ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
ilObjMediaObjectsSettingsGUI Class Reference

Media Objects/Pools Settings. More...

+ Inheritance diagram for ilObjMediaObjectsSettingsGUI:
+ Collaboration diagram for ilObjMediaObjectsSettingsGUI:

Public Member Functions

 __construct ($a_data, $a_id, $a_call_by_reference=true, $a_prepare_output=true)
 Contructor. More...
 
 executeCommand ()
 Execute command. More...
 
 getAdminTabs ()
 Get tabs. More...
 
 editSettings ($a_omit_init=false)
 Edit settings. More...
 
 saveSettings ()
 Save settings. More...
 
 initMediaObjectsSettingsForm ()
 Init media objects settings form. More...
 
 getSettingsValues ()
 Get current values for form from. 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...
 
 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 ()
 list childs of current object More...
 
 deleteObject ($a_error=false)
 Display deletion confirmation screen. More...
 
 cloneAllObject ()
 Clone single (not container object) Method is overwritten in ilContainerGUI. 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...
 
- Data Fields inherited from ilObjectGUI
const COPY_WIZARD_NEEDS_PAGE = 1
 
 $ilias
 
 $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 inherited from ilObjectGUI
 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...
 
 showMountWebfolderIcon ()
 
 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...
 
 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...
 
 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 inherited from ilObjectGUI
 $tmp_import_dir
 
 $tabs_gui = null
 
 $ctrl
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilObjMediaObjectsSettingsGUI::__construct (   $a_data,
  $a_id,
  $a_call_by_reference = true,
  $a_prepare_output = true 
)

Contructor.

public

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

25  {
26  $this->type = 'mobs';
27  parent::__construct($a_data, $a_id, $a_call_by_reference, $a_prepare_output);
28 
29  $this->lng->loadLanguageModule('mob');
30  $this->lng->loadLanguageModule('mep');
31  $this->lng->loadLanguageModule('content');
32  }

Member Function Documentation

◆ editSettings()

ilObjMediaObjectsSettingsGUI::editSettings (   $a_omit_init = false)

Edit settings.

Definition at line 103 of file class.ilObjMediaObjectsSettingsGUI.php.

References ilObjectGUI\$tpl, getSettingsValues(), and initMediaObjectsSettingsForm().

Referenced by saveSettings().

104  {
105  global $tpl;
106 
107  if (!$a_omit_init)
108  {
110  $this->getSettingsValues();
111  }
112  $tpl->setContent($this->form->getHTML());
113  }
getSettingsValues()
Get current values for form from.
initMediaObjectsSettingsForm()
Init media objects settings form.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ executeCommand()

ilObjMediaObjectsSettingsGUI::executeCommand ( )

Execute command.

public

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

References $cmd, $ilErr, $ret, and ilObjectGUI\prepareOutput().

41  {
42  global $rbacsystem,$ilErr,$ilAccess;
43 
44  $next_class = $this->ctrl->getNextClass($this);
45  $cmd = $this->ctrl->getCmd();
46 
47  $this->prepareOutput();
48 
49  if(!$ilAccess->checkAccess('read','',$this->object->getRefId()))
50  {
51  $ilErr->raiseError($this->lng->txt('no_permission'),$ilErr->WARNING);
52  }
53 
54  switch($next_class)
55  {
56  case 'ilpermissiongui':
57  $this->tabs_gui->setTabActive('perm_settings');
58  include_once("Services/AccessControl/classes/class.ilPermissionGUI.php");
59  $perm_gui = new ilPermissionGUI($this);
60  $ret = $this->ctrl->forwardCommand($perm_gui);
61  break;
62 
63  default:
64  if(!$cmd || $cmd == 'view')
65  {
66  $cmd = "editSettings";
67  }
68 
69  $this->$cmd();
70  break;
71  }
72  return true;
73  }
global $ilErr
Definition: raiseError.php:16
$cmd
Definition: sahs_server.php:35
prepareOutput($a_show_subobjects=true)
prepare output
$ret
Definition: parser.php:6
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
+ Here is the call graph for this function:

◆ getAdminTabs()

ilObjMediaObjectsSettingsGUI::getAdminTabs ( )

Get tabs.

public

Definition at line 81 of file class.ilObjMediaObjectsSettingsGUI.php.

References array.

82  {
83  global $rbacsystem, $ilAccess, $ilTabs;
84 
85  if ($ilAccess->checkAccess("write", "", $this->object->getRefId()))
86  {
87  $ilTabs->addTarget("settings",
88  $this->ctrl->getLinkTarget($this, "editSettings"),
89  array("editSettings", "view"));
90  }
91 
92  if ($ilAccess->checkAccess('edit_permission', "", $this->object->getRefId()))
93  {
94  $ilTabs->addTarget("perm_settings",
95  $this->ctrl->getLinkTargetByClass('ilpermissiongui',"perm"),
96  array(),'ilpermissiongui');
97  }
98  }
Create styles array
The data for the language used.

◆ getSettingsValues()

ilObjMediaObjectsSettingsGUI::getSettingsValues ( )

Get current values for form from.

Definition at line 194 of file class.ilObjMediaObjectsSettingsGUI.php.

References array.

Referenced by editSettings().

195  {
196  $values = array();
197 
198  $mset = new ilSetting("mobs");
199  $values["activate_pages"] = $mset->get("mep_activate_pages");
200  $values["file_manager_always"] = $mset->get("file_manager_always");
201  $values["restricted_file_types"] = $mset->get("restricted_file_types");
202  $values["black_list_file_types"] = $mset->get("black_list_file_types");
203  $values["mob_upload_dir"] = $mset->get("upload_dir");
204 
205  $this->form->setValuesByArray($values);
206  }
ILIAS Setting Class.
Create styles array
The data for the language used.
+ Here is the caller graph for this function:

◆ initMediaObjectsSettingsForm()

ilObjMediaObjectsSettingsGUI::initMediaObjectsSettingsForm ( )

Init media objects settings form.

Definition at line 146 of file class.ilObjMediaObjectsSettingsGUI.php.

References $ilCtrl, ilObjectGUI\$lng, and ilFormPropertyGUI\setInfo().

Referenced by editSettings(), and saveSettings().

147  {
148  global $lng, $ilCtrl, $ilAccess;
149 
150 
151  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
152  $this->form = new ilPropertyFormGUI();
153 
154  // activate page in media pool
155  $cb = new ilCheckboxInputGUI($lng->txt("mobs_activate_pages"), "activate_pages");
156  $cb->setInfo($lng->txt("mobs_activate_pages_info"));
157  $this->form->addItem($cb);
158 
159  // activate page in media pool
160  $cb = new ilCheckboxInputGUI($lng->txt("mobs_always_show_file_manager"), "file_manager_always");
161  $cb->setInfo($lng->txt("mobs_always_show_file_manager_info"));
162  $this->form->addItem($cb);
163 
164  // allowed file types
165  $ta = new ilTextAreaInputGUI($this->lng->txt("mobs_restrict_file_types"), "restricted_file_types");
166  //$ta->setCols();
167  //$ta->setRows();
168  $ta->setInfo($this->lng->txt("mobs_restrict_file_types_info"));
169  $this->form->addItem($ta);
170 
171  // black lis file types
172  $ta = new ilTextAreaInputGUI($this->lng->txt("mobs_black_list_file_types"), "black_list_file_types");
173  $ta->setInfo($this->lng->txt("mobs_black_list_file_types_info"));
174  $this->form->addItem($ta);
175 
176  // Upload dir for learning resources
177  $tx_prop = new ilTextInputGUI($lng->txt("mob_upload_dir"),
178  "mob_upload_dir");
179  $tx_prop->setInfo($lng->txt("mob_upload_dir_info"));
180  $this->form->addItem($tx_prop);
181 
182  if($ilAccess->checkAccess('write','',$this->object->getRefId()))
183  {
184  $this->form->addCommandButton("saveSettings", $lng->txt("save"));
185  }
186 
187  $this->form->setTitle($lng->txt("settings"));
188  $this->form->setFormAction($ilCtrl->getFormAction($this));
189  }
This class represents a property form user interface.
This class represents a checkbox property in a property form.
global $ilCtrl
Definition: ilias.php:18
setInfo($a_info)
Set Information Text.
This class represents a text property 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()

ilObjMediaObjectsSettingsGUI::saveSettings ( )

Save settings.

Definition at line 118 of file class.ilObjMediaObjectsSettingsGUI.php.

References $_POST, $ilCtrl, ilObjectGUI\$lng, ilObjectGUI\$tpl, ilObjectGUI\checkPermission(), editSettings(), initMediaObjectsSettingsForm(), and ilUtil\sendSuccess().

119  {
120  global $tpl, $lng, $ilCtrl;
121 
122  $this->checkPermission("write");
123 
125  if ($this->form->checkInput())
126  {
127  // perform save
128  $mset = new ilSetting("mobs");
129  $mset->set("mep_activate_pages", $_POST["activate_pages"]);
130  $mset->set("file_manager_always", $_POST["file_manager_always"]);
131  $mset->set("restricted_file_types", $_POST["restricted_file_types"]);
132  $mset->set("black_list_file_types", $_POST["black_list_file_types"]);
133  $mset->set("upload_dir", $_POST["mob_upload_dir"]);
134 
135  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
136  $ilCtrl->redirect($this, "editSettings");
137  }
138 
139  $this->form->setValuesByPost();
140  $this->editSettings(true);
141  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
ILIAS Setting Class.
initMediaObjectsSettingsForm()
Init media objects settings form.
global $ilCtrl
Definition: ilias.php:18
editSettings($a_omit_init=false)
Edit settings.
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission and redirect on error.
$_POST["username"]
+ Here is the call graph for this function:

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