ILIAS  trunk Revision v11.0_alpha-1744-gb0451eebef4
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilObjLearningResourcesSettingsGUI Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

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

Public Member Functions

 __construct ( $a_data, int $a_id, bool $a_call_by_reference=true, bool $a_prepare_output=true)
 
 executeCommand ()
 
 getAdminTabs ()
 
 editSettings (?ilPropertyFormGUI $form=null)
 
 getSettingsForm ()
 
 saveSettings ()
 
 addToExternalSettingsForm (int $a_form_id)
 
- Public Member Functions inherited from ilObjectGUI
 getRefId ()
 
 setAdminMode (string $mode)
 
 getAdminMode ()
 
 getObject ()
 
 executeCommand ()
 
 withReferences ()
 determines whether objects are referenced or not (got ref ids or not) More...
 
 setCreationMode (bool $mode=true)
 If true, a creation screen is displayed the current [ref_id] does belong to the parent class The mode is determined in ilRepositoryGUI. More...
 
 getCreationMode ()
 
 prepareOutput (bool $show_sub_objects=true)
 
 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...
 
 cancelObject ()
 cancel action and go back to previous page More...
 
 createObject ()
 create new object form More...
 
 editAvailabilityPeriodObject ()
 
 saveAvailabilityPeriodObject ()
 
 cancelCreation ()
 cancel create action and go back to repository parent More...
 
 saveObject ()
 
 getDidacticTemplateVar (string $type)
 Get didactic template setting from creation screen. More...
 
 putObjectInTree (ilObject $obj, ?int $parent_node_id=null)
 Add object to tree at given position. More...
 
 editObject ()
 
 addExternalEditFormCustom (ilPropertyFormGUI $form)
 
 updateObject ()
 updates object entry in object_data More...
 
 getFormAction (string $cmd, string $default_form_action="")
 Get form action for command (command is method name without "Object", e.g. More...
 
 isVisible (int $ref_id, string $type)
 
 viewObject ()
 viewObject container presentation for "administration -> repository, trash, permissions" More...
 
 deleteObject (bool $error=false)
 Display deletion confirmation screen. More...
 
 setColumnSettings (ilColumnGUI $column_gui)
 
 addToDeskObject ()
 
 removeFromDeskObject ()
 
- Public Member Functions inherited from ILIAS\Object\ImplementsCreationCallback
 callCreationCallback (\ilObject $object, \ilObjectDefinition $obj_definition, int $requested_crtcb)
 

Additional Inherited Members

- Static Public Member Functions inherited from ilObjectGUI
static _gotoRepositoryRoot (bool $raise_error=false)
 Goto repository root. More...
 
static _gotoRepositoryNode (int $ref_id, string $cmd="")
 
static _gotoSharedWorkspaceNode (int $wsp_id)
 
- Data Fields inherited from ilObjectGUI
const ADMIN_MODE_NONE = ""
 
const ADMIN_MODE_SETTINGS = "settings"
 
const ADMIN_MODE_REPOSITORY = "repository"
 
const UPLOAD_TYPE_LOCAL = 1
 
const UPLOAD_TYPE_UPLOAD_DIRECTORY = 2
 
const CFORM_NEW = 1
 
const CFORM_IMPORT = 2
 
const CFORM_CLONE = 3
 
const SUPPORTED_IMPORT_MIME_TYPES = [MimeType::APPLICATION__ZIP, MimeType::APPLICATION__X_ZIP_COMPRESSED]
 
- Protected Member Functions inherited from ilObjectGUI
 getObjectService ()
 
 assignObject ()
 
 setTitleAndDescription ()
 
 createActionDispatcherGUI ()
 
 initHeaderAction (?string $sub_type=null, ?int $sub_id=null)
 Add header action menu. More...
 
 insertHeaderAction (?ilObjectListGUI $list_gui=null)
 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 More...
 
 setAdminTabs ()
 set admin tabs More...
 
 setLocator ()
 
 addLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 omitLocator (bool $omit=true)
 
 addAdminLocatorItems (bool $do_not_add_object=false)
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 getCreationFormsHTML (StandardForm|ilPropertyFormGUI|array $form)
 
 getTitleForCreationFormPage ()
 
 getCreationFormTitle ()
 
 initCreateForm (string $new_type)
 
 didacticTemplatesToForm ()
 
 initDidacticTemplate (ilPropertyFormGUI $form)
 
 retrieveAdditionalDidacticTemplateOptions ()
 
 addAdoptContentLinkToToolbar ()
 
 addImportButtonToToolbar ()
 
 addAvailabilityPeriodButtonToToolbar (ilToolbarGUI $toolbar)
 
 parseDidacticTemplateVar (string $var, string $type)
 
 afterSave (ilObject $new_object)
 Post (successful) object creation hook. More...
 
 initEditForm ()
 
 initEditCustomForm (ilPropertyFormGUI $a_form)
 Add custom fields to update form. More...
 
 getEditFormValues ()
 
 getEditFormCustomValues (array &$a_values)
 Add values to custom edit fields. More...
 
 validateCustom (ilPropertyFormGUI $form)
 Validate custom values (if not possible with checkInput()) More...
 
 updateCustom (ilPropertyFormGUI $form)
 Insert custom update form values into object. More...
 
 afterUpdate ()
 Post (successful) object update hook. More...
 
 routeImportCmdObject ()
 
 importFile (string $file_to_import, string $path_to_uploaded_file_in_temp_dir)
 
 deleteUploadedImportFile (string $path_to_uploaded_file_in_temp_dir)
 
 afterImport (ilObject $new_object)
 Post (successful) object import hook. More...
 
 setFormAction (string $cmd, string $form_action)
 
 getReturnLocation (string $cmd, string $default_location="")
 Get return location for command (command is method name without "Object", e.g. More...
 
 setReturnLocation (string $cmd, string $location)
 set specific return location for command More...
 
 getTargetFrame (string $cmd, string $default_target_frame="")
 get target frame for command (command is method name without "Object", e.g. More...
 
 setTargetFrame (string $cmd, string $target_frame)
 Set specific target frame for command. More...
 
 showPossibleSubObjects ()
 show possible sub objects (pull down menu) More...
 
 getTabs ()
 overwrite in derived GUI class of your object type More...
 
 redirectToRefId (int $ref_id, string $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 ["ref_id"] value of the request More...
 
 getCenterColumnHTML ()
 Get center column. More...
 
 getRightColumnHTML ()
 Display right column. More...
 
 checkPermission (string $perm, string $cmd="", string $type="", ?int $ref_id=null)
 
 checkPermissionBool (string $perm, string $cmd="", string $type="", ?int $ref_id=null)
 
 enableDragDropFileUpload ()
 Enables the file upload into this object by dropping files. More...
 
 getCreatableObjectTypes ()
 
 buildAddNewItemElements (array $subtypes, string $create_target_class=ilRepositoryGUI::class, ?int $redirect_target_ref_id=null,)
 
 buildGroup (string $create_target_class, array $obj_types_in_group, string $title, array $subtypes)
 
- Protected Attributes inherited from ilObjectGUI
ILIAS Notes Service $notes_service
 
ServerRequestInterface $request
 
ilLocatorGUI $locator
 
ilObjUser $user
 
ilAccessHandler $access
 
ilSetting $settings
 
ilToolbarGUI $toolbar
 
ilRbacAdmin $rbac_admin
 
ilRbacSystem $rbac_system
 
ilRbacReview $rbac_review
 
ilObjectService $object_service
 
ilObjectDefinition $obj_definition
 
ilGlobalTemplateInterface $tpl
 
ilTree $tree
 
ilCtrl $ctrl
 
ilErrorHandling $error
 
ilLanguage $lng
 
ilTabsGUI $tabs_gui
 
ILIAS $ilias
 
ArrayBasedRequestWrapper $post_wrapper
 
RequestWrapper $request_wrapper
 
Refinery $refinery
 
ilFavouritesManager $favourites
 
ilObjectCustomIconFactory $custom_icon_factory
 
UIFactory $ui_factory
 
UIRenderer $ui_renderer
 
Filesystem $temp_file_system
 
ilObject $object = null
 
bool $creation_mode = false
 
 $data
 
int $id
 
bool $call_by_reference = false
 
bool $prepare_output
 
int $ref_id
 
int $obj_id
 
int $maxcount
 
array $form_action = []
 
array $return_location = []
 
array $target_frame = []
 
string $tmp_import_dir
 
string $sub_objects = ""
 
bool $omit_locator = false
 
string $type = ""
 
string $admin_mode = self::ADMIN_MODE_NONE
 
int $requested_ref_id = 0
 
int $requested_crtptrefid = 0
 
int $requested_crtcb = 0
 
string $requested_new_type = ""
 
string $link_params
 
string $html = ""
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning Learning Resources Settings.

Author
Alexander Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de

ilObjLearningResourcesSettingsGUI: ilPermissionGUI ilObjLearningResourcesSettingsGUI: ilAdministrationGUI

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

Constructor & Destructor Documentation

◆ __construct()

ilObjLearningResourcesSettingsGUI::__construct (   $a_data,
int  $a_id,
bool  $a_call_by_reference = true,
bool  $a_prepare_output = true 
)
Parameters
mixed$a_data
Exceptions
ilCtrlException

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

References $DIC, ILIAS\GlobalScreen\Provider\__construct(), ILIAS\Repository\access(), ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), and ILIAS\Repository\settings().

38  {
39  global $DIC;
40 
41  $this->access = $DIC->access();
42  $this->settings = $DIC->settings();
43  $this->ctrl = $DIC->ctrl();
44  $this->lng = $DIC->language();
45  $this->type = 'lrss';
46  parent::__construct($a_data, $a_id, $a_call_by_reference, $a_prepare_output);
47 
48  $this->lng->loadLanguageModule('content');
49  $this->lng->loadLanguageModule('lm');
50  }
global $DIC
Definition: shib_login.php:22
__construct(Container $dic, ilPlugin $plugin)
+ Here is the call graph for this function:

Member Function Documentation

◆ addToExternalSettingsForm()

ilObjLearningResourcesSettingsGUI::addToExternalSettingsForm ( int  $a_form_id)

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

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

300  : array
301  {
302  switch ($a_form_id) {
304 
305  $privacy = ilPrivacySettings::getInstance();
306 
307  $fields = array('enable_sahs_protocol_data' => array($privacy->enabledSahsProtocolData(), ilAdministrationSettingsFormHandler::VALUE_BOOL));
308 
309  return array(array("editSettings", $fields));
310  }
311  return [];
312  }
+ Here is the call graph for this function:

◆ editSettings()

ilObjLearningResourcesSettingsGUI::editSettings ( ?ilPropertyFormGUI  $form = null)

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

References getSettingsForm().

Referenced by saveSettings().

101  : void
102  {
103  if (is_null($form)) {
104  $form = $this->getSettingsForm();
105  }
106  $this->tpl->setContent($form->getHTML());
107  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ executeCommand()

ilObjLearningResourcesSettingsGUI::executeCommand ( )

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

References ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), and ilObjectGUI\prepareOutput().

52  : void
53  {
54  $next_class = $this->ctrl->getNextClass($this);
55  $cmd = $this->ctrl->getCmd();
56 
57  $this->prepareOutput();
58 
59  if (!$this->rbac_system->checkAccess("visible,read", $this->object->getRefId())) {
60  throw new ilPermissionException($this->lng->txt('no_permission'));
61  }
62 
63  switch ($next_class) {
64  case 'ilpermissiongui':
65  $this->tabs_gui->setTabActive('perm_settings');
66  $perm_gui = new ilPermissionGUI($this);
67  $ret = $this->ctrl->forwardCommand($perm_gui);
68  break;
69 
70  default:
71  if (!$cmd || $cmd == 'view') {
72  $cmd = "editSettings";
73  }
74  $this->$cmd();
75  break;
76  }
77  }
prepareOutput(bool $show_sub_objects=true)
+ Here is the call graph for this function:

◆ getAdminTabs()

ilObjLearningResourcesSettingsGUI::getAdminTabs ( )

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

References ilObjectGUI\$rbac_system, ilRbacSystem\checkAccess(), and ILIAS\Repository\ctrl().

79  : void
80  {
82 
83  if ($rbac_system->checkAccess("visible,read", $this->object->getRefId())) {
84  $this->tabs_gui->addTarget(
85  "cont_edit_lrs_settings",
86  $this->ctrl->getLinkTarget($this, "editSettings"),
87  array("editSettings", "view")
88  );
89  }
90 
91  if ($rbac_system->checkAccess('edit_permission', $this->object->getRefId())) {
92  $this->tabs_gui->addTarget(
93  "perm_settings",
94  $this->ctrl->getLinkTargetByClass('ilpermissiongui', "perm"),
95  array(),
96  'ilpermissiongui'
97  );
98  }
99  }
ilRbacSystem $rbac_system
checkAccess(string $a_operations, int $a_ref_id, string $a_type="")
checkAccess represents the main method of the RBAC-system in ILIAS3 developers want to use With this ...
+ Here is the call graph for this function:

◆ getSettingsForm()

ilObjLearningResourcesSettingsGUI::getSettingsForm ( )

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

References $check, ilObjectGUI\$ctrl, $lm_set, ilObjectGUI\$lng, ilObjectGUI\checkPermissionBool(), ilPrivacySettings\getInstance(), ILIAS\Repository\lng(), ilLanguage\loadLanguageModule(), ilSelectInputGUI\setOptions(), and ilLanguage\txt().

Referenced by editSettings(), and saveSettings().

110  {
111  $ilCtrl = $this->ctrl;
112  $lng = $this->lng;
113 
114  $lm_set = new ilSetting("lm");
115  $lng->loadLanguageModule("scormdebug");
116 
117  $form = new ilPropertyFormGUI();
118  $form->setFormAction($ilCtrl->getFormAction($this));
119  $form->setTitle($lng->txt("cont_lrs_settings") . " - " . $lng->txt("obj_lm"));
120 
121  // Page History
122  $cb_prop = new ilCheckboxInputGUI(
123  $lng->txt("cont_enable_page_history"),
124  "page_history"
125  );
126  $cb_prop->setInfo($lng->txt("cont_enable_page_history_info"));
127  $cb_prop->setChecked((bool) $lm_set->get("page_history", '1'));
128  $form->addItem($cb_prop);
129 
130  // Time scheduled page activation
131  $cb_prop = new ilCheckboxInputGUI(
132  $lng->txt("cont_enable_time_scheduled_page_activation"),
133  "time_scheduled_page_activation"
134  );
135  $cb_prop->setInfo($lng->txt("cont_enable_time_scheduled_page_activation_info"));
136  $cb_prop->setChecked((bool) $lm_set->get("time_scheduled_page_activation"));
137  $form->addItem($cb_prop);
138 
139  // lm starting point
140  $options = array(
141  "" => $this->lng->txt("cont_last_visited_page"),
142  "first" => $this->lng->txt("cont_first_page")
143  );
144  $si = new ilSelectInputGUI($this->lng->txt("cont_lm_starting_point"), "lm_starting_point");
145  $si->setOptions($options);
146  $si->setValue($lm_set->get("lm_starting_point"));
147  $si->setInfo($this->lng->txt("cont_lm_starting_point_info"));
148  $form->addItem($si);
149 
150  // Activate replace media object function
151  $cb_prop = new ilCheckboxInputGUI(
152  $lng->txt("cont_replace_mob_feature"),
153  "replace_mob_feature"
154  );
155  $cb_prop->setInfo($lng->txt("cont_replace_mob_feature_info"));
156  $cb_prop->setChecked((bool) $lm_set->get("replace_mob_feature"));
157  $form->addItem($cb_prop);
158 
159  // Activate HTML export IDs
160  $cb_prop = new ilCheckboxInputGUI(
161  $lng->txt("cont_html_export_ids"),
162  "html_export_ids"
163  );
164  $cb_prop->setInfo($lng->txt("cont_html_export_ids_info"));
165  $cb_prop->setChecked((bool) $lm_set->get("html_export_ids"));
166  $form->addItem($cb_prop);
167 
168  // Activate replace media object function
169  $cb_prop = new ilCheckboxInputGUI(
170  $lng->txt("lm_est_reading_time"),
171  "lm_est_reading_time"
172  );
173  $cb_prop->setInfo($lng->txt("lm_est_reading_time_info"));
174  $cb_prop->setChecked((bool) $lm_set->get("est_reading_time"));
175  $form->addItem($cb_prop);
176 
177  $sh = new ilFormSectionHeaderGUI();
178  $sh->setTitle($lng->txt("cont_lrs_settings") . " - " . $lng->txt("obj_sahs"));
179  $form->addItem($sh);
180 
181  // scormDebugger activation
182  $cb_prop = new ilCheckboxInputGUI($lng->txt("scormdebug_global_activate"), "scormdebug_global_activate");
183  $cb_prop->setInfo($lng->txt("scormdebug_global_activate_info"));
184  $cb_prop->setChecked((bool) $lm_set->get("scormdebug_global_activate"));
185  $form->addItem($cb_prop);
186 
187  // scorm2004 disableRTECaching
188  $cb_prop = new ilCheckboxInputGUI(
189  $lng->txt("scormdebug_disable_cache"),
190  "scormdebug_disable_cache"
191  );
192  $cb_prop->setInfo($lng->txt("scormdebug_disable_cache_info"));
193  $cb_prop->setChecked((bool) $lm_set->get("scormdebug_disable_cache"));
194  $form->addItem($cb_prop);
195 
196  // scorm2004 without session
197  $cb_prop = new ilCheckboxInputGUI(
198  $lng->txt("scorm_without_session"),
199  "scorm_without_session"
200  );
201  $cb_prop->setInfo($lng->txt("scorm_without_session_info"));
202  $cb_prop->setChecked((bool) $lm_set->get("scorm_without_session"));
203  $form->addItem($cb_prop);
204 
205  $privacy = ilPrivacySettings::getInstance();
206  $check = new ilCheckboxInputGUI($lng->txt('enable_sahs_protocol_data'), 'enable_sahs_pd');
207  $check->setInfo($this->lng->txt('enable_sahs_protocol_data_desc'));
208  $check->setChecked((bool) $privacy->enabledSahsProtocolData());
209  $form->addItem($check);
210 
211  // show and export protocol data with name
212  $check = new ilCheckboxInputGUI($this->lng->txt('ps_export_scorm'), 'export_scorm');
213  $check->setInfo($this->lng->txt('enable_export_scorm_desc'));
214  $check->setChecked($privacy->enabledExportSCORM());
215  $form->addItem($check);
216 
217  // scorm auto-setting for learning progress
218  $cb_prop = new ilCheckboxInputGUI($lng->txt("scorm_lp_auto_activate"), "scorm_lp_auto_activate");
219  $cb_prop->setInfo($lng->txt("scorm_lp_auto_activate_info"));
220  $cb_prop->setChecked((bool) $lm_set->get("scorm_lp_auto_activate"));
221  $form->addItem($cb_prop);
222 
223  // command buttons
224  if ($this->checkPermissionBool("write")) {
225  $form->addCommandButton("saveSettings", $lng->txt("save"));
226  $form->addCommandButton("view", $lng->txt("cancel"));
227  }
228  return $form;
229  }
This class represents a selection list property in a property form.
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
loadLanguageModule(string $a_module)
Load language module.
setOptions(array $a_options)
ilLanguage $lng
checkPermissionBool(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
$lm_set
$check
Definition: buildRTE.php:81
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ saveSettings()

ilObjLearningResourcesSettingsGUI::saveSettings ( )

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

References ilObjectGUI\$ctrl, $lm_set, ilObjectGUI\checkPermission(), editSettings(), ilPrivacySettings\getInstance(), getSettingsForm(), and ILIAS\Repository\lng().

231  : void
232  {
233  $ilCtrl = $this->ctrl;
234 
235  $form = $this->getSettingsForm();
236 
237  $this->checkPermission("write");
238 
239  if ($form->checkInput()) {
240  $lm_set = new ilSetting("lm");
241  $lm_set->set(
242  "time_scheduled_page_activation",
243  $form->getInput("time_scheduled_page_activation")
244  );
245  $lm_set->set(
246  "lm_starting_point",
247  $form->getInput("lm_starting_point")
248  );
249  $lm_set->set(
250  "page_history",
251  $form->getInput("page_history")
252  );
253  $lm_set->set(
254  "replace_mob_feature",
255  $form->getInput("replace_mob_feature")
256  );
257  $lm_set->set(
258  "html_export_ids",
259  $form->getInput("html_export_ids")
260  );
261  $lm_set->setScormDebug(
262  "scormdebug_global_activate",
263  $form->getInput("scormdebug_global_activate")
264  );
265  $lm_set->set(
266  "scorm_login_as_learner_id",
267  $form->getInput("scorm_login_as_learner_id")
268  );
269  $lm_set->set(
270  "scormdebug_disable_cache",
271  $form->getInput("scormdebug_disable_cache")
272  );
273  $lm_set->set(
274  "scorm_without_session",
275  $form->getInput("scorm_without_session")
276  );
277  $lm_set->set(
278  "scorm_lp_auto_activate",
279  $form->getInput("scorm_lp_auto_activate")
280  );
281  $lm_set->set(
282  "est_reading_time",
283  $form->getInput("lm_est_reading_time")
284  );
285 
286 
287  $privacy = ilPrivacySettings::getInstance();
288  $privacy->enableSahsProtocolData((int) $form->getInput('enable_sahs_pd'));
289  $privacy->enableExportSCORM((int) $form->getInput('export_scorm'));
290  $privacy->save();
291 
292  $this->tpl->setOnScreenMessage('success', $this->lng->txt("settings_saved"), true);
293  $ilCtrl->redirect($this, "view");
294  } else {
295  $form->setValuesByPost();
296  $this->editSettings($form);
297  }
298  }
$lm_set
checkPermission(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
+ Here is the call graph for this function:

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