3declare(strict_types=1);
81 $this->ui_factory = $ui->
factory();
82 $this->ui_renderer = $ui->
renderer();
87 $this->
lng->loadLanguageModule(
'meta');
95 $cmd = $this->
ctrl->getCmd();
97 if (!$this->rbacsystem->checkAccess(
'read', $this->webdav_object_ref_id)) {
98 $this->
error->raiseError($this->
lng->txt(
'permission_denied'), $this->error->MESSAGE);
101 if ($cmd ==
'delete') {
104 if ($cmd ==
'' || !method_exists($this, $cmd)) {
105 $cmd =
'showDocuments';
112 $this->webdav_object_ref_id =
$ref_id;
120 if ($this->rbacsystem->checkAccess(
'write', $this->webdav_object_ref_id)) {
122 $addDocumentBtn->setPrimary(
true);
123 $addDocumentBtn->setUrl($this->
ctrl->getLinkTarget($this,
'showAddDocumentForm'));
124 $addDocumentBtn->setCaption(
'webdav_add_instructions_btn_label');
125 $this->
toolbar->addStickyItem($addDocumentBtn);
136 $this->
http->request(),
137 $this->rbacsystem->checkAccess(
'write', $this->webdav_object_ref_id)
140 $document_tbl_gui->populate();
142 $this->tpl->setContent($document_tbl_gui->getHTML());
147 if ($a_document->
getId() > 0) {
148 $this->
ctrl->setParameter($this,
'doc_id', $a_document->
getId());
150 $form_action = $this->
ctrl->getFormAction($this, self::ACTION_SAVE_EDIT_DOCUMENT_FORM);
153 $form_action = $this->
ctrl->getFormAction($this, self::ACTION_SAVE_ADD_DOCUMENT_FORM);
159 $this->mount_instructions_repository,
162 $this->file_systems->temp(),
167 $this->rbacsystem->checkAccess(
'write', $this->webdav_object_ref_id)
175 if (!$this->rbacsystem->checkAccess(
'write', $this->webdav_object_ref_id)) {
176 $this->
error->raiseError($this->
lng->txt(
'permission_denied'), $this->error->MESSAGE);
180 $this->tpl->setContent($form->getHTML());
185 if (!$this->rbacsystem->checkAccess(
'write', $this->webdav_object_ref_id)) {
186 $this->
error->raiseError($this->
lng->txt(
'permission_denied'), $this->error->MESSAGE);
189 $document_id = $this->
http->wrapper()->query()->retrieve(
'document_id', $this->
refinery->kindlyTo()->int());
190 $document = $this->mount_instructions_repository->getMountInstructionsDocumentById($document_id);
192 $this->tpl->setContent($form->getHTML());
200 if (!$this->rbacsystem->checkAccess(
'write', $this->webdav_object_ref_id)) {
201 $this->
error->raiseError($this->
lng->txt(
'permission_denied'), $this->error->MESSAGE);
205 if ($form->saveObject()) {
206 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'saved_successfully'),
true);
207 if ($form->hasTranslatedInfo()) {
208 $this->tpl->setOnScreenMessage(
'info', $form->getTranslatedInfo(),
true);
210 $this->
ctrl->redirect($this,
'showDocuments');
211 } elseif ($form->hasTranslatedError()) {
212 $this->tpl->setOnScreenMessage(
'failure', $form->getTranslatedError(),
true);
215 $html = $form->getHTML();
216 $this->tpl->setContent($html);
224 if (!$this->rbacsystem->checkAccess(
'write', $this->webdav_object_ref_id)) {
225 $this->
error->raiseError($this->
lng->txt(
'permission_denied'), $this->error->MESSAGE);
228 $document_id = $this->
http->wrapper()->query()->retrieve(
'document_id', $this->
refinery->kindlyTo()->int());
229 $form = $this->
getDocumentForm($this->mount_instructions_repository->getMountInstructionsDocumentById($document_id));
230 if ($form->updateObject()) {
231 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'saved_successfully'),
true);
232 if ($form->hasTranslatedInfo()) {
233 $this->tpl->setOnScreenMessage(
'info', $form->getTranslatedInfo(),
true);
235 $this->
ctrl->redirect($this,
'showDocuments');
236 } elseif ($form->hasTranslatedError()) {
237 $this->tpl->setOnScreenMessage(
'failure', $form->getTranslatedError(),
true);
240 $html = $form->getHTML();
241 $this->tpl->setContent($html);
246 if (!$this->rbacsystem->checkAccess(
'delete', $this->webdav_object_ref_id)) {
247 $this->
error->raiseError($this->
lng->txt(
'permission_denied'), $this->error->MESSAGE);
250 $document_id = $this->
http->wrapper()->query()->retrieve(
'document_id', $this->
refinery->kindlyTo()->int());
252 $this->mount_instructions_repository->deleteMountInstructionsById($document_id);
253 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'deleted_successfully'),
true);
254 $this->
ctrl->redirect($this,
'showDocuments');
259 if (!$this->rbacsystem->checkAccess(
'write', $this->webdav_object_ref_id)) {
260 $this->
error->raiseError($this->
lng->txt(
'permission_denied'), $this->error->MESSAGE);
263 $sorting = $this->
http->request()->getParsedBody()[
'sorting'] ?? [];
264 if (!is_array($sorting) || 0 === count($sorting)) {
270 asort($sorting, SORT_NUMERIC);
273 foreach ($sorting as $document_id => $ignored_sort_value) {
276 if (!is_numeric($document_id)) {
280 $this->mount_instructions_repository->updateSortingValueById((
int) $document_id, ++$position);
283 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'webdav_saved_sorting'),
true);
284 $this->
ctrl->redirect($this);
Provides fluid interface to RBAC services.
renderer()
Get a renderer for UI components.
factory()
Get the factory that crafts UI components.
Error Handling & global info handling uses PEAR error class.
Component logger with individual log levels by component id.
class ilRbacSystem system function like checkAccess, addActiveRole ... Supporting system functions ar...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
int $webdav_object_ref_id
const ACTION_SAVE_ADD_DOCUMENT_FORM
ilWebDAVMountInstructionsRepository $mount_instructions_repository
getDocumentForm(ilWebDAVMountInstructionsDocument $a_document)
ilGlobalTemplateInterface $tpl
const ACTION_SAVE_EDIT_DOCUMENT_FORM
__construct(ilGlobalTemplateInterface $tpl, ilObjUser $user, ilCtrlInterface $ctrl, ilLanguage $lng, ilRbacSystem $rbacsystem, ilErrorHandling $error, ilLogger $log, ilToolbarGUI $toolbar, Services $http, RefineryFactory $refinery, UIServices $ui, Filesystems $file_systems, FileUpload $file_upload, ilWebDAVMountInstructionsRepository $mount_instructions_repository)
Filesystems $file_systems
RefineryFactory $refinery
This is how the factory for UI elements looks.
An entity that renders components to a string output.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static http()
Fetches the global http state from ILIAS.