ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilObjStudyProgrammeTreeExplorerGUI Class Reference

Class ilStudyProgrammeTreeGUI ilObjStudyProgrammeTreeExplorerGUI generates the tree output for StudyProgrammes This class builds the tree with drag & drop functionality and some additional buttons which triggers bootstrap-modals. More...

+ Inheritance diagram for ilObjStudyProgrammeTreeExplorerGUI:
+ Collaboration diagram for ilObjStudyProgrammeTreeExplorerGUI:

Public Member Functions

 __construct ($a_tree_root_id, $modal_id, $a_expl_id, $a_parent_obj, $a_parent_cmd)
 
 getNodeContent ($node)
 Return node element. More...
 
 getRootNode ()
 Return root node of tree. More...
 
 getNodeIcon ($a_node)
 Get node icon Return custom icon of OrgUnit type if existing. More...
 
 getNodeHref ($node)
 Returns node link target. More...
 
 getChildsOfNode ($a_parent_node_id)
 Get childs of node. More...
 
 isNodeClickable ($a_node)
 Is node clickable? More...
 
 getNodeId ($a_node)
 Get id of a node. More...
 
 listItemStart ($tpl, $a_node)
 List item start. More...
 
 getHTML ()
 Returns the output of the complete tree There are added some additional javascripts before output the parent::getHTML() More...
 
 closeCertainNode ($node_id)
 Closes certain node in the tree session The open nodes of a tree are stored in a session. More...
 
 openCertainNode ($node_id)
 Open certain node in the tree session The open nodes of a tree are stored in a session. More...
 
 addJsConf ($key, $value)
 Adds configuration to the study-programme-tree jquery plugin. More...
 
 getJsConf ($key)
 Returns setting of the study-programme-tree. More...
 
- Public Member Functions inherited from ilExplorerBaseGUI
 __construct ($a_expl_id, $a_parent_obj, $a_parent_cmd)
 Constructor. More...
 
 setMainTemplate (ilTemplate $a_main_tpl=null)
 Set main template (that is responsible for adding js/css) More...
 
 getRootNode ()
 Get root node. More...
 
 getChildsOfNode ($a_parent_node_id)
 Get childs of node. More...
 
 getNodeContent ($a_node)
 Get content of a node. More...
 
 getNodeId ($a_node)
 Get id of a node. More...
 
 getNodeHref ($a_node)
 Get href for node. More...
 
 nodeHasVisibleChilds ($a_node)
 Node has childs? More...
 
 sortChilds ($a_childs, $a_parent_node_id)
 Sort childs. More...
 
 getNodeIcon ($a_node)
 Get node icon path. More...
 
 getNodeIconAlt ($a_node)
 Get node icon alt attribute. More...
 
 getNodeTarget ($a_node)
 Get node target (frame) attribute. More...
 
 getNodeOnClick ($a_node)
 Get node onclick attribute. More...
 
 isNodeVisible ($a_node)
 Is node visible? More...
 
 isNodeHighlighted ($a_node)
 Is node highlighted? More...
 
 isNodeClickable ($a_node)
 Is node clickable? More...
 
 getId ()
 Get id of explorer element. More...
 
 setSkipRootNode ($a_val)
 Set skip root node. More...
 
 getSkipRootNode ()
 Get skip root node. More...
 
 setAjax ($a_val)
 Set ajax. More...
 
 getAjax ()
 Get ajax. More...
 
 setSecondaryHighlightedNodes ($a_val)
 Set secondary (background) highlighted nodes. More...
 
 getSecondaryHighlightedNodes ()
 Get secondary (background) highlighted nodes. More...
 
 setNodeOpen ($a_id)
 Set node to be opened (additional custom opened node, not standard expand behaviour) More...
 
 setSelectMode ($a_postvar, $a_multi=false)
 Set select mode (to deactivate, pass an empty string as postvar) More...
 
 setNodeSelected ($a_id)
 Set node to be opened (additional custom opened node, not standard expand behaviour) More...
 
 setOfflineMode ($a_val)
 Set offline mode. More...
 
 getOfflineMode ()
 Get offline mode. More...
 
 handleCommand ()
 Handle explorer internal command. More...
 
 getContainerId ()
 Get container id. More...
 
 openNode ()
 Open node. More...
 
 closeNode ()
 Close node. More...
 
 getNodeAsync ()
 Get node asynchronously. More...
 
 beforeRendering ()
 Before rendering. More...
 
 getOnLoadCode ()
 Get on load code. More...
 
 getHTML ()
 Get HTML. More...
 
 renderNode ($a_node, $tpl)
 Render node. More...
 
 renderChilds ($a_node_id, $tpl)
 Render childs. More...
 
 getDomNodeIdForNodeId ($a_node_id)
 Get DOM node id for node id. More...
 
 getNodeIdForDomNodeId ($a_dom_node_id)
 Get node id for dom node id. More...
 
 listItemStart ($tpl, $a_node)
 List item start. More...
 
 listItemEnd ($tpl)
 List item end. More...
 
 listStart ($tpl)
 List start. More...
 
 listEnd ($tpl)
 List end. More...
 
 isNodeOnclickEnabled ()
 
 setNodeOnclickEnabled ($nodeOnclickEnabled)
 
 isEnableDnd ()
 
 setEnableDnd ($enable_dnd)
 Enable Drag & Drop functionality. More...
 

Protected Member Functions

 getNodeTitleClasses ($node_config)
 Returns array with all css classes of the title node element. More...
 
 parseStudyProgrammeNodeButtons ($node, $node_config, $tpl)
 Generates the buttons for a study-programme node. More...
 
 parseLeafNodeButtons ($node, $node_config, $tpl)
 Generates the buttons for a study programme leaf. More...
 
 getNodeTemplateInstance ()
 Factory method for a new instance of a node template. More...
 
 formatPointValue ($points)
 Returns formatted point value. More...
 
 getNodeButtonActionLink ($target_class, $cmd, $params, $content, $async=true)
 Generate link-element. More...
 
 checkAccess ($permission, $ref_id)
 Checks permission of current tree or certain child of it. More...
 
 checkAccessOrFail ($permission, $ref_id)
 Checks permission of a object and throws an exception if they are not granted. More...
 
- Protected Member Functions inherited from ilExplorerBaseGUI
 isNodeSelectable ($a_node)
 Is node selectable? More...
 
 getNodeToggleOnClick ($a_node)
 Get onclick attribute for node toggling. More...
 
 getSelectOnClick ($a_node)
 Get onclick attribute for selecting radio/checkbox. More...
 
 getJSTreePlugins ()
 

Protected Attributes

 $js_study_programme_path = "./Modules/StudyProgramme/templates/js/ilStudyProgramme.js"
 
 $css_study_programme_path = "./Modules/StudyProgramme/templates/css/ilStudyProgrammeTree.css"
 
 $tree_root_id
 
 $access
 
 $lng
 
 $tpl
 
 $toolbar
 
 $ctrl
 
 $modal_id
 
 $js_conf
 
 $class_configuration
 
 $node_template
 
- Protected Attributes inherited from ilExplorerBaseGUI
 $log
 
 $ctrl
 
 $tpl
 
 $skip_root_node = false
 
 $ajax = false
 
 $custom_open_nodes = array()
 
 $selected_nodes = array()
 
 $select_postvar = ""
 
 $offline_mode = false
 
 $sec_highl_nodes = array()
 
 $enable_dnd = false
 

Additional Inherited Members

- Static Public Member Functions inherited from ilExplorerBaseGUI
static getLocalExplorerJsPath ()
 Get local path of explorer js. More...
 
static getLocalJsTreeJsPath ()
 Get local path of jsTree js. More...
 
static createHTMLExportDirs ($a_target_dir)
 Create html export directories. More...
 
static init ($a_main_tpl=null)
 Init JS. More...
 
- Static Protected Attributes inherited from ilExplorerBaseGUI
static $js_tree_path = "./libs/bower/bower_components/jstree/jquery.jstree.js"
 
static $js_expl_path = "./Services/UIComponent/Explorer2/js/Explorer2.js"
 

Detailed Description

Class ilStudyProgrammeTreeGUI ilObjStudyProgrammeTreeExplorerGUI generates the tree output for StudyProgrammes This class builds the tree with drag & drop functionality and some additional buttons which triggers bootstrap-modals.

Author
Michael Herren mh@st.nosp@m.uder.nosp@m.-raim.nosp@m.ann..nosp@m.ch
Version
1.0.0

Definition at line 16 of file class.ilObjStudyProgrammeTreeExplorerGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilObjStudyProgrammeTreeExplorerGUI::__construct (   $a_tree_root_id,
  $modal_id,
  $a_expl_id,
  $a_parent_obj,
  $a_parent_cmd 
)
Parameters
$a_expl_id
$a_parent_obj
$a_parent_cmd
$a_tree

Definition at line 87 of file class.ilObjStudyProgrammeTreeExplorerGUI.php.

References $DIC, $ilCtrl, $lng, $modal_id, $tpl, array, checkAccess(), ilExplorerBaseGUI\setAjax(), and ilExplorerBaseGUI\setEnableDnd().

88  {
89  global $DIC;
90  $ilAccess = $DIC['ilAccess'];
91  $lng = $DIC['lng'];
92  $tpl = $DIC['tpl'];
93  $ilToolbar = $DIC['ilToolbar'];
94  $ilCtrl = $DIC['ilCtrl'];
95 
96  parent::__construct($a_expl_id, $a_parent_obj, $a_parent_cmd);
97 
98  $this->tree_root_id = $a_tree_root_id;
99 
100  $this->access = $ilAccess;
101  $this->lng = $lng;
102  $this->tpl = $tpl;
103  $this->toolbar = $ilToolbar;
104  $this->ctrl = $ilCtrl;
105  $this->modal_id = $modal_id;
106  $this->js_conf = array();
107 
108  $lng->loadLanguageModule("prg");
109 
110  $this->setAjax(true);
111 
112  if ($this->checkAccess('write', $a_tree_root_id)) {
113  $this->setEnableDnd(true);
114  }
115  }
checkAccess($permission, $ref_id)
Checks permission of current tree or certain child of it.
global $DIC
Definition: saml.php:7
global $ilCtrl
Definition: ilias.php:18
setEnableDnd($enable_dnd)
Enable Drag & Drop functionality.
Create styles array
The data for the language used.
+ Here is the call graph for this function:

Member Function Documentation

◆ addJsConf()

ilObjStudyProgrammeTreeExplorerGUI::addJsConf (   $key,
  $value 
)

Adds configuration to the study-programme-tree jquery plugin.

Parameters
array$js_conf

Definition at line 538 of file class.ilObjStudyProgrammeTreeExplorerGUI.php.

References $key.

539  {
540  $this->js_conf[$key] = $value;
541  }
$key
Definition: croninfo.php:18

◆ checkAccess()

ilObjStudyProgrammeTreeExplorerGUI::checkAccess (   $permission,
  $ref_id 
)
protected

Checks permission of current tree or certain child of it.

Parameters
string$permission
null$ref_id
Returns
bool

Definition at line 510 of file class.ilObjStudyProgrammeTreeExplorerGUI.php.

Referenced by __construct(), checkAccessOrFail(), getChildsOfNode(), and getNodeContent().

511  {
512  $checker = $this->access->checkAccess($permission, '', $ref_id);
513 
514  return $checker;
515  }
+ Here is the caller graph for this function:

◆ checkAccessOrFail()

ilObjStudyProgrammeTreeExplorerGUI::checkAccessOrFail (   $permission,
  $ref_id 
)
protected

Checks permission of a object and throws an exception if they are not granted.

Parameters
string$permission
null$ref_id
Exceptions
ilException

Definition at line 526 of file class.ilObjStudyProgrammeTreeExplorerGUI.php.

References checkAccess().

527  {
528  if (!$this->checkAccess($permission, $ref_id)) {
529  throw new ilException("You have no permission for " . $permission . " Object with ref_id " . $ref_id . "!");
530  }
531  }
checkAccess($permission, $ref_id)
Checks permission of current tree or certain child of it.
+ Here is the call graph for this function:

◆ closeCertainNode()

ilObjStudyProgrammeTreeExplorerGUI::closeCertainNode (   $node_id)

Closes certain node in the tree session The open nodes of a tree are stored in a session.

This function closes a certain node by its id.

Parameters
int$node_id

Definition at line 477 of file class.ilObjStudyProgrammeTreeExplorerGUI.php.

478  {
479  if (in_array($node_id, $this->open_nodes)) {
480  $k = array_search($node_id, $this->open_nodes);
481  unset($this->open_nodes[$k]);
482  }
483  $this->store->set("on_" . $this->id, serialize($this->open_nodes));
484  }

◆ formatPointValue()

ilObjStudyProgrammeTreeExplorerGUI::formatPointValue (   $points)
protected

Returns formatted point value.

Parameters
$points
Returns
string

Definition at line 268 of file class.ilObjStudyProgrammeTreeExplorerGUI.php.

Referenced by getNodeContent().

269  {
270  return '(' . $points . " " . $this->lng->txt('prg_points') . ')';
271  }
+ Here is the caller graph for this function:

◆ getChildsOfNode()

ilObjStudyProgrammeTreeExplorerGUI::getChildsOfNode (   $a_parent_node_id)

Get childs of node.

Parameters
$a_parent_node_idilAccess

Definition at line 378 of file class.ilObjStudyProgrammeTreeExplorerGUI.php.

References $DIC, array, checkAccess(), and ilObjectFactoryWrapper\singleton().

379  {
380  global $DIC;
381  $ilAccess = $DIC['ilAccess'];
382 
383  $parent_obj = ilObjectFactoryWrapper::singleton()->getInstanceByRefId($a_parent_node_id);
384 
385  $children_with_permission = array();
386 
387  // its currently only possible to have children on StudyProgrammes
388  if ($parent_obj instanceof ilObjStudyProgramme) {
389  $children = ($parent_obj->hasChildren())? $parent_obj->getChildren() : $parent_obj->getLPChildren();
390 
391  if (is_array($children)) {
392  foreach ($children as $node) {
393  if ($this->checkAccess('visible', $node->getRefId())) {
394  $children_with_permission[] = $node;
395  }
396  }
397  }
398  }
399 
400  return $children_with_permission;
401  }
checkAccess($permission, $ref_id)
Checks permission of current tree or certain child of it.
global $DIC
Definition: saml.php:7
Class ilObjStudyProgramme.
Create styles array
The data for the language used.
+ Here is the call graph for this function:

◆ getHTML()

ilObjStudyProgrammeTreeExplorerGUI::getHTML ( )

Returns the output of the complete tree There are added some additional javascripts before output the parent::getHTML()

Returns
string

Definition at line 460 of file class.ilObjStudyProgrammeTreeExplorerGUI.php.

References ilExplorerBaseGUI\getContainerId().

461  {
462  $this->tpl->addJavascript($this->js_study_programme_path);
463  $this->tpl->addCss($this->css_study_programme_path);
464 
465  $this->tpl->addOnLoadCode('$("#' . $this->getContainerId() . '").study_programme_tree(' . json_encode($this->js_conf) . ');');
466 
467  return parent::getHTML();
468  }
getContainerId()
Get container id.
+ Here is the call graph for this function:

◆ getJsConf()

ilObjStudyProgrammeTreeExplorerGUI::getJsConf (   $key)

Returns setting of the study-programme-tree.

Parameters
array$js_conf

Definition at line 548 of file class.ilObjStudyProgrammeTreeExplorerGUI.php.

References $key.

549  {
550  return $this->js_conf[$key];
551  }
$key
Definition: croninfo.php:18

◆ getNodeButtonActionLink()

ilObjStudyProgrammeTreeExplorerGUI::getNodeButtonActionLink (   $target_class,
  $cmd,
  $params,
  $content,
  $async = true 
)
protected

Generate link-element.

Parameters
$target_class
$cmd
$paramsurl-params send to the
$content
bool$async
Returns
string

Definition at line 284 of file class.ilObjStudyProgrammeTreeExplorerGUI.php.

References $params, $tpl, array, and getNodeTemplateInstance().

Referenced by parseLeafNodeButtons(), and parseStudyProgrammeNodeButtons().

285  {
286  foreach ($params as $param_name=>$param_value) {
287  $this->ctrl->setParameterByClass($target_class, $param_name, $param_value);
288  }
289 
290  $tpl = $this->getNodeTemplateInstance();
291  //$tpl->free();
292  $tpl->setCurrentBlock('tree-button-block');
293 
294  $classes = array($this->class_configuration['node']['node_buttons']);
295  $classes[] = 'cmd_' . $cmd;
296 
297  $tpl->setVariable('LINK_HREF', $this->ctrl->getLinkTargetByClass($target_class, $cmd, '', true, false));
298  $tpl->setVariable('LINK_CLASSES', implode(' ', $classes));
299 
300  if ($async) {
301  $tpl->touchBlock('enable-async-link');
302  $tpl->setVariable('LINK_DATA_TARGET', '#' . $this->modal_id);
303  }
304 
305  $tpl->setVariable('LINK_CONTENT', $content);
306 
307  //$tpl->parseCurrentBlock('tree-button-block');
308 
309  return $tpl->get();
310  }
$params
Definition: disable.php:11
getNodeTemplateInstance()
Factory method for a new instance of a node template.
Create styles array
The data for the language used.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getNodeContent()

ilObjStudyProgrammeTreeExplorerGUI::getNodeContent (   $node)

Return node element.

Parameters
ilObjStudyProgramme | ilObject$node
Returns
string

Definition at line 125 of file class.ilObjStudyProgrammeTreeExplorerGUI.php.

References $_GET, $DIC, $lng, $tpl, array, checkAccess(), formatPointValue(), getNodeTemplateInstance(), getNodeTitleClasses(), parseLeafNodeButtons(), and parseStudyProgrammeNodeButtons().

126  {
127  global $DIC;
128  $lng = $DIC['lng'];
129  $ilAccess = $DIC['ilAccess'];
130 
131  $current_ref_id = (isset($_GET["ref_id"]))? $_GET["ref_id"] : -1;
132 
133  $is_current_node = ($node->getRefId() == $current_ref_id);
134  $is_study_programme = ($node instanceof ilObjStudyProgramme);
135  $is_root_node = ($is_study_programme && $node->getRoot() == null);
136 
137  // show delete only on not current elements and not root
138  $is_delete_enabled = ($is_study_programme && ($is_current_node || $is_root_node))? false : $this->checkAccess("delete", $current_ref_id);
139 
140  $is_creation_enabled = ($this->checkAccess("create", $current_ref_id));
141 
142  $node_config = array(
143  'current_ref_id' =>$current_ref_id,
144  'is_current_node' => $is_current_node,
145  'is_delete_enabled' => $is_delete_enabled,
146  'is_creation_enabled' => $is_creation_enabled,
147  'is_study_programme' => $is_study_programme,
148  'is_root_node' => $is_root_node
149  );
150 
151  // TODO: find way to remove a-tag around the content, to create valid html
152  $tpl = $this->getNodeTemplateInstance();
153 
154  $tpl->setCurrentBlock('node-content-block');
155  $tpl->setVariable('NODE_TITLE_CLASSES', implode(' ', $this->getNodeTitleClasses($node_config)));
156  $tpl->setVariable('NODE_TITLE', $node->getTitle());
157 
158  if ($is_study_programme) {
159  $tpl->setVariable('NODE_POINT_CLASSES', $this->class_configuration['node']['node_point']);
160  $tpl->setVariable('NODE_POINTS', $this->formatPointValue($node->getPoints()));
161  }
162 
163  $tpl->parseCurrentBlock('node-content-block');
164 
165  // add the tree buttons
166  if ($this->checkAccess('write', $node->getRefId())) {
167  if ($is_study_programme) {
168  $this->parseStudyProgrammeNodeButtons($node, $node_config, $tpl);
169  } else {
170  $this->parseLeafNodeButtons($node, $node_config, $tpl);
171  }
172  }
173 
174  return $tpl->get();
175  }
checkAccess($permission, $ref_id)
Checks permission of current tree or certain child of it.
global $DIC
Definition: saml.php:7
$_GET["client_id"]
getNodeTemplateInstance()
Factory method for a new instance of a node template.
Class ilObjStudyProgramme.
formatPointValue($points)
Returns formatted point value.
parseStudyProgrammeNodeButtons($node, $node_config, $tpl)
Generates the buttons for a study-programme node.
Create styles array
The data for the language used.
parseLeafNodeButtons($node, $node_config, $tpl)
Generates the buttons for a study programme leaf.
getNodeTitleClasses($node_config)
Returns array with all css classes of the title node element.
+ Here is the call graph for this function:

◆ getNodeHref()

ilObjStudyProgrammeTreeExplorerGUI::getNodeHref (   $node)

Returns node link target.

Parameters
mixed$node
Returns
string

Definition at line 355 of file class.ilObjStudyProgrammeTreeExplorerGUI.php.

References $DIC, and $ilCtrl.

356  {
357  global $DIC;
358  $ilCtrl = $DIC['ilCtrl'];
359 
360  if ($ilCtrl->getCmd() == "performPaste") {
361  $ilCtrl->setParameterByClass("ilObjStudyProgrammeGUI", "target_node", $node->getRefId());
362  }
363 
364  $ilCtrl->setParameterByClass("ilObjStudyProgrammeGUI", "ref_id", $node->getRefId());
365 
366  return '#';
367  }
global $DIC
Definition: saml.php:7
global $ilCtrl
Definition: ilias.php:18

◆ getNodeIcon()

ilObjStudyProgrammeTreeExplorerGUI::getNodeIcon (   $a_node)

Get node icon Return custom icon of OrgUnit type if existing.

Parameters
array$a_node
Returns
string

Definition at line 334 of file class.ilObjStudyProgrammeTreeExplorerGUI.php.

References $DIC, ilObject\_getIcon(), and ilObject\_lookupObjId().

335  {
336  global $DIC;
337  $ilias = $DIC['ilias'];
338 
339  $obj_id = ilObject::_lookupObjId($a_node->getRefId());
340  if ($ilias->getSetting('custom_icons')) {
341  //TODO: implement custom icon functionality
342  }
343 
344  return ilObject::_getIcon($obj_id, "tiny");
345  }
static _getIcon( $a_obj_id="", $a_size="big", $a_type="", $a_offline=false)
Get icon for repository item.
global $DIC
Definition: saml.php:7
static _lookupObjId($a_id)
+ Here is the call graph for this function:

◆ getNodeId()

ilObjStudyProgrammeTreeExplorerGUI::getNodeId (   $a_node)

Get id of a node.

Parameters
mixed$a_nodenode array or object
Returns
string id of node

Definition at line 424 of file class.ilObjStudyProgrammeTreeExplorerGUI.php.

Referenced by listItemStart().

425  {
426  if (!is_null($a_node)) {
427  return $a_node->getRefId();
428  }
429  return null;
430  }
+ Here is the caller graph for this function:

◆ getNodeTemplateInstance()

ilObjStudyProgrammeTreeExplorerGUI::getNodeTemplateInstance ( )
protected

Factory method for a new instance of a node template.

Returns
ilTemplate

Definition at line 256 of file class.ilObjStudyProgrammeTreeExplorerGUI.php.

Referenced by getNodeButtonActionLink(), and getNodeContent().

257  {
258  return new ilTemplate("tpl.tree_node_content.html", true, true, "Modules/StudyProgramme");
259  }
special template class to simplify handling of ITX/PEAR
+ Here is the caller graph for this function:

◆ getNodeTitleClasses()

ilObjStudyProgrammeTreeExplorerGUI::getNodeTitleClasses (   $node_config)
protected

Returns array with all css classes of the title node element.

Parameters
array$node_config
Returns
array

Definition at line 184 of file class.ilObjStudyProgrammeTreeExplorerGUI.php.

References array.

Referenced by getNodeContent().

185  {
186  $node_title_classes = array($this->class_configuration['node']['node_title']);
187  if ($node_config['is_study_programme']) {
188  if ($node_config['is_current_node']) {
189  array_push($node_title_classes, $this->class_configuration['node']['node_current']);
190  }
191  } else {
192  array_push($node_title_classes, $this->class_configuration['lp_object']);
193  }
194 
195  return $node_title_classes;
196  }
Create styles array
The data for the language used.
+ Here is the caller graph for this function:

◆ getRootNode()

ilObjStudyProgrammeTreeExplorerGUI::getRootNode ( )

Return root node of tree.

Returns
mixed

Definition at line 317 of file class.ilObjStudyProgrammeTreeExplorerGUI.php.

References ilObjStudyProgramme\getInstanceByRefId().

318  {
319  $node = ilObjStudyProgramme::getInstanceByRefId($this->tree_root_id);
320  if ($node->getRoot() != null) {
321  return $node->getRoot();
322  }
323  return $node;
324  }
static getInstanceByRefId($a_ref_id)
Get an instance of ilObjStudyProgramme, use cache.
+ Here is the call graph for this function:

◆ isNodeClickable()

ilObjStudyProgrammeTreeExplorerGUI::isNodeClickable (   $a_node)

Is node clickable?

Parameters
mixed$a_nodenode object/array

ilAccessHandler $ilAccess

Returns
boolean node clickable true/false

Definition at line 411 of file class.ilObjStudyProgrammeTreeExplorerGUI.php.

412  {
413  return true;
414  }

◆ listItemStart()

ilObjStudyProgrammeTreeExplorerGUI::listItemStart (   $tpl,
  $a_node 
)

List item start.

Parameters

Definition at line 438 of file class.ilObjStudyProgrammeTreeExplorerGUI.php.

References $tpl, ilExplorerBaseGUI\getAjax(), ilExplorerBaseGUI\getDomNodeIdForNodeId(), getNodeId(), and ilExplorerBaseGUI\nodeHasVisibleChilds().

439  {
440  $tpl->setCurrentBlock("list_item_start");
441 
442  if ($this->getAjax() && $this->nodeHasVisibleChilds($a_node) || ($a_node instanceof ilStudyProgramme && $a_node->getParent() === null)) {
443  $tpl->touchBlock("li_closed");
444  }
445  $tpl->setVariable(
446  "DOM_NODE_ID",
447  $this->getDomNodeIdForNodeId($this->getNodeId($a_node))
448  );
449  $tpl->parseCurrentBlock();
450  $tpl->touchBlock("tag");
451  }
Class ilStudyProgramme.
getDomNodeIdForNodeId($a_node_id)
Get DOM node id for node id.
nodeHasVisibleChilds($a_node)
Node has childs?
+ Here is the call graph for this function:

◆ openCertainNode()

ilObjStudyProgrammeTreeExplorerGUI::openCertainNode (   $node_id)

Open certain node in the tree session The open nodes of a tree are stored in a session.

This function opens a certain node by its id.

Parameters
int$node_id

Definition at line 492 of file class.ilObjStudyProgrammeTreeExplorerGUI.php.

References $id, and ilExplorerBaseGUI\getNodeIdForDomNodeId().

493  {
494  $id = $this->getNodeIdForDomNodeId($node_id);
495  if (!in_array($id, $this->open_nodes)) {
496  $this->open_nodes[] = $id;
497  }
498  $this->store->set("on_" . $this->id, serialize($this->open_nodes));
499  }
if(!array_key_exists('StateId', $_REQUEST)) $id
getNodeIdForDomNodeId($a_dom_node_id)
Get node id for dom node id.
+ Here is the call graph for this function:

◆ parseLeafNodeButtons()

ilObjStudyProgrammeTreeExplorerGUI::parseLeafNodeButtons (   $node,
  $node_config,
  $tpl 
)
protected

Generates the buttons for a study programme leaf.

Parameters
ilObject$nodeparsed node
array$node_configconfiguration of current node
ilTemplate$tplcurrent node template

Definition at line 237 of file class.ilObjStudyProgrammeTreeExplorerGUI.php.

References $tpl, array, ilGlyphGUI\get(), getNodeButtonActionLink(), and ilGlyphGUI\REMOVE.

Referenced by getNodeContent().

238  {
239  $tpl->setCurrentBlock('enable-tree-buttons');
240  $tpl->touchBlock('enable-tree-buttons');
241 
242  // only show delete button when its not the current node
243  if ($node_config['is_delete_enabled']) {
244  $delete_button = $this->getNodeButtonActionLink('ilObjStudyProgrammeTreeGUI', 'delete', array('ref_id'=>$node->getRefId(), 'item_ref_id'=>$node_config['current_ref_id']), ilGlyphGUI::get(ilGlyphGUI::REMOVE));
245  $tpl->setVariable('NODE_DELETE_BUTTON', $delete_button);
246  }
247 
248  $tpl->parseCurrentBlock('enable-tree-buttons');
249  }
static get($a_glyph, $a_text="")
Get glyph html.
getNodeButtonActionLink($target_class, $cmd, $params, $content, $async=true)
Generate link-element.
Create styles array
The data for the language used.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ parseStudyProgrammeNodeButtons()

ilObjStudyProgrammeTreeExplorerGUI::parseStudyProgrammeNodeButtons (   $node,
  $node_config,
  $tpl 
)
protected

Generates the buttons for a study-programme node.

Parameters
ilObjStudyProgramme$nodeparsed node
array$node_configconfiguration of current node
ilTemplate$tplcurrent node template

Definition at line 206 of file class.ilObjStudyProgrammeTreeExplorerGUI.php.

References $tpl, ilGlyphGUI\ADD, array, ilGlyphGUI\get(), getNodeButtonActionLink(), ilGlyphGUI\INFO, and ilGlyphGUI\REMOVE.

Referenced by getNodeContent().

207  {
208  $tpl->setCurrentBlock('enable-tree-buttons');
209  $tpl->touchBlock('enable-tree-buttons');
210 
211  // show info button only when it not the current node
212  $info_button = $this->getNodeButtonActionLink('ilObjStudyProgrammeSettingsGUI', 'view', array('ref_id'=>$node->getRefId(), 'currentNode'=>$node_config['is_current_node']), ilGlyphGUI::get(ilGlyphGUI::INFO));
213  $tpl->setVariable('NODE_INFO_BUTTON', $info_button);
214 
215  // only show add button when create permission is set
216  if ($node_config['is_creation_enabled']) {
217  $create_button = $this->getNodeButtonActionLink('ilObjStudyProgrammeTreeGUI', 'create', array('ref_id'=>$node->getRefId()), ilGlyphGUI::get(ilGlyphGUI::ADD));
218  $tpl->setVariable('NODE_CREATE_BUTTON', $create_button);
219  }
220 
221  // only show delete button when its not the current node, not the root-node and delete permissions are set
222  if ($node_config['is_delete_enabled']) {
223  $delete_button = $this->getNodeButtonActionLink('ilObjStudyProgrammeTreeGUI', 'delete', array('ref_id'=>$node->getRefId(), 'item_ref_id'=>$node_config['current_ref_id']), ilGlyphGUI::get(ilGlyphGUI::REMOVE));
224  $tpl->setVariable('NODE_DELETE_BUTTON', $delete_button);
225  }
226 
227  $tpl->parseCurrentBlock('enable-tree-buttons');
228  }
static get($a_glyph, $a_text="")
Get glyph html.
getNodeButtonActionLink($target_class, $cmd, $params, $content, $async=true)
Generate link-element.
Create styles array
The data for the language used.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $access

ilObjStudyProgrammeTreeExplorerGUI::$access
protected

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

◆ $class_configuration

ilObjStudyProgrammeTreeExplorerGUI::$class_configuration
protected
Initial value:
'node' => array(
'node_title' => 'title',
'node_point' => 'points',
'node_current' => 'ilHighlighted current_node',
'node_buttons' => 'tree_button'
),
'lp_object' => 'lp-object',
)

Definition at line 69 of file class.ilObjStudyProgrammeTreeExplorerGUI.php.

◆ $css_study_programme_path

ilObjStudyProgrammeTreeExplorerGUI::$css_study_programme_path = "./Modules/StudyProgramme/templates/css/ilStudyProgrammeTree.css"
protected

Definition at line 19 of file class.ilObjStudyProgrammeTreeExplorerGUI.php.

◆ $ctrl

ilObjStudyProgrammeTreeExplorerGUI::$ctrl
protected

Definition at line 53 of file class.ilObjStudyProgrammeTreeExplorerGUI.php.

◆ $js_conf

ilObjStudyProgrammeTreeExplorerGUI::$js_conf
protected

Definition at line 63 of file class.ilObjStudyProgrammeTreeExplorerGUI.php.

◆ $js_study_programme_path

ilObjStudyProgrammeTreeExplorerGUI::$js_study_programme_path = "./Modules/StudyProgramme/templates/js/ilStudyProgramme.js"
protected

Definition at line 18 of file class.ilObjStudyProgrammeTreeExplorerGUI.php.

◆ $lng

ilObjStudyProgrammeTreeExplorerGUI::$lng
protected

Definition at line 38 of file class.ilObjStudyProgrammeTreeExplorerGUI.php.

Referenced by __construct(), and getNodeContent().

◆ $modal_id

ilObjStudyProgrammeTreeExplorerGUI::$modal_id
protected

Definition at line 58 of file class.ilObjStudyProgrammeTreeExplorerGUI.php.

Referenced by __construct().

◆ $node_template

ilObjStudyProgrammeTreeExplorerGUI::$node_template
protected

Definition at line 79 of file class.ilObjStudyProgrammeTreeExplorerGUI.php.

◆ $toolbar

ilObjStudyProgrammeTreeExplorerGUI::$toolbar
protected

Definition at line 48 of file class.ilObjStudyProgrammeTreeExplorerGUI.php.

◆ $tpl

◆ $tree_root_id

ilObjStudyProgrammeTreeExplorerGUI::$tree_root_id
protected

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


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