19 declare(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->
ctrl = $DIC[
'ilCtrl'];
64 $this->tpl = $DIC[
'tpl'];
65 $this->tree = $DIC[
'tree'];
67 $this->error_handling = $DIC[
"ilErr"];
68 $this->
http = $DIC->http()->wrapper();
69 $this->ref_id = $this->
http->query()->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);
100 $this->
lng->loadLanguageModule(
"fils");
102 $next_class = $this->
ctrl->getNextClass($this);
103 $cmd = $this->
ctrl->getCmd();
108 switch ($next_class) {
109 case strtolower(ilPermissionGUI::class):
110 $this->tabs_gui->activateTab(self::TAB_PERMISSIONS);
112 $this->
ctrl->forwardCommand($perm_gui);
114 case strtolower(ilResourceOverviewGUI::class):
115 $this->tabs_gui->activateTab(self::TAB_OVERVIEW);
117 $this->
ctrl->forwardCommand($overview);
119 case strtolower(ilUploadLimitsOverviewGUI::class):
120 $this->tabs_gui->activateTab(self::TAB_UPLOAD_LIMITS);
122 $this->
ctrl->forwardCommand($limits_gui);
125 if (!$cmd || $cmd ===
'view') {
126 $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")
190 parent::setTitleAndDescription();
191 $this->tpl->setDescription($this->
object->getDescription());
199 $form->setFormAction($this->
ctrl->getFormAction($this));
200 $form->setTitle($this->
lng->txt(self::TAB_SETTINGS));
204 $ne->setValue(implode(
", ", $this->file_service_settings->getDefaultWhitelist()));
205 $ne->setInfo($this->
lng->txt(
"file_suffix_default_positive_info"));
211 "file_suffix_custom_negative" 213 "suffix_repl_additional" 215 $ta->
setInfo($this->
lng->txt(
"file_suffix_custom_negative_info"));
217 $ta->setDisabled(!$permission_to_write);
223 "file_suffix_custom_positive" 225 "suffix_custom_white_list" 227 $ta->
setInfo($this->
lng->txt(
"file_suffix_custom_positive_info"));
229 $ta->setDisabled(!$permission_to_write);
234 $ne->setValue(implode(
", ", $this->file_service_settings->getWhiteListedSuffixes()));
235 $ne->setInfo($this->
lng->txt(
"file_suffix_overall_positive_info"));
240 $this->
lng->txt(
"file_suffix_custom_expl_negative"),
241 "suffix_custom_expl_black" 243 $ta->
setInfo($this->
lng->txt(
"file_suffix_custom_expl_negative_info"));
245 $ta->setDisabled(!$permission_to_write);
249 if ($permission_to_write) {
250 $form->addCommandButton(
'saveSettings', $this->
lng->txt(
'save'));
251 $form->addCommandButton(
'view', $this->
lng->txt(
'cancel'));
259 $this->tabs_gui->setTabActive(self::TAB_SETTINGS);
268 $val[
"suffix_repl_additional"] = implode(
", ", $this->file_service_settings->getWhiteListNegative());
269 $val[
"suffix_custom_white_list"] = implode(
", ", $this->file_service_settings->getWhiteListPositive());
270 $val[
"suffix_custom_expl_black"] = implode(
", ", $this->file_service_settings->getProhibited());
271 $form->setValuesByArray($val);
274 $this->tpl->setContent($form->getHTML());
283 if ($form->checkInput()) {
284 $trafo =
function (
string $id): ?
string {
285 return $this->
http->post()->has(
$id)
291 $this->
settings->set(
"suffix_repl_additional", $trafo(
"suffix_repl_additional"));
292 $this->
settings->set(
"suffix_custom_white_list", $trafo(
"suffix_custom_white_list"));
293 $this->
settings->set(
"suffix_custom_expl_black", $trafo(
"suffix_custom_expl_black"));
295 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'settings_saved'),
true);
296 $this->
ctrl->redirect($this, self::CMD_EDIT_SETTINGS);
298 $form->setValuesByPost();
299 $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
hasUserPermissionTo(string $str)
static http()
Fetches the global http state from ILIAS.
Class ilObjFileServicesGUI.
ilErrorHandling $error_handling
executeCommand()
Execute command public.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Error Handling & global info handling.
This class represents a text area property in a property form.
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
__construct(int $id=0, int $id_type=self::REPOSITORY_NODE_ID, int $parent_node_id=0)
Constructor public.
ilFileServicesSettings $file_service_settings