ILIAS  release_7 Revision v7.30-3-g800a261c036
class.ilLearningProgressBaseGUI.php
Go to the documentation of this file.
1<?php
2
19include_once 'Services/Tracking/classes/class.ilObjUserTracking.php';
20
36{
37 public $tpl = null;
38 public $ctrl = null;
39 public $lng = null;
40 public $ref_id = 0;
41 public $mode = 0;
42
43 protected $anonymized;
44
48 protected $logger;
49
53 protected $tabs_gui;
54
55
61
65 // const LP_ACTIVE_LM_STATISTICS = 4; obsolete
66 const LP_ACTIVE_USERS = 5;
72 const LP_ACTIVE_MATRIX = 11;
73
74 public function __construct($a_mode, $a_ref_id = 0, $a_usr_id = 0)
75 {
76 global $DIC;
77
78 $tpl = $DIC['tpl'];
79 $ilCtrl = $DIC['ilCtrl'];
80 $lng = $DIC['lng'];
81 $ilObjDataCache = $DIC['ilObjDataCache'];
82 $ilTabs = $DIC['ilTabs'];
83
84 $this->tpl = $tpl;
85 $this->ctrl = $ilCtrl;
86 $this->lng = $lng;
87 $this->lng->loadLanguageModule('trac');
88 $this->tabs_gui = $ilTabs;
89
90 $this->mode = $a_mode;
91 $this->ref_id = $a_ref_id;
92 $this->obj_id = $ilObjDataCache->lookupObjId($this->ref_id);
93 $this->obj_type = $ilObjDataCache->lookupType($this->obj_id);
94 $this->usr_id = $a_usr_id;
95
96 $this->anonymized = (bool) !ilObjUserTracking::_enabledUserRelatedData();
97 if (!$this->anonymized && $this->obj_id) {
98 include_once "Services/Object/classes/class.ilObjectLP.php";
99 $olp = ilObjectLP::getInstance($this->obj_id);
100 $this->anonymized = $olp->isAnonymized();
101 }
102
103 $this->logger = $GLOBALS['DIC']->logger()->trac();
104 }
105
106 public function isAnonymized()
107 {
108 return $this->anonymized;
109 }
110
111 public function getMode()
112 {
113 return $this->mode;
114 }
115
116 public function getRefId()
117 {
118 return $this->ref_id;
119 }
120
121 public function getObjId()
122 {
123 return $this->obj_id;
124 }
125
126 public function getUserId()
127 {
128 if ($this->usr_id) {
129 return $this->usr_id;
130 }
131 if ((int) $_GET['user_id']) {
132 return (int) $_GET['user_id'];
133 }
134 return 0;
135 }
136
137 // Protected
138 public function __getDefaultCommand()
139 {
140 if (strlen($cmd = $this->ctrl->getCmd())) {
141 return $cmd;
142 }
143 return 'show';
144 }
145
146 public function __setSubTabs($a_active)
147 {
148 global $DIC;
149
150 $rbacsystem = $DIC['rbacsystem'];
151 $ilObjDataCache = $DIC['ilObjDataCache'];
152
153
154
155 switch ($this->getMode()) {
157
158 include_once("Services/Tracking/classes/class.ilObjUserTracking.php");
161 $this->tabs_gui->addTarget(
162 'trac_progress',
163 $this->ctrl->getLinkTargetByClass('illplistofprogressgui', ''),
164 "",
165 "",
166 "",
167 $a_active == self::LP_ACTIVE_PROGRESS
168 );
169 }
170
172 $this->tabs_gui->addTarget(
173 'trac_objects',
174 $this->ctrl->getLinkTargetByClass("illplistofobjectsgui", ''),
175 "",
176 "",
177 "",
178 $a_active == self::LP_ACTIVE_OBJECTS
179 );
180 }
181 break;
182
183
185 // #12771 - do not show status if learning progress is deactivated
186 include_once './Services/Object/classes/class.ilObjectLP.php';
187 $olp = ilObjectLP::getInstance($this->obj_id);
188 if ($olp->isActive()) {
189 include_once './Services/Tracking/classes/class.ilLearningProgressAccess.php';
190 $has_read = ilLearningProgressAccess::checkPermission('read_learning_progress', $this->getRefId());
191
192 if ($this->isAnonymized() || !$has_read) {
193 $this->ctrl->setParameterByClass('illplistofprogressgui', 'user_id', $this->getUserId());
194 $this->tabs_gui->addSubTabTarget(
195 'trac_progress',
196 $this->ctrl->getLinkTargetByClass('illplistofprogressgui', ''),
197 "",
198 "",
199 "",
200 $a_active == self::LP_ACTIVE_PROGRESS
201 );
202 } else {
203 // Check if it is a course
204 $sub_tab = ($ilObjDataCache->lookupType($ilObjDataCache->lookupObjId($this->getRefId())) == 'crs') ?
205 'trac_crs_objects' :
206 'trac_objects';
207
208 $this->tabs_gui->addSubTabTarget(
209 $sub_tab,
210 $this->ctrl->getLinkTargetByClass("illplistofobjectsgui", ''),
211 "",
212 "",
213 "",
214 $a_active == self::LP_ACTIVE_OBJECTS
215 );
216 }
217
218 if ($has_read) {
219 if (!$this->isAnonymized() &&
220 !($olp instanceof ilPluginLP) &&
221 ilObjectLP::supportsMatrixView($this->obj_type)) {
222 $this->tabs_gui->addSubTabTarget(
223 "trac_matrix",
224 $this->ctrl->getLinkTargetByClass("illplistofobjectsgui", 'showUserObjectMatrix'),
225 "",
226 "",
227 "",
228 $a_active == self::LP_ACTIVE_MATRIX
229 );
230 }
231
232 $this->tabs_gui->addSubTabTarget(
233 "trac_summary",
234 $this->ctrl->getLinkTargetByClass("illplistofobjectsgui", 'showObjectSummary'),
235 "",
236 "",
237 "",
238 $a_active == self::LP_ACTIVE_SUMMARY
239 );
240 }
241 }
242 include_once './Services/Tracking/classes/class.ilLearningProgressAccess.php';
243 if (!($olp instanceof ilPluginLP) &&
244 ilLearningProgressAccess::checkPermission('edit_learning_progress', $this->getRefId())) {
245 $this->tabs_gui->addSubTabTarget(
246 'trac_settings',
247 $this->ctrl->getLinkTargetByClass('illplistofsettingsgui', ''),
248 "",
249 "",
250 "",
251 $a_active == self::LP_ACTIVE_SETTINGS
252 );
253 }
254 break;
255
257 /*
258 $this->tabs_gui->addSubTabTarget('trac_progress',
259 $this->ctrl->getLinkTargetByClass('illplistofprogressgui',''),
260 "","","",$a_active == self::LP_ACTIVE_PROGRESS);
261 */
262 $this->tabs_gui->addSubTabTarget(
263 'trac_objects',
264 $this->ctrl->getLinkTargetByClass("illplistofobjectsgui", ''),
265 "",
266 "",
267 "",
268 $a_active == self::LP_ACTIVE_OBJECTS
269 );
270 break;
271
274 // No tabs default class is lpprogressgui
275 break;
276
277 default:
278 die('No valid mode given');
279 break;
280 }
281
282 return true;
283 }
284
285 public function __buildFooter()
286 {
287 switch ($this->getMode()) {
289
290 $this->tpl->printToStdout(true);
291 }
292 }
293
294 public function __buildHeader()
295 {
296 if ($this->getMode() == self::LP_CONTEXT_PERSONAL_DESKTOP) {
298 }
299 }
300
304 public function __insertPath(&$a_tpl, $a_ref_id)
305 {
306 global $DIC;
307
308 $tree = $DIC['tree'];
309
310 $path_arr = $tree->getPathFull($a_ref_id);
311 $counter = 0;
312 foreach ($tree->getPathFull($a_ref_id) as $data) {
313 if ($counter++) {
314 $path .= " -> ";
315 }
316 $path .= $data['title'];
317 }
318 $a_tpl->setCurrentBlock("path_item");
319 $a_tpl->setVariable("PATH_ITEM", $path);
320 $a_tpl->parseCurrentBlock();
321
322 $a_tpl->setCurrentBlock("path");
323 $a_tpl->parseCurrentBlock();
324
325 return $path;
326 }
327
331 public function __showImageByStatus(&$tpl, $a_status, $tpl_prefix = "")
332 {
333 return ilLearningProgressBaseGUI::_showImageByStatus($tpl, $a_status, $tpl_prefix);
334 }
335
340 public static function _showImageByStatus(&$tpl, $a_status, $tpl_prefix = "")
341 {
342 global $DIC;
343
344 $lng = $DIC['lng'];
345
346 $tpl->setVariable(
347 $tpl_prefix . "STATUS_IMG",
349 );
350 $tpl->setVariable($tpl_prefix . "STATUS_ALT", $lng->txt($a_status));
351
352 return true;
353 }
354
359 public static function _getImagePathForStatus($a_status)
360 {
361 include_once("./Services/Tracking/classes/class.ilLPStatus.php");
362
363 // constants are either number or string, so make comparison string-based
364 switch ((string) $a_status) {
368 return ilUtil::getImagePath('scorm/incomplete.svg');
369 break;
370
374 return ilUtil::getImagePath('scorm/complete.svg');
375 break;
376
380 return ilUtil::getImagePath('scorm/not_attempted.svg');
381 break;
382
385 return ilUtil::getImagePath('scorm/failed.svg');
386 break;
387
388 default:
389 return ilUtil::getImagePath('scorm/not_attempted.svg');
390 break;
391 }
392 }
393
398 public static function _getStatusText($a_status, $a_lng = null)
399 {
400 global $DIC;
401
402 $lng = $DIC['lng'];
403
404 if (!$a_lng) {
405 $a_lng = $lng;
406 }
407
408 include_once("./Services/Tracking/classes/class.ilLPStatus.php");
409 //echo "#".$a_status."#";
410 switch ($a_status) {
412 return $a_lng->txt(ilLPStatus::LP_STATUS_IN_PROGRESS);
413
415 return $a_lng->txt(ilLPStatus::LP_STATUS_COMPLETED);
416
418 return $a_lng->txt(ilLPStatus::LP_STATUS_FAILED);
419
420 default:
421 if ($a_status === ilLPStatus::LP_STATUS_NOT_ATTEMPTED_NUM) {
422 return $a_lng->txt(ilLPStatus::LP_STATUS_NOT_ATTEMPTED);
423 }
424 return $a_lng->txt($a_status);
425 }
426 }
427
428
429 // Protected Table gui methods
430 public function &__initTableGUI()
431 {
432 include_once "./Services/Table/classes/class.ilTableGUI.php";
433
434 return new ilTableGUI(0, false);
435 }
436
437
441 public function __showObjectDetails(&$info, $item_id = 0, $add_section = true)
442 {
443 global $DIC;
444
445 $ilObjDataCache = $DIC['ilObjDataCache'];
446
447 $details_id = $item_id ? $item_id : $this->details_id;
448
449 include_once 'Services/Object/classes/class.ilObjectLP.php';
450 $olp = ilObjectLP::getInstance($details_id);
451 $mode = $olp->getCurrentMode();
452
453 include_once './Services/MetaData/classes/class.ilMDEducational.php';
456 // Section object details
457 if ($add_section) {
458 $info->addSection($this->lng->txt('details'));
459 }
460
462 $info->addProperty($this->lng->txt('trac_required_visits'), ilLPObjSettings::_lookupVisits($details_id));
463 }
464
465 if ($seconds = ilMDEducational::_getTypicalLearningTimeSeconds($details_id)) {
466 $info->addProperty($this->lng->txt('meta_typical_learning_time'), ilDatePresentation::secondsToString($seconds));
467 }
468
469 return true;
470 }
471 return false;
472 }
473
474 public function __appendUserInfo(&$info, $a_user)
475 {
476 global $DIC;
477
478 $ilUser = $DIC['ilUser'];
479
480 // #13525 - irrelevant personal data is not to be presented
481 return;
482
483 if (!is_object($a_user)) {
484 $a_user = ilObjectFactory::getInstanceByObjId($a_user);
485 }
486
487 if ($a_user->getId() != $ilUser->getId()) {
488 $info->addSection($this->lng->txt("trac_user_data"));
489 // $info->addProperty($this->lng->txt('username'),$a_user->getLogin());
490 // $info->addProperty($this->lng->txt('name'),$a_user->getFullname());
491 $info->addProperty(
492 $this->lng->txt('last_login'),
493 ilDatePresentation::formatDate(new ilDateTime($a_user->getLastLogin(), IL_CAL_DATETIME))
494 );
495 $info->addProperty(
496 $this->lng->txt('trac_total_online'),
497 ilDatePresentation::secondsToString(ilOnlineTracking::getOnlineTime($a_user->getId()))
498 );
499 return true;
500 }
501 }
502
503 public function __appendLPDetails(&$info, $item_id, $user_id)
504 {
505 global $DIC;
506
507 $ilObjDataCache = $DIC['ilObjDataCache'];
508
509 $type = $ilObjDataCache->lookupType($item_id);
510
511 // Section learning_progress
512 // $info->addSection($this->lng->txt('trac_learning_progress'));
513 // see ilLPTableBaseGUI::parseTitle();
514 $info->addSection($this->lng->txt("trac_progress") . ": " . ilObject::_lookupTitle($item_id));
515
516 $olp = ilObjectLP::getInstance($item_id);
517 $info->addProperty(
518 $this->lng->txt('trac_mode'),
519 $olp->getModeText($olp->getCurrentMode())
520 );
521
522 switch ($type) {
523 case 'lm':
524 case 'htlm':
525 include_once 'Services/Tracking/classes/class.ilLearningProgress.php';
526 $progress = ilLearningProgress::_getProgress($user_id, $item_id);
527
528 if ($progress['access_time']) {
529 $info->addProperty(
530 $this->lng->txt('last_access'),
531 ilDatePresentation::formatDate(new ilDateTime($progress['access_time'], IL_CAL_UNIX))
532 );
533 } else {
534 $info->addProperty($this->lng->txt('last_access'), $this->lng->txt('trac_not_accessed'));
535 }
536 $info->addProperty($this->lng->txt('trac_visits'), (int) $progress['visits']);
538 $info->addProperty($this->lng->txt('trac_spent_time'), ilDatePresentation::secondsToString($progress['spent_seconds']));
539 }
540 // fallthrough
541
542 // no break
543 case 'exc':
544 case 'tst':
545 case 'file':
546 case 'mcst':
547 case 'svy':
548 case 'crs':
549 case 'sahs':
550 case 'grp':
551 case 'iass':
552 case 'copa':
553 case 'cmix':
554 case 'lti':
555 case 'sess':
556 case 'lso':
557 // display status as image
558 include_once("./Services/Tracking/classes/class.ilLearningProgressBaseGUI.php");
559 $status = $this->__readStatus($item_id, $user_id);
561 $status_text = ilLearningProgressBaseGUI::_getStatusText($status);
562
563 $info->addProperty(
564 $this->lng->txt('trac_status'),
565 $icons->renderIconForStatus($icons->lookupNumStatus($status)) . " " . $status_text
566 );
567
568 // #15334 - see ilLPTableBaseGUI::isPercentageAvailable()
569 $mode = $olp->getCurrentMode();
570 if (in_array($mode, array(ilLPObjSettings::LP_MODE_TLT,
572 // ilLPObjSettings::LP_MODE_OBJECTIVES,
582 include_once 'Services/Tracking/classes/class.ilLPStatus.php';
583 $perc = ilLPStatus::_lookupPercentage($item_id, $user_id);
584 $info->addProperty($this->lng->txt('trac_percentage'), (int) $perc . "%");
585 }
586 break;
587
588 }
589
590 include_once 'Services/Tracking/classes/class.ilLPMarks.php';
591
593 if (strlen($mark = ilLPMarks::_lookupMark($user_id, $item_id))) {
594 $info->addProperty($this->lng->txt('trac_mark'), $mark);
595 }
596 }
597
598 if (strlen($comment = ilLPMarks::_lookupComment($user_id, $item_id))) {
599 $info->addProperty($this->lng->txt('trac_comment'), $comment);
600 }
601 }
602
603 public static function __readStatus($a_obj_id, $user_id)
604 {
605 include_once 'Services/Tracking/classes/class.ilLPStatus.php';
606 $status = ilLPStatus::_lookupStatus($a_obj_id, $user_id);
607
608 include_once("./Services/Tracking/classes/class.ilLPStatus.php");
609 switch ($status) {
612
615
618
621
622 default:
623 return $status;
624 }
625 }
626
639 public function __sort($a_ids, $a_table, $a_field, $a_id_name)
640 {
641 global $DIC;
642
643 $ilDB = $DIC['ilDB'];
644
645 if (!$a_ids) {
646 return array();
647 }
648
649 // comment by mjansen: Requesting database in gui classes?
650
651 // use database to sort user array
652 $where = "WHERE " . $ilDB->in($a_id_name, $a_ids, false, 'integer') . " ";
653
654 $query = "SELECT " . $a_id_name . " FROM " . $a_table . " " .
655 $where .
656 "ORDER BY " . $a_field;
657
658 $res = $ilDB->query($query);
659 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
660 $ids[] = $row->$a_id_name;
661 }
662 return $ids ? $ids : array();
663 }
664
665 public function __getPercent($max, $reached)
666 {
667 if (!$max) {
668 return "0%";
669 }
670
671 return sprintf("%d%%", $reached / $max * 100);
672 }
673
674 public function __readItemStatusInfo($a_items)
675 {
676 global $DIC;
677
678 $ilObjDataCache = $DIC['ilObjDataCache'];
679
680 include_once 'Services/Object/classes/class.ilObjectLP.php';
681
682 foreach ($a_items as $item_id) {
683 $olp = ilObjectLP::getInstance($item_id);
684
685 $this->obj_data[$item_id]['type'] = $ilObjDataCache->lookupType($item_id);
686 $this->obj_data[$item_id]['mode'] = $olp->getCurrentMode();
687 if ($this->obj_data[$item_id]['mode'] == ilLPObjSettings::LP_MODE_TLT) {
688 include_once './Services/MetaData/classes/class.ilMDEducational.php';
689 $this->obj_data[$item_id]['tlt'] = ilMDEducational::_getTypicalLearningTimeSeconds($item_id);
690 }
691 if ($this->obj_data[$item_id]['mode'] == ilLPObjSettings::LP_MODE_VISITS) {
692 $this->obj_data[$item_id]['visits'] = ilLPObjSettings::_lookupVisits($item_id);
693 }
694 if ($this->obj_data[$item_id]['mode'] == ilLPObjSettings::LP_MODE_SCORM) {
695 $collection = $olp->getCollectionInstance();
696 if ($collection) {
697 $this->obj_data[$item_id]['scos'] = count($collection->getItems());
698 }
699 }
700 }
701 }
702
703 public function __getLegendHTML(int $variant = ilLPStatusIcons::ICON_VARIANT_LONG) : string
704 {
705 global $DIC;
706 $lng = $DIC['lng'];
707 $icons = ilLPStatusIcons::getInstance($variant);
708
709 $tpl = new ilTemplate(
710 "tpl.lp_legend.html",
711 true,
712 true,
713 "Services/Tracking"
714 );
715
716 $tpl->setVariable(
717 "IMG_NOT_ATTEMPTED",
718 $icons->renderIconForStatus(ilLPStatus::LP_STATUS_NOT_ATTEMPTED_NUM)
719 );
720 $tpl->setVariable(
721 "IMG_IN_PROGRESS",
722 $icons->renderIconForStatus(ilLPStatus::LP_STATUS_IN_PROGRESS_NUM)
723 );
724 $tpl->setVariable(
725 "IMG_COMPLETED",
726 $icons->renderIconForStatus(ilLPStatus::LP_STATUS_COMPLETED_NUM)
727 );
728 $tpl->setVariable(
729 "IMG_FAILED",
730 $icons->renderIconForStatus(ilLPStatus::LP_STATUS_FAILED_NUM)
731 );
732 $tpl->setVariable(
733 "TXT_NOT_ATTEMPTED",
734 $lng->txt("trac_not_attempted")
735 );
736 $tpl->setVariable(
737 "TXT_IN_PROGRESS",
738 $lng->txt("trac_in_progress")
739 );
740 $tpl->setVariable(
741 "TXT_COMPLETED",
742 $lng->txt("trac_completed")
743 );
744 $tpl->setVariable(
745 "TXT_FAILED",
746 $lng->txt("trac_failed")
747 );
748
749 include_once "Services/UIComponent/Panel/classes/class.ilPanelGUI.php";
752 $panel->setBody($tpl->get());
753
754 return $panel->getHTML();
755 }
756
757 protected function initEditUserForm($a_user_id, $a_obj_id, $a_cancel = null)
758 {
759 global $DIC;
760
761 $lng = $DIC['lng'];
762 $ilCtrl = $DIC['ilCtrl'];
763
764 include_once 'Services/Object/classes/class.ilObjectLP.php';
765 $olp = ilObjectLP::getInstance($a_obj_id);
766 $lp_mode = $olp->getCurrentMode();
767
768 include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
769 $form = new ilPropertyFormGUI();
770
771 $form->setFormAction($ilCtrl->getFormAction($this, "updateUser"));
772
773 $form->setTitle($lng->txt("edit") . ": " . ilObject::_lookupTitle($a_obj_id));
774 $form->setDescription($lng->txt('trac_mode') . ": " . $olp->getModeText($lp_mode));
775
776 include_once "Services/User/classes/class.ilUserUtil.php";
777 $user = new ilNonEditableValueGUI($lng->txt("user"), null, true);
778 $user->setValue(ilUserUtil::getNamePresentation($a_user_id, true));
779 $form->addItem($user);
780
781 include_once 'Services/Tracking/classes/class.ilLPMarks.php';
782 $marks = new ilLPMarks($a_obj_id, $a_user_id);
783
785 $mark = new ilTextInputGUI($lng->txt("trac_mark"), "mark");
786 $mark->setValue($marks->getMark());
787 $mark->setMaxLength(32);
788 $form->addItem($mark);
789 }
790
791 $comm = new ilTextInputGUI($lng->txt("trac_comment"), "comment");
792 $comm->setValue($marks->getComment());
793 $form->addItem($comm);
794
795 if ($lp_mode == ilLPObjSettings::LP_MODE_MANUAL ||
797 include_once("./Services/Tracking/classes/class.ilLPStatus.php");
798 $completed = ilLPStatus::_lookupStatus($a_obj_id, $a_user_id);
799
800 $status = new ilCheckboxInputGUI($lng->txt('trac_completed'), "completed");
801 $status->setChecked(($completed == ilLPStatus::LP_STATUS_COMPLETED_NUM));
802 $form->addItem($status);
803 }
804
805 $form->addCommandButton("updateUser", $lng->txt('save'));
806
807 if ($a_cancel) {
808 $form->addCommandButton($a_cancel, $lng->txt('cancel'));
809 }
810
811 return $form;
812 }
813
814 public function __showEditUser($a_user_id, $a_ref_id, $a_cancel, $a_sub_id = false)
815 {
816 global $DIC;
817
818 $ilCtrl = $DIC['ilCtrl'];
819
820 if (!$a_sub_id) {
821 $obj_id = ilObject::_lookupObjId($a_ref_id);
822 } else {
823 $ilCtrl->setParameter($this, 'userdetails_id', $a_sub_id);
824 $obj_id = ilObject::_lookupObjId($a_sub_id);
825 }
826
827 $ilCtrl->setParameter($this, 'user_id', $a_user_id);
828 $ilCtrl->setParameter($this, 'details_id', $a_ref_id);
829
830 $form = $this->initEditUserForm($a_user_id, $obj_id, $a_cancel);
831
832 return $form->getHTML();
833 }
834
835 public function __updateUser($user_id, $obj_id)
836 {
837 $form = $this->initEditUserForm($user_id, $obj_id);
838 if ($form->checkInput()) {
839 include_once 'Services/Tracking/classes/class.ilLPMarks.php';
840
841 $marks = new ilLPMarks($obj_id, $user_id);
842 $marks->setMark($form->getInput("mark"));
843 $marks->setComment($form->getInput("comment"));
844
845 $do_lp = false;
846
847 // status/completed is optional
848 $status = $form->getItemByPostVar("completed");
849 if (is_object($status)) {
850 if ($marks->getCompleted() != $form->getInput("completed")) {
851 $marks->setCompleted($form->getInput("completed"));
852 $do_lp = true;
853 }
854 }
855
856 $marks->update();
857
858 // #11600
859 if ($do_lp) {
860 include_once("./Services/Tracking/classes/class.ilLPStatusWrapper.php");
861 ilLPStatusWrapper::_updateStatus($obj_id, $user_id);
862 }
863 }
864 }
865
866 public static function isObjectOffline($a_obj_id, $a_type = null)
867 {
868 global $DIC;
869
870 $objDefinition = $DIC['objDefinition'];
871 $ilObjDataCache = $DIC['ilObjDataCache'];
872
873 if (!$a_type) {
874 $a_type = $ilObjDataCache->lookupType($a_obj_id);
875 }
876
877 if ($objDefinition->isPluginTypeName($a_type)) {
878 return false;
879 }
880
881 $class = "ilObj" . $objDefinition->getClassName($a_type) . "Access";
882 include_once $objDefinition->getLocation($a_type) . "/class." . $class . ".php";
883 return call_user_func(array($class,'_isOffline'), $a_obj_id);
884
885 // PHP 5.3 only ?
886 //return $class::_isOffline($obj_id);
887 }
888}
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64
$comment
Definition: buildRTE.php:83
$_GET["client_id"]
An exception for terminatinating execution or to throw for unit testing.
const IL_CAL_UNIX
const IL_CAL_DATETIME
This class represents a checkbox property in a property form.
static secondsToString($seconds, $force_with_seconds=false, $a_lng=null)
converts seconds to string: Long: 7 days 4 hour(s) ...
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false, $include_seconds=false)
Format a date @access public.
@classDescription Date and time handling
static _lookupMark($a_usr_id, $a_obj_id)
static _lookupComment($a_usr_id, $a_obj_id)
static _lookupVisits($a_obj_id)
const LP_MODE_CMIX_COMPL_OR_PASSED_WITH_FAILED
static getInstance(int $variant=ilLPStatusIcons::ICON_VARIANT_DEFAULT, ?\ILIAS\UI\Renderer $renderer=null, ?\ILIAS\UI\Factory $factory=null)
static _updateStatus($a_obj_id, $a_usr_id, $a_obj=null, $a_percentage=false, $a_force_raise=false)
Update status.
const LP_STATUS_COMPLETED_NUM
const LP_STATUS_NOT_PARTICIPATED
static _lookupStatus($a_obj_id, $a_user_id, $a_create=true)
Lookup status.
const LP_STATUS_COMPLETED
const LP_STATUS_NOT_REGISTERED
const LP_STATUS_PARTICIPATED
const LP_STATUS_FAILED
const LP_STATUS_IN_PROGRESS_NUM
const LP_STATUS_NOT_ATTEMPTED_NUM
const LP_STATUS_REGISTERED
const LP_STATUS_FAILED_NUM
static _lookupPercentage($a_obj_id, $a_user_id)
Lookup percentage.
const LP_STATUS_NOT_ATTEMPTED
const LP_STATUS_IN_PROGRESS
static checkPermission($a_permission, $a_ref_id, $a_user_id=null)
wrapper for rbac access checks
static _getStatusText($a_status, $a_lng=null)
Get status alt text.
__showImageByStatus(&$tpl, $a_status, $tpl_prefix="")
__sort($a_ids, $a_table, $a_field, $a_id_name)
Function that sorts ids by a given table field using WHERE IN E.g: __sort(array(6,...
__getLegendHTML(int $variant=ilLPStatusIcons::ICON_VARIANT_LONG)
__construct($a_mode, $a_ref_id=0, $a_usr_id=0)
static _showImageByStatus(&$tpl, $a_status, $tpl_prefix="")
we need this public in table classes
__showObjectDetails(&$info, $item_id=0, $add_section=true)
show details about current object.
static __readStatus($a_obj_id, $user_id)
__appendLPDetails(&$info, $item_id, $user_id)
initEditUserForm($a_user_id, $a_obj_id, $a_cancel=null)
static _getImagePathForStatus($a_status)
Get image path for status.
static isObjectOffline($a_obj_id, $a_type=null)
__insertPath(&$a_tpl, $a_ref_id)
insert path
__showEditUser($a_user_id, $a_ref_id, $a_cancel, $a_sub_id=false)
static _getProgress($a_user_id, $a_obj_id)
static _getTypicalLearningTimeSeconds($a_rbac_id, $a_obj_id=0)
This class represents a non editable value in a property form.
static _enabledUserRelatedData()
check wether user related tracking is enabled or not
static getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
static supportsMark($a_obj_type)
static supportsSpentSeconds($a_obj_type)
static getInstance($a_obj_id)
static supportsMatrixView($a_obj_type)
static _lookupObjId($a_id)
static _lookupTitle($a_id)
lookup object title
static _lookupType($a_id, $a_reference=false)
lookup object type
const PANEL_STYLE_SECONDARY
static getInstance()
Get instance.
This class represents a property form user interface.
Class ilTableGUI.
special template class to simplify handling of ITX/PEAR
This class represents a text property in a property form.
static getNamePresentation( $a_user_id, $a_user_image=false, $a_profile_link=false, $a_profile_back_link="", $a_force_first_lastname=false, $a_omit_login=false, $a_sortable=true, $a_return_data_array=false, $a_ctrl_path="ilpublicuserprofilegui")
Default behaviour is:
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
static infoPanel($a_keep=true)
global $DIC
Definition: goto.php:24
if(isset($_FILES['img_file']) &&is_array($_FILES['img_file'])) $panel
Definition: imgupload.php:138
$ilUser
Definition: imgupload.php:18
$query
$type
foreach($_POST as $key=> $value) $res
global $ilDB
$data
Definition: storeScorm.php:23