19 declare(strict_types=1);
31 'edit' =>
'editSettings',
32 'save' =>
'saveSettings' 38 public function __construct(?array $a_data,
int $a_id,
bool $a_call_by_reference)
42 $this->webdav_dic->init($DIC);
50 $next_class = $this->
ctrl->getNextClass($this);
51 $cmd = $this->
ctrl->getCmd();
55 if (!$this->
access->checkAccess(
'read',
'', $this->object->getRefId())) {
56 $this->error_handling->raiseError(
57 $this->
lng->txt(
'no_permission'),
58 $this->error_handling->MESSAGE
62 switch ($next_class) {
63 case strtolower(ilWebDAVMountInstructionsUploadGUI::class):
64 $document_gui = $this->webdav_dic->mountinstructions_upload();
65 $document_gui->setRefId($this->
object->getRefId());
66 $this->tabs_gui->activateTab(
'webdav_upload_instructions');
67 $this->
ctrl->forwardCommand($document_gui);
71 if (!$cmd || $cmd ===
'view' || !in_array($cmd, self::SETTING_COMMANDS)) {
72 $cmd = self::SETTING_COMMANDS[
'edit'];
81 if ($this->rbac_system->checkAccess(
"visible,read", $this->object->getRefId())) {
82 $this->tabs_gui->addTab(
83 'webdav_general_settings',
84 $this->
lng->txt(
"webdav_general_settings"),
85 $this->
ctrl->getLinkTarget($this, self::SETTING_COMMANDS[
'edit'])
87 $this->tabs_gui->addTab(
88 'webdav_upload_instructions',
89 $this->
lng->txt(
"webdav_upload_instructions"),
90 $this->
ctrl->getLinkTargetByClass(ilWebDAVMountInstructionsUploadGUI::class)
97 parent::setTitleAndDescription();
98 $this->tpl->setDescription($this->
object->getDescription());
104 $form->setFormAction($this->
ctrl->getFormAction($this));
105 $form->setTitle($this->
lng->txt(
"settings"));
108 $cb_prop->setValue(
'1');
109 $cb_prop->setChecked($this->
object->isWebdavEnabled());
110 $form->addItem($cb_prop);
112 $cb_prop =
new ilCheckboxInputGUI($this->
lng->txt(
"webdav_enable_versioning"),
"enable_versioning_webdav");
113 $cb_prop->setValue(
'1');
114 $cb_prop->setInfo($this->
lng->txt(
"webdav_versioning_info"));
115 $cb_prop->setChecked($this->
object->isWebdavVersioningEnabled());
116 $form->addItem($cb_prop);
118 $form->addCommandButton(self::SETTING_COMMANDS[
'save'], $this->
lng->txt(
'save'));
125 $this->tabs_gui->activateTab(
'webdav_general_settings');
127 if (!$this->rbac_system->checkAccess(
"visible,read", $this->object->getRefId())) {
128 $this->error_handling->raiseError(
129 $this->
lng->txt(
"no_permission"),
130 $this->error_handling->WARNING
136 $this->tpl->setContent($form->getHTML());
141 if (!$this->rbac_system->checkAccess(
"write", $this->object->getRefId())) {
142 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'no_permission'),
true);
143 $this->
ctrl->redirect($this, self::SETTING_COMMANDS[
'edit']);
147 if ($form->checkInput()) {
148 $this->
object->setWebdavEnabled(($form->getInput(
'enable_webdav') ===
'1'));
149 $this->
object->setWebdavVersioningEnabled(($form->getInput(
'enable_versioning_webdav') ===
'1'));
150 $this->
object->update();
151 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'settings_saved'),
true);
152 $this->
ctrl->redirect($this, self::SETTING_COMMANDS[
'edit']);
154 $form->setValuesByPost();
155 $this->tpl->setContent($form->getHTML());
ilErrorHandling $error_handling
const ilWebDAVDIC $webdav_dic
prepareOutput(bool $show_sub_objects=true)
Class ilObjectGUI Basic methods of all Output classes.
__construct(Container $dic, ilPlugin $plugin)
__construct(?array $a_data, int $a_id, bool $a_call_by_reference)