ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
All Data Structures Namespaces Files Functions Variables Modules Pages
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...
 
 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 ()
 

Protected Attributes

 $error
 
 $access
 
 $tabs
 
- Protected Attributes inherited from ilObjectGUI
 $ilErr
 
 $locator
 
 $user
 
 $access
 
 $rbacsystem
 
 $settings
 
 $rbacreview
 
 $toolbar
 
 $tmp_import_dir
 
 $tabs_gui = null
 
 $ctrl
 
 $object_service
 
 $favourites
 

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
 
 $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
 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...
 

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 40 of file class.ilObjMediaObjectsSettingsGUI.php.

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

41  {
42  global $DIC;
43  $this->error = $DIC["ilErr"];
44  $this->access = $DIC->access();
45  $this->tabs = $DIC->tabs();
46  $this->tpl = $DIC["tpl"];
47  $this->lng = $DIC->language();
48  $this->ctrl = $DIC->ctrl();
49  $this->type = 'mobs';
50  parent::__construct($a_data, $a_id, $a_call_by_reference, $a_prepare_output);
51 
52  $this->lng->loadLanguageModule('mob');
53  $this->lng->loadLanguageModule('mep');
54  $this->lng->loadLanguageModule('content');
55  }
__construct(Container $dic, ilPlugin $plugin)
$DIC
Definition: xapitoken.php:46
+ Here is the call graph for this function:

Member Function Documentation

◆ editSettings()

ilObjMediaObjectsSettingsGUI::editSettings (   $a_omit_init = false)

Edit settings.

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

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

Referenced by saveSettings().

126  {
127  $tpl = $this->tpl;
128 
129  if (!$a_omit_init) {
131  $this->getSettingsValues();
132  }
133  $tpl->setContent($this->form->getHTML());
134  }
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 63 of file class.ilObjMediaObjectsSettingsGUI.php.

References $ret, and ilObjectGUI\prepareOutput().

64  {
65  $next_class = $this->ctrl->getNextClass($this);
66  $cmd = $this->ctrl->getCmd();
67 
68  $this->prepareOutput();
69 
70  if (!$this->rbacsystem->checkAccess("visible,read", $this->object->getRefId())) {
71  $this->error->raiseError($this->lng->txt('no_permission'), $this->error->WARNING);
72  }
73 
74  switch ($next_class) {
75  case 'ilpermissiongui':
76  $this->tabs_gui->setTabActive('perm_settings');
77  include_once("Services/AccessControl/classes/class.ilPermissionGUI.php");
78  $perm_gui = new ilPermissionGUI($this);
79  $ret = $this->ctrl->forwardCommand($perm_gui);
80  break;
81 
82  default:
83  if (!$cmd || $cmd == 'view') {
84  $cmd = "editSettings";
85  }
86 
87  $this->$cmd();
88  break;
89  }
90  return true;
91  }
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 99 of file class.ilObjMediaObjectsSettingsGUI.php.

References $access, and $tabs.

100  {
101  $ilAccess = $this->access;
102  $ilTabs = $this->tabs;
103 
104  if ($ilAccess->checkAccess("write", "", $this->object->getRefId())) {
105  $ilTabs->addTarget(
106  "settings",
107  $this->ctrl->getLinkTarget($this, "editSettings"),
108  array("editSettings", "view")
109  );
110  }
111 
112  if ($ilAccess->checkAccess('edit_permission', "", $this->object->getRefId())) {
113  $ilTabs->addTarget(
114  "perm_settings",
115  $this->ctrl->getLinkTargetByClass('ilpermissiongui', "perm"),
116  array(),
117  'ilpermissiongui'
118  );
119  }
120  }

◆ getSettingsValues()

ilObjMediaObjectsSettingsGUI::getSettingsValues ( )

Get current values for form from.

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

Referenced by editSettings().

220  {
221  $values = array();
222 
223  $mset = new ilSetting("mobs");
224  $values["activate_pages"] = $mset->get("mep_activate_pages");
225  $values["file_manager_always"] = $mset->get("file_manager_always");
226  $values["restricted_file_types"] = $mset->get("restricted_file_types");
227  $values["black_list_file_types"] = $mset->get("black_list_file_types");
228  $values["mob_upload_dir"] = $mset->get("upload_dir");
229 
230  $this->form->setValuesByArray($values);
231  }
+ Here is the caller graph for this function:

◆ initMediaObjectsSettingsForm()

ilObjMediaObjectsSettingsGUI::initMediaObjectsSettingsForm ( )

Init media objects settings form.

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

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

Referenced by editSettings(), and saveSettings().

169  {
170  $lng = $this->lng;
172  $ilAccess = $this->access;
173 
174 
175  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
176  $this->form = new ilPropertyFormGUI();
177 
178  // activate page in media pool
179  $cb = new ilCheckboxInputGUI($lng->txt("mobs_activate_pages"), "activate_pages");
180  $cb->setInfo($lng->txt("mobs_activate_pages_info"));
181  $this->form->addItem($cb);
182 
183  // activate page in media pool
184  $cb = new ilCheckboxInputGUI($lng->txt("mobs_always_show_file_manager"), "file_manager_always");
185  $cb->setInfo($lng->txt("mobs_always_show_file_manager_info"));
186  $this->form->addItem($cb);
187 
188  // allowed file types
189  $ta = new ilTextAreaInputGUI($this->lng->txt("mobs_restrict_file_types"), "restricted_file_types");
190  //$ta->setCols();
191  //$ta->setRows();
192  $ta->setInfo($this->lng->txt("mobs_restrict_file_types_info"));
193  $this->form->addItem($ta);
194 
195  // black lis file types
196  $ta = new ilTextAreaInputGUI($this->lng->txt("mobs_black_list_file_types"), "black_list_file_types");
197  $ta->setInfo($this->lng->txt("mobs_black_list_file_types_info"));
198  $this->form->addItem($ta);
199 
200  // Upload dir for learning resources
201  $tx_prop = new ilTextInputGUI(
202  $lng->txt("mob_upload_dir"),
203  "mob_upload_dir"
204  );
205  $tx_prop->setInfo($lng->txt("mob_upload_dir_info"));
206  $this->form->addItem($tx_prop);
207 
208  if ($ilAccess->checkAccess('write', '', $this->object->getRefId())) {
209  $this->form->addCommandButton("saveSettings", $lng->txt("save"));
210  }
211 
212  $this->form->setTitle($lng->txt("settings"));
213  $this->form->setFormAction($ilCtrl->getFormAction($this));
214  }
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 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 139 of file class.ilObjMediaObjectsSettingsGUI.php.

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

140  {
141  $tpl = $this->tpl;
142  $lng = $this->lng;
144 
145  $this->checkPermission("write");
146 
148  if ($this->form->checkInput()) {
149  // perform save
150  $mset = new ilSetting("mobs");
151  $mset->set("mep_activate_pages", $_POST["activate_pages"]);
152  $mset->set("file_manager_always", $_POST["file_manager_always"]);
153  $mset->set("restricted_file_types", $_POST["restricted_file_types"]);
154  $mset->set("black_list_file_types", $_POST["black_list_file_types"]);
155  $mset->set("upload_dir", $_POST["mob_upload_dir"]);
156 
157  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
158  $ilCtrl->redirect($this, "editSettings");
159  }
160 
161  $this->form->setValuesByPost();
162  $this->editSettings(true);
163  }
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:

Field Documentation

◆ $access

ilObjMediaObjectsSettingsGUI::$access
protected

◆ $error

ilObjMediaObjectsSettingsGUI::$error
protected

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

◆ $tabs

ilObjMediaObjectsSettingsGUI::$tabs
protected

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

Referenced by getAdminTabs().


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