ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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...
 
 getNodeIconAlt ($a_node)
 Get node icon alt attribute. 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...
 
 setChildLimit ($a_val)
 Set child limit. More...
 
 getChildLimit ()
 Get child limit. More...
 
 setSearchTerm ($a_val)
 Set search term. More...
 
 getSearchTerm ()
 Get search term. More...
 
 setMainTemplate (ilTemplate $a_main_tpl=null)
 Set main template (that is responsible for adding js/css) 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...
 

Protected Attributes

 $lng
 
 $ctrl
 
- Protected Attributes inherited from ilTreeExplorerGUI
 $lng
 
 $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
 $log
 
 $ctrl
 
 $tpl
 
 $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
 
 $search_term = ""
 
 $child_limit = 0
 

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 getLocalJsTreeCssPath ()
 Get local path of jsTree js. More...
 
static createHTMLExportDirs ($a_target_dir)
 Create html export directories. More...
 
static init ($a_main_tpl=null)
 Init JS. More...
 
- Protected Member Functions inherited from ilTreeExplorerGUI
 preloadChilds ()
 Preload childs. More...
 
 matches ($node)
 Does a node match a search term (or is search term empty) 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...
 
 isNodeOpen ($node_id)
 Get all open nodes. More...
 
 getJSTreePlugins ()
 
- Static Protected Attributes inherited from ilExplorerBaseGUI
static $js_tree_path = "./libs/bower/bower_components/jstree/dist/jstree.js"
 
static $js_tree_path_css = "./libs/bower/bower_components/jstree/dist/themes/default/style.min.css"
 
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 32 of file class.ilSkillTemplateTreeExplorerGUI.php.

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

33  {
34  global $DIC;
35 
36  $this->lng = $DIC->language();
37  $this->ctrl = $DIC->ctrl();
38  include_once("./Services/Skill/classes/class.ilSkillTree.php");
39  $tree = new ilSkillTree();
40  parent::__construct("skill_exp", $a_parent_obj, $a_parent_cmd, $tree);
41 
42  $this->setTypeWhiteList(array("skrt", "sktp", "sctp"));
43 
44  $this->setSkipRootNode(false);
45  $this->setAjax(true);
46  $this->setOrderField("order_nr");
47  }
global $DIC
Definition: saml.php:7
Skill tree.
setSkipRootNode($a_val)
Set skip root node.
setTypeWhiteList($a_val)
Set type white list.
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 67 of file class.ilSkillTemplateTreeExplorerGUI.php.

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

68  {
69  $childs = parent::getChildsOfNode($a_parent_id);
70 
71  include_once("./Services/Skill/classes/class.ilSkillTreeNode.php");
72  foreach ($childs as $c) {
73  $this->parent[$c["child"]] = $c["parent"];
74  if ($this->draft[$c["parent"]]) {
75  $this->draft[$c["child"]] = true;
76  } else {
77  $this->draft[$c["child"]] = (ilSkillTreeNode::_lookupStatus($c["child"]) == ilSkillTreeNode::STATUS_DRAFT);
78  }
79  }
80  return $childs;
81  }
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 89 of file class.ilSkillTemplateTreeExplorerGUI.php.

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

90  {
91  $lng = $this->lng;
92 
93  // title
94  $title = $a_node["title"];
95 
96  // root?
97  if ($a_node["type"] == "skrt") {
98  $title = $lng->txt("skmg_skill_templates");
99  } else {
100  if ($a_node["type"] == "sktr") {
101  include_once("./Services/Skill/classes/class.ilSkillTemplateReference.php");
102  $tid = ilSkillTemplateReference::_lookupTemplateId($a_node["child"]);
103  $title .= " (" . ilSkillTreeNode::_lookupTitle($tid) . ")";
104  }
105  if (ilSkillTreeNode::_lookupSelfEvaluation($a_node["child"])) {
106  $title = "<u>" . $title . "</u>";
107  }
108  }
109 
110  return $title;
111  }
static _lookupSelfEvaluation($a_obj_id)
Lookup self evaluation.
static _lookupTemplateId($a_obj_id)
Lookup template ID.
static _lookupTitle($a_obj_id, $a_tref_id=0)
Lookup Title.
+ 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 161 of file class.ilSkillTemplateTreeExplorerGUI.php.

References $_GET, $ctrl, $ilCtrl, and $ret.

162  {
164 
165  switch ($a_node["type"]) {
166  // root
167  case "skrt":
168  $ilCtrl->setParameterByClass("ilskillrootgui", "obj_id", $a_node["child"]);
169  $ret = $ilCtrl->getLinkTargetByClass("ilskillrootgui", "listTemplates");
170  $ilCtrl->setParameterByClass("ilskillrootgui", "obj_id", $_GET["obj_id"]);
171  return $ret;
172  break;
173 
174  // template
175  case "sktp":
176  $ilCtrl->setParameterByClass("ilbasicskilltemplategui", "obj_id", $a_node["child"]);
177  $ret = $ilCtrl->getLinkTargetByClass("ilbasicskilltemplategui", "edit");
178  $ilCtrl->setParameterByClass("ilbasicskilltemplategui", "obj_id", $_GET["obj_id"]);
179  return $ret;
180  break;
181 
182  // template category
183  case "sctp":
184  $ilCtrl->setParameterByClass("ilskilltemplatecategorygui", "obj_id", $a_node["child"]);
185  $ret = $ilCtrl->getLinkTargetByClass("ilskilltemplatecategorygui", "listItems");
186  $ilCtrl->setParameterByClass("ilskilltemplatecategorygui", "obj_id", $_GET["obj_id"]);
187  return $ret;
188  break;
189 
190  }
191  }
$_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 119 of file class.ilSkillTemplateTreeExplorerGUI.php.

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

120  {
121  // root?
122  if ($a_node["type"] == "skrt") {
123  $icon = ilUtil::getImagePath("icon_sctp.svg");
124  } else {
125  if (in_array($a_node["type"], array("skll", "scat", "sctr", "sktr"))) {
127  $a_node["child"],
128  $a_node["type"],
129  "",
130  $this->draft[$a_node["child"]]
131  );
132  } else {
133  $icon = ilUtil::getImagePath("icon_" . $a_node["type"] . ".svg");
134  }
135  }
136 
137  return $icon;
138  }
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)
+ Here is the call graph for this function:

◆ getNodeIconAlt()

ilSkillTemplateTreeExplorerGUI::getNodeIconAlt (   $a_node)

Get node icon alt attribute.

Parameters
mixed$a_nodenode object/array
Returns
string image alt attribute

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

References $lng.

200  {
201  $lng = $this->lng;
202 
203  if ($lng->exists("skmg_" . $a_node["type"])) {
204  return $lng->txt("skmg_" . $a_node["type"]);
205  }
206 
207  return $lng->txt($a_node["type"]);
208  }

◆ getRootNode()

ilSkillTemplateTreeExplorerGUI::getRootNode ( )

Get root node.

Returns
array node data

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

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

55  {
56  $path = $this->getTree()->getPathId($_GET["obj_id"]);
57  return $this->getTree()->getNodeData($path[1]);
58  }
$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 146 of file class.ilSkillTemplateTreeExplorerGUI.php.

References $_GET.

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

Field Documentation

◆ $ctrl

ilSkillTemplateTreeExplorerGUI::$ctrl
protected

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

Referenced by getNodeHref().

◆ $lng

ilSkillTemplateTreeExplorerGUI::$lng
protected

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

Referenced by getNodeContent(), and getNodeIconAlt().


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