ILIAS  Release_3_10_x_branch Revision 61812
 All Data Structures Namespaces Files Functions Variables Groups Pages
class.ilSAHSPresentationGUI.php
Go to the documentation of this file.
1 <?php
2 /*
3  +-----------------------------------------------------------------------------+
4  | ILIAS open source |
5  +-----------------------------------------------------------------------------+
6  | Copyright (c) 1998-2006 ILIAS open source, University of Cologne |
7  | |
8  | This program is free software; you can redistribute it and/or |
9  | modify it under the terms of the GNU General Public License |
10  | as published by the Free Software Foundation; either version 2 |
11  | of the License, or (at your option) any later version. |
12  | |
13  | This program is distributed in the hope that it will be useful, |
14  | but WITHOUT ANY WARRANTY; without even the implied warranty of |
15  | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
16  | GNU General Public License for more details. |
17  | |
18  | You should have received a copy of the GNU General Public License |
19  | along with this program; if not, write to the Free Software |
20  | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
21  +-----------------------------------------------------------------------------+
22 */
23 
24 
41 {
42  var $ilias;
43  var $tpl;
44  var $lng;
45 
47  {
48  global $ilias, $tpl, $lng, $ilCtrl;
49 
50  $this->ilias =& $ilias;
51  $this->tpl =& $tpl;
52  $this->lng =& $lng;
53  $this->ctrl =& $ilCtrl;
54 
55  $this->ctrl->saveParameter($this, "ref_id");
56  }
57 
61  function &executeCommand()
62  {
63  global $lng,$ilAccess, $ilNavigationHistory, $ilCtrl, $ilLocator, $ilObjDataCache;
64 
65  include_once "./classes/class.ilObjectGUI.php";
66  include_once "./Modules/ScormAicc/classes/class.ilObjSAHSLearningModule.php";
67 
68  $lng->loadLanguageModule("content");
69 
70  // add entry to navigation history
71  if ($ilAccess->checkAccess("read", "", $_GET["ref_id"]))
72  {
73  $ilNavigationHistory->addItem($_GET["ref_id"],
74  "ilias.php?cmd=infoScreen&baseClass=ilSAHSPresentationGUI&ref_id=".$_GET["ref_id"], "lm");
75  }
76 
77  include_once 'payment/classes/class.ilPaymentObject.php';
78  if(ilPaymentObject::_isBuyable($_GET['ref_id']) &&
80  {
81  $ilLocator->addRepositoryItems();
82  $ilLocator->addItem($ilObjDataCache->lookupTitle($ilObjDataCache->lookupObjId($_GET['ref_id'])),
83  'ilias.php?baseClass=ilSAHSPresentationGUI&amp;ref_id='.$_GET['ref_id'],
84  '',
85  $_GET['ref_id'],
86  'sahs');
87  $this->tpl->setLocator();
88  $this->tpl->getStandardTemplate();
89 
90  include_once 'Services/Payment/classes/class.ilShopPurchaseGUI.php';
91  $this->ctrl->setReturn($this, '');
92  $pp_gui = new ilShopPurchaseGUI($_GET['ref_id']);
93  $this->ctrl->forwardCommand($pp_gui);
94  $this->tpl->show();
95  exit();
96  }
97 
98  include_once './classes/class.ilSearch.php';
99 
100  $next_class = $this->ctrl->getNextClass($this);
101  $cmd = $this->ctrl->getCmd();
102 
103  $obj_id = ilObject::_lookupObjectId($_GET['ref_id']);
105 
106  switch($type)
107  {
108 
109  case "scorm2004":
110  include_once("./Modules/ScormAicc/classes/class.ilObjSCORMLearningModuleGUI.php");
111  $this->slm_gui = new ilObjSCORMLearningModuleGUI("", $_GET["ref_id"],true,false);
112  break;
113 
114  case "scorm":
115  include_once("./Modules/ScormAicc/classes/class.ilObjSCORMLearningModuleGUI.php");
116  $this->slm_gui = new ilObjSCORMLearningModuleGUI("", $_GET["ref_id"],true,false);
117  break;
118 
119  case "aicc":
120  include_once("./Modules/ScormAicc/classes/class.ilObjAICCLearningModuleGUI.php");
121  $this->slm_gui = new ilObjAICCLearningModuleGUI("", $_GET["ref_id"],true,false);
122  break;
123 
124  case "hacp":
125  include_once("./Modules/ScormAicc/classes/class.ilObjHACPLearningModuleGUI.php");
126  $this->slm_gui = new ilObjHACPLearningModuleGUI("", $_GET["ref_id"],true,false);
127  break;
128  }
129 
130  if ($next_class != "ilinfoscreengui" &&
131  $cmd != "infoScreen")
132  {
133  switch($type)
134  {
135 
136  case "scorm2004":
137  $this->ctrl->setCmdClass("ilscorm13player");
138  $this->slm_gui = new ilObjSCORMLearningModuleGUI("", $_GET["ref_id"],true,false);
139  break;
140 
141  case "scorm":
142  $this->ctrl->setCmdClass("ilscormpresentationgui");
143  $this->slm_gui = new ilObjSCORMLearningModuleGUI("", $_GET["ref_id"],true,false);
144  break;
145 
146  case "aicc":
147  $this->ctrl->setCmdClass("ilaiccpresentationgui");
148  break;
149 
150  case "hacp":
151  $this->ctrl->setCmdClass("ilhacppresentationgui");
152  break;
153  }
154  $next_class = $this->ctrl->getNextClass($this);
155  }
156 
157  switch($next_class)
158  {
159  case "ilinfoscreengui":
160  $ret =& $this->outputInfoScreen();
161  break;
162 
163  case "ilscorm13player":
164  require_once "./Modules/Scorm2004/classes/ilSCORM13Player.php";
165  $scorm_gui = new ilSCORM13Player();
166  $ret =& $this->ctrl->forwardCommand($scorm_gui);
167  break;
168 
169  case "ilscormpresentationgui":
170  require_once "./Modules/ScormAicc/classes/SCORM/class.ilSCORMPresentationGUI.php";
171  $scorm_gui = new ilSCORMPresentationGUI();
172  $ret =& $this->ctrl->forwardCommand($scorm_gui);
173  break;
174 
175  case "ilaiccpresentationgui":
176  require_once "./Modules/ScormAicc/classes/AICC/class.ilAICCPresentationGUI.php";
177  $aicc_gui = new ilAICCPresentationGUI();
178  $ret =& $this->ctrl->forwardCommand($aicc_gui);
179  break;
180 
181  case "ilhacppresentationgui":
182  require_once "./Modules/ScormAicc/classes/HACP/class.ilHACPPresentationGUI.php";
183  $hacp_gui = new ilHACPPresentationGUI();
184  $ret =& $this->ctrl->forwardCommand($hacp_gui);
185  break;
186 
187  default:
188  $this->$cmd();
189  }
190  }
191 
192 
193  function attrib2arr(&$a_attributes)
194  {
195  $attr = array();
196  if(!is_array($a_attributes))
197  {
198  return $attr;
199  }
200  foreach ($a_attributes as $attribute)
201  {
202  $attr[$attribute->name()] = $attribute->value();
203  }
204  return $attr;
205  }
206 
207 
211  function frameset()
212  {
213  $this->tpl = new ilTemplate("tpl.sahs_pres_frameset.html", false, false, "Modules/ScormAicc");
214  $this->tpl->setVariable("REF_ID",$this->slm->getRefId());
215  $this->tpl->show("DEFAULT", false);
216  exit;
217  }
218 
219 
223  function explorer($a_target = "sahs_content")
224  {
225  global $ilBench;
226 
227  $ilBench->start("SAHSExplorer", "initExplorer");
228 
229  $this->tpl = new ilTemplate("tpl.sahs_exp_main.html", true, true, "Modules/ScormAicc");
230 
231  require_once("./Modules/ScormAicc/classes/SCORM/class.ilSCORMExplorer.php");
232  $exp = new ilSCORMExplorer("ilias.php?baseClass=ilSAHSPresentationGUI&cmd=view&ref_id=".$this->slm->getRefId(), $this->slm);
233  $exp->setTargetGet("obj_id");
234  $exp->setFrameTarget($a_target);
235 
236  //$exp->setFiltered(true);
237 
238  if ($_GET["scexpand"] == "")
239  {
240  $mtree = new ilSCORMTree($this->slm->getId());
241  $expanded = $mtree->readRootId();
242  }
243  else
244  {
245  $expanded = $_GET["scexpand"];
246  }
247  $exp->setExpand($expanded);
248 
249  $exp->forceExpandAll(true, false);
250 
251  // build html-output
252  //666$exp->setOutput(0);
253  $ilBench->stop("SAHSExplorer", "initExplorer");
254 
255  // set output
256  $ilBench->start("SAHSExplorer", "setOutput");
257  $exp->setOutput(0);
258  $ilBench->stop("SAHSExplorer", "setOutput");
259 
260  $ilBench->start("SAHSExplorer", "getOutput");
261  $output = $exp->getOutput();
262  $ilBench->stop("SAHSExplorer", "getOutput");
263 
264  $this->tpl->setVariable("LOCATION_STYLESHEET", ilUtil::getStyleSheetLocation());
265  $this->tpl->addBlockFile("CONTENT", "content", "tpl.sahs_explorer.html", "Modules/ScormAicc");
266  //$this->tpl->setVariable("TXT_EXPLORER_HEADER", $this->lng->txt("cont_content"));
267  $this->tpl->setVariable("EXP_REFRESH", $this->lng->txt("refresh"));
268  $this->tpl->setVariable("EXPLORER",$output);
269  $this->tpl->setVariable("ACTION", "ilias.php?baseClass=ilSAHSPresentationGUI&cmd=".$_GET["cmd"]."&frame=".$_GET["frame"].
270  "&ref_id=".$this->slm->getRefId()."&scexpand=".$_GET["scexpand"]);
271  $this->tpl->parseCurrentBlock();
272  $this->tpl->show();
273  }
274 
275 
276  function view()
277  {
278  $sc_gui_object =& ilSCORMObjectGUI::getInstance($_GET["obj_id"]);
279 
280  if(is_object($sc_gui_object))
281  {
282  $sc_gui_object->view();
283  }
284 
285  $this->tpl->setVariable("LOCATION_STYLESHEET", ilUtil::getStyleSheetLocation());
286  $this->tpl->show();
287  }
288 
289  function api()
290  {
291  global $ilias;
292 
293  $slm_obj =& new ilObjSCORMLearningModule($_GET["ref_id"]);
294 
295  $this->tpl = new ilTemplate("tpl.sahs_api.html", true, true, "Modules/ScormAicc");
296  $this->tpl->setVariable("USER_ID",$ilias->account->getId());
297  $this->tpl->setVariable("USER_FIRSTNAME",$ilias->account->getFirstname());
298  $this->tpl->setVariable("USER_LASTNAME",$ilias->account->getLastname());
299  $this->tpl->setVariable("REF_ID",$_GET["ref_id"]);
300  $this->tpl->setVariable("SESSION_ID",session_id());
301 
302  $this->tpl->setVariable("CODE_BASE", "http://".$_SERVER['SERVER_NAME'].substr($_SERVER['PHP_SELF'], 0, strpos ($_SERVER['PHP_SELF'], "/ilias.php")));
303  $this->tpl->parseCurrentBlock();
304 
305  $this->tpl->show(false);
306  exit;
307  }
308 
309  function launchSahs()
310  {
311  global $ilUser, $ilDB;
312 
313  $sco_id = ($_GET["sahs_id"] == "")
314  ? $_POST["sahs_id"]
315  : $_GET["sahs_id"];
316  $ref_id = ($_GET["ref_id"] == "")
317  ? $_POST["ref_id"]
318  : $_GET["ref_id"];
319 
320  $this->slm =& new ilObjSCORMLearningModule($ref_id, true);
321 
322  include_once("./Modules/ScormAicc/classes/SCORM/class.ilSCORMItem.php");
323  include_once("./Modules/ScormAicc/classes/SCORM/class.ilSCORMResource.php");
324  $item =& new ilSCORMItem($sco_id);
325 
326  $id_ref = $item->getIdentifierRef();
327  $resource =& new ilSCORMResource();
328  $resource->readByIdRef($id_ref, $item->getSLMId());
329  //$slm_obj =& new ilObjSCORMLearningModule($_GET["ref_id"]);
330  $href = $resource->getHref();
331  $this->tpl = new ilTemplate("tpl.sahs_launch_cbt.html", true, true, "Modules/ScormAicc");
332  $this->tpl->setVariable("HREF", $this->slm->getDataDirectory("output")."/".$href);
333 
334  // set item data
335  $this->tpl->setVariable("LAUNCH_DATA", $item->getDataFromLms());
336  $this->tpl->setVariable("MAST_SCORE", $item->getMasteryScore());
337  $this->tpl->setVariable("MAX_TIME", $item->getMaxTimeAllowed());
338  $this->tpl->setVariable("LIMIT_ACT", $item->getTimeLimitAction());
339 
340  // set alternative API name
341  if ($this->slm->getAPIAdapterName() != "API")
342  {
343  $this->tpl->setCurrentBlock("alt_api_ref");
344  $this->tpl->setVariable("API_NAME", $this->slm->getAPIAdapterName());
345  $this->tpl->parseCurrentBlock();
346  }
347 
348  $query = "SELECT * FROM scorm_tracking WHERE".
349  " user_id = ".$ilDB->quote($ilUser->getId()).
350  " AND sco_id = ".$ilDB->quote($sco_id).
351  " AND obj_id = ".$ilDB->quote($this->slm->getId());
352 
353 
354  $val_set = $ilDB->query($query);
355  $re_value = array();
356  while($val_rec = $val_set->fetchRow(DB_FETCHMODE_ASSOC))
357  {
358  $val_rec["rvalue"] = str_replace("\r\n", "\n", $val_rec["rvalue"]);
359  $val_rec["rvalue"] = str_replace("\r", "\n", $val_rec["rvalue"]);
360  $val_rec["rvalue"] = str_replace("\n", "\\n", $val_rec["rvalue"]);
361  $re_value[$val_rec["lvalue"]] = $val_rec["rvalue"];
362  }
363 
364  foreach($re_value as $var => $value)
365  {
366  switch ($var)
367  {
368  case "cmi.core.lesson_location":
369  case "cmi.core.lesson_status":
370  case "cmi.core.entry":
371  case "cmi.core.score.raw":
372  case "cmi.core.score.max":
373  case "cmi.core.score.min":
374  case "cmi.core.total_time":
375  case "cmi.core.exit":
376  case "cmi.suspend_data":
377  case "cmi.comments":
378  case "cmi.student_preference.audio":
379  case "cmi.student_preference.language":
380  case "cmi.student_preference.speed":
381  case "cmi.student_preference.text":
382  $this->setSingleVariable($var, $value);
383  break;
384 
385  case "cmi.objectives._count":
386  $this->setSingleVariable($var, $value);
387  $this->setArray("cmi.objectives", $value, "id", $re_value);
388  $this->setArray("cmi.objectives", $value, "score.raw", $re_value);
389  $this->setArray("cmi.objectives", $value, "score.max", $re_value);
390  $this->setArray("cmi.objectives", $value, "score.min", $re_value);
391  $this->setArray("cmi.objectives", $value, "status", $re_value);
392  break;
393 
394  case "cmi.interactions._count":
395  $this->setSingleVariable($var, $value);
396  $this->setArray("cmi.interactions", $value, "id", $re_value);
397  for($i=0; $i<$value; $i++)
398  {
399  $var2 = "cmi.interactions.".$i.".objectives._count";
400  if (isset($v_array[$var2]))
401  {
402  $cnt = $v_array[$var2];
403  $this->setArray("cmi.interactions.".$i.".objectives",
404  $cnt, "id", $re_value);
405  /*
406  $this->setArray("cmi.interactions.".$i.".objectives",
407  $cnt, "score.raw", $re_value);
408  $this->setArray("cmi.interactions.".$i.".objectives",
409  $cnt, "score.max", $re_value);
410  $this->setArray("cmi.interactions.".$i.".objectives",
411  $cnt, "score.min", $re_value);
412  $this->setArray("cmi.interactions.".$i.".objectives",
413  $cnt, "status", $re_value);*/
414  }
415  }
416  $this->setArray("cmi.interactions", $value, "time", $re_value);
417  $this->setArray("cmi.interactions", $value, "type", $re_value);
418  for($i=0; $i<$value; $i++)
419  {
420  $var2 = "cmi.interactions.".$i.".correct_responses._count";
421  if (isset($v_array[$var2]))
422  {
423  $cnt = $v_array[$var2];
424  $this->setArray("cmi.interactions.".$i.".correct_responses",
425  $cnt, "pattern", $re_value);
426  $this->setArray("cmi.interactions.".$i.".correct_responses",
427  $cnt, "weighting", $re_value);
428  }
429  }
430  $this->setArray("cmi.interactions", $value, "student_response", $re_value);
431  $this->setArray("cmi.interactions", $value, "result", $re_value);
432  $this->setArray("cmi.interactions", $value, "latency", $re_value);
433  break;
434  }
435  }
436 
437  global $lng;
438  $this->tpl->setCurrentBlock("switch_icon");
439  $this->tpl->setVariable("SCO_ID", $_GET["sahs_id"]);
440  $this->tpl->setVariable("SCO_ICO", ilUtil::getImagePath("scorm/running.gif"));
441  $this->tpl->setVariable("SCO_ALT",
442  $lng->txt("cont_status").": "
443  .$lng->txt("cont_sc_stat_running")
444  );
445  $this->tpl->parseCurrentBlock();
446 
447  // lesson mode
448  $lesson_mode = $this->slm->getDefaultLessonMode();
449  if ($this->slm->getAutoReview())
450  {
451  if ($re_value["cmi.core.lesson_status"] == "completed" ||
452  $re_value["cmi.core.lesson_status"] == "passed" ||
453  $re_value["cmi.core.lesson_status"] == "failed")
454  {
455  $lesson_mode = "review";
456  }
457  }
458  $this->tpl->setVariable("LESSON_MODE", $lesson_mode);
459 
460  // credit mode
461  if ($lesson_mode == "normal")
462  {
463  $this->tpl->setVariable("CREDIT_MODE",
464  str_replace("_", "-", $this->slm->getCreditMode()));
465  }
466  else
467  {
468  $this->tpl->setVariable("CREDIT_MODE", "no-credit");
469  }
470 
471  // init cmi.core.total_time, cmi.core.lesson_status and cmi.core.entry
472  $sahs_obj_id = ilObject::_lookupObjId($_GET["ref_id"]);
473  if (!isset($re_value["cmi.core.total_time"]))
474  {
475  $item->insertTrackData("cmi.core.total_time", "0000:00:00", $sahs_obj_id);
476  }
477  if (!isset($re_value["cmi.core.lesson_status"]))
478  {
479  $item->insertTrackData("cmi.core.lesson_status", "not attempted", $sahs_obj_id);
480  }
481  if (!isset($re_value["cmi.core.entry"]))
482  {
483  $item->insertTrackData("cmi.core.entry", "", $sahs_obj_id);
484  }
485 
486  $this->tpl->show();
487  }
488 
489  function finishSahs ()
490  {
491  global $lng;
492  $this->tpl = new ilTemplate("tpl.sahs_finish_cbt.html", true, true, "Modules/ScormAicc");
493  $this->tpl->setVariable("LOCATION_STYLESHEET", ilUtil::getStyleSheetLocation());
494 
495  $this->tpl->setCurrentBlock("switch_icon");
496  $this->tpl->setVariable("SCO_ID", $_GET["sahs_id"]);
497  $this->tpl->setVariable("SCO_ICO", ilUtil::getImagePath(
498  "scorm/".str_replace(" ", "_", $_GET["status"]).'.gif')
499  );
500  $this->tpl->setVariable("SCO_ALT",
501  $lng->txt("cont_status").": "
502  .$lng->txt("cont_sc_stat_".str_replace(" ", "_", $_GET["status"])).", "
503  .$lng->txt("cont_total_time"). ": "
504  .$_GET["totime"]
505  );
506  $this->tpl->setVariable("SCO_LAUNCH_ID", $_GET["launch"]);
507  $this->tpl->parseCurrentBlock();
508  $this->tpl->show();
509  }
510 
511  function unloadSahs ()
512  {
513  $this->tpl = new ilTemplate("tpl.sahs_unload_cbt.html", true, true, "Modules/ScormAicc");
514  $this->tpl->setVariable("LOCATION_STYLESHEET", ilUtil::getStyleSheetLocation());
515  $this->tpl->setVariable("SCO_ID", $_GET["sahs_id"]);
516  $this->tpl->show();
517  }
518 
519 
520  function launchAsset()
521  {
522  global $ilUser, $ilDB;
523 
524  $sco_id = ($_GET["asset_id"] == "")
525  ? $_POST["asset_id"]
526  : $_GET["asset_id"];
527  $ref_id = ($_GET["ref_id"] == "")
528  ? $_POST["ref_id"]
529  : $_GET["ref_id"];
530 
531  $this->slm =& new ilObjSCORMLearningModule($ref_id, true);
532 
533  include_once("./Modules/ScormAicc/classes/SCORM/class.ilSCORMItem.php");
534  include_once("./Modules/ScormAicc/classes/SCORM/class.ilSCORMResource.php");
535  $item =& new ilSCORMItem($sco_id);
536 
537  $id_ref = $item->getIdentifierRef();
538  $resource =& new ilSCORMResource();
539  $resource->readByIdRef($id_ref, $item->getSLMId());
540  $href = $resource->getHref();
541  $this->tpl->setVariable("HREF", $this->slm->getDataDirectory("output")."/".$href);
542  $this->tpl = new ilTemplate("tpl.scorm_launch_asset.html", true, true, "Modules/ScormAicc");
543  $this->tpl->setVariable("HREF", $this->slm->getDataDirectory("output")."/".$href);
544  $this->tpl->show();
545  }
546 
547 
551  function setSingleVariable($a_var, $a_value)
552  {
553  $this->tpl->setCurrentBlock("set_value");
554  $this->tpl->setVariable("VAR", $a_var);
555  $this->tpl->setVariable("VALUE", $a_value);
556  $this->tpl->parseCurrentBlock();
557  }
558 
562  function setArray($a_left, $a_value, $a_name, &$v_array)
563  {
564  for($i=0; $i<$a_value; $i++)
565  {
566  $var = $a_left.".".$i.".".$a_name;
567  if (isset($v_array[$var]))
568  {
569  $this->tpl->setCurrentBlock("set_value");
570  $this->tpl->setVariable("VAR", $var);
571  $this->tpl->setVariable("VALUE", $v_array[$var]);
572  $this->tpl->parseCurrentBlock();
573  }
574  }
575  }
576 
582  function infoScreen()
583  {
584  $this->ctrl->setCmd("showSummary");
585  $this->ctrl->setCmdClass("ilinfoscreengui");
586  $this->outputInfoScreen();
587  }
588 
592  function outputInfoScreen($a_standard_locator = false)
593  {
594  global $ilBench, $ilLocator, $ilAccess, $tpl;
595 
596  //$this->tpl->setHeaderPageTitle("PAGETITLE", " - ".$this->lm->getTitle());
597 
598  // set style sheets
599  /*
600  if (!$this->offlineMode())
601  {
602  $this->tpl->setStyleSheetLocation(ilUtil::getStyleSheetLocation());
603  }
604  else
605  {
606  $style_name = $this->ilias->account->prefs["style"].".css";;
607  $this->tpl->setStyleSheetLocation("./".$style_name);
608  }*/
609 
610  $this->tpl->getStandardTemplate();
611  $this->tpl->setTitle($this->slm_gui->object->getTitle());
612  $this->tpl->setTitleIcon(ilUtil::getImagePath("icon_slm_b.gif"));
613 
614  $ilLocator->addRepositoryItems();
615  $ilLocator->addItem($this->slm_gui->object->getTitle(),
616  $this->ctrl->getLinkTarget($this, "infoScreen"), "", $_GET["ref_id"]);
617 
618  $this->tpl->setLocator();
619 
620  $this->lng->loadLanguageModule("meta");
621 
622  include_once("./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
623 
624  $info = new ilInfoScreenGUI($this->slm_gui);
625  $info->enablePrivateNotes();
626  //$info->enableLearningProgress();
627 
628  $info->enableNews();
629  if ($ilAccess->checkAccess("write", "", $_GET["ref_id"]))
630  {
631  $info->enableNewsEditing();
632  $news_set = new ilSetting("news");
633  $enable_internal_rss = $news_set->get("enable_rss_for_internal");
634  if ($enable_internal_rss)
635  {
636  $info->setBlockProperty("news", "settings", true);
637  }
638  }
639 
640  // add read / back button
641  if ($ilAccess->checkAccess("read", "", $_GET["ref_id"]))
642  {
643  $info->addButton($this->lng->txt("view"),
644  $this->ctrl->getLinkTarget($this, ""),
645  ' target="ilContObj'.$this->slm_gui->object->getId().'" ');
646  }
647 
648  // show standard meta data section
649  $info->addMetaDataSections($this->slm_gui->object->getId(),0,
650  $this->slm_gui->object->getType());
651 
652  /*
653  if ($this->offlineMode())
654  {
655  $this->tpl->setContent($info->getHTML());
656  return $this->tpl->get();
657  }
658  else
659  {*/
660  // forward the command
661  $this->ctrl->forwardCommand($info);
662  //$this->tpl->setContent("aa");
663  $this->tpl->show();
664  //}
665  }
666 
667 
668 }
669 ?>