ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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...
 
 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 ()
 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...
 
 redirectAfterCreation ()
 Redirect after creation, see https://docu.ilias.de/goto_docu_wiki_wpage_5035_1357.html. More...
 

Protected Attributes

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

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

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

Contructor.

public

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

References $DIC, and settings().

37  {
38  global $DIC;
39 
40  $this->rbacsystem = $DIC->rbac()->system();
41  $this->error = $DIC["ilErr"];
42  $this->access = $DIC->access();
43  $this->settings = $DIC->settings();
44  $this->ctrl = $DIC->ctrl();
45  $this->lng = $DIC->language();
46  $this->type = 'lrss';
47  parent::__construct($a_data, $a_id, $a_call_by_reference, $a_prepare_output);
48 
49  $this->lng->loadLanguageModule('content');
50  }
settings()
Definition: settings.php:2
global $DIC
Definition: saml.php:7
+ Here is the call graph for this function:

Member Function Documentation

◆ addToExternalSettingsForm()

ilObjLearningResourcesSettingsGUI::addToExternalSettingsForm (   $a_form_id)

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

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

310  {
311  switch ($a_form_id) {
313 
314  $privacy = ilPrivacySettings::_getInstance();
315 
316  $fields = array('enable_sahs_protocol_data' => array($privacy->enabledSahsProtocolData(), ilAdministrationSettingsFormHandler::VALUE_BOOL));
317 
318  return array(array("editSettings", $fields));
319  }
320  }
static _getInstance()
Get instance of ilPrivacySettings.
+ Here is the call graph for this function:

◆ editSettings()

ilObjLearningResourcesSettingsGUI::editSettings ( )

Edit learning resources settings.

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

References ilObjectGUI\$ctrl, $form, $ilCtrl, $ilSetting, $lm_set, ilObjectGUI\$lng, PHPMailer\PHPMailer\$options, ilObjectGUI\$settings, $si, ilPrivacySettings\_getInstance(), ilObjectGUI\checkPermissionBool(), ilFormPropertyGUI\setInfo(), and ilSelectInputGUI\setOptions().

123  {
125  $lng = $this->lng;
127 
128  $lm_set = new ilSetting("lm");
129  $lng->loadLanguageModule("scormdebug");
130 
131  include_once("./Services/Form/classes/class.ilPropertyFormGUI.php");
132  $form = new ilPropertyFormGUI();
133  $form->setFormAction($ilCtrl->getFormAction($this));
134  $form->setTitle($lng->txt("cont_lrs_settings"));
135 
136  // Page History
137  $cb_prop = new ilCheckboxInputGUI(
138  $lng->txt("cont_enable_page_history"),
139  "page_history"
140  );
141  $cb_prop->setInfo($lng->txt("cont_enable_page_history_info"));
142  $cb_prop->setChecked($lm_set->get("page_history", 1));
143  $form->addItem($cb_prop);
144 
145  // Time scheduled page activation
146  $cb_prop = new ilCheckboxInputGUI(
147  $lng->txt("cont_enable_time_scheduled_page_activation"),
148  "time_scheduled_page_activation"
149  );
150  $cb_prop->setInfo($lng->txt("cont_enable_time_scheduled_page_activation_info"));
151  $cb_prop->setChecked($lm_set->get("time_scheduled_page_activation"));
152  $form->addItem($cb_prop);
153 
154  // lm starting point
155  $options = array(
156  "" => $this->lng->txt("cont_last_visited_page"),
157  "first" => $this->lng->txt("cont_first_page")
158  );
159  $si = new ilSelectInputGUI($this->lng->txt("cont_lm_starting_point"), "lm_starting_point");
160  $si->setOptions($options);
161  $si->setValue($lm_set->get("lm_starting_point"));
162  $si->setInfo($this->lng->txt("cont_lm_starting_point_info"));
163  $form->addItem($si);
164 
165  // Activate replace media object function
166  $cb_prop = new ilCheckboxInputGUI(
167  $lng->txt("cont_replace_mob_feature"),
168  "replace_mob_feature"
169  );
170  $cb_prop->setInfo($lng->txt("cont_replace_mob_feature_info"));
171  $cb_prop->setChecked($lm_set->get("replace_mob_feature"));
172  $form->addItem($cb_prop);
173 
174  // Activate HTML export IDs
175  $cb_prop = new ilCheckboxInputGUI(
176  $lng->txt("cont_html_export_ids"),
177  "html_export_ids"
178  );
179  $cb_prop->setInfo($lng->txt("cont_html_export_ids_info"));
180  $cb_prop->setChecked($lm_set->get("html_export_ids"));
181  $form->addItem($cb_prop);
182 
183  // Upload dir for learning resources
184  $tx_prop = new ilTextInputGUI(
185  $lng->txt("cont_upload_dir"),
186  "cont_upload_dir"
187  );
188  $tx_prop->setInfo($lng->txt("cont_upload_dir_info"));
189  $tx_prop->setValue($lm_set->get("cont_upload_dir"));
190  $form->addItem($tx_prop);
191 
192  // scormDebugger activation
193  $cb_prop = new ilCheckboxInputGUI($lng->txt("scormdebug_global_activate"), "scormdebug_global_activate");
194  $cb_prop->setInfo($lng->txt("scormdebug_global_activate_info"));
195  $cb_prop->setChecked($lm_set->get("scormdebug_global_activate"));
196  $form->addItem($cb_prop);
197 
198  // scorm2004 disableRTECaching
199  $cb_prop = new ilCheckboxInputGUI(
200  $lng->txt("scormdebug_disable_cache"),
201  "scormdebug_disable_cache"
202  );
203  $cb_prop->setInfo($lng->txt("scormdebug_disable_cache_info"));
204  $cb_prop->setChecked($lm_set->get("scormdebug_disable_cache"));
205  $form->addItem($cb_prop);
206 
207  // scorm2004 without session
208  $cb_prop = new ilCheckboxInputGUI(
209  $lng->txt("scorm_without_session"),
210  "scorm_without_session"
211  );
212  $cb_prop->setInfo($lng->txt("scorm_without_session_info"));
213  $cb_prop->setChecked($lm_set->get("scorm_without_session"));
214  $form->addItem($cb_prop);
215 
216  $privacy = ilPrivacySettings::_getInstance();
217  $check = new ilCheckboxInputGui($lng->txt('enable_sahs_protocol_data'), 'enable_sahs_pd');
218  $check->setInfo($this->lng->txt('enable_sahs_protocol_data_desc'));
219  $check->setChecked($privacy->enabledSahsProtocolData());
220  $form->addItem($check);
221 
222  // show and export protocol data with name
223  $check = new ilCheckboxInputGui($this->lng->txt('ps_export_scorm'), 'export_scorm');
224  $check->setInfo($this->lng->txt('enable_export_scorm_desc'));
225  $check->setChecked($privacy->enabledExportSCORM());
226  $form->addItem($check);
227 
228  // scorm auto-setting for learning progress
229  $cb_prop = new ilCheckboxInputGUI($lng->txt("scorm_lp_auto_activate"), "scorm_lp_auto_activate");
230  $cb_prop->setInfo($lng->txt("scorm_lp_auto_activate_info"));
231  $cb_prop->setChecked($lm_set->get("scorm_lp_auto_activate"));
232  $form->addItem($cb_prop);
233 
234  // command buttons
235  if ($this->checkPermissionBool("write")) {
236  $form->addCommandButton("saveSettings", $lng->txt("save"));
237  $form->addCommandButton("view", $lng->txt("cancel"));
238  }
239 
240  $this->tpl->setContent($form->getHTML());
241  }
This class represents a selection list property in a property form.
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.
if(isset($_POST['submit'])) $form
This class represents a text property in a property form.
setOptions($a_options)
Set Options.
$lm_set
global $ilSetting
Definition: privfeed.php:17
static _getInstance()
Get instance of ilPrivacySettings.
checkPermissionBool($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission.
+ Here is the call graph for this function:

◆ executeCommand()

ilObjLearningResourcesSettingsGUI::executeCommand ( )

Execute command.

public

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

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

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

References $rbacsystem.

98  {
100 
101  if ($rbacsystem->checkAccess("visible,read", $this->object->getRefId())) {
102  $this->tabs_gui->addTarget(
103  "cont_edit_lrs_settings",
104  $this->ctrl->getLinkTarget($this, "editSettings"),
105  array("editSettings", "view")
106  );
107  }
108 
109  if ($rbacsystem->checkAccess('edit_permission', $this->object->getRefId())) {
110  $this->tabs_gui->addTarget(
111  "perm_settings",
112  $this->ctrl->getLinkTargetByClass('ilpermissiongui', "perm"),
113  array(),
114  'ilpermissiongui'
115  );
116  }
117  }

◆ saveSettings()

ilObjLearningResourcesSettingsGUI::saveSettings ( )

Save learning resources settings.

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

References $_POST, ilObjectGUI\$ctrl, $ilCtrl, $ilSetting, $lm_set, ilObjectGUI\$settings, ilPrivacySettings\_getInstance(), ilObjectGUI\checkPermission(), and ilUtil\stripSlashes().

247  {
250 
251  $this->checkPermission("write");
252 
253  $lm_set = new ilSetting("lm");
254  $lm_set->set(
255  "time_scheduled_page_activation",
256  ilUtil::stripSlashes($_POST["time_scheduled_page_activation"])
257  );
258  $lm_set->set(
259  "lm_starting_point",
260  ilUtil::stripSlashes($_POST["lm_starting_point"])
261  );
262  $lm_set->set(
263  "page_history",
264  (int) ilUtil::stripSlashes($_POST["page_history"])
265  );
266  $lm_set->set(
267  "replace_mob_feature",
268  ilUtil::stripSlashes($_POST["replace_mob_feature"])
269  );
270  $lm_set->set(
271  "html_export_ids",
272  ilUtil::stripSlashes($_POST["html_export_ids"])
273  );
274  $lm_set->set(
275  "cont_upload_dir",
276  ilUtil::stripSlashes($_POST["cont_upload_dir"])
277  );
278  $lm_set->setScormDebug(
279  "scormdebug_global_activate",
280  ilUtil::stripSlashes($_POST["scormdebug_global_activate"])
281  );
282  $lm_set->set(
283  "scorm_login_as_learner_id",
284  ilUtil::stripSlashes($_POST["scorm_login_as_learner_id"])
285  );
286  $lm_set->set(
287  "scormdebug_disable_cache",
288  ilUtil::stripSlashes($_POST["scormdebug_disable_cache"])
289  );
290  $lm_set->set(
291  "scorm_without_session",
292  ilUtil::stripSlashes($_POST["scorm_without_session"])
293  );
294  $lm_set->set(
295  "scorm_lp_auto_activate",
296  ilUtil::stripSlashes($_POST["scorm_lp_auto_activate"])
297  );
298 
299  $privacy = ilPrivacySettings::_getInstance();
300  $privacy->enableSahsProtocolData((int) $_POST['enable_sahs_pd']);
301  $privacy->enableExportSCORM((int) $_POST['export_scorm']);
302  $privacy->save();
303 
304  ilUtil::sendSuccess($this->lng->txt("settings_saved"), true);
305 
306  $ilCtrl->redirect($this, "view");
307  }
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
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission and redirect on error.
static _getInstance()
Get instance of ilPrivacySettings.
$_POST["username"]
+ Here is the call graph for this function:

Field Documentation

◆ $error

ilObjLearningResourcesSettingsGUI::$error
protected

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

Referenced by executeCommand().

◆ $ERROR_MESSAGE

ilObjLearningResourcesSettingsGUI::$ERROR_MESSAGE
staticprivate

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

◆ $rbacsystem

ilObjLearningResourcesSettingsGUI::$rbacsystem
protected

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

Referenced by getAdminTabs().


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