44 public function __construct($a_data,
int $a_id,
bool $a_call_by_reference)
49 $this->folderSettings =
new ilSetting(
'fold');
50 $this->
http = $DIC->http();
62 $this->
lng->loadLanguageModule(
"file");
64 $next_class = $this->
ctrl->getNextClass($this);
65 $cmd = $this->
ctrl->getCmd();
69 if (!$this->
access->checkAccess(
'read',
'', $this->object->getRefId())) {
70 $this->
ilias->raiseError(
71 $this->
lng->txt(
'no_permission'),
72 $this->
ilias->error_obj->MESSAGE
76 switch ($next_class) {
77 case 'ilpermissiongui':
78 $this->tabs_gui->setTabActive(
'perm_settings');
80 $this->
ctrl->forwardCommand($perm_gui);
83 if (!$cmd || $cmd ==
'view') {
84 $cmd = self::CMD_EDIT_SETTINGS;
101 if ($this->rbac_system->checkAccess(
"visible,read", $this->object->getRefId())) {
102 $this->tabs_gui->addTarget(
104 $this->
ctrl->getLinkTarget($this, self::CMD_EDIT_SETTINGS),
105 array(self::CMD_EDIT_SETTINGS,
"view")
108 if ($this->rbac_system->checkAccess(
'edit_permission', $this->object->getRefId())) {
109 $this->tabs_gui->addTarget(
"perm_settings", $this->
ctrl->getLinkTargetByClass(
'ilpermissiongui',
"perm"), array(),
'ilpermissiongui');
116 $this->tabs_gui->addSubTabTarget(
118 $this->
ctrl->getLinkTarget($this, self::CMD_EDIT_SETTINGS),
119 array(self::CMD_EDIT_SETTINGS,
"view")
121 $this->tabs_gui->addSubTabTarget(
123 $this->
ctrl->getLinkTarget($this, self::CMD_SHOW_PREVIEW_RENDERERS),
124 array(self::CMD_SHOW_PREVIEW_RENDERERS,
"view")
135 $ilCtrl = $DIC[
'ilCtrl'];
139 $form->setFormAction($ilCtrl->getFormAction($this));
140 $form->setTitle(
$lng->
txt(
"settings"));
148 $dl_prop->setChecked($this->
object->isDownloadWithUploadedFilename() == 1);
149 $dl_prop->setInfo(
$lng->
txt(
'download_with_uploaded_filename_info'));
150 $form->addItem($dl_prop);
156 $dl_prop->setRequired(
true);
157 $dl_prop->setSize(10);
158 $dl_prop->setMinValue(1);
159 $dl_prop->setSuffix(
$lng->
txt(
"lang_size_mb"));
160 $dl_prop->setValue($this->folderSettings->get(
"bgtask_download_limit", null));
161 $form->addItem($dl_prop);
166 $tai_prop->setInfo(
$lng->
txt(
'inline_file_extensions_info'));
167 $tai_prop->setCols(80);
168 $tai_prop->setRows(5);
169 $form->addItem($tai_prop);
175 $chk_prop->setInfo(
$lng->
txt(
'enable_preview_info'));
176 $form->addItem($chk_prop);
181 $num_prop->setMinValue(1);
182 $num_prop->setMinvalueShouldBeGreater(
false);
184 $num_prop->setMaxvalueShouldBeLess(
false);
185 $num_prop->setMaxLength(5);
186 $num_prop->setSize(10);
188 $num_prop->setInfo(
$lng->
txt(
'max_previews_per_object_info'));
189 $form->addItem($num_prop);
192 $form->addCommandButton(
'saveSettings',
$lng->
txt(
'save'));
193 $form->addCommandButton(
'view',
$lng->
txt(
'cancel'));
206 $this->tabs_gui->setTabActive(
'file_objects');
208 $this->tabs_gui->setSubTabActive(
'settings');
210 if (!$DIC->rbac()->system()->checkAccess(
"visible,read", $this->
object->getRefId())) {
211 $ilErr->raiseError($DIC->language()->txt(
"no_permission"), $ilErr->WARNING);
214 if ($a_form === null) {
218 $DIC->ui()->mainTemplate()->setContent($a_form->getHTML());
228 $rbacsystem = $DIC[
'rbacsystem'];
230 if (!$rbacsystem->checkAccess(
"write", $this->object->getRefId())) {
231 $this->tpl->setOnScreenMessage(
'failure', $DIC->language()->txt(
"no_permission"),
true);
232 $DIC->ctrl()->redirect($this, self::CMD_EDIT_SETTINGS);
236 if ($form->checkInput()) {
238 $post = (array) $this->
http->request()->getParsedBody();
239 $this->
object->setDownloadWithUploadedFilename(
242 $this->
object->setInlineFileExtensions(
245 $this->
object->update();
246 $this->folderSettings->set(
"bgtask_download_limit", (
int)
$post[
"bg_limit"]);
247 $enable_preview = (
int) ($post[
"enable_preview"] ?? 0);
251 $this->tpl->setOnScreenMessage(
'success', $DIC->language()->txt(
'settings_saved'),
true);
252 $DIC->ctrl()->redirect($this, self::CMD_EDIT_SETTINGS);
255 $form->setValuesByPost();
263 $rbacsystem = $DIC[
'rbacsystem'];
268 $this->tabs_gui->setTabActive(
'file_objects');
270 $this->tabs_gui->setSubTabActive(
'preview_renderers');
272 if (!$rbacsystem->checkAccess(
"visible,read", $this->object->getRefId())) {
278 $this->tpl->setOnScreenMessage(
'info',
$lng->
txt(
"ghostscript_not_configured"));
282 $renderers =
$factory->getRenderers();
285 'name' => $renderer->
getName(),
286 'is_plugin' => $renderer->
isPlugin(),
289 'object' => $renderer
295 $table->setMaxCount(count($renderers));
296 $table->setData($array_wrapper);
308 parent::setTitleAndDescription();
309 $this->tpl->setDescription($this->
object->getDescription());
static setPreviewEnabled(bool $a_value)
Sets whether the preview functionality is enabled.
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...
getName()
Gets the name of the renderer.
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static isGhostscriptInstalled()
Determines whether Ghostscript is installed.
prepareOutput(bool $show_sub_objects=true)
static stripSlashes(string $a_str, bool $a_strip_html=true, string $a_allow="")
__construct($a_data, int $a_id, bool $a_call_by_reference)
Constructor.
isPlugin()
Determines whether the renderer is a plugin or a built in one.
executeCommand()
Execute command.
loadLanguageModule(string $a_module)
Load language module.
static setMaximumPreviews(int $a_value)
Sets the maximum number of preview pictures per object.
getSupportedFileFormats()
Gets an array containing the file formats that are supported by the renderer.
Class ilObjFileAccessSettingsGUI.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setValue(string $a_value)
static http()
Fetches the global http state from ILIAS.
ilGlobalTemplateInterface $tpl
setContent(string $a_html)
Sets content for standard template.
initSettingsForm()
Edit settings.
Class ilObjectGUI Basic methods of all Output classes.
header include for all ilias files.
getSupportedRepositoryTypes()
Gets an array containing the repository types (e.g.
static getMaximumPreviews()
Gets the maximum number of preview pictures per object.
static isPreviewEnabled()
Gets whether the preview functionality is enabled.
saveSettings()
Save settings.
__construct(Container $dic, ilPlugin $plugin)
This class represents a text area property in a property form.
ilSetting $folderSettings
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
const CMD_SHOW_PREVIEW_RENDERERS
editSettings(ilPropertyFormGUI $a_form=null)
Edit settings.
setTitleAndDescription()
called by prepare output