ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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 $DIC;
26  $ilias = $DIC['ilias'];
27  $tpl = $DIC['tpl'];
28  $lng = $DIC['lng'];
29  $ilCtrl = $DIC['ilCtrl'];
30 
31  $this->ilias = $ilias;
32  $this->tpl = $tpl;
33  $this->lng = $lng;
34  $this->ctrl = $ilCtrl;
35 
36  $this->ctrl->saveParameter($this, "ref_id");
37  }
38 
42  public function executeCommand()
43  {
44  global $DIC;
45  $lng = $DIC['lng'];
46  $ilAccess = $DIC['ilAccess'];
47  $ilNavigationHistory = $DIC['ilNavigationHistory'];
48  $ilias = $DIC['ilias'];
49  $ilCtrl = $DIC['ilCtrl'];
50  $GLOBALS['DIC']["ilLog"]->write("bc:" . $_GET["baseClass"] . "; nc:" . $this->ctrl->getNextClass($this) . "; cmd:" . $this->ctrl->getCmd());
51 
52  include_once "./Modules/ScormAicc/classes/class.ilObjSAHSLearningModule.php";
53 
54  $lng->loadLanguageModule("content");
55 
56  // permission
57  if (!$ilAccess->checkAccess("write", "", $_GET["ref_id"])) {
58  $this->ilias->raiseError($lng->txt("permission_denied"), $ilias->error_obj->MESSAGE);
59  }
60 
61  // add entry to navigation history
62  $ilNavigationHistory->addItem(
63  $_GET["ref_id"],
64  "ilias.php?baseClass=ilSAHSEditGUI&ref_id=" . $_GET["ref_id"],
65  "lm"
66  );
67 
68  $next_class = $this->ctrl->getNextClass($this);
69  $cmd = $this->ctrl->getCmd();
70 
71  $obj_id = ilObject::_lookupObjectId($_GET['ref_id']);
73 
74  switch ($type) {
75 
76  case "scorm2004":
77  include_once("./Modules/Scorm2004/classes/class.ilObjSCORM2004LearningModuleGUI.php");
78  $this->slm_gui = new ilObjSCORM2004LearningModuleGUI("", $_GET["ref_id"], true, false);
79  break;
80 
81  case "scorm":
82  include_once("./Modules/ScormAicc/classes/class.ilObjSCORMLearningModuleGUI.php");
83  $this->slm_gui = new ilObjSCORMLearningModuleGUI("", $_GET["ref_id"], true, false);
84  break;
85  }
86 
87  if ($next_class == "") {
88  switch ($type) {
89 
90  case "scorm2004":
91  $this->ctrl->setCmdClass("ilobjscorm2004learningmodulegui");
92  break;
93 
94  case "scorm":
95  $this->ctrl->setCmdClass("ilobjscormlearningmodulegui");
96  break;
97  }
98  $next_class = $this->ctrl->getNextClass($this);
99  }
100 
101  switch ($next_class) {
102  case "ilobjscormlearningmodulegui":
103  case "ilobjscorm2004learningmodulegui":
104  $ret = $this->ctrl->forwardCommand($this->slm_gui);
105  break;
106 
107  case "ilexportgui":
108  $obj_id = ilObject::_lookupObjectId($_GET["ref_id"]);
109  if ($cmd == "create_xml") {
110  require_once("Modules/ScormAicc/classes/class.ilScormAiccExporter.php");
111  $exporter = new ilScormAiccExporter();
112  $xml = $exporter->getXmlRepresentation("sahs", "5.1.0", ilObject::_lookupObjectId($_GET["ref_id"]));
113  } elseif ($cmd == "download") {
114  $file = $_GET["file"];
115  $ftmp = explode(":", $file);
116  $fileName = $ftmp[1];
117  require_once("./Services/Export/classes/class.ilExport.php");
118  $exportDir = ilExport::_getExportDirectory($obj_id);
119  ilUtil::deliverFile($exportDir . "/" . $fileName, $fileName);
120  } elseif ($cmd == "confirmDeletion") {
121  }
122  $this->ctrl->setCmd("export");
123  ilUtil::redirect("ilias.php?baseClass=ilSAHSEditGUI&cmd=export&ref_id=" . $_GET["ref_id"]);
124  break;
125 
126 
127  default:
128  die("ilSAHSEdit: Class $next_class not found.");;
129  }
130 
131  $this->tpl->show();
132  }
133 }
Class ilObjSCORMLearningModuleGUI.
$type
global $DIC
Definition: saml.php:7
$_GET["client_id"]
static _lookupSubType($a_obj_id)
lookup subtype id (scorm, )
static _lookupObjectId($a_ref_id)
lookup object id
global $ilCtrl
Definition: ilias.php:18
redirection script todo: (a better solution should control the processing via a xml file) ...
Class ilSAHSPresentationGUI.
$ret
Definition: parser.php:6
static _getExportDirectory($a_obj_id, $a_type="xml", $a_obj_type="", $a_entity="")
Get export directory for an repository object.
executeCommand()
execute command
static redirect($a_script)
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.
static deliverFile( $a_file, $a_filename, $a_mime='', $isInline=false, $removeAfterDelivery=false, $a_exit_after=true)
deliver file for download via browser.