ILIAS  trunk Revision v11.0_alpha-1715-g7fc467680fb
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
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 29 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 39 of file class.ilVirtualSkillTreeExplorerGUI.php.

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

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

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

◆ getDomNodeIdForNodeId()

ilVirtualSkillTreeExplorerGUI::getDomNodeIdForNodeId (   $a_node_id)

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

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

◆ getNodeContent()

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

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

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

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

References ilExplorerBaseGUI\$ctrl.

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

◆ getNodeIcon()

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

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

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

157  : string
158  {
159  $a_id_parts = explode(":", (string) $a_node["id"]);
160  $a_skl_template_tree_id = isset($a_id_parts[1]) ? (int) $a_id_parts[1] : 0;
161 
162  // root?
163  if ($a_node["type"] == "skrt") {
164  $icon = ilUtil::getImagePath("standard/icon_scat.svg");
165  } else {
166  $type = $a_node["type"];
167  if ($type == "sktr") {
168  $type = ilSkillTreeNode::_lookupType($a_skl_template_tree_id);
169  }
170  if ($type == "sktp") {
171  $type = "skll";
172  }
173  if ($type == "sctp") {
174  $type = "scat";
175  }
176  $icon = ilUtil::getImagePath("standard/icon_" . $type . ".svg");
177  }
178 
179  return $icon;
180  }
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 217 of file class.ilVirtualSkillTreeExplorerGUI.php.

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

217  : string
218  {
219  $lng = $this->lng;
220 
221  if ($lng->exists("skmg_" . $a_node["type"])) {
222  return $lng->txt("skmg_" . $a_node["type"]);
223  }
224 
225  return $lng->txt($a_node["type"]);
226  }
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 94 of file class.ilVirtualSkillTreeExplorerGUI.php.

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

◆ getNodeIdForDomNodeId()

ilVirtualSkillTreeExplorerGUI::getNodeIdForDomNodeId ( string  $a_dom_node_id)

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

References ilExplorerBaseGUI\$id.

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

◆ getRootNode()

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

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

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

◆ getShowDraftNodes()

ilVirtualSkillTreeExplorerGUI::getShowDraftNodes ( )

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

References $show_draft_nodes.

66  : bool
67  {
69  }

◆ getShowOutdatedNodes()

ilVirtualSkillTreeExplorerGUI::getShowOutdatedNodes ( )

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

References $show_outdated_nodes.

◆ isNodeClickable()

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

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

208  : bool
209  {
210  return false;
211  }

◆ setShowDraftNodes()

ilVirtualSkillTreeExplorerGUI::setShowDraftNodes ( bool  $a_val)

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

Referenced by ilSkillTreeExplorerGUI\__construct().

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

◆ setShowOutdatedNodes()

ilVirtualSkillTreeExplorerGUI::setShowOutdatedNodes ( bool  $a_val)

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

Referenced by ilSkillTreeExplorerGUI\__construct().

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

Field Documentation

◆ $lng

ilLanguage ilVirtualSkillTreeExplorerGUI::$lng
protected

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

Referenced by getNodeContent(), and getNodeIconAlt().

◆ $show_draft_nodes

bool ilVirtualSkillTreeExplorerGUI::$show_draft_nodes = false
protected

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

Referenced by getShowDraftNodes().

◆ $show_outdated_nodes

bool ilVirtualSkillTreeExplorerGUI::$show_outdated_nodes = false
protected

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

Referenced by getShowOutdatedNodes().

◆ $skill_tree_manager

SkillTreeManager ilVirtualSkillTreeExplorerGUI::$skill_tree_manager
protected

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

◆ $tree_factory

SkillInternalFactoryService ilVirtualSkillTreeExplorerGUI::$tree_factory
protected

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

◆ $vtree

ilVirtualSkillTree ilVirtualSkillTreeExplorerGUI::$vtree
protected

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


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