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