ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilPersonalSkillExplorerGUI Class Reference

Explorer for selecting a personal skill. More...

+ Inheritance diagram for ilPersonalSkillExplorerGUI:
+ Collaboration diagram for ilPersonalSkillExplorerGUI:

Public Member Functions

 __construct ( $a_parent_obj, string $a_parent_cmd, $a_select_gui, string $a_select_cmd, string $a_select_par="node_id")
 
 getHasSelectableNodes ()
 
 buildSelectableTree (int $a_node_id)
 
 getChildsOfNode ($a_parent_node_id)
 Get childs of node (selectable tree) More...
 
 getOriginalChildsOfNode (int $a_parent_id)
 Get original childs of node (whole tree) More...
 
 getNodeHref ($a_node)
 
 getNodeContent ($a_node)
 
 isNodeClickable ($a_node)
 
 getNodeIcon ($a_node)
 get image path (may be overwritten by derived classes) More...
 
 getNodeIconAlt ($a_node)
 
- Public Member Functions inherited from ilTreeExplorerGUI
 __construct (string $a_expl_id, $a_parent_obj, string $a_parent_cmd, ilTree $a_tree, string $a_node_parameter_name="node_id")
 
 getTree ()
 
 setOrderField (string $a_val, bool $a_numeric=false)
 
 getOrderField ()
 
 setTypeWhiteList (array $a_val)
 Set type white list. More...
 
 getTypeWhiteList ()
 Get type white list. More...
 
 setTypeBlackList (array $a_val)
 Set type black list. More...
 
 getTypeBlackList ()
 Get type black list. More...
 
 setPreloadChilds (bool $a_val)
 
 getPreloadChilds ()
 
 getSuccessorNode ( $a_node_id, string $a_type="")
 Get successor node (currently only(!) based on lft/rgt tree values) More...
 
 getChildsOfNode ($a_parent_node_id)
 Get childs of node. More...
 
 getNodeId ($a_node)
 Get id for node. More...
 
 getNodeIconAlt ($a_node)
 Get node icon alt attribute. More...
 
 getRootNode ()
 Get root node. More...
 
 setRootId ($a_root)
 
 setPathOpen ($a_id)
 Set node path to be opened. More...
 
 getHTML ($new=false)
 Get HTML. More...
 
 getChildren ($record, $environment=null)
 Get a list of records (that list can also be empty). More...
 
 build (\ILIAS\UI\Component\Tree\Node\Factory $factory, $record, $environment=null)
 
 getTreeLabel ()
 
 getTreeComponent ()
 
 toggleExplorerNodeState ()
 Should be called by an ilCtrl-enabled command class if a tree node toggle action should be processed. More...
 
- 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)
 
- Public Member Functions inherited from ILIAS\UI\Component\Tree\TreeRecursion
 build (Node\Factory $factory, $record, $environment=null)
 Build and return a Node. More...
 

Protected Member Functions

 getRootId ()
 
 setHasSelectableNodes (bool $a_val)
 
- Protected Member Functions inherited from ilTreeExplorerGUI
 preloadChilds ()
 
 matches ($node)
 Does a node match a search term (or is search term empty) More...
 
 getRootId ()
 
 createNode (\ILIAS\UI\Component\Tree\Node\Factory $factory, $record)
 Creates at tree node, can be overwritten in derivatives if another node type should be used. More...
 
 getNodeStateToggleCmdClasses ($record)
 Should return an array of ilCtrl-enabled command classes which should be used to build the URL for the expand/collapse actions applied on a tree node. More...
 
 render ()
 
- 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)
 

Protected Attributes

string $select_gui = ""
 
string $select_cmd = ""
 
string $select_par = ""
 
array $all_nodes = []
 
array $node = []
 
array $child_nodes = []
 
array $parent = []
 
array $selectable = []
 
array $selectable_child_nodes = []
 
bool $has_selectable_nodes = false
 
SkillTreeFactory $skill_tree_factory
 
ilSkillTreeRepository $tree_repo
 
SkillTreeManager $skill_tree_manager
 
- Protected Attributes inherited from ilTreeExplorerGUI
ilLanguage $lng
 
Psr Http Message ServerRequestInterface $httpRequest
 
ilTree $tree = null
 
string $tree_label = ""
 
string $order_field = ""
 
bool $order_field_numeric = false
 
array $type_white_list = array()
 
array $type_black_list = array()
 
array $childs = array()
 
bool $preloaded = false
 
bool $preload_childs = false
 
array $root_node_data = null
 
array $all_childs = array()
 
 $root_id = 0
 
ILIAS DI UIServices $ui
 
- 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)
 
- 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 for selecting a personal skill.

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

Constructor & Destructor Documentation

◆ __construct()

ilPersonalSkillExplorerGUI::__construct (   $a_parent_obj,
string  $a_parent_cmd,
  $a_select_gui,
string  $a_select_cmd,
string  $a_select_par = "node_id" 
)

Definition at line 69 of file class.ilPersonalSkillExplorerGUI.php.

References $c, $DIC, ilTreeExplorerGUI\$tree, ILIAS\GlobalScreen\Provider\__construct(), buildSelectableTree(), ILIAS\Repository\ctrl(), ilTree\getNodeData(), ilTree\getSubTree(), ILIAS\Repository\lng(), and ilExplorerBaseGUI\setSkipRootNode().

75  {
76  global $DIC;
77 
78  $this->ctrl = $DIC->ctrl();
79  $this->lng = $DIC->language();
80 
81  $this->select_gui = (is_object($a_select_gui))
82  ? strtolower(get_class($a_select_gui))
83  : $a_select_gui;
84  $this->select_cmd = $a_select_cmd;
85  $this->select_par = $a_select_par;
86 
87  $this->skill_tree_factory = $DIC->skills()->internal()->factory()->tree();
88  $this->tree_repo = $DIC->skills()->internal()->repo()->getTreeRepo();
89  $this->skill_tree_manager = $DIC->skills()->internal()->manager()->getTreeManager();
90 
91  $this->lng->loadLanguageModule("skmg");
92 
93  $this->tree = $this->skill_tree_factory->getGlobalTree();
94  $this->root_id = $this->tree->readRootId();
95 
96  parent::__construct("pskill_sel", $a_parent_obj, $a_parent_cmd, $this->tree);
97  $this->setSkipRootNode(true);
98 
99  $this->all_nodes = [];
100 
101  foreach ($this->tree->getChilds(0) as $c) {
102  $tree_id = $this->tree_repo->getTreeIdForNodeId($c["child"]);
103  $tree = $this->skill_tree_factory->getTreeById($tree_id);
105  foreach ($all_nodes as $n) {
106  $this->node[$n["child"]] = $n;
107  $this->child_nodes[$n["parent"]][] = $n;
108  $this->parent[$n["child"]] = $n["parent"];
109  $this->all_nodes[] = $n;
110  }
111  }
112 
113 
114  // $this->setTypeWhiteList(array("skrt", "skll", "scat", "sktr"));
115  $this->buildSelectableTree(0);
116  }
getNodeData(int $a_node_id, ?int $a_tree_pk=null)
get all information of a node.
$c
Definition: cli.php:38
global $DIC
Definition: feed.php:28
__construct(Container $dic, ilPlugin $plugin)
getSubTree(array $a_node, bool $a_with_data=true, array $a_type=[])
get all nodes in the subtree under specified node
+ Here is the call graph for this function:

Member Function Documentation

◆ buildSelectableTree()

ilPersonalSkillExplorerGUI::buildSelectableTree ( int  $a_node_id)

Definition at line 133 of file class.ilPersonalSkillExplorerGUI.php.

References ilSkillTreeNode\_lookupSelfEvaluation(), ilSkillTreeNode\_lookupStatus(), ilSkillTreeNode\_lookupType(), getOriginalChildsOfNode(), setHasSelectableNodes(), ilSkillTreeNode\STATUS_DRAFT, and ilSkillTreeNode\STATUS_OUTDATED.

Referenced by __construct().

133  : void
134  {
136  if ($a_node_id != 0 && ilSkillTreeNode::_lookupType($a_node_id) !== "skrt") {
137  return;
138  }
139  }
140 
141  $this->selectable[$a_node_id] = false;
142  if (ilSkillTreeNode::_lookupSelfEvaluation($a_node_id)) {
143  $this->selectable[$a_node_id] = true;
144  $cid = $a_node_id;
145  //$this->selectable[$this->parent[$a_node_id]] = true;
146  while (isset($this->parent[$cid])) {
147  $this->selectable[$this->parent[$cid]] = true;
148  $cid = $this->parent[$cid];
149  }
150  }
151  foreach ($this->getOriginalChildsOfNode($a_node_id) as $n) {
152  $this->buildSelectableTree($n["child"]);
153  }
154  if ($this->selectable[$a_node_id]) {
155  $this->setHasSelectableNodes(true);
156  if (isset($this->node[$a_node_id])) {
157  $this->selectable_child_nodes[$this->node[$a_node_id]["parent"]][] =
158  $this->node[$a_node_id];
159  }
160  }
161  }
static _lookupStatus(int $a_obj_id)
static _lookupType(int $a_obj_id)
getOriginalChildsOfNode(int $a_parent_id)
Get original childs of node (whole tree)
static _lookupSelfEvaluation(int $a_obj_id)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getChildsOfNode()

ilPersonalSkillExplorerGUI::getChildsOfNode (   $a_parent_node_id)

Get childs of node (selectable tree)

Parameters
int$a_parent_node_idparent id
Returns
array childs

Definition at line 168 of file class.ilPersonalSkillExplorerGUI.php.

References ilTreeExplorerGUI\$childs, and ilArrayUtil\sortArray().

168  : array
169  {
170  if (isset($this->selectable_child_nodes[$a_parent_node_id])
171  && is_array($this->selectable_child_nodes[$a_parent_node_id])) {
172  $childs = $this->selectable_child_nodes[$a_parent_node_id];
173  $childs = ilArrayUtil::sortArray($childs, "order_nr", "asc", true);
174  return $childs;
175  }
176  return [];
177  }
static sortArray(array $array, string $a_array_sortby_key, string $a_array_sortorder="asc", bool $a_numeric=false, bool $a_keep_keys=false)
+ Here is the call graph for this function:

◆ getHasSelectableNodes()

ilPersonalSkillExplorerGUI::getHasSelectableNodes ( )

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

References $has_selectable_nodes.

128  : bool
129  {
131  }

◆ getNodeContent()

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

Definition at line 211 of file class.ilPersonalSkillExplorerGUI.php.

References ilTreeExplorerGUI\$lng.

211  : string
212  {
213  $lng = $this->lng;
214 
215  // title
216  if ((int) $a_node["parent"] == 0) {
217  $tree_obj = $this->skill_tree_manager->getTree($a_node["skl_tree_id"]);
218  $title = $tree_obj->getTitle();
219  } else {
220  $title = $a_node["title"];
221  }
222 
223  return $title;
224  }

◆ getNodeHref()

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

Definition at line 194 of file class.ilPersonalSkillExplorerGUI.php.

References ilExplorerBaseGUI\$ctrl, and ilCtrl\setParameterByClass().

194  : string
195  {
196  $ilCtrl = $this->ctrl;
197 
198  $skill_id = $a_node["child"];
199 
200  $ilCtrl->setParameterByClass($this->select_gui, $this->select_par, $skill_id);
201  $ret = $ilCtrl->getLinkTargetByClass($this->select_gui, $this->select_cmd);
202  $ilCtrl->setParameterByClass($this->select_gui, $this->select_par, "");
203 
204  return $ret;
205  }
setParameterByClass(string $a_class, string $a_parameter, $a_value)
+ Here is the call graph for this function:

◆ getNodeIcon()

ilPersonalSkillExplorerGUI::getNodeIcon (   $a_node)

get image path (may be overwritten by derived classes)

Parameters
object | array$a_node
Returns
string

Definition at line 243 of file class.ilPersonalSkillExplorerGUI.php.

References ilUtil\getImagePath().

243  : string
244  {
245  $t = $a_node["type"];
246  if ($t == "sktr") {
247  return ilUtil::getImagePath("icon_skll.svg");
248  }
249  return ilUtil::getImagePath("icon_" . $t . ".svg");
250  }
static getImagePath(string $img, 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()

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

Definition at line 256 of file class.ilPersonalSkillExplorerGUI.php.

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

256  : string
257  {
258  $lng = $this->lng;
259 
260  if ($lng->exists("skmg_" . $a_node["type"])) {
261  return $lng->txt("skmg_" . $a_node["type"]);
262  }
263 
264  return $lng->txt($a_node["type"]);
265  }
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:

◆ getOriginalChildsOfNode()

ilPersonalSkillExplorerGUI::getOriginalChildsOfNode ( int  $a_parent_id)

Get original childs of node (whole tree)

Definition at line 182 of file class.ilPersonalSkillExplorerGUI.php.

Referenced by buildSelectableTree().

182  : array
183  {
184  if (isset($this->child_nodes[$a_parent_id]) && is_array($this->child_nodes[$a_parent_id])) {
185  return $this->child_nodes[$a_parent_id];
186  }
187  return [];
188  }
+ Here is the caller graph for this function:

◆ getRootId()

ilPersonalSkillExplorerGUI::getRootId ( )
protected

Definition at line 118 of file class.ilPersonalSkillExplorerGUI.php.

118  : int
119  {
120  return 0;
121  }

◆ isNodeClickable()

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

Definition at line 230 of file class.ilPersonalSkillExplorerGUI.php.

References ilSkillTreeNode\_lookupSelfEvaluation().

230  : bool
231  {
232  if (!ilSkillTreeNode::_lookupSelfEvaluation($a_node["child"])) {
233  return false;
234  }
235  return true;
236  }
static _lookupSelfEvaluation(int $a_obj_id)
+ Here is the call graph for this function:

◆ setHasSelectableNodes()

ilPersonalSkillExplorerGUI::setHasSelectableNodes ( bool  $a_val)
protected

Definition at line 123 of file class.ilPersonalSkillExplorerGUI.php.

Referenced by buildSelectableTree().

123  : void
124  {
125  $this->has_selectable_nodes = $a_val;
126  }
+ Here is the caller graph for this function:

Field Documentation

◆ $all_nodes

array ilPersonalSkillExplorerGUI::$all_nodes = []
protected

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

◆ $child_nodes

array ilPersonalSkillExplorerGUI::$child_nodes = []
protected

Definition at line 47 of file class.ilPersonalSkillExplorerGUI.php.

◆ $has_selectable_nodes

bool ilPersonalSkillExplorerGUI::$has_selectable_nodes = false
protected

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

Referenced by getHasSelectableNodes().

◆ $node

array ilPersonalSkillExplorerGUI::$node = []
protected

Definition at line 42 of file class.ilPersonalSkillExplorerGUI.php.

◆ $parent

array ilPersonalSkillExplorerGUI::$parent = []
protected

Definition at line 52 of file class.ilPersonalSkillExplorerGUI.php.

◆ $select_cmd

string ilPersonalSkillExplorerGUI::$select_cmd = ""
protected

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

◆ $select_gui

string ilPersonalSkillExplorerGUI::$select_gui = ""
protected

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

◆ $select_par

string ilPersonalSkillExplorerGUI::$select_par = ""
protected

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

◆ $selectable

array ilPersonalSkillExplorerGUI::$selectable = []
protected

Definition at line 57 of file class.ilPersonalSkillExplorerGUI.php.

◆ $selectable_child_nodes

array ilPersonalSkillExplorerGUI::$selectable_child_nodes = []
protected

Definition at line 62 of file class.ilPersonalSkillExplorerGUI.php.

◆ $skill_tree_factory

SkillTreeFactory ilPersonalSkillExplorerGUI::$skill_tree_factory
protected

Definition at line 65 of file class.ilPersonalSkillExplorerGUI.php.

◆ $skill_tree_manager

SkillTreeManager ilPersonalSkillExplorerGUI::$skill_tree_manager
protected

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

◆ $tree_repo

ilSkillTreeRepository ilPersonalSkillExplorerGUI::$tree_repo
protected

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


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