ILIAS  release_10 Revision v10.1-43-ga1241a92c2f
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)
 
 getNodeIdForDomNodeId (string $a_dom_node_id)
 
 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 = "assets/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 30 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 40 of file class.ilVirtualSkillTreeExplorerGUI.php.

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

41  {
42  global $DIC;
43 
44  $this->lng = $DIC->language();
45  $this->ctrl = $DIC->ctrl();
46  parent::__construct($a_id, $a_parent_obj, $a_parent_cmd);
47 
48  $this->skill_tree_manager = $DIC->skills()->internal()->manager()->getTreeManager();
49  $this->tree_factory = $DIC->skills()->internal()->factory();
50 
51  if ($tree_id == 0) {
52  $this->vtree = $this->tree_factory->tree()->getGlobalVirtualTree();
53  } else {
54  $this->vtree = $this->tree_factory->tree()->getVirtualTreeById($tree_id);
55  }
56 
57  $this->setSkipRootNode(false);
58  $this->setAjax(false);
59  }
global $DIC
Definition: shib_login.php:25
__construct(Container $dic, ilPlugin $plugin)
+ 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}[]

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

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

◆ getDomNodeIdForNodeId()

ilVirtualSkillTreeExplorerGUI::getDomNodeIdForNodeId (   $a_node_id)

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

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

◆ getNodeContent()

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

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

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

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

◆ getNodeHref()

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

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

References ilExplorerBaseGUI\$ctrl.

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

◆ getNodeIcon()

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

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

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

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

◆ getNodeIconAlt()

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

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

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

218  : string
219  {
220  $lng = $this->lng;
221 
222  if ($lng->exists("skmg_" . $a_node["type"])) {
223  return $lng->txt("skmg_" . $a_node["type"]);
224  }
225 
226  return $lng->txt($a_node["type"]);
227  }
exists(string $a_topic)
Check if language entry exists.
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...
+ Here is the call graph for this function:

◆ getNodeId()

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

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

95  : string
96  {
97  return (string) $a_node["id"];
98  }

◆ getNodeIdForDomNodeId()

ilVirtualSkillTreeExplorerGUI::getNodeIdForDomNodeId ( string  $a_dom_node_id)

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

References ilExplorerBaseGUI\$id.

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

◆ getRootNode()

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

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

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

◆ getShowDraftNodes()

ilVirtualSkillTreeExplorerGUI::getShowDraftNodes ( )

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

References $show_draft_nodes.

67  : bool
68  {
70  }

◆ getShowOutdatedNodes()

ilVirtualSkillTreeExplorerGUI::getShowOutdatedNodes ( )

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

References $show_outdated_nodes.

◆ isNodeClickable()

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

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

209  : bool
210  {
211  return false;
212  }

◆ setShowDraftNodes()

ilVirtualSkillTreeExplorerGUI::setShowDraftNodes ( bool  $a_val)

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

Referenced by ilSkillTreeExplorerGUI\__construct().

61  : void
62  {
63  $this->show_draft_nodes = $a_val;
64  $this->vtree->setIncludeDrafts($a_val);
65  }
+ Here is the caller graph for this function:

◆ setShowOutdatedNodes()

ilVirtualSkillTreeExplorerGUI::setShowOutdatedNodes ( bool  $a_val)

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

Referenced by ilSkillTreeExplorerGUI\__construct().

72  : void
73  {
74  $this->show_outdated_nodes = $a_val;
75  $this->vtree->setIncludeOutdated($a_val);
76  }
+ Here is the caller graph for this function:

Field Documentation

◆ $lng

ilLanguage ilVirtualSkillTreeExplorerGUI::$lng
protected

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

Referenced by getNodeContent(), and getNodeIconAlt().

◆ $show_draft_nodes

bool ilVirtualSkillTreeExplorerGUI::$show_draft_nodes = false
protected

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

Referenced by getShowDraftNodes().

◆ $show_outdated_nodes

bool ilVirtualSkillTreeExplorerGUI::$show_outdated_nodes = false
protected

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

Referenced by getShowOutdatedNodes().

◆ $skill_tree_manager

SkillTreeManager ilVirtualSkillTreeExplorerGUI::$skill_tree_manager
protected

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

◆ $tree_factory

SkillInternalFactoryService ilVirtualSkillTreeExplorerGUI::$tree_factory
protected

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

◆ $vtree

ilVirtualSkillTree ilVirtualSkillTreeExplorerGUI::$vtree
protected

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


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