4 include_once
"./Services/Object/classes/class.ilObjectGUI.php";
43 public function __construct($a_data, $a_id, $a_call_by_reference)
51 $this->tpl = $this->dic[
'tpl'];
52 $this->lng = $this->dic->language();
53 $this->lng->loadLanguageModule(
'trac');
54 $this->rbacsystem = $this->dic->rbac()->system();
56 $this->ctrl = $this->dic->ctrl();
61 $next_class = $this->ctrl->getNextClass();
62 $this->ctrl->setReturn($this,
"show");
65 switch ($next_class) {
66 case 'ilpermissiongui':
67 include_once(
"Services/AccessControl/classes/class.ilPermissionGUI.php");
69 $ret = &$this->ctrl->forwardCommand($perm_gui);
72 case 'illearningprogressgui':
73 $this->tabs_gui->setTabActive(
'learning_progress');
74 include_once(
"./Services/Tracking/classes/class.ilLearningProgressGUI.php");
76 $ret = &$this->ctrl->forwardCommand($lp_gui);
79 case 'illpobjectstatisticsgui':
80 $this->tabs_gui->setTabActive(
'statistics');
81 include_once(
"./Services/Tracking/classes/object_statistics/class.ilLPObjectStatisticsGUI.php");
83 $ret = &$this->ctrl->forwardCommand($os_gui);
86 case 'ilsessionstatisticsgui':
87 $this->tabs_gui->setTabActive(
'session_statistics');
88 include_once(
"./Services/Authentication/classes/class.ilSessionStatisticsGUI.php");
90 $ret = &$this->ctrl->forwardCommand($sess_gui);
94 $cmd = $this->ctrl->getCmd();
95 if ($cmd ==
"view" || $cmd ==
"") {
113 $this->ctrl->setParameter($this,
"ref_id", $this->ref_id);
115 $this->tabs_gui->addTarget(
117 $this->ctrl->getLinkTarget($this,
"settings"),
122 if ($this->rbacsystem->checkAccess(
"visible,read", $this->ref_id)) {
124 $this->tabs_gui->addTarget(
126 $this->ctrl->getLinkTargetByClass(
127 "illpobjectstatisticsgui",
131 "illpobjectstatisticsgui" 136 $this->tabs_gui->addTarget(
138 $this->ctrl->getLinkTargetByClass(
139 "illearningprogressgui",
143 "illearningprogressgui" 149 $this->tabs_gui->addTarget(
150 "session_statistics",
151 $this->ctrl->getLinkTargetByClass(
152 "ilsessionstatisticsgui",
156 "ilsessionstatisticsgui" 162 $this->tabs_gui->addTarget(
164 $this->ctrl->getLinkTargetByClass(array(get_class($this),
'ilpermissiongui'),
"perm"),
165 array(
"perm",
"info",
"owner"),
179 if (!$this->rbacsystem->checkAccess(
"visible,read", $this->object->getRefId())) {
180 $ilErr->raiseError($this->lng->txt(
"no_permission"), $ilErr->WARNING);
183 $this->tabs_gui->addSubTab(
185 $this->lng->txt(
'settings'),
186 $this->ctrl->getLinkTarget($this,
'settings')
190 $this->tabs_gui->addSubTab(
192 $this->lng->txt(
'trac_defaults'),
193 $this->ctrl->getLinkTarget($this,
'editLPDefaults')
197 $this->tabs_gui->setTabActive(
'settings');
198 $this->tabs_gui->setSubTabActive(
'lp_settings');
204 $this->tpl->setContent($a_form->getHTML());
209 include_once
'Services/Form/classes/class.ilPropertyFormGUI.php';
211 $form->setFormAction($this->ctrl->getFormAction($this));
212 $form->setTitle($this->lng->txt(
'tracking_settings'));
215 $form->addItem($activate);
218 $lp =
new ilCheckboxInputGUI($this->lng->txt(
'trac_learning_progress'),
'learning_progress_tracking');
219 if ($this->object->enabledLearningProgress()) {
222 $activate->addSubItem($lp);
227 $learner =
new ilCheckboxInputGUI($this->lng->txt(
'trac_lp_learner_access'),
'lp_learner');
228 $learner->
setInfo($this->lng->txt(
'trac_lp_learner_access_info'));
229 $learner->setChecked($this->object->hasLearningProgressLearner());
230 $lp->addSubItem($learner);
237 $extdata->addOption(
new ilCheckboxOption($this->lng->txt(
'trac_read_count'),
'lp_count'));
238 $extdata->addOption(
new ilCheckboxOption($this->lng->txt(
'trac_spent_seconds'),
'lp_spent'));
239 $lp->addSubItem($extdata);
241 $ext_value = array();
243 $ext_value[] =
'lp_access';
246 $ext_value[] =
'lp_count';
249 $ext_value[] =
'lp_spent';
251 $extdata->setValue($ext_value);
254 $listgui->
setInfo($this->lng->txt(
'trac_lp_list_gui_info'));
255 $listgui->setChecked($this->object->hasLearningProgressListGUI());
256 $lp->addSubItem($listgui);
269 $objstat =
new ilCheckboxInputGUI($this->lng->txt(
'trac_object_statistics'),
'object_statistics');
270 if ($this->object->enabledObjectStatistics()) {
273 $activate->addSubItem($objstat);
276 $sessstat =
new ilCheckboxInputGUI($this->lng->txt(
'session_statistics'),
'session_statistics');
277 if ($this->object->enabledSessionStatistics()) {
280 $activate->addSubItem($sessstat);
284 $user->setInfo($this->lng->txt(
'trac_anonymized_info'));
285 $user->setChecked(!$this->object->enabledUserRelatedData());
286 $form->addItem(
$user);
292 $valid->setSuffix($this->lng->txt(
'seconds'));
293 $valid->setInfo($this->lng->txt(
'info_valid_request'));
294 $valid->setValue($this->object->getValidTimeSpan());
296 $valid->setMaxValue(9999);
297 $valid->setRequired(
true);
300 include_once
"Services/Administration/classes/class.ilAdministrationSettingsFormHandler.php";
309 $form->addCommandButton(
'saveSettings', $this->lng->txt(
'save'));
311 $lp->setDisabled(
true);
312 $learner->setDisabled(
true);
313 $extdata->setDisabled(
true);
314 $listgui->setDisabled(
true);
315 $objstat->setDisabled(
true);
316 $user->setDisabled(
true);
317 $valid->setDisabled(
true);
331 if ($form->checkInput()) {
332 $lp_active = $form->getInput(
'learning_progress_tracking');
334 $this->
object->enableLearningProgress($lp_active);
337 $ext_data = (array) $form->getInput(
"lp_extdata");
339 if (in_array(
'lp_access', $ext_data)) {
342 if (in_array(
'lp_count', $ext_data)) {
345 if (in_array(
'lp_spent', $ext_data)) {
348 $this->
object->setExtendedData($code);
351 $this->
object->enableChangeEventTracking($form->getInput(
'change_event_tracking'));
352 $this->
object->enableObjectStatistics($form->getInput(
'object_statistics'));
353 $this->
object->enableUserRelatedData(!$form->getInput(
'user_related'));
354 $this->
object->setValidTimeSpan($form->getInput(
'valid_request'));
356 $this->
object->setLearningProgressLearner($form->getInput(
'lp_learner'));
357 $this->
object->enableSessionStatistics($form->getInput(
'session_statistics'));
358 $this->
object->setLearningProgressListGUI($form->getInput(
'lp_list'));
359 $this->
object->updateSettings();
361 ilUtil::sendSuccess($this->lng->txt(
"msg_obj_modified"),
true);
362 $this->ctrl->redirect($this,
"settings");
365 $form->setValuesByPost();
379 $this->tabs_gui->addSubTab(
381 $this->lng->txt(
'settings'),
382 $this->ctrl->getLinkTarget($this,
'settings')
385 $this->tabs_gui->addSubTab(
387 $this->lng->txt(
'trac_defaults'),
388 $this->ctrl->getLinkTarget($this,
'editLPDefaults')
391 $this->tabs_gui->setTabActive(
'settings');
392 $this->tabs_gui->setSubTabActive(
'lpdef');
398 $this->tpl->setContent($a_form->getHTML());
407 include_once
'Services/Form/classes/class.ilPropertyFormGUI.php';
409 $form->setFormAction($this->ctrl->getFormAction($this));
410 $form->setTitle($this->lng->txt(
'trac_defaults'));
411 $form->setDescription($this->lng->txt(
'trac_defaults_info'));
413 include_once
"Services/Object/classes/class.ilObjectLP.php";
414 include_once
"Services/Tracking/classes/class.ilLPObjSettings.php";
419 $types[
$type] = array(
421 "caption" => $this->lng->txt(
"obj_" .
$type)
426 foreach ($types as $item) {
429 if (
sizeof($modes) > 1) {
431 $form->addItem($def_type);
433 $def_type->setRequired(
true);
437 foreach ($modes as $mode) {
439 ? $this->lng->txt(
"trac_defaults_inactive")
441 $options[$mode] = $caption;
443 $def_type->setOptions($options);
448 $form->addCommandButton(
'saveLPDefaults', $this->lng->txt(
'save'));
450 foreach ($types as $item) {
451 $form->getItemByPostVar(
"def_" . $item[
"type"])->setDisabled(
true);
467 if ($form->checkInput()) {
468 include_once
"Services/Object/classes/class.ilObjectLP.php";
469 include_once
"Services/Tracking/classes/class.ilLPObjSettings.php";
474 $mode = $form->getInput(
"def_" .
$type);
483 ilUtil::sendSuccess($this->lng->txt(
"msg_obj_modified"),
true);
484 $this->ctrl->redirect($this,
"editLPDefaults");
487 $form->setValuesByPost();
498 switch ($a_form_id) {
502 return array(
'obj_trac' => array(
'editLPDefaults', $fields));
Class ilSessionStatisticsGUI.
static sortArray( $array, $a_array_sortby, $a_array_sortorder=0, $a_numeric=false, $a_keep_keys=false)
sortArray
const EXTENDED_DATA_LAST_ACCESS
editLPDefaultsObject($a_form=null)
This class represents an option in a checkbox group.
static getTypeClass($a_type)
static _enabledObjectStatistics()
check wether object statistics is enabled or not
settingsObject($a_form=null)
display tracking settings form
static isSupportedObjectType($a_type)
const EXTENDED_DATA_READ_COUNT
const LP_CONTEXT_ADMINISTRATION
__construct($a_data, $a_id, $a_call_by_reference)
static getTypeDefault($a_type)
Get current type default.
prepareOutput($a_show_subobjects=true)
prepare output
static _enabledLearningProgress()
check wether learing progress is enabled or not
foreach($_POST as $key=> $value) $res
Class ilObjectGUI Basic methods of all Output classes.
static saveTypeDefaults(array $a_data)
addToExternalSettingsForm($a_form_id)
const EXTENDED_DATA_SPENT_SECONDS
const LP_MODE_DEACTIVATED
__construct(Container $dic, ilPlugin $plugin)
static _enabledSessionStatistics()
check wether session statistics is enabled or not
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission and redirect on error.
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
checkPermissionBool($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission.
Class ilObjUserTrackingGUI.
saveSettingsObject()
save user tracking settings
static _mode2Text($a_mode)