ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
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 = "assets/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 28 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 45 of file class.ilSkillTemplateTreeExplorerGUI.php.

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

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 73 of file class.ilSkillTemplateTreeExplorerGUI.php.

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

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 91 of file class.ilSkillTemplateTreeExplorerGUI.php.

91 : string
92 {
94
95 // title
96 $title = $a_node["title"];
97
98 // root?
99 if ($a_node["type"] == "skrt") {
100 $title = $lng->txt("skmg_skill_templates");
101 } else {
102 if ($a_node["type"] == "sktr") {
103 $tid = ilSkillTemplateReference::_lookupTemplateId((int) $a_node["child"]);
104 $title .= " (" . ilSkillTreeNode::_lookupTitle($tid) . ")";
105 }
106 if (ilSkillTreeNode::_lookupSelfEvaluation((int) $a_node["child"])) {
107 $title = "<u>" . $title . "</u>";
108 }
109 }
110
111 return $title;
112 }
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 151 of file class.ilSkillTemplateTreeExplorerGUI.php.

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

117 : string
118 {
119 // root?
120 if ($a_node["type"] == "skrt") {
121 $icon = ilUtil::getImagePath("standard/icon_sctp.svg");
122 } elseif (in_array($a_node["type"], array("skll", "scat", "sctr", "sktr"))) {
124 $a_node["child"],
125 $a_node["type"],
126 "",
127 (int) $this->draft[$a_node["child"]]
128 );
129 } else {
130 $icon = ilUtil::getImagePath("standard/icon_" . $a_node["type"] . ".svg");
131 }
132
133 return $icon;
134 }
static getIconPath(int $a_obj_id, string $a_type, string $a_size="", int $a_status=0)
static getImagePath(string $image_name, 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 200 of file class.ilSkillTemplateTreeExplorerGUI.php.

200 : string
201 {
203
204 if ($lng->exists("skmg_" . $a_node["type"])) {
205 return $lng->txt("skmg_" . $a_node["type"]);
206 }
207
208 return $lng->txt($a_node["type"]);
209 }
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 64 of file class.ilSkillTemplateTreeExplorerGUI.php.

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

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 139 of file class.ilSkillTemplateTreeExplorerGUI.php.

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

Field Documentation

◆ $admin_gui_request

SkillAdminGUIRequest ilSkillTemplateTreeExplorerGUI::$admin_gui_request
protected

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

◆ $draft

array ilSkillTemplateTreeExplorerGUI::$draft = []
protected

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

◆ $parent

array ilSkillTemplateTreeExplorerGUI::$parent = []
protected

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

◆ $requested_skill_node_id

int ilSkillTemplateTreeExplorerGUI::$requested_skill_node_id = 0
protected

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


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