3declare(strict_types=1);
54 $this->
tabs = $DIC[
'ilTabs'];
55 $this->
lng = $DIC->language();
56 $this->
lng->loadLanguageModule(
'adn');
57 $this->
ctrl = $DIC[
'ilCtrl'];
58 $this->tpl =
$DIC[
'tpl'];
59 $this->tree =
$DIC[
'tree'];
61 $this->error_handling =
$DIC[
"ilErr"];
62 $this->
http = $DIC->http()->wrapper();
63 $this->ref_id = $this->
http->query()->retrieve(
'ref_id', $DIC->refinery()->kindlyTo()->int());
65 $this->file_service_settings =
$DIC->fileServiceSettings();
76 $this->error_handling->raiseError(
77 $this->
lng->txt(
'no_permission'),
85 return $this->
access->checkAccess($str,
'', $this->ref_id);
94 $this->
lng->loadLanguageModule(
"fils");
96 $next_class = $this->
ctrl->getNextClass($this);
97 $cmd = $this->
ctrl->getCmd();
102 switch ($next_class) {
103 case 'ilpermissiongui':
104 $this->tabs_gui->setTabActive(
'perm_settings');
106 $this->
ctrl->forwardCommand($perm_gui);
109 if (!$cmd || $cmd ===
'view') {
122 if ($this->rbac_system->checkAccess(
124 $this->object->getRefId()
127 $this->tabs_gui->addTarget(
129 $this->
ctrl->getLinkTarget($this, self::CMD_EDIT_SETTINGS),
130 [self::CMD_EDIT_SETTINGS,
"view"]
133 if ($this->rbac_system->checkAccess(
135 $this->object->getRefId()
138 $this->tabs_gui->addTarget(
140 $this->
ctrl->getLinkTargetByClass(ilPermissionGUI::class,
"perm"),
142 ilPermissionGUI::class
149 parent::setTitleAndDescription();
150 $this->tpl->setDescription($this->
object->getDescription());
158 $form->setFormAction($this->
ctrl->getFormAction($this));
159 $form->setTitle($this->
lng->txt(
"settings"));
163 $ne->setValue(implode(
", ", $this->file_service_settings->getDefaultWhitelist()));
164 $ne->setInfo($this->
lng->txt(
"file_suffix_default_positive_info"));
170 "file_suffix_custom_negative"
172 "suffix_repl_additional"
174 $ta->setInfo($this->
lng->txt(
"file_suffix_custom_negative_info"));
176 $ta->setDisabled(!$permission_to_write);
182 "file_suffix_custom_positive"
184 "suffix_custom_white_list"
186 $ta->setInfo($this->
lng->txt(
"file_suffix_custom_positive_info"));
188 $ta->setDisabled(!$permission_to_write);
193 $ne->setValue(implode(
", ", $this->file_service_settings->getWhiteListedSuffixes()));
194 $ne->setInfo($this->
lng->txt(
"file_suffix_overall_positive_info"));
199 $this->
lng->txt(
"file_suffix_custom_expl_negative"),
200 "suffix_custom_expl_black"
202 $ta->setInfo($this->
lng->txt(
"file_suffix_custom_expl_negative_info"));
204 $ta->setDisabled(!$permission_to_write);
208 if ($permission_to_write) {
209 $form->addCommandButton(
'saveSettings', $this->
lng->txt(
'save'));
210 $form->addCommandButton(
'view', $this->
lng->txt(
'cancel'));
218 $this->tabs_gui->setTabActive(
'settings');
227 $val[
"suffix_repl_additional"] = implode(
", ", $this->file_service_settings->getWhiteListNegative());
228 $val[
"suffix_custom_white_list"] = implode(
", ", $this->file_service_settings->getWhiteListPositive());
229 $val[
"suffix_custom_expl_black"] = implode(
", ", $this->file_service_settings->getProhibited());
230 $form->setValuesByArray($val);
233 $this->tpl->setContent($form->getHTML());
242 if ($form->checkInput()) {
243 $trafo =
function (
string $id): ?
string {
244 return $this->
http->post()->has(
$id)
250 $this->
settings->set(
"suffix_repl_additional", $trafo(
"suffix_repl_additional"));
251 $this->
settings->set(
"suffix_custom_white_list", $trafo(
"suffix_custom_white_list"));
252 $this->
settings->set(
"suffix_custom_expl_black", $trafo(
"suffix_custom_expl_black"));
254 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'settings_saved'),
true);
255 $this->
ctrl->redirect($this, self::CMD_EDIT_SETTINGS);
257 $form->setValuesByPost();
258 $this->tpl->setContent($form->getHTML());
Class ilCtrl provides processing control methods.
Error Handling & global info handling uses PEAR error class.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
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)
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
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.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static http()
Fetches the global http state from ILIAS.
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc