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') {
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"));
146 $dl_prop->setValue(
'1');
148 $dl_prop->setChecked($this->
object->isDownloadWithUploadedFilename() == 1);
149 $dl_prop->setInfo(
$lng->
txt(
'download_with_uploaded_filename_info'));
150 $form->addItem($dl_prop);
155 $dl_prop->setInfo(
$lng->
txt(
"bgtask_setting_limit_info"));
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);
165 $tai_prop->setValue($this->
object->getInlineFileExtensions());
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);
173 $chk_prop->setValue(
'1');
175 $chk_prop->setInfo(
$lng->
txt(
'enable_preview_info'));
176 $form->addItem($chk_prop);
180 $num_prop->setDecimals(0);
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());
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getSupportedRepositoryTypes()
Gets an array containing the repository types (e.g.
getSupportedFileFormats()
Gets an array containing the file formats that are supported by the renderer.
static isGhostscriptInstalled()
Determines whether Ghostscript is installed.
loadLanguageModule(string $a_module)
Load language module.
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...
Class ilObjFileAccessSettingsGUI.
setTitleAndDescription()
called by prepare output
editSettings(ilPropertyFormGUI $a_form=null)
Edit settings.
executeCommand()
Execute command.
__construct($a_data, int $a_id, bool $a_call_by_reference)
Constructor.
saveSettings()
Save settings.
initSettingsForm()
Edit settings.
ilSetting $folderSettings
const CMD_SHOW_PREVIEW_RENDERERS
Class ilObjectGUI Basic methods of all Output classes.
ilGlobalTemplateInterface $tpl
prepareOutput(bool $show_sub_objects=true)
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
getName()
Gets the name of the renderer.
isPlugin()
Determines whether the renderer is a plugin or a built in one.
static setMaximumPreviews(int $a_value)
Sets the maximum number of preview pictures per object.
static isPreviewEnabled()
Gets whether the preview functionality is enabled.
static getMaximumPreviews()
Gets the maximum number of preview pictures per object.
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...
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.
static stripSlashes(string $a_str, bool $a_strip_html=true, string $a_allow="")
setContent(string $a_html)
Sets content for standard template.
static http()
Fetches the global http state from ILIAS.
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
header include for all ilias files.