ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilHTLMPresentationGUI.php
Go to the documentation of this file.
1<?php
2
24{
25 protected \ILIAS\HTMLLearningModule\StandardGUIRequest $request;
26 protected ilCtrl $ctrl;
32 public int $ref_id;
33
34 public function __construct()
35 {
36 global $DIC;
37
38 $this->access = $DIC->access();
39 $this->nav_history = $DIC["ilNavigationHistory"];
40 $tpl = $DIC["tpl"];
41 $lng = $DIC->language();
42 $objDefinition = $DIC["objDefinition"];
43 $ilCtrl = $DIC->ctrl();
44 $ilAccess = $DIC->access();
45 $this->request = $DIC->htmlLearningModule()
46 ->internal()
47 ->gui()
48 ->standardRequest();
49 $this->ref_id = $this->request->getRefId();
50
51 $lng->loadLanguageModule("content");
52
53 // check write permission
54 if (!$ilAccess->checkAccess("read", "", $this->ref_id)) {
55 throw new ilPermissionException($lng->txt("permission_denied"));
56 }
57
58
59 $this->ctrl = $ilCtrl;
60
61 //$this->ctrl->saveParameter($this, array("ref_id", "obj_id"));
62 $this->ctrl->saveParameter($this, array("ref_id"));
63
64 // initiate variables
65 $this->tpl = $tpl;
66 $this->lng = $lng;
67 $this->objDefinition = $objDefinition;
68 }
69
70 public function executeCommand(): void
71 {
73 $ilCtrl = $this->ctrl;
74 $ilAccess = $this->access;
75 $ilNavigationHistory = $this->nav_history;
76
77 // add entry to navigation history
78 if ($ilAccess->checkAccess("read", "", $this->ref_id)) {
79 $ilCtrl->setParameterByClass("ilobjfilebasedlmgui", "ref_id", $this->ref_id);
80 $ilNavigationHistory->addItem(
81 $this->ref_id,
82 $ilCtrl->getLinkTargetByClass(array("ilrepositorygui", "ilobjfilebasedlmgui"), "infoScreen"),
83 "htlm"
84 );
85 }
86
87 $next_class = $this->ctrl->getNextClass($this);
88
89 switch ($next_class) {
90 case "ilobjfilebasedlmgui":
91 $fblm_gui = new ilObjFileBasedLMGUI("", $this->ref_id, true, false);
92 $ilCtrl->forwardCommand($fblm_gui);
94 break;
95
96 default:
97 $this->ctrl->saveParameterByClass(ilObjFileBasedLMGUI::class, "ref_id");
98 $this->ctrl->redirectByClass(ilObjFileBasedLMGUI::class, "showLearningModule");
99 break;
100 }
101 }
102}
Class ilCtrl provides processing control methods.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
ilGlobalTemplateInterface $tpl
ILIAS HTMLLearningModule StandardGUIRequest $request
language handling
loadLanguageModule(string $a_module)
Load language module.
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
Last visited history for repository items.
addItem(int $a_ref_id, string $a_link, string $a_type, string $a_title="", ?int $a_sub_obj_id=null, string $a_goto_link="")
Add an item to the stack.
User Interface class for file based learning modules (HTML)
parses the objects.xml it handles the xml-description of all ilias objects
printToStdout(string $part=self::DEFAULT_BLOCK, bool $has_tabs=true, bool $skip_main_menu=false)
Interface ilAccessHandler This interface combines all available interfaces which can be called via gl...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
global $DIC
Definition: shib_login.php:26