ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
ilObjUserTrackingGUI Class Reference
+ Inheritance diagram for ilObjUserTrackingGUI:
+ Collaboration diagram for ilObjUserTrackingGUI:

Public Member Functions

 ilObjUserTrackingGUI ($a_data, $a_id, $a_call_by_reference)
 
executeCommand ()
 execute command More...
 
 getAdminTabs (&$tabs_gui)
 administration tabs show only permissions and trash folder More...
 
 getTabs (&$tabs_gui)
 get tabs abstract method. More...
 
 settingsObject ($a_form=null)
 display tracking settings form More...
 
 saveSettingsObject ()
 save user tracking settings More...
 
- Public Member Functions inherited from ilObjectGUI
 ilObjectGUI ($a_data, $a_id=0, $a_call_by_reference=true, $a_prepare_output=true)
 Constructor @access public. More...
 
executeCommand ()
 execute command More...
 
 withReferences ()
 determines wether objects are referenced or not (got ref ids or not) More...
 
 setCreationMode ($a_mode=true)
 if true, a creation screen is displayed the current $_GET[ref_id] don't belong to the current class! the mode is determined in ilrepositorygui More...
 
 getCreationMode ()
 get creation mode More...
 
 getAdminTabs (&$tabs_gui)
 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...
 
 cancelDeleteObject ()
 cancel deletion of object More...
 
 cancelObject ($in_rep=false)
 cancel action and go back to previous page @access public More...
 
 createObject ()
 create new object form More...
 
 cancelCreation ()
 cancel create action and go back to repository parent More...
 
 saveObject ()
 save object More...
 
 editObject ()
 edit object More...
 
 addExternalEditFormCustom (ilPropertyFormGUI $a_form)
 
 updateObject ()
 updates object entry in object_data More...
 
 getFormAction ($a_cmd, $a_formaction="")
 get form action for command (command is method name without "Object", e.g. More...
 
 isVisible ($a_ref_id, $a_type)
 
 viewObject ()
 list childs of current object More...
 
 deleteObject ($a_error=false)
 Display deletion confirmation screen. More...
 
 cloneAllObject ()
 Clone single (not container object) Method is overwritten in ilContainerGUI. More...
 

Data Fields

 $tpl = null
 
 $ilErr = null
 
 $lng = null
 
 $ctrl = null
 
- Data Fields inherited from ilObjectGUI
const COPY_WIZARD_NEEDS_PAGE = 1
 
 $ilias
 
 $objDefinition
 
 $tpl
 
 $tree
 
 $lng
 
 $data
 
 $object
 
 $ref_id
 
 $obj_id
 
 $maxcount
 
 $formaction
 
 $return_location
 
 $target_frame
 
 $tab_target_script
 
 $actions
 
 $sub_objects
 
 $omit_locator = false
 
const CFORM_NEW = 1
 
const CFORM_IMPORT = 2
 
const CFORM_CLONE = 3
 

Protected Member Functions

 initSettingsForm ()
 
- Protected Member Functions inherited from ilObjectGUI
 assignObject ()
 
 prepareOutput ()
 prepare output More...
 
 setTitleAndDescription ()
 called by prepare output More...
 
 initHeaderAction ($a_sub_type=null, $a_sub_id=null)
 Add header action menu. More...
 
 insertHeaderAction ($a_list_gui)
 Insert header action into main template. More...
 
 addHeaderAction ()
 Add header action menu. More...
 
 redrawHeaderActionObject ()
 Ajax call: redraw action header only. More...
 
 showMountWebfolderIcon ()
 
 setTabs ()
 set admin tabs @access public More...
 
 setAdminTabs ()
 set admin tabs @access public More...
 
 setLocator ()
 set Locator More...
 
 addLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 omitLocator ($a_omit=true)
 
 addAdminLocatorItems ($a_do_not_add_object=false)
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 initCreationForms ($a_new_type)
 Init creation froms. More...
 
 getCreationFormsHTML (array $a_forms)
 Get HTML for creation forms (accordion) More...
 
 initCreateForm ($a_new_type)
 Init object creation form. More...
 
 initDidacticTemplate (ilPropertyFormGUI $form)
 Show didactic template types. More...
 
 addDidacticTemplateOptions (array &$a_options)
 Add custom templates. More...
 
 getDidacticTemplateVar ($a_type)
 Get didactic template setting from creation screen. More...
 
 putObjectInTree (ilObject $a_obj, $a_parent_node_id=null)
 Add object to tree at given position. More...
 
 afterSave (ilObject $a_new_object)
 Post (successful) object creation hook. More...
 
 initEditForm ()
 Init object edit form. More...
 
 initEditCustomForm (ilPropertyFormGUI $a_form)
 Add custom fields to update form. More...
 
 getEditFormValues ()
 Get values for edit form. More...
 
 getEditFormCustomValues (array &$a_values)
 Add values to custom edit fields. More...
 
 validateCustom (ilPropertyFormGUI $a_form)
 Validate custom values (if not possible with checkInput()) More...
 
 updateCustom (ilPropertyFormGUI $a_form)
 Insert custom update form values into object. More...
 
 afterUpdate ()
 Post (successful) object update hook. More...
 
 initImportForm ($a_new_type)
 Init object import form. More...
 
 importFileObject ($parent_id=null, $a_catch_errors=true)
 Import. More...
 
 afterImport (ilObject $a_new_object)
 Post (successful) object import hook. More...
 
 setFormAction ($a_cmd, $a_formaction)
 set specific form action for command More...
 
 getReturnLocation ($a_cmd, $a_location="")
 get return location for command (command is method name without "Object", e.g. More...
 
 setReturnLocation ($a_cmd, $a_location)
 set specific return location for command More...
 
 getTargetFrame ($a_cmd, $a_target_frame="")
 get target frame for command (command is method name without "Object", e.g. More...
 
 setTargetFrame ($a_cmd, $a_target_frame)
 set specific target frame for command More...
 
 showPossibleSubObjects ()
 show possible subobjects (pulldown menu) More...
 
 getTemplateFile ($a_cmd, $a_type="")
 get a template blockfile format: tpl. More...
 
 getTitlesByRefId ($a_ref_ids)
 get Titles of objects this method is used for error messages in methods cut/copy/paste More...
 
 getTabs (&$tabs_gui)
 get tabs abstract method. More...
 
 __showButton ($a_cmd, $a_text, $a_target='')
 
 hitsperpageObject ()
 
__initTableGUI ()
 
 __setTableGUIBasicData (&$tbl, &$result_set, $a_from="")
 standard implementation for tables use 'from' variable use different initial setting of table More...
 
 redirectToRefId ($a_ref_id, $a_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 $_GET["ref_id"] value More...
 
 fillCloneTemplate ($a_tpl_varname, $a_type)
 Fill object clone template This method can be called from any object GUI class that wants to offer object cloning. More...
 
 getCenterColumnHTML ()
 Get center column. More...
 
 getRightColumnHTML ()
 Display right column. More...
 
 setColumnSettings ($column_gui)
 May be overwritten in subclasses. More...
 
 checkPermission ($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
 Check permission and redirect on error. More...
 
 checkPermissionBool ($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
 Check permission. More...
 
 enableDragDropFileUpload ()
 Enables the file upload into this object by dropping files. More...
 
 handleAutoRating (ilObject $a_new_obj)
 Activate rating automatically if parent container setting. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from ilObjectGUI
static _gotoRepositoryRoot ($a_raise_error=false)
 Goto repository root. More...
 
static _gotoRepositoryNode ($a_ref_id, $a_cmd="frameset")
 Goto repository root. More...
 
- Protected Attributes inherited from ilObjectGUI
 $tmp_import_dir
 

Detailed Description

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

Member Function Documentation

◆ executeCommand()

& ilObjUserTrackingGUI::executeCommand ( )

execute command

Reimplemented from ilObjectGUI.

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

42 {
43 $next_class = $this->ctrl->getNextClass();
44 $this->ctrl->setReturn($this, "show");
45 $this->prepareOutput();
46
47 switch($next_class)
48 {
49 case 'ilpermissiongui':
50 include_once("Services/AccessControl/classes/class.ilPermissionGUI.php");
51 $perm_gui =& new ilPermissionGUI($this);
52 $ret =& $this->ctrl->forwardCommand($perm_gui);
53 break;
54
55 case 'illearningprogressgui':
56 $this->tabs_gui->setTabActive('learning_progress');
57 include_once("./Services/Tracking/classes/class.ilLearningProgressGUI.php");
59 $ret =& $this->ctrl->forwardCommand($lp_gui);
60 break;
61
62 case 'illpobjectstatisticsgui':
63 $this->tabs_gui->setTabActive('statistics');
64 include_once("./Services/Tracking/classes/object_statistics/class.ilLPObjectStatisticsGUI.php");
66 $ret =& $this->ctrl->forwardCommand($os_gui);
67 break;
68
69 case 'ilsessionstatisticsgui':
70 $this->tabs_gui->setTabActive('session_statistics');
71 include_once("./Services/Authentication/classes/class.ilSessionStatisticsGUI.php");
72 $sess_gui =& new ilSessionStatisticsGUI();
73 $ret =& $this->ctrl->forwardCommand($sess_gui);
74 break;
75
76 default:
77 $cmd = $this->ctrl->getCmd();
78 if ($cmd == "view" || $cmd == "")
79 {
80 $cmd = "settings";
81 }
82 $cmd .= "Object";
83 $this->$cmd();
84 break;
85 }
86
87 return true;
88 }
Class ilObjUserTrackingGUI.
prepareOutput()
prepare output
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
Class ilSessionStatisticsGUI.
$cmd
Definition: sahs_server.php:35

References $cmd, $ret, ilLearningProgressBaseGUI\LP_CONTEXT_ADMINISTRATION, and ilObjectGUI\prepareOutput().

+ Here is the call graph for this function:

◆ getAdminTabs()

ilObjUserTrackingGUI::getAdminTabs ( $tabs_gui)

administration tabs show only permissions and trash folder

Reimplemented from ilObjectGUI.

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

91 {
92 $this->getTabs($tabs_gui);
93 }
getTabs(&$tabs_gui)
get tabs abstract method.

References getTabs().

+ Here is the call graph for this function:

◆ getTabs()

ilObjUserTrackingGUI::getTabs ( $tabs_gui)

get tabs abstract method.

@abstract overwrite in derived GUI class of your object type @access public

Parameters
objectinstance of ilTabsGUI

Reimplemented from ilObjectGUI.

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

96 {
97 global $rbacsystem;
98
99 $this->ctrl->setParameter($this,"ref_id",$this->ref_id);
100
101 $tabs_gui->addTarget("settings",
102 $this->ctrl->getLinkTarget($this, "settings"),
103 "settings",
104 get_class($this));
105
106 if ($rbacsystem->checkAccess("read",$this->object->getRefId()))
107 {
109 {
110 $tabs_gui->addTarget("statistics",
111 $this->ctrl->getLinkTargetByClass("illpobjectstatisticsgui",
112 "access"),
113 "",
114 "illpobjectstatisticsgui");
115 }
116
118 {
119 $tabs_gui->addTarget("learning_progress",
120 $this->ctrl->getLinkTargetByClass("illearningprogressgui",
121 "show"),
122 "",
123 "illearningprogressgui");
124 }
125
126 // session statistics
128 {
129 $tabs_gui->addTarget("session_statistics",
130 $this->ctrl->getLinkTargetByClass("ilsessionstatisticsgui",
131 ""),
132 "",
133 "ilsessionstatisticsgui");
134 }
135 }
136
137 if ($rbacsystem->checkAccess("edit_permission",$this->object->getRefId()))
138 {
139 $tabs_gui->addTarget("perm_settings",
140 $this->ctrl->getLinkTargetByClass(array(get_class($this),'ilpermissiongui'), "perm"),
141 array("perm","info","owner"),
142 'ilpermissiongui');
143 }
144 }
static _enabledObjectStatistics()
check wether object statistics is enabled or not
static _enabledLearningProgress()
check wether learing progress is enabled or not
static _enabledSessionStatistics()
check wether session statistics is enabled or not

References ilObjUserTracking\_enabledLearningProgress(), ilObjUserTracking\_enabledObjectStatistics(), and ilObjUserTracking\_enabledSessionStatistics().

Referenced by getAdminTabs().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ilObjUserTrackingGUI()

ilObjUserTrackingGUI::ilObjUserTrackingGUI (   $a_data,
  $a_id,
  $a_call_by_reference 
)

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

27 {
28 global $tpl,$ilErr,$lng,$ilCtrl;
29
30 $this->type = "trac";
31 $this->ilObjectGUI($a_data,$a_id,$a_call_by_reference, false);
32
33 $this->tpl =& $tpl;
34 $this->ilErr =& $ilErr;
35 $this->lng =& $lng;
36 $this->lng->loadLanguageModule('trac');
37
38 $this->ctrl =& $ilCtrl;
39 }
ilObjectGUI($a_data, $a_id=0, $a_call_by_reference=true, $a_prepare_output=true)
Constructor @access public.
global $ilCtrl
Definition: ilias.php:18

References $ilCtrl, $ilErr, $lng, $tpl, and ilObjectGUI\ilObjectGUI().

+ Here is the call graph for this function:

◆ initSettingsForm()

ilObjUserTrackingGUI::initSettingsForm ( )
protected

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

170 {
171 global $rbacsystem;
172
173 include_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
174 $form = new ilPropertyFormGUI();
175 $form->setFormAction($this->ctrl->getFormAction($this));
176 $form->setTitle($this->lng->txt('tracking_settings'));
177
178 $activate = new ilCheckboxGroupInputGUI($this->lng->txt('activate_tracking'));
179 $form->addItem($activate);
180
181 // learning progress
182 $lp = new ilCheckboxInputGUI($this->lng->txt('trac_learning_progress'), 'learning_progress_tracking');
183 if($this->object->enabledLearningProgress())
184 {
185 $lp->setChecked(true);
186 }
187 $activate->addSubItem($lp);
188
189
190 // lp settings
191
192 /*
193 $desktop = new ilCheckboxInputGUI($this->lng->txt('trac_lp_on_personal_desktop'), 'lp_desktop');
194 $desktop->setInfo($this->lng->txt('trac_lp_on_personal_desktop_info'));
195 $desktop->setChecked($this->object->hasLearningProgressDesktop());
196 $lp->addSubItem($desktop);
197 */
198
199 $learner = new ilCheckboxInputGUI($this->lng->txt('trac_lp_learner_access'), 'lp_learner');
200 $learner->setInfo($this->lng->txt('trac_lp_learner_access_info'));
201 $learner->setChecked($this->object->hasLearningProgressLearner());
202 $lp->addSubItem($learner);
203
204
205 // extended data
206
207 $extdata = new ilCheckboxGroupInputGUI($this->lng->txt('trac_learning_progress_settings_info'), 'lp_extdata');
208 $extdata->addOption(new ilCheckboxOption($this->lng->txt('trac_first_and_last_access'), 'lp_access'));
209 $extdata->addOption(new ilCheckboxOption($this->lng->txt('trac_read_count'), 'lp_count'));
210 $extdata->addOption(new ilCheckboxOption($this->lng->txt('trac_spent_seconds'), 'lp_spent'));
211 $lp->addSubItem($extdata);
212
213 $ext_value = array();
214 if($this->object->hasExtendedData(ilObjUserTracking::EXTENDED_DATA_LAST_ACCESS))
215 {
216 $ext_value[] = 'lp_access';
217 }
218 if($this->object->hasExtendedData(ilObjUserTracking::EXTENDED_DATA_READ_COUNT))
219 {
220 $ext_value[] = 'lp_count';
221 }
222 if($this->object->hasExtendedData(ilObjUserTracking::EXTENDED_DATA_SPENT_SECONDS))
223 {
224 $ext_value[] = 'lp_spent';
225 }
226 $extdata->setValue($ext_value);
227
228 $listgui = new ilCheckboxInputGUI($this->lng->txt('trac_lp_list_gui'), 'lp_list');
229 $listgui->setInfo($this->lng->txt('trac_lp_list_gui_info'));
230 $listgui->setChecked($this->object->hasLearningProgressListGUI());
231 $lp->addSubItem($listgui);
232
233 /* => REPOSITORY
234 // change event
235 $event = new ilCheckboxInputGUI($this->lng->txt('trac_repository_changes'), 'change_event_tracking');
236 if($this->object->enabledChangeEventTracking())
237 {
238 $event->setChecked(true);
239 }
240 $activate->addSubItem($event);
241 */
242
243 // object statistics
244 $objstat = new ilCheckboxInputGUI($this->lng->txt('trac_object_statistics'), 'object_statistics');
245 if($this->object->enabledObjectStatistics())
246 {
247 $objstat->setChecked(true);
248 }
249 $activate->addSubItem($objstat);
250
251 // session statistics
252 $sessstat = new ilCheckboxInputGUI($this->lng->txt('session_statistics'), 'session_statistics');
253 if($this->object->enabledSessionStatistics())
254 {
255 $sessstat->setChecked(true);
256 }
257 $activate->addSubItem($sessstat);
258
259 // Anonymized
260 $user = new ilCheckboxInputGUI($this->lng->txt('trac_anonymized'), 'user_related');
261 $user->setInfo($this->lng->txt('trac_anonymized_info'));
262 $user->setChecked(!$this->object->enabledUserRelatedData());
263 $form->addItem($user);
264
265 // Max time gap
266 $valid = new ilNumberInputGUI($this->lng->txt('trac_valid_request'), 'valid_request');
267 $valid->setMaxLength(4);
268 $valid->setSize(4);
269 $valid->setSuffix($this->lng->txt('seconds'));
270 $valid->setInfo($this->lng->txt('info_valid_request'));
271 $valid->setValue($this->object->getValidTimeSpan());
272 $valid->setMinValue(1);
273 $valid->setMaxValue(9999);
274 $valid->setRequired(true);
275 $form->addItem($valid);
276
277 include_once "Services/Administration/classes/class.ilAdministrationSettingsFormHandler.php";
280 $form,
281 $this
282 );
283
284 // #12259
285 if ($rbacsystem->checkAccess("write",$this->object->getRefId()))
286 {
287 $form->addCommandButton('saveSettings', $this->lng->txt('save'));
288 }
289 else
290 {
291 $lp->setDisabled(true);
292 $learner->setDisabled(true);
293 $extdata->setDisabled(true);
294 $listgui->setDisabled(true);
295 $objstat->setDisabled(true);
296 $user->setDisabled(true);
297 $valid->setDisabled(true);
298 }
299
300 return $form;
301 }
static addFieldsToForm($a_form_id, ilPropertyFormGUI $a_form, ilObjectGUI $a_parent_gui)
This class represents a property in a property form.
This class represents a checkbox property in a property form.
This class represents an option in a checkbox group.
This class represents a number property in a property form.
This class represents a property form user interface.
$valid

References $valid, ilAdministrationSettingsFormHandler\addFieldsToForm(), ilObjUserTracking\EXTENDED_DATA_LAST_ACCESS, ilObjUserTracking\EXTENDED_DATA_READ_COUNT, ilObjUserTracking\EXTENDED_DATA_SPENT_SECONDS, and ilAdministrationSettingsFormHandler\FORM_LP.

Referenced by saveSettingsObject(), and settingsObject().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ saveSettingsObject()

ilObjUserTrackingGUI::saveSettingsObject ( )

save user tracking settings

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

307 {
308 global $rbacsystem;
309
310 if (!$rbacsystem->checkAccess("write",$this->object->getRefId()))
311 {
312 return;
313 }
314
315 $form = $this->initSettingsForm();
316 if($form->checkInput())
317 {
318 $lp_active = $form->getInput('learning_progress_tracking');
319
320 $this->object->enableLearningProgress($lp_active);
321
322 if($lp_active)
323 {
324 $ext_data = (array)$form->getInput("lp_extdata");
325 $code = 0;
326 if(in_array('lp_access', $ext_data))
327 {
329 }
330 if(in_array('lp_count', $ext_data))
331 {
333 }
334 if(in_array('lp_spent', $ext_data))
335 {
337 }
338 $this->object->setExtendedData($code);
339 }
340
341 $this->object->enableChangeEventTracking($form->getInput('change_event_tracking'));
342 $this->object->enableObjectStatistics($form->getInput('object_statistics'));
343 $this->object->enableUserRelatedData(!$form->getInput('user_related'));
344 $this->object->setValidTimeSpan($form->getInput('valid_request'));
345 // $this->object->setLearningProgressDesktop($form->getInput('lp_desktop'));
346 $this->object->setLearningProgressLearner($form->getInput('lp_learner'));
347 $this->object->enableSessionStatistics($form->getInput('session_statistics'));
348 $this->object->setLearningProgressListGUI($form->getInput('lp_list'));
349 $this->object->updateSettings();
350
351 ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
352 $this->ctrl->redirect($this, "settings");
353 }
354
355 $form->setValuesByPost();
356 $this->settingsObject($form);
357 return false;
358 }
settingsObject($a_form=null)
display tracking settings form
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
$code
Definition: example_050.php:99

References $code, ilObjUserTracking\EXTENDED_DATA_LAST_ACCESS, ilObjUserTracking\EXTENDED_DATA_READ_COUNT, ilObjUserTracking\EXTENDED_DATA_SPENT_SECONDS, initSettingsForm(), ilUtil\sendSuccess(), and settingsObject().

+ Here is the call graph for this function:

◆ settingsObject()

ilObjUserTrackingGUI::settingsObject (   $a_form = null)

display tracking settings form

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

151 {
152 global $rbacsystem;
153
154 if (!$rbacsystem->checkAccess('read',$this->object->getRefId()))
155 {
156 $ilErr->raiseError($this->lng->txt("msg_no_perm_read_track"),$ilErr->WARNING);
157 }
158
159 $this->tabs_gui->setTabActive('settings');
160
161 if(!$a_form)
162 {
163 $a_form = $this->initSettingsForm();
164 }
165
166 $this->tpl->setContent($a_form->getHTML());
167 }

References $ilErr, and initSettingsForm().

Referenced by saveSettingsObject().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $ctrl

ilObjUserTrackingGUI::$ctrl = null

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

◆ $ilErr

ilObjUserTrackingGUI::$ilErr = null

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

Referenced by ilObjUserTrackingGUI(), and settingsObject().

◆ $lng

ilObjUserTrackingGUI::$lng = null

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

Referenced by ilObjUserTrackingGUI().

◆ $tpl

ilObjUserTrackingGUI::$tpl = null

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

Referenced by ilObjUserTrackingGUI().


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