ILIAS  release_4-4 Revision
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
 ilObjectGUI ($a_data, $a_id=0, $a_call_by_reference=true, $a_prepare_output=true)
 Constructor public. More...
 
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...
 
 getAdminTabs (&$tabs_gui)
 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 ($in_rep=false)
 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...
 
 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 ()
 
 prepareOutput ()
 prepare output More...
 
 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...
 
 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)
 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...
 
 getTitlesByRefId ($a_ref_ids)
 get Titles of objects this method is used for error messages in methods cut/copy/paste More...
 
 getTabs (&$tabs_gui)
 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 ($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()

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::ilObjectGUI($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 264 of file class.ilObjLearningResourcesSettingsGUI.php.

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

265  {
266  switch($a_form_id)
267  {
269 
270  $privacy = ilPrivacySettings::_getInstance();
271 
272  $fields = array('enable_sahs_protocol_data' => array($privacy->enabledSahsProtocolData(), ilAdministrationSettingsFormHandler::VALUE_BOOL));
273 
274  return array(array("editSettings", $fields));
275  }
276  }
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 ilTextInputGUI\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 ilTextInputGUI($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  // command buttons
217  $form->addCommandButton("saveSettings", $lng->txt("save"));
218  $form->addCommandButton("view", $lng->txt("cancel"));
219 
220  $this->tpl->setContent($form->getHTML());
221  }
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.
setSize($a_size)
Set Size.
This class represents a text property in a property form.
$lm_set
global $ilSetting
Definition: privfeed.php:40
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, 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");
59  $license_gui =& new ilLicenseOverviewGUI($this,LIC_MODE_ADMINISTRATION);
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  }
$cmd
Definition: sahs_server.php:35
prepareOutput()
prepare output
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
const LIC_MODE_ADMINISTRATION
+ 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, and ilLicenseAccess\_isEnabled().

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.
global $ilSetting
Definition: privfeed.php:40
+ Here is the call graph for this function:

◆ saveSettings()

ilObjLearningResourcesSettingsGUI::saveSettings ( )

Save learning resources settings.

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

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

227  {
228  global $ilCtrl, $ilSetting;
229 
230  $lm_set = new ilSetting("lm");
231  $lm_set->set("time_scheduled_page_activation",
232  ilUtil::stripSlashes($_POST["time_scheduled_page_activation"]));
233  $lm_set->set("page_history",
234  (int) ilUtil::stripSlashes($_POST["page_history"]));
235  $lm_set->set("replace_mob_feature",
236  ilUtil::stripSlashes($_POST["replace_mob_feature"]));
237  $lm_set->set("html_export_ids",
238  ilUtil::stripSlashes($_POST["html_export_ids"]));
239  $lm_set->set("cont_upload_dir",
240  ilUtil::stripSlashes($_POST["cont_upload_dir"]));
241  $lm_set->setScormDebug("scormdebug_global_activate",
242  ilUtil::stripSlashes($_POST["scormdebug_global_activate"]));
243  $lm_set->set("scorm_login_as_learner_id",
244  ilUtil::stripSlashes($_POST["scorm_login_as_learner_id"]));
245  $lm_set->set("scormdebug_disable_cache",
246  ilUtil::stripSlashes($_POST["scormdebug_disable_cache"]));
247  $lm_set->set("scorm_without_session",
248  ilUtil::stripSlashes($_POST["scorm_without_session"]));
249  $lic_set = new ilSetting("license");
250  $lic_set->set("license_counter",
251  ilUtil::stripSlashes($_POST["license_counter"]));
252  $lic_set->set("license_warning",
253  ilUtil::stripSlashes($_POST["license_warning"]));
254 
255  $privacy = ilPrivacySettings::_getInstance();
256  $privacy->enableSahsProtocolData((int) $_POST['enable_sahs_pd']);
257  $privacy->save();
258 
259  ilUtil::sendSuccess($this->lng->txt("settings_saved"),true);
260 
261  $ilCtrl->redirect($this, "view");
262  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
ILIAS Setting Class.
$_POST['username']
Definition: cron.php:12
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:40
static _getInstance()
Get instance of ilPrivacySettings.
+ 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: