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

Learning Resources Settings. More...

+ Inheritance diagram for ilObjLearningResourcesSettingsGUI:
+ Collaboration diagram for ilObjLearningResourcesSettingsGUI:

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 ()
 Edit learning resources settings. More...
 
 saveSettings ()
 Save learning resources settings. More...
 
 addToExternalSettingsForm ($a_form_id)
 
- 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...
 

Static Private Attributes

static $ERROR_MESSAGE
 

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

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

Contructor.

public

Definition at line 27 of file class.ilObjLearningResourcesSettingsGUI.php.

28  {
29  $this->type = 'lrss';
30  parent::__construct($a_data, $a_id, $a_call_by_reference, $a_prepare_output);
31 
32  $this->lng->loadLanguageModule('content');
33  }

Member Function Documentation

◆ addToExternalSettingsForm()

ilObjLearningResourcesSettingsGUI::addToExternalSettingsForm (   $a_form_id)

Definition at line 279 of file class.ilObjLearningResourcesSettingsGUI.php.

References ilPrivacySettings\_getInstance(), array, ilAdministrationSettingsFormHandler\FORM_PRIVACY, and ilAdministrationSettingsFormHandler\VALUE_BOOL.

280  {
281  switch($a_form_id)
282  {
284 
285  $privacy = ilPrivacySettings::_getInstance();
286 
287  $fields = array('enable_sahs_protocol_data' => array($privacy->enabledSahsProtocolData(), ilAdministrationSettingsFormHandler::VALUE_BOOL));
288 
289  return array(array("editSettings", $fields));
290  }
291  }
Create styles array
The data for the language used.
static _getInstance()
Get instance of ilPrivacySettings.
+ Here is the call graph for this function:

◆ editSettings()

ilObjLearningResourcesSettingsGUI::editSettings ( )

Edit learning resources settings.

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

References $ilCtrl, $ilSetting, $lm_set, ilObjectGUI\$lng, ilPrivacySettings\_getInstance(), ilFormPropertyGUI\setInfo(), and ilNumberInputGUI\setSize().

119  {
120  global $ilCtrl, $lng, $ilSetting;
121 
122  $lm_set = new ilSetting("lm");
123  $lic_set = new ilSetting("license");
124  $lng->loadLanguageModule("license");
125  $lng->loadLanguageModule("scormdebug");
126 
127  include_once("./Services/Form/classes/class.ilPropertyFormGUI.php");
128  $form = new ilPropertyFormGUI();
129  $form->setFormAction($ilCtrl->getFormAction($this));
130  $form->setTitle($lng->txt("cont_lrs_settings"));
131 
132  // Page History
133  $cb_prop = new ilCheckboxInputGUI($lng->txt("cont_enable_page_history"),
134  "page_history");
135  $cb_prop->setInfo($lng->txt("cont_enable_page_history_info"));
136  $cb_prop->setChecked($lm_set->get("page_history", 1));
137  $form->addItem($cb_prop);
138 
139  // Time scheduled page activation
140  $cb_prop = new ilCheckboxInputGUI($lng->txt("cont_enable_time_scheduled_page_activation"),
141  "time_scheduled_page_activation");
142  $cb_prop->setInfo($lng->txt("cont_enable_time_scheduled_page_activation_info"));
143  $cb_prop->setChecked($lm_set->get("time_scheduled_page_activation"));
144  $form->addItem($cb_prop);
145 
146  // Activate replace media object function
147  $cb_prop = new ilCheckboxInputGUI($lng->txt("cont_replace_mob_feature"),
148  "replace_mob_feature");
149  $cb_prop->setInfo($lng->txt("cont_replace_mob_feature_info"));
150  $cb_prop->setChecked($lm_set->get("replace_mob_feature"));
151  $form->addItem($cb_prop);
152 
153  // Activate HTML export IDs
154  $cb_prop = new ilCheckboxInputGUI($lng->txt("cont_html_export_ids"),
155  "html_export_ids");
156  $cb_prop->setInfo($lng->txt("cont_html_export_ids_info"));
157  $cb_prop->setChecked($lm_set->get("html_export_ids"));
158  $form->addItem($cb_prop);
159 
160  // Upload dir for learning resources
161  $tx_prop = new ilTextInputGUI($lng->txt("cont_upload_dir"),
162  "cont_upload_dir");
163  $tx_prop->setInfo($lng->txt("cont_upload_dir_info"));
164  $tx_prop->setValue($lm_set->get("cont_upload_dir"));
165  $form->addItem($tx_prop);
166 
167 
168  // license activation
169  $cb_prop = new ilCheckboxInputGUI($lng->txt("license_counter"),
170  "license_counter");
171  $cb_prop->setInfo($lng->txt("license_counter_info"));
172  $cb_prop->setChecked($lic_set->get("license_counter"));
173  $form->addItem($cb_prop);
174 
175  // license warning
176  $tx_prop = new ilNumberInputGUI($lng->txt("license_warning"),
177  "license_warning");
178  $tx_prop->setSize(5);
179  $tx_prop->setInfo($lng->txt("license_warning_info"));
180  $tx_prop->setValue($lic_set->get("license_warning"));
181  $form->addItem($tx_prop);
182 
183  // scormDebugger activation
184  $cb_prop = new ilCheckboxInputGUI($lng->txt("scormdebug_global_activate"),"scormdebug_global_activate");
185  $cb_prop->setInfo($lng->txt("scormdebug_global_activate_info"));
186  $cb_prop->setChecked($lm_set->get("scormdebug_global_activate"));
187  $form->addItem($cb_prop);
188 
189  // scorm2004 login instead of userId for cmi.learner_id
190  $cb_prop = new ilCheckboxInputGUI($lng->txt("scorm_login_as_learner_id"),
191  "scorm_login_as_learner_id");
192  $cb_prop->setInfo($lng->txt("scorm_login_as_learner_id_info"));
193  $cb_prop->setChecked($lm_set->get("scorm_login_as_learner_id"));
194  $form->addItem($cb_prop);
195 
196  // scorm2004 disableRTECaching
197  $cb_prop = new ilCheckboxInputGUI($lng->txt("scormdebug_disable_cache"),
198  "scormdebug_disable_cache");
199  $cb_prop->setInfo($lng->txt("scormdebug_disable_cache_info"));
200  $cb_prop->setChecked($lm_set->get("scormdebug_disable_cache"));
201  $form->addItem($cb_prop);
202 
203  // scorm2004 without session
204  $cb_prop = new ilCheckboxInputGUI($lng->txt("scorm_without_session"),
205  "scorm_without_session");
206  $cb_prop->setInfo($lng->txt("scorm_without_session_info"));
207  $cb_prop->setChecked($lm_set->get("scorm_without_session"));
208  $form->addItem($cb_prop);
209 
210  $privacy = ilPrivacySettings::_getInstance();
211  $check = new ilCheckboxInputGui($lng->txt('enable_sahs_protocol_data'), 'enable_sahs_pd');
212  $check->setInfo($this->lng->txt('enable_sahs_protocol_data_desc'));
213  $check->setChecked($privacy->enabledSahsProtocolData());
214  $form->addItem($check);
215 
216  // show and export protocol data with name
217  $check = new ilCheckboxInputGui($this->lng->txt('ps_export_scorm'), 'export_scorm');
218  $check->setInfo($this->lng->txt('enable_export_scorm_desc'));
219  $check->setChecked($privacy->enabledExportSCORM());
220  $form->addItem($check);
221 
222  // scorm auto-setting for learning progress
223  $cb_prop = new ilCheckboxInputGUI($lng->txt("scorm_lp_auto_activate"),"scorm_lp_auto_activate");
224  $cb_prop->setInfo($lng->txt("scorm_lp_auto_activate_info"));
225  $cb_prop->setChecked($lm_set->get("scorm_lp_auto_activate"));
226  $form->addItem($cb_prop);
227 
228  // command buttons
229  $form->addCommandButton("saveSettings", $lng->txt("save"));
230  $form->addCommandButton("view", $lng->txt("cancel"));
231 
232  $this->tpl->setContent($form->getHTML());
233  }
ILIAS Setting Class.
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 number property in a property form.
This class represents a text property in a property form.
setSize($a_size)
Set Size.
$lm_set
global $ilSetting
Definition: privfeed.php:17
static _getInstance()
Get instance of ilPrivacySettings.
+ Here is the call graph for this function:

◆ executeCommand()

ilObjLearningResourcesSettingsGUI::executeCommand ( )

Execute command.

public

Definition at line 41 of file class.ilObjLearningResourcesSettingsGUI.php.

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

42  {
43  global $rbacsystem,$ilErr,$ilAccess;
44 
45  $next_class = $this->ctrl->getNextClass($this);
46  $cmd = $this->ctrl->getCmd();
47 
48  $this->prepareOutput();
49 
50  if(!$ilAccess->checkAccess('read','',$this->object->getRefId()))
51  {
52  $ilErr->raiseError($this->lng->txt('no_permission'),$ilErr->WARNING);
53  }
54 
55  switch($next_class)
56  {
57  case 'illicenseoverviewgui':
58  include_once("./Services/License/classes/class.ilLicenseOverviewGUI.php");
60  $ret = $this->ctrl->forwardCommand($license_gui);
61  break;
62 
63  case 'ilpermissiongui':
64  $this->tabs_gui->setTabActive('perm_settings');
65  include_once("Services/AccessControl/classes/class.ilPermissionGUI.php");
66  $perm_gui = new ilPermissionGUI($this);
67  $ret = $this->ctrl->forwardCommand($perm_gui);
68  break;
69 
70  default:
71  if(!$cmd || $cmd == 'view')
72  {
73  $cmd = "editSettings";
74  }
75 
76  $this->$cmd();
77  break;
78  }
79  return true;
80  }
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()

ilObjLearningResourcesSettingsGUI::getAdminTabs ( )

Get tabs.

public

Definition at line 88 of file class.ilObjLearningResourcesSettingsGUI.php.

References $ilSetting, ilLicenseAccess\_isEnabled(), and array.

89  {
90  global $rbacsystem, $ilAccess, $ilSetting;
91 
92  if ($rbacsystem->checkAccess("visible,read",$this->object->getRefId()))
93  {
94  $this->tabs_gui->addTarget("cont_edit_lrs_settings",
95  $this->ctrl->getLinkTarget($this, "editSettings"),
96  array("editSettings", "view"));
97 
98  include_once("Services/License/classes/class.ilLicenseAccess.php");
100  {
101  $this->tabs_gui->addTarget("licenses",
102  $this->ctrl->getLinkTargetByClass('illicenseoverviewgui', ''),
103  "", "illicenseoverviewgui");
104  }
105  }
106 
107  if ($rbacsystem->checkAccess('edit_permission',$this->object->getRefId()))
108  {
109  $this->tabs_gui->addTarget("perm_settings",
110  $this->ctrl->getLinkTargetByClass('ilpermissiongui',"perm"),
111  array(),'ilpermissiongui');
112  }
113  }
static _isEnabled()
Check, if licencing is enabled This check is called from the ilAccessHandler class.
Create styles array
The data for the language used.
global $ilSetting
Definition: privfeed.php:17
+ Here is the call graph for this function:

◆ saveSettings()

ilObjLearningResourcesSettingsGUI::saveSettings ( )

Save learning resources settings.

Definition at line 238 of file class.ilObjLearningResourcesSettingsGUI.php.

References $_POST, $ilCtrl, $ilSetting, $lm_set, ilPrivacySettings\_getInstance(), ilUtil\sendSuccess(), and ilUtil\stripSlashes().

239  {
240  global $ilCtrl, $ilSetting;
241 
242  $lm_set = new ilSetting("lm");
243  $lm_set->set("time_scheduled_page_activation",
244  ilUtil::stripSlashes($_POST["time_scheduled_page_activation"]));
245  $lm_set->set("page_history",
246  (int) ilUtil::stripSlashes($_POST["page_history"]));
247  $lm_set->set("replace_mob_feature",
248  ilUtil::stripSlashes($_POST["replace_mob_feature"]));
249  $lm_set->set("html_export_ids",
250  ilUtil::stripSlashes($_POST["html_export_ids"]));
251  $lm_set->set("cont_upload_dir",
252  ilUtil::stripSlashes($_POST["cont_upload_dir"]));
253  $lm_set->setScormDebug("scormdebug_global_activate",
254  ilUtil::stripSlashes($_POST["scormdebug_global_activate"]));
255  $lm_set->set("scorm_login_as_learner_id",
256  ilUtil::stripSlashes($_POST["scorm_login_as_learner_id"]));
257  $lm_set->set("scormdebug_disable_cache",
258  ilUtil::stripSlashes($_POST["scormdebug_disable_cache"]));
259  $lm_set->set("scorm_without_session",
260  ilUtil::stripSlashes($_POST["scorm_without_session"]));
261  $lm_set->set("scorm_lp_auto_activate",
262  ilUtil::stripSlashes($_POST["scorm_lp_auto_activate"]));
263  $lic_set = new ilSetting("license");
264  $lic_set->set("license_counter",
265  ilUtil::stripSlashes($_POST["license_counter"]));
266  $lic_set->set("license_warning",
267  ilUtil::stripSlashes($_POST["license_warning"]));
268 
269  $privacy = ilPrivacySettings::_getInstance();
270  $privacy->enableSahsProtocolData((int) $_POST['enable_sahs_pd']);
271  $privacy->enableExportSCORM((int) $_POST['export_scorm']);
272  $privacy->save();
273 
274  ilUtil::sendSuccess($this->lng->txt("settings_saved"),true);
275 
276  $ilCtrl->redirect($this, "view");
277  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
ILIAS Setting Class.
global $ilCtrl
Definition: ilias.php:18
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
$lm_set
global $ilSetting
Definition: privfeed.php:17
static _getInstance()
Get instance of ilPrivacySettings.
$_POST["username"]
+ Here is the call graph for this function:

Field Documentation

◆ $ERROR_MESSAGE

ilObjLearningResourcesSettingsGUI::$ERROR_MESSAGE
staticprivate

Definition at line 21 of file class.ilObjLearningResourcesSettingsGUI.php.


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