ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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 
4 include_once("./Services/UIComponent/Explorer2/classes/class.ilExplorerBaseGUI.php");
5 
15 {
19  protected $lng;
20 
24  protected $ctrl;
25 
26  protected $show_draft_nodes = false;
27  protected $show_outdated_nodes = false;
28 
32  public function __construct($a_id, $a_parent_obj, $a_parent_cmd)
33  {
34  global $DIC;
35 
36  $this->lng = $DIC->language();
37  $this->ctrl = $DIC->ctrl();
38  parent::__construct($a_id, $a_parent_obj, $a_parent_cmd);
39 
40  include_once("./Services/Skill/classes/class.ilVirtualSkillTree.php");
41  $this->vtree = new ilVirtualSkillTree();
42 
43  $this->setSkipRootNode(false);
44  $this->setAjax(false);
45  }
46 
52  public function setShowDraftNodes($a_val)
53  {
54  $this->show_draft_nodes = $a_val;
55  $this->vtree->setIncludeDrafts($a_val);
56  }
57 
63  public function getShowDraftNodes()
64  {
66  }
67 
73  public function setShowOutdatedNodes($a_val)
74  {
75  $this->show_outdated_nodes = $a_val;
76  $this->vtree->setIncludeOutdated($a_val);
77  }
78 
84  public function getShowOutdatedNodes()
85  {
87  }
88 
94  public function getRootNode()
95  {
96  return $this->vtree->getRootNode();
97  }
98 
105  public function getNodeId($a_node)
106  {
107  return $a_node["id"];
108  }
109 
116  public function getChildsOfNode($a_parent_id)
117  {
118  return $this->vtree->getChildsOfNode($a_parent_id);
119  }
120 
127  public function getNodeContent($a_node)
128  {
129  $lng = $this->lng;
130 
131  $a_parent_id_parts = explode(":", $a_node["id"]);
132  $a_parent_skl_tree_id = $a_parent_id_parts[0];
133  $a_parent_skl_template_tree_id = $a_parent_id_parts[1];
134 
135  // title
136  $title = $a_node["title"];
137 
138  // root?
139  if ($a_node["type"] == "skrt") {
140  $lng->txt("skmg_skills");
141  } else {
142  if ($a_node["type"] == "sktr") {
143  // include_once("./Services/Skill/classes/class.ilSkillTemplateReference.php");
144 // $title.= " (".ilSkillTreeNode::_lookupTitle($a_parent_skl_template_tree_id).")";
145  }
146  }
147 
148  return $title;
149  }
150 
157  public function getNodeIcon($a_node)
158  {
159  $a_id_parts = explode(":", $a_node["id"]);
160  $a_skl_tree_id = $a_parent_id_parts[0];
161  $a_skl_template_tree_id = $a_id_parts[1];
162 
163  // root?
164  if ($a_node["type"] == "skrt") {
165  $icon = ilUtil::getImagePath("icon_scat.svg");
166  } else {
167  $type = $a_node["type"];
168  if ($type == "sktr") {
169  include_once("./Services/Skill/classes/class.ilSkillTreeNode.php");
170  $type = ilSkillTreeNode::_lookupType($a_skl_template_tree_id);
171  }
172  if ($type == "sktp") {
173  $type = "skll";
174  }
175  if ($type == "sctp") {
176  $type = "scat";
177  }
178  $icon = ilUtil::getImagePath("icon_" . $type . ".svg");
179  }
180 
181  return $icon;
182  }
183 
190  public function getNodeHref($a_node)
191  {
193 
194  // we have a tree id like <skl_tree_id>:<skl_template_tree_id> here
195  // use this, if you want a "common" skill id in format <skill_id>:<tref_id>
196  $id_parts = explode(":", $a_node["id"]);
197  if ($id_parts[1] == 0) {
198  // skill in main tree
199  $skill_id = $a_node["id"];
200  } else {
201  // skill in template
202  $skill_id = $id_parts[1] . ":" . $id_parts[0];
203  }
204 
205  return "";
206  }
207 
214  public function isNodeClickable($a_node)
215  {
216  return false;
217  }
218 }
$type
global $DIC
Definition: saml.php:7
setSkipRootNode($a_val)
Set skip root node.
__construct($a_id, $a_parent_obj, $a_parent_cmd)
Constructor.
static _lookupType($a_obj_id)
Lookup Type.
global $ilCtrl
Definition: ilias.php:18
setShowOutdatedNodes($a_val)
Set show outdated nodes.
Explorer base GUI class.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
getChildsOfNode($a_parent_id)
Get childs of node.