19declare(strict_types=1);
33 'edit' =>
'editSettings',
34 'save' =>
'saveSettings'
40 public function __construct(?array $a_data,
int $a_id,
bool $a_call_by_reference)
44 $this->webdav_dic->init(
$DIC);
53 $next_class = $this->
ctrl->getNextClass($this);
54 $cmd = $this->
ctrl->getCmd();
58 if (!$this->
access->checkAccess(
'read',
'', $this->object->getRefId())) {
59 $this->error_handling->raiseError(
60 $this->
lng->txt(
'no_permission'),
61 $this->error_handling->MESSAGE
65 switch ($next_class) {
66 case strtolower(UploadGUI::class):
67 $document_gui = $this->webdav_dic->mountinstructions_upload();
68 $document_gui->setRefId($this->
object->getRefId());
69 $this->tabs_gui->activateTab(
'webdav_upload_instructions');
70 $this->
ctrl->forwardCommand($document_gui);
74 if (!$cmd || $cmd ===
'view' || !in_array($cmd, self::SETTING_COMMANDS)) {
75 $cmd = self::SETTING_COMMANDS[
'edit'];
85 if ($this->rbac_system->checkAccess(
"read", $this->object->getRefId())) {
86 $this->tabs_gui->addTab(
87 'webdav_general_settings',
88 $this->
lng->txt(
"webdav_general_settings"),
89 $this->ctrl->getLinkTarget($this, self::SETTING_COMMANDS[
'edit'])
91 $this->tabs_gui->addTab(
92 'webdav_upload_instructions',
93 $this->
lng->txt(
"webdav_upload_instructions"),
94 $this->ctrl->getLinkTargetByClass(UploadGUI::class)
102 parent::setTitleAndDescription();
103 $this->tpl->setDescription($this->
object->getDescription());
109 $form->setFormAction($this->
ctrl->getFormAction($this));
110 $form->setTitle($this->
lng->txt(
"settings"));
113 $cb_prop->setInfo($this->
lng->txt(
"enable_webdav_info"));
114 $cb_prop->setValue(
'1');
115 $cb_prop->setChecked($this->
object->isWebdavEnabled());
116 $form->addItem($cb_prop);
118 $cb_prop =
new ilCheckboxInputGUI($this->
lng->txt(
"webdav_enable_versioning"),
"enable_versioning_webdav");
119 $cb_prop->setValue(
'1');
120 $cb_prop->setInfo($this->
lng->txt(
"webdav_versioning_info"));
121 $cb_prop->setChecked($this->
object->isWebdavVersioningEnabled());
122 $form->addItem($cb_prop);
124 $form->addCommandButton(self::SETTING_COMMANDS[
'save'], $this->
lng->txt(
'save'));
131 $this->tabs_gui->activateTab(
'webdav_general_settings');
133 if (!$this->rbac_system->checkAccess(
"read", $this->object->getRefId())) {
134 $this->error_handling->raiseError(
135 $this->
lng->txt(
"no_permission"),
136 $this->error_handling->WARNING
142 $this->tpl->setContent($form->getHTML());
147 if (!$this->rbac_system->checkAccess(
"write", $this->object->getRefId())) {
148 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'no_permission'),
true);
149 $this->
ctrl->redirect($this, self::SETTING_COMMANDS[
'edit']);
153 if ($form->checkInput()) {
154 $this->
object->setWebdavEnabled(($form->getInput(
'enable_webdav') ===
'1'));
155 $this->
object->setWebdavVersioningEnabled(($form->getInput(
'enable_versioning_webdav') ===
'1'));
156 $this->
object->update();
157 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'settings_saved'),
true);
158 $this->
ctrl->redirect($this, self::SETTING_COMMANDS[
'edit']);
160 $form->setValuesByPost();
161 $this->tpl->setContent($form->getHTML());
@ilCtrl_isCalledBy ILIAS\WebDAV\Mount\UploadGUI: ilObjWebDAVGUI
Error Handling & global info handling.
getAdminTabs()
administration tabs show only permissions and trash folder
ilErrorHandling $error_handling
__construct(?array $a_data, int $a_id, bool $a_call_by_reference)
Class ilObjectGUI Basic methods of all Output classes.
prepareOutput(bool $show_sub_objects=true)
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc