ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
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 = "./Services/UIComponent/Explorer2/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 27 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 39 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().

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

Member Function Documentation

◆ getNodeContent()

ilSkillTreeExplorerGUI::getNodeContent (   $a_node)

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

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

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

References ilExplorerBaseGUI\$ctrl.

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

◆ getNodeIcon()

ilSkillTreeExplorerGUI::getNodeIcon (   $a_node)

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

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

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

203  : bool
204  {
205  return true;
206  }

◆ isNodeHighlighted()

ilSkillTreeExplorerGUI::isNodeHighlighted (   $a_node)

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

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

Field Documentation

◆ $admin_gui_request

SkillAdminGUIRequest ilSkillTreeExplorerGUI::$admin_gui_request
protected

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

◆ $lng

ilLanguage ilSkillTreeExplorerGUI::$lng
protected

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

Referenced by getNodeContent().

◆ $requested_skill_node_id

int ilSkillTreeExplorerGUI::$requested_skill_node_id = 0
protected

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

◆ $requested_tref_id

int ilSkillTreeExplorerGUI::$requested_tref_id = 0
protected

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


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