ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilSkillTreeExplorerGUI Class Reference

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

+ Inheritance diagram for ilSkillTreeExplorerGUI:
+ Collaboration diagram for ilSkillTreeExplorerGUI:

Public Member Functions

 __construct ($a_parent_obj, string $a_parent_cmd, int $tree_id=0)
 
 getNodeContent ($a_node)
 
Parameters
array | object$a_node
Returns
string
More...
 
 getNodeIcon ($a_node)
 
Parameters
array | object$a_node
Returns
string
More...
 
 isNodeHighlighted ($a_node)
 Is node highlighted?
Parameters
object | array$a_nodenode
Returns
bool node highlighted true/false
More...
 
 getNodeHref ($a_node)
 
Parameters
array | object$a_node
Returns
string
More...
 
 isNodeClickable ($a_node)
 
Parameters
array | object$a_node
Returns
bool
More...
 
- Public Member Functions inherited from ilVirtualSkillTreeExplorerGUI
 __construct (string $a_id, $a_parent_obj, string $a_parent_cmd, int $tree_id=0)
 
 setShowDraftNodes (bool $a_val)
 
 getShowDraftNodes ()
 
 setShowOutdatedNodes (bool $a_val)
 
 getShowOutdatedNodes ()
 
 getRootNode ()
 
 getNodeId ($a_node)
 
 getDomNodeIdForNodeId ($a_node_id)
 Get DOM node id for node id.
Parameters
string$a_node_id
More...
 
 getNodeIdForDomNodeId (string $a_dom_node_id)
 Get node id for dom node id. More...
 
 getChildsOfNode ($a_parent_node_id)
 
 getNodeContent ($a_node)
 
 getNodeIcon ($a_node)
 
 getNodeHref ($a_node)
 
 isNodeClickable ($a_node)
 
 getNodeIconAlt ($a_node)
 
 getHTML ()
 
 getTreeComponent ()
 
 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)
 
- 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

ilLanguage $lng
 
SkillAdminGUIRequest $admin_gui_request
 
int $requested_skill_node_id = 0
 
int $requested_tref_id = 0
 
- Protected Attributes inherited from ilVirtualSkillTreeExplorerGUI
ILIAS DI UIServices $ui
 
ilLanguage $lng
 
ilVirtualSkillTree $vtree
 
SkillTreeManager $skill_tree_manager
 
SkillInternalFactoryService $tree_factory
 
bool $show_draft_nodes = false
 
bool $show_outdated_nodes = false
 
- 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 ilVirtualSkillTreeExplorerGUI
 render ()
 
 createNode (\ILIAS\UI\Component\Tree\Node\Factory $factory, $record)
 
- 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.ilSkillTreeExplorerGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilSkillTreeExplorerGUI::__construct (   $a_parent_obj,
string  $a_parent_cmd,
int  $tree_id = 0 
)
Parameters
object | string[]$a_parent_obj
string$a_parent_cmd
int$tree_id

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

41 {
42 global $DIC;
43
44 $this->lng = $DIC->language();
45 $this->ctrl = $DIC->ctrl();
46 $this->admin_gui_request = $DIC->skills()->internal()->gui()->admin_request();
47 parent::__construct("skill_exp", $a_parent_obj, $a_parent_cmd, $tree_id);
48
49 $this->requested_skill_node_id = $this->admin_gui_request->getNodeId();
50 $this->requested_tref_id = $this->admin_gui_request->getTrefId();
51
52 // node should be hidden #26849 (not not hidden, see discussion in #26813 and JF 6 Jan 2020)
53 $this->setSkipRootNode(false);
54 $this->setAjax(false);
55 $this->setShowDraftNodes(true);
56 $this->setShowOutdatedNodes(true);
57 }
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
global $DIC
Definition: shib_login.php:26

References $DIC, ILIAS\GlobalScreen\Provider\__construct(), ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), ilExplorerBaseGUI\setAjax(), ilVirtualSkillTreeExplorerGUI\setShowDraftNodes(), ilVirtualSkillTreeExplorerGUI\setShowOutdatedNodes(), and ilExplorerBaseGUI\setSkipRootNode().

+ Here is the call graph for this function:

Member Function Documentation

◆ getNodeContent()

ilSkillTreeExplorerGUI::getNodeContent (   $a_node)

Parameters
array | object$a_node
Returns
string

Reimplemented from ilVirtualSkillTreeExplorerGUI.

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

62 : string
63 {
65
66 $a_parent_id_parts = explode(":", $a_node["id"]);
67 $a_parent_skl_tree_id = (int) $a_parent_id_parts[0];
68 $a_parent_skl_template_tree_id = isset($a_parent_id_parts[1]) ? (int) $a_parent_id_parts[1] : 0;
69
70 // title
71 $title = $a_node["title"];
72
73 // root?
74 if ($a_node["type"] == "skrt") {
75 $tree_obj = $this->skill_tree_manager->getTree($a_node["skl_tree_id"]);
76 $title = $tree_obj->getTitle();
77 } else {
78 if ($a_node["type"] == "sktr") {
79 $tid = ilSkillTemplateReference::_lookupTemplateId($a_parent_skl_tree_id);
80 $title .= " (" . ilSkillTreeNode::_lookupTitle($tid) . ")";
81 }
82
83 // @todo: fix this if possible for skill/tref_id combination
84 if (ilSkillTreeNode::_lookupSelfEvaluation($a_parent_skl_tree_id)) {
85 if ($a_parent_skl_template_tree_id == 0 || $a_node["type"] == "sktr") {
86 $title = "<u>" . $title . "</u>";
87 }
88 }
89 }
90
91 if ($this->vtree->isOutdated($a_node["id"])) {
92 $title = "<span class='light'>" . $title . "</span>";
93 }
94
95 return $title;
96 }
static _lookupSelfEvaluation(int $a_obj_id)
static _lookupTitle(int $a_obj_id, int $a_tref_id=0)

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

+ Here is the call graph for this function:

◆ getNodeHref()

ilSkillTreeExplorerGUI::getNodeHref (   $a_node)

Parameters
array | object$a_node
Returns
string

Reimplemented from ilVirtualSkillTreeExplorerGUI.

Definition at line 155 of file class.ilSkillTreeExplorerGUI.php.

155 : string
156 {
157 $ilCtrl = $this->ctrl;
158
159 $id_parts = explode(":", $a_node["id"]);
160 if (!isset($id_parts[1]) || $id_parts[1] == 0) {
161 // skill in main tree
162 $skill_id = $id_parts[0];
163 $tref_id = 0;
164 } else {
165 // skill in template
166 $tref_id = $id_parts[0];
167 $skill_id = $id_parts[1];
168 }
169
170 $gui_class = array(
171 "skrt" => "ilskillrootgui",
172 "scat" => "ilskillcategorygui",
173 "sktr" => "ilskilltemplatereferencegui",
174 "skll" => "ilbasicskillgui",
175 "sktp" => "ilbasicskilltemplategui",
176 "sctp" => "ilskilltemplatecategorygui"
177 );
178
179 $cmd = array(
180 "skrt" => "listSkills",
181 "scat" => "listItems",
182 "sktr" => "listItems",
183 "skll" => "edit",
184 "sktp" => "edit",
185 "sctp" => "listItems"
186 );
187
188 $gui_class = $gui_class[$a_node["type"]];
189 $cmd = $cmd[$a_node["type"]];
190
191 $ilCtrl->setParameterByClass($gui_class, "tref_id", $tref_id);
192 $ilCtrl->setParameterByClass($gui_class, "node_id", $skill_id);
193 $ret = $ilCtrl->getLinkTargetByClass(["ilAdministrationGUI", "ilObjSkillManagementGUI",
194 "ilSkillTreeAdminGUI", "ilObjSkillTreeGUI", $gui_class], $cmd);
195 $ilCtrl->setParameterByClass($gui_class, "node_id", $this->requested_skill_node_id);
196 $ilCtrl->setParameterByClass($gui_class, "tref_id", $this->requested_tref_id);
197
198 return $ret;
199 }

References ilExplorerBaseGUI\$ctrl.

◆ getNodeIcon()

ilSkillTreeExplorerGUI::getNodeIcon (   $a_node)

Parameters
array | object$a_node
Returns
string

Reimplemented from ilVirtualSkillTreeExplorerGUI.

Definition at line 101 of file class.ilSkillTreeExplorerGUI.php.

101 : string
102 {
103 $a_parent_id_parts = explode(":", $a_node["id"]);
104 $a_parent_skl_tree_id = (int) $a_parent_id_parts[0];
105 $a_parent_skl_template_tree_id = isset($a_parent_id_parts[1]) ? (int) $a_parent_id_parts[1] : 0;
106
107
108 // root?
109 if ($a_node["type"] == "skrt") {
110 $icon = ilUtil::getImagePath("standard/icon_scat.svg");
111 } elseif (in_array($a_node["type"], array("skll", "scat", "sctr", "sktr", "sctp", "sktp"))) {
113 $a_parent_skl_tree_id,
114 $a_node["type"],
115 "",
116 (int) ($this->vtree->isDraft($a_node["id"]) || $this->vtree->isOutdated($a_node["id"]))
117 );
118 } else {
119 $icon = ilUtil::getImagePath("standard/icon_" . $a_node["type"] . ".svg");
120 }
121
122 return $icon;
123 }
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(), ilUtil\getImagePath(), and ILIAS\Repository\int().

+ Here is the call graph for this function:

◆ isNodeClickable()

ilSkillTreeExplorerGUI::isNodeClickable (   $a_node)

Parameters
array | object$a_node
Returns
bool

Reimplemented from ilVirtualSkillTreeExplorerGUI.

Definition at line 204 of file class.ilSkillTreeExplorerGUI.php.

204 : bool
205 {
206 return true;
207 }

◆ isNodeHighlighted()

ilSkillTreeExplorerGUI::isNodeHighlighted (   $a_node)

Is node highlighted?

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

Reimplemented from ilExplorerBaseGUI.

Definition at line 128 of file class.ilSkillTreeExplorerGUI.php.

128 : bool
129 {
130 $id_parts = explode(":", $a_node["id"]);
131 if (!isset($id_parts[1]) || $id_parts[1] == 0) {
132 // skill in main tree
133 $skill_id = $id_parts[0];
134 $tref_id = 0;
135 } else {
136 // skill in template
137 $tref_id = $id_parts[0];
138 $skill_id = $id_parts[1];
139 }
140
141 if ($this->requested_skill_node_id == "" && $a_node["type"] == "skrt") {
142 return true;
143 }
144
145 if ($skill_id == $this->requested_skill_node_id &&
146 ($this->requested_tref_id == $tref_id)) {
147 return true;
148 }
149 return false;
150 }

Field Documentation

◆ $admin_gui_request

SkillAdminGUIRequest ilSkillTreeExplorerGUI::$admin_gui_request
protected

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

◆ $lng

ilLanguage ilSkillTreeExplorerGUI::$lng
protected

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

Referenced by getNodeContent().

◆ $requested_skill_node_id

int ilSkillTreeExplorerGUI::$requested_skill_node_id = 0
protected

Definition at line 32 of file class.ilSkillTreeExplorerGUI.php.

◆ $requested_tref_id

int ilSkillTreeExplorerGUI::$requested_tref_id = 0
protected

Definition at line 33 of file class.ilSkillTreeExplorerGUI.php.


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