ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
class.ilHTLMEditorGUI.php
Go to the documentation of this file.
1 <?php
2 /*
3  +-----------------------------------------------------------------------------+
4  | ILIAS open source |
5  +-----------------------------------------------------------------------------+
6  | Copyright (c) 1998-2005 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 
37 {
41  protected $ctrl;
42 
46  protected $rbacsystem;
47 
51  protected $error;
52 
56  protected $access;
57 
61  protected $nav_history;
62 
63  public $tpl;
64  public $lng;
66  public $ref_id;
67 
72  public function __construct()
73  {
74  global $DIC;
75 
76  $this->rbacsystem = $DIC->rbac()->system();
77  $this->error = $DIC["ilErr"];
78  $this->access = $DIC->access();
79  $this->nav_history = $DIC["ilNavigationHistory"];
80  $tpl = $DIC["tpl"];
81  $lng = $DIC->language();
82  $objDefinition = $DIC["objDefinition"];
83  $ilCtrl = $DIC->ctrl();
84  $rbacsystem = $DIC->rbac()->system();
85  $ilErr = $DIC["ilErr"];
86 
87  $lng->loadLanguageModule("content");
88 
89  // check write permission
90  if (!$rbacsystem->checkAccess("write", $_GET["ref_id"])) {
91  $ilErr->raiseError($lng->txt("permission_denied"), $ilErr->MESSAGE);
92  }
93 
94  $this->ctrl = $ilCtrl;
95 
96  //$this->ctrl->saveParameter($this, array("ref_id", "obj_id"));
97  $this->ctrl->saveParameter($this, array("ref_id"));
98 
99  // initiate variables
100  $this->tpl = $tpl;
101  $this->lng = $lng;
102  $this->objDefinition = $objDefinition;
103  $this->ref_id = $_GET["ref_id"];
104  }
105 
109  public function executeCommand()
110  {
111  $tpl = $this->tpl;
113  $ilAccess = $this->access;
114  $ilNavigationHistory = $this->nav_history;
115 
116  $next_class = $this->ctrl->getNextClass($this);
117  $cmd = $this->ctrl->getCmd("");
118 
119  // add entry to navigation history
120  if ($ilAccess->checkAccess("read", "", $_GET["ref_id"])) {
121  $ilCtrl->setParameterByClass("ilobjfilebasedlmgui", "ref_id", $_GET["ref_id"]);
122  $ilNavigationHistory->addItem(
123  $_GET["ref_id"],
124  $ilCtrl->getLinkTargetByClass(array("ilrepositorygui", "ilobjfilebasedlmgui"), "infoScreen"),
125  "htlm"
126  );
127  }
128 
129  switch ($next_class) {
130  case "ilobjfilebasedlmgui":
131  require_once("./Modules/HTMLLearningModule/classes/class.ilObjFileBasedLMGUI.php");
132  $fblm_gui = new ilObjFileBasedLMGUI("", $_GET["ref_id"], true, false);
133  $ilCtrl->forwardCommand($fblm_gui);
134  $tpl->show();
135  break;
136 
137  default:
138  $this->ctrl->setCmdClass("ilobjfilebasedlmgui");
139  $this->ctrl->setCmd("");
140  return $this->executeCommand();
141  break;
142  }
143  }
144 }
global $ilErr
Definition: raiseError.php:16
executeCommand()
execute command
global $DIC
Definition: saml.php:7
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18
Create styles array
The data for the language used.
User Interface class for file based learning modules (HTML)
GUI class for learning module editor.
__construct()
Constructor public.