ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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{
19 protected $ctrl;
20
27 public function __construct(
28 $a_parent_obj,
29 $a_parent_cmd,
30 $a_tax_id,
31 $a_target_gui,
32 $a_target_cmd,
33 $a_id = ""
34 ) {
35 global $DIC;
36
37 $this->ctrl = $DIC->ctrl();
38 include_once("./Services/Taxonomy/classes/class.ilTaxonomyTree.php");
39 $this->tax_tree = new ilTaxonomyTree($a_tax_id);
40 if ($a_id != "") {
41 $this->id = $a_id;
42 } else {
43 $this->id = "tax_expl_" . $this->tax_tree->getTreeId();
44 }
45 include_once("./Services/Taxonomy/classes/class.ilObjTaxonomy.php");
47 $this->setOrderField("title");
48 } else {
49 $this->setOrderField("order_nr", true);
50 }
51 $this->setPreloadChilds(true);
52 $this->target_gui = $a_target_gui;
53 $this->target_cmd = $a_target_cmd;
54 //$this->setOrderField("title");
55 parent::__construct($this->id, $a_parent_obj, $a_parent_cmd, $this->tax_tree);
56 }
57
58
65 public function getNodeContent($a_node)
66 {
67 $rn = $this->getRootNode();
68 if ($rn["child"] == $a_node["child"]) {
69 return ilObject::_lookupTitle($this->tax_tree->getTreeId());
70 } else {
71 return $a_node["title"];
72 }
73 }
74
81 public function getNodeHref($a_node)
82 {
84
85 if (!$this->onclick) {
86 $ilCtrl->setParameterByClass($this->target_gui, "tax_node", $a_node["child"]);
87 $href = $ilCtrl->getLinkTargetByClass($this->target_gui, $this->target_cmd);
88 $ilCtrl->setParameterByClass($this->target_gui, "tax_node", $_GET["tax_node"]);
89 return $href;
90 } else {
91 return "#";
92 }
93 }
94
101 public function getNodeIcon($a_node)
102 {
103 return ilUtil::getImagePath("icon_taxn.svg");
104 }
105
112 public function isNodeHighlighted($a_node)
113 {
114 if ((!$this->onclick && $a_node["child"] == $_GET["tax_node"]) ||
115 ($this->onclick && is_array($this->selected_nodes) && in_array($a_node["child"], $this->selected_nodes))) {
116 return true;
117 }
118 return false;
119 }
120
121 public function setOnClick($a_value)
122 {
123 $this->onclick = $a_value;
124 }
125
126 public function getNodeOnClick($a_node)
127 {
128 if ($this->onclick) {
129 return str_replace("{NODE_CHILD}", $a_node["child"], $this->onclick);
130 } else {
131 // #14623
132 return parent::getNodeOnClick($a_node);
133 }
134 }
135}
$_GET["client_id"]
An exception for terminatinating execution or to throw for unit testing.
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.
__construct( $a_parent_obj, $a_parent_cmd, $a_tax_id, $a_target_gui, $a_target_cmd, $a_id="")
Constructor.
getNodeHref($a_node)
Get node href.
getNodeIcon($a_node)
Get node icon.
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
global $DIC
Definition: saml.php:7