ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
All Data Structures Namespaces Files Functions Variables Modules Pages
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 ()
 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
 
- Protected Attributes inherited from ilObjectGUI
 $ilErr
 
 $locator
 
 $user
 
 $access
 
 $rbacsystem
 
 $settings
 
 $rbacreview
 
 $toolbar
 
 $tmp_import_dir
 
 $tabs_gui = null
 
 $ctrl
 
 $object_service
 
 $favourites
 

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...
 
 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 30 of file class.ilObjLearningResourcesSettingsGUI.php.

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

31  {
32  global $DIC;
33 
34  $this->error = $DIC["ilErr"];
35  $this->access = $DIC->access();
36  $this->settings = $DIC->settings();
37  $this->ctrl = $DIC->ctrl();
38  $this->lng = $DIC->language();
39  $this->type = 'lrss';
40  parent::__construct($a_data, $a_id, $a_call_by_reference, $a_prepare_output);
41 
42  $this->lng->loadLanguageModule('content');
43  }
settings()
Definition: settings.php:2
__construct(Container $dic, ilPlugin $plugin)
$DIC
Definition: xapitoken.php:46
+ Here is the call graph for this function:

Member Function Documentation

◆ addToExternalSettingsForm()

ilObjLearningResourcesSettingsGUI::addToExternalSettingsForm (   $a_form_id)

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

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

300  {
301  switch ($a_form_id) {
303 
304  $privacy = ilPrivacySettings::_getInstance();
305 
306  $fields = array('enable_sahs_protocol_data' => array($privacy->enabledSahsProtocolData(), ilAdministrationSettingsFormHandler::VALUE_BOOL));
307 
308  return array(array("editSettings", $fields));
309  }
310  }
static _getInstance()
Get instance of ilPrivacySettings.
+ Here is the call graph for this function:

◆ editSettings()

ilObjLearningResourcesSettingsGUI::editSettings ( )

Edit learning resources settings.

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

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

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

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

52  {
54 
55  $next_class = $this->ctrl->getNextClass($this);
56  $cmd = $this->ctrl->getCmd();
57 
58  $this->prepareOutput();
59 
60  if (!$this->rbacsystem->checkAccess("visible,read", $this->object->getRefId())) {
61  $ilErr->raiseError($this->lng->txt('no_permission'), $ilErr->WARNING);
62  }
63 
64  switch ($next_class) {
65  case 'ilpermissiongui':
66  $this->tabs_gui->setTabActive('perm_settings');
67  $perm_gui = new ilPermissionGUI($this);
68  $ret = $this->ctrl->forwardCommand($perm_gui);
69  break;
70 
71  default:
72  if (!$cmd || $cmd == 'view') {
73  $cmd = "editSettings";
74  }
75 
76  $this->$cmd();
77  break;
78  }
79  return true;
80  }
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 ilObjectGUI\$rbacsystem.

89  {
91 
92  if ($rbacsystem->checkAccess("visible,read", $this->object->getRefId())) {
93  $this->tabs_gui->addTarget(
94  "cont_edit_lrs_settings",
95  $this->ctrl->getLinkTarget($this, "editSettings"),
96  array("editSettings", "view")
97  );
98  }
99 
100  if ($rbacsystem->checkAccess('edit_permission', $this->object->getRefId())) {
101  $this->tabs_gui->addTarget(
102  "perm_settings",
103  $this->ctrl->getLinkTargetByClass('ilpermissiongui', "perm"),
104  array(),
105  'ilpermissiongui'
106  );
107  }
108  }

◆ saveSettings()

ilObjLearningResourcesSettingsGUI::saveSettings ( )

Save learning resources settings.

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

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

237  {
240 
241  $this->checkPermission("write");
242 
243  $lm_set = new ilSetting("lm");
244  $lm_set->set(
245  "time_scheduled_page_activation",
246  ilUtil::stripSlashes($_POST["time_scheduled_page_activation"])
247  );
248  $lm_set->set(
249  "lm_starting_point",
250  ilUtil::stripSlashes($_POST["lm_starting_point"])
251  );
252  $lm_set->set(
253  "page_history",
254  (int) ilUtil::stripSlashes($_POST["page_history"])
255  );
256  $lm_set->set(
257  "replace_mob_feature",
258  ilUtil::stripSlashes($_POST["replace_mob_feature"])
259  );
260  $lm_set->set(
261  "html_export_ids",
262  ilUtil::stripSlashes($_POST["html_export_ids"])
263  );
264  $lm_set->set(
265  "cont_upload_dir",
266  ilUtil::stripSlashes($_POST["cont_upload_dir"])
267  );
268  $lm_set->setScormDebug(
269  "scormdebug_global_activate",
270  ilUtil::stripSlashes($_POST["scormdebug_global_activate"])
271  );
272  $lm_set->set(
273  "scorm_login_as_learner_id",
274  ilUtil::stripSlashes($_POST["scorm_login_as_learner_id"])
275  );
276  $lm_set->set(
277  "scormdebug_disable_cache",
278  ilUtil::stripSlashes($_POST["scormdebug_disable_cache"])
279  );
280  $lm_set->set(
281  "scorm_without_session",
282  ilUtil::stripSlashes($_POST["scorm_without_session"])
283  );
284  $lm_set->set(
285  "scorm_lp_auto_activate",
286  ilUtil::stripSlashes($_POST["scorm_lp_auto_activate"])
287  );
288 
289  $privacy = ilPrivacySettings::_getInstance();
290  $privacy->enableSahsProtocolData((int) $_POST['enable_sahs_pd']);
291  $privacy->enableExportSCORM((int) $_POST['export_scorm']);
292  $privacy->save();
293 
294  ilUtil::sendSuccess($this->lng->txt("settings_saved"), true);
295 
296  $ilCtrl->redirect($this, "view");
297  }
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 22 of file class.ilObjLearningResourcesSettingsGUI.php.

Referenced by executeCommand().

◆ $ERROR_MESSAGE

ilObjLearningResourcesSettingsGUI::$ERROR_MESSAGE
staticprivate

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


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