ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
ilLMEditorGUI Class Reference

GUI class for learning module editor. More...

+ Collaboration diagram for ilLMEditorGUI:

Public Member Functions

 __construct ()
 Constructor 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$

ilLMEditorGUI: ilObjLearningModuleGUI

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

Constructor & Destructor Documentation

◆ __construct()

ilLMEditorGUI::__construct ( )

Constructor public.

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

References $_GET, $ilCtrl, $ilias, $lng, $objDefinition, $tpl, ilLMObject\_lookupContObjID(), array, and ilTree\setTableNames().

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  if ($this->obj_id > 0 && ilLMObject::_lookupContObjID($this->obj_id) != $this->lm_obj->getId())
78  {
79  throw new ilException("Object ID does not match learning module.");
80  }
81  if ($_REQUEST["active_node"] > 0 && ilLMObject::_lookupContObjID((int) $_REQUEST["active_node"]) != $this->lm_obj->getId())
82  {
83  throw new ilException("Active node does not match learning module.");
84  }
85 
86  $ilNavigationHistory->addItem($_GET["ref_id"],
87  "ilias.php?baseClass=ilLMEditorGUI&ref_id=".$_GET["ref_id"], "lm");
88 
89  }
Base class for ILIAS Exception handling.
$_GET["client_id"]
static _lookupContObjID($a_id)
get learning module / digibook id for lm object
global $ilCtrl
Definition: ilias.php:18
redirection script todo: (a better solution should control the processing via a xml file) ...
setTableNames($a_table_tree, $a_table_obj_data, $a_table_obj_reference="")
set table names The primary key of the table containing your object_data must be 'obj_id' You may use...
Tree class data representation in hierachical trees using the Nested Set Model with Gaps by Joe Celco...
Create styles array
The data for the language used.
+ Here is the call graph for this function:

Member Function Documentation

◆ displayLocator()

ilLMEditorGUI::displayLocator ( )

display locator

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

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

Referenced by executeCommand().

205  {
206  global $lng;
207 
208  $this->tpl->addBlockFile("LOCATOR", "locator", "tpl.locator.html", "Services/Locator");
209 
210  $modifier = 1;
211 
212  $locations = $this->ctrl->getLocations();
213 
214  foreach ($locations as $key => $row)
215  {
216  if ($key < count($locations)-$modifier)
217  {
218  $this->tpl->touchBlock("locator_separator");
219  }
220 
221  if ($row["ref_id"]> 0 && $row["ref_id"] != ROOT_FOLDER_ID)
222  {
223  $oid = ilObject::_lookupObjId($row["ref_id"]);
224  $t = ilObject::_lookupType($oid);
225  $this->tpl->setCurrentBlock("locator_img");
226  $this->tpl->setVariable("IMG_SRC",
227  ilUtil::getImagePath("icon_".$t.".svg"));
228  $this->tpl->setVariable("IMG_ALT",
229  $lng->txt("obj_".$type));
230  $this->tpl->parseCurrentBlock();
231  }
232 
233  if ($row["link"] != "")
234  {
235  $this->tpl->setCurrentBlock("locator_item");
236  $this->tpl->setVariable("ITEM", $row["title"]);
237  $this->tpl->setVariable("LINK_ITEM", $row["link"]);
238  if ($row["target"] != "")
239  {
240  $this->tpl->setVariable("LINK_TARGET", ' target="'.$row["target"].'" ');
241  }
242  $this->tpl->parseCurrentBlock();
243  }
244  else
245  {
246  $this->tpl->setCurrentBlock("locator_item");
247  $this->tpl->setVariable("PREFIX", $row["title"]);
248  $this->tpl->parseCurrentBlock();
249  }
250  }
251 
252  $this->tpl->setCurrentBlock("locator");
253  $this->tpl->parseCurrentBlock();
254 
255  }
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
static _lookupObjId($a_id)
static _lookupType($a_id, $a_reference=false)
lookup object type
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ executeCommand()

ilLMEditorGUI::executeCommand ( )

execute command

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

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

95  {
96 
97  global $ilHelp;
98 
99  if ($_GET["to_page"]== 1)
100  {
101  $this->ctrl->setParameterByClass("illmpageobjectgui", "obj_id", $_GET["obj_id"]);
102  $this->ctrl->redirectByClass(array("ilobjlearningmodulegui", "illmpageobjectgui"), "edit");
103  }
104 
105  if ($cmd != "showTree")
106  {
107  $this->showTree();
108  }
109 
110  $next_class = $this->ctrl->getNextClass($this);
111 //echo "lmeditorgui:$next_class:".$this->ctrl->getCmdClass().":$cmd:<br>";
112 
113  if ($next_class == "" && ($cmd != "explorer")
114  && ($cmd != "showImageMap"))
115  {
116  $next_class = "ilobjlearningmodulegui";
117  }
118 
119  // show footer
120  $show_footer = ($cmd == "explorer")
121  ? false
122  : true;
123 
124 // if ($this->lm_obj->getType()
125  switch($next_class)
126  {
127  case "ilobjlearningmodulegui":
128  include_once ("./Modules/LearningModule/classes/class.ilObjLearningModule.php");
129  include_once ("./Modules/LearningModule/classes/class.ilObjLearningModuleGUI.php");
130  $this->main_header($this->lm_obj->getType());
131  $lm_gui = new ilObjLearningModuleGUI("", $_GET["ref_id"], true, false);
132  //$ret =& $lm_gui->executeCommand();
133  $ret = $this->ctrl->forwardCommand($lm_gui);
134  if (strcmp($cmd, "explorer") != 0)
135  {
136  // don't call the locator in the explorer frame
137  // this prevents a lot of log errors
138  // Helmut Schottmüller, 2006-07-21
139  $this->displayLocator();
140  }
141 //echo "*".$this->tpl->get()."*";
142  // (horrible) workaround for preventing template engine
143  // from hiding paragraph text that is enclosed
144  // in curly brackets (e.g. "{a}", see ilPageObjectGUI::showPage())
145 // $this->tpl->fillTabs();
146  $output = $this->tpl->get("DEFAULT", true, true, $show_footer,true);
147  $output = str_replace("&#123;", "{", $output);
148  $output = str_replace("&#125;", "}", $output);
149  header('Content-type: text/html; charset=UTF-8');
150  echo $output;
151  break;
152 
153  default:
154  $ret = $this->$cmd();
155  break;
156  }
157  }
main_header($a_type)
output main header (title and locator)
$_GET["client_id"]
$cmd
Definition: sahs_server.php:35
Class ilLearningModuleGUI.
if(!is_dir( $entity_dir)) exit("Fatal Error ([A-Za-z0-9]+)\+" &#(? foreach( $entity_files as $file) $output
Add a drawing to the header
Definition: 04printing.php:69
displayLocator()
display locator
Create styles array
The data for the language used.
$ret
Definition: parser.php:6
showTree()
Show tree.
+ Here is the call graph for this function:

◆ main_header()

ilLMEditorGUI::main_header (   $a_type)

output main header (title and locator)

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

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

Referenced by executeCommand().

181  {
182  global $lng;
183 
184  $this->tpl->getStandardTemplate();
185 
186  // content style
187  $this->tpl->setCurrentBlock("ContentStyle");
188  $this->tpl->setVariable("LOCATION_CONTENT_STYLESHEET",
189  ilObjStyleSheet::getContentStylePath($this->lm_obj->getStyleSheetId()));
190  $this->tpl->parseCurrentBlock();
191 
192  // syntax style
193  $this->tpl->setCurrentBlock("SyntaxStyle");
194  $this->tpl->setVariable("LOCATION_SYNTAX_STYLESHEET",
196  $this->tpl->parseCurrentBlock();
197 
198  }
static getSyntaxStylePath()
get syntax style path
static getContentStylePath($a_style_id)
get content style path
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showTree()

ilLMEditorGUI::showTree ( )

Show tree.

Parameters

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

References $tpl.

Referenced by executeCommand().

166  {
167  global $tpl;
168 
169  include_once("./Modules/LearningModule/classes/class.ilLMEditorExplorerGUI.php");
170  $exp = new ilLMEditorExplorerGUI($this, "showTree", $this->lm_obj);
171  if (!$exp->handleCommand())
172  {
173  $tpl->setLeftNavContent($exp->getHTML());
174  }
175  }
LM editor explorer GUI class.
+ Here is the caller graph for this function:

Field Documentation

◆ $ilias

ilLMEditorGUI::$ilias

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

Referenced by __construct().

◆ $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 __construct(), displayLocator(), 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 __construct().

◆ $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 __construct(), 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: