3 declare(strict_types=1);
31 'edit' =>
'editSettings',
32 'save' =>
'saveSettings'];
37 public function __construct(?array $a_data,
int $a_id,
bool $a_call_by_reference)
41 $this->webdav_dic->init($DIC);
49 $next_class = $this->
ctrl->getNextClass($this);
50 $cmd = $this->
ctrl->getCmd();
54 if (!$this->
access->checkAccess(
'read',
'', $this->object->getRefId())) {
55 $this->error_handling->raiseError(
56 $this->
lng->txt(
'no_permission'),
57 $this->error_handling->MESSAGE
61 switch ($next_class) {
62 case strtolower(ilWebDAVMountInstructionsUploadGUI::class):
63 $document_gui = $this->webdav_dic->mountinstructions_upload();
64 $document_gui->setRefId($this->
object->getRefId());
65 $this->tabs_gui->activateTab(
'webdav_upload_instructions');
66 $this->
ctrl->forwardCommand($document_gui);
70 if (!$cmd || $cmd ===
'view' || !in_array($cmd, self::SETTING_COMMANDS)) {
71 $cmd = self::SETTING_COMMANDS[
'edit'];
80 if ($this->rbac_system->checkAccess(
"visible,read", $this->object->getRefId())) {
81 $this->tabs_gui->addTab(
82 'webdav_general_settings',
83 $this->
lng->txt(
"webdav_general_settings"),
84 $this->
ctrl->getLinkTarget($this, self::SETTING_COMMANDS[
'edit'])
86 $this->tabs_gui->addTab(
87 'webdav_upload_instructions',
88 $this->
lng->txt(
"webdav_upload_instructions"),
89 $this->
ctrl->getLinkTargetByClass(ilWebDAVMountInstructionsUploadGUI::class)
96 parent::setTitleAndDescription();
97 $this->tpl->setDescription($this->
object->getDescription());
104 $form->setFormAction($this->
ctrl->getFormAction($this));
105 $form->setTitle($this->
lng->txt(
"settings"));
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");
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.
Error Handling & global info handling uses PEAR error class.
__construct(Container $dic, ilPlugin $plugin)
__construct(?array $a_data, int $a_id, bool $a_call_by_reference)