ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilSAHSPresentationGUI Class Reference

Class ilSAHSPresentationGUI. More...

+ Collaboration diagram for ilSAHSPresentationGUI:

Public Member Functions

 __construct ()
 
 executeCommand ()
 execute command More...
 
 attrib2arr (&$a_attributes)
 
 frameset ()
 output main menu More...
 
 explorer ($a_target="sahs_content")
 output table of content More...
 
 view ()
 
 api ()
 
 launchSahs ()
 
 finishSahs ()
 
 unloadSahs ()
 
 launchAsset ()
 
 setSingleVariable ($a_var, $a_value)
 set single value More...
 
 setArray ($a_left, $a_value, $a_name, &$v_array)
 set single value More...
 
 infoScreen ()
 this one is called from the info button in the repository not very nice to set cmdClass/Cmd manually, if everything works through ilCtrl in the future this may be changed More...
 
 setInfoTabs ($a_active)
 
 outputInfoScreen ()
 info screen More...
 

Data Fields

 $ilias
 
 $tpl
 
 $lng
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilSAHSPresentationGUI::__construct ( )

Definition at line 27 of file class.ilSAHSPresentationGUI.php.

References $DIC, $ilCtrl, $ilias, $lng, and $tpl.

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  }
global $DIC
Definition: saml.php:7
global $ilCtrl
Definition: ilias.php:18
redirection script todo: (a better solution should control the processing via a xml file) ...

Member Function Documentation

◆ api()

ilSAHSPresentationGUI::api ( )

Definition at line 261 of file class.ilSAHSPresentationGUI.php.

References $_GET, $_SERVER, $DIC, $ilias, and exit.

262  {
263  global $DIC;
264  $ilias = $DIC['ilias'];
265 
266  $slm_obj = new ilObjSCORMLearningModule($_GET["ref_id"]);
267 
268  $this->tpl = new ilTemplate("tpl.sahs_api.html", true, true, "Modules/ScormAicc");
269  $this->tpl->setVariable("USER_ID", $ilias->account->getId());
270  $this->tpl->setVariable("USER_FIRSTNAME", $ilias->account->getFirstname());
271  $this->tpl->setVariable("USER_LASTNAME", $ilias->account->getLastname());
272  $this->tpl->setVariable("REF_ID", $_GET["ref_id"]);
273  $this->tpl->setVariable("SESSION_ID", session_id());
274 
275  $this->tpl->setVariable("CODE_BASE", "http://" . $_SERVER['SERVER_NAME'] . substr($_SERVER['PHP_SELF'], 0, strpos($_SERVER['PHP_SELF'], "/ilias.php")));
276  $this->tpl->parseCurrentBlock();
277 
278  $this->tpl->show(false);
279  exit;
280  }
if((!isset($_SERVER['DOCUMENT_ROOT'])) OR(empty($_SERVER['DOCUMENT_ROOT']))) $_SERVER['DOCUMENT_ROOT']
global $DIC
Definition: saml.php:7
$_GET["client_id"]
special template class to simplify handling of ITX/PEAR
exit
Definition: backend.php:16
Class ilObjSCORMLearningModule.

◆ attrib2arr()

ilSAHSPresentationGUI::attrib2arr ( $a_attributes)

Definition at line 167 of file class.ilSAHSPresentationGUI.php.

168  {
169  $attr = array();
170 
171  if (!is_array($a_attributes)) {
172  return $attr;
173  }
174  foreach ($a_attributes as $attribute) {
175  $attr[$attribute->name()] = $attribute->value();
176  }
177 
178 
179  return $attr;
180  }

◆ executeCommand()

ilSAHSPresentationGUI::executeCommand ( )

execute command

Definition at line 46 of file class.ilSAHSPresentationGUI.php.

References $_GET, $DIC, $ilCtrl, $lng, $ret, $type, ilObjSAHSLearningModuleAccess\_lookupEditable(), ilObject\_lookupObjectId(), ilObjSAHSLearningModule\_lookupSubType(), ilObjSAHSLearningModuleAccess\_lookupUserIsOfflineMode(), ilLearningProgressBaseGUI\LP_CONTEXT_REPOSITORY, outputInfoScreen(), and setInfoTabs().

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("ilscorm13player");
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 "ilscorm13player":
120  require_once "./Modules/Scorm2004/classes/ilSCORM13Player.php";
121  $scorm_gui = new ilSCORM13Player();
122  $ret = $this->ctrl->forwardCommand($scorm_gui);
123  break;
124 
125  case "ilscormpresentationgui":
126  require_once "./Modules/ScormAicc/classes/SCORM/class.ilSCORMPresentationGUI.php";
127  $scorm_gui = new ilSCORMPresentationGUI();
128  $ret = $this->ctrl->forwardCommand($scorm_gui);
129  break;
130 
131 
132  case "illearningprogressgui":
133  $this->setInfoTabs("learning_progress");
134  include_once "./Services/Tracking/classes/class.ilLearningProgressGUI.php";
136  $this->ctrl->forwardCommand($new_gui);
137  $this->tpl->show();
138  break;
139 
140  case "ilscormofflinemodegui":
141  include_once "./Modules/ScormAicc/classes/class.ilSCORMOfflineModeGUI.php";
142  $new_gui = new ilSCORMOfflineModeGUI($type);
143  $this->ctrl->forwardCommand($new_gui);
144  break;
145 
146  case "ilobjscorm2004learningmodulegui":
147  include_once './Modules/Scorm2004/classes/class.ilObjSCORM2004LearningModuleGUI.php';
148  $new_gui = new ilObjSCORM2004LearningModuleGUI("", $_GET["ref_id"], true, false);
149  $this->ctrl->forwardCommand($new_gui);
150  $this->setInfoTabs("cont_tracking_data");
151  $this->tpl->show();
152  break;
153 
154  case "ilobjscormlearningmodulegui":
155  include_once './Modules/ScormAicc/classes/class.ilObjSCORMLearningModuleGUI.php';
156  $new_gui = new ilObjSCORMLearningModuleGUI("", $_GET["ref_id"], true, false);
157  $this->ctrl->forwardCommand($new_gui);
158  $this->setInfoTabs("cont_tracking_data");
159  $this->tpl->show();
160  break;
161 
162  default:
163  $this->$cmd();
164  }
165  }
Class ilObjSCORMLearningModuleGUI.
$type
global $DIC
Definition: saml.php:7
$_GET["client_id"]
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
global $ilCtrl
Definition: ilias.php:18
static _lookupEditable($a_obj_id)
Lookup editable.
Class ilSCORMPresentationGUI.
$ret
Definition: parser.php:6
Class ilObjUserTrackingGUI.
+ Here is the call graph for this function:

◆ explorer()

ilSAHSPresentationGUI::explorer (   $a_target = "sahs_content")

output table of content

Definition at line 198 of file class.ilSAHSPresentationGUI.php.

References $_GET, $DIC, $ilBench, Sabre\VObject\$output, ilUtil\getStyleSheetLocation(), ilTree\readRootId(), and ilExplorer\setTargetGet().

199  {
200  global $DIC;
201  $ilBench = $DIC['ilBench'];
202 
203  $ilBench->start("SAHSExplorer", "initExplorer");
204 
205  $this->tpl = new ilTemplate("tpl.sahs_exp_main.html", true, true, "Modules/ScormAicc");
206 
207  require_once("./Modules/ScormAicc/classes/SCORM/class.ilSCORMExplorer.php");
208  $exp = new ilSCORMExplorer("ilias.php?baseClass=ilSAHSPresentationGUI&cmd=view&ref_id=" . $this->slm->getRefId(), $this->slm);
209  $exp->setTargetGet("obj_id");
210  $exp->setFrameTarget($a_target);
211 
212  //$exp->setFiltered(true);
213 
214  if ($_GET["scexpand"] == "") {
215  $mtree = new ilSCORMTree($this->slm->getId());
216  $expanded = $mtree->readRootId();
217  } else {
218  $expanded = $_GET["scexpand"];
219  }
220  $exp->setExpand($expanded);
221 
222  $exp->forceExpandAll(true, false);
223 
224  // build html-output
225  //666$exp->setOutput(0);
226  $ilBench->stop("SAHSExplorer", "initExplorer");
227 
228  // set output
229  $ilBench->start("SAHSExplorer", "setOutput");
230  $exp->setOutput(0);
231  $ilBench->stop("SAHSExplorer", "setOutput");
232 
233  $ilBench->start("SAHSExplorer", "getOutput");
234  $output = $exp->getOutput();
235  $ilBench->stop("SAHSExplorer", "getOutput");
236 
237  $this->tpl->setVariable("LOCATION_STYLESHEET", ilUtil::getStyleSheetLocation());
238  $this->tpl->addBlockFile("CONTENT", "content", "tpl.sahs_explorer.html", "Modules/ScormAicc");
239  //$this->tpl->setVariable("TXT_EXPLORER_HEADER", $this->lng->txt("cont_content"));
240  $this->tpl->setVariable("EXP_REFRESH", $this->lng->txt("refresh"));
241  $this->tpl->setVariable("EXPLORER", $output);
242  $this->tpl->setVariable("ACTION", "ilias.php?baseClass=ilSAHSPresentationGUI&cmd=" . $_GET["cmd"] . "&frame=" . $_GET["frame"] .
243  "&ref_id=" . $this->slm->getRefId() . "&scexpand=" . $_GET["scexpand"]);
244  $this->tpl->parseCurrentBlock();
245  $this->tpl->show();
246  }
setTargetGet($a_target_get)
set the varname in Get-string public
global $DIC
Definition: saml.php:7
static getStyleSheetLocation($mode="output", $a_css_name="", $a_css_location="")
get full style sheet file name (path inclusive) of current user
$_GET["client_id"]
special template class to simplify handling of ITX/PEAR
Explorer View for SCORM Learning Modules.
SCORM Object Tree.
global $ilBench
Definition: ilias.php:18
readRootId()
read root id from database
+ Here is the call graph for this function:

◆ finishSahs()

ilSAHSPresentationGUI::finishSahs ( )

Definition at line 468 of file class.ilSAHSPresentationGUI.php.

References $_GET, $DIC, $lng, ilUtil\getImagePath(), and ilUtil\getStyleSheetLocation().

469  {
470  global $DIC;
471  $lng = $DIC['lng'];
472  $this->tpl = new ilTemplate("tpl.sahs_finish_cbt.html", true, true, "Modules/ScormAicc");
473  $this->tpl->setVariable("LOCATION_STYLESHEET", ilUtil::getStyleSheetLocation());
474 
475  $this->tpl->setCurrentBlock("switch_icon");
476  $this->tpl->setVariable("SCO_ID", $_GET["sahs_id"]);
477  $this->tpl->setVariable(
478  "SCO_ICO",
480  "scorm/" . str_replace(" ", "_", $_GET["status"]) . '.svg'
481  )
482  );
483  $this->tpl->setVariable(
484  "SCO_ALT",
485  $lng->txt("cont_status") . ": "
486  . $lng->txt("cont_sc_stat_" . str_replace(" ", "_", $_GET["status"])) . ", "
487  . $lng->txt("cont_total_time") . ": "
488  . $_GET["totime"]
489  );
490  $this->tpl->setVariable("SCO_LAUNCH_ID", $_GET["launch"]);
491  $this->tpl->parseCurrentBlock();
492  $this->tpl->show();
493  }
global $DIC
Definition: saml.php:7
static getStyleSheetLocation($mode="output", $a_css_name="", $a_css_location="")
get full style sheet file name (path inclusive) of current user
$_GET["client_id"]
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
special template class to simplify handling of ITX/PEAR
+ Here is the call graph for this function:

◆ frameset()

ilSAHSPresentationGUI::frameset ( )

output main menu

Definition at line 186 of file class.ilSAHSPresentationGUI.php.

References exit.

187  {
188  $this->tpl = new ilTemplate("tpl.sahs_pres_frameset.html", false, false, "Modules/ScormAicc");
189  $this->tpl->setVariable("REF_ID", $this->slm->getRefId());
190  $this->tpl->show("DEFAULT", false);
191  exit;
192  }
special template class to simplify handling of ITX/PEAR
exit
Definition: backend.php:16

◆ infoScreen()

ilSAHSPresentationGUI::infoScreen ( )

this one is called from the info button in the repository not very nice to set cmdClass/Cmd manually, if everything works through ilCtrl in the future this may be changed

Definition at line 566 of file class.ilSAHSPresentationGUI.php.

References outputInfoScreen().

567  {
568  $this->ctrl->setCmd("showSummary");
569  $this->ctrl->setCmdClass("ilinfoscreengui");
570  $this->outputInfoScreen();
571  }
+ Here is the call graph for this function:

◆ launchAsset()

ilSAHSPresentationGUI::launchAsset ( )

Definition at line 504 of file class.ilSAHSPresentationGUI.php.

References $_GET, $_POST, $DIC, $ilDB, and $ilUser.

505  {
506  global $DIC;
507  $ilUser = $DIC['ilUser'];
508  $ilDB = $DIC['ilDB'];
509 
510  $sco_id = ($_GET["asset_id"] == "")
511  ? $_POST["asset_id"]
512  : $_GET["asset_id"];
513  $ref_id = ($_GET["ref_id"] == "")
514  ? $_POST["ref_id"]
515  : $_GET["ref_id"];
516 
517  $this->slm = new ilObjSCORMLearningModule($ref_id, true);
518 
519  include_once("./Modules/ScormAicc/classes/SCORM/class.ilSCORMItem.php");
520  include_once("./Modules/ScormAicc/classes/SCORM/class.ilSCORMResource.php");
521  $item = new ilSCORMItem($sco_id);
522 
523  $id_ref = $item->getIdentifierRef();
524  $resource = new ilSCORMResource();
525  $resource->readByIdRef($id_ref, $item->getSLMId());
526  $href = $resource->getHref();
527  $this->tpl->setVariable("HREF", $this->slm->getDataDirectory("output") . "/" . $href);
528  $this->tpl = new ilTemplate("tpl.scorm_launch_asset.html", true, true, "Modules/ScormAicc");
529  $this->tpl->setVariable("HREF", $this->slm->getDataDirectory("output") . "/" . $href);
530  $this->tpl->show();
531  }
global $DIC
Definition: saml.php:7
$_GET["client_id"]
special template class to simplify handling of ITX/PEAR
SCORM Item.
$ilUser
Definition: imgupload.php:18
global $ilDB
Class ilObjSCORMLearningModule.
$_POST["username"]

◆ launchSahs()

ilSAHSPresentationGUI::launchSahs ( )

Definition at line 282 of file class.ilSAHSPresentationGUI.php.

References $_GET, $_POST, $DIC, $i, $ilDB, $ilUser, $lng, ilObject\_lookupObjId(), ilUtil\getImagePath(), setArray(), and setSingleVariable().

283  {
284  global $DIC;
285  $ilUser = $DIC['ilUser'];
286  $ilDB = $DIC['ilDB'];
287 
288  $sco_id = ($_GET["sahs_id"] == "")
289  ? $_POST["sahs_id"]
290  : $_GET["sahs_id"];
291  $ref_id = ($_GET["ref_id"] == "")
292  ? $_POST["ref_id"]
293  : $_GET["ref_id"];
294 
295  $this->slm = new ilObjSCORMLearningModule($ref_id, true);
296 
297  include_once("./Modules/ScormAicc/classes/SCORM/class.ilSCORMItem.php");
298  include_once("./Modules/ScormAicc/classes/SCORM/class.ilSCORMResource.php");
299  $item = new ilSCORMItem($sco_id);
300 
301  $id_ref = $item->getIdentifierRef();
302  $resource = new ilSCORMResource();
303  $resource->readByIdRef($id_ref, $item->getSLMId());
304  //$slm_obj = new ilObjSCORMLearningModule($_GET["ref_id"]);
305  $href = $resource->getHref();
306  $this->tpl = new ilTemplate("tpl.sahs_launch_cbt.html", true, true, "Modules/ScormAicc");
307  $this->tpl->setVariable("HREF", $this->slm->getDataDirectory("output") . "/" . $href);
308 
309  // set item data
310  $this->tpl->setVariable("LAUNCH_DATA", $item->getDataFromLms());
311  $this->tpl->setVariable("MAST_SCORE", $item->getMasteryScore());
312  $this->tpl->setVariable("MAX_TIME", $item->getMaxTimeAllowed());
313  $this->tpl->setVariable("LIMIT_ACT", $item->getTimeLimitAction());
314 
315  // set alternative API name
316  if ($this->slm->getAPIAdapterName() != "API") {
317  $this->tpl->setCurrentBlock("alt_api_ref");
318  $this->tpl->setVariable("API_NAME", $this->slm->getAPIAdapterName());
319  $this->tpl->parseCurrentBlock();
320  }
321 
322  $val_set = $ilDB->queryF(
323  '
324  SELECT * FROM scorm_tracking
325  WHERE user_id = %s
326  AND sco_id = %s
327  AND obj_id = %s',
328  array('integer','integer','integer'),
329  array($ilUser->getId(),$sco_id,$this->slm->getId())
330  );
331 
332  $re_value = array();
333 
334  while ($val_rec = $ilDB->fetchAssoc($val_set)) {
335  $val_rec["rvalue"] = str_replace("\r\n", "\n", $val_rec["rvalue"]);
336  $val_rec["rvalue"] = str_replace("\r", "\n", $val_rec["rvalue"]);
337  $val_rec["rvalue"] = str_replace("\n", "\\n", $val_rec["rvalue"]);
338  $re_value[$val_rec["lvalue"]] = $val_rec["rvalue"];
339  }
340 
341  foreach ($re_value as $var => $value) {
342  switch ($var) {
343  case "cmi.core.lesson_location":
344  case "cmi.core.lesson_status":
345  case "cmi.core.entry":
346  case "cmi.core.score.raw":
347  case "cmi.core.score.max":
348  case "cmi.core.score.min":
349  case "cmi.core.total_time":
350  case "cmi.core.exit":
351  case "cmi.suspend_data":
352  case "cmi.comments":
353  case "cmi.student_preference.audio":
354  case "cmi.student_preference.language":
355  case "cmi.student_preference.speed":
356  case "cmi.student_preference.text":
357  $this->setSingleVariable($var, $value);
358  break;
359 
360  case "cmi.objectives._count":
361  $this->setSingleVariable($var, $value);
362  $this->setArray("cmi.objectives", $value, "id", $re_value);
363  $this->setArray("cmi.objectives", $value, "score.raw", $re_value);
364  $this->setArray("cmi.objectives", $value, "score.max", $re_value);
365  $this->setArray("cmi.objectives", $value, "score.min", $re_value);
366  $this->setArray("cmi.objectives", $value, "status", $re_value);
367  break;
368 
369  case "cmi.interactions._count":
370  $this->setSingleVariable($var, $value);
371  $this->setArray("cmi.interactions", $value, "id", $re_value);
372  for ($i = 0; $i < $value; $i++) {
373  $var2 = "cmi.interactions." . $i . ".objectives._count";
374  if (isset($v_array[$var2])) {
375  $cnt = $v_array[$var2];
376  $this->setArray(
377  "cmi.interactions." . $i . ".objectives",
378  $cnt,
379  "id",
380  $re_value
381  );
382  /*
383  $this->setArray("cmi.interactions.".$i.".objectives",
384  $cnt, "score.raw", $re_value);
385  $this->setArray("cmi.interactions.".$i.".objectives",
386  $cnt, "score.max", $re_value);
387  $this->setArray("cmi.interactions.".$i.".objectives",
388  $cnt, "score.min", $re_value);
389  $this->setArray("cmi.interactions.".$i.".objectives",
390  $cnt, "status", $re_value);*/
391  }
392  }
393  $this->setArray("cmi.interactions", $value, "time", $re_value);
394  $this->setArray("cmi.interactions", $value, "type", $re_value);
395  for ($i = 0; $i < $value; $i++) {
396  $var2 = "cmi.interactions." . $i . ".correct_responses._count";
397  if (isset($v_array[$var2])) {
398  $cnt = $v_array[$var2];
399  $this->setArray(
400  "cmi.interactions." . $i . ".correct_responses",
401  $cnt,
402  "pattern",
403  $re_value
404  );
405  $this->setArray(
406  "cmi.interactions." . $i . ".correct_responses",
407  $cnt,
408  "weighting",
409  $re_value
410  );
411  }
412  }
413  $this->setArray("cmi.interactions", $value, "student_response", $re_value);
414  $this->setArray("cmi.interactions", $value, "result", $re_value);
415  $this->setArray("cmi.interactions", $value, "latency", $re_value);
416  break;
417  }
418  }
419 
420  global $DIC;
421  $lng = $DIC['lng'];
422  $this->tpl->setCurrentBlock("switch_icon");
423  $this->tpl->setVariable("SCO_ID", $_GET["sahs_id"]);
424  $this->tpl->setVariable("SCO_ICO", ilUtil::getImagePath("scorm/running.svg"));
425  $this->tpl->setVariable(
426  "SCO_ALT",
427  $lng->txt("cont_status") . ": "
428  . $lng->txt("cont_sc_stat_running")
429  );
430  $this->tpl->parseCurrentBlock();
431 
432  // lesson mode
433  $lesson_mode = $this->slm->getDefaultLessonMode();
434  if ($this->slm->getAutoReview()) {
435  if ($re_value["cmi.core.lesson_status"] == "completed" ||
436  $re_value["cmi.core.lesson_status"] == "passed" ||
437  $re_value["cmi.core.lesson_status"] == "failed") {
438  $lesson_mode = "review";
439  }
440  }
441  $this->tpl->setVariable("LESSON_MODE", $lesson_mode);
442 
443  // credit mode
444  if ($lesson_mode == "normal") {
445  $this->tpl->setVariable(
446  "CREDIT_MODE",
447  str_replace("_", "-", $this->slm->getCreditMode())
448  );
449  } else {
450  $this->tpl->setVariable("CREDIT_MODE", "no-credit");
451  }
452 
453  // init cmi.core.total_time, cmi.core.lesson_status and cmi.core.entry
454  $sahs_obj_id = ilObject::_lookupObjId($_GET["ref_id"]);
455  if (!isset($re_value["cmi.core.total_time"])) {
456  $item->insertTrackData("cmi.core.total_time", "0000:00:00", $sahs_obj_id);
457  }
458  if (!isset($re_value["cmi.core.lesson_status"])) {
459  $item->insertTrackData("cmi.core.lesson_status", "not attempted", $sahs_obj_id);
460  }
461  if (!isset($re_value["cmi.core.entry"])) {
462  $item->insertTrackData("cmi.core.entry", "", $sahs_obj_id);
463  }
464 
465  $this->tpl->show();
466  }
global $DIC
Definition: saml.php:7
$_GET["client_id"]
setSingleVariable($a_var, $a_value)
set single value
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
setArray($a_left, $a_value, $a_name, &$v_array)
set single value
global $ilDB
$i
Definition: disco.tpl.php:19
Class ilObjSCORMLearningModule.
$_POST["username"]
+ Here is the call graph for this function:

◆ outputInfoScreen()

ilSAHSPresentationGUI::outputInfoScreen ( )

info screen

Definition at line 639 of file class.ilSAHSPresentationGUI.php.

References $_GET, $DIC, $GLOBALS, $info, and setInfoTabs().

Referenced by executeCommand(), and infoScreen().

640  {
641  global $DIC;
642  $ilAccess = $DIC['ilAccess'];
643 
644  //$this->tpl->setHeaderPageTitle("PAGETITLE", " - ".$this->lm->getTitle());
645 
646  // set style sheets
647  /*
648  if (!$this->offlineMode())
649  {
650  $this->tpl->setStyleSheetLocation(ilUtil::getStyleSheetLocation());
651  }
652  else
653  {
654  $style_name = $this->ilias->account->prefs["style"].".css";;
655  $this->tpl->setStyleSheetLocation("./".$style_name);
656  }*/
657 
658  $this->setInfoTabs("info_short");
659 
660  $this->lng->loadLanguageModule("meta");
661 
662  include_once("./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
663 
664  $info = new ilInfoScreenGUI($this->slm_gui);
665  $info->enablePrivateNotes();
666  //$info->enableLearningProgress();
667 
668  $info->enableNews();
669  if ($ilAccess->checkAccess("write", "", $_GET["ref_id"])) {
670  $info->enableNewsEditing();
671  $news_set = new ilSetting("news");
672  $enable_internal_rss = $news_set->get("enable_rss_for_internal");
673  if ($enable_internal_rss) {
674  $info->setBlockProperty("news", "settings", true);
675  }
676  }
677 
678  // add read / back button
679  if ($ilAccess->checkAccess("read", "", $_GET["ref_id"])) {
680  $ilToolbar = $GLOBALS['DIC']->toolbar();
681  $ilToolbar->addButtonInstance($this->slm_gui->object->getViewButton());
682  }
683 
684  // show standard meta data section
685  $info->addMetaDataSections(
686  $this->slm_gui->object->getId(),
687  0,
688  $this->slm_gui->object->getType()
689  );
690 
691  /*
692  if ($this->offlineMode())
693  {
694  $this->tpl->setContent($info->getHTML());
695  return $this->tpl->get();
696  }
697  else
698  {*/
699  // forward the command
700  $this->ctrl->forwardCommand($info);
701  $this->tpl->show();
702  //}
703  }
Class ilInfoScreenGUI.
global $DIC
Definition: saml.php:7
$_GET["client_id"]
$info
Definition: index.php:5
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setArray()

ilSAHSPresentationGUI::setArray (   $a_left,
  $a_value,
  $a_name,
$v_array 
)

set single value

Definition at line 548 of file class.ilSAHSPresentationGUI.php.

References $i.

Referenced by launchSahs().

549  {
550  for ($i = 0; $i < $a_value; $i++) {
551  $var = $a_left . "." . $i . "." . $a_name;
552  if (isset($v_array[$var])) {
553  $this->tpl->setCurrentBlock("set_value");
554  $this->tpl->setVariable("VAR", $var);
555  $this->tpl->setVariable("VALUE", $v_array[$var]);
556  $this->tpl->parseCurrentBlock();
557  }
558  }
559  }
$i
Definition: disco.tpl.php:19
+ Here is the caller graph for this function:

◆ setInfoTabs()

ilSAHSPresentationGUI::setInfoTabs (   $a_active)

Definition at line 573 of file class.ilSAHSPresentationGUI.php.

References $_GET, $DIC, $type, ilPrivacySettings\_getInstance(), ilObject\_lookupObjectId(), ilObjSAHSLearningModule\_lookupSubType(), ilLearningProgressAccess\checkAccess(), and ilUtil\getImagePath().

Referenced by executeCommand(), and outputInfoScreen().

574  {
575  global $DIC;
576 
577  if (
578  !$DIC->access()->checkAccess('visible', '', (int) $_GET["ref_id"]) &&
579  !$DIC->access()->checkAccess('read', '', (int) $_GET["ref_id"])
580  ) {
581  $DIC['ilErr']->raiseError($this->lng->txt('msg_no_perm_read'), $DIC['ilErr']->MESSAGE);
582  }
583 
584  // $ilTabs->clearTargets();
585  // #9658 / #11753
586  include_once "Services/Tracking/classes/class.ilLearningProgressAccess.php";
587  if (ilLearningProgressAccess::checkAccess($_GET["ref_id"])) {
588  $DIC->tabs()->addTab(
589  "info_short",
590  $this->lng->txt("info_short"),
591  $this->ctrl->getLinkTargetByClass("ilinfoscreengui", "showSummary")
592  );
593 
594  $DIC->tabs()->addTab(
595  "learning_progress",
596  $this->lng->txt("learning_progress"),
597  $this->ctrl->getLinkTargetByClass('illearningprogressgui', '')
598  );
599  }
600  if ($DIC->access()->checkAccess("edit_learning_progress", "", $_GET["ref_id"]) || $DIC->access()->checkAccess("read_learning_progress", "", $_GET["ref_id"])) {
601  include_once('./Services/PrivacySecurity/classes/class.ilPrivacySettings.php');
602  $privacy = ilPrivacySettings::_getInstance();
603  if ($privacy->enabledSahsProtocolData()) {
604  include_once "./Modules/ScormAicc/classes/class.ilObjSAHSLearningModule.php";
605  $obj_id = ilObject::_lookupObjectId($_GET['ref_id']);
607  if ($type == "scorm2004") {
608  $DIC->tabs()->addTab(
609  "cont_tracking_data",
610  $this->lng->txt("cont_tracking_data"),
611  $this->ctrl->getLinkTargetByClass('ilobjscorm2004learningmodulegui', 'showTrackingItems')
612  );
613  } elseif ($type == "scorm") {
614  $DIC->tabs()->addTab(
615  "cont_tracking_data",
616  $this->lng->txt("cont_tracking_data"),
617  $this->ctrl->getLinkTargetByClass('ilobjscormlearningmodulegui', 'showTrackingItems')
618  );
619  }
620  }
621  }
622  $DIC->tabs()->activateTab($a_active);
623  $this->tpl->getStandardTemplate();
624  $this->tpl->setTitle($this->slm_gui->object->getTitle());
625  $this->tpl->setTitleIcon(ilUtil::getImagePath("icon_lm.svg"));
626  $DIC['ilLocator']->addRepositoryItems();
627  $DIC['ilLocator']->addItem(
628  $this->slm_gui->object->getTitle(),
629  $this->ctrl->getLinkTarget($this, "infoScreen"),
630  "",
631  $_GET["ref_id"]
632  );
633  $this->tpl->setLocator();
634  }
$type
global $DIC
Definition: saml.php:7
$_GET["client_id"]
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
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
static _getInstance()
Get instance of ilPrivacySettings.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setSingleVariable()

ilSAHSPresentationGUI::setSingleVariable (   $a_var,
  $a_value 
)

set single value

Definition at line 537 of file class.ilSAHSPresentationGUI.php.

Referenced by launchSahs().

538  {
539  $this->tpl->setCurrentBlock("set_value");
540  $this->tpl->setVariable("VAR", $a_var);
541  $this->tpl->setVariable("VALUE", $a_value);
542  $this->tpl->parseCurrentBlock();
543  }
+ Here is the caller graph for this function:

◆ unloadSahs()

ilSAHSPresentationGUI::unloadSahs ( )

Definition at line 495 of file class.ilSAHSPresentationGUI.php.

References $_GET, and ilUtil\getStyleSheetLocation().

496  {
497  $this->tpl = new ilTemplate("tpl.sahs_unload_cbt.html", true, true, "Modules/ScormAicc");
498  $this->tpl->setVariable("LOCATION_STYLESHEET", ilUtil::getStyleSheetLocation());
499  $this->tpl->setVariable("SCO_ID", $_GET["sahs_id"]);
500  $this->tpl->show();
501  }
static getStyleSheetLocation($mode="output", $a_css_name="", $a_css_location="")
get full style sheet file name (path inclusive) of current user
$_GET["client_id"]
special template class to simplify handling of ITX/PEAR
+ Here is the call graph for this function:

◆ view()

ilSAHSPresentationGUI::view ( )

Definition at line 249 of file class.ilSAHSPresentationGUI.php.

References $_GET, ilSCORMObjectGUI\getInstance(), and ilUtil\getStyleSheetLocation().

250  {
251  $sc_gui_object = ilSCORMObjectGUI::getInstance($_GET["obj_id"]);
252 
253  if (is_object($sc_gui_object)) {
254  $sc_gui_object->view();
255  }
256 
257  $this->tpl->setVariable("LOCATION_STYLESHEET", ilUtil::getStyleSheetLocation());
258  $this->tpl->show();
259  }
static getStyleSheetLocation($mode="output", $a_css_name="", $a_css_location="")
get full style sheet file name (path inclusive) of current user
$_GET["client_id"]
& getInstance($a_id)
get instance of specialized GUI class
+ Here is the call graph for this function:

Field Documentation

◆ $ilias

ilSAHSPresentationGUI::$ilias

Definition at line 23 of file class.ilSAHSPresentationGUI.php.

Referenced by __construct(), and api().

◆ $lng

ilSAHSPresentationGUI::$lng

◆ $tpl

ilSAHSPresentationGUI::$tpl

Definition at line 24 of file class.ilSAHSPresentationGUI.php.

Referenced by __construct().


The documentation for this class was generated from the following file: