ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
class.ilTaxonomyExplorerGUI.php
Go to the documentation of this file.
1<?php
2
3/* Copyright (c) 1998-2012 ILIAS open source, Extended GPL, see docs/LICENSE */
4
5include_once("./Services/UIComponent/Explorer2/classes/class.ilTreeExplorerGUI.php");
6
15{
22 function __construct($a_parent_obj, $a_parent_cmd, $a_tax_id,
23 $a_target_gui, $a_target_cmd, $a_id = "")
24 {
25 include_once("./Services/Taxonomy/classes/class.ilTaxonomyTree.php");
26 $this->tax_tree = new ilTaxonomyTree($a_tax_id);
27 if ($a_id != "")
28 {
29 $this->id = $a_id;
30 }
31 else
32 {
33 $this->id = "tax_expl_".$this->tax_tree->getTreeId();
34 }
35 include_once("./Services/Taxonomy/classes/class.ilObjTaxonomy.php");
37 {
38 $this->setOrderField("title");
39 }
40 else
41 {
42 $this->setOrderField("order_nr", true);
43 }
44 $this->setPreloadChilds(true);
45 $this->target_gui = $a_target_gui;
46 $this->target_cmd = $a_target_cmd;
47 //$this->setOrderField("title");
48 parent::__construct($this->id, $a_parent_obj, $a_parent_cmd, $this->tax_tree);
49 }
50
51
58 function getNodeContent($a_node)
59 {
60 $rn = $this->getRootNode();
61 if ($rn["child"] == $a_node["child"])
62 {
63 return ilObject::_lookupTitle($this->tax_tree->getTreeId());
64 }
65 else
66 {
67 return $a_node["title"];
68 }
69 }
70
77 function getNodeHref($a_node)
78 {
79 global $ilCtrl;
80
81 if(!$this->onclick)
82 {
83 $ilCtrl->setParameterByClass($this->target_gui, "tax_node", $a_node["child"]);
84 $href = $ilCtrl->getLinkTargetByClass($this->target_gui, $this->target_cmd);
85 $ilCtrl->setParameterByClass($this->target_gui, "tax_node", $_GET["tax_node"]);
86 return $href;
87 }
88 else
89 {
90 return "#";
91 }
92 }
93
100 function getNodeIcon($a_node)
101 {
102 return ilUtil::getImagePath("icon_taxn.svg");
103 }
104
111 function isNodeHighlighted($a_node)
112 {
113 if ((!$this->onclick && $a_node["child"] == $_GET["tax_node"]) ||
114 ($this->onclick && is_array($this->selected_nodes) && in_array($a_node["child"], $this->selected_nodes)))
115 {
116 return true;
117 }
118 return false;
119 }
120
121 function setOnClick($a_value)
122 {
123 $this->onclick = $a_value;
124 }
125
126 function getNodeOnClick($a_node)
127 {
128 if($this->onclick)
129 {
130 return str_replace("{NODE_CHILD}", $a_node["child"], $this->onclick);
131 }
132 else
133 {
134 // #14623
135 return parent::getNodeOnClick($a_node);
136 }
137 }
138}
139
140?>
$_GET["client_id"]
static lookupSortingMode($a_id)
Lookup sorting mode.
static _lookupTitle($a_id)
lookup object title
Taxonomy explorer GUI class.
getNodeOnClick($a_node)
Get node onclick attribute.
getNodeHref($a_node)
Get node href.
getNodeIcon($a_node)
Get node icon.
__construct($a_parent_obj, $a_parent_cmd, $a_tax_id, $a_target_gui, $a_target_cmd, $a_id="")
Constructor.
getNodeContent($a_node)
Get content of node.
Explorer class that works on tree objects (Services/Tree)
setPreloadChilds($a_val)
Set preload childs.
setOrderField($a_val, $a_numeric=false)
Set order field.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
global $ilCtrl
Definition: ilias.php:18