ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilSCORMItemGUI.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
29{
30 public function __construct(int $a_id)
31 {
33 $this->sc_object = new ilSCORMItem($a_id);
34 }
35
36 public function view(): void
37 {
38 global $DIC;
39 $usr = $DIC->user();
40
41 // get ressource identifier
42 $id_ref = $this->sc_object->getIdentifierRef();
43 if ($id_ref != "") {
44 $resource = new ilSCORMResource();
45 $resource->readByIdRef($id_ref, $this->sc_object->getSLMId());
46
47 $refId = $DIC->http()->wrapper()->query()->retrieve('ref_id', $DIC->refinery()->kindlyTo()->int());
48 $objId = $DIC->http()->wrapper()->query()->retrieve('obj_id', $DIC->refinery()->kindlyTo()->int());
49
50 $slm_obj = new ilObjSCORMLearningModule($refId);
51
52 if ($resource->getHref() != "") {
53 $param_str = ($this->sc_object->getParameters() != "")
54 ? "?" . $this->sc_object->getParameters()
55 : "";
56
57 $this->tpl = new ilGlobalTemplate("tpl.scorm_content_frameset.html", true, true, "components/ILIAS/ScormAicc");
58 $this->tpl->setVariable("ITEM_LOCATION", $slm_obj->getDataDirectory() . "/" . $resource->getHref() . $param_str);
59 $this->tpl->setVariable("ITEM_ID", $objId);
60 $this->tpl->setVariable("REF_ID", $refId);
61 $this->tpl->setVariable("USER_ID", $usr->getId());
62 $this->tpl->setVariable("ADAPTER_NAME", $slm_obj->getAPIAdapterName());
63 $this->tpl->printToStdout();
64 exit;
65 }
66 }
67
68 // this point is only reached if now resource could be displayed above!
69 $this->tpl->addBlockFile("CONTENT", "content", "tpl.scorm_obj.html", "components/ILIAS/ScormAicc");
70 $this->tpl->setCurrentBlock("par_table");
71 $this->tpl->setVariable("TXT_OBJECT_TYPE", $this->lng->txt("cont_item"));
72 $this->displayParameter(
73 $this->lng->txt("cont_import_id"),
74 $this->sc_object->getImportId()
75 );
76 $this->displayParameter(
77 $this->lng->txt("cont_id_ref"),
78 $this->sc_object->getIdentifierRef()
79 );
80 $str_visible = ($this->sc_object->getVisible())
81 ? "true"
82 : "false";
83 $this->displayParameter(
84 $this->lng->txt("cont_is_visible"),
85 $str_visible
86 );
87 $this->displayParameter(
88 $this->lng->txt("cont_parameters"),
89 $this->sc_object->getParameters()
90 );
91 $this->displayParameter(
92 $this->lng->txt("cont_sc_title"),
93 $this->sc_object->getTitle()
94 );
95 $this->displayParameter(
96 $this->lng->txt("cont_prereq_type"),
97 $this->sc_object->getPrereqType()
98 );
99 $this->displayParameter(
100 $this->lng->txt("cont_prerequisites"),
101 $this->sc_object->getPrerequisites()
102 );
103 $this->displayParameter(
104 $this->lng->txt("cont_max_time_allowed"),
105 $this->sc_object->getMaxTimeAllowed()
106 );
107 $this->displayParameter(
108 $this->lng->txt("cont_time_limit_action"),
109 $this->sc_object->getTimeLimitAction()
110 );
111 $this->displayParameter(
112 $this->lng->txt("cont_data_from_lms"),
113 $this->sc_object->getDataFromLms()
114 );
115 $this->displayParameter(
116 $this->lng->txt("cont_mastery_score"),
117 $this->sc_object->getMasteryScore()
118 );
119 $this->tpl->parseCurrentBlock();
120 }
121}
special template class to simplify handling of ITX/PEAR
Class ilObjSCORMLearningModule.
GUI class for SCORM Items.
Parent object for SCORM GUI objects.
displayParameter(string $a_name, string $a_value)
exit
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
global $DIC
Definition: shib_login.php:26
$objId
Definition: xapitoken.php:57
$refId
Definition: xapitoken.php:58