ILIAS  trunk Revision v12.0_alpha-1227-g7ff6d300864
class.ilSAHSEditGUI.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
33{
34 private \ILIAS\HTTP\Wrapper\WrapperFactory $wrapper;
35 private \ILIAS\Refinery\Factory $refinery;
37 protected ilLanguage $lng;
38 protected ilCtrl $ctrl;
39 protected int $refId;
40
42
46 public function __construct()
47 {
48 global $DIC;
49 $this->tpl = $DIC['tpl'];
50 $this->lng = $DIC->language();
51 $this->ctrl = $DIC->ctrl();
52 $this->wrapper = $DIC->http()->wrapper();
53 $this->refinery = $DIC->refinery();
54 $this->refId = $DIC->http()->wrapper()->query()->retrieve('ref_id', $DIC->refinery()->kindlyTo()->int());
55
56 $this->ctrl->saveParameter($this, "ref_id");
57 }
58
62 public function executeCommand(): void
63 {
64 global $DIC;
65
66 $DIC->globalScreen()->tool()->context()->claim()->repository();
67
68 $lng = $DIC->language();
69 $ilAccess = $DIC->access();
70 $ilNavigationHistory = $DIC['ilNavigationHistory'];
71 $ilCtrl = $DIC->ctrl();
72 $ilErr = $DIC["ilErr"];
73 $ilLog = ilLoggerFactory::getLogger('sahs');
74 $ilLog->debug("bc:" . $DIC->http()->wrapper()->query()->retrieve('baseClass', $DIC->refinery()->kindlyTo()->string()) . "; nc:" . $this->ctrl->getNextClass($this) . "; cmd:" . $this->ctrl->getCmd());
75
76 $lng->loadLanguageModule("content");
77
78 // permission
79 if (!$ilAccess->checkAccess("write", "", $this->refId)) {
80 $ilErr->raiseError($lng->txt("permission_denied"), $ilErr->MESSAGE);
81 }
82
83 // add entry to navigation history
84 $ilNavigationHistory->addItem(
85 $this->refId,
86 "ilias.php?baseClass=ilSAHSEditGUI&ref_id=" . $this->refId,
87 "lm"
88 );
89
90 $next_class = $this->ctrl->getNextClass($this) ?? '';
91 $cmd = $this->ctrl->getCmd() ?? '';
92
93 $obj_id = ilObject::_lookupObjectId($this->refId);
95
96 if ($next_class === '') {
97 switch ($type) {
98 case "scorm":
99 $this->ctrl->redirectByClass(ilObjSCORMLearningModuleGUI::class, $cmd);
100
101 case "scorm2004":
102 $this->ctrl->redirectByClass(ilObjSCORM2004LearningModuleGUI::class, $cmd);
103 }
104 }
105
106 switch ($type) {
107 case "scorm":
108 $this->slm_gui = new ilObjSCORMLearningModuleGUI([], $this->refId, true, false);
109 break;
110
111 case "scorm2004":
112 $this->slm_gui = new ilObjSCORM2004LearningModuleGUI([], $this->refId, true, false);
113 break;
114 }
115
116 switch ($next_class) {
117 case "ilobjscormlearningmodulegui":
118 case "ilobjscorm2004learningmodulegui":
119 $ret = $this->ctrl->forwardCommand($this->slm_gui);
120 break;
121
122 case "ilexportgui":
123 $this->slm_gui->export();
124 ilUtil::redirect("ilias.php?baseClass=ilSAHSEditGUI&cmd=export&ref_id=" . $this->refId);
125 break;
126
127
128 default:
129 die("ilSAHSEdit: Class $next_class not found.");
130 }
131
132 $this->tpl->printToStdout();
133 }
134}
Class ilCtrl provides processing control methods.
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...
static getLogger(string $a_component_id)
Get component logger.
static _lookupSubType(int $a_obj_id)
lookup subtype id (scorm, )
Class ilObjSCORMLearningModuleGUI.
static _lookupObjectId(int $ref_id)
Class ilSAHSPresentationGUI.
ilObjSCORMLearningModuleGUI ilObjSCORM2004LearningModuleGUI $slm_gui
ilGlobalPageTemplate $tpl
ILIAS HTTP Wrapper WrapperFactory $wrapper
ILIAS Refinery Factory $refinery
static redirect(string $a_script)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
$ilErr
Definition: raiseError.php:33
global $DIC
Definition: shib_login.php:26