ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
ilSAHSEditGUI Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Inheritance diagram for ilSAHSEditGUI:
+ Collaboration diagram for ilSAHSEditGUI:

Public Member Functions

 __construct ()
 
 executeCommand ()
 

Protected Attributes

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

Private Attributes

ILIAS HTTP Wrapper WrapperFactory $wrapper
 
ILIAS Refinery Factory $refinery
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning Class ilSAHSPresentationGUI

GUI class for scorm learning module presentation

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
Id
class.ilSAHSPresentationGUI.php 11714 2006-07-30 17:15:55Z akill

ilSAHSEditGUI: ilFileSystemGUI, ilObjectMetaDataGUI, ilObjSCORMLearningModuleGUI, ilInfoScreenGUI, ilObjSCORM2004LearningModuleGUI, ilExportGUI, ilObjSAHSLearningModuleGUI, ilLTIProviderObjectSettingGUI

Definition at line 32 of file class.ilSAHSEditGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilSAHSEditGUI::__construct ( )
Exceptions
ilCtrlException

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

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

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  }
global $DIC
Definition: feed.php:28
+ Here is the call graph for this function:

Member Function Documentation

◆ executeCommand()

ilSAHSEditGUI::executeCommand ( )
Exceptions
ilCtrlException

Definition at line 62 of file class.ilSAHSEditGUI.php.

References $DIC, $ilErr, ilExport\_getExportDirectory(), ilObject\_lookupObjectId(), ilObjSAHSLearningModule\_lookupSubType(), ILIAS\Repository\ctrl(), ilFileDelivery\deliverFileLegacy(), ilLoggerFactory\getLogger(), ilLanguage\loadLanguageModule(), ilUtil\redirect(), ILIAS\Repository\refinery(), and ilLanguage\txt().

62  : 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  switch ($type) {
97  case "scorm":
98  $this->slm_gui = new ilObjSCORMLearningModuleGUI([], $this->refId, true, false);
99  break;
100 
101  case "scorm2004":
102  $this->slm_gui = new ilObjSCORM2004LearningModuleGUI([], $this->refId, true, false);
103  break;
104  }
105 
106  if ($next_class == "") {
107  switch ($type) {
108  case "scorm2004":
109  $this->ctrl->setCmdClass("ilobjscorm2004learningmodulegui");
110  break;
111 
112  case "scorm":
113  $this->ctrl->setCmdClass("ilobjscormlearningmodulegui");
114  break;
115  }
116  $next_class = $this->ctrl->getNextClass($this);
117  }
118 
119  switch ($next_class) {
120  case "ilobjscormlearningmodulegui":
121  case "ilobjscorm2004learningmodulegui":
122  $ret = $this->ctrl->forwardCommand($this->slm_gui);
123  break;
124 
125  case "ilexportgui":
126  $obj_id = ilObject::_lookupObjectId($this->refId);
127  if ($cmd === "create_xml") {
128  $exporter = new ilScormAiccExporter();
129  $xml = $exporter->getXmlRepresentation("sahs", "5.1.0", (string) $obj_id);
130  } elseif ($cmd === "download") {
131  $file = $this->wrapper->query()->retrieve('file', $this->refinery->kindlyTo()->string());
132  $ftmp = explode(":", $file);
133  $fileName = (string) $ftmp[1];
134  $exportDir = ilExport::_getExportDirectory($obj_id);
135  ilFileDelivery::deliverFileLegacy($exportDir . "/" . $fileName, $fileName, "zip");
136  } elseif ($cmd === "confirmDeletion") {
137  $exportDir = ilExport::_getExportDirectory($obj_id);
138  // $files = $_POST['file'];
139  $files = $this->wrapper->post()->retrieve('file', $this->refinery->kindlyTo()->listOf($this->refinery->kindlyTo()->string()));
140  foreach ($files as $file) {
141  $file = explode(":", $file);
142  $file[1] = basename($file[1]);
143  $exp_file = $exportDir . "/" . str_replace("..", "", $file[1]);
144  if (@is_file($exp_file)) {
145  unlink($exp_file);
146  }
147  }
148  }
149  $this->ctrl->setCmd("export");
150  ilUtil::redirect("ilias.php?baseClass=ilSAHSEditGUI&cmd=export&ref_id=" . $this->refId);
151  break;
152 
153 
154  default:
155  die("ilSAHSEdit: Class $next_class not found.");
156  }
157 
158  $this->tpl->printToStdout();
159  }
Class ilObjSCORMLearningModuleGUI.
static getLogger(string $a_component_id)
Get component logger.
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...
loadLanguageModule(string $a_module)
Load language module.
static _getExportDirectory(int $a_obj_id, string $a_type="xml", string $a_obj_type="", string $a_entity="")
Get export directory for an repository object.
static _lookupSubType(int $a_obj_id)
lookup subtype id (scorm, )
$ilErr
Definition: raiseError.php:17
static deliverFileLegacy(string $a_file, ?string $a_filename=null, ?string $a_mime=null, ?bool $isInline=false, ?bool $removeAfterDelivery=false, ?bool $a_exit_after=true)
global $DIC
Definition: feed.php:28
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _lookupObjectId(int $ref_id)
static redirect(string $a_script)
+ Here is the call graph for this function:

Field Documentation

◆ $ctrl

ilCtrl ilSAHSEditGUI::$ctrl
protected

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

◆ $lng

ilLanguage ilSAHSEditGUI::$lng
protected

Definition at line 37 of file class.ilSAHSEditGUI.php.

◆ $refId

int ilSAHSEditGUI::$refId
protected

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

◆ $refinery

ILIAS Refinery Factory ilSAHSEditGUI::$refinery
private

Definition at line 35 of file class.ilSAHSEditGUI.php.

◆ $slm_gui

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

◆ $tpl

ilGlobalPageTemplate ilSAHSEditGUI::$tpl
protected

Definition at line 36 of file class.ilSAHSEditGUI.php.

◆ $wrapper

ILIAS HTTP Wrapper WrapperFactory ilSAHSEditGUI::$wrapper
private

Definition at line 34 of file class.ilSAHSEditGUI.php.


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