19declare(strict_types=1);
59 $this->
tabs = $DIC[
'ilTabs'];
60 $this->
lng = $DIC->language();
61 $this->
lng->loadLanguageModule(
'adn');
62 $this->
lng->loadLanguageModule(
'irss');
63 $this->
lng->loadLanguageModule(
'wopi');
64 $this->
ctrl = $DIC[
'ilCtrl'];
65 $this->tpl =
$DIC[
'tpl'];
66 $this->tree =
$DIC[
'tree'];
68 $this->error_handling =
$DIC[
"ilErr"];
69 $this->ref_id = $this->request_wrapper->retrieve(
'ref_id',
$DIC->refinery()->kindlyTo()->int());
71 $this->file_service_settings =
$DIC->fileServiceSettings();
82 $this->error_handling->raiseError(
83 $this->
lng->txt(
'no_permission'),
91 return $this->
access->checkAccess($str,
'', $this->ref_id);
101 $this->
lng->loadLanguageModule(
"fils");
103 $next_class = $this->
ctrl->getNextClass($this);
104 $cmd = $this->
ctrl->getCmd();
109 switch ($next_class) {
110 case strtolower(ilPermissionGUI::class):
111 $this->tabs_gui->activateTab(self::TAB_PERMISSIONS);
113 $this->
ctrl->forwardCommand($perm_gui);
115 case strtolower(ilResourceOverviewGUI::class):
116 $this->tabs_gui->activateTab(self::TAB_OVERVIEW);
118 $this->
ctrl->forwardCommand($overview);
120 case strtolower(ilUploadLimitsOverviewGUI::class):
121 $this->tabs_gui->activateTab(self::TAB_UPLOAD_LIMITS);
123 $this->
ctrl->forwardCommand($limits_gui);
125 case strtolower(ilWOPIAdministrationGUI::class):
126 $this->tabs_gui->activateTab(self::TAB_WOPI);
128 $this->
ctrl->forwardCommand($wopi_gui);
131 if (!$cmd || $cmd ===
'view') {
146 if ($this->rbac_system->checkAccess(
148 $this->object->getRefId()
151 $this->tabs_gui->addTab(
153 $this->
lng->txt(self::TAB_SETTINGS),
154 $this->ctrl->getLinkTarget($this, self::CMD_EDIT_SETTINGS)
158 if ($this->rbac_system->checkAccess(
160 $this->object->getRefId()
163 $this->tabs_gui->addTab(
165 $this->
lng->txt(self::TAB_OVERVIEW),
166 $this->ctrl->getLinkTargetByClass(ilResourceOverviewGUI::class),
170 if ($this->rbac_system->checkAccess(
172 $this->object->getRefId()
175 $this->tabs_gui->addTab(
176 self::TAB_UPLOAD_LIMITS,
177 $this->
lng->txt(self::TAB_UPLOAD_LIMITS),
178 $this->ctrl->getLinkTargetByClass(ilUploadLimitsOverviewGUI::class),
182 if ($this->rbac_system->checkAccess(
184 $this->object->getRefId()
187 $this->tabs_gui->addTab(
189 $this->
lng->txt(self::TAB_WOPI),
190 $this->ctrl->getLinkTargetByClass(ilWOPIAdministrationGUI::class),
195 if ($this->rbac_system->checkAccess(
197 $this->object->getRefId()
200 $this->tabs_gui->addTab(
201 self::TAB_PERMISSIONS,
202 $this->
lng->txt(self::TAB_PERMISSIONS),
203 $this->ctrl->getLinkTargetByClass(ilPermissionGUI::class,
"perm")
211 parent::setTitleAndDescription();
212 $this->tpl->setDescription($this->
object->getDescription());
220 $form->setFormAction($this->
ctrl->getFormAction($this));
221 $form->setTitle($this->
lng->txt(self::TAB_SETTINGS));
225 $ne->setValue(implode(
", ", $this->file_service_settings->getDefaultWhitelist()));
226 $ne->setInfo($this->
lng->txt(
"file_suffix_default_positive_info"));
232 "file_suffix_custom_negative"
234 "suffix_repl_additional"
236 $ta->setInfo($this->
lng->txt(
"file_suffix_custom_negative_info"));
238 $ta->setDisabled(!$permission_to_write);
244 "file_suffix_custom_positive"
246 "suffix_custom_white_list"
248 $ta->setInfo($this->
lng->txt(
"file_suffix_custom_positive_info"));
250 $ta->setDisabled(!$permission_to_write);
255 $ne->setValue(implode(
", ", $this->file_service_settings->getWhiteListedSuffixes()));
256 $ne->setInfo($this->
lng->txt(
"file_suffix_overall_positive_info"));
261 $this->
lng->txt(
"file_suffix_custom_expl_negative"),
262 "suffix_custom_expl_black"
264 $ta->setInfo($this->
lng->txt(
"file_suffix_custom_expl_negative_info"));
266 $ta->setDisabled(!$permission_to_write);
270 if ($permission_to_write) {
271 $form->addCommandButton(
'saveSettings', $this->
lng->txt(
'save'));
272 $form->addCommandButton(
'view', $this->
lng->txt(
'cancel'));
280 $this->tabs_gui->setTabActive(self::TAB_SETTINGS);
289 $val[
"suffix_repl_additional"] = implode(
", ", $this->file_service_settings->getWhiteListNegative());
290 $val[
"suffix_custom_white_list"] = implode(
", ", $this->file_service_settings->getWhiteListPositive());
291 $val[
"suffix_custom_expl_black"] = implode(
", ", $this->file_service_settings->getProhibited());
292 $form->setValuesByArray($val);
295 $this->tpl->setContent($form->getHTML());
304 if ($form->checkInput()) {
305 $trafo = (fn(
string $id): ?
string => $this->post_wrapper->has(
$id)
306 ? $this->post_wrapper->retrieve(
$id, $this->
refinery->to()->string())
310 $this->
settings->set(
"suffix_repl_additional", $trafo(
"suffix_repl_additional"));
311 $this->
settings->set(
"suffix_custom_white_list", $trafo(
"suffix_custom_white_list"));
312 $this->
settings->set(
"suffix_custom_expl_black", $trafo(
"suffix_custom_expl_black"));
314 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'settings_saved'),
true);
315 $this->
ctrl->redirect($this, self::CMD_EDIT_SETTINGS);
317 $form->setValuesByPost();
318 $this->tpl->setContent($form->getHTML());
Class ilCtrl provides processing control methods.
Error Handling & global info handling.
This class represents a non editable value in a property form.
Class ilObjFileServicesGUI.
checkPermissionOrFail(string $str)
executeCommand()
Execute command @access public.
ilGlobalTemplateInterface $tpl
ilFileServicesSettings $file_service_settings
__construct(int $id=0, int $id_type=self::REPOSITORY_NODE_ID, int $parent_node_id=0)
Constructor @access public.
getType()
Functions that must be overwritten.
ilErrorHandling $error_handling
hasUserPermissionTo(string $str)
New implementation of ilObjectGUI.
prepareOutput(bool $show_sub_objects=true)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This class represents a text area property in a property form.
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc