ILIAS  release_10 Revision v10.1-43-ga1241a92c2f
ilObjUserTrackingGUI Class Reference
+ Inheritance diagram for ilObjUserTrackingGUI:
+ Collaboration diagram for ilObjUserTrackingGUI:

Public Member Functions

 __construct ( $a_data, int $a_id, bool $a_call_by_reference, bool $prepare_output)
 
 executeCommand ()
 
 getAdminTabs ()
 
 settingsObject (?ilPropertyFormGUI $a_form=null)
 
 saveSettingsObject ()
 
 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)
 

Protected Member Functions

 getTabs ()
 
 initSettingsForm ()
 
 editLPDefaultsObject (?ilPropertyFormGUI $a_form=null)
 
 initLPDefaultsForm ()
 
 saveLPDefaultsObject ()
 
- 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

ilErrorHandling $error
 
ilObjectDefinition $objectDefinition
 
- 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 = ""
 

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]
 

Detailed Description

Definition at line 14 of file class.ilObjUserTrackingGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilObjUserTrackingGUI::__construct (   $a_data,
int  $a_id,
bool  $a_call_by_reference,
bool  $prepare_output 
)

Definition at line 19 of file class.ilObjUserTrackingGUI.php.

References $DIC, ILIAS\GlobalScreen\Provider\__construct(), ILIAS\Repository\lng(), and ILIAS\Repository\objectDefinition().

24  {
25  global $DIC;
26 
27  $this->error = $DIC['ilErr'];
28  $this->objectDefinition = $DIC['objDefinition'];
29 
30  $this->type = "trac";
31  parent::__construct($a_data, $a_id, $a_call_by_reference, false);
32  $this->lng->loadLanguageModule('trac');
33  }
global $DIC
Definition: shib_login.php:25
__construct(Container $dic, ilPlugin $plugin)
+ Here is the call graph for this function:

Member Function Documentation

◆ addToExternalSettingsForm()

ilObjUserTrackingGUI::addToExternalSettingsForm ( int  $a_form_id)

Definition at line 482 of file class.ilObjUserTrackingGUI.php.

References ilAdministrationSettingsFormHandler\FORM_CERTIFICATE.

482  : array
483  {
484  switch ($a_form_id) {
486  $fields = array();
487  return array('obj_trac' => array('editLPDefaults', $fields));
488  }
489  return [];
490  }

◆ editLPDefaultsObject()

ilObjUserTrackingGUI::editLPDefaultsObject ( ?ilPropertyFormGUI  $a_form = null)
protected

Definition at line 370 of file class.ilObjUserTrackingGUI.php.

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

Referenced by saveLPDefaultsObject().

372  : void {
373  $this->checkPermission('read');
374 
375  $this->tabs_gui->addSubTab(
376  'lp_settings',
377  $this->lng->txt('settings'),
378  $this->ctrl->getLinkTarget($this, 'settings')
379  );
380 
381  $this->tabs_gui->addSubTab(
382  'lpdef',
383  $this->lng->txt('trac_defaults'),
384  $this->ctrl->getLinkTarget($this, 'editLPDefaults')
385  );
386 
387  $this->tabs_gui->setTabActive('settings');
388  $this->tabs_gui->setSubTabActive('lpdef');
389 
390  if (!$a_form) {
391  $a_form = $this->initLPDefaultsForm();
392  }
393 
394  $this->tpl->setContent($a_form->getHTML());
395  }
checkPermission(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ executeCommand()

ilObjUserTrackingGUI::executeCommand ( )

Definition at line 35 of file class.ilObjUserTrackingGUI.php.

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

35  : void
36  {
37  $next_class = $this->ctrl->getNextClass();
38  $this->ctrl->setReturn($this, "show");
39  $this->prepareOutput();
40 
41  switch ($next_class) {
42  case 'ilpermissiongui':
43  $perm_gui = new ilPermissionGUI($this);
44  $this->ctrl->forwardCommand($perm_gui);
45  break;
46 
47  case 'illpobjectstatisticsgui':
48  $this->tabs_gui->activateTab('statistics');
49  $os_gui = new ilLPObjectStatisticsGUI(
51  );
52  $this->ctrl->forwardCommand($os_gui);
53  break;
54 
55  case 'ilsessionstatisticsgui':
56  $this->tabs_gui->setTabActive('session_statistics');
57  $sess_gui = new ilSessionStatisticsGUI();
58  $this->ctrl->forwardCommand($sess_gui);
59  break;
60 
61  default:
62  $cmd = $this->ctrl->getCmd();
63  if ($cmd == "view" || $cmd == "") {
64  $cmd = "settings";
65  }
66  $cmd .= "Object";
67  $this->$cmd();
68  break;
69  }
70  }
prepareOutput(bool $show_sub_objects=true)
+ Here is the call graph for this function:

◆ getAdminTabs()

ilObjUserTrackingGUI::getAdminTabs ( )

Definition at line 72 of file class.ilObjUserTrackingGUI.php.

References getTabs().

72  : void
73  {
74  $this->getTabs();
75  }
+ Here is the call graph for this function:

◆ getTabs()

ilObjUserTrackingGUI::getTabs ( )
protected

Definition at line 77 of file class.ilObjUserTrackingGUI.php.

References ilObjUserTracking\_enabledObjectStatistics(), ilObjUserTracking\_enabledSessionStatistics(), ilObjectGUI\checkPermissionBool(), and ILIAS\Repository\ctrl().

Referenced by getAdminTabs().

77  : void
78  {
79  $this->ctrl->setParameter($this, "ref_id", $this->ref_id);
80 
81  $this->tabs_gui->addTarget(
82  "settings",
83  $this->ctrl->getLinkTarget($this, "settings"),
84  "settings",
85  get_class($this)
86  );
87 
88  if ($this->rbac_system->checkAccess("visible,read", $this->ref_id)) {
90  $this->tabs_gui->addTarget(
91  "statistics",
92  $this->ctrl->getLinkTargetByClass(
93  "illpobjectstatisticsgui",
94  "access"
95  ),
96  "",
97  "illpobjectstatisticsgui"
98  );
99  }
100 
101  // session statistics
103  $this->tabs_gui->addTarget(
104  "session_statistics",
105  $this->ctrl->getLinkTargetByClass(
106  "ilsessionstatisticsgui",
107  ""
108  ),
109  "",
110  "ilsessionstatisticsgui"
111  );
112  }
113  }
114 
115  if ($this->checkPermissionBool("edit_permission")) {
116  $this->tabs_gui->addTarget(
117  "perm_settings",
118  $this->ctrl->getLinkTargetByClass(
119  array(get_class($this), 'ilpermissiongui'),
120  "perm"
121  ),
122  array("perm", "info", "owner"),
123  'ilpermissiongui'
124  );
125  }
126  }
checkPermissionBool(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initLPDefaultsForm()

ilObjUserTrackingGUI::initLPDefaultsForm ( )
protected

Definition at line 397 of file class.ilObjUserTrackingGUI.php.

References ilObjectGUI\$type, ilObjUserTracking\_enabledLearningProgress(), ilLPObjSettings\_mode2Text(), ilObjectGUI\checkPermissionBool(), ILIAS\Repository\ctrl(), ilObjectLP\getTypeClass(), ilObjectLP\getTypeDefault(), ilObjectLP\isSupportedObjectType(), ILIAS\Repository\lng(), ilLPObjSettings\LP_MODE_DEACTIVATED, ILIAS\Repository\objectDefinition(), and ilArrayUtil\sortArray().

Referenced by editLPDefaultsObject(), and saveLPDefaultsObject().

398  {
399  $form = new ilPropertyFormGUI();
400  $form->setFormAction($this->ctrl->getFormAction($this));
401  $form->setTitle($this->lng->txt('trac_defaults'));
402  $form->setDescription($this->lng->txt('trac_defaults_info'));
403 
404  $types = array();
405  foreach ($this->objectDefinition->getAllRepositoryTypes() as $type) {
407  $types[$type] = array(
408  "type" => $type,
409  "caption" => $this->lng->txt("obj_" . $type)
410  );
411  }
412  }
413  $types = ilArrayUtil::sortArray($types, "caption", "asc");
414  foreach ($types as $item) {
415  $class = ilObjectLP::getTypeClass($item["type"]);
416  $modes = $class::getDefaultModes(
418  );
419  if (sizeof($modes) > 1) {
420  $def_type = new ilSelectInputGUI(
421  $item["caption"],
422  "def_" . $item["type"]
423  );
424  $form->addItem($def_type);
425 
426  $def_type->setRequired(true);
427  $def_type->setValue(ilObjectLP::getTypeDefault($item["type"]));
428 
429  $options = array();
430  foreach ($modes as $mode) {
431  $caption = ($mode == ilLPObjSettings::LP_MODE_DEACTIVATED)
432  ? $this->lng->txt("trac_defaults_inactive")
434  $options[$mode] = $caption;
435  }
436  $def_type->setOptions($options);
437  }
438  }
439 
440  if ($this->checkPermissionBool("write")) {
441  $form->addCommandButton('saveLPDefaults', $this->lng->txt('save'));
442  } else {
443  foreach ($types as $item) {
444  $form->getItemByPostVar("def_" . $item["type"])->setDisabled(
445  true
446  );
447  }
448  }
449  return $form;
450  }
This class represents a selection list property in a property form.
static isSupportedObjectType(string $type)
static getTypeDefault(string $type)
checkPermissionBool(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
static getTypeClass(string $type)
static sortArray(array $array, string $a_array_sortby_key, string $a_array_sortorder="asc", bool $a_numeric=false, bool $a_keep_keys=false)
static _mode2Text(int $a_mode)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initSettingsForm()

ilObjUserTrackingGUI::initSettingsForm ( )
protected

Definition at line 164 of file class.ilObjUserTrackingGUI.php.

References ilObjectGUI\$user, $valid, ilAdministrationSettingsFormHandler\addFieldsToForm(), ilCheckboxGroupInputGUI\addOption(), ilObjectGUI\checkPermissionBool(), ILIAS\Repository\ctrl(), ilObjUserTracking\EXTENDED_DATA_LAST_ACCESS, ilObjUserTracking\EXTENDED_DATA_READ_COUNT, ilObjUserTracking\EXTENDED_DATA_SPENT_SECONDS, ilAdministrationSettingsFormHandler\FORM_LP, ILIAS\Repository\lng(), and ILIAS\Repository\object().

Referenced by saveSettingsObject(), and settingsObject().

165  {
166  $form = new ilPropertyFormGUI();
167  $form->setFormAction($this->ctrl->getFormAction($this));
168  $form->setTitle($this->lng->txt('tracking_settings'));
169 
170  $activate = new ilCheckboxGroupInputGUI(
171  $this->lng->txt('activate_tracking')
172  );
173  $form->addItem($activate);
174 
175  // learning progress
176  $lp = new ilCheckboxInputGUI(
177  $this->lng->txt('trac_learning_progress'),
178  'learning_progress_tracking'
179  );
180  if ($this->object->enabledLearningProgress()) {
181  $lp->setChecked(true);
182  }
183  $activate->addSubItem($lp);
184 
185  // lp settings
186 
187  $learner = new ilCheckboxInputGUI(
188  $this->lng->txt('trac_lp_learner_access'),
189  'lp_learner'
190  );
191  $learner->setInfo($this->lng->txt('trac_lp_learner_access_info'));
192  $learner->setChecked($this->object->hasLearningProgressLearner());
193  $lp->addSubItem($learner);
194 
195  // extended data
196 
197  $extdata = new ilCheckboxGroupInputGUI(
198  $this->lng->txt('trac_learning_progress_settings_info'),
199  'lp_extdata'
200  );
201  $extdata->addOption(
202  new ilCheckboxOption(
203  $this->lng->txt('trac_first_and_last_access'),
204  'lp_access'
205  )
206  );
207  $extdata->addOption(
208  new ilCheckboxOption($this->lng->txt('trac_read_count'), 'lp_count')
209  );
210  $extdata->addOption(
211  new ilCheckboxOption(
212  $this->lng->txt('trac_spent_seconds'),
213  'lp_spent'
214  )
215  );
216  $lp->addSubItem($extdata);
217 
218  $ext_value = array();
219  if ($this->object->hasExtendedData(
221  )) {
222  $ext_value[] = 'lp_access';
223  }
224  if ($this->object->hasExtendedData(
226  )) {
227  $ext_value[] = 'lp_count';
228  }
229  if ($this->object->hasExtendedData(
231  )) {
232  $ext_value[] = 'lp_spent';
233  }
234  $extdata->setValue($ext_value);
235 
236  $listgui = new ilCheckboxInputGUI(
237  $this->lng->txt('trac_lp_list_gui'),
238  'lp_list'
239  );
240  $listgui->setInfo($this->lng->txt('trac_lp_list_gui_info'));
241  $listgui->setChecked($this->object->hasLearningProgressListGUI());
242  $lp->addSubItem($listgui);
243 
244  // object statistics
245  $objstat = new ilCheckboxInputGUI(
246  $this->lng->txt('trac_object_statistics'),
247  'object_statistics'
248  );
249  if ($this->object->enabledObjectStatistics()) {
250  $objstat->setChecked(true);
251  }
252  $activate->addSubItem($objstat);
253 
254  // session statistics
255  $sessstat = new ilCheckboxInputGUI(
256  $this->lng->txt('session_statistics'),
257  'session_statistics'
258  );
259  if ($this->object->enabledSessionStatistics()) {
260  $sessstat->setChecked(true);
261  }
262  $activate->addSubItem($sessstat);
263 
264  // Anonymized
266  $this->lng->txt('trac_anonymized'),
267  'user_related'
268  );
269  $user->setInfo($this->lng->txt('trac_anonymized_info'));
270  $user->setChecked(!$this->object->enabledUserRelatedData());
271  $form->addItem($user);
272 
273  // Max time gap
274  $valid = new ilNumberInputGUI(
275  $this->lng->txt('trac_valid_request'),
276  'valid_request'
277  );
278  $valid->setMaxLength(4);
279  $valid->setSize(4);
280  $valid->setSuffix($this->lng->txt('seconds'));
281  $valid->setInfo($this->lng->txt('info_valid_request'));
282  $valid->setValue((string) $this->object->getValidTimeSpan());
283  $valid->setMinValue(1);
284  $valid->setMaxValue(9999);
285  $valid->setRequired(true);
286  $form->addItem($valid);
287 
290  $form,
291  $this
292  );
293 
294  // #12259
295  if ($this->checkPermissionBool("write")) {
296  $form->addCommandButton('saveSettings', $this->lng->txt('save'));
297  } else {
298  $lp->setDisabled(true);
299  $learner->setDisabled(true);
300  $extdata->setDisabled(true);
301  $listgui->setDisabled(true);
302  $objstat->setDisabled(true);
303  $user->setDisabled(true);
304  $valid->setDisabled(true);
305  }
306 
307  return $form;
308  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
$valid
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
checkPermissionBool(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
static addFieldsToForm(int $a_form_id, ilPropertyFormGUI $a_form, ilObjectGUI $a_parent_gui)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ saveLPDefaultsObject()

ilObjUserTrackingGUI::saveLPDefaultsObject ( )
protected

Definition at line 452 of file class.ilObjUserTrackingGUI.php.

References $res, ilObjectGUI\$type, ilObjectGUI\checkPermission(), ILIAS\Repository\ctrl(), editLPDefaultsObject(), initLPDefaultsForm(), ilObjectLP\isSupportedObjectType(), ILIAS\Repository\lng(), ilLPObjSettings\LP_MODE_DEACTIVATED, ILIAS\Repository\objectDefinition(), and ilObjectLP\saveTypeDefaults().

452  : void
453  {
454  $this->checkPermission('write');
455 
456  $form = $this->initLPDefaultsForm();
457  if ($form->checkInput()) {
458  $res = array();
459  foreach ($this->objectDefinition->getAllRepositoryTypes(
460  ) as $type) {
462  $mode = $form->getInput("def_" . $type);
463  $res[$type] = $mode
465  }
466  }
467 
469 
470  $this->tpl->setOnScreenMessage(
471  'success',
472  $this->lng->txt("msg_obj_modified"),
473  true
474  );
475  $this->ctrl->redirect($this, "editLPDefaults");
476  }
477 
478  $form->setValuesByPost();
479  $this->editLPDefaultsObject($form);
480  }
$res
Definition: ltiservices.php:69
static isSupportedObjectType(string $type)
static saveTypeDefaults(array $data)
editLPDefaultsObject(?ilPropertyFormGUI $a_form=null)
checkPermission(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
+ Here is the call graph for this function:

◆ saveSettingsObject()

ilObjUserTrackingGUI::saveSettingsObject ( )

Definition at line 310 of file class.ilObjUserTrackingGUI.php.

References ilObjectGUI\checkPermission(), ILIAS\Repository\ctrl(), ilObjUserTracking\EXTENDED_DATA_LAST_ACCESS, ilObjUserTracking\EXTENDED_DATA_READ_COUNT, ilObjUserTracking\EXTENDED_DATA_SPENT_SECONDS, initSettingsForm(), ILIAS\Repository\lng(), and settingsObject().

310  : void
311  {
312  $this->checkPermission('write');
313 
314  $form = $this->initSettingsForm();
315  if ($form->checkInput()) {
316  $lp_active = $form->getInput('learning_progress_tracking');
317 
318  $this->object->enableLearningProgress((bool) $lp_active);
319 
320  if ($lp_active) {
321  $ext_data = (array) $form->getInput("lp_extdata");
322  $code = 0;
323  if (in_array('lp_access', $ext_data)) {
325  }
326  if (in_array('lp_count', $ext_data)) {
328  }
329  if (in_array('lp_spent', $ext_data)) {
331  }
332  $this->object->setExtendedData($code);
333  }
334 
335  $this->object->enableChangeEventTracking(
336  (bool) $form->getInput('change_event_tracking')
337  );
338  $this->object->enableObjectStatistics(
339  (bool) $form->getInput('object_statistics')
340  );
341  $this->object->enableUserRelatedData(
342  !$form->getInput('user_related')
343  );
344  $this->object->setValidTimeSpan(
345  (int) $form->getInput('valid_request')
346  );
347  // $this->object->setLearningProgressDesktop($form->getInput('lp_desktop'));
348  $this->object->setLearningProgressLearner(
349  (bool) $form->getInput('lp_learner')
350  );
351  $this->object->enableSessionStatistics(
352  (bool) $form->getInput('session_statistics')
353  );
354  $this->object->setLearningProgressListGUI(
355  (bool) $form->getInput('lp_list')
356  );
357  $this->object->updateSettings();
358 
359  $this->tpl->setOnScreenMessage(
360  'success',
361  $this->lng->txt("msg_obj_modified"),
362  true
363  );
364  $this->ctrl->redirect($this, "settings");
365  }
366  $form->setValuesByPost();
367  $this->settingsObject($form);
368  }
settingsObject(?ilPropertyFormGUI $a_form=null)
checkPermission(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
+ Here is the call graph for this function:

◆ settingsObject()

ilObjUserTrackingGUI::settingsObject ( ?ilPropertyFormGUI  $a_form = null)

Definition at line 128 of file class.ilObjUserTrackingGUI.php.

References ilObjUserTracking\_enabledLearningProgress(), ILIAS\Repository\ctrl(), initSettingsForm(), and ILIAS\Repository\lng().

Referenced by saveSettingsObject().

128  : void
129  {
130  if (!$this->rbac_system->checkAccess(
131  "visible,read",
132  $this->object->getRefId()
133  )) {
134  $this->error->raiseError(
135  $this->lng->txt("no_permission"),
136  $this->error->WARNING
137  );
138  }
139 
140  $this->tabs_gui->addSubTab(
141  'lp_settings',
142  $this->lng->txt('settings'),
143  $this->ctrl->getLinkTarget($this, 'settings')
144  );
145 
147  $this->tabs_gui->addSubTab(
148  'lpdef',
149  $this->lng->txt('trac_defaults'),
150  $this->ctrl->getLinkTarget($this, 'editLPDefaults')
151  );
152  }
153 
154  $this->tabs_gui->setTabActive('settings');
155  $this->tabs_gui->setSubTabActive('lp_settings');
156 
157  if (!$a_form) {
158  $a_form = $this->initSettingsForm();
159  }
160 
161  $this->tpl->setContent($a_form->getHTML());
162  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $error

ilErrorHandling ilObjUserTrackingGUI::$error
protected

Definition at line 16 of file class.ilObjUserTrackingGUI.php.

◆ $objectDefinition

ilObjectDefinition ilObjUserTrackingGUI::$objectDefinition
protected

Definition at line 17 of file class.ilObjUserTrackingGUI.php.


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