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