ILIAS  release_7 Revision v7.30-3-g800a261c036
ilObjFileAccessSettingsGUI Class Reference

Class ilObjFileAccessSettingsGUI. More...

+ Inheritance diagram for ilObjFileAccessSettingsGUI:
+ Collaboration diagram for ilObjFileAccessSettingsGUI:

Public Member Functions

 __construct ($a_data, $a_id, $a_call_by_reference)
 Constructor. More...
 
 executeCommand ()
 Execute command. More...
 
 getAdminTabs ()
 Get tabs. More...
 
 editSettings (ilPropertyFormGUI $a_form=null)
 Edit settings. More...
 
 saveSettings ()
 Save settings. More...
 
 setTitleAndDescription ()
 called by prepare output More...
 
- Public Member Functions inherited from ilObjectGUI
 executeCommand ()
 execute command More...
 
 withReferences ()
 determines wether objects are referenced or not (got ref ids or not) More...
 
 setCreationMode ($a_mode=true)
 if true, a creation screen is displayed the current $_GET[ref_id] don't belong to the current class! the mode is determined in ilrepositorygui More...
 
 getCreationMode ()
 get creation mode More...
 
 prepareOutput ($a_show_subobjects=true)
 prepare output More...
 
 getAdminTabs ()
 administration tabs show only permissions and trash folder More...
 
 getHTML ()
 
 confirmedDeleteObject ()
 confirmed deletion of object -> objects are moved to trash or deleted immediately, if trash is disabled More...
 
 cancelDeleteObject ()
 cancel deletion of object More...
 
 cancelObject ()
 cancel action and go back to previous page @access public More...
 
 createObject ()
 create new object form More...
 
 cancelCreation ()
 cancel create action and go back to repository parent More...
 
 saveObject ()
 save object More...
 
 getDidacticTemplateVar ($a_type)
 Get didactic template setting from creation screen. More...
 
 putObjectInTree (ilObject $a_obj, $a_parent_node_id=null)
 Add object to tree at given position. More...
 
 editObject ()
 edit object More...
 
 addExternalEditFormCustom (ilPropertyFormGUI $a_form)
 
 updateObject ()
 updates object entry in object_data More...
 
 getFormAction ($a_cmd, $a_formaction="")
 get form action for command (command is method name without "Object", e.g. More...
 
 isVisible ($a_ref_id, $a_type)
 
 viewObject ()
 viewObject container presentation for "administration -> repository, trash, permissions" More...
 
 deleteObject ($a_error=false)
 Display deletion confirmation screen. More...
 
 cloneAllObject ()
 Clone single (not container object) Method is overwritten in ilContainerGUI. More...
 
 redirectAfterCreation ()
 Redirect after creation, see https://docu.ilias.de/goto_docu_wiki_wpage_5035_1357.html. More...
 
 addToDeskObject ()
 @inheritDoc More...
 
 removeFromDeskObject ()
 @inheritDoc More...
 
- Public Member Functions inherited from ILIAS\Object\ImplementsCreationCallback
 callCreationCallback (\ilObject $object, \ilObjectDefinition $obj_definition, int $requested_crtcb)
 

Data Fields

const CMD_EDIT_SETTINGS = 'editSettings'
 
const CMD_SHOW_PREVIEW_RENDERERS = 'showPreviewRenderers'
 
- Data Fields inherited from ilObjectGUI
const ALLOWED_TAGS_IN_TITLE_AND_DESCRIPTION
 
const COPY_WIZARD_NEEDS_PAGE = 1
 
 $objDefinition
 
 $tpl
 
 $tree
 
 $lng
 
 $data
 
 $object
 
 $ref_id
 
 $obj_id
 
 $maxcount
 
 $formaction
 
 $return_location
 
 $target_frame
 
 $tab_target_script
 
 $actions
 
 $sub_objects
 
 $omit_locator = false
 
const CFORM_NEW = 1
 
const CFORM_IMPORT = 2
 
const CFORM_CLONE = 3
 

Protected Member Functions

 addFileObjectsSubTabs ()
 
 initSettingsForm ()
 Edit settings. More...
 
 showPreviewRenderers ()
 
- Protected Member Functions inherited from ilObjectGUI
 getObjectService ()
 Get object service. More...
 
 assignObject ()
 
 setTitleAndDescription ()
 called by prepare output More...
 
 initHeaderAction ($a_sub_type=null, $a_sub_id=null)
 Add header action menu. More...
 
 insertHeaderAction ($a_list_gui)
 Insert header action into main template. More...
 
 addHeaderAction ()
 Add header action menu. More...
 
 redrawHeaderActionObject ()
 Ajax call: redraw action header only. More...
 
 setTabs ()
 set admin tabs @access public More...
 
 setAdminTabs ()
 set admin tabs @access public More...
 
 setLocator ()
 set Locator More...
 
 addLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 omitLocator ($a_omit=true)
 
 addAdminLocatorItems ($a_do_not_add_object=false)
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 initCreationForms ($a_new_type)
 Init creation froms. More...
 
 getCreationFormsHTML (array $a_forms)
 Get HTML for creation forms (accordion) More...
 
 initCreateForm ($a_new_type)
 Init object creation form. More...
 
 initDidacticTemplate (ilPropertyFormGUI $form)
 Show didactic template types. More...
 
 addDidacticTemplateOptions (array &$a_options)
 Add custom templates. More...
 
 afterSave (ilObject $a_new_object)
 Post (successful) object creation hook. More...
 
 initEditForm ()
 Init object edit form. More...
 
 initEditCustomForm (ilPropertyFormGUI $a_form)
 Add custom fields to update form. More...
 
 getEditFormValues ()
 Get values for edit form. More...
 
 getEditFormCustomValues (array &$a_values)
 Add values to custom edit fields. More...
 
 validateCustom (ilPropertyFormGUI $a_form)
 Validate custom values (if not possible with checkInput()) More...
 
 updateCustom (ilPropertyFormGUI $a_form)
 Insert custom update form values into object. More...
 
 afterUpdate ()
 Post (successful) object update hook. More...
 
 initImportForm ($a_new_type)
 Init object import form. More...
 
 importFileObject ($parent_id=null, $a_catch_errors=true)
 Import. More...
 
 afterImport (ilObject $a_new_object)
 Post (successful) object import hook. More...
 
 setFormAction ($a_cmd, $a_formaction)
 set specific form action for command More...
 
 getReturnLocation ($a_cmd, $a_location="")
 get return location for command (command is method name without "Object", e.g. More...
 
 setReturnLocation ($a_cmd, $a_location)
 set specific return location for command More...
 
 getTargetFrame ($a_cmd, $a_target_frame="")
 get target frame for command (command is method name without "Object", e.g. More...
 
 setTargetFrame ($a_cmd, $a_target_frame)
 set specific target frame for command More...
 
 showPossibleSubObjects ()
 show possible subobjects (pulldown menu) More...
 
 getTemplateFile ($a_cmd, $a_type="")
 get a template blockfile format: tpl. More...
 
 getTabs ()
 get tabs abstract method. More...
 
 __showButton ($a_cmd, $a_text, $a_target='')
 
 hitsperpageObject ()
 
__initTableGUI ()
 
 __setTableGUIBasicData (&$tbl, &$result_set, $a_from="")
 standard implementation for tables use 'from' variable use different initial setting of table More...
 
 redirectToRefId ($a_ref_id, $a_cmd="")
 redirects to (repository) view per ref id usually to a container and usually used at the end of a save/import method where the object gui type (of the new object) doesn't match with the type of the current $_GET["ref_id"] value More...
 
 fillCloneTemplate ($a_tpl_varname, $a_type)
 Fill object clone template This method can be called from any object GUI class that wants to offer object cloning. More...
 
 getCenterColumnHTML ()
 Get center column. More...
 
 getRightColumnHTML ()
 Display right column. More...
 
 setColumnSettings (ilColumnGUI $column_gui)
 May be overwritten in subclasses. More...
 
 checkPermission ($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
 Check permission and redirect on error. More...
 
 checkPermissionBool ($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
 Check permission. More...
 
 enableDragDropFileUpload ()
 Enables the file upload into this object by dropping files. More...
 
 handleAutoRating (ilObject $a_new_obj)
 Activate rating automatically if parent container setting. More...
 

Protected Attributes

 $folderSettings
 
- Protected Attributes inherited from ilObjectGUI
const UPLOAD_TYPE_LOCAL = 1
 
const UPLOAD_TYPE_UPLOAD_DIRECTORY = 2
 
 $ilErr
 
 $locator
 
 $user
 
 $access
 
 $rbacsystem
 
 $settings
 
 $rbacreview
 
 $toolbar
 
 $tmp_import_dir
 
 $tabs_gui = null
 
 $ctrl
 
 $object_service
 
 $favourites
 
 $request
 

Additional Inherited Members

- Static Public Member Functions inherited from ilObjectGUI
static _gotoRepositoryRoot ($a_raise_error=false)
 Goto repository root. More...
 
static _gotoRepositoryNode ($a_ref_id, $a_cmd="frameset")
 Goto repository root. More...
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilObjFileAccessSettingsGUI::__construct (   $a_data,
  $a_id,
  $a_call_by_reference 
)

Constructor.

@access public

Definition at line 52 of file class.ilObjFileAccessSettingsGUI.php.

53 {
54 $this->type = "facs";
55 parent::__construct($a_data, $a_id, $a_call_by_reference, false);
56 $this->folderSettings = new ilSetting('fold');
57 }
ILIAS Setting Class.
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc

References ILIAS\GlobalScreen\Provider\__construct().

+ Here is the call graph for this function:

Member Function Documentation

◆ addFileObjectsSubTabs()

ilObjFileAccessSettingsGUI::addFileObjectsSubTabs ( )
protected

Definition at line 129 of file class.ilObjFileAccessSettingsGUI.php.

130 {
131 $this->tabs_gui->addSubTabTarget(
132 "settings",
133 $this->ctrl->getLinkTarget($this, self::CMD_EDIT_SETTINGS),
134 array(self::CMD_EDIT_SETTINGS, "view")
135 );
136 $this->tabs_gui->addSubTabTarget(
137 "preview_renderers",
138 $this->ctrl->getLinkTarget($this, self::CMD_SHOW_PREVIEW_RENDERERS),
139 array(self::CMD_SHOW_PREVIEW_RENDERERS, "view")
140 );
141 }

Referenced by editSettings(), and showPreviewRenderers().

+ Here is the caller graph for this function:

◆ editSettings()

ilObjFileAccessSettingsGUI::editSettings ( ilPropertyFormGUI  $a_form = null)

Edit settings.

Definition at line 225 of file class.ilObjFileAccessSettingsGUI.php.

226 {
227 global $DIC, $ilErr;
228
229 $this->tabs_gui->setTabActive('file_objects');
230 $this->addFileObjectsSubTabs();
231 $this->tabs_gui->setSubTabActive('settings');
232
233 if (!$DIC->rbac()->system()->checkAccess("visible,read", $this->object->getRefId())) {
234 $ilErr->raiseError($DIC->language()->txt("no_permission"), $ilErr->WARNING);
235 }
236
237 if (!$a_form) {
238 $a_form = $this->initSettingsForm();
239 }
240
241 $DIC->ui()->mainTemplate()->setContent($a_form->getHTML());
242 }
global $DIC
Definition: goto.php:24

References $DIC, ilObjectGUI\$ilErr, addFileObjectsSubTabs(), and initSettingsForm().

Referenced by saveSettings().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ executeCommand()

ilObjFileAccessSettingsGUI::executeCommand ( )

Execute command.

@access public

Reimplemented from ilObjectGUI.

Definition at line 66 of file class.ilObjFileAccessSettingsGUI.php.

67 {
68 global $DIC;
69 $ilAccess = $DIC['ilAccess'];
70 $ilias = $DIC['ilias'];
71 $lng = $DIC['lng'];
72
73 $lng->loadLanguageModule("file");
74
75 $next_class = $this->ctrl->getNextClass($this);
76 $cmd = $this->ctrl->getCmd();
77
78 $this->prepareOutput();
79
80 if (!$ilAccess->checkAccess('read', '', $this->object->getRefId())) {
81 $ilias->raiseError($lng->txt('no_permission'), $ilias->error_obj->MESSAGE);
82 }
83
84 switch ($next_class) {
85 case 'ilpermissiongui':
86 $this->tabs_gui->setTabActive('perm_settings');
87 $perm_gui = new ilPermissionGUI($this);
88 $ret = &$this->ctrl->forwardCommand($perm_gui);
89 break;
90 default:
91 if (!$cmd || $cmd == 'view') {
93 }
94
95 $this->$cmd();
96 break;
97 }
98
99 return true;
100 }
prepareOutput($a_show_subobjects=true)
prepare output
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
$ret
Definition: parser.php:6

References $DIC, ilObjectGUI\$lng, $ret, CMD_EDIT_SETTINGS, and ilObjectGUI\prepareOutput().

+ Here is the call graph for this function:

◆ getAdminTabs()

ilObjFileAccessSettingsGUI::getAdminTabs ( )

Get tabs.

@access public

Reimplemented from ilObjectGUI.

Definition at line 109 of file class.ilObjFileAccessSettingsGUI.php.

110 {
111 global $DIC;
112 $rbacsystem = $DIC['rbacsystem'];
113
114 $GLOBALS['DIC']['lng']->loadLanguageModule('fm');
115
116 if ($rbacsystem->checkAccess("visible,read", $this->object->getRefId())) {
117 $this->tabs_gui->addTarget(
118 'file_objects',
119 $this->ctrl->getLinkTarget($this, self::CMD_EDIT_SETTINGS),
120 array(self::CMD_EDIT_SETTINGS, "view")
121 );
122 }
123 if ($rbacsystem->checkAccess('edit_permission', $this->object->getRefId())) {
124 $this->tabs_gui->addTarget("perm_settings", $this->ctrl->getLinkTargetByClass('ilpermissiongui', "perm"), array(), 'ilpermissiongui');
125 }
126 }
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64

References $DIC, $GLOBALS, and ilObjectGUI\$rbacsystem.

◆ initSettingsForm()

ilObjFileAccessSettingsGUI::initSettingsForm ( )
protected

Edit settings.

Definition at line 147 of file class.ilObjFileAccessSettingsGUI.php.

148 {
149 global $DIC;
150 $ilCtrl = $DIC['ilCtrl'];
151 $lng = $DIC['lng'];
152
153 require_once("./Services/Form/classes/class.ilPropertyFormGUI.php");
154 require_once("./Services/Form/classes/class.ilCheckboxInputGUI.php");
155 require_once("./Services/Form/classes/class.ilRadioGroupInputGUI.php");
156 require_once("./Services/Form/classes/class.ilRadioOption.php");
157 require_once("./Services/Form/classes/class.ilTextAreaInputGUI.php");
158
159 $form = new ilPropertyFormGUI();
160 $form->setFormAction($ilCtrl->getFormAction($this));
161 $form->setTitle($lng->txt("settings"));
162
163 // Backwards compatibility with ILIAS 3.9: Use the name of the
164 // uploaded file as the filename for the downloaded file instead
165 // of the title of the file object.
166 $dl_prop = new ilCheckboxInputGUI($lng->txt("download_with_uploaded_filename"), "download_with_uploaded_filename");
167 $dl_prop->setValue('1');
168 // default value should reflect previous behaviour (-> 0)
169 $dl_prop->setChecked($this->object->isDownloadWithUploadedFilename() == 1);
170 $dl_prop->setInfo($lng->txt('download_with_uploaded_filename_info'));
171 $form->addItem($dl_prop);
172
173 // download limit
174 $lng->loadLanguageModule("bgtask");
175 $dl_prop = new ilNumberInputGUI($lng->txt("bgtask_setting_limit"), "bg_limit");
176 $dl_prop->setInfo($lng->txt("bgtask_setting_limit_info"));
177 $dl_prop->setRequired(true);
178 $dl_prop->setSize(10);
179 $dl_prop->setMinValue(1);
180 $dl_prop->setSuffix($lng->txt("lang_size_mb"));
181 $dl_prop->setValue($this->folderSettings->get("bgtask_download_limit", null));
182 $form->addItem($dl_prop);
183
184 // Inline file extensions
185 $tai_prop = new ilTextAreaInputGUI($lng->txt('inline_file_extensions'), 'inline_file_extensions');
186 $tai_prop->setValue($this->object->getInlineFileExtensions());
187 $tai_prop->setInfo($lng->txt('inline_file_extensions_info'));
188 $tai_prop->setCols(80);
189 $tai_prop->setRows(5);
190 $form->addItem($tai_prop);
191
192 require_once("Services/Preview/classes/class.ilPreviewSettings.php");
193
194 // enable preview
195 $chk_prop = new ilCheckboxInputGUI($lng->txt("enable_preview"), "enable_preview");
196 $chk_prop->setValue('1');
197 $chk_prop->setChecked(ilPreviewSettings::isPreviewEnabled());
198 $chk_prop->setInfo($lng->txt('enable_preview_info'));
199 $form->addItem($chk_prop);
200
201 // max preview images
202 $num_prop = new ilNumberInputGUI($lng->txt("max_previews_per_object"), "max_previews_per_object");
203 $num_prop->setDecimals(0);
204 $num_prop->setMinValue(1);
205 $num_prop->setMinvalueShouldBeGreater(false);
206 $num_prop->setMaxValue(ilPreviewSettings::MAX_PREVIEWS_MAX);
207 $num_prop->setMaxvalueShouldBeLess(false);
208 $num_prop->setMaxLength(5);
209 $num_prop->setSize(10);
210 $num_prop->setValue(ilPreviewSettings::getMaximumPreviews());
211 $num_prop->setInfo($lng->txt('max_previews_per_object_info'));
212 $form->addItem($num_prop);
213
214 // command buttons
215 $form->addCommandButton('saveSettings', $lng->txt('save'));
216 $form->addCommandButton('view', $lng->txt('cancel'));
217
218 return $form;
219 }
This class represents a checkbox property in a property form.
This class represents a number property in a property form.
static isPreviewEnabled()
Gets whether the preview functionality is enabled.
static getMaximumPreviews()
Gets the maximum number of preview pictures per object.
This class represents a property form user interface.
This class represents a text area property in a property form.

References $DIC, ilObjectGUI\$lng, ilPreviewSettings\getMaximumPreviews(), ilPreviewSettings\isPreviewEnabled(), and ilPreviewSettings\MAX_PREVIEWS_MAX.

Referenced by editSettings(), and saveSettings().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ saveSettings()

ilObjFileAccessSettingsGUI::saveSettings ( )

Save settings.

Definition at line 248 of file class.ilObjFileAccessSettingsGUI.php.

249 {
250 global $DIC;
251 $rbacsystem = $DIC['rbacsystem'];
252
253 if (!$rbacsystem->checkAccess("write", $this->object->getRefId())) {
254 ilUtil::sendFailure($DIC->language()->txt("no_permission"), true);
255 $DIC->ctrl()->redirect($this, self::CMD_EDIT_SETTINGS);
256 }
257
258 $form = $this->initSettingsForm();
259 if ($form->checkInput()) {
260 $this->object->setDownloadWithUploadedFilename(ilUtil::stripSlashes($_POST['download_with_uploaded_filename']));
261 $this->object->setInlineFileExtensions(ilUtil::stripSlashes($_POST['inline_file_extensions']));
262 $this->object->update();
263 $this->folderSettings->set("bgtask_download_limit", (int) $_POST["bg_limit"]);
264
265 require_once("Services/Preview/classes/class.ilPreviewSettings.php");
266 ilPreviewSettings::setPreviewEnabled($_POST["enable_preview"] == 1);
267 ilPreviewSettings::setMaximumPreviews($_POST["max_previews_per_object"]);
268
269 ilUtil::sendSuccess($DIC->language()->txt('settings_saved'), true);
270 $DIC->ctrl()->redirect($this, self::CMD_EDIT_SETTINGS);
271 }
272
273 $form->setValuesByPost();
274 $this->editSettings($form);
275 }
$_POST["username"]
editSettings(ilPropertyFormGUI $a_form=null)
Edit settings.
static setMaximumPreviews($a_value)
Sets the maximum number of preview pictures per object.
static setPreviewEnabled($a_value)
Sets whether the preview functionality is enabled.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled

References $_POST, $DIC, ilObjectGUI\$rbacsystem, editSettings(), initSettingsForm(), ilUtil\sendFailure(), ilPreviewSettings\setMaximumPreviews(), ilPreviewSettings\setPreviewEnabled(), and ilUtil\stripSlashes().

+ Here is the call graph for this function:

◆ setTitleAndDescription()

ilObjFileAccessSettingsGUI::setTitleAndDescription ( )

called by prepare output

Reimplemented from ilObjectGUI.

Definition at line 316 of file class.ilObjFileAccessSettingsGUI.php.

317 {
318 parent::setTitleAndDescription();
319 $this->tpl->setDescription($this->object->getDescription());
320 }

◆ showPreviewRenderers()

ilObjFileAccessSettingsGUI::showPreviewRenderers ( )
protected

Definition at line 278 of file class.ilObjFileAccessSettingsGUI.php.

278 {
279 global $DIC;
280 $rbacsystem = $DIC['rbacsystem'];
281 $ilErr = $DIC['ilErr'];
282 $tpl = $DIC['tpl'];
283 $lng = $DIC['lng'];
284
285 $this->tabs_gui->setTabActive('file_objects');
286 $this->addFileObjectsSubTabs();
287 $this->tabs_gui->setSubTabActive('preview_renderers');
288
289 if (!$rbacsystem->checkAccess("visible,read", $this->object->getRefId())) {
290 $ilErr->raiseError($lng->txt("no_permission"), $ilErr->WARNING);
291 }
292
293 // set warning if ghostscript not installed
295 ilUtil::sendInfo($lng->txt("ghostscript_not_configured"));
296 }
297
298 // build renderer HTML
299 require_once("Services/Preview/classes/class.ilRendererFactory.php");
300 require_once("Services/Preview/classes/class.ilRendererTableGUI.php");
301
302 $renderers = ilRendererFactory::getRenderers();
303
304 $table = new ilRendererTableGUI($this, array(self::CMD_SHOW_PREVIEW_RENDERERS, "view"));
305 $table->setMaxCount(sizeof($renderers));
306 $table->setData($renderers);
307
308 // set content
309 $tpl->setContent($table->getHTML());
310 }
static isGhostscriptInstalled()
Determines whether Ghostscript is installed.
static getRenderers()
Gets an array containing all available preview renderers.
Displays an overview of all loaded preview renderers.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.

References $DIC, ilObjectGUI\$ilErr, ilObjectGUI\$lng, ilObjectGUI\$rbacsystem, ilObjectGUI\$tpl, addFileObjectsSubTabs(), ilRendererFactory\getRenderers(), ilGhostscriptRenderer\isGhostscriptInstalled(), and ilUtil\sendInfo().

+ Here is the call graph for this function:

Field Documentation

◆ $folderSettings

ilObjFileAccessSettingsGUI::$folderSettings
protected

Definition at line 44 of file class.ilObjFileAccessSettingsGUI.php.

◆ CMD_EDIT_SETTINGS

const ilObjFileAccessSettingsGUI::CMD_EDIT_SETTINGS = 'editSettings'

Definition at line 38 of file class.ilObjFileAccessSettingsGUI.php.

Referenced by executeCommand().

◆ CMD_SHOW_PREVIEW_RENDERERS

const ilObjFileAccessSettingsGUI::CMD_SHOW_PREVIEW_RENDERERS = 'showPreviewRenderers'

Definition at line 39 of file class.ilObjFileAccessSettingsGUI.php.


The documentation for this class was generated from the following file: