19 declare(strict_types=1);
58 $this->
tabs = $DIC[
'ilTabs'];
59 $this->
lng = $DIC->language();
60 $this->
lng->loadLanguageModule(
'adn');
61 $this->
lng->loadLanguageModule(
'irss');
62 $this->
ctrl = $DIC[
'ilCtrl'];
63 $this->tpl = $DIC[
'tpl'];
64 $this->tree = $DIC[
'tree'];
66 $this->error_handling = $DIC[
"ilErr"];
67 $this->ref_id = $this->request_wrapper->retrieve(
'ref_id', $DIC->refinery()->kindlyTo()->int());
69 $this->file_service_settings = $DIC->fileServiceSettings();
80 $this->error_handling->raiseError(
81 $this->
lng->txt(
'no_permission'),
89 return $this->
access->checkAccess($str,
'', $this->ref_id);
99 $this->
lng->loadLanguageModule(
"fils");
101 $next_class = $this->
ctrl->getNextClass($this);
102 $cmd = $this->
ctrl->getCmd();
107 switch ($next_class) {
108 case strtolower(ilPermissionGUI::class):
109 $this->tabs_gui->activateTab(self::TAB_PERMISSIONS);
111 $this->
ctrl->forwardCommand($perm_gui);
113 case strtolower(ilResourceOverviewGUI::class):
114 $this->tabs_gui->activateTab(self::TAB_OVERVIEW);
116 $this->
ctrl->forwardCommand($overview);
118 case strtolower(ilUploadLimitsOverviewGUI::class):
119 $this->tabs_gui->activateTab(self::TAB_UPLOAD_LIMITS);
121 $this->
ctrl->forwardCommand($limits_gui);
124 if (!$cmd || $cmd ===
'view') {
125 $cmd = self::CMD_EDIT_SETTINGS;
139 if ($this->rbac_system->checkAccess(
141 $this->object->getRefId()
144 $this->tabs_gui->addTab(
146 $this->
lng->txt(self::TAB_SETTINGS),
147 $this->
ctrl->getLinkTarget($this, self::CMD_EDIT_SETTINGS)
151 if ($this->rbac_system->checkAccess(
153 $this->object->getRefId()
156 $this->tabs_gui->addTab(
158 $this->
lng->txt(self::TAB_OVERVIEW),
159 $this->
ctrl->getLinkTargetByClass(ilResourceOverviewGUI::class),
163 if ($this->rbac_system->checkAccess(
165 $this->object->getRefId()
168 $this->tabs_gui->addTab(
169 self::TAB_UPLOAD_LIMITS,
170 $this->
lng->txt(self::TAB_UPLOAD_LIMITS),
171 $this->
ctrl->getLinkTargetByClass(ilUploadLimitsOverviewGUI::class),
175 if ($this->rbac_system->checkAccess(
177 $this->object->getRefId()
180 $this->tabs_gui->addTab(
181 self::TAB_PERMISSIONS,
182 $this->
lng->txt(self::TAB_PERMISSIONS),
183 $this->
ctrl->getLinkTargetByClass(ilPermissionGUI::class,
"perm")
191 parent::setTitleAndDescription();
192 $this->tpl->setDescription($this->
object->getDescription());
200 $form->setFormAction($this->
ctrl->getFormAction($this));
201 $form->setTitle($this->
lng->txt(self::TAB_SETTINGS));
205 $ne->setValue(implode(
", ", $this->file_service_settings->getDefaultWhitelist()));
206 $ne->setInfo($this->
lng->txt(
"file_suffix_default_positive_info"));
212 "file_suffix_custom_negative" 214 "suffix_repl_additional" 216 $ta->
setInfo($this->
lng->txt(
"file_suffix_custom_negative_info"));
218 $ta->setDisabled(!$permission_to_write);
224 "file_suffix_custom_positive" 226 "suffix_custom_white_list" 228 $ta->
setInfo($this->
lng->txt(
"file_suffix_custom_positive_info"));
230 $ta->setDisabled(!$permission_to_write);
235 $ne->setValue(implode(
", ", $this->file_service_settings->getWhiteListedSuffixes()));
236 $ne->setInfo($this->
lng->txt(
"file_suffix_overall_positive_info"));
241 $this->
lng->txt(
"file_suffix_custom_expl_negative"),
242 "suffix_custom_expl_black" 244 $ta->
setInfo($this->
lng->txt(
"file_suffix_custom_expl_negative_info"));
246 $ta->setDisabled(!$permission_to_write);
250 if ($permission_to_write) {
251 $form->addCommandButton(
'saveSettings', $this->
lng->txt(
'save'));
252 $form->addCommandButton(
'view', $this->
lng->txt(
'cancel'));
260 $this->tabs_gui->setTabActive(self::TAB_SETTINGS);
269 $val[
"suffix_repl_additional"] = implode(
", ", $this->file_service_settings->getWhiteListNegative());
270 $val[
"suffix_custom_white_list"] = implode(
", ", $this->file_service_settings->getWhiteListPositive());
271 $val[
"suffix_custom_expl_black"] = implode(
", ", $this->file_service_settings->getProhibited());
272 $form->setValuesByArray($val);
275 $this->tpl->setContent($form->getHTML());
284 if ($form->checkInput()) {
285 $trafo = (fn(
string $id): ?
string => $this->post_wrapper->has($id)
286 ? $this->post_wrapper->retrieve($id, $this->
refinery->to()->string())
290 $this->
settings->set(
"suffix_repl_additional", $trafo(
"suffix_repl_additional"));
291 $this->
settings->set(
"suffix_custom_white_list", $trafo(
"suffix_custom_white_list"));
292 $this->
settings->set(
"suffix_custom_expl_black", $trafo(
"suffix_custom_expl_black"));
294 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'settings_saved'),
true);
295 $this->
ctrl->redirect($this, self::CMD_EDIT_SETTINGS);
297 $form->setValuesByPost();
298 $this->tpl->setContent($form->getHTML());
checkPermissionOrFail(string $str)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
New implementation of ilObjectGUI.
prepareOutput(bool $show_sub_objects=true)
ilGlobalTemplateInterface $tpl
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
hasUserPermissionTo(string $str)
Class ilObjFileServicesGUI.
ilErrorHandling $error_handling
executeCommand()
Execute command public.
__construct(Container $dic, ilPlugin $plugin)
This class represents a text area property in a property form.
__construct(int $id=0, int $id_type=self::REPOSITORY_NODE_ID, int $parent_node_id=0)
Constructor public.
ilFileServicesSettings $file_service_settings