35 $this->webdav_settings = $webdav_settings;
39 $this->rbacsystem = $rbacsystem;
40 $this->
error = $error;
43 $this->toolbar = $toolbar;
44 $this->http_state = $http_state;
45 $this->ui_factory = $ui_factory;
46 $this->ui_renderer = $ui_renderer;
47 $this->file_systems = $file_systems;
48 $this->file_upload = $file_upload;
49 $this->mount_instructions_repository = $mount_instructions_repository;
57 $cmd = $this->ctrl->getCmd();
59 if (!$this->rbacsystem->checkAccess(
'read', $this->webdav_settings->getRefId())) {
60 $this->
error->raiseError($this->lng->txt(
'permission_denied'), $this->error->MESSAGE);
63 if ($cmd ==
'delete') {
66 if ($cmd ==
'' || !method_exists($this, $cmd)) {
67 $cmd =
'showDocuments';
77 if ($this->rbacsystem->checkAccess(
'write', $this->webdav_settings->getRefId())) {
79 $addDocumentBtn->setPrimary(
true);
80 $addDocumentBtn->setUrl($this->ctrl->getLinkTarget($this,
'showAddDocumentForm'));
81 $addDocumentBtn->setCaption(
'webdav_add_instructions_btn_label');
82 $this->toolbar->addStickyItem($addDocumentBtn);
93 $this->rbacsystem->checkAccess(
'write', $this->webdav_settings->getRefId())
96 $document_tbl_gui->populate();
98 $this->tpl->setContent($document_tbl_gui->getHTML());
107 if ($a_document->
getId() > 0) {
108 $this->ctrl->setParameter($this,
'doc_id', $a_document->
getId());
110 $form_action = $this->ctrl->getFormAction($this, self::ACTION_SAVE_EDIT_DOCUMENT_FORM);
113 $form_action = $this->ctrl->getFormAction($this, self::ACTION_SAVE_ADD_DOCUMENT_FORM);
119 $this->mount_instructions_repository,
122 $this->file_systems->temp(),
127 $this->rbacsystem->checkAccess(
'write', $this->webdav_settings->getRefId())
135 if (!$this->rbacsystem->checkAccess(
'write', $this->webdav_settings->getRefId())) {
136 $this->
error->raiseError($this->lng->txt(
'permission_denied'), $this->error->MESSAGE);
140 $this->tpl->setContent($form->getHTML());
145 if (!$this->rbacsystem->checkAccess(
'write', $this->webdav_settings->getRefId())) {
146 $this->
error->raiseError($this->lng->txt(
'permission_denied'), $this->error->MESSAGE);
149 $document_id = $_REQUEST[
'webdav_id'];
150 $document = $this->mount_instructions_repository->getMountInstructionsDocumentById($document_id);
152 $this->tpl->setContent($form->getHTML());
160 if (!$this->rbacsystem->checkAccess(
'write', $this->webdav_settings->getRefId())) {
161 $this->
error->raiseError($this->lng->txt(
'permission_denied'), $this->error->MESSAGE);
165 if ($form->saveObject()) {
166 ilUtil::sendSuccess($this->lng->txt(
'saved_successfully'),
true);
167 if ($form->hasTranslatedInfo()) {
170 $this->ctrl->redirect($this,
'showDocuments');
171 } elseif ($form->hasTranslatedError()) {
175 $html = $form->getHTML();
176 $this->tpl->setContent($html);
184 if (!$this->rbacsystem->checkAccess(
'write', $this->webdav_settings->getRefId())) {
185 $this->
error->raiseError($this->lng->txt(
'permission_denied'), $this->error->MESSAGE);
189 if ($form->updateObject()) {
190 ilUtil::sendSuccess($this->lng->txt(
'saved_successfully'),
true);
191 if ($form->hasTranslatedInfo()) {
194 $this->ctrl->redirect($this,
'showDocuments');
195 } elseif ($form->hasTranslatedError()) {
199 $html = $form->getHTML();
200 $this->tpl->setContent($html);
205 return $this->httpState->request() - getParsedBody()[
'instructions_id'] ?? [];
210 if (!$this->rbacsystem->checkAccess(
'delete', $this->webdav_settings->getRefId())) {
211 $this->
error->raiseError($this->lng->txt(
'permission_denied'), $this->error->MESSAGE);
213 $webdav_id = $_REQUEST[
'webdav_id'];
214 $this->mount_instructions_repository->deleteMountInstructionsById($webdav_id);
215 ilUtil::sendSuccess($this->lng->txt(
'deleted_successfully'),
true);
216 $this->ctrl->redirect($this,
'showDocuments');
222 if (!$this->rbacsystem->checkAccess(
'write', $this->webdav_settings->getRefId())) {
223 $this->
error->raiseError($this->lng->txt(
'permission_denied'), $this->error->MESSAGE);
226 $sorting = $this->http_state->request()->getParsedBody()[
'sorting'] ?? [];
227 if (!is_array($sorting) || 0 === count($sorting)) {
233 asort($sorting, SORT_NUMERIC);
236 foreach ($sorting as $document_id => $ignored_sort_value) {
239 if (!is_numeric($document_id)) {
243 $this->mount_instructions_repository->updateSortingValueById((
int) $document_id, ++$position);
246 ilUtil::sendSuccess($this->lng->txt(
'webdav_saved_sorting'),
true);
247 $this->ctrl->redirect($this);
An exception for terminatinating execution or to throw for unit testing.
error($a_errmsg)
set error message @access public
This class provides processing control methods.
Class ilGlobalPageTemplate.
Component logger with individual log levels by component id.
class ilRbacSystem system function like checkAccess, addActiveRole ... Supporting system functions ar...
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
__construct(ilObjWebDAV $webdav_settings, ilGlobalPageTemplate $tpl, ilObjUser $user, ilCtrl $ctrl, ilLanguage $lng, ilRbacSystem $rbacsystem, ilErrorHandling $error, ilLogger $log, ilToolbarGUI $toolbar, GlobalHttpState $http_state, Factory $ui_factory, Renderer $ui_renderer, Filesystems $file_systems, FileUpload $file_upload, ilWebDAVMountInstructionsRepository $mount_instructions_repository)
const ACTION_SAVE_ADD_DOCUMENT_FORM
getDocumentByServerRequest()
getDocumentForm(ilWebDAVMountInstructionsDocument $a_document)
const ACTION_SAVE_EDIT_DOCUMENT_FORM
Class Filesystems The Filesystems interface defines the access methods which can be used to fetch the...
Interface GlobalHttpState.
This is how the factory for UI elements looks.
An entity that renders components to a string output.
Interface ilWebDAVMountInstructionsRepository.
if($DIC->http() ->request() ->getMethod()=="GET" &&isset($DIC->http() ->request() ->getQueryParams()['tex'])) $tpl