ILIAS  Release_4_1_x_branch Revision 61804
 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, $ilias;
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  $this->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 
81  $obj_id = ilObject::_lookupObjectId($_GET['ref_id']);
83 
84  switch($type)
85  {
86 
87  case "scorm2004":
88  include_once("./Modules/Scorm2004/classes/class.ilObjSCORM2004LearningModuleGUI.php");
89  $this->slm_gui = new ilObjSCORM2004LearningModuleGUI("", $_GET["ref_id"],true,false);
90  break;
91 
92  case "scorm":
93  include_once("./Modules/ScormAicc/classes/class.ilObjSCORMLearningModuleGUI.php");
94  $this->slm_gui = new ilObjSCORMLearningModuleGUI("", $_GET["ref_id"],true,false);
95  break;
96 
97  case "aicc":
98  include_once("./Modules/ScormAicc/classes/class.ilObjAICCLearningModuleGUI.php");
99  $this->slm_gui = new ilObjAICCLearningModuleGUI("", $_GET["ref_id"],true,false);
100  break;
101 
102  case "hacp":
103  include_once("./Modules/ScormAicc/classes/class.ilObjHACPLearningModuleGUI.php");
104  $this->slm_gui = new ilObjHACPLearningModuleGUI("", $_GET["ref_id"],true,false);
105  break;
106  }
107 
108  if ($next_class == "")
109  {
110  switch($type)
111  {
112 
113  case "scorm2004":
114  $this->ctrl->setCmdClass("ilobjscorm2004learningmodulegui");
115  break;
116 
117  case "scorm":
118  $this->ctrl->setCmdClass("ilobjscormlearningmodulegui");
119  break;
120 
121  case "aicc":
122  $this->ctrl->setCmdClass("ilobjaicclearningmodulegui");
123  break;
124 
125  case "hacp":
126  $this->ctrl->setCmdClass("ilobjhacplearningmodulegui");
127  break;
128  }
129  $next_class = $this->ctrl->getNextClass($this);
130  }
131 
132  switch($next_class)
133  {
134  case "ilobjscormlearningmodulegui":
135  case "ilobjscorm2004learningmodulegui":
136  $ret =& $this->ctrl->forwardCommand($this->slm_gui);
137  break;
138 
139  case "ilobjaicclearningmodulegui":
140  $ret =& $this->ctrl->forwardCommand($this->slm_gui);
141  break;
142 
143  case "ilobjhacplearningmodulegui":
144  $ret =& $this->ctrl->forwardCommand($this->slm_gui);
145  break;
146 
147  default:
148  die ("ilSAHSEdit: Class $next_class not found.");;
149  }
150 
151  $this->tpl->show();
152  }
153 }
154 ?>