ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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 
27  function __construct()
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 "./Services/Object/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");
56  $this->offline_mode = ilObjSAHSLearningModuleAccess::_lookupUserIsOfflineMode($obj_id);
57 
59  {
60  $ilNavigationHistory->addItem($_GET["ref_id"],
61  "ilias.php?cmd=infoScreen&baseClass=ilSAHSPresentationGUI&ref_id=".$_GET["ref_id"], "lm");
62  }
63  }
64 
65  $next_class = $this->ctrl->getNextClass($this);
66  $cmd = $this->ctrl->getCmd();
67 
69 
70  if ($cmd == "downloadCertificate")
71  {
72  require_once "./Modules/ScormAicc/classes/SCORM/class.ilSCORMPresentationGUI.php";
73  $scorm_gui = new ilSCORMPresentationGUI();
74  $ret = $this->ctrl->forwardCommand($scorm_gui);
75  }
76 
77  if (substr($cmd,0,11) == "offlineMode" || $this->offline_mode) $next_class = "ilscormofflinemodegui";
78 
79  switch($type)
80  {
81 
82  case "scorm2004":
83  include_once("./Modules/ScormAicc/classes/class.ilObjSCORMLearningModuleGUI.php");
84  $this->slm_gui = new ilObjSCORMLearningModuleGUI("", $_GET["ref_id"],true,false);
85  break;
86 
87  case "scorm":
88  include_once("./Modules/ScormAicc/classes/class.ilObjSCORMLearningModuleGUI.php");
89  $this->slm_gui = new ilObjSCORMLearningModuleGUI("", $_GET["ref_id"],true,false);
90  break;
91 
92  case "aicc":
93  include_once("./Modules/ScormAicc/classes/class.ilObjAICCLearningModuleGUI.php");
94  $this->slm_gui = new ilObjAICCLearningModuleGUI("", $_GET["ref_id"],true,false);
95  break;
96 
97  case "hacp":
98  include_once("./Modules/ScormAicc/classes/class.ilObjHACPLearningModuleGUI.php");
99  $this->slm_gui = new ilObjHACPLearningModuleGUI("", $_GET["ref_id"],true,false);
100  break;
101  }
102 
103  if ($next_class != "ilinfoscreengui" &&
104  $cmd != "infoScreen" &&
105  $next_class != "ilobjscorm2004learningmodulegui" &&
106  $next_class != "ilobjscormlearningmodulegui" &&
107  $next_class != "ilscormofflinemodegui" &&
108  $next_class != "illearningprogressgui")
109  {
110  include_once("./Services/License/classes/class.ilLicense.php");
111  ilLicense::_noteAccess($obj_id, "sahs", $_GET["ref_id"]);
112  switch($type)
113  {
114  case "scorm2004":
115  $this->ctrl->setCmdClass("ilscorm13player");
116  $this->slm_gui = new ilObjSCORMLearningModuleGUI("", $_GET["ref_id"],true,false);
117  break;
118 
119  case "scorm":
120  $this->ctrl->setCmdClass("ilscormpresentationgui");
121  $this->slm_gui = new ilObjSCORMLearningModuleGUI("", $_GET["ref_id"],true,false);
122  break;
123 
124  case "aicc":
125  $this->ctrl->setCmdClass("ilaiccpresentationgui");
126  break;
127 
128  case "hacp":
129  $this->ctrl->setCmdClass("ilhacppresentationgui");
130  break;
131  }
132  $next_class = $this->ctrl->getNextClass($this);
133  }
134 
135  switch($next_class)
136  {
137  case "ilinfoscreengui":
138  $ret = $this->outputInfoScreen();
139  break;
140 
141  case "ilscorm13player":
142  require_once "./Modules/Scorm2004/classes/ilSCORM13Player.php";
143  $scorm_gui = new ilSCORM13Player();
144  $ret = $this->ctrl->forwardCommand($scorm_gui);
145  break;
146 
147  case "ilscormpresentationgui":
148  require_once "./Modules/ScormAicc/classes/SCORM/class.ilSCORMPresentationGUI.php";
149  $scorm_gui = new ilSCORMPresentationGUI();
150  $ret = $this->ctrl->forwardCommand($scorm_gui);
151  break;
152 
153  case "ilaiccpresentationgui":
154  require_once "./Modules/ScormAicc/classes/AICC/class.ilAICCPresentationGUI.php";
155  $aicc_gui = new ilAICCPresentationGUI();
156  $ret = $this->ctrl->forwardCommand($aicc_gui);
157  break;
158 
159  case "ilhacppresentationgui":
160  require_once "./Modules/ScormAicc/classes/HACP/class.ilHACPPresentationGUI.php";
161  $hacp_gui = new ilHACPPresentationGUI();
162  $ret = $this->ctrl->forwardCommand($hacp_gui);
163  break;
164 
165  case "illearningprogressgui":
166  $this->setInfoTabs("learning_progress");
167  include_once "./Services/Tracking/classes/class.ilLearningProgressGUI.php";
169  $this->ctrl->forwardCommand($new_gui);
170  $this->tpl->show();
171  break;
172 
173  case "ilscormofflinemodegui":
174  include_once "./Modules/ScormAicc/classes/class.ilSCORMOfflineModeGUI.php";
175  $new_gui = new ilSCORMOfflineModeGUI($type);
176  $this->ctrl->forwardCommand($new_gui);
177  break;
178 
179  case "ilobjscorm2004learningmodulegui":
180  include_once './Modules/Scorm2004/classes/class.ilObjSCORM2004LearningModuleGUI.php';
181  $new_gui = new ilObjSCORM2004LearningModuleGUI("", $_GET["ref_id"],true,false);
182  $this->ctrl->forwardCommand($new_gui);
183  $this->setInfoTabs("cont_tracking_data");
184  $this->tpl->show();
185  break;
186 
187  case "ilobjscormlearningmodulegui":
188  include_once './Modules/ScormAicc/classes/class.ilObjSCORMLearningModuleGUI.php';
189  $new_gui = new ilObjSCORMLearningModuleGUI("", $_GET["ref_id"],true,false);
190  $this->ctrl->forwardCommand($new_gui);
191  $this->setInfoTabs("cont_tracking_data");
192  $this->tpl->show();
193  break;
194 
195  default:
196  $this->$cmd();
197  }
198  }
199 
200  function attrib2arr(&$a_attributes)
201  {
202  $attr = array();
203 
204  if(!is_array($a_attributes))
205  {
206  return $attr;
207  }
208  foreach ($a_attributes as $attribute)
209  {
210  $attr[$attribute->name()] = $attribute->value();
211  }
212 
213 
214  return $attr;
215  }
216 
217 
221  function frameset()
222  {
223  $this->tpl = new ilTemplate("tpl.sahs_pres_frameset.html", false, false, "Modules/ScormAicc");
224  $this->tpl->setVariable("REF_ID",$this->slm->getRefId());
225  $this->tpl->show("DEFAULT", false);
226  exit;
227  }
228 
229 
233  function explorer($a_target = "sahs_content")
234  {
235  global $ilBench;
236 
237  $ilBench->start("SAHSExplorer", "initExplorer");
238 
239  $this->tpl = new ilTemplate("tpl.sahs_exp_main.html", true, true, "Modules/ScormAicc");
240 
241  require_once("./Modules/ScormAicc/classes/SCORM/class.ilSCORMExplorer.php");
242  $exp = new ilSCORMExplorer("ilias.php?baseClass=ilSAHSPresentationGUI&cmd=view&ref_id=".$this->slm->getRefId(), $this->slm);
243  $exp->setTargetGet("obj_id");
244  $exp->setFrameTarget($a_target);
245 
246  //$exp->setFiltered(true);
247 
248  if ($_GET["scexpand"] == "")
249  {
250  $mtree = new ilSCORMTree($this->slm->getId());
251  $expanded = $mtree->readRootId();
252  }
253  else
254  {
255  $expanded = $_GET["scexpand"];
256  }
257  $exp->setExpand($expanded);
258 
259  $exp->forceExpandAll(true, false);
260 
261  // build html-output
262  //666$exp->setOutput(0);
263  $ilBench->stop("SAHSExplorer", "initExplorer");
264 
265  // set output
266  $ilBench->start("SAHSExplorer", "setOutput");
267  $exp->setOutput(0);
268  $ilBench->stop("SAHSExplorer", "setOutput");
269 
270  $ilBench->start("SAHSExplorer", "getOutput");
271  $output = $exp->getOutput();
272  $ilBench->stop("SAHSExplorer", "getOutput");
273 
274  $this->tpl->setVariable("LOCATION_STYLESHEET", ilUtil::getStyleSheetLocation());
275  $this->tpl->addBlockFile("CONTENT", "content", "tpl.sahs_explorer.html", "Modules/ScormAicc");
276  //$this->tpl->setVariable("TXT_EXPLORER_HEADER", $this->lng->txt("cont_content"));
277  $this->tpl->setVariable("EXP_REFRESH", $this->lng->txt("refresh"));
278  $this->tpl->setVariable("EXPLORER",$output);
279  $this->tpl->setVariable("ACTION", "ilias.php?baseClass=ilSAHSPresentationGUI&cmd=".$_GET["cmd"]."&frame=".$_GET["frame"].
280  "&ref_id=".$this->slm->getRefId()."&scexpand=".$_GET["scexpand"]);
281  $this->tpl->parseCurrentBlock();
282  $this->tpl->show();
283  }
284 
285 
286  function view()
287  {
288  $sc_gui_object = ilSCORMObjectGUI::getInstance($_GET["obj_id"]);
289 
290  if(is_object($sc_gui_object))
291  {
292  $sc_gui_object->view();
293  }
294 
295  $this->tpl->setVariable("LOCATION_STYLESHEET", ilUtil::getStyleSheetLocation());
296  $this->tpl->show();
297  }
298 
299  function api()
300  {
301  global $ilias;
302 
303  $slm_obj = new ilObjSCORMLearningModule($_GET["ref_id"]);
304 
305  $this->tpl = new ilTemplate("tpl.sahs_api.html", true, true, "Modules/ScormAicc");
306  $this->tpl->setVariable("USER_ID",$ilias->account->getId());
307  $this->tpl->setVariable("USER_FIRSTNAME",$ilias->account->getFirstname());
308  $this->tpl->setVariable("USER_LASTNAME",$ilias->account->getLastname());
309  $this->tpl->setVariable("REF_ID",$_GET["ref_id"]);
310  $this->tpl->setVariable("SESSION_ID",session_id());
311 
312  $this->tpl->setVariable("CODE_BASE", "http://".$_SERVER['SERVER_NAME'].substr($_SERVER['PHP_SELF'], 0, strpos ($_SERVER['PHP_SELF'], "/ilias.php")));
313  $this->tpl->parseCurrentBlock();
314 
315  $this->tpl->show(false);
316  exit;
317  }
318 
319  function launchSahs()
320  {
321 
322  global $ilUser, $ilDB;
323 
324  $sco_id = ($_GET["sahs_id"] == "")
325  ? $_POST["sahs_id"]
326  : $_GET["sahs_id"];
327  $ref_id = ($_GET["ref_id"] == "")
328  ? $_POST["ref_id"]
329  : $_GET["ref_id"];
330 
331  $this->slm = new ilObjSCORMLearningModule($ref_id, true);
332 
333  include_once("./Modules/ScormAicc/classes/SCORM/class.ilSCORMItem.php");
334  include_once("./Modules/ScormAicc/classes/SCORM/class.ilSCORMResource.php");
335  $item = new ilSCORMItem($sco_id);
336 
337  $id_ref = $item->getIdentifierRef();
338  $resource = new ilSCORMResource();
339  $resource->readByIdRef($id_ref, $item->getSLMId());
340  //$slm_obj = new ilObjSCORMLearningModule($_GET["ref_id"]);
341  $href = $resource->getHref();
342  $this->tpl = new ilTemplate("tpl.sahs_launch_cbt.html", true, true, "Modules/ScormAicc");
343  $this->tpl->setVariable("HREF", $this->slm->getDataDirectory("output")."/".$href);
344 
345  // set item data
346  $this->tpl->setVariable("LAUNCH_DATA", $item->getDataFromLms());
347  $this->tpl->setVariable("MAST_SCORE", $item->getMasteryScore());
348  $this->tpl->setVariable("MAX_TIME", $item->getMaxTimeAllowed());
349  $this->tpl->setVariable("LIMIT_ACT", $item->getTimeLimitAction());
350 
351  // set alternative API name
352  if ($this->slm->getAPIAdapterName() != "API")
353  {
354  $this->tpl->setCurrentBlock("alt_api_ref");
355  $this->tpl->setVariable("API_NAME", $this->slm->getAPIAdapterName());
356  $this->tpl->parseCurrentBlock();
357  }
358 
359  $val_set = $ilDB->queryF('
360  SELECT * FROM scorm_tracking
361  WHERE user_id = %s
362  AND sco_id = %s
363  AND obj_id = %s',
364  array('integer','integer','integer'),
365  array($ilUser->getId(),$sco_id,$this->slm->getId()));
366 
367  $re_value = array();
368 
369  while($val_rec = $ilDB->fetchAssoc($val_set))
370  {
371  $val_rec["rvalue"] = str_replace("\r\n", "\n", $val_rec["rvalue"]);
372  $val_rec["rvalue"] = str_replace("\r", "\n", $val_rec["rvalue"]);
373  $val_rec["rvalue"] = str_replace("\n", "\\n", $val_rec["rvalue"]);
374  $re_value[$val_rec["lvalue"]] = $val_rec["rvalue"];
375  }
376 
377  foreach($re_value as $var => $value)
378  {
379  switch ($var)
380  {
381  case "cmi.core.lesson_location":
382  case "cmi.core.lesson_status":
383  case "cmi.core.entry":
384  case "cmi.core.score.raw":
385  case "cmi.core.score.max":
386  case "cmi.core.score.min":
387  case "cmi.core.total_time":
388  case "cmi.core.exit":
389  case "cmi.suspend_data":
390  case "cmi.comments":
391  case "cmi.student_preference.audio":
392  case "cmi.student_preference.language":
393  case "cmi.student_preference.speed":
394  case "cmi.student_preference.text":
395  $this->setSingleVariable($var, $value);
396  break;
397 
398  case "cmi.objectives._count":
399  $this->setSingleVariable($var, $value);
400  $this->setArray("cmi.objectives", $value, "id", $re_value);
401  $this->setArray("cmi.objectives", $value, "score.raw", $re_value);
402  $this->setArray("cmi.objectives", $value, "score.max", $re_value);
403  $this->setArray("cmi.objectives", $value, "score.min", $re_value);
404  $this->setArray("cmi.objectives", $value, "status", $re_value);
405  break;
406 
407  case "cmi.interactions._count":
408  $this->setSingleVariable($var, $value);
409  $this->setArray("cmi.interactions", $value, "id", $re_value);
410  for($i=0; $i<$value; $i++)
411  {
412  $var2 = "cmi.interactions.".$i.".objectives._count";
413  if (isset($v_array[$var2]))
414  {
415  $cnt = $v_array[$var2];
416  $this->setArray("cmi.interactions.".$i.".objectives",
417  $cnt, "id", $re_value);
418  /*
419  $this->setArray("cmi.interactions.".$i.".objectives",
420  $cnt, "score.raw", $re_value);
421  $this->setArray("cmi.interactions.".$i.".objectives",
422  $cnt, "score.max", $re_value);
423  $this->setArray("cmi.interactions.".$i.".objectives",
424  $cnt, "score.min", $re_value);
425  $this->setArray("cmi.interactions.".$i.".objectives",
426  $cnt, "status", $re_value);*/
427  }
428  }
429  $this->setArray("cmi.interactions", $value, "time", $re_value);
430  $this->setArray("cmi.interactions", $value, "type", $re_value);
431  for($i=0; $i<$value; $i++)
432  {
433  $var2 = "cmi.interactions.".$i.".correct_responses._count";
434  if (isset($v_array[$var2]))
435  {
436  $cnt = $v_array[$var2];
437  $this->setArray("cmi.interactions.".$i.".correct_responses",
438  $cnt, "pattern", $re_value);
439  $this->setArray("cmi.interactions.".$i.".correct_responses",
440  $cnt, "weighting", $re_value);
441  }
442  }
443  $this->setArray("cmi.interactions", $value, "student_response", $re_value);
444  $this->setArray("cmi.interactions", $value, "result", $re_value);
445  $this->setArray("cmi.interactions", $value, "latency", $re_value);
446  break;
447  }
448  }
449 
450  global $lng;
451  $this->tpl->setCurrentBlock("switch_icon");
452  $this->tpl->setVariable("SCO_ID", $_GET["sahs_id"]);
453  $this->tpl->setVariable("SCO_ICO", ilUtil::getImagePath("scorm/running.svg"));
454  $this->tpl->setVariable("SCO_ALT",
455  $lng->txt("cont_status").": "
456  .$lng->txt("cont_sc_stat_running")
457  );
458  $this->tpl->parseCurrentBlock();
459 
460  // lesson mode
461  $lesson_mode = $this->slm->getDefaultLessonMode();
462  if ($this->slm->getAutoReview())
463  {
464  if ($re_value["cmi.core.lesson_status"] == "completed" ||
465  $re_value["cmi.core.lesson_status"] == "passed" ||
466  $re_value["cmi.core.lesson_status"] == "failed")
467  {
468  $lesson_mode = "review";
469  }
470  }
471  $this->tpl->setVariable("LESSON_MODE", $lesson_mode);
472 
473  // credit mode
474  if ($lesson_mode == "normal")
475  {
476  $this->tpl->setVariable("CREDIT_MODE",
477  str_replace("_", "-", $this->slm->getCreditMode()));
478  }
479  else
480  {
481  $this->tpl->setVariable("CREDIT_MODE", "no-credit");
482  }
483 
484  // init cmi.core.total_time, cmi.core.lesson_status and cmi.core.entry
485  $sahs_obj_id = ilObject::_lookupObjId($_GET["ref_id"]);
486  if (!isset($re_value["cmi.core.total_time"]))
487  {
488  $item->insertTrackData("cmi.core.total_time", "0000:00:00", $sahs_obj_id);
489  }
490  if (!isset($re_value["cmi.core.lesson_status"]))
491  {
492  $item->insertTrackData("cmi.core.lesson_status", "not attempted", $sahs_obj_id);
493  }
494  if (!isset($re_value["cmi.core.entry"]))
495  {
496  $item->insertTrackData("cmi.core.entry", "", $sahs_obj_id);
497  }
498 
499  $this->tpl->show();
500  }
501 
502  function finishSahs ()
503  {
504  global $lng;
505  $this->tpl = new ilTemplate("tpl.sahs_finish_cbt.html", true, true, "Modules/ScormAicc");
506  $this->tpl->setVariable("LOCATION_STYLESHEET", ilUtil::getStyleSheetLocation());
507 
508  $this->tpl->setCurrentBlock("switch_icon");
509  $this->tpl->setVariable("SCO_ID", $_GET["sahs_id"]);
510  $this->tpl->setVariable("SCO_ICO", ilUtil::getImagePath(
511  "scorm/".str_replace(" ", "_", $_GET["status"]).'.svg')
512  );
513  $this->tpl->setVariable("SCO_ALT",
514  $lng->txt("cont_status").": "
515  .$lng->txt("cont_sc_stat_".str_replace(" ", "_", $_GET["status"])).", "
516  .$lng->txt("cont_total_time"). ": "
517  .$_GET["totime"]
518  );
519  $this->tpl->setVariable("SCO_LAUNCH_ID", $_GET["launch"]);
520  $this->tpl->parseCurrentBlock();
521  $this->tpl->show();
522  }
523 
524  function unloadSahs ()
525  {
526  $this->tpl = new ilTemplate("tpl.sahs_unload_cbt.html", true, true, "Modules/ScormAicc");
527  $this->tpl->setVariable("LOCATION_STYLESHEET", ilUtil::getStyleSheetLocation());
528  $this->tpl->setVariable("SCO_ID", $_GET["sahs_id"]);
529  $this->tpl->show();
530  }
531 
532 
533  function launchAsset()
534  {
535  global $ilUser, $ilDB;
536 
537  $sco_id = ($_GET["asset_id"] == "")
538  ? $_POST["asset_id"]
539  : $_GET["asset_id"];
540  $ref_id = ($_GET["ref_id"] == "")
541  ? $_POST["ref_id"]
542  : $_GET["ref_id"];
543 
544  $this->slm = new ilObjSCORMLearningModule($ref_id, true);
545 
546  include_once("./Modules/ScormAicc/classes/SCORM/class.ilSCORMItem.php");
547  include_once("./Modules/ScormAicc/classes/SCORM/class.ilSCORMResource.php");
548  $item = new ilSCORMItem($sco_id);
549 
550  $id_ref = $item->getIdentifierRef();
551  $resource = new ilSCORMResource();
552  $resource->readByIdRef($id_ref, $item->getSLMId());
553  $href = $resource->getHref();
554  $this->tpl->setVariable("HREF", $this->slm->getDataDirectory("output")."/".$href);
555  $this->tpl = new ilTemplate("tpl.scorm_launch_asset.html", true, true, "Modules/ScormAicc");
556  $this->tpl->setVariable("HREF", $this->slm->getDataDirectory("output")."/".$href);
557  $this->tpl->show();
558  }
559 
560 
564  function setSingleVariable($a_var, $a_value)
565  {
566  $this->tpl->setCurrentBlock("set_value");
567  $this->tpl->setVariable("VAR", $a_var);
568  $this->tpl->setVariable("VALUE", $a_value);
569  $this->tpl->parseCurrentBlock();
570  }
571 
575  function setArray($a_left, $a_value, $a_name, &$v_array)
576  {
577  for($i=0; $i<$a_value; $i++)
578  {
579  $var = $a_left.".".$i.".".$a_name;
580  if (isset($v_array[$var]))
581  {
582  $this->tpl->setCurrentBlock("set_value");
583  $this->tpl->setVariable("VAR", $var);
584  $this->tpl->setVariable("VALUE", $v_array[$var]);
585  $this->tpl->parseCurrentBlock();
586  }
587  }
588  }
589 
595  function infoScreen()
596  {
597  $this->ctrl->setCmd("showSummary");
598  $this->ctrl->setCmdClass("ilinfoscreengui");
599  $this->outputInfoScreen();
600  }
601 
602  function setInfoTabs($a_active)
603  {
604  global $ilTabs, $ilLocator, $ilAccess;
605  // $ilTabs->clearTargets();
606  // #9658 / #11753
607  include_once "Services/Tracking/classes/class.ilLearningProgressAccess.php";
609  ((!$ilAccess->checkAccess("edit_learning_progress", "", $_GET["ref_id"]) &&
610  !$ilAccess->checkAccess("read_learning_progress", "", $_GET["ref_id"])) ||
611  !$ilAccess->checkAccess("write", "", $_GET["ref_id"])))
612  {
613  $ilTabs->addTab("info_short", $this->lng->txt("info_short"),
614  $this->ctrl->getLinkTargetByClass("ilinfoscreengui", "showSummary"));
615 
616  $ilTabs->addTab("learning_progress", $this->lng->txt("learning_progress"),
617  $this->ctrl->getLinkTargetByClass('illearningprogressgui',''));
618  }
619  if($ilAccess->checkAccess("edit_learning_progress", "", $_GET["ref_id"]) || $ilAccess->checkAccess("read_learning_progress", "", $_GET["ref_id"]))
620  {
621  include_once('./Services/PrivacySecurity/classes/class.ilPrivacySettings.php');
622  $privacy = ilPrivacySettings::_getInstance();
623  if($privacy->enabledSahsProtocolData()) {
624  include_once "./Modules/ScormAicc/classes/class.ilObjSAHSLearningModule.php";
625  $obj_id = ilObject::_lookupObjectId($_GET['ref_id']);
627  if($type == "scorm2004") {
628  $ilTabs->addTab("cont_tracking_data", $this->lng->txt("cont_tracking_data"),
629  $this->ctrl->getLinkTargetByClass('ilobjscorm2004learningmodulegui','showTrackingItems'));
630  }
631  else if($type == "scorm") {
632  $ilTabs->addTab("cont_tracking_data", $this->lng->txt("cont_tracking_data"),
633  $this->ctrl->getLinkTargetByClass('ilobjscormlearningmodulegui','showTrackingItems'));
634  }
635  }
636  }
637  $ilTabs->activateTab($a_active);
638  $this->tpl->getStandardTemplate();
639  $this->tpl->setTitle($this->slm_gui->object->getTitle());
640  $this->tpl->setTitleIcon(ilUtil::getImagePath("icon_lm.svg"));
641  $ilLocator->addRepositoryItems();
642  $ilLocator->addItem($this->slm_gui->object->getTitle(),
643  $this->ctrl->getLinkTarget($this, "infoScreen"), "", $_GET["ref_id"]);
644  $this->tpl->setLocator();
645  }
646 
650  function outputInfoScreen()
651  {
652  global $ilAccess;
653 
654  //$this->tpl->setHeaderPageTitle("PAGETITLE", " - ".$this->lm->getTitle());
655 
656  // set style sheets
657  /*
658  if (!$this->offlineMode())
659  {
660  $this->tpl->setStyleSheetLocation(ilUtil::getStyleSheetLocation());
661  }
662  else
663  {
664  $style_name = $this->ilias->account->prefs["style"].".css";;
665  $this->tpl->setStyleSheetLocation("./".$style_name);
666  }*/
667 
668  $this->setInfoTabs("info_short");
669 
670  $this->lng->loadLanguageModule("meta");
671 
672  include_once("./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
673 
674  $info = new ilInfoScreenGUI($this->slm_gui);
675  $info->enablePrivateNotes();
676  //$info->enableLearningProgress();
677 
678  $info->enableNews();
679  if ($ilAccess->checkAccess("write", "", $_GET["ref_id"]))
680  {
681  $info->enableNewsEditing();
682  $news_set = new ilSetting("news");
683  $enable_internal_rss = $news_set->get("enable_rss_for_internal");
684  if ($enable_internal_rss)
685  {
686  $info->setBlockProperty("news", "settings", true);
687  }
688  }
689 
690  // add read / back button
691  if ($ilAccess->checkAccess("read", "", $_GET["ref_id"]))
692  {
693  include_once './Modules/ScormAicc/classes/class.ilObjSAHSLearningModule.php';
694  $sahs_obj = new ilObjSAHSLearningModule($_GET["ref_id"]);
695  $om = $sahs_obj->getOpenMode();
696  $width = $sahs_obj->getWidth();
697  $height = $sahs_obj->getHeight();
698  if ( ($om == 5 || $om == 1) && $width > 0 && $height > 0) $om++;
699  if ($om != 0)
700  {
701  $info->addButton($this->lng->txt("view"),
702  "javascript:void(0); onclick=startSAHS('".$this->ctrl->getLinkTarget($this, "")."','ilContObj".$this->slm_gui->object->getId()."',".$om.",".$width.",".$height.");",
703  '', 'top', true);
704  }
705  else
706  {
707  $info->addButton($this->lng->txt("view"),
708  $this->ctrl->getLinkTarget($this, ""),
709  ' target="ilContObj'.$this->slm_gui->object->getId().'" ',
710  'top', true);
711  }
712  }
713 
714  // show standard meta data section
715  $info->addMetaDataSections($this->slm_gui->object->getId(),0,
716  $this->slm_gui->object->getType());
717 
718  /*
719  if ($this->offlineMode())
720  {
721  $this->tpl->setContent($info->getHTML());
722  return $this->tpl->get();
723  }
724  else
725  {*/
726  // forward the command
727  $this->ctrl->forwardCommand($info);
728  //$this->tpl->setContent("aa");
729  $this->tpl->show();
730  //}
731  }
732 
733 }
734 ?>
ILIAS Setting Class.
Class ilObjSCORMLearningModuleGUI.
infoScreen()
this one is called from the info button in the repository not very nice to set cmdClass/Cmd manually...
if((!isset($_SERVER['DOCUMENT_ROOT'])) OR(empty($_SERVER['DOCUMENT_ROOT']))) $_SERVER['DOCUMENT_ROOT']
Class ilInfoScreenGUI.
setTargetGet($a_target_get)
set the varname in Get-string public
static getStyleSheetLocation($mode="output", $a_css_name="", $a_css_location="")
get full style sheet file name (path inclusive) of current user
$_GET["client_id"]
setSingleVariable($a_var, $a_value)
set single value
GUI class ilSCORMOfflineModeGUI.
$cmd
Definition: sahs_server.php:35
Class ilObjAICCLearningModuleGUI.
static _lookupUserIsOfflineMode($a_obj_id)
Checks offlineMode and returns false if.
static _lookupSubType($a_obj_id)
lookup subtype id (scorm, aicc, hacp)
Class ilObjHACPLearningModuleGUI.
static _lookupObjectId($a_ref_id)
lookup object id
global $ilCtrl
Definition: ilias.php:18
static checkAccess($a_ref_id, $a_allow_only_read=true)
check access to learning progress
if(!is_dir( $entity_dir)) exit("Fatal Error ([A-Za-z0-9]+)\+" &#(? foreach( $entity_files as $file) $output
$info
Definition: example_052.php:80
& getInstance($a_id)
get instance of specialized GUI class
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
static _lookupObjId($a_id)
special template class to simplify handling of ITX/PEAR
SCORM Item.
$ilUser
Definition: imgupload.php:18
redirection script todo: (a better solution should control the processing via a xml file) ...
static _lookupEditable($a_obj_id)
Lookup editable.
Explorer View for SCORM Learning Modules.
SCORM Object Tree.
Create styles array
The data for the language used.
Class ilSCORMPresentationGUI.
setArray($a_left, $a_value, $a_name, &$v_array)
set single value
$ref_id
Definition: sahs_server.php:39
global $ilBench
Definition: ilias.php:18
global $ilDB
$ret
Definition: parser.php:6
Class ilSAHSPresentationGUI.
static _getInstance()
Get instance of ilPrivacySettings.
Class ilObjUserTrackingGUI.
Class ilObjSCORMLearningModule.
$_POST["username"]
Class ilObjSCORMLearningModule.
explorer($a_target="sahs_content")
output table of content
static _noteAccess($a_obj_id, $a_type, $a_ref_id)
Note the access of the current usr to an object.
readRootId()
read root id from database
Class ilAICCPresentationGUI.