ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
class.ilVirtualSkillTreeExplorerGUI.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 1998-2013 ILIAS open source, Extended GPL, see docs/LICENSE */
3
4include_once("./Services/UIComponent/Explorer2/classes/class.ilExplorerBaseGUI.php");
5
15{
16 protected $show_draft_nodes = false;
17 protected $show_outdated_nodes = false;
18
22 public function __construct($a_id, $a_parent_obj, $a_parent_cmd)
23 {
24 parent::__construct($a_id, $a_parent_obj, $a_parent_cmd);
25
26 include_once("./Services/Skill/classes/class.ilVirtualSkillTree.php");
27 $this->vtree = new ilVirtualSkillTree();
28
29 $this->setSkipRootNode(false);
30 $this->setAjax(false);
31 }
32
38 function setShowDraftNodes($a_val)
39 {
40 $this->show_draft_nodes = $a_val;
41 $this->vtree->setIncludeDrafts($a_val);
42 }
43
50 {
52 }
53
59 function setShowOutdatedNodes($a_val)
60 {
61 $this->show_outdated_nodes = $a_val;
62 $this->vtree->setIncludeOutdated($a_val);
63 }
64
71 {
73 }
74
80 function getRootNode()
81 {
82 return $this->vtree->getRootNode();
83 }
84
91 function getNodeId($a_node)
92 {
93 return $a_node["id"];
94 }
95
102 function getChildsOfNode($a_parent_id)
103 {
104 return $this->vtree->getChildsOfNode($a_parent_id);
105 }
106
113 function getNodeContent($a_node)
114 {
115 global $lng;
116
117 $a_parent_id_parts = explode(":", $a_node["id"]);
118 $a_parent_skl_tree_id = $a_parent_id_parts[0];
119 $a_parent_skl_template_tree_id = $a_parent_id_parts[1];
120
121 // title
122 $title = $a_node["title"];
123
124 // root?
125 if ($a_node["type"] == "skrt")
126 {
127 $lng->txt("skmg_skills");
128 }
129 else
130 {
131 if ($a_node["type"] == "sktr")
132 {
133// include_once("./Services/Skill/classes/class.ilSkillTemplateReference.php");
134// $title.= " (".ilSkillTreeNode::_lookupTitle($a_parent_skl_template_tree_id).")";
135 }
136 }
137
138 return $title;
139 }
140
147 function getNodeIcon($a_node)
148 {
149 $a_id_parts = explode(":", $a_node["id"]);
150 $a_skl_tree_id = $a_parent_id_parts[0];
151 $a_skl_template_tree_id = $a_id_parts[1];
152
153 // root?
154 if ($a_node["type"] == "skrt")
155 {
156 $icon = ilUtil::getImagePath("icon_scat.svg");
157 }
158 else
159 {
160 $type = $a_node["type"];
161 if ($type == "sktr")
162 {
163 include_once("./Services/Skill/classes/class.ilSkillTreeNode.php");
164 $type = ilSkillTreeNode::_lookupType($a_skl_template_tree_id);
165 }
166 if ($type == "sktp")
167 {
168 $type = "skll";
169 }
170 if ($type == "sctp")
171 {
172 $type = "scat";
173 }
174 $icon = ilUtil::getImagePath("icon_".$type.".svg");
175 }
176
177 return $icon;
178 }
179
186 function getNodeHref($a_node)
187 {
188 global $ilCtrl;
189
190 // we have a tree id like <skl_tree_id>:<skl_template_tree_id> here
191 // use this, if you want a "common" skill id in format <skill_id>:<tref_id>
192 $id_parts = explode(":", $a_node["id"]);
193 if ($id_parts[1] == 0)
194 {
195 // skill in main tree
196 $skill_id = $a_node["id"];
197 }
198 else
199 {
200 // skill in template
201 $skill_id = $id_parts[1].":".$id_parts[0];
202 }
203
204 return "";
205 }
206
213 function isNodeClickable($a_node)
214 {
215 return false;
216 }
217
218}
219
220?>
Explorer base GUI class.
setSkipRootNode($a_val)
Set skip root node.
static _lookupType($a_obj_id)
Lookup Type.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
__construct($a_id, $a_parent_obj, $a_parent_cmd)
Constructor.
setShowOutdatedNodes($a_val)
Set show outdated nodes.
getChildsOfNode($a_parent_id)
Get childs of node.
global $ilCtrl
Definition: ilias.php:18
global $lng
Definition: privfeed.php:40