ILIAS  release_4-4 Revision
All Data Structures Namespaces Files Functions Variables Modules Pages
class.ilSkillSelectorGUI.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/Skill/classes/class.ilVirtualSkillTreeExplorerGUI.php");
5 
15 {
19  public function __construct($a_parent_obj, $a_parent_cmd, $a_select_gui, $a_select_cmd, $a_select_par = "selected_skill")
20  {
21  parent::__construct("skill_sel", $a_parent_obj, $a_parent_cmd);
22  $this->select_gui = (is_object($a_select_gui))
23  ? strtolower(get_class($a_select_gui))
24  : $a_select_gui;
25  $this->select_cmd = $a_select_cmd;
26  $this->select_par = $a_select_par;
27  $this->setSkipRootNode(true);
28  }
29 
36  function getNodeHref($a_node)
37  {
38  global $ilCtrl;
39 
40  // we have a tree id like <skl_tree_id>:<skl_template_tree_id>
41  // and make a "common" skill id in format <skill_id>:<tref_id>
42 
43  $id_parts = explode(":", $a_node["id"]);
44  if ($id_parts[1] == 0)
45  {
46  // skill in main tree
47  $skill_id = $a_node["id"];
48  }
49  else
50  {
51  // skill in template
52  $skill_id = $id_parts[1].":".$id_parts[0];
53  }
54 
55  $ilCtrl->setParameterByClass($this->select_gui, $this->select_par, $skill_id);
56  $ret = $ilCtrl->getLinkTargetByClass($this->select_gui, $this->select_cmd);
57  $ilCtrl->setParameterByClass($this->select_gui, $this->select_par, "");
58 
59  return $ret;
60  }
61 
68  function isNodeClickable($a_node)
69  {
70  if (in_array($a_node["type"], array("skll", "sktp")))
71  {
72  return true;
73  }
74  // references that refer directly to a (basic) skill template
75  if ($a_node["type"] == "sktr" && ilSkillTreeNode::_lookupType($a_node["skill_id"]) == "sktp")
76  {
77  return true;
78  }
79 
80  return false;
81  }
82 
83 }
84 
85 ?>
__construct($a_parent_obj, $a_parent_cmd, $a_select_gui, $a_select_cmd, $a_select_par="selected_skill")
Constructor.
setSkipRootNode($a_val)
Set skip root node.
isNodeClickable($a_node)
Is clickable.
static _lookupType($a_obj_id)
Lookup Type.
global $ilCtrl
Definition: ilias.php:18
Explorer class that works on tree objects (Services/Tree)
getNodeHref($a_node)
Get href for node.