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