ILIAS  release_8 Revision v8.24
ilVirtualSkillTreeExplorerGUI Class Reference

Virtual skill tree explorer. More...

+ Inheritance diagram for ilVirtualSkillTreeExplorerGUI:
+ Collaboration diagram for ilVirtualSkillTreeExplorerGUI:

Public Member Functions

 __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)
 
- 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)
 

Protected Attributes

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 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

Virtual skill tree explorer.

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.ilVirtualSkillTreeExplorerGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilVirtualSkillTreeExplorerGUI::__construct ( string  $a_id,
  $a_parent_obj,
string  $a_parent_cmd,
int  $tree_id = 0 
)

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

39 {
40 global $DIC;
41
42 $this->lng = $DIC->language();
43 $this->ctrl = $DIC->ctrl();
44 parent::__construct($a_id, $a_parent_obj, $a_parent_cmd);
45
46 $this->skill_tree_manager = $DIC->skills()->internal()->manager()->getTreeManager();
47 $this->tree_factory = $DIC->skills()->internal()->factory();
48
49 if ($tree_id == 0) {
50 $this->vtree = $this->tree_factory->tree()->getGlobalVirtualTree();
51 } else {
52 $this->vtree = $this->tree_factory->tree()->getVirtualTreeById($tree_id);
53 }
54
55 $this->setSkipRootNode(false);
56 $this->setAjax(false);
57 }
global $DIC
Definition: feed.php:28
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc

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

+ Here is the call graph for this function:

Member Function Documentation

◆ getChildsOfNode()

ilVirtualSkillTreeExplorerGUI::getChildsOfNode (   $a_parent_node_id)
Parameters
string$a_parent_node_id
Returns
array{cskill_id: string, id: string, skill_id: string, tref_id: string, parent: string}[]

Reimplemented from ilExplorerBaseGUI.

Definition at line 119 of file class.ilVirtualSkillTreeExplorerGUI.php.

119 : array
120 {
121 return $this->vtree->getChildsOfNode($a_parent_node_id);
122 }

◆ getDomNodeIdForNodeId()

ilVirtualSkillTreeExplorerGUI::getDomNodeIdForNodeId (   $a_node_id)

Get DOM node id for node id.

Parameters
string$a_node_id

Reimplemented from ilExplorerBaseGUI.

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

101 : string
102 {
103 return parent::getDomNodeIdForNodeId(str_replace(":", "_", $a_node_id));
104 }

◆ getNodeContent()

ilVirtualSkillTreeExplorerGUI::getNodeContent (   $a_node)
Parameters
array | object$a_node
Returns
string

Reimplemented from ilExplorerBaseGUI.

Reimplemented in ilSkillTreeExplorerGUI.

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

128 : string
129 {
131
132 $a_parent_id_parts = explode(":", (string) $a_node["id"]);
133 $a_parent_skl_tree_id = (int) $a_parent_id_parts[0];
134 $a_parent_skl_template_tree_id = isset($a_parent_id_parts[1]) ? (int) $a_parent_id_parts[1] : 0;
135
136 // title
137 if ((int) $a_node["parent"] == 0) {
138 $tree_obj = $this->skill_tree_manager->getTree($a_node["skl_tree_id"]);
139 $title = $tree_obj->getTitle();
140 } else {
141 $title = $a_node["title"];
142 }
143
144 // root?
145 if ($a_node["type"] == "skrt") {
146 $lng->txt("skmg_skills");
147 }
148
149 return $title;
150 }
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...

References $lng, ILIAS\Repository\int(), and ilLanguage\txt().

+ Here is the call graph for this function:

◆ getNodeHref()

ilVirtualSkillTreeExplorerGUI::getNodeHref (   $a_node)
Parameters
array | object$a_node
Returns
string

Reimplemented from ilExplorerBaseGUI.

Reimplemented in ilSkillSelectorGUI, and ilSkillTreeExplorerGUI.

Definition at line 185 of file class.ilVirtualSkillTreeExplorerGUI.php.

185 : string
186 {
187 $ilCtrl = $this->ctrl;
188
189 // we have a tree id like <skl_tree_id>:<skl_template_tree_id> here
190 // use this, if you want a "common" skill id in format <skill_id>:<tref_id>
191 $id_parts = explode(":", (string) $a_node["id"]);
192 if (!isset($id_parts[1]) || $id_parts[1] == 0) {
193 // skill in main tree
194 $skill_id = $a_node["id"];
195 } else {
196 // skill in template
197 $skill_id = $id_parts[1] . ":" . $id_parts[0];
198 }
199
200 return "";
201 }

References ilExplorerBaseGUI\$ctrl.

◆ getNodeIcon()

ilVirtualSkillTreeExplorerGUI::getNodeIcon (   $a_node)
Parameters
array | object$a_node
Returns
string

Reimplemented from ilExplorerBaseGUI.

Reimplemented in ilSkillTreeExplorerGUI.

Definition at line 156 of file class.ilVirtualSkillTreeExplorerGUI.php.

156 : string
157 {
158 $a_id_parts = explode(":", (string) $a_node["id"]);
159 $a_skl_template_tree_id = isset($a_id_parts[1]) ? (int) $a_id_parts[1] : 0;
160
161 // root?
162 if ($a_node["type"] == "skrt") {
163 $icon = ilUtil::getImagePath("icon_scat.svg");
164 } else {
165 $type = $a_node["type"];
166 if ($type == "sktr") {
167 $type = ilSkillTreeNode::_lookupType($a_skl_template_tree_id);
168 }
169 if ($type == "sktp") {
170 $type = "skll";
171 }
172 if ($type == "sctp") {
173 $type = "scat";
174 }
175 $icon = ilUtil::getImagePath("icon_" . $type . ".svg");
176 }
177
178 return $icon;
179 }
static _lookupType(int $a_obj_id)
static getImagePath(string $img, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
$type

References $type, ilSkillTreeNode\_lookupType(), ilUtil\getImagePath(), and ILIAS\Repository\int().

+ Here is the call graph for this function:

◆ getNodeIconAlt()

ilVirtualSkillTreeExplorerGUI::getNodeIconAlt (   $a_node)
Parameters
array | object$a_node
Returns
string

Reimplemented from ilExplorerBaseGUI.

Definition at line 216 of file class.ilVirtualSkillTreeExplorerGUI.php.

216 : string
217 {
219
220 if ($lng->exists("skmg_" . $a_node["type"])) {
221 return $lng->txt("skmg_" . $a_node["type"]);
222 }
223
224 return $lng->txt($a_node["type"]);
225 }
exists(string $a_topic)
Check if language entry exists.

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

+ Here is the call graph for this function:

◆ getNodeId()

ilVirtualSkillTreeExplorerGUI::getNodeId (   $a_node)
Parameters
array | object$a_node
Returns
string

Reimplemented from ilExplorerBaseGUI.

Definition at line 93 of file class.ilVirtualSkillTreeExplorerGUI.php.

93 : string
94 {
95 return $a_node["id"];
96 }

◆ getNodeIdForDomNodeId()

ilVirtualSkillTreeExplorerGUI::getNodeIdForDomNodeId ( string  $a_dom_node_id)

Get node id for dom node id.

Reimplemented from ilExplorerBaseGUI.

Definition at line 109 of file class.ilVirtualSkillTreeExplorerGUI.php.

109 : string
110 {
111 $id = parent::getNodeIdForDomNodeId($a_dom_node_id);
112 return str_replace("_", ":", $id);
113 }

References ilExplorerBaseGUI\$id.

◆ getRootNode()

ilVirtualSkillTreeExplorerGUI::getRootNode ( )
Returns
array{id: string, cskill_id: string}

Reimplemented from ilExplorerBaseGUI.

Definition at line 84 of file class.ilVirtualSkillTreeExplorerGUI.php.

84 : array
85 {
86 return $this->vtree->getRootNode();
87 }

◆ getShowDraftNodes()

ilVirtualSkillTreeExplorerGUI::getShowDraftNodes ( )

◆ getShowOutdatedNodes()

ilVirtualSkillTreeExplorerGUI::getShowOutdatedNodes ( )

◆ isNodeClickable()

ilVirtualSkillTreeExplorerGUI::isNodeClickable (   $a_node)
Parameters
array | object$a_node
Returns
bool

Reimplemented from ilExplorerBaseGUI.

Reimplemented in ilSkillSelectorGUI, and ilSkillTreeExplorerGUI.

Definition at line 207 of file class.ilVirtualSkillTreeExplorerGUI.php.

207 : bool
208 {
209 return false;
210 }

◆ setShowDraftNodes()

ilVirtualSkillTreeExplorerGUI::setShowDraftNodes ( bool  $a_val)

Definition at line 59 of file class.ilVirtualSkillTreeExplorerGUI.php.

59 : void
60 {
61 $this->show_draft_nodes = $a_val;
62 $this->vtree->setIncludeDrafts($a_val);
63 }

Referenced by ilSkillTreeExplorerGUI\__construct().

+ Here is the caller graph for this function:

◆ setShowOutdatedNodes()

ilVirtualSkillTreeExplorerGUI::setShowOutdatedNodes ( bool  $a_val)

Definition at line 70 of file class.ilVirtualSkillTreeExplorerGUI.php.

70 : void
71 {
72 $this->show_outdated_nodes = $a_val;
73 $this->vtree->setIncludeOutdated($a_val);
74 }

Referenced by ilSkillTreeExplorerGUI\__construct().

+ Here is the caller graph for this function:

Field Documentation

◆ $lng

ilLanguage ilVirtualSkillTreeExplorerGUI::$lng
protected

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

Referenced by getNodeContent(), and getNodeIconAlt().

◆ $show_draft_nodes

bool ilVirtualSkillTreeExplorerGUI::$show_draft_nodes = false
protected

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

Referenced by getShowDraftNodes().

◆ $show_outdated_nodes

bool ilVirtualSkillTreeExplorerGUI::$show_outdated_nodes = false
protected

Definition at line 36 of file class.ilVirtualSkillTreeExplorerGUI.php.

Referenced by getShowOutdatedNodes().

◆ $skill_tree_manager

SkillTreeManager ilVirtualSkillTreeExplorerGUI::$skill_tree_manager
protected

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

◆ $tree_factory

SkillInternalFactoryService ilVirtualSkillTreeExplorerGUI::$tree_factory
protected

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

◆ $vtree

ilVirtualSkillTree ilVirtualSkillTreeExplorerGUI::$vtree
protected

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


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