ILIAS  trunk Revision v11.0_alpha-1715-g7fc467680fb
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
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 28 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 33 of file class.ilObjUserTrackingGUI.php.

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

38  {
39  global $DIC;
40 
41  $this->error = $DIC['ilErr'];
42  $this->objectDefinition = $DIC['objDefinition'];
43 
44  $this->type = "trac";
45  parent::__construct($a_data, $a_id, $a_call_by_reference, false);
46  $this->lng->loadLanguageModule('trac');
47  }
global $DIC
Definition: shib_login.php:22
__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 496 of file class.ilObjUserTrackingGUI.php.

References ilAdministrationSettingsFormHandler\FORM_CERTIFICATE.

496  : array
497  {
498  switch ($a_form_id) {
500  $fields = array();
501  return array('obj_trac' => array('editLPDefaults', $fields));
502  }
503  return [];
504  }

◆ editLPDefaultsObject()

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

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

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

Referenced by saveLPDefaultsObject().

386  : void {
387  $this->checkPermission('read');
388 
389  $this->tabs_gui->addSubTab(
390  'lp_settings',
391  $this->lng->txt('settings'),
392  $this->ctrl->getLinkTarget($this, 'settings')
393  );
394 
395  $this->tabs_gui->addSubTab(
396  'lpdef',
397  $this->lng->txt('trac_defaults'),
398  $this->ctrl->getLinkTarget($this, 'editLPDefaults')
399  );
400 
401  $this->tabs_gui->setTabActive('settings');
402  $this->tabs_gui->setSubTabActive('lpdef');
403 
404  if (!$a_form) {
405  $a_form = $this->initLPDefaultsForm();
406  }
407 
408  $this->tpl->setContent($a_form->getHTML());
409  }
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 49 of file class.ilObjUserTrackingGUI.php.

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

49  : void
50  {
51  $next_class = $this->ctrl->getNextClass();
52  $this->ctrl->setReturn($this, "show");
53  $this->prepareOutput();
54 
55  switch ($next_class) {
56  case 'ilpermissiongui':
57  $perm_gui = new ilPermissionGUI($this);
58  $this->ctrl->forwardCommand($perm_gui);
59  break;
60 
61  case 'illpobjectstatisticsgui':
62  $this->tabs_gui->activateTab('statistics');
63  $os_gui = new ilLPObjectStatisticsGUI(
65  );
66  $this->ctrl->forwardCommand($os_gui);
67  break;
68 
69  case 'ilsessionstatisticsgui':
70  $this->tabs_gui->setTabActive('session_statistics');
71  $sess_gui = new ilSessionStatisticsGUI();
72  $this->ctrl->forwardCommand($sess_gui);
73  break;
74 
75  default:
76  $cmd = $this->ctrl->getCmd();
77  if ($cmd == "view" || $cmd == "") {
78  $cmd = "settings";
79  }
80  $cmd .= "Object";
81  $this->$cmd();
82  break;
83  }
84  }
prepareOutput(bool $show_sub_objects=true)
+ Here is the call graph for this function:

◆ getAdminTabs()

ilObjUserTrackingGUI::getAdminTabs ( )

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

References getTabs().

86  : void
87  {
88  $this->getTabs();
89  }
+ Here is the call graph for this function:

◆ getTabs()

ilObjUserTrackingGUI::getTabs ( )
protected

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

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

Referenced by getAdminTabs().

91  : void
92  {
93  $this->ctrl->setParameter($this, "ref_id", $this->ref_id);
94 
95  $this->tabs_gui->addTarget(
96  "settings",
97  $this->ctrl->getLinkTarget($this, "settings"),
98  "settings",
99  get_class($this)
100  );
101 
102  if ($this->rbac_system->checkAccess("visible,read", $this->ref_id)) {
104  $this->tabs_gui->addTarget(
105  "statistics",
106  $this->ctrl->getLinkTargetByClass(
107  "illpobjectstatisticsgui",
108  "access"
109  ),
110  "",
111  "illpobjectstatisticsgui"
112  );
113  }
114 
115  // session statistics
117  $this->tabs_gui->addTarget(
118  "session_statistics",
119  $this->ctrl->getLinkTargetByClass(
120  "ilsessionstatisticsgui",
121  ""
122  ),
123  "",
124  "ilsessionstatisticsgui"
125  );
126  }
127  }
128 
129  if ($this->checkPermissionBool("edit_permission")) {
130  $this->tabs_gui->addTarget(
131  "perm_settings",
132  $this->ctrl->getLinkTargetByClass(
133  array(get_class($this), 'ilpermissiongui'),
134  "perm"
135  ),
136  array("perm", "info", "owner"),
137  'ilpermissiongui'
138  );
139  }
140  }
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 411 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().

412  {
413  $form = new ilPropertyFormGUI();
414  $form->setFormAction($this->ctrl->getFormAction($this));
415  $form->setTitle($this->lng->txt('trac_defaults'));
416  $form->setDescription($this->lng->txt('trac_defaults_info'));
417 
418  $types = array();
419  foreach ($this->objectDefinition->getAllRepositoryTypes() as $type) {
421  $types[$type] = array(
422  "type" => $type,
423  "caption" => $this->lng->txt("obj_" . $type)
424  );
425  }
426  }
427  $types = ilArrayUtil::sortArray($types, "caption", "asc");
428  foreach ($types as $item) {
429  $class = ilObjectLP::getTypeClass($item["type"]);
430  $modes = $class::getDefaultModes(
432  );
433  if (sizeof($modes) > 1) {
434  $def_type = new ilSelectInputGUI(
435  $item["caption"],
436  "def_" . $item["type"]
437  );
438  $form->addItem($def_type);
439 
440  $def_type->setRequired(true);
441  $def_type->setValue(ilObjectLP::getTypeDefault($item["type"]));
442 
443  $options = array();
444  foreach ($modes as $mode) {
445  $caption = ($mode == ilLPObjSettings::LP_MODE_DEACTIVATED)
446  ? $this->lng->txt("trac_defaults_inactive")
448  $options[$mode] = $caption;
449  }
450  $def_type->setOptions($options);
451  }
452  }
453 
454  if ($this->checkPermissionBool("write")) {
455  $form->addCommandButton('saveLPDefaults', $this->lng->txt('save'));
456  } else {
457  foreach ($types as $item) {
458  $form->getItemByPostVar("def_" . $item["type"])->setDisabled(
459  true
460  );
461  }
462  }
463  return $form;
464  }
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 178 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().

179  {
180  $form = new ilPropertyFormGUI();
181  $form->setFormAction($this->ctrl->getFormAction($this));
182  $form->setTitle($this->lng->txt('tracking_settings'));
183 
184  $activate = new ilCheckboxGroupInputGUI(
185  $this->lng->txt('activate_tracking')
186  );
187  $form->addItem($activate);
188 
189  // learning progress
190  $lp = new ilCheckboxInputGUI(
191  $this->lng->txt('trac_learning_progress'),
192  'learning_progress_tracking'
193  );
194  if ($this->object->enabledLearningProgress()) {
195  $lp->setChecked(true);
196  }
197  $activate->addSubItem($lp);
198 
199  // lp settings
200 
201  $learner = new ilCheckboxInputGUI(
202  $this->lng->txt('trac_lp_learner_access'),
203  'lp_learner'
204  );
205  $learner->setInfo($this->lng->txt('trac_lp_learner_access_info'));
206  $learner->setChecked($this->object->hasLearningProgressLearner());
207  $lp->addSubItem($learner);
208 
209  // extended data
210 
211  $extdata = new ilCheckboxGroupInputGUI(
212  $this->lng->txt('trac_learning_progress_settings_info'),
213  'lp_extdata'
214  );
215  $extdata->addOption(
216  new ilCheckboxOption(
217  $this->lng->txt('trac_first_and_last_access'),
218  'lp_access'
219  )
220  );
221  $extdata->addOption(
222  new ilCheckboxOption($this->lng->txt('trac_read_count'), 'lp_count')
223  );
224  $extdata->addOption(
225  new ilCheckboxOption(
226  $this->lng->txt('trac_spent_seconds'),
227  'lp_spent'
228  )
229  );
230  $lp->addSubItem($extdata);
231 
232  $ext_value = array();
233  if ($this->object->hasExtendedData(
235  )) {
236  $ext_value[] = 'lp_access';
237  }
238  if ($this->object->hasExtendedData(
240  )) {
241  $ext_value[] = 'lp_count';
242  }
243  if ($this->object->hasExtendedData(
245  )) {
246  $ext_value[] = 'lp_spent';
247  }
248  $extdata->setValue($ext_value);
249 
250  $listgui = new ilCheckboxInputGUI(
251  $this->lng->txt('trac_lp_list_gui'),
252  'lp_list'
253  );
254  $listgui->setInfo($this->lng->txt('trac_lp_list_gui_info'));
255  $listgui->setChecked($this->object->hasLearningProgressListGUI());
256  $lp->addSubItem($listgui);
257 
258  // object statistics
259  $objstat = new ilCheckboxInputGUI(
260  $this->lng->txt('trac_object_statistics'),
261  'object_statistics'
262  );
263  if ($this->object->enabledObjectStatistics()) {
264  $objstat->setChecked(true);
265  }
266  $activate->addSubItem($objstat);
267 
268  // session statistics
269  $sessstat = new ilCheckboxInputGUI(
270  $this->lng->txt('session_statistics'),
271  'session_statistics'
272  );
273  if ($this->object->enabledSessionStatistics()) {
274  $sessstat->setChecked(true);
275  }
276  $activate->addSubItem($sessstat);
277 
278  // Anonymized
280  $this->lng->txt('trac_anonymized'),
281  'user_related'
282  );
283  $user->setInfo($this->lng->txt('trac_anonymized_info'));
284  $user->setChecked(!$this->object->enabledUserRelatedData());
285  $form->addItem($user);
286 
287  // Max time gap
288  $valid = new ilNumberInputGUI(
289  $this->lng->txt('trac_valid_request'),
290  'valid_request'
291  );
292  $valid->setMaxLength(4);
293  $valid->setSize(4);
294  $valid->setSuffix($this->lng->txt('seconds'));
295  $valid->setInfo($this->lng->txt('info_valid_request'));
296  $valid->setValue((string) $this->object->getValidTimeSpan());
297  $valid->setMinValue(1);
298  $valid->setMaxValue(9999);
299  $valid->setRequired(true);
300  $form->addItem($valid);
301 
304  $form,
305  $this
306  );
307 
308  // #12259
309  if ($this->checkPermissionBool("write")) {
310  $form->addCommandButton('saveSettings', $this->lng->txt('save'));
311  } else {
312  $lp->setDisabled(true);
313  $learner->setDisabled(true);
314  $extdata->setDisabled(true);
315  $listgui->setDisabled(true);
316  $objstat->setDisabled(true);
317  $user->setDisabled(true);
318  $valid->setDisabled(true);
319  }
320 
321  return $form;
322  }
This class represents an option in a checkbox group.
$valid
This class represents a number property in a property form.
This class represents a property in a property form.
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 466 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().

466  : void
467  {
468  $this->checkPermission('write');
469 
470  $form = $this->initLPDefaultsForm();
471  if ($form->checkInput()) {
472  $res = array();
473  foreach ($this->objectDefinition->getAllRepositoryTypes(
474  ) as $type) {
476  $mode = $form->getInput("def_" . $type);
477  $res[$type] = $mode
479  }
480  }
481 
483 
484  $this->tpl->setOnScreenMessage(
485  'success',
486  $this->lng->txt("msg_obj_modified"),
487  true
488  );
489  $this->ctrl->redirect($this, "editLPDefaults");
490  }
491 
492  $form->setValuesByPost();
493  $this->editLPDefaultsObject($form);
494  }
$res
Definition: ltiservices.php:66
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 324 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().

324  : void
325  {
326  $this->checkPermission('write');
327 
328  $form = $this->initSettingsForm();
329  if ($form->checkInput()) {
330  $lp_active = $form->getInput('learning_progress_tracking');
331 
332  $this->object->enableLearningProgress((bool) $lp_active);
333 
334  if ($lp_active) {
335  $ext_data = (array) $form->getInput("lp_extdata");
336  $code = 0;
337  if (in_array('lp_access', $ext_data)) {
339  }
340  if (in_array('lp_count', $ext_data)) {
342  }
343  if (in_array('lp_spent', $ext_data)) {
345  }
346  $this->object->setExtendedData($code);
347  }
348 
349  $this->object->enableChangeEventTracking(
350  (bool) $form->getInput('change_event_tracking')
351  );
352  $this->object->enableObjectStatistics(
353  (bool) $form->getInput('object_statistics')
354  );
355  $this->object->enableUserRelatedData(
356  !$form->getInput('user_related')
357  );
358  $this->object->setValidTimeSpan(
359  (int) $form->getInput('valid_request')
360  );
361  // $this->object->setLearningProgressDesktop($form->getInput('lp_desktop'));
362  $this->object->setLearningProgressLearner(
363  (bool) $form->getInput('lp_learner')
364  );
365  $this->object->enableSessionStatistics(
366  (bool) $form->getInput('session_statistics')
367  );
368  $this->object->setLearningProgressListGUI(
369  (bool) $form->getInput('lp_list')
370  );
371  $this->object->updateSettings();
372 
373  $this->tpl->setOnScreenMessage(
374  'success',
375  $this->lng->txt("msg_obj_modified"),
376  true
377  );
378  $this->ctrl->redirect($this, "settings");
379  }
380  $form->setValuesByPost();
381  $this->settingsObject($form);
382  }
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 142 of file class.ilObjUserTrackingGUI.php.

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

Referenced by saveSettingsObject().

142  : void
143  {
144  if (!$this->rbac_system->checkAccess(
145  "visible,read",
146  $this->object->getRefId()
147  )) {
148  $this->error->raiseError(
149  $this->lng->txt("no_permission"),
150  $this->error->WARNING
151  );
152  }
153 
154  $this->tabs_gui->addSubTab(
155  'lp_settings',
156  $this->lng->txt('settings'),
157  $this->ctrl->getLinkTarget($this, 'settings')
158  );
159 
161  $this->tabs_gui->addSubTab(
162  'lpdef',
163  $this->lng->txt('trac_defaults'),
164  $this->ctrl->getLinkTarget($this, 'editLPDefaults')
165  );
166  }
167 
168  $this->tabs_gui->setTabActive('settings');
169  $this->tabs_gui->setSubTabActive('lp_settings');
170 
171  if (!$a_form) {
172  $a_form = $this->initSettingsForm();
173  }
174 
175  $this->tpl->setContent($a_form->getHTML());
176  }
+ 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 30 of file class.ilObjUserTrackingGUI.php.

◆ $objectDefinition

ilObjectDefinition ilObjUserTrackingGUI::$objectDefinition
protected

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


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