ILIAS  release_10 Revision v10.1-43-ga1241a92c2f
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)
 
 getNodeIcon ($a_node)
 
 isNodeHighlighted ($a_node)
 
 getNodeHref ($a_node)
 
 isNodeClickable ($a_node)
 
- 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)
 
 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
 
SkillAdminGUIRequest $admin_gui_request
 
int $requested_skill_node_id = 0
 
int $requested_tref_id = 0
 
- Protected Attributes inherited from ilVirtualSkillTreeExplorerGUI
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

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 29 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 41 of file class.ilSkillTreeExplorerGUI.php.

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

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

Member Function Documentation

◆ getNodeContent()

ilSkillTreeExplorerGUI::getNodeContent (   $a_node)

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

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

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

◆ getNodeHref()

ilSkillTreeExplorerGUI::getNodeHref (   $a_node)

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

References ilExplorerBaseGUI\$ctrl.

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

◆ getNodeIcon()

ilSkillTreeExplorerGUI::getNodeIcon (   $a_node)

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

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

102  : string
103  {
104  $a_parent_id_parts = explode(":", $a_node["id"]);
105  $a_parent_skl_tree_id = (int) $a_parent_id_parts[0];
106  $a_parent_skl_template_tree_id = isset($a_parent_id_parts[1]) ? (int) $a_parent_id_parts[1] : 0;
107 
108 
109  // root?
110  if ($a_node["type"] == "skrt") {
111  $icon = ilUtil::getImagePath("standard/icon_scat.svg");
112  } elseif (in_array($a_node["type"], array("skll", "scat", "sctr", "sktr", "sctp", "sktp"))) {
114  $a_parent_skl_tree_id,
115  $a_node["type"],
116  "",
117  (int) ($this->vtree->isDraft($a_node["id"]) || $this->vtree->isOutdated($a_node["id"]))
118  );
119  } else {
120  $icon = ilUtil::getImagePath("standard/icon_" . $a_node["type"] . ".svg");
121  }
122 
123  return $icon;
124  }
static getImagePath(string $image_name, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
static getIconPath(int $a_obj_id, string $a_type, string $a_size="", int $a_status=0)
+ Here is the call graph for this function:

◆ isNodeClickable()

ilSkillTreeExplorerGUI::isNodeClickable (   $a_node)

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

205  : bool
206  {
207  return true;
208  }

◆ isNodeHighlighted()

ilSkillTreeExplorerGUI::isNodeHighlighted (   $a_node)

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

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

Field Documentation

◆ $admin_gui_request

SkillAdminGUIRequest ilSkillTreeExplorerGUI::$admin_gui_request
protected

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

◆ $lng

ilLanguage ilSkillTreeExplorerGUI::$lng
protected

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

Referenced by getNodeContent().

◆ $requested_skill_node_id

int ilSkillTreeExplorerGUI::$requested_skill_node_id = 0
protected

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

◆ $requested_tref_id

int ilSkillTreeExplorerGUI::$requested_tref_id = 0
protected

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


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