ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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  var $ilias;
20  var $tpl;
21  var $lng;
22 
23  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  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  {
50  $this->ilias->raiseError($lng->txt("permission_denied"),$ilias->error_obj->MESSAGE);
51  }
52 
53  // add entry to navigation history
54  $ilNavigationHistory->addItem($_GET["ref_id"],
55  "ilias.php?baseClass=ilSAHSEditGUI&ref_id=".$_GET["ref_id"], "lm");
56 
57  $next_class = $this->ctrl->getNextClass($this);
58  $cmd = $this->ctrl->getCmd();
59 
60  $obj_id = ilObject::_lookupObjectId($_GET['ref_id']);
62 
63  switch($type)
64  {
65 
66  case "scorm2004":
67  include_once("./Modules/Scorm2004/classes/class.ilObjSCORM2004LearningModuleGUI.php");
68  $this->slm_gui = new ilObjSCORM2004LearningModuleGUI("", $_GET["ref_id"],true,false);
69  break;
70 
71  case "scorm":
72  include_once("./Modules/ScormAicc/classes/class.ilObjSCORMLearningModuleGUI.php");
73  $this->slm_gui = new ilObjSCORMLearningModuleGUI("", $_GET["ref_id"],true,false);
74  break;
75 
76  case "aicc":
77  include_once("./Modules/ScormAicc/classes/class.ilObjAICCLearningModuleGUI.php");
78  $this->slm_gui = new ilObjAICCLearningModuleGUI("", $_GET["ref_id"],true,false);
79  break;
80 
81  case "hacp":
82  include_once("./Modules/ScormAicc/classes/class.ilObjHACPLearningModuleGUI.php");
83  $this->slm_gui = new ilObjHACPLearningModuleGUI("", $_GET["ref_id"],true,false);
84  break;
85  }
86 
87  if ($next_class == "")
88  {
89  switch($type)
90  {
91 
92  case "scorm2004":
93  $this->ctrl->setCmdClass("ilobjscorm2004learningmodulegui");
94  break;
95 
96  case "scorm":
97  $this->ctrl->setCmdClass("ilobjscormlearningmodulegui");
98  break;
99 
100  case "aicc":
101  $this->ctrl->setCmdClass("ilobjaicclearningmodulegui");
102  break;
103 
104  case "hacp":
105  $this->ctrl->setCmdClass("ilobjhacplearningmodulegui");
106  break;
107  }
108  $next_class = $this->ctrl->getNextClass($this);
109  }
110 
111  switch($next_class)
112  {
113  case "ilobjscormlearningmodulegui":
114  case "ilobjscorm2004learningmodulegui":
115  $ret = $this->ctrl->forwardCommand($this->slm_gui);
116  break;
117 
118  case "ilobjaicclearningmodulegui":
119  $ret = $this->ctrl->forwardCommand($this->slm_gui);
120  break;
121 
122  case "ilobjhacplearningmodulegui":
123  $ret = $this->ctrl->forwardCommand($this->slm_gui);
124  break;
125  case "ilexportgui":
126  $obj_id = ilObject::_lookupObjectId($_GET["ref_id"]);
127  if ($cmd == "create_xml")
128  {
129  require_once("Modules/ScormAicc/classes/class.ilScormAiccExporter.php");
130  $exporter = new ilScormAiccExporter();
131  $xml = $exporter->getXmlRepresentation("sahs", "5.1.0", $_GET["ref_id"]);
132  }
133  else if ($cmd == "download")
134  {
135  $file = $_GET["file"];
136  $ftmp = explode (":", $file);
137  $fileName = $ftmp[1];
138  require_once ("./Services/Export/classes/class.ilExport.php");
139  $exportDir = ilExport::_getExportDirectory($obj_id);
140  ilUtil::deliverFile ($exportDir . "/" . $fileName, $fileName);
141  }
142  else if ($cmd == "confirmDeletion")
143  {
144  }
145  $this->ctrl->setCmd ("export");
146  ilUtil::redirect("ilias.php?baseClass=ilSAHSEditGUI&cmd=export&ref_id=".$_GET["ref_id"]);
147  break;
148 
149 
150  default:
151  die ("ilSAHSEdit: Class $next_class not found.");;
152  }
153 
154  $this->tpl->show();
155  }
156 }
157 ?>
Class ilObjSCORMLearningModuleGUI.
$_GET["client_id"]
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
$cmd
Definition: sahs_server.php:35
Class ilObjAICCLearningModuleGUI.
static _lookupSubType($a_obj_id)
lookup subtype id (scorm, aicc, hacp)
Class ilObjHACPLearningModuleGUI.
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) ...
static deliverFile($a_file, $a_filename, $a_mime='', $isInline=false, $removeAfterDelivery=false, $a_exit_after=true)
deliver file for download via browser.
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
if(!file_exists("$old.txt")) if($old===$new) if(file_exists("$new.txt")) $file
static redirect($a_script)
http redirect to other script