ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
ilSkillTemplateTreeExplorerGUI Class Reference

Explorer class that works on tree objects (Services/Tree) More...

+ Inheritance diagram for ilSkillTemplateTreeExplorerGUI:
+ Collaboration diagram for ilSkillTemplateTreeExplorerGUI:

Public Member Functions

 __construct ($a_parent_obj, $a_parent_cmd)
 Constructor. More...
 
 getRootNode ()
 Get root node. More...
 
 getChildsOfNode ($a_parent_id)
 Get childs of node. More...
 
 getNodeContent ($a_node)
 Get node content. More...
 
 getNodeIcon ($a_node)
 Get node content. More...
 
 isNodeHighlighted ($a_node)
 Is node highlighted? More...
 
 getNodeHref ($a_node)
 Get href for node. More...
 
- Public Member Functions inherited from ilTreeExplorerGUI
 __construct ($a_expl_id, $a_parent_obj, $a_parent_cmd, $a_tree)
 Constructor. More...
 
 getTree ()
 Get tree. More...
 
 setOrderField ($a_val, $a_numeric=false)
 Set order field. More...
 
 getOrderField ()
 Get order field. More...
 
 setTypeWhiteList ($a_val)
 Set type white list. More...
 
 getTypeWhiteList ()
 Get type white list. More...
 
 setTypeBlackList ($a_val)
 Set type black list. More...
 
 getTypeBlackList ()
 Get type black list. More...
 
 setPreloadChilds ($a_val)
 Set preload childs. More...
 
 getPreloadChilds ()
 Get preload childs. More...
 
 getSuccessorNode ($a_node_id, $a_type="")
 Get successor node (currently only(!) based on lft/rgt tree values) More...
 
 getChildsOfNode ($a_parent_node_id)
 Get childs of node. More...
 
 getNodeId ($a_node)
 Get id for node. More...
 
 getNodeIconAlt ($a_node)
 Get node icon alt attribute. More...
 
 getRootNode ()
 Get root node. More...
 
 setRootId ($a_root)
 
 setPathOpen ($a_id)
 Set node path to be opened. More...
 
 getHTML ()
 Get HTML. More...
 
- Public Member Functions inherited from ilExplorerBaseGUI
 __construct ($a_expl_id, $a_parent_obj, $a_parent_cmd)
 Constructor. More...
 
 getRootNode ()
 Get root node. More...
 
 getChildsOfNode ($a_parent_node_id)
 Get childs of node. More...
 
 getNodeContent ($a_node)
 Get content of a node. More...
 
 getNodeId ($a_node)
 Get id of a node. More...
 
 getNodeHref ($a_node)
 Get href for node. More...
 
 nodeHasVisibleChilds ($a_node)
 Node has childs? More...
 
 sortChilds ($a_childs, $a_parent_node_id)
 Sort childs. More...
 
 getNodeIcon ($a_node)
 Get node icon path. More...
 
 getNodeIconAlt ($a_node)
 Get node icon alt attribute. More...
 
 getNodeTarget ($a_node)
 Get node target (frame) attribute. More...
 
 getNodeOnClick ($a_node)
 Get node onclick attribute. More...
 
 isNodeVisible ($a_node)
 Is node visible? More...
 
 isNodeHighlighted ($a_node)
 Is node highlighted? More...
 
 isNodeClickable ($a_node)
 Is node clickable? More...
 
 getId ()
 Get id of explorer element. More...
 
 setSkipRootNode ($a_val)
 Set skip root node. More...
 
 getSkipRootNode ()
 Get skip root node. More...
 
 setAjax ($a_val)
 Set ajax. More...
 
 getAjax ()
 Get ajax. More...
 
 setSecondaryHighlightedNodes ($a_val)
 Set secondary (background) highlighted nodes. More...
 
 getSecondaryHighlightedNodes ()
 Get secondary (background) highlighted nodes. More...
 
 setNodeOpen ($a_id)
 Set node to be opened (additional custom opened node, not standard expand behaviour) More...
 
 setSelectMode ($a_postvar, $a_multi=false)
 Set select mode (to deactivate, pass an empty string as postvar) More...
 
 setNodeSelected ($a_id)
 Set node to be opened (additional custom opened node, not standard expand behaviour) More...
 
 setOfflineMode ($a_val)
 Set offline mode. More...
 
 getOfflineMode ()
 Get offline mode. More...
 
 handleCommand ()
 Handle explorer internal command. More...
 
 getContainerId ()
 Get container id. More...
 
 openNode ()
 Open node. More...
 
 closeNode ()
 Close node. More...
 
 getNodeAsync ()
 Get node asynchronously. More...
 
 beforeRendering ()
 Before rendering. More...
 
 getOnLoadCode ()
 Get on load code. More...
 
 getHTML ()
 Get HTML. More...
 
 renderNode ($a_node, $tpl)
 Render node. More...
 
 renderChilds ($a_node_id, $tpl)
 Render childs. More...
 
 getDomNodeIdForNodeId ($a_node_id)
 Get DOM node id for node id. More...
 
 getNodeIdForDomNodeId ($a_dom_node_id)
 Get node id for dom node id. More...
 
 listItemStart ($tpl, $a_node)
 List item start. More...
 
 listItemEnd ($tpl)
 List item end. More...
 
 listStart ($tpl)
 List start. More...
 
 listEnd ($tpl)
 List end. More...
 
 isNodeOnclickEnabled ()
 
 setNodeOnclickEnabled ($nodeOnclickEnabled)
 
 isEnableDnd ()
 
 setEnableDnd ($enable_dnd)
 Enable Drag & Drop functionality. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from ilExplorerBaseGUI
static getLocalExplorerJsPath ()
 Get local path of explorer js. More...
 
static getLocalJsTreeJsPath ()
 Get local path of jsTree js. More...
 
static createHTMLExportDirs ($a_target_dir)
 Create html export directories. More...
 
static init ()
 Init JS. More...
 
- Protected Member Functions inherited from ilTreeExplorerGUI
 preloadChilds ()
 Preload childs. More...
 
 getRootId ()
 
- Protected Member Functions inherited from ilExplorerBaseGUI
 isNodeSelectable ($a_node)
 Is node selectable? More...
 
 getNodeToggleOnClick ($a_node)
 Get onclick attribute for node toggling. More...
 
 getSelectOnClick ($a_node)
 Get onclick attribute for selecting radio/checkbox. More...
 
 getJSTreePlugins ()
 
- Protected Attributes inherited from ilTreeExplorerGUI
 $tree = null
 
 $order_field = ""
 
 $order_field_numeric = false
 
 $type_white_list = array()
 
 $type_black_list = array()
 
 $childs = array()
 
 $preloaded = false
 
 $preload_childs = false
 
 $root_node_data = null
 
 $all_childs = array()
 
- Protected Attributes inherited from ilExplorerBaseGUI
 $skip_root_node = false
 
 $ajax = false
 
 $custom_open_nodes = array()
 
 $selected_nodes = array()
 
 $select_postvar = ""
 
 $offline_mode = false
 
 $sec_highl_nodes = array()
 
 $enable_dnd = false
 
- Static Protected Attributes inherited from ilExplorerBaseGUI
static $js_tree_path = "./Services/UIComponent/Explorer2/lib/jstree-v.pre1.0/jquery.jstree.js"
 
static $js_expl_path = "./Services/UIComponent/Explorer2/js/Explorer2.js"
 

Detailed Description

Explorer class that works on tree objects (Services/Tree)

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
$Id$

Definition at line 14 of file class.ilSkillTemplateTreeExplorerGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilSkillTemplateTreeExplorerGUI::__construct (   $a_parent_obj,
  $a_parent_cmd 
)

Constructor.

Parameters
object$a_parent_objparent gui object
string$a_parent_cmdparent command

Definition at line 22 of file class.ilSkillTemplateTreeExplorerGUI.php.

References ilTreeExplorerGUI\$tree, array, ilExplorerBaseGUI\setAjax(), ilTreeExplorerGUI\setOrderField(), ilExplorerBaseGUI\setSkipRootNode(), and ilTreeExplorerGUI\setTypeWhiteList().

23  {
24  include_once("./Services/Skill/classes/class.ilSkillTree.php");
25  $tree = new ilSkillTree();
26  parent::__construct("skill_exp", $a_parent_obj, $a_parent_cmd, $tree);
27 
28  $this->setTypeWhiteList(array("skrt", "sktp", "sctp"));
29 
30  $this->setSkipRootNode(false);
31  $this->setAjax(true);
32  $this->setOrderField("order_nr");
33  }
Skill tree.
setSkipRootNode($a_val)
Set skip root node.
setTypeWhiteList($a_val)
Set type white list.
Create styles array
The data for the language used.
setOrderField($a_val, $a_numeric=false)
Set order field.
+ Here is the call graph for this function:

Member Function Documentation

◆ getChildsOfNode()

ilSkillTemplateTreeExplorerGUI::getChildsOfNode (   $a_parent_id)

Get childs of node.

Parameters
int$a_parent_idparent id
Returns
array childs

Definition at line 53 of file class.ilSkillTemplateTreeExplorerGUI.php.

References ilTreeExplorerGUI\$childs, ilSkillTreeNode\_lookupStatus(), and ilSkillTreeNode\STATUS_DRAFT.

54  {
55  $childs = parent::getChildsOfNode($a_parent_id);
56 
57  include_once("./Services/Skill/classes/class.ilSkillTreeNode.php");
58  foreach ($childs as $c)
59  {
60  $this->parent[$c["child"]] = $c["parent"];
61  if ($this->draft[$c["parent"]])
62  {
63  $this->draft[$c["child"]] = true;
64  }
65  else
66  {
67  $this->draft[$c["child"]] = (ilSkillTreeNode::_lookupStatus($c["child"]) == ilSkillTreeNode::STATUS_DRAFT);
68  }
69  }
70  return $childs;
71  }
static _lookupStatus($a_obj_id)
Lookup Status.
+ Here is the call graph for this function:

◆ getNodeContent()

ilSkillTemplateTreeExplorerGUI::getNodeContent (   $a_node)

Get node content.

Parameters
array
Returns

Definition at line 79 of file class.ilSkillTemplateTreeExplorerGUI.php.

References $lng, $title, ilSkillTreeNode\_lookupSelfEvaluation(), and ilSkillTemplateReference\_lookupTemplateId().

80  {
81  global $lng;
82 
83  // title
84  $title = $a_node["title"];
85 
86  // root?
87  if ($a_node["type"] == "skrt")
88  {
89  $title = $lng->txt("skmg_skill_templates");
90  }
91  else
92  {
93  if ($a_node["type"] == "sktr")
94  {
95  include_once("./Services/Skill/classes/class.ilSkillTemplateReference.php");
96  $tid = ilSkillTemplateReference::_lookupTemplateId($a_node["child"]);
97  $title.= " (".ilSkillTreeNode::_lookupTitle($tid).")";
98  }
99  if (ilSkillTreeNode::_lookupSelfEvaluation($a_node["child"]))
100  {
101  $title = "<u>".$title."</u>";
102  }
103  }
104 
105  return $title;
106  }
static _lookupSelfEvaluation($a_obj_id)
Lookup self evaluation.
static _lookupTemplateId($a_obj_id)
Lookup template ID.
global $lng
Definition: privfeed.php:17
+ Here is the call graph for this function:

◆ getNodeHref()

ilSkillTemplateTreeExplorerGUI::getNodeHref (   $a_node)

Get href for node.

Parameters
mixed$a_nodenode object/array
Returns
string href attribute

Definition at line 159 of file class.ilSkillTemplateTreeExplorerGUI.php.

References $_GET, $ilCtrl, and $ret.

160  {
161  global $ilCtrl;
162 
163  switch($a_node["type"])
164  {
165  // root
166  case "skrt":
167  $ilCtrl->setParameterByClass("ilskillrootgui", "obj_id", $a_node["child"]);
168  $ret = $ilCtrl->getLinkTargetByClass("ilskillrootgui", "listTemplates");
169  $ilCtrl->setParameterByClass("ilskillrootgui", "obj_id", $_GET["obj_id"]);
170  return $ret;
171  break;
172 
173  // template
174  case "sktp":
175  $ilCtrl->setParameterByClass("ilbasicskilltemplategui", "obj_id", $a_node["child"]);
176  $ret = $ilCtrl->getLinkTargetByClass("ilbasicskilltemplategui", "edit");
177  $ilCtrl->setParameterByClass("ilbasicskilltemplategui", "obj_id", $_GET["obj_id"]);
178  return $ret;
179  break;
180 
181  // template category
182  case "sctp":
183  $ilCtrl->setParameterByClass("ilskilltemplatecategorygui", "obj_id", $a_node["child"]);
184  $ret = $ilCtrl->getLinkTargetByClass("ilskilltemplatecategorygui", "listItems");
185  $ilCtrl->setParameterByClass("ilskilltemplatecategorygui", "obj_id", $_GET["obj_id"]);
186  return $ret;
187  break;
188 
189  }
190  }
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18
$ret
Definition: parser.php:6

◆ getNodeIcon()

ilSkillTemplateTreeExplorerGUI::getNodeIcon (   $a_node)

Get node content.

Parameters
array
Returns

Definition at line 114 of file class.ilSkillTemplateTreeExplorerGUI.php.

References array, ilSkillTreeNode\getIconPath(), and ilUtil\getImagePath().

115  {
116  // root?
117  if ($a_node["type"] == "skrt")
118  {
119  $icon = ilUtil::getImagePath("icon_sctp.svg");
120  }
121  else
122  {
123  if (in_array($a_node["type"], array("skll", "scat", "sctr", "sktr")))
124  {
125  $icon = ilSkillTreeNode::getIconPath($a_node["child"], $a_node["type"], "",
126  $this->draft[$a_node["child"]]);
127  }
128  else
129  {
130  $icon = ilUtil::getImagePath("icon_".$a_node["type"].".svg");
131  }
132  }
133 
134  return $icon;
135  }
static getIconPath($a_obj_id, $a_type, $a_size="", $a_status=0)
Get icon path.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
Create styles array
The data for the language used.
+ Here is the call graph for this function:

◆ getRootNode()

ilSkillTemplateTreeExplorerGUI::getRootNode ( )

Get root node.

Returns
array node data

Definition at line 40 of file class.ilSkillTemplateTreeExplorerGUI.php.

References $_GET, $path, and ilTreeExplorerGUI\getTree().

41  {
42  $path = $this->getTree()->getPathId($_GET["obj_id"]);
43  return $this->getTree()->getNodeData($path[1]);
44  }
$path
Definition: aliased.php:25
$_GET["client_id"]
+ Here is the call graph for this function:

◆ isNodeHighlighted()

ilSkillTemplateTreeExplorerGUI::isNodeHighlighted (   $a_node)

Is node highlighted?

Parameters
mixed$a_nodenode object/array
Returns
boolean node visible true/false

Definition at line 143 of file class.ilSkillTemplateTreeExplorerGUI.php.

References $_GET.

144  {
145  if ($a_node["child"] == $_GET["obj_id"] ||
146  ($_GET["obj_id"] == "" && $a_node["type"] == "skrt"))
147  {
148  return true;
149  }
150  return false;
151  }
$_GET["client_id"]

The documentation for this class was generated from the following file: