ILIAS  release_10 Revision v10.1-43-ga1241a92c2f
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 = "assets/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 30 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 71 of file class.ilPersonalSkillExplorerGUI.php.

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

77  {
78  global $DIC;
79 
80  $this->ctrl = $DIC->ctrl();
81  $this->lng = $DIC->language();
82 
83  $this->select_gui = (is_object($a_select_gui))
84  ? strtolower(get_class($a_select_gui))
85  : $a_select_gui;
86  $this->select_cmd = $a_select_cmd;
87  $this->select_par = $a_select_par;
88 
89  $this->skill_tree_factory = $DIC->skills()->internal()->factory()->tree();
90  $this->tree_repo = $DIC->skills()->internal()->repo()->getTreeRepo();
91  $this->skill_tree_manager = $DIC->skills()->internal()->manager()->getTreeManager();
92 
93  $this->lng->loadLanguageModule("skmg");
94 
95  $this->tree = $this->skill_tree_factory->getGlobalTree();
96  $this->root_id = $this->tree->readRootId();
97 
98  parent::__construct("pskill_sel", $a_parent_obj, $a_parent_cmd, $this->tree);
99  $this->setSkipRootNode(true);
100 
101  $this->all_nodes = [];
102 
103  foreach ($this->tree->getChilds(0) as $c) {
104  $node_id = (int) $c["child"];
105  $tree_id = $this->tree_repo->getTreeIdForNodeId($node_id);
106  $tree = $this->skill_tree_factory->getTreeById($tree_id);
108  foreach ($all_nodes as $n) {
109  $this->node[$n["child"]] = $n;
110  $this->child_nodes[$n["parent"]][] = $n;
111  $this->parent[$n["child"]] = $n["parent"];
112  $this->all_nodes[] = $n;
113  }
114  }
115 
116 
117  // $this->setTypeWhiteList(array("skrt", "skll", "scat", "sktr"));
118  $this->buildSelectableTree(0);
119  }
getNodeData(int $a_node_id, ?int $a_tree_pk=null)
get all information of a node.
$c
Definition: deliver.php:9
global $DIC
Definition: shib_login.php:25
__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 136 of file class.ilPersonalSkillExplorerGUI.php.

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

Referenced by __construct().

136  : void
137  {
139  if ($a_node_id != 0 && ilSkillTreeNode::_lookupType($a_node_id) !== "skrt") {
140  return;
141  }
142  }
143 
144  $this->selectable[$a_node_id] = false;
145  if (ilSkillTreeNode::_lookupSelfEvaluation($a_node_id)) {
146  $this->selectable[$a_node_id] = true;
147  $cid = $a_node_id;
148  //$this->selectable[$this->parent[$a_node_id]] = true;
149  while (isset($this->parent[$cid])) {
150  $this->selectable[$this->parent[$cid]] = true;
151  $cid = $this->parent[$cid];
152  }
153  }
154  foreach ($this->getOriginalChildsOfNode($a_node_id) as $n) {
155  $this->buildSelectableTree((int) $n["child"]);
156  }
157  if ($this->selectable[$a_node_id]) {
158  $this->setHasSelectableNodes(true);
159  if (isset($this->node[$a_node_id])) {
160  $this->selectable_child_nodes[$this->node[$a_node_id]["parent"]][] =
161  $this->node[$a_node_id];
162  }
163  }
164  }
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 171 of file class.ilPersonalSkillExplorerGUI.php.

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

171  : array
172  {
173  if (isset($this->selectable_child_nodes[$a_parent_node_id])
174  && is_array($this->selectable_child_nodes[$a_parent_node_id])) {
175  $childs = $this->selectable_child_nodes[$a_parent_node_id];
176  $childs = ilArrayUtil::sortArray($childs, "order_nr", "asc", true);
177  return $childs;
178  }
179  return [];
180  }
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 131 of file class.ilPersonalSkillExplorerGUI.php.

References $has_selectable_nodes.

131  : bool
132  {
134  }

◆ getNodeContent()

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

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

References ilTreeExplorerGUI\$lng.

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

◆ getNodeHref()

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

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

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

197  : string
198  {
199  $ilCtrl = $this->ctrl;
200 
201  $skill_id = $a_node["child"];
202 
203  $ilCtrl->setParameterByClass($this->select_gui, $this->select_par, $skill_id);
204  $ret = $ilCtrl->getLinkTargetByClass($this->select_gui, $this->select_cmd);
205  $ilCtrl->setParameterByClass($this->select_gui, $this->select_par, "");
206 
207  return $ret;
208  }
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 246 of file class.ilPersonalSkillExplorerGUI.php.

References ilUtil\getImagePath().

246  : string
247  {
248  $t = $a_node["type"];
249  if ($t == "sktr") {
250  return ilUtil::getImagePath("standard/icon_skll.svg");
251  }
252  return ilUtil::getImagePath("standard/icon_" . $t . ".svg");
253  }
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()

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

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

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

259  : string
260  {
261  $lng = $this->lng;
262 
263  if ($lng->exists("skmg_" . $a_node["type"])) {
264  return $lng->txt("skmg_" . $a_node["type"]);
265  }
266 
267  return $lng->txt($a_node["type"]);
268  }
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 185 of file class.ilPersonalSkillExplorerGUI.php.

Referenced by buildSelectableTree().

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

◆ getRootId()

ilPersonalSkillExplorerGUI::getRootId ( )
protected

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

121  : int
122  {
123  return 0;
124  }

◆ isNodeClickable()

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

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

References ilSkillTreeNode\_lookupSelfEvaluation().

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

◆ setHasSelectableNodes()

ilPersonalSkillExplorerGUI::setHasSelectableNodes ( bool  $a_val)
protected

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

Referenced by buildSelectableTree().

126  : void
127  {
128  $this->has_selectable_nodes = $a_val;
129  }
+ Here is the caller graph for this function:

Field Documentation

◆ $all_nodes

array ilPersonalSkillExplorerGUI::$all_nodes = []
protected

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

◆ $child_nodes

array ilPersonalSkillExplorerGUI::$child_nodes = []
protected

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

◆ $has_selectable_nodes

bool ilPersonalSkillExplorerGUI::$has_selectable_nodes = false
protected

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

Referenced by getHasSelectableNodes().

◆ $node

array ilPersonalSkillExplorerGUI::$node = []
protected

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

◆ $parent

array ilPersonalSkillExplorerGUI::$parent = []
protected

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

◆ $select_cmd

string ilPersonalSkillExplorerGUI::$select_cmd = ""
protected

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

◆ $select_gui

string ilPersonalSkillExplorerGUI::$select_gui = ""
protected

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

◆ $select_par

string ilPersonalSkillExplorerGUI::$select_par = ""
protected

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

◆ $selectable

array ilPersonalSkillExplorerGUI::$selectable = []
protected

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

◆ $selectable_child_nodes

array ilPersonalSkillExplorerGUI::$selectable_child_nodes = []
protected

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

◆ $skill_tree_factory

SkillTreeFactory ilPersonalSkillExplorerGUI::$skill_tree_factory
protected

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

◆ $skill_tree_manager

SkillTreeManager ilPersonalSkillExplorerGUI::$skill_tree_manager
protected

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

◆ $tree_repo

ilSkillTreeRepository ilPersonalSkillExplorerGUI::$tree_repo
protected

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


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