ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
class.ilSAHSEditGUI.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 1998-2012 ILIAS open source, Extended GPL, see docs/LICENSE */
3
18{
19 public $ilias;
20 public $tpl;
21 public $lng;
22
23 public function __construct()
24 {
25 global $ilias, $tpl, $lng, $ilCtrl;
26
27 $this->ilias = $ilias;
28 $this->tpl = $tpl;
29 $this->lng = $lng;
30 $this->ctrl = $ilCtrl;
31
32 $this->ctrl->saveParameter($this, "ref_id");
33 }
34
38 public function executeCommand()
39 {
40 global $lng, $ilAccess, $ilNavigationHistory, $ilias, $ilCtrl;
41 $GLOBALS["ilLog"]->write("bc:" . $_GET["baseClass"] . "; nc:" . $this->ctrl->getNextClass($this) . "; cmd:" . $this->ctrl->getCmd());
42
43 include_once "./Modules/ScormAicc/classes/class.ilObjSAHSLearningModule.php";
44
45 $lng->loadLanguageModule("content");
46
47 // permission
48 if (!$ilAccess->checkAccess("write", "", $_GET["ref_id"])) {
49 $this->ilias->raiseError($lng->txt("permission_denied"), $ilias->error_obj->MESSAGE);
50 }
51
52 // add entry to navigation history
53 $ilNavigationHistory->addItem(
54 $_GET["ref_id"],
55 "ilias.php?baseClass=ilSAHSEditGUI&ref_id=" . $_GET["ref_id"],
56 "lm"
57 );
58
59 $next_class = $this->ctrl->getNextClass($this);
60 $cmd = $this->ctrl->getCmd();
61
62 $obj_id = ilObject::_lookupObjectId($_GET['ref_id']);
64
65 switch ($type) {
66
67 case "scorm2004":
68 include_once("./Modules/Scorm2004/classes/class.ilObjSCORM2004LearningModuleGUI.php");
69 $this->slm_gui = new ilObjSCORM2004LearningModuleGUI("", $_GET["ref_id"], true, false);
70 break;
71
72 case "scorm":
73 include_once("./Modules/ScormAicc/classes/class.ilObjSCORMLearningModuleGUI.php");
74 $this->slm_gui = new ilObjSCORMLearningModuleGUI("", $_GET["ref_id"], true, false);
75 break;
76 }
77
78 if ($next_class == "") {
79 switch ($type) {
80
81 case "scorm2004":
82 $this->ctrl->setCmdClass("ilobjscorm2004learningmodulegui");
83 break;
84
85 case "scorm":
86 $this->ctrl->setCmdClass("ilobjscormlearningmodulegui");
87 break;
88 }
89 $next_class = $this->ctrl->getNextClass($this);
90 }
91
92 switch ($next_class) {
93 case "ilobjscormlearningmodulegui":
94 case "ilobjscorm2004learningmodulegui":
95 $ret = $this->ctrl->forwardCommand($this->slm_gui);
96 break;
97
98 case "ilexportgui":
99 $obj_id = ilObject::_lookupObjectId($_GET["ref_id"]);
100 if ($cmd == "create_xml") {
101 require_once("Modules/ScormAicc/classes/class.ilScormAiccExporter.php");
102 $exporter = new ilScormAiccExporter();
103 $xml = $exporter->getXmlRepresentation("sahs", "5.1.0", ilObject::_lookupObjectId($_GET["ref_id"]));
104 } elseif ($cmd == "download") {
105 $file = $_GET["file"];
106 $ftmp = explode(":", $file);
107 $fileName = $ftmp[1];
108 require_once("./Services/Export/classes/class.ilExport.php");
109 $exportDir = ilExport::_getExportDirectory($obj_id);
110 ilUtil::deliverFile($exportDir . "/" . $fileName, $fileName);
111 } elseif ($cmd == "confirmDeletion") {
112 }
113 $this->ctrl->setCmd("export");
114 ilUtil::redirect("ilias.php?baseClass=ilSAHSEditGUI&cmd=export&ref_id=" . $_GET["ref_id"]);
115 break;
116
117
118 default:
119 die("ilSAHSEdit: Class $next_class not found.");;
120 }
121
122 $this->tpl->show();
123 }
124}
$_GET["client_id"]
An exception for terminatinating execution or to throw for unit testing.
static _getExportDirectory($a_obj_id, $a_type="xml", $a_obj_type="", $a_entity="")
Get export directory for an repository object.
static _lookupSubType($a_obj_id)
lookup subtype id (scorm, )
Class ilObjSCORMLearningModuleGUI.
static _lookupObjectId($a_ref_id)
lookup object id
Class ilSAHSPresentationGUI.
executeCommand()
execute command
static redirect($a_script)
static deliverFile( $a_file, $a_filename, $a_mime='', $isInline=false, $removeAfterDelivery=false, $a_exit_after=true)
deliver file for download via browser.
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
global $ilCtrl
Definition: ilias.php:18
$xml
Definition: metadata.php:240
redirection script todo: (a better solution should control the processing via a xml file)
$ret
Definition: parser.php:6
$type
if(!file_exists("$old.txt")) if( $old===$new) if(file_exists("$new.txt")) $file