35 $this->file_access_settings = $file_access_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->file_access_settings->getRefId())) {
60 $this->error->raiseError($this->lng->txt(
'permission_denied'), $this->error->MESSAGE);
63 if ($cmd ==
'' || !method_exists($this, $cmd)) {
64 $cmd =
'showDocuments';
74 if ($this->rbacsystem->checkAccess(
'write', $this->file_access_settings->getRefId())) {
76 $addDocumentBtn->setPrimary(
true);
77 $addDocumentBtn->setUrl($this->ctrl->getLinkTarget($this,
'showAddDocumentForm'));
78 $addDocumentBtn->setCaption(
'webdav_add_instructions_btn_label');
79 $this->toolbar->addStickyItem($addDocumentBtn);
90 $this->rbacsystem->checkAccess(
'write', $this->file_access_settings->getRefId())
93 $document_tbl_gui->populate();
95 $this->tpl->setContent($document_tbl_gui->getHTML());
104 if ($a_document->
getId() > 0) {
105 $this->ctrl->setParameter($this,
'doc_id', $a_document->
getId());
107 $form_action = $this->ctrl->getFormAction($this, self::ACTION_SAVE_EDIT_DOCUMENT_FORM);
108 $save_command = self::ACTION_SAVE_EDIT_DOCUMENT_FORM;
110 $form_action = $this->ctrl->getFormAction($this, self::ACTION_SAVE_ADD_DOCUMENT_FORM);
111 $save_command = self::ACTION_SAVE_ADD_DOCUMENT_FORM;
116 $this->mount_instructions_repository,
119 $this->file_systems->temp(),
124 $this->rbacsystem->checkAccess(
'write', $this->file_access_settings->getRefId())
132 if (!$this->rbacsystem->checkAccess(
'write', $this->file_access_settings->getRefId())) {
133 $this->error->raiseError($this->lng->txt(
'permission_denied'), $this->error->MESSAGE);
137 $this->tpl->setContent($form->getHTML());
142 if (!$this->rbacsystem->checkAccess(
'write', $this->file_access_settings->getRefId())) {
143 $this->error->raiseError($this->lng->txt(
'permission_denied'), $this->error->MESSAGE);
146 $document_id = $_REQUEST[
'webdav_id'];
147 $document = $this->mount_instructions_repository->getMountInstructionsDocumentById($document_id);
149 $this->tpl->setContent($form->getHTML());
157 if (!$this->rbacsystem->checkAccess(
'write', $this->file_access_settings->getRefId())) {
158 $this->error->raiseError($this->lng->txt(
'permission_denied'), $this->error->MESSAGE);
162 if ($form->saveObject()) {
163 ilUtil::sendSuccess($this->lng->txt(
'saved_successfully'),
true);
164 if ($form->hasTranslatedInfo()) {
167 $this->ctrl->redirect($this,
'showDocuments');
168 } elseif ($form->hasTranslatedError()) {
172 $html = $form->getHTML();
173 $this->tpl->setContent($html);
181 if (!$this->rbacsystem->checkAccess(
'write', $this->file_access_settings->getRefId())) {
182 $this->error->raiseError($this->lng->txt(
'permission_denied'), $this->error->MESSAGE);
186 if ($form->updateObject()) {
187 ilUtil::sendSuccess($this->lng->txt(
'saved_successfully'),
true);
188 if ($form->hasTranslatedInfo()) {
191 $this->ctrl->redirect($this,
'showDocuments');
192 } elseif ($form->hasTranslatedError()) {
196 $html = $form->getHTML();
197 $this->tpl->setContent($html);
202 return $this->httpState->request() - getParsedBody()[
'instructions_id'] ?? [];
207 if (!$this->rbacsystem->checkAccess(
'delete', $this->file_access_settings->getRefId())) {
208 $this->error->raiseError($this->lng->txt(
'permission_denied'), $this->error->MESSAGE);
210 $webdav_id = $_REQUEST[
'webdav_id'];
211 $this->mount_instructions_repository->deleteMountInstructionsById($webdav_id);
212 ilUtil::sendSuccess($this->lng->txt(
'deleted_successfully'),
true);
213 $this->ctrl->redirect($this,
'showDocuments');
219 if (!$this->rbacsystem->checkAccess(
'write', $this->file_access_settings->getRefId())) {
220 $this->error->raiseError($this->lng->txt(
'permission_denied'), $this->error->MESSAGE);
223 $sorting = $this->http_state->request()->getParsedBody()[
'sorting'] ?? [];
224 if (!is_array($sorting) || 0 === count($sorting)) {
230 asort($sorting, SORT_NUMERIC);
233 foreach ($sorting as $document_id => $ignored_sort_value) {
236 if (!is_numeric($document_id)) {
240 $this->mount_instructions_repository->updateSortingValueById((
int) $document_id, ++$position);
243 ilUtil::sendSuccess($this->lng->txt(
'webdav_saved_sorting'),
true);
244 $this->ctrl->redirect($this);
Interface GlobalHttpState.
An entity that renders components to a string output.
This class provides processing control methods.
__construct(ilObjFileAccessSettings $file_access_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)
class ilRbacSystem system function like checkAccess, addActiveRole ...
if(isset($_FILES['img_file']['size']) && $_FILES['img_file']['size'] > 0) $tpl
getDocumentByServerRequest()
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
getDocumentForm(ilWebDAVMountInstructionsDocument $a_document)
Interface ilWebDAVMountInstructionsRepository.
Class ilGlobalPageTemplate.
This is how the factory for UI elements looks.
const ACTION_SAVE_ADD_DOCUMENT_FORM
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
const ACTION_SAVE_EDIT_DOCUMENT_FORM
Component logger with individual log levels by component id.