ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilLMEditorGUI Class Reference

GUI class for learning module editor. More...

+ Collaboration diagram for ilLMEditorGUI:

Public Member Functions

 __construct ()
 Constructor public. More...
 
 showTree ()
 Show tree. More...
 
 main_header ()
 output main header (title and locator) More...
 
 displayLocator ()
 Display locator. More...
 

Protected Member Functions

 checkRequestParameters ()
 Check request parameters. More...
 

Protected Attributes

 $ctrl
 
 $rbacsystem
 
 $nav_history
 
 $error
 
 $help
 
 $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

ilLMEditorGUI: ilObjLearningModuleGUI

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

Constructor & Destructor Documentation

◆ __construct()

ilLMEditorGUI::__construct ( )

Constructor public.

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

References $_GET, $DIC, $ilCtrl, $ilErr, $lng, $objDefinition, $rbacsystem, $tpl, checkRequestParameters(), ilObjectFactory\getInstanceByRefId(), and ilTree\setTableNames().

82  {
83  global $DIC;
84 
85  $this->rbacsystem = $DIC->rbac()->system();
86  $this->nav_history = $DIC["ilNavigationHistory"];
87  $this->error = $DIC["ilErr"];
88  $this->help = $DIC["ilHelp"];
89  $tpl = $DIC["tpl"];
90  $lng = $DIC->language();
91  $objDefinition = $DIC["objDefinition"];
92  $ilCtrl = $DIC->ctrl();
93  $rbacsystem = $DIC->rbac()->system();
94  $ilNavigationHistory = $DIC["ilNavigationHistory"];
95  $ilErr = $DIC["ilErr"];
96 
97  $lng->loadLanguageModule("content");
98  $lng->loadLanguageModule("lm");
99 
100  // check write permission
101  if (!$rbacsystem->checkAccess("write", $_GET["ref_id"])) {
102  $ilErr->raiseError($lng->txt("permission_denied"), $ilErr->MESSAGE);
103  }
104 
105  $this->ctrl = $ilCtrl;
106 
107  $this->ctrl->saveParameter($this, array("ref_id", "transl"));
108 
109  // initiate variables
110  $this->tpl = $tpl;
111  $this->lng = $lng;
112  $this->objDefinition = $objDefinition;
113  $this->ref_id = $_GET["ref_id"];
114  $this->obj_id = $_GET["obj_id"];
115 
116  $this->lm_obj = ilObjectFactory::getInstanceByRefId($this->ref_id);
117  $this->tree = new ilTree($this->lm_obj->getId());
118  $this->tree->setTableNames('lm_tree', 'lm_data');
119  $this->tree->setTreeTablePK("lm_id");
120 
121 
122  $ilNavigationHistory->addItem(
123  $_GET["ref_id"],
124  "ilias.php?baseClass=ilLMEditorGUI&ref_id=" . $_GET["ref_id"],
125  "lm"
126  );
127 
128  $this->checkRequestParameters();
129  }
checkRequestParameters()
Check request parameters.
global $DIC
Definition: saml.php:7
$_GET["client_id"]
$ilErr
Definition: raiseError.php:18
global $ilCtrl
Definition: ilias.php:18
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...
static getInstanceByRefId($a_ref_id, $stop_on_error=true)
get an instance of an Ilias object by reference id
+ Here is the call graph for this function:

Member Function Documentation

◆ checkRequestParameters()

ilLMEditorGUI::checkRequestParameters ( )
protected

Check request parameters.

Exceptions
ilCtrlException
ilException

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

References $_GET, $DIC, Sabre\VObject\$output, $ret, ilLMObject\_lookupContObjID(), displayLocator(), main_header(), and showTree().

Referenced by __construct().

137  {
138  $forwards_to_role = $this->ctrl->checkCurrentPathForClass("ilobjrolegui");
139 
140  if (!$forwards_to_role && $this->obj_id > 0 && ilLMObject::_lookupContObjID($this->obj_id) != $this->lm_obj->getId()) {
141  throw new ilException("Object ID does not match learning module.");
142  }
143  if ($_REQUEST["active_node"] > 0 && ilLMObject::_lookupContObjID((int) $_REQUEST["active_node"]) != $this->lm_obj->getId()) {
144  throw new ilException("Active node does not match learning module.");
145  }
146  }
static _lookupContObjID($a_id)
get learning module / digibook id for lm object
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ displayLocator()

ilLMEditorGUI::displayLocator ( )

Display locator.

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

Referenced by checkRequestParameters().

253  {
254  $this->tpl->setLocator();
255  }
+ Here is the caller graph for this function:

◆ main_header()

ilLMEditorGUI::main_header ( )

output main header (title and locator)

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

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

Referenced by checkRequestParameters().

228  {
229  $this->tpl->getStandardTemplate();
230 
231  // content style
232  $this->tpl->setCurrentBlock("ContentStyle");
233  $this->tpl->setVariable(
234  "LOCATION_CONTENT_STYLESHEET",
235  ilObjStyleSheet::getContentStylePath($this->lm_obj->getStyleSheetId())
236  );
237  $this->tpl->parseCurrentBlock();
238 
239  // syntax style
240  $this->tpl->setCurrentBlock("SyntaxStyle");
241  $this->tpl->setVariable(
242  "LOCATION_SYNTAX_STYLESHEET",
244  );
245  $this->tpl->parseCurrentBlock();
246  }
static getSyntaxStylePath()
get syntax style path
static getContentStylePath($a_style_id, $add_random=true)
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.

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

References $tpl.

Referenced by checkRequestParameters().

214  {
215  $tpl = $this->tpl;
216 
217  include_once("./Modules/LearningModule/classes/class.ilLMEditorExplorerGUI.php");
218  $exp = new ilLMEditorExplorerGUI($this, "showTree", $this->lm_obj);
219  if (!$exp->handleCommand()) {
220  $tpl->setLeftNavContent($exp->getHTML());
221  }
222  }
LM editor explorer GUI class.
+ Here is the caller graph for this function:

Field Documentation

◆ $ctrl

ilLMEditorGUI::$ctrl
protected

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

◆ $error

ilLMEditorGUI::$error
protected

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

◆ $help

ilLMEditorGUI::$help
protected

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

◆ $lm_obj

ilLMEditorGUI::$lm_obj
protected

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

◆ $lng

ilLMEditorGUI::$lng
protected

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

Referenced by __construct().

◆ $nav_history

ilLMEditorGUI::$nav_history
protected

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

◆ $obj_id

ilLMEditorGUI::$obj_id
protected

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

◆ $objDefinition

ilLMEditorGUI::$objDefinition
protected

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

Referenced by __construct().

◆ $rbacsystem

ilLMEditorGUI::$rbacsystem
protected

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

Referenced by __construct().

◆ $ref_id

ilLMEditorGUI::$ref_id
protected

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

◆ $tpl

ilLMEditorGUI::$tpl
protected

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

Referenced by __construct(), and showTree().

◆ $tree

ilLMEditorGUI::$tree
protected

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


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