ILIAS  release_7 Revision v7.30-3-g800a261c036
All Data Structures Namespaces Files Functions Variables Modules Pages
ilObjFileServicesGUI Class Reference

Class ilObjFileServicesGUI. More...

+ Inheritance diagram for ilObjFileServicesGUI:
+ Collaboration diagram for ilObjFileServicesGUI:

Public Member Functions

 __construct ($a_data, $a_id, $a_call_by_reference)
 Constructor public. More...
 
 executeCommand ()
 Execute command public. More...
 
 getAdminTabs ()
 Get tabs. 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 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 ()
 
 removeFromDeskObject ()
 
- Public Member Functions inherited from ILIAS\Object\ImplementsCreationCallback
 callCreationCallback (\ilObject $object, \ilObjectDefinition $obj_definition, int $requested_crtcb)
 

Data Fields

const CMD_EDIT_SETTINGS = 'editSettings'
 
 $lng
 
 $error_handling
 
 $tpl
 
- 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

 checkPermissionOrFail (string $str)
 
 hasUserPermissionTo ($str)
 
 editSettings ()
 Edit settings. More...
 
 saveSettings ()
 Save settings. More...
 
- 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 public More...
 
 setAdminTabs ()
 set admin tabs 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

 $rbacsystem
 
 $tabs
 
 $ctrl
 
 $settings
 ilSetting More...
 
- 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
 

Private Member Functions

 initSettingsForm ()
 Initializes the settings form. More...
 

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()

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

Constructor public.

Definition at line 46 of file class.ilObjFileServicesGUI.php.

References $DIC, ILIAS\GlobalScreen\Provider\__construct(), and settings().

47  {
48  global $DIC;
49 
50  $this->type = "fils";
51  parent::__construct($a_data, $a_id, $a_call_by_reference, false);
52 
53  $this->tabs = $DIC['ilTabs'];
54  $this->lng = $DIC->language();
55  $this->lng->loadLanguageModule('adn');
56  $this->ctrl = $DIC['ilCtrl'];
57  $this->tpl = $DIC['tpl'];
58  $this->tree = $DIC['tree'];
59  $this->settings = $DIC['ilSetting'];
60  $this->rbacsystem = $DIC['rbacsystem'];
61  $this->error_handling = $DIC["ilErr"];
62  }
settings()
Definition: settings.php:2
global $DIC
Definition: goto.php:24
__construct(Container $dic, ilPlugin $plugin)
+ Here is the call graph for this function:

Member Function Documentation

◆ checkPermissionOrFail()

ilObjFileServicesGUI::checkPermissionOrFail ( string  $str)
protected
Parameters
string$str

Definition at line 67 of file class.ilObjFileServicesGUI.php.

References hasUserPermissionTo().

Referenced by editSettings(), executeCommand(), and saveSettings().

67  : void
68  {
69  if (!$this->hasUserPermissionTo($str)) {
70  $this->error_handling->raiseError(
71  $this->lng->txt('no_permission'),
72  $this->error_handling->error_obj->MESSAGE
73  );
74  }
75  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ editSettings()

ilObjFileServicesGUI::editSettings ( )
protected

Edit settings.

Definition at line 212 of file class.ilObjFileServicesGUI.php.

References checkPermissionOrFail(), initSettingsForm(), and settings().

212  : void
213  {
214  $this->tabs_gui->setTabActive('settings');
215 
216  $this->checkPermissionOrFail("visible,read");
217 
218  // get form
219  $form = $this->initSettingsForm();
220 
221  // set current values
222  $val = array();
223  $val["suffix_repl_additional"] = $this->settings->get("suffix_repl_additional");
224  $val["suffix_custom_white_list"] = $this->settings->get("suffix_custom_white_list");
225  $val["suffix_custom_expl_black"] = $this->settings->get("suffix_custom_expl_black");
226  $form->setValuesByArray($val);
227 
228  // set content
229  $this->tpl->setContent($form->getHTML());
230  }
settings()
Definition: settings.php:2
initSettingsForm()
Initializes the settings form.
+ Here is the call graph for this function:

◆ executeCommand()

ilObjFileServicesGUI::executeCommand ( )

Execute command public.

Definition at line 86 of file class.ilObjFileServicesGUI.php.

References checkPermissionOrFail(), and ilObjectGUI\prepareOutput().

87  {
88  $this->lng->loadLanguageModule("fils");
89 
90  $next_class = $this->ctrl->getNextClass($this);
91  $cmd = $this->ctrl->getCmd();
92 
93  $this->prepareOutput();
94  $this->checkPermissionOrFail('read');
95 
96  switch ($next_class) {
97  case 'ilpermissiongui':
98  $this->tabs_gui->setTabActive('perm_settings');
99  $perm_gui = new ilPermissionGUI($this);
100  $this->ctrl->forwardCommand($perm_gui);
101  break;
102  default:
103  if (!$cmd || $cmd === 'view') {
104  $cmd = self::CMD_EDIT_SETTINGS;
105  }
106  $this->$cmd();
107  break;
108  }
109 
110  return true;
111  }
prepareOutput($a_show_subobjects=true)
prepare output
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
+ Here is the call graph for this function:

◆ getAdminTabs()

ilObjFileServicesGUI::getAdminTabs ( )

Get tabs.

Definition at line 116 of file class.ilObjFileServicesGUI.php.

References $DIC, and $rbacsystem.

117  {
118  global $DIC;
119  $rbacsystem = $DIC['rbacsystem'];
120 
121  if ($rbacsystem->checkAccess("visible,read", $this->object->getRefId())) {
122  $this->tabs_gui->addTarget(
123  'settings',
124  $this->ctrl->getLinkTarget($this, self::CMD_EDIT_SETTINGS),
125  array(self::CMD_EDIT_SETTINGS, "view")
126  );
127  }
128  if ($rbacsystem->checkAccess('edit_permission', $this->object->getRefId())) {
129  $this->tabs_gui->addTarget(
130  "perm_settings",
131  $this->ctrl->getLinkTargetByClass('ilpermissiongui', "perm"),
132  array(),
133  'ilpermissiongui'
134  );
135  }
136  }
global $DIC
Definition: goto.php:24

◆ hasUserPermissionTo()

ilObjFileServicesGUI::hasUserPermissionTo (   $str)
protected

Definition at line 77 of file class.ilObjFileServicesGUI.php.

Referenced by checkPermissionOrFail(), and initSettingsForm().

77  : bool
78  {
79  return $this->access->checkAccess($str, '', $this->object->getRefId());
80  }
+ Here is the caller graph for this function:

◆ initSettingsForm()

ilObjFileServicesGUI::initSettingsForm ( )
private

Initializes the settings form.

Definition at line 150 of file class.ilObjFileServicesGUI.php.

References ilFileUtils\getDefaultValidExtensionWhiteList(), ilFileUtils\getValidExtensions(), hasUserPermissionTo(), ilFormPropertyGUI\setInfo(), and ilNonEditableValueGUI\setValue().

Referenced by editSettings(), and saveSettings().

151  {
152  $permission_to_write = $this->hasUserPermissionTo('write');
153 
154  $form = new ilPropertyFormGUI();
155  $form->setFormAction($this->ctrl->getFormAction($this));
156  $form->setTitle($this->lng->txt("settings"));
157 
158  // default positive list
159  $ne = new ilNonEditableValueGUI($this->lng->txt("file_suffix_default_positive"), "");
161  $ne->setInfo($this->lng->txt("file_suffix_default_positive_info"));
162  $form->addItem($ne);
163 
164  // file suffix custom negative list
165  $ta = new ilTextAreaInputGUI($this->lng->txt(
166  "file_suffix_custom_negative"),
167  "suffix_repl_additional"
168  );
169  $ta->setInfo($this->lng->txt("file_suffix_custom_negative_info"));
170  $ta->setRows(5);
171  $ta->setDisabled(!$permission_to_write);
172  $form->addItem($ta);
173 
174  // file suffix custom positive list
175  $ta = new ilTextAreaInputGUI($this->lng->txt(
176  "file_suffix_custom_positive"),
177  "suffix_custom_white_list"
178  );
179  $ta->setInfo($this->lng->txt("file_suffix_custom_positive_info"));
180  $ta->setRows(5);
181  $ta->setDisabled(!$permission_to_write);
182  $form->addItem($ta);
183 
184  // resulting overall positive list
185  $ne = new ilNonEditableValueGUI($this->lng->txt("file_suffix_overall_positive"), "");
186  $ne->setValue(implode(", ", ilFileUtils::getValidExtensions()));
187  $ne->setInfo($this->lng->txt("file_suffix_overall_positive_info"));
188  $form->addItem($ne);
189 
190  // explicit negative list
191  $ta = new ilTextAreaInputGUI(
192  $this->lng->txt("file_suffix_custom_expl_negative"),
193  "suffix_custom_expl_black"
194  );
195  $ta->setInfo($this->lng->txt("file_suffix_custom_expl_negative_info"));
196  $ta->setRows(5);
197  $ta->setDisabled(!$permission_to_write);
198  $form->addItem($ta);
199 
200  // command buttons
201  if ($permission_to_write) {
202  $form->addCommandButton('saveSettings', $this->lng->txt('save'));
203  $form->addCommandButton('view', $this->lng->txt('cancel'));
204  }
205 
206  return $form;
207  }
This class represents a property form user interface.
setInfo($a_info)
Set Information Text.
static getDefaultValidExtensionWhiteList()
Valid extensions.
static getValidExtensions()
Valid extensions.
This class represents a non editable value in a property form.
This class represents a text area property in a property form.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ saveSettings()

ilObjFileServicesGUI::saveSettings ( )
protected

Save settings.

Definition at line 235 of file class.ilObjFileServicesGUI.php.

References $_POST, checkPermissionOrFail(), initSettingsForm(), and settings().

235  :void
236  {
237  $this->checkPermissionOrFail("write");
238 
239  // get form
240  $form = $this->initSettingsForm();
241  if ($form->checkInput()) {
242  $this->settings->set("suffix_repl_additional", $_POST["suffix_repl_additional"]);
243  $this->settings->set("suffix_custom_white_list", $_POST["suffix_custom_white_list"]);
244  $this->settings->set("suffix_custom_expl_black", $_POST["suffix_custom_expl_black"]);
245 
246  ilUtil::sendSuccess($this->lng->txt('settings_saved'), true);
247  $this->ctrl->redirect($this, self::CMD_EDIT_SETTINGS);
248  } else {
249  $form->setValuesByPost();
250  $this->tpl->setContent($form->getHTML());
251  }
252  }
settings()
Definition: settings.php:2
initSettingsForm()
Initializes the settings form.
$_POST["username"]
+ Here is the call graph for this function:

◆ setTitleAndDescription()

ilObjFileServicesGUI::setTitleAndDescription ( )

called by prepare output

Definition at line 141 of file class.ilObjFileServicesGUI.php.

141  : void
142  {
143  parent::setTitleAndDescription();
144  $this->tpl->setDescription($this->object->getDescription());
145  }

Field Documentation

◆ $ctrl

ilObjFileServicesGUI::$ctrl
protected

Definition at line 32 of file class.ilObjFileServicesGUI.php.

◆ $error_handling

ilObjFileServicesGUI::$error_handling

Definition at line 28 of file class.ilObjFileServicesGUI.php.

◆ $lng

ilObjFileServicesGUI::$lng

Definition at line 24 of file class.ilObjFileServicesGUI.php.

◆ $rbacsystem

ilObjFileServicesGUI::$rbacsystem
protected

Definition at line 16 of file class.ilObjFileServicesGUI.php.

Referenced by getAdminTabs().

◆ $settings

ilObjFileServicesGUI::$settings
protected

ilSetting

Definition at line 36 of file class.ilObjFileServicesGUI.php.

◆ $tabs

ilObjFileServicesGUI::$tabs
protected

Definition at line 20 of file class.ilObjFileServicesGUI.php.

◆ $tpl

ilObjFileServicesGUI::$tpl

Definition at line 40 of file class.ilObjFileServicesGUI.php.

◆ CMD_EDIT_SETTINGS

const ilObjFileServicesGUI::CMD_EDIT_SETTINGS = 'editSettings'

Definition at line 11 of file class.ilObjFileServicesGUI.php.


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