ILIAS  release_7 Revision v7.30-3-g800a261c036
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 ($new=false)
 Get HTML. More...
 
 getChildren ($node, $environment=null)
 Get a list of records (that list can also be empty).Each record will be relayed to $this->build to retrieve a Node. Also, each record will be asked for Sub-Nodes using this function.
Returns
array
More...
 
 build (\ILIAS\UI\Component\Tree\Node\Factory $factory, $record, $environment=null)
 
 getTreeLabel ()
 
 getTreeComponent ()
 Get Tree UI. More...
 
 toggleExplorerNodeState ()
 Should be called by an ilCtrl-enabled command class if a tree node toggle action should be processed. 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 ($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...
 
- Public Member Functions inherited from ILIAS\UI\Component\Tree\TreeRecursion
 getChildren ( $record, $environment=null)
 Get a list of records (that list can also be empty). More...
 
 build (Node\Factory $factory, $record, $environment=null)
 Build and return a Node. More...
 

Protected Attributes

 $lng
 
 $ctrl
 
- Protected Attributes inherited from ilTreeExplorerGUI
 $lng
 
 $httpRequest
 
 $tree = null
 
 $tree_label = ""
 
 $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()
 
 $ui
 
- 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 = ""
 
 $open_nodes = []
 
 $store
 
 $parent_obj
 
 $child_limit = 0
 
 $parent_cmd = ''
 

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 ()
 
 createNode (\ILIAS\UI\Component\Tree\Node\Factory $factory, $record)
 Creates at tree node, can be overwritten in derivatives if another node type should be used. More...
 
 getNodeStateToggleCmdClasses ($record)
 Should return an array of ilCtrl-enabled command classes which should be used to build the URL for the expand/collapse actions applied on a tree node. More...
 
 render ()
 Render tree. More...
 
- 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 = "./node_modules/jstree/dist/jstree.js"
 
static $js_tree_path_css = "./node_modules/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

Definition at line 10 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 28 of file class.ilSkillTemplateTreeExplorerGUI.php.

29 {
30 global $DIC;
31
32 $this->lng = $DIC->language();
33 $this->ctrl = $DIC->ctrl();
34 $tree = new ilSkillTree();
35 parent::__construct("skill_exp", $a_parent_obj, $a_parent_cmd, $tree);
36
37 $this->setTypeWhiteList(array("skrt", "sktp", "sctp"));
38
39 $this->setSkipRootNode(false);
40 $this->setAjax(true);
41 $this->setOrderField("order_nr");
42 }
setSkipRootNode($a_val)
Set skip root node.
setTypeWhiteList($a_val)
Set type white list.
setOrderField($a_val, $a_numeric=false)
Set order field.
global $DIC
Definition: goto.php:24
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc

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

+ 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

Reimplemented from ilTreeExplorerGUI.

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

63 {
64 $childs = parent::getChildsOfNode($a_parent_id);
65
66 foreach ($childs as $c) {
67 $this->parent[$c["child"]] = $c["parent"];
68 if ($this->draft[$c["parent"]]) {
69 $this->draft[$c["child"]] = true;
70 } else {
71 $this->draft[$c["child"]] = (ilSkillTreeNode::_lookupStatus($c["child"]) == ilSkillTreeNode::STATUS_DRAFT);
72 }
73 }
74 return $childs;
75 }
static _lookupStatus($a_obj_id)
Lookup Status.
$c
Definition: cli.php:37

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

+ Here is the call graph for this function:

◆ getNodeContent()

ilSkillTemplateTreeExplorerGUI::getNodeContent (   $a_node)

Get node content.

Parameters
array
Returns

Reimplemented from ilExplorerBaseGUI.

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

84 {
86
87 // title
88 $title = $a_node["title"];
89
90 // root?
91 if ($a_node["type"] == "skrt") {
92 $title = $lng->txt("skmg_skill_templates");
93 } else {
94 if ($a_node["type"] == "sktr") {
95 $tid = ilSkillTemplateReference::_lookupTemplateId($a_node["child"]);
96 $title .= " (" . ilSkillTreeNode::_lookupTitle($tid) . ")";
97 }
98 if (ilSkillTreeNode::_lookupSelfEvaluation($a_node["child"])) {
99 $title = "<u>" . $title . "</u>";
100 }
101 }
102
103 return $title;
104 }
static _lookupTemplateId($a_obj_id)
Lookup template ID.
static _lookupSelfEvaluation($a_obj_id)
Lookup self evaluation.
static _lookupTitle($a_obj_id, $a_tref_id=0)
Lookup Title.

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

+ 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

Reimplemented from ilExplorerBaseGUI.

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

155 {
156 $ilCtrl = $this->ctrl;
157
158 switch ($a_node["type"]) {
159 // root
160 case "skrt":
161 $ilCtrl->setParameterByClass("ilskillrootgui", "obj_id", $a_node["child"]);
162 $ret = $ilCtrl->getLinkTargetByClass(["ilAdministrationGUI", "ilObjSkillManagementGUI","ilskillrootgui"], "listTemplates");
163 $ilCtrl->setParameterByClass("ilskillrootgui", "obj_id", $_GET["obj_id"]);
164 return $ret;
165 break;
166
167 // template
168 case "sktp":
169 $ilCtrl->setParameterByClass("ilbasicskilltemplategui", "obj_id", $a_node["child"]);
170 $ret = $ilCtrl->getLinkTargetByClass(["ilAdministrationGUI", "ilObjSkillManagementGUI","ilbasicskilltemplategui"], "edit");
171 $ilCtrl->setParameterByClass("ilbasicskilltemplategui", "obj_id", $_GET["obj_id"]);
172 return $ret;
173 break;
174
175 // template category
176 case "sctp":
177 $ilCtrl->setParameterByClass("ilskilltemplatecategorygui", "obj_id", $a_node["child"]);
178 $ret = $ilCtrl->getLinkTargetByClass(["ilAdministrationGUI", "ilObjSkillManagementGUI","ilskilltemplatecategorygui"], "listItems");
179 $ilCtrl->setParameterByClass("ilskilltemplatecategorygui", "obj_id", $_GET["obj_id"]);
180 return $ret;
181 break;
182
183 }
184 }
$_GET["client_id"]
$ret
Definition: parser.php:6

References $_GET, $ctrl, and $ret.

◆ getNodeIcon()

ilSkillTemplateTreeExplorerGUI::getNodeIcon (   $a_node)

Get node content.

Parameters
array
Returns

Reimplemented from ilExplorerBaseGUI.

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

113 {
114 // root?
115 if ($a_node["type"] == "skrt") {
116 $icon = ilUtil::getImagePath("icon_sctp.svg");
117 } else {
118 if (in_array($a_node["type"], array("skll", "scat", "sctr", "sktr"))) {
120 $a_node["child"],
121 $a_node["type"],
122 "",
123 $this->draft[$a_node["child"]]
124 );
125 } else {
126 $icon = ilUtil::getImagePath("icon_" . $a_node["type"] . ".svg");
127 }
128 }
129
130 return $icon;
131 }
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)

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

+ 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

Reimplemented from ilTreeExplorerGUI.

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

193 {
195
196 if ($lng->exists("skmg_" . $a_node["type"])) {
197 return $lng->txt("skmg_" . $a_node["type"]);
198 }
199
200 return $lng->txt($a_node["type"]);
201 }

References $lng.

◆ getRootNode()

ilSkillTemplateTreeExplorerGUI::getRootNode ( )

Get root node.

Returns
array node data

Reimplemented from ilTreeExplorerGUI.

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

50 {
51 $path = $this->getTree()->getPathId($_GET["obj_id"]);
52 return $this->getTree()->getNodeData($path[1]);
53 }

References $_GET, and ilTreeExplorerGUI\getTree().

+ 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

Reimplemented from ilExplorerBaseGUI.

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

140 {
141 if ($a_node["child"] == $_GET["obj_id"] ||
142 ($_GET["obj_id"] == "" && $a_node["type"] == "skrt")) {
143 return true;
144 }
145 return false;
146 }

References $_GET.

Field Documentation

◆ $ctrl

ilSkillTemplateTreeExplorerGUI::$ctrl
protected

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

Referenced by getNodeHref().

◆ $lng

ilSkillTemplateTreeExplorerGUI::$lng
protected

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

Referenced by getNodeContent(), and getNodeIconAlt().


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