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