ILIAS  release_8 Revision v8.24
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, string $a_parent_cmd, int $tree_id)
 
 getRootNode ()
 Get root node. More...
 
 getChildsOfNode ($a_parent_node_id)
 Get childs of node.
Parameters
int | string$a_parent_node_idparent id
Returns
array childs
More...
 
 getNodeContent ($a_node)
 Get content of a node.
Parameters
object | array$a_nodenode array or object
Returns
string content of the node
More...
 
 getNodeIcon ($a_node)
 Get node icon path.
Parameters
object | array$a_node
Returns
string image file path
More...
 
 isNodeHighlighted ($a_node)
 Is node highlighted?
Parameters
object | array$a_nodenode
Returns
bool node highlighted true/false
More...
 
 getNodeHref ($a_node)
 Get href for node.
Parameters
object | array$a_node
Returns
string href attribute
More...
 
 getNodeIconAlt ($a_node)
 Get node icon alt attribute.
Parameters
object | array$a_nodenode
Returns
string image alt attribute
More...
 
- Public Member Functions inherited from ilTreeExplorerGUI
 __construct (string $a_expl_id, $a_parent_obj, string $a_parent_cmd, ilTree $a_tree, string $a_node_parameter_name="node_id")
 
 getTree ()
 
 setOrderField (string $a_val, bool $a_numeric=false)
 
 getOrderField ()
 
 setTypeWhiteList (array $a_val)
 Set type white list. More...
 
 getTypeWhiteList ()
 Get type white list. More...
 
 setTypeBlackList (array $a_val)
 Set type black list. More...
 
 getTypeBlackList ()
 Get type black list. More...
 
 setPreloadChilds (bool $a_val)
 
 getPreloadChilds ()
 
 getSuccessorNode ( $a_node_id, string $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 ($record, $environment=null)
 Get a list of records (that list can also be empty). More...
 
 build (\ILIAS\UI\Component\Tree\Node\Factory $factory, $record, $environment=null)
 
 getTreeLabel ()
 
 getTreeComponent ()
 
 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
 setChildLimit (int $a_val)
 
 getChildLimit ()
 
 setSearchTerm (string $a_val)
 
 getSearchTerm ()
 
 setMainTemplate (ilGlobalTemplateInterface $a_main_tpl=null)
 
 getRootNode ()
 Get root node. More...
 
 getChildsOfNode ($a_parent_node_id)
 Get children 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 children Please note that this standard method may not be optimal depending on what a derived class does in isNodeVisible. More...
 
 sortChilds (array $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 (bool $a_val)
 
 getSkipRootNode ()
 
 setAjax (bool $a_val)
 
 getAjax ()
 
 setSecondaryHighlightedNodes (array $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 (string $a_postvar, bool $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 (bool $a_val)
 
 getOfflineMode ()
 
 handleCommand ()
 Handle explorer internal command. More...
 
 getContainerId ()
 
 openNode ()
 Open node. More...
 
 closeNode ()
 Close node. More...
 
 getNodeAsync ()
 Get node asynchronously. More...
 
 beforeRendering ()
 Before rendering. More...
 
 getOnLoadCode ()
 Get on load code. More...
 
 getHTML ()
 
 renderNode ($a_node, ilTemplate $tpl)
 Render node. More...
 
 renderChilds ($a_node_id, ilTemplate $tpl)
 Render childs. More...
 
 getDomNodeIdForNodeId ($a_node_id)
 Get DOM node id for node id. More...
 
 getNodeIdForDomNodeId (string $a_dom_node_id)
 Get node id for dom node id. More...
 
 listItemStart (ilTemplate $tpl, $a_node)
 List item start. More...
 
 listItemEnd (ilTemplate $tpl)
 
 listStart (ilTemplate $tpl)
 
 listEnd (ilTemplate $tpl)
 
 isNodeOnclickEnabled ()
 
 setNodeOnclickEnabled (bool $nodeOnclickEnabled)
 
 isEnableDnd ()
 
 setEnableDnd (bool $enable_dnd)
 
- 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

SkillAdminGUIRequest $admin_gui_request
 
int $requested_skill_node_id = 0
 
array $parent = []
 
array $draft = []
 
- Protected Attributes inherited from ilTreeExplorerGUI
ilLanguage $lng
 
Psr Http Message ServerRequestInterface $httpRequest
 
ilTree $tree = null
 
string $tree_label = ""
 
string $order_field = ""
 
bool $order_field_numeric = false
 
array $type_white_list = array()
 
array $type_black_list = array()
 
array $childs = array()
 
bool $preloaded = false
 
bool $preload_childs = false
 
array $root_node_data = null
 
array $all_childs = array()
 
 $root_id = 0
 
ILIAS DI UIServices $ui
 
- Protected Attributes inherited from ilExplorerBaseGUI
string $node_parameter_name
 
ilLogger $log
 
ilCtrl $ctrl
 
ilGlobalTemplateInterface $tpl
 
bool $skip_root_node = false
 
bool $ajax = false
 
array $custom_open_nodes = array()
 
array $selected_nodes = array()
 
string $select_postvar = ""
 
bool $offline_mode = false
 
array $sec_highl_nodes = array()
 
bool $enable_dnd = false
 
string $search_term = ""
 
array $open_nodes = []
 
ilSessionIStorage $store
 
bool $select_multi = false
 
 $parent_obj
 
int $child_limit = 0
 
string $parent_cmd = ''
 
string $requested_exp_cmd = ""
 
string $requested_exp_cont = ""
 
string $requested_searchterm = ""
 
string $requested_node_id = ""
 
string $id
 

Additional Inherited Members

- Static Public Member Functions inherited from ilExplorerBaseGUI
static getLocalExplorerJsPath ()
 
static getLocalJsTreeJsPath ()
 
static getLocalJsTreeCssPath ()
 
static createHTMLExportDirs (string $a_target_dir)
 
static init (ilGlobalTemplateInterface $a_main_tpl=null)
 
- Protected Member Functions inherited from ilTreeExplorerGUI
 preloadChilds ()
 
 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 ()
 
- 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 ()
 
 isNodeRequested (string $a_node_id)
 
- Static Protected Attributes inherited from ilExplorerBaseGUI
static string $js_tree_path = "./node_modules/jstree/dist/jstree.js"
 
static string $js_tree_path_css = "./node_modules/jstree/dist/themes/default/style.min.css"
 
static string $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 27 of file class.ilSkillTemplateTreeExplorerGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilSkillTemplateTreeExplorerGUI::__construct (   $a_parent_obj,
string  $a_parent_cmd,
int  $tree_id 
)
Parameters
object | string[]$a_parent_objparent gui object(s)
string$a_parent_cmdparent command

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

45 {
46 global $DIC;
47
48 $this->lng = $DIC->language();
49 $this->ctrl = $DIC->ctrl();
50 $this->admin_gui_request = $DIC->skills()->internal()->gui()->admin_request();
51 $tree = $DIC->skills()->internal()->factory()->tree()->getTreeById($tree_id);
52 parent::__construct("skill_exp", $a_parent_obj, $a_parent_cmd, $tree);
53
54 $this->requested_skill_node_id = $this->admin_gui_request->getNodeId();
55
56 $this->setTypeWhiteList(array("skrt", "sktp", "sctp"));
57
58 $this->setSkipRootNode(false);
59 $this->setAjax(true);
60 $this->setOrderField("order_nr");
61 }
setOrderField(string $a_val, bool $a_numeric=false)
setTypeWhiteList(array $a_val)
Set type white list.
global $DIC
Definition: feed.php:28
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc

References $DIC, ilTreeExplorerGUI\$tree, ILIAS\GlobalScreen\Provider\__construct(), ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), 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_node_id)

Get childs of node.

Parameters
int | string$a_parent_node_idparent id
Returns
array childs

Reimplemented from ilTreeExplorerGUI.

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

72 : array
73 {
74 $childs = parent::getChildsOfNode($a_parent_node_id);
75
76 foreach ($childs as $c) {
77 $this->parent[$c["child"]] = $c["parent"];
78 if ($this->draft[$c["parent"]]) {
79 $this->draft[$c["child"]] = true;
80 } else {
81 $this->draft[$c["child"]] = (ilSkillTreeNode::_lookupStatus($c["child"]) == ilSkillTreeNode::STATUS_DRAFT);
82 }
83 }
84 return $childs;
85 }
static _lookupStatus(int $a_obj_id)
$c
Definition: cli.php:38

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

+ Here is the call graph for this function:

◆ getNodeContent()

ilSkillTemplateTreeExplorerGUI::getNodeContent (   $a_node)

Get content of a node.

Parameters
object | array$a_nodenode array or object
Returns
string content of the node

Reimplemented from ilExplorerBaseGUI.

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

90 : string
91 {
93
94 // title
95 $title = $a_node["title"];
96
97 // root?
98 if ($a_node["type"] == "skrt") {
99 $title = $lng->txt("skmg_skill_templates");
100 } else {
101 if ($a_node["type"] == "sktr") {
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 }
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
static _lookupSelfEvaluation(int $a_obj_id)
static _lookupTitle(int $a_obj_id, int $a_tref_id=0)

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

+ Here is the call graph for this function:

◆ getNodeHref()

ilSkillTemplateTreeExplorerGUI::getNodeHref (   $a_node)

Get href for node.

Parameters
object | array$a_node
Returns
string href attribute

Reimplemented from ilExplorerBaseGUI.

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

150 : string
151 {
152 $ilCtrl = $this->ctrl;
153
154 switch ($a_node["type"]) {
155 // root
156 case "skrt":
157 $ilCtrl->setParameterByClass("ilskillrootgui", "node_id", $a_node["child"]);
158 $ret = $ilCtrl->getLinkTargetByClass(["ilAdministrationGUI",
159 "ilObjSkillManagementGUI",
160 "ilSkillTreeAdminGUI",
161 "ilObjSkillTreeGUI",
162 "ilskillrootgui"
163 ], "listTemplates");
164 $ilCtrl->setParameterByClass("ilskillrootgui", "node_id", $this->requested_skill_node_id);
165 return $ret;
166
167 // template
168 case "sktp":
169 $ilCtrl->setParameterByClass("ilbasicskilltemplategui", "node_id", $a_node["child"]);
170 $ret = $ilCtrl->getLinkTargetByClass(["ilAdministrationGUI",
171 "ilObjSkillManagementGUI",
172 "ilSkillTreeAdminGUI",
173 "ilObjSkillTreeGUI",
174 "ilbasicskilltemplategui"
175 ], "edit");
176 $ilCtrl->setParameterByClass("ilbasicskilltemplategui", "node_id", $this->requested_skill_node_id);
177 return $ret;
178
179 // template category
180 case "sctp":
181 $ilCtrl->setParameterByClass("ilskilltemplatecategorygui", "node_id", $a_node["child"]);
182 $ret = $ilCtrl->getLinkTargetByClass(["ilAdministrationGUI",
183 "ilObjSkillManagementGUI",
184 "ilSkillTreeAdminGUI",
185 "ilObjSkillTreeGUI",
186 "ilskilltemplatecategorygui"
187 ], "listItems");
188 $ilCtrl->setParameterByClass("ilskilltemplatecategorygui", "node_id", $this->requested_skill_node_id);
189 return $ret;
190
191 default:
192 return "";
193 }
194 }
setParameterByClass(string $a_class, string $a_parameter, $a_value)
@inheritDoc

References ilExplorerBaseGUI\$ctrl, and ilCtrl\setParameterByClass().

+ Here is the call graph for this function:

◆ getNodeIcon()

ilSkillTemplateTreeExplorerGUI::getNodeIcon (   $a_node)

Get node icon path.

Parameters
object | array$a_node
Returns
string image file path

Reimplemented from ilExplorerBaseGUI.

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

116 : string
117 {
118 // root?
119 if ($a_node["type"] == "skrt") {
120 $icon = ilUtil::getImagePath("icon_sctp.svg");
121 } elseif (in_array($a_node["type"], array("skll", "scat", "sctr", "sktr"))) {
123 $a_node["child"],
124 $a_node["type"],
125 "",
126 $this->draft[$a_node["child"]]
127 );
128 } else {
129 $icon = ilUtil::getImagePath("icon_" . $a_node["type"] . ".svg");
130 }
131
132 return $icon;
133 }
static getIconPath(int $a_obj_id, string $a_type, string $a_size="", int $a_status=0)
static getImagePath(string $img, string $module_path="", string $mode="output", bool $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
object | array$a_nodenode
Returns
string image alt attribute

Reimplemented from ilTreeExplorerGUI.

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

199 : string
200 {
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 }
exists(string $a_topic)
Check if language entry exists.

References ilTreeExplorerGUI\$lng, ilLanguage\exists(), and ilLanguage\txt().

+ Here is the call graph for this function:

◆ getRootNode()

ilSkillTemplateTreeExplorerGUI::getRootNode ( )

Get root node.

Returns
object|array node

Reimplemented from ilTreeExplorerGUI.

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

63 : array
64 {
65 $path = $this->getTree()->getPathId($this->requested_skill_node_id);
66 return $this->getTree()->getNodeData($path[1]);
67 }
$path
Definition: ltiservices.php:32

References $path, and ilTreeExplorerGUI\getTree().

+ Here is the call graph for this function:

◆ isNodeHighlighted()

ilSkillTemplateTreeExplorerGUI::isNodeHighlighted (   $a_node)

Is node highlighted?

Parameters
object | array$a_nodenode
Returns
bool node highlighted true/false

Reimplemented from ilExplorerBaseGUI.

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

138 : bool
139 {
140 if ($a_node["child"] == $this->requested_skill_node_id ||
141 ($this->requested_skill_node_id == "" && $a_node["type"] == "skrt")) {
142 return true;
143 }
144 return false;
145 }

Field Documentation

◆ $admin_gui_request

SkillAdminGUIRequest ilSkillTemplateTreeExplorerGUI::$admin_gui_request
protected

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

◆ $draft

array ilSkillTemplateTreeExplorerGUI::$draft = []
protected

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

◆ $parent

array ilSkillTemplateTreeExplorerGUI::$parent = []
protected

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

◆ $requested_skill_node_id

int ilSkillTemplateTreeExplorerGUI::$requested_skill_node_id = 0
protected

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


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