ILIAS  trunk Revision v11.0_alpha-2662-g519ff7d528f
ilSAHSPresentationGUI Class Reference

Class ilSAHSPresentationGUI. More...

+ Inheritance diagram for ilSAHSPresentationGUI:
+ Collaboration diagram for ilSAHSPresentationGUI:

Public Member Functions

 __construct ()
 
 executeCommand ()
 
 view ()
 
 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 (string $a_active)
 
 outputInfoScreen ()
 info screen More...
 

Protected Attributes

ilGlobalPageTemplate $tpl
 
ilLanguage $lng
 
ilCtrl $ctrl
 
ilObjSCORMLearningModuleGUI $slm_gui
 
int $refId
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilSAHSPresentationGUI::__construct ( )
Exceptions
ilCtrlException

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

References $DIC, ILIAS\Repository\ctrl(), and ILIAS\Repository\lng().

48  {
49  global $DIC;
50  $this->tpl = $DIC['tpl'];
51  $this->lng = $DIC->language();
52  $this->ctrl = $DIC->ctrl();
53  $this->ctrl->saveParameter($this, "ref_id");
54  $this->refId = $DIC->http()->wrapper()->query()->retrieve('ref_id', $DIC->refinery()->kindlyTo()->int());
55  }
global $DIC
Definition: shib_login.php:26
+ Here is the call graph for this function:

Member Function Documentation

◆ executeCommand()

ilSAHSPresentationGUI::executeCommand ( )
Exceptions
ilCtrlException

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

References $DIC, ilObject\_lookupObjectId(), ilObjSAHSLearningModule\_lookupSubType(), ILIAS\Repository\ctrl(), ilLanguage\loadLanguageModule(), ilLearningProgressBaseGUI\LP_CONTEXT_REPOSITORY, outputInfoScreen(), and setInfoTabs().

60  : void
61  {
62  global $DIC;
63  $lng = $DIC->language();
64  $ilAccess = $DIC->access();
65  $ilNavigationHistory = $DIC['ilNavigationHistory'];
66  $ilCtrl = $DIC->ctrl();
67  $ilLocator = $DIC['ilLocator'];
68  $ilObjDataCache = $DIC['ilObjDataCache'];
69 
70  $lng->loadLanguageModule("content");
71  $obj_id = ilObject::_lookupObjectId($this->refId);
72 
73  // add entry to navigation history
74  if ($ilAccess->checkAccess("read", "", $this->refId)) {
75  $ilNavigationHistory->addItem(
76  $this->refId,
77  "ilias.php?cmd=infoScreen&baseClass=ilSAHSPresentationGUI&ref_id=" . $this->refId,
78  "lm"
79  );
80  }
81 
82  $next_class = $this->ctrl->getNextClass($this);
83  $cmd = $this->ctrl->getCmd();
84 
86 
87  if ($cmd === "downloadCertificate") {
88  $scorm_gui = new ilSCORMPresentationGUI();
89  $ret = $this->ctrl->forwardCommand($scorm_gui);
90  }
91 
92  $this->slm_gui = new ilObjSCORMLearningModuleGUI("", $this->refId, true, false);
93 
94  # AXH: DEBUGGING!
95  $DIC->logger()->root()->info( '===== $next_class: ' . $next_class . ' =====' );
96  $DIC->logger()->root()->info( '===== $cmd: ' . $cmd . ' =====' );
97 
98  if ($next_class !== "ilinfoscreengui" &&
99  $cmd !== "infoScreen" &&
100  $next_class !== "ilobjscorm2004learningmodulegui" &&
101  $next_class !== "ilobjscormlearningmodulegui" &&
102  $next_class !== "ilscorm13playergui" &&
103  $next_class !== "ilscormpresentationgui" &&
104  $next_class !== "illearningprogressgui") {
105  switch ($type) {
106  case "scorm2004":
107  // @todo: removed deprecated ilCtrl methods, this needs inspection by a maintainer.
108  // $this->ctrl->setCmdClass("ilscorm13playergui");
109 
110  $this->ctrl->saveParameterByClass(ilSCORM13PlayerGUI::class, "ref_id");
111  $this->ctrl->redirectByClass(ilSCORM13PlayerGUI::class, $this->ctrl->getCmd());
112 
113  # AXH: Verwendung unklar!
114  $this->slm_gui = new ilObjSCORMLearningModuleGUI("", $this->refId, true, false);
115  break;
116 
117  case "scorm":
118  // @todo: removed deprecated ilCtrl methods, this needs inspection by a maintainer.
119  // $this->ctrl->setCmdClass("ilscormpresentationgui");
120 
121  $this->ctrl->saveParameterByClass(ilSCORMPresentationGUI::class, "ref_id");
122  $this->ctrl->redirectByClass(ilSCORMPresentationGUI::class, $this->ctrl->getCmd());
123 
124  # AXH: Verwendung unklar!
125  $this->slm_gui = new ilObjSCORMLearningModuleGUI("", $this->refId, true, false);
126  break;
127  }
128  # AXH: Verwendung unklar!
129  $next_class = $this->ctrl->getNextClass($this);
130  }
131 
132  switch ($next_class) {
133  case "ilinfoscreengui":
134  $this->outputInfoScreen();
135  break;
136 
137  case "ilscorm13playergui":
138  $scorm_gui = new ilSCORM13PlayerGUI();
139  $ret = $this->ctrl->forwardCommand($scorm_gui);
140  break;
141 
142  case "ilscormpresentationgui":
143  $scorm_gui = new ilSCORMPresentationGUI();
144  $ret = $this->ctrl->forwardCommand($scorm_gui);
145  break;
146 
147  case "illearningprogressgui":
148  $this->setInfoTabs("learning_progress");
150  $this->ctrl->forwardCommand($new_gui);
151  $this->tpl->printToStdout();
152  break;
153 
154  case "ilobjscorm2004learningmodulegui":
155  $new_gui = new ilObjSCORM2004LearningModuleGUI([], $this->refId, true, false);
156  $this->ctrl->forwardCommand($new_gui);
157  $this->setInfoTabs("cont_tracking_data");
158  $this->tpl->printToStdout();
159  break;
160 
161  case "ilobjscormlearningmodulegui":
162  $new_gui = new ilObjSCORMLearningModuleGUI("", $this->refId, true, false);
163  $this->ctrl->forwardCommand($new_gui);
164  $this->setInfoTabs("cont_tracking_data");
165  $this->tpl->printToStdout();
166  break;
167 
168  default:
169  $this->$cmd();
170  }
171  }
Class ilObjSCORMLearningModuleGUI.
loadLanguageModule(string $a_module)
Load language module.
static _lookupSubType(int $a_obj_id)
lookup subtype id (scorm, )
global $DIC
Definition: shib_login.php:26
static _lookupObjectId(int $ref_id)
Class ilSCORMPresentationGUI.
Class ilObjUserTrackingGUI.
+ Here is the call graph for this function:

◆ 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

Exceptions
ilCtrlException

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

References ILIAS\Repository\ctrl(), and outputInfoScreen().

192  : void
193  {
194  if (strtolower($this->ctrl->getCmd() ?? '') === 'infoscreen') {
195  $this->ctrl->redirectByClass(ilInfoScreenGUI::class, 'showSummary');
196  }
197 
198  $this->outputInfoScreen();
199  }
+ Here is the call graph for this function:

◆ outputInfoScreen()

ilSAHSPresentationGUI::outputInfoScreen ( )

info screen

Exceptions
ilCtrlException

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

References $DIC, $GLOBALS, $info, $refId, ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), and setInfoTabs().

Referenced by executeCommand(), and infoScreen().

267  : void
268  {
269  global $DIC;
270  $ilAccess = $DIC->access();
272 
273  $this->setInfoTabs("info_short");
274 
275  $this->lng->loadLanguageModule("meta");
276 
277  $info = new ilInfoScreenGUI($this->slm_gui);
278  $info->enablePrivateNotes();
279 
280  $info->enableNews();
281  if ($ilAccess->checkAccess("write", "", $refId)) {
282  $info->enableNewsEditing();
283  $news_set = new ilSetting("news");
284  $enable_internal_rss = $news_set->get("enable_rss_for_internal");
285  if ($enable_internal_rss) {
286  $info->setBlockProperty("news", "settings", "");
287  }
288  }
289 
290  // add read / back button
291  if ($ilAccess->checkAccess("read", "", $refId)) {
292  $ilToolbar = $GLOBALS['DIC']->toolbar();
293  $ilToolbar->addButtonInstance($this->slm_gui->getObject()->getViewButton());
294  }
295 
296  // show standard meta data section
297  $info->addMetaDataSections(
298  $this->slm_gui->getObject()->getId(),
299  0,
300  $this->slm_gui->getObject()->getType()
301  );
302 
303  $this->ctrl->forwardCommand($info);
304  $this->tpl->printToStdout();
305  }
$GLOBALS["DIC"]
Definition: wac.php:54
global $DIC
Definition: shib_login.php:26
$info
Definition: entry_point.php:21
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setInfoTabs()

ilSAHSPresentationGUI::setInfoTabs ( string  $a_active)
Exceptions
ilCtrlException

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

References $DIC, $refId, ilObject\_lookupObjectId(), ilObjSAHSLearningModule\_lookupSubType(), ilLearningProgressAccess\checkAccess(), ILIAS\Repository\ctrl(), ilUtil\getImagePath(), ilPrivacySettings\getInstance(), and ILIAS\Repository\lng().

Referenced by executeCommand(), and outputInfoScreen().

204  : void
205  {
206  global $DIC;
207 
209 
210  if (
211  !$DIC->access()->checkAccess('visible', '', $refId) &&
212  !$DIC->access()->checkAccess('read', '', $refId)
213  ) {
214  $DIC['ilErr']->raiseError($this->lng->txt('msg_no_perm_read'), $DIC['ilErr']->MESSAGE); //todo
215  }
217  $DIC->tabs()->addTab(
218  "info_short",
219  $this->lng->txt("info_short"),
220  $this->ctrl->getLinkTargetByClass("ilinfoscreengui", "showSummary")
221  );
222 
223  $DIC->tabs()->addTab(
224  "learning_progress",
225  $this->lng->txt("learning_progress"),
226  $this->ctrl->getLinkTargetByClass('illearningprogressgui', '')
227  );
228  }
229  if ($DIC->access()->checkAccess("edit_learning_progress", "", $refId) || $DIC->access()->checkAccess("read_learning_progress", "", $refId)) {
230  $privacy = ilPrivacySettings::getInstance();
231  if ($privacy->enabledSahsProtocolData()) {
234  if ($type === "scorm2004") {
235  $DIC->tabs()->addTab(
236  "cont_tracking_data",
237  $this->lng->txt("cont_tracking_data"),
238  $this->ctrl->getLinkTargetByClass('ilobjscorm2004learningmodulegui', 'showTrackingItems')
239  );
240  } elseif ($type === "scorm") {
241  $DIC->tabs()->addTab(
242  "cont_tracking_data",
243  $this->lng->txt("cont_tracking_data"),
244  $this->ctrl->getLinkTargetByClass('ilobjscormlearningmodulegui', 'showTrackingItems')
245  );
246  }
247  }
248  }
249  $DIC->tabs()->activateTab($a_active);
250  $this->tpl->loadStandardTemplate();
251  $this->tpl->setTitle($this->slm_gui->getObject()->getTitle());
252  $this->tpl->setTitleIcon(ilUtil::getImagePath("standard/icon_lm.svg"));
253  $DIC['ilLocator']->addRepositoryItems();
254  $DIC['ilLocator']->addItem(
255  $this->slm_gui->getObject()->getTitle(),
256  $this->ctrl->getLinkTarget($this, "infoScreen"),
257  "",
258  $refId
259  );
260  $this->tpl->setLocator();
261  }
static checkAccess(int $a_ref_id, bool $a_allow_only_read=true)
check access to learning progress
static _lookupSubType(int $a_obj_id)
lookup subtype id (scorm, )
global $DIC
Definition: shib_login.php:26
static getImagePath(string $image_name, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
static _lookupObjectId(int $ref_id)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ view()

ilSAHSPresentationGUI::view ( )

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

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

174  : void
175  {
176  $sc_gui_object = ilSCORMObjectGUI::getInstance($this->refId);
177 
178  if (is_object($sc_gui_object)) {
179  $sc_gui_object->view();
180  }
181 
182  $this->tpl->setVariable("LOCATION_STYLESHEET", ilUtil::getStyleSheetLocation());
183  $this->tpl->printToStdout();
184  }
static getStyleSheetLocation(string $mode="output", string $a_css_name="")
get full style sheet file name (path inclusive) of current user
+ Here is the call graph for this function:

Field Documentation

◆ $ctrl

ilCtrl ilSAHSPresentationGUI::$ctrl
protected

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

◆ $lng

ilLanguage ilSAHSPresentationGUI::$lng
protected

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

◆ $refId

int ilSAHSPresentationGUI::$refId
protected

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

Referenced by outputInfoScreen(), and setInfoTabs().

◆ $slm_gui

ilObjSCORMLearningModuleGUI ilSAHSPresentationGUI::$slm_gui
protected

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

◆ $tpl

ilGlobalPageTemplate ilSAHSPresentationGUI::$tpl
protected

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


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