ILIAS  Release_3_10_x_branch Revision 61812
 All Data Structures Namespaces Files Functions Variables Groups Pages
class.ilSAHSEditGUI.php
Go to the documentation of this file.
1 <?php
2 /*
3  +-----------------------------------------------------------------------------+
4  | ILIAS open source |
5  +-----------------------------------------------------------------------------+
6  | Copyright (c) 1998-2006 ILIAS open source, University of Cologne |
7  | |
8  | This program is free software; you can redistribute it and/or |
9  | modify it under the terms of the GNU General Public License |
10  | as published by the Free Software Foundation; either version 2 |
11  | of the License, or (at your option) any later version. |
12  | |
13  | This program is distributed in the hope that it will be useful, |
14  | but WITHOUT ANY WARRANTY; without even the implied warranty of |
15  | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
16  | GNU General Public License for more details. |
17  | |
18  | You should have received a copy of the GNU General Public License |
19  | along with this program; if not, write to the Free Software |
20  | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
21  +-----------------------------------------------------------------------------+
22 */
23 
24 
39 {
40  var $ilias;
41  var $tpl;
42  var $lng;
43 
44  function ilSAHSEditGUI()
45  {
46  global $ilias, $tpl, $lng, $ilCtrl;
47 
48  $this->ilias =& $ilias;
49  $this->tpl =& $tpl;
50  $this->lng =& $lng;
51  $this->ctrl =& $ilCtrl;
52 
53  $this->ctrl->saveParameter($this, "ref_id");
54  }
55 
59  function &executeCommand()
60  {
61  global $lng, $ilAccess, $ilNavigationHistory;
62 
63  include_once "./Modules/ScormAicc/classes/class.ilObjSAHSLearningModule.php";
64 
65  $lng->loadLanguageModule("content");
66 
67  // permission
68  if (!$ilAccess->checkAccess("write", "", $_GET["ref_id"]))
69  {
70  $ilias->raiseError($lng->txt("permission_denied"),$ilias->error_obj->MESSAGE);
71  }
72 
73  // add entry to navigation history
74  $ilNavigationHistory->addItem($_GET["ref_id"],
75  "ilias.php?baseClass=ilSAHSEditGUI&ref_id=".$_GET["ref_id"], "lm");
76 
77  $next_class = $this->ctrl->getNextClass($this);
78  $cmd = $this->ctrl->getCmd();
79 
80  $obj_id = ilObject::_lookupObjectId($_GET['ref_id']);
82 
83  switch($type)
84  {
85 
86  case "scorm2004":
87  include_once("./Modules/Scorm2004/classes/class.ilObjSCORM2004LearningModuleGUI.php");
88  $this->slm_gui = new ilObjSCORM2004LearningModuleGUI("", $_GET["ref_id"],true,false);
89  break;
90 
91  case "scorm":
92  include_once("./Modules/ScormAicc/classes/class.ilObjSCORMLearningModuleGUI.php");
93  $this->slm_gui = new ilObjSCORMLearningModuleGUI("", $_GET["ref_id"],true,false);
94  break;
95 
96  case "aicc":
97  include_once("./Modules/ScormAicc/classes/class.ilObjAICCLearningModuleGUI.php");
98  $this->slm_gui = new ilObjAICCLearningModuleGUI("", $_GET["ref_id"],true,false);
99  break;
100 
101  case "hacp":
102  include_once("./Modules/ScormAicc/classes/class.ilObjHACPLearningModuleGUI.php");
103  $this->slm_gui = new ilObjHACPLearningModuleGUI("", $_GET["ref_id"],true,false);
104  break;
105  }
106 
107  if ($next_class == "")
108  {
109  switch($type)
110  {
111 
112  case "scorm2004":
113  $this->ctrl->setCmdClass("ilobjscorm2004learningmodulegui");
114  break;
115 
116  case "scorm":
117  $this->ctrl->setCmdClass("ilobjscormlearningmodulegui");
118  break;
119 
120  case "aicc":
121  $this->ctrl->setCmdClass("ilobjaicclearningmodulegui");
122  break;
123 
124  case "hacp":
125  $this->ctrl->setCmdClass("ilobjhacplearningmodulegui");
126  break;
127  }
128  $next_class = $this->ctrl->getNextClass($this);
129  }
130 
131  switch($next_class)
132  {
133  case "ilobjscormlearningmodulegui":
134  case "ilobjscorm2004learningmodulegui":
135  $ret =& $this->ctrl->forwardCommand($this->slm_gui);
136  break;
137 
138  case "ilobjaicclearningmodulegui":
139  $ret =& $this->ctrl->forwardCommand($this->slm_gui);
140  break;
141 
142  case "ilobjhacplearningmodulegui":
143  $ret =& $this->ctrl->forwardCommand($this->slm_gui);
144  break;
145 
146  default:
147  die ("ilSAHSEdit: Class $next_class not found.");;
148  }
149 
150  $this->tpl->show();
151  }
152 }
153 ?>