ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
class.ilHTLMPresentationGUI.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 $access;
47
51 protected $error;
52
56 protected $nav_history;
57
58 public $tpl;
59 public $lng;
61 public $ref_id;
62
67 public function __construct()
68 {
69 global $DIC;
70
71 $this->access = $DIC->access();
72 $this->error = $DIC["ilErr"];
73 $this->nav_history = $DIC["ilNavigationHistory"];
74 $tpl = $DIC["tpl"];
75 $lng = $DIC->language();
76 $objDefinition = $DIC["objDefinition"];
77 $ilCtrl = $DIC->ctrl();
78 $ilAccess = $DIC->access();
79 $ilErr = $DIC["ilErr"];
80
81 $lng->loadLanguageModule("content");
82
83 // check write permission
84 if (!$ilAccess->checkAccess("read", "", $_GET["ref_id"])) {
85 $ilErr->raiseError($lng->txt("permission_denied"), $ilErr->MESSAGE);
86 }
87
88
89 $this->ctrl = $ilCtrl;
90
91 //$this->ctrl->saveParameter($this, array("ref_id", "obj_id"));
92 $this->ctrl->saveParameter($this, array("ref_id"));
93
94 // initiate variables
95 $this->tpl = $tpl;
96 $this->lng = $lng;
97 $this->objDefinition = $objDefinition;
98 $this->ref_id = $_GET["ref_id"];
99 }
100
104 public function executeCommand()
105 {
108 $ilAccess = $this->access;
109 $ilNavigationHistory = $this->nav_history;
110
111 // add entry to navigation history
112 if ($ilAccess->checkAccess("read", "", $_GET["ref_id"])) {
113 $ilCtrl->setParameterByClass("ilobjfilebasedlmgui", "ref_id", $_GET["ref_id"]);
114 $ilNavigationHistory->addItem(
115 $_GET["ref_id"],
116 $ilCtrl->getLinkTargetByClass(array("ilrepositorygui", "ilobjfilebasedlmgui"), "infoScreen"),
117 "htlm"
118 );
119 }
120
121 $next_class = $this->ctrl->getNextClass($this);
122 $cmd = $this->ctrl->getCmd("");
123
124 switch ($next_class) {
125 case "ilobjfilebasedlmgui":
126 require_once("./Modules/HTMLLearningModule/classes/class.ilObjFileBasedLMGUI.php");
127 $fblm_gui = new ilObjFileBasedLMGUI("", $_GET["ref_id"], true, false);
128 $ilCtrl->forwardCommand($fblm_gui);
129 $tpl->show();
130 break;
131
132 default:
133 $this->ctrl->setCmdClass("ilobjfilebasedlmgui");
134 $this->ctrl->setCmd("showLearningModule");
135 return $this->executeCommand();
136 break;
137 }
138 }
139}
$_GET["client_id"]
An exception for terminatinating execution or to throw for unit testing.
error($a_errmsg)
set error message @access public
GUI class for html lm presentation.
__construct()
Constructor @access public.
User Interface class for file based learning modules (HTML)
global $ilCtrl
Definition: ilias.php:18
global $ilErr
Definition: raiseError.php:16
global $DIC
Definition: saml.php:7