ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
class.ilLearningProgressBaseGUI.php
Go to the documentation of this file.
1 <?php
2 
3 /* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE */
4 
5 include_once 'Services/Tracking/classes/class.ilObjUserTracking.php';
6 
22 {
23  var $tpl = null;
24  var $ctrl = null;
25  var $lng = null;
26  var $ref_id = 0;
27  var $mode = 0;
28 
29  protected $anonymized;
30 
36 
37  const LP_ACTIVE_SETTINGS = 1;
38  const LP_ACTIVE_OBJECTS = 2;
39  const LP_ACTIVE_PROGRESS = 3;
40  // const LP_ACTIVE_LM_STATISTICS = 4; obsolete
41  const LP_ACTIVE_USERS = 5;
42  const LP_ACTIVE_SUMMARY = 6;
47  const LP_ACTIVE_MATRIX = 11;
48 
49  function ilLearningProgressBaseGUI($a_mode,$a_ref_id = 0,$a_usr_id = 0)
50  {
51  global $tpl,$ilCtrl,$lng,$ilObjDataCache,$ilTabs;
52 
53  $this->tpl =& $tpl;
54  $this->ctrl =& $ilCtrl;
55  $this->lng =& $lng;
56  $this->lng->loadLanguageModule('trac');
57  $this->tabs_gui =& $ilTabs;
58 
59  $this->mode = $a_mode;
60  $this->ref_id = $a_ref_id;
61  $this->obj_id = $ilObjDataCache->lookupObjId($this->ref_id);
62  $this->obj_type = $ilObjDataCache->lookupType($this->obj_id);
63  $this->usr_id = $a_usr_id;
64 
65  $this->anonymized = (bool)!ilObjUserTracking::_enabledUserRelatedData();
66  if(!$this->anonymized && $this->obj_id)
67  {
68  include_once "Services/Object/classes/class.ilObjectLP.php";
69  $olp = ilObjectLP::getInstance($this->obj_id);
70  $this->anonymized = $olp->isAnonymized();
71  }
72  }
73 
74  function isAnonymized()
75  {
76  return $this->anonymized;
77  }
78 
79  function getMode()
80  {
81  return $this->mode;
82  }
83 
84  function getRefId()
85  {
86  return $this->ref_id;
87  }
88 
89  function getObjId()
90  {
91  return $this->obj_id;
92  }
93 
94  function getUserId()
95  {
96  if($this->usr_id)
97  {
98  return $this->usr_id;
99  }
100  if((int) $_GET['user_id'])
101  {
102  return (int) $_GET['user_id'];
103  }
104  return 0;
105  }
106 
107  // Protected
109  {
110  if(strlen($cmd = $this->ctrl->getCmd()))
111  {
112  return $cmd;
113  }
114  return 'show';
115  }
116 
117  function __setSubTabs($a_active)
118  {
119  global $rbacsystem,$ilObjDataCache;
120 
121 
122 
123  switch($this->getMode())
124  {
125  case self::LP_CONTEXT_PERSONAL_DESKTOP:
126 
127  include_once("Services/Tracking/classes/class.ilObjUserTracking.php");
130  {
131  $this->tabs_gui->addTarget('trac_progress',
132  $this->ctrl->getLinkTargetByClass('illplistofprogressgui',''),
133  "","","",$a_active == self::LP_ACTIVE_PROGRESS);
134  }
135 
137  {
138  $this->tabs_gui->addTarget('trac_objects',
139  $this->ctrl->getLinkTargetByClass("illplistofobjectsgui",''),
140  "","","",$a_active == self::LP_ACTIVE_OBJECTS);
141  }
142  break;
143 
144 
145  case self::LP_CONTEXT_REPOSITORY:
146  // #12771 - do not show status if learning progress is deactivated
147  include_once './Services/Object/classes/class.ilObjectLP.php';
148  $olp = ilObjectLP::getInstance($this->obj_id);
149  if($olp->isActive())
150  {
151  $has_read = $rbacsystem->checkAccess('read_learning_progress',$this->getRefId());
152 
153  if($this->isAnonymized() || !$has_read)
154  {
155  $this->ctrl->setParameterByClass('illplistofprogressgui','user_id',$this->getUserId());
156  $this->tabs_gui->addSubTabTarget('trac_progress',
157  $this->ctrl->getLinkTargetByClass('illplistofprogressgui',''),
158  "","","",$a_active == self::LP_ACTIVE_PROGRESS);
159  }
160  else
161  {
162  // Check if it is a course
163  $sub_tab = ($ilObjDataCache->lookupType($ilObjDataCache->lookupObjId($this->getRefId())) == 'crs') ?
164  'trac_crs_objects' :
165  'trac_objects';
166 
167  $this->tabs_gui->addSubTabTarget($sub_tab,
168  $this->ctrl->getLinkTargetByClass("illplistofobjectsgui",''),
169  "","","",$a_active == self::LP_ACTIVE_OBJECTS);
170  }
171 
172  if($has_read)
173  {
174  if(!$this->isAnonymized() && !in_array($this->obj_type, array('tst', 'htlm', 'exc', 'sess')) && !($olp instanceof ilPluginLP))
175  {
176  $this->tabs_gui->addSubTabTarget("trac_matrix",
177  $this->ctrl->getLinkTargetByClass("illplistofobjectsgui", 'showUserObjectMatrix'),
178  "", "", "", $a_active == self::LP_ACTIVE_MATRIX);
179  }
180 
181  $this->tabs_gui->addSubTabTarget("trac_summary",
182  $this->ctrl->getLinkTargetByClass("illplistofobjectsgui", 'showObjectSummary'),
183  "", "", "", $a_active == self::LP_ACTIVE_SUMMARY);
184  }
185  }
186  if(!($olp instanceof ilPluginLP) &&
187  $rbacsystem->checkAccess('edit_learning_progress',$this->getRefId()))
188  {
189  $this->tabs_gui->addSubTabTarget('trac_settings',
190  $this->ctrl->getLinkTargetByClass('illplistofsettingsgui',''),
191  "","","",$a_active == self::LP_ACTIVE_SETTINGS);
192  }
193  break;
194 
195  case self::LP_CONTEXT_ADMINISTRATION:
196  /*
197  $this->tabs_gui->addSubTabTarget('trac_progress',
198  $this->ctrl->getLinkTargetByClass('illplistofprogressgui',''),
199  "","","",$a_active == self::LP_ACTIVE_PROGRESS);
200  */
201  $this->tabs_gui->addSubTabTarget('trac_objects',
202  $this->ctrl->getLinkTargetByClass("illplistofobjectsgui",''),
203  "","","",$a_active == self::LP_ACTIVE_OBJECTS);
204  break;
205 
206  case self::LP_CONTEXT_USER_FOLDER:
207  case self::LP_CONTEXT_ORG_UNIT:
208  // No tabs default class is lpprogressgui
209  break;
210 
211  default:
212  die ('No valid mode given');
213  break;
214  }
215 
216  return true;
217  }
218 
219  function __buildFooter()
220  {
221  switch($this->getMode())
222  {
223  case self::LP_CONTEXT_PERSONAL_DESKTOP:
224 
225  $this->tpl->show(true);
226  }
227  }
228 
229  function __buildHeader()
230  {
231  if($this->getMode() == self::LP_CONTEXT_PERSONAL_DESKTOP)
232  {
233  $this->tpl->setTitle($this->lng->txt("learning_progress"));
234 
235  // set locator
236 /*
237  $this->tpl->setVariable("TXT_LOCATOR", $this->lng->txt("locator"));
238  $this->tpl->touchBlock("locator_separator");
239  $this->tpl->touchBlock("locator_item");
240  //$this->tpl->setCurrentBlock("locator_item");
241  //$this->tpl->setVariable("ITEM", $this->lng->txt("personal_desktop"));
242  //$this->tpl->setVariable("LINK_ITEM",
243  // $this->ctrl->getLinkTargetByClass("ilpersonaldesktopgui"));
244  //$this->tpl->parseCurrentBlock();
245 
246  $this->tpl->setCurrentBlock("locator_item");
247  $this->tpl->setVariable("ITEM", $this->lng->txt("learning_progress"));
248  $this->tpl->setVariable("LINK_ITEM",
249  $this->ctrl->getLinkTargetByClass('illearningprogressgui'));
250  $this->tpl->parseCurrentBlock();
251 */
252 
253  // display infopanel if something happened
255  }
256 
257  }
258 
262  function __insertPath(&$a_tpl,$a_ref_id)
263  {
264  global $tree;
265 
266  $path_arr = $tree->getPathFull($a_ref_id);
267  $counter = 0;
268  foreach($tree->getPathFull($a_ref_id) as $data)
269  {
270  if($counter++)
271  {
272  $path .= " -> ";
273  }
274  $path .= $data['title'];
275  }
276  $a_tpl->setCurrentBlock("path_item");
277  $a_tpl->setVariable("PATH_ITEM",$path);
278  $a_tpl->parseCurrentBlock();
279 
280  $a_tpl->setCurrentBlock("path");
281  $a_tpl->parseCurrentBlock();
282 
283  return $path;
284  }
285 
286  function __showImageByStatus(&$tpl,$a_status,$tpl_prefix = "")
287  {
288  return ilLearningProgressBaseGUI::_showImageByStatus($tpl,$a_status,$tpl_prefix);
289  }
290 
291  // we need this public in table classes
292  public static function _showImageByStatus(&$tpl,$a_status,$tpl_prefix = "")
293  {
294  global $lng;
295 
296  $tpl->setVariable($tpl_prefix."STATUS_IMG",
298  $tpl->setVariable($tpl_prefix."STATUS_ALT",$lng->txt($a_status));
299 
300  return true;
301  }
302 
306  function _getImagePathForStatus($a_status)
307  {
308  include_once("./Services/Tracking/classes/class.ilLPStatus.php");
309 
310  // constants are either number or string, so make comparison string-based
311  switch((string)$a_status)
312  {
316  return ilUtil::getImagePath('scorm/incomplete.svg');
317  break;
318 
322  return ilUtil::getImagePath('scorm/complete.svg');
323  break;
324 
328  return ilUtil::getImagePath('scorm/not_attempted.svg');
329  break;
330 
333  return ilUtil::getImagePath('scorm/failed.svg');
334  break;
335 
336  default:
337  return ilUtil::getImagePath('scorm/not_attempted.svg');
338  break;
339  }
340  }
341 
345  function _getStatusText($a_status)
346  {
347  global $lng;
348 
349  include_once("./Services/Tracking/classes/class.ilLPStatus.php");
350 //echo "#".$a_status."#";
351  switch($a_status)
352  {
354  return $lng->txt(ilLPStatus::LP_STATUS_IN_PROGRESS);
355 
357  return $lng->txt(ilLPStatus::LP_STATUS_COMPLETED);
358 
360  return $lng->txt(ilLPStatus::LP_STATUS_FAILED);
361 
362  default:
363  if ($a_status === ilLPStatus::LP_STATUS_NOT_ATTEMPTED_NUM)
364  {
365  return $lng->txt(ilLPStatus::LP_STATUS_NOT_ATTEMPTED);
366  }
367  return $lng->txt($a_status);
368  }
369  }
370 
371 
372  // Protected Table gui methods
373  function &__initTableGUI()
374  {
375  include_once "./Services/Table/classes/class.ilTableGUI.php";
376 
377  return new ilTableGUI(0,false);
378  }
379 
380 
384  function __showObjectDetails(&$info,$item_id = 0,$add_section = true)
385  {
386  global $ilObjDataCache;
387 
388  $details_id = $item_id ? $item_id : $this->details_id;
389 
390  include_once 'Services/Object/classes/class.ilObjectLP.php';
391  $olp = ilObjectLP::getInstance($details_id);
392  $mode = $olp->getCurrentMode();
393 
394  include_once './Services/MetaData/classes/class.ilMDEducational.php';
397  {
398  // Section object details
399  if($add_section)
400  {
401  $info->addSection($this->lng->txt('details'));
402  }
403 
405  {
406  $info->addProperty($this->lng->txt('trac_required_visits'), ilLPObjSettings::_lookupVisits($details_id));
407  }
408 
409  if($seconds = ilMDEducational::_getTypicalLearningTimeSeconds($details_id))
410  {
411  $info->addProperty($this->lng->txt('meta_typical_learning_time'), ilFormat::_secondsToString($seconds));
412  }
413 
414  return true;
415  }
416  return false;
417  }
418 
419  function __appendUserInfo(&$info, $a_user)
420  {
421  global $ilUser;
422 
423  // #13525 - irrelevant personal data is not to be presented
424  return;
425 
426  if(!is_object($a_user))
427  {
428  $a_user = ilObjectFactory::getInstanceByObjId($a_user);
429  }
430 
431  if($a_user->getId() != $ilUser->getId())
432  {
433  $info->addSection($this->lng->txt("trac_user_data"));
434  // $info->addProperty($this->lng->txt('username'),$a_user->getLogin());
435  // $info->addProperty($this->lng->txt('name'),$a_user->getFullname());
436  $info->addProperty($this->lng->txt('last_login'),
437  ilDatePresentation::formatDate(new ilDateTime($a_user->getLastLogin(),IL_CAL_DATETIME)));
438  $info->addProperty($this->lng->txt('trac_total_online'),
439  ilFormat::_secondsToString(ilOnlineTracking::getOnlineTime($a_user->getId())));
440  return true;
441  }
442  }
443 
444  function __appendLPDetails(&$info,$item_id,$user_id)
445  {
446  global $ilObjDataCache;
447 
448  $type = $ilObjDataCache->lookupType($item_id);
449 
450  // Section learning_progress
451  // $info->addSection($this->lng->txt('trac_learning_progress'));
452  // see ilLPTableBaseGUI::parseTitle();
453  $info->addSection($this->lng->txt("trac_progress").": ".ilObject::_lookupTitle($item_id));
454 
455  $olp = ilObjectLP::getInstance($item_id);
456  $info->addProperty($this->lng->txt('trac_mode'),
457  $olp->getModeText($olp->getCurrentMode()));
458 
459  switch($type)
460  {
461  case 'lm':
462  case 'htlm':
463  include_once 'Services/Tracking/classes/class.ilLearningProgress.php';
464  $progress = ilLearningProgress::_getProgress($user_id,$item_id);
465 
466  if($progress['access_time'])
467  {
468  $info->addProperty($this->lng->txt('last_access'),
469  ilDatePresentation::formatDate(new ilDateTime($progress['access_time'],IL_CAL_DATETIME)));
470  }
471  else
472  {
473  $info->addProperty($this->lng->txt('last_access'),$this->lng->txt('trac_not_accessed'));
474  }
475  $info->addProperty($this->lng->txt('trac_visits'),(int) $progress['visits']);
476  if($type == 'lm')
477  {
478  $info->addProperty($this->lng->txt('trac_spent_time'),ilFormat::_secondsToString($progress['spent_seconds']));
479  }
480  // fallthrough
481 
482  case 'exc':
483  case 'tst':
484  case 'crs':
485  case 'sahs':
486  case 'grp':
487  // display status as image
488  include_once("./Services/Tracking/classes/class.ilLearningProgressBaseGUI.php");
489  $status = $this->__readStatus($item_id,$user_id);
491  $status_text = ilLearningProgressBaseGUI::_getStatusText($status);
492  $info->addProperty($this->lng->txt('trac_status'),
493  ilUtil::img($status_path, $status_text)." ".$status_text);
494 
495  // #15334 - see ilLPTableBaseGUI::isPercentageAvailable()
496  $mode = $olp->getCurrentMode();
497  if(in_array($mode, array(ilLPObjSettings::LP_MODE_TLT,
499  // ilLPObjSettings::LP_MODE_OBJECTIVES,
502  {
503  include_once 'Services/Tracking/classes/class.ilLPStatus.php';
504  $perc = ilLPStatus::_lookupPercentage($item_id, $user_id);
505  $info->addProperty($this->lng->txt('trac_percentage'), (int)$perc."%");
506  }
507  break;
508 
509  }
510 
511  include_once 'Services/Tracking/classes/class.ilLPMarks.php';
512  if(strlen($mark = ilLPMarks::_lookupMark($user_id,$item_id)))
513  {
514  $info->addProperty($this->lng->txt('trac_mark'),$mark);
515  }
516  if(strlen($comment = ilLPMarks::_lookupComment($user_id,$item_id)))
517  {
518  $info->addProperty($this->lng->txt('trac_comment'),$comment);
519  }
520  }
521 
522  function __readStatus($a_obj_id,$user_id)
523  {
524  include_once 'Services/Tracking/classes/class.ilLPStatus.php';
525  $status = ilLPStatus::_lookupStatus($a_obj_id, $user_id);
526 
527  include_once("./Services/Tracking/classes/class.ilLPStatus.php");
528  switch($status)
529  {
532 
535 
538 
541 
542  default:
543  return $status;
544  }
545  }
546 
559  function __sort($a_ids,$a_table,$a_field,$a_id_name)
560  {
561  global $ilDB;
562 
563  if(!$a_ids)
564  {
565  return array();
566  }
567 
568  // comment by mjansen: Requesting database in gui classes?
569 
570  // use database to sort user array
571  $where = "WHERE ".$ilDB->in($a_id_name, $a_ids, false, 'integer')." ";
572 
573  $query = "SELECT ".$a_id_name." FROM ".$a_table." ".
574  $where.
575  "ORDER BY ".$a_field;
576 
577  $res = $ilDB->query($query);
578  while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
579  {
580  $ids[] = $row->$a_id_name;
581  }
582  return $ids ? $ids : array();
583  }
584 
585  function __getPercent($max,$reached)
586  {
587  if(!$max)
588  {
589  return "0%";
590  }
591 
592  return sprintf("%d%%",$reached / $max * 100);
593  }
594 
595  function __readItemStatusInfo($a_items)
596  {
597  global $ilObjDataCache;
598 
599  include_once 'Services/Object/classes/class.ilObjectLP.php';
600 
601  foreach($a_items as $item_id)
602  {
603  $olp = ilObjectLP::getInstance($item_id);
604 
605  $this->obj_data[$item_id]['type'] = $ilObjDataCache->lookupType($item_id);
606  $this->obj_data[$item_id]['mode'] = $olp->getCurrentMode();
607  if($this->obj_data[$item_id]['mode'] == ilLPObjSettings::LP_MODE_TLT)
608  {
609  include_once './Services/MetaData/classes/class.ilMDEducational.php';
610  $this->obj_data[$item_id]['tlt'] = ilMDEducational::_getTypicalLearningTimeSeconds($item_id);
611  }
612  if($this->obj_data[$item_id]['mode'] == ilLPObjSettings::LP_MODE_VISITS)
613  {
614  $this->obj_data[$item_id]['visits'] = ilLPObjSettings::_lookupVisits($item_id);
615  }
616  if($this->obj_data[$item_id]['mode'] == ilLPObjSettings::LP_MODE_SCORM)
617  {
618  $collection = $olp->getCollectionInstance();
619  if($collection)
620  {
621  $this->obj_data[$item_id]['scos'] = count($collection->getItems());
622  }
623  }
624  }
625  }
626 
627  function __getLegendHTML()
628  {
629  global $lng;
630 
631  $tpl = new ilTemplate("tpl.lp_legend.html", true, true, "Services/Tracking");
632  $tpl->setVariable("IMG_NOT_ATTEMPTED",
633  ilUtil::getImagePath("scorm/not_attempted.svg"));
634  $tpl->setVariable("IMG_IN_PROGRESS",
635  ilUtil::getImagePath("scorm/incomplete.svg"));
636  $tpl->setVariable("IMG_COMPLETED",
637  ilUtil::getImagePath("scorm/completed.svg"));
638  $tpl->setVariable("IMG_FAILED",
639  ilUtil::getImagePath("scorm/failed.svg"));
640  $tpl->setVariable("TXT_NOT_ATTEMPTED",
641  $lng->txt("trac_not_attempted"));
642  $tpl->setVariable("TXT_IN_PROGRESS",
643  $lng->txt("trac_in_progress"));
644  $tpl->setVariable("TXT_COMPLETED",
645  $lng->txt("trac_completed"));
646  $tpl->setVariable("TXT_FAILED",
647  $lng->txt("trac_failed"));
648 
649  include_once "Services/UIComponent/Panel/classes/class.ilPanelGUI.php";
650  $panel = ilPanelGUI::getInstance();
651  $panel->setPanelStyle(ilPanelGUI::PANEL_STYLE_SECONDARY);
652  $panel->setBody($tpl->get());
653 
654  return $panel->getHTML();
655  }
656 
657  protected function initEditUserForm($a_user_id, $a_obj_id, $a_cancel = null)
658  {
659  global $lng, $ilCtrl;
660 
661  include_once 'Services/Object/classes/class.ilObjectLP.php';
662  $olp = ilObjectLP::getInstance($a_obj_id);
663  $lp_mode = $olp->getCurrentMode();
664 
665  include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
666  $form = new ilPropertyFormGUI();
667 
668  $form->setFormAction($ilCtrl->getFormAction($this, "updateUser"));
669 
670  $form->setTitle($lng->txt("edit").": ".ilObject::_lookupTitle($a_obj_id));
671  $form->setDescription($lng->txt('trac_mode').": ".$olp->getModeText($lp_mode));
672 
673  include_once "Services/User/classes/class.ilUserUtil.php";
674  $user = new ilNonEditableValueGUI($lng->txt("user"), null, true);
675  $user->setValue(ilUserUtil::getNamePresentation($a_user_id, true));
676  $form->addItem($user);
677 
678  include_once 'Services/Tracking/classes/class.ilLPMarks.php';
679  $marks = new ilLPMarks($a_obj_id, $a_user_id);
680 
681  $type = ilObject::_lookupType($a_obj_id);
682  if($type != 'lm')
683  {
684  $mark = new ilTextInputGUI($lng->txt("trac_mark"), "mark");
685  $mark->setValue($marks->getMark());
686  $mark->setMaxLength(32);
687  $form->addItem($mark);
688  }
689 
690  $comm = new ilTextInputGUI($lng->txt("trac_comment"), "comment");
691  $comm->setValue($marks->getComment());
692  $form->addItem($comm);
693 
694  if($lp_mode == ilLPObjSettings::LP_MODE_MANUAL ||
696  {
697  include_once("./Services/Tracking/classes/class.ilLPStatus.php");
698  $completed = ilLPStatus::_lookupStatus($a_obj_id, $a_user_id);
699 
700  $status = new ilCheckboxInputGUI($lng->txt('trac_completed'), "completed");
701  $status->setChecked(($completed == ilLPStatus::LP_STATUS_COMPLETED_NUM));
702  $form->addItem($status);
703  }
704 
705  $form->addCommandButton("updateUser", $lng->txt('save'));
706 
707  if($a_cancel)
708  {
709  $form->addCommandButton($a_cancel, $lng->txt('cancel'));
710  }
711 
712  return $form;
713  }
714 
715  function __showEditUser($a_user_id, $a_ref_id, $a_cancel, $a_sub_id = false)
716  {
717  global $ilCtrl;
718 
719  if(!$a_sub_id)
720  {
721  $obj_id = ilObject::_lookupObjId($a_ref_id);
722  }
723  else
724  {
725  $ilCtrl->setParameter($this,'userdetails_id',$a_sub_id);
726  $obj_id = ilObject::_lookupObjId($a_sub_id);
727  }
728 
729  $ilCtrl->setParameter($this, 'user_id', $a_user_id);
730  $ilCtrl->setParameter($this, 'details_id', $a_ref_id);
731 
732  $form = $this->initEditUserForm($a_user_id, $obj_id, $a_cancel);
733 
734  return $form->getHTML();
735  }
736 
737  function __updateUser($user_id, $obj_id)
738  {
739  $form = $this->initEditUserForm($user_id, $obj_id);
740  if($form->checkInput())
741  {
742  include_once 'Services/Tracking/classes/class.ilLPMarks.php';
743 
744  $marks = new ilLPMarks($obj_id, $user_id);
745  $marks->setMark($form->getInput("mark"));
746  $marks->setComment($form->getInput("comment"));
747 
748  $do_lp = false;
749 
750  // status/completed is optional
751  $status = $form->getItemByPostVar("completed");
752  if(is_object($status))
753  {
754  if($marks->getCompleted() != $form->getInput("completed"))
755  {
756  $marks->setCompleted($form->getInput("completed"));
757  $do_lp = true;
758  }
759  }
760 
761  $marks->update();
762 
763  // #11600
764  if($do_lp)
765  {
766  include_once("./Services/Tracking/classes/class.ilLPStatusWrapper.php");
767  ilLPStatusWrapper::_updateStatus($obj_id, $user_id);
768  }
769  }
770  }
771 
772  static function isObjectOffline($a_obj_id, $a_type = null)
773  {
774  global $objDefinition, $ilObjDataCache;
775 
776  if(!$a_type)
777  {
778  $a_type = $ilObjDataCache->lookupType($a_obj_id);
779  }
780 
781  if($objDefinition->isPluginTypeName($a_type))
782  {
783  return false;
784  }
785 
786  $class = "ilObj".$objDefinition->getClassName($a_type)."Access";
787  include_once $objDefinition->getLocation($a_type)."/class.".$class.".php";
788  return call_user_func(array($class,'_isOffline'), $a_obj_id);
789 
790  // PHP 5.3 only ?
791  //return $class::_isOffline($obj_id);
792  }
793 }
794 
795 ?>