ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
ilLMEditorGUI Class Reference

GUI class for learning module editor. More...

+ Collaboration diagram for ilLMEditorGUI:

Public Member Functions

 ilLMEditorGUI ()
 Constructor @access public. More...
 
executeCommand ()
 execute command More...
 
 showTree ()
 Show tree. More...
 
 main_header ($a_type)
 output main header (title and locator) More...
 
 displayLocator ()
 display locator More...
 

Data Fields

 $ilias
 
 $tpl
 
 $lng
 
 $objDefinition
 
 $ref_id
 
 $lm_obj
 
 $tree
 
 $obj_id
 

Detailed Description

GUI class for learning module editor.

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
$Id$

@ilCtrl_Calls ilLMEditorGUI: ilObjDlBookGUI, ilObjLearningModuleGUI

Definition at line 22 of file class.ilLMEditorGUI.php.

Member Function Documentation

◆ displayLocator()

ilLMEditorGUI::displayLocator ( )

display locator

Definition at line 234 of file class.ilLMEditorGUI.php.

235 {
236 global $lng;
237
238 $this->tpl->addBlockFile("LOCATOR", "locator", "tpl.locator.html", "Services/Locator");
239
240 $modifier = 1;
241
242 $locations = $this->ctrl->getLocations();
243
244 foreach ($locations as $key => $row)
245 {
246 if ($key < count($locations)-$modifier)
247 {
248 $this->tpl->touchBlock("locator_separator");
249 }
250
251 if ($row["ref_id"]> 0 && $row["ref_id"] != ROOT_FOLDER_ID)
252 {
253 $oid = ilObject::_lookupObjId($row["ref_id"]);
255 $this->tpl->setCurrentBlock("locator_img");
256 $this->tpl->setVariable("IMG_SRC",
257 ilUtil::getImagePath("icon_".$t.".svg"));
258 $this->tpl->setVariable("IMG_ALT",
259 $lng->txt("obj_".$type));
260 $this->tpl->parseCurrentBlock();
261 }
262
263 if ($row["link"] != "")
264 {
265 $this->tpl->setCurrentBlock("locator_item");
266 $this->tpl->setVariable("ITEM", $row["title"]);
267 $this->tpl->setVariable("LINK_ITEM", $row["link"]);
268 if ($row["target"] != "")
269 {
270 $this->tpl->setVariable("LINK_TARGET", ' target="'.$row["target"].'" ');
271 }
272 $this->tpl->parseCurrentBlock();
273 }
274 else
275 {
276 $this->tpl->setCurrentBlock("locator_item");
277 $this->tpl->setVariable("PREFIX", $row["title"]);
278 $this->tpl->parseCurrentBlock();
279 }
280 }
281
282 $this->tpl->setCurrentBlock("locator");
283 $this->tpl->parseCurrentBlock();
284
285 }
static _lookupObjId($a_id)
static _lookupType($a_id, $a_reference=false)
lookup object type
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)

References $lng, $row, $t, ilObject\_lookupObjId(), ilObject\_lookupType(), and ilUtil\getImagePath().

Referenced by executeCommand().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ executeCommand()

& ilLMEditorGUI::executeCommand ( )

execute command

Definition at line 85 of file class.ilLMEditorGUI.php.

86 {
87
88 global $ilHelp;
89
90 if ($_GET["to_page"]== 1)
91 {
92 $this->ctrl->setParameterByClass("illmpageobjectgui", "obj_id", $_GET["obj_id"]);
93 $this->ctrl->redirectByClass(array("ilobjlearningmodulegui", "illmpageobjectgui"), "edit");
94 }
95
96 if ($cmd != "showTree")
97 {
98 $this->showTree();
99 }
100
101 $next_class = $this->ctrl->getNextClass($this);
102//echo "lmeditorgui:$next_class:".$this->ctrl->getCmdClass().":$cmd:<br>";
103
104 if ($next_class == "" && ($cmd != "explorer")
105 && ($cmd != "showImageMap"))
106 {
107 switch($this->lm_obj->getType())
108 {
109 case "lm":
110 //$this->ctrl->setCmdClass("ilObjLearningModuleGUI");
111 $next_class = "ilobjlearningmodulegui";
112 break;
113
114 case "dbk":
115 //$this->ctrl->setCmdClass("ilObjDlBookGUI");
116 $next_class = "ilobjdlbookgui";
117 break;
118 }
119 //$next_class = $this->ctrl->getNextClass($this);
120 }
121
122 // show footer
123 $show_footer = ($cmd == "explorer")
124 ? false
125 : true;
126
127// if ($this->lm_obj->getType()
128 switch($next_class)
129 {
130 case "ilobjdlbookgui":
131 include_once ("./Modules/LearningModule/classes/class.ilObjDlBook.php");
132 include_once ("./Modules/LearningModule/classes/class.ilObjDlBookGUI.php");
133
134 $this->main_header($this->lm_obj->getType());
135 $book_gui =& new ilObjDlBookGUI("", $_GET["ref_id"], true, false);
136 //$ret =& $book_gui->executeCommand();
137 $ret =& $this->ctrl->forwardCommand($book_gui);
138 if (strcmp($cmd, "explorer") != 0)
139 {
140 // don't call the locator in the explorer frame
141 // this prevents a lot of log errors
142 // Helmut Schottmüller, 2006-07-21
143 $this->displayLocator();
144 }
145
146 // (horrible) workaround for preventing template engine
147 // from hiding paragraph text that is enclosed
148 // in curly brackets (e.g. "{a}", see ilPageObjectGUI::showPage())
149// $this->tpl->fillTabs();
150 $output = $this->tpl->get("DEFAULT", true, true, $show_footer,true);
151 $output = str_replace("&#123;", "{", $output);
152 $output = str_replace("&#125;", "}", $output);
153 header('Content-type: text/html; charset=UTF-8');
154 echo $output;
155 break;
156
157 case "ilobjlearningmodulegui":
158 include_once ("./Modules/LearningModule/classes/class.ilObjLearningModule.php");
159 include_once ("./Modules/LearningModule/classes/class.ilObjLearningModuleGUI.php");
160 $this->main_header($this->lm_obj->getType());
161 $lm_gui =& new ilObjLearningModuleGUI("", $_GET["ref_id"], true, false);
162 //$ret =& $lm_gui->executeCommand();
163 $ret =& $this->ctrl->forwardCommand($lm_gui);
164 if (strcmp($cmd, "explorer") != 0)
165 {
166 // don't call the locator in the explorer frame
167 // this prevents a lot of log errors
168 // Helmut Schottmüller, 2006-07-21
169 $this->displayLocator();
170 }
171//echo "*".$this->tpl->get()."*";
172 // (horrible) workaround for preventing template engine
173 // from hiding paragraph text that is enclosed
174 // in curly brackets (e.g. "{a}", see ilPageObjectGUI::showPage())
175// $this->tpl->fillTabs();
176 $output = $this->tpl->get("DEFAULT", true, true, $show_footer,true);
177 $output = str_replace("&#123;", "{", $output);
178 $output = str_replace("&#125;", "}", $output);
179 header('Content-type: text/html; charset=UTF-8');
180 echo $output;
181 break;
182
183 default:
184 $ret = $this->$cmd();
185 break;
186 }
187 }
$_GET["client_id"]
displayLocator()
display locator
main_header($a_type)
output main header (title and locator)
Class ilObjDlBookGUI.
Class ilLearningModuleGUI.
$cmd
Definition: sahs_server.php:35

References $_GET, $cmd, $ret, displayLocator(), main_header(), and showTree().

+ Here is the call graph for this function:

◆ ilLMEditorGUI()

ilLMEditorGUI::ilLMEditorGUI ( )

Constructor @access public.

Definition at line 43 of file class.ilLMEditorGUI.php.

44 {
46 $rbacsystem, $ilNavigationHistory;
47
48 // init module (could be done in ilctrl)
49 //define("ILIAS_MODULE", "content");
50 $lng->loadLanguageModule("content");
51
52 // check write permission
53 if (!$rbacsystem->checkAccess("write", $_GET["ref_id"]))
54 {
55 $ilias->raiseError($lng->txt("permission_denied"),$ilias->error_obj->MESSAGE);
56 }
57
58
59 $this->ctrl =& $ilCtrl;
60
61 //$this->ctrl->saveParameter($this, array("ref_id", "obj_id"));
62 $this->ctrl->saveParameter($this, array("ref_id", "transl"));
63
64 // initiate variables
65 $this->ilias =& $ilias;
66 $this->tpl =& $tpl;
67 $this->lng =& $lng;
68 $this->objDefinition =& $objDefinition;
69 $this->ref_id = $_GET["ref_id"];
70 $this->obj_id = $_GET["obj_id"];
71
72 $this->lm_obj =& $this->ilias->obj_factory->getInstanceByRefId($this->ref_id);
73 $this->tree = new ilTree($this->lm_obj->getId());
74 $this->tree->setTableNames('lm_tree','lm_data');
75 $this->tree->setTreeTablePK("lm_id");
76
77 $ilNavigationHistory->addItem($_GET["ref_id"],
78 "ilias.php?baseClass=ilLMEditorGUI&ref_id=".$_GET["ref_id"], "lm");
79
80 }
Tree class data representation in hierachical trees using the Nested Set Model with Gaps by Joe Celco...
global $ilCtrl
Definition: ilias.php:18
redirection script todo: (a better solution should control the processing via a xml file)

References $_GET, $ilCtrl, $ilias, $lng, $objDefinition, and $tpl.

◆ main_header()

ilLMEditorGUI::main_header (   $a_type)

output main header (title and locator)

Definition at line 210 of file class.ilLMEditorGUI.php.

211 {
212 global $lng;
213
214 $this->tpl->getStandardTemplate();
215
216 // content style
217 $this->tpl->setCurrentBlock("ContentStyle");
218 $this->tpl->setVariable("LOCATION_CONTENT_STYLESHEET",
219 ilObjStyleSheet::getContentStylePath($this->lm_obj->getStyleSheetId()));
220 $this->tpl->parseCurrentBlock();
221
222 // syntax style
223 $this->tpl->setCurrentBlock("SyntaxStyle");
224 $this->tpl->setVariable("LOCATION_SYNTAX_STYLESHEET",
226 $this->tpl->parseCurrentBlock();
227
228 }
getContentStylePath($a_style_id)
get content style path
getSyntaxStylePath()
get syntax style path

References $lng, ilObjStyleSheet\getContentStylePath(), and ilObjStyleSheet\getSyntaxStylePath().

Referenced by executeCommand().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showTree()

ilLMEditorGUI::showTree ( )

Show tree.

Parameters

return

Definition at line 195 of file class.ilLMEditorGUI.php.

196 {
197 global $tpl;
198
199 include_once("./Modules/LearningModule/classes/class.ilLMEditorExplorerGUI.php");
200 $exp = new ilLMEditorExplorerGUI($this, "showTree", $this->lm_obj);
201 if (!$exp->handleCommand())
202 {
203 $tpl->setLeftNavContent($exp->getHTML());
204 }
205 }
LM editor explorer GUI class.

References $tpl.

Referenced by executeCommand().

+ Here is the caller graph for this function:

Field Documentation

◆ $ilias

ilLMEditorGUI::$ilias

Definition at line 29 of file class.ilLMEditorGUI.php.

Referenced by ilLMEditorGUI().

◆ $lm_obj

ilLMEditorGUI::$lm_obj

Definition at line 34 of file class.ilLMEditorGUI.php.

◆ $lng

ilLMEditorGUI::$lng

Definition at line 31 of file class.ilLMEditorGUI.php.

Referenced by displayLocator(), ilLMEditorGUI(), and main_header().

◆ $obj_id

ilLMEditorGUI::$obj_id

Definition at line 37 of file class.ilLMEditorGUI.php.

◆ $objDefinition

ilLMEditorGUI::$objDefinition

Definition at line 32 of file class.ilLMEditorGUI.php.

Referenced by ilLMEditorGUI().

◆ $ref_id

ilLMEditorGUI::$ref_id

Definition at line 33 of file class.ilLMEditorGUI.php.

◆ $tpl

ilLMEditorGUI::$tpl

Definition at line 30 of file class.ilLMEditorGUI.php.

Referenced by ilLMEditorGUI(), and showTree().

◆ $tree

ilLMEditorGUI::$tree

Definition at line 36 of file class.ilLMEditorGUI.php.


The documentation for this class was generated from the following file: