3 declare(strict_types=0);
22 bool $a_call_by_reference,
27 $this->error = $DIC[
'ilErr'];
32 $this->
lng->loadLanguageModule(
'trac');
37 $next_class = $this->
ctrl->getNextClass();
38 $this->
ctrl->setReturn($this,
"show");
41 switch ($next_class) {
42 case 'ilpermissiongui':
44 $this->
ctrl->forwardCommand($perm_gui);
47 case 'illearningprogressgui':
48 $this->tabs_gui->setTabActive(
'learning_progress');
52 $this->
ctrl->forwardCommand($lp_gui);
55 case 'illpobjectstatisticsgui':
56 $this->tabs_gui->activateTab(
'statistics');
60 $this->
ctrl->forwardCommand($os_gui);
63 case 'ilsessionstatisticsgui':
64 $this->tabs_gui->setTabActive(
'session_statistics');
66 $this->
ctrl->forwardCommand($sess_gui);
70 $cmd = $this->
ctrl->getCmd();
71 if ($cmd ==
"view" || $cmd ==
"") {
87 $this->
ctrl->setParameter($this,
"ref_id", $this->ref_id);
89 $this->tabs_gui->addTarget(
91 $this->
ctrl->getLinkTarget($this,
"settings"),
96 if ($this->rbac_system->checkAccess(
"visible,read", $this->ref_id)) {
98 $this->tabs_gui->addTarget(
100 $this->
ctrl->getLinkTargetByClass(
101 "illpobjectstatisticsgui",
105 "illpobjectstatisticsgui" 110 $this->tabs_gui->addTarget(
112 $this->
ctrl->getLinkTargetByClass(
113 "illearningprogressgui",
117 "illearningprogressgui" 123 $this->tabs_gui->addTarget(
124 "session_statistics",
125 $this->
ctrl->getLinkTargetByClass(
126 "ilsessionstatisticsgui",
130 "ilsessionstatisticsgui" 136 $this->tabs_gui->addTarget(
138 $this->
ctrl->getLinkTargetByClass(
139 array(get_class($this),
'ilpermissiongui'),
142 array(
"perm",
"info",
"owner"),
150 if (!$this->rbac_system->checkAccess(
152 $this->object->getRefId()
154 $this->error->raiseError(
155 $this->
lng->txt(
"no_permission"),
156 $this->error->WARNING
160 $this->tabs_gui->addSubTab(
162 $this->
lng->txt(
'settings'),
163 $this->
ctrl->getLinkTarget($this,
'settings')
167 $this->tabs_gui->addSubTab(
169 $this->
lng->txt(
'trac_defaults'),
170 $this->
ctrl->getLinkTarget($this,
'editLPDefaults')
174 $this->tabs_gui->setTabActive(
'settings');
175 $this->tabs_gui->setSubTabActive(
'lp_settings');
181 $this->tpl->setContent($a_form->getHTML());
187 $form->setFormAction($this->
ctrl->getFormAction($this));
188 $form->setTitle($this->
lng->txt(
'tracking_settings'));
191 $this->
lng->txt(
'activate_tracking')
193 $form->addItem($activate);
197 $this->
lng->txt(
'trac_learning_progress'),
198 'learning_progress_tracking' 200 if ($this->
object->enabledLearningProgress()) {
203 $activate->addSubItem($lp);
208 $this->
lng->txt(
'trac_lp_learner_access'),
211 $learner->
setInfo($this->
lng->txt(
'trac_lp_learner_access_info'));
212 $learner->setChecked($this->
object->hasLearningProgressLearner());
213 $lp->addSubItem($learner);
218 $this->
lng->txt(
'trac_learning_progress_settings_info'),
223 $this->
lng->txt(
'trac_first_and_last_access'),
232 $this->
lng->txt(
'trac_spent_seconds'),
236 $lp->addSubItem($extdata);
238 $ext_value = array();
239 if ($this->
object->hasExtendedData(
242 $ext_value[] =
'lp_access';
244 if ($this->
object->hasExtendedData(
247 $ext_value[] =
'lp_count';
249 if ($this->
object->hasExtendedData(
252 $ext_value[] =
'lp_spent';
254 $extdata->setValue($ext_value);
257 $this->
lng->txt(
'trac_lp_list_gui'),
260 $listgui->
setInfo($this->
lng->txt(
'trac_lp_list_gui_info'));
261 $listgui->setChecked($this->
object->hasLearningProgressListGUI());
262 $lp->addSubItem($listgui);
266 $this->
lng->txt(
'trac_object_statistics'),
269 if ($this->
object->enabledObjectStatistics()) {
272 $activate->addSubItem($objstat);
276 $this->
lng->txt(
'session_statistics'),
279 if ($this->
object->enabledSessionStatistics()) {
282 $activate->addSubItem($sessstat);
286 $this->
lng->txt(
'trac_anonymized'),
289 $user->setInfo($this->
lng->txt(
'trac_anonymized_info'));
290 $user->setChecked(!$this->
object->enabledUserRelatedData());
291 $form->addItem(
$user);
295 $this->
lng->txt(
'trac_valid_request'),
300 $valid->setSuffix($this->
lng->txt(
'seconds'));
301 $valid->setInfo($this->
lng->txt(
'info_valid_request'));
302 $valid->setValue((
string) $this->
object->getValidTimeSpan());
304 $valid->setMaxValue(9999);
305 $valid->setRequired(
true);
316 $form->addCommandButton(
'saveSettings', $this->
lng->txt(
'save'));
318 $lp->setDisabled(
true);
319 $learner->setDisabled(
true);
320 $extdata->setDisabled(
true);
321 $listgui->setDisabled(
true);
322 $objstat->setDisabled(
true);
323 $user->setDisabled(
true);
324 $valid->setDisabled(
true);
335 if ($form->checkInput()) {
336 $lp_active = $form->getInput(
'learning_progress_tracking');
338 $this->
object->enableLearningProgress((
bool) $lp_active);
341 $ext_data = (array) $form->getInput(
"lp_extdata");
343 if (in_array(
'lp_access', $ext_data)) {
346 if (in_array(
'lp_count', $ext_data)) {
349 if (in_array(
'lp_spent', $ext_data)) {
352 $this->
object->setExtendedData($code);
355 $this->
object->enableChangeEventTracking(
356 (
bool) $form->getInput(
'change_event_tracking')
358 $this->
object->enableObjectStatistics(
359 (
bool) $form->getInput(
'object_statistics')
361 $this->
object->enableUserRelatedData(
362 !$form->getInput(
'user_related')
364 $this->
object->setValidTimeSpan(
365 (
int) $form->getInput(
'valid_request')
368 $this->
object->setLearningProgressLearner(
369 (
bool) $form->getInput(
'lp_learner')
371 $this->
object->enableSessionStatistics(
372 (
bool) $form->getInput(
'session_statistics')
374 $this->
object->setLearningProgressListGUI(
375 (
bool) $form->getInput(
'lp_list')
377 $this->
object->updateSettings();
379 $this->tpl->setOnScreenMessage(
381 $this->
lng->txt(
"msg_obj_modified"),
384 $this->
ctrl->redirect($this,
"settings");
386 $form->setValuesByPost();
395 $this->tabs_gui->addSubTab(
397 $this->
lng->txt(
'settings'),
398 $this->
ctrl->getLinkTarget($this,
'settings')
401 $this->tabs_gui->addSubTab(
403 $this->
lng->txt(
'trac_defaults'),
404 $this->
ctrl->getLinkTarget($this,
'editLPDefaults')
407 $this->tabs_gui->setTabActive(
'settings');
408 $this->tabs_gui->setSubTabActive(
'lpdef');
414 $this->tpl->setContent($a_form->getHTML());
420 $form->setFormAction($this->
ctrl->getFormAction($this));
421 $form->setTitle($this->
lng->txt(
'trac_defaults'));
422 $form->setDescription($this->
lng->txt(
'trac_defaults_info'));
427 $types[
$type] = array(
429 "caption" => $this->
lng->txt(
"obj_" .
$type)
434 foreach ($types as $item) {
436 $modes = $class::getDefaultModes(
439 if (
sizeof($modes) > 1) {
442 "def_" . $item[
"type"]
444 $form->addItem($def_type);
446 $def_type->setRequired(
true);
450 foreach ($modes as $mode) {
452 ? $this->
lng->txt(
"trac_defaults_inactive")
454 $options[$mode] = $caption;
456 $def_type->setOptions($options);
461 $form->addCommandButton(
'saveLPDefaults', $this->
lng->txt(
'save'));
463 foreach ($types as $item) {
464 $form->getItemByPostVar(
"def_" . $item[
"type"])->setDisabled(
477 if ($form->checkInput()) {
482 $mode = $form->getInput(
"def_" .
$type);
490 $this->tpl->setOnScreenMessage(
492 $this->
lng->txt(
"msg_obj_modified"),
495 $this->
ctrl->redirect($this,
"editLPDefaults");
498 $form->setValuesByPost();
504 switch ($a_form_id) {
507 return array(
'obj_trac' => array(
'editLPDefaults', $fields));
const EXTENDED_DATA_LAST_ACCESS
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _enabledObjectStatistics()
static isSupportedObjectType(string $type)
prepareOutput(bool $show_sub_objects=true)
static getTypeDefault(string $type)
const EXTENDED_DATA_READ_COUNT
static saveTypeDefaults(array $data)
const LP_CONTEXT_ADMINISTRATION
parses the objects.xml it handles the xml-description of all ilias objects
static _enabledLearningProgress()
settingsObject(?ilPropertyFormGUI $a_form=null)
ilObjectDefinition $objectDefinition
Class ilObjectGUI Basic methods of all Output classes.
checkPermissionBool(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
const EXTENDED_DATA_SPENT_SECONDS
const LP_MODE_DEACTIVATED
Error Handling & global info handling uses PEAR error class.
editLPDefaultsObject(?ilPropertyFormGUI $a_form=null)
__construct(Container $dic, ilPlugin $plugin)
static _enabledSessionStatistics()
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
static getTypeClass(string $type)
addToExternalSettingsForm(int $a_form_id)
__construct( $a_data, int $a_id, bool $a_call_by_reference, bool $prepare_output)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
checkPermission(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
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)