ILIAS  trunk Revision v11.0_alpha-1749-g1a06bdef097
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator 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 = "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 29 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 70 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().

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

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

Referenced by __construct().

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

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

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

References $has_selectable_nodes.

130  : bool
131  {
133  }

◆ getNodeContent()

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

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

References ilTreeExplorerGUI\$lng.

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

◆ getNodeHref()

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

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

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

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

References ilUtil\getImagePath().

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

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

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

Referenced by buildSelectableTree().

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

◆ getRootId()

ilPersonalSkillExplorerGUI::getRootId ( )
protected

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

120  : int
121  {
122  return 0;
123  }

◆ isNodeClickable()

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

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

References ilSkillTreeNode\_lookupSelfEvaluation().

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

◆ setHasSelectableNodes()

ilPersonalSkillExplorerGUI::setHasSelectableNodes ( bool  $a_val)
protected

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

Referenced by buildSelectableTree().

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

Field Documentation

◆ $all_nodes

array ilPersonalSkillExplorerGUI::$all_nodes = []
protected

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

◆ $child_nodes

array ilPersonalSkillExplorerGUI::$child_nodes = []
protected

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

◆ $has_selectable_nodes

bool ilPersonalSkillExplorerGUI::$has_selectable_nodes = false
protected

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

Referenced by getHasSelectableNodes().

◆ $node

array ilPersonalSkillExplorerGUI::$node = []
protected

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

◆ $parent

array ilPersonalSkillExplorerGUI::$parent = []
protected

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

◆ $select_cmd

string ilPersonalSkillExplorerGUI::$select_cmd = ""
protected

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

◆ $select_gui

string ilPersonalSkillExplorerGUI::$select_gui = ""
protected

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

◆ $select_par

string ilPersonalSkillExplorerGUI::$select_par = ""
protected

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

◆ $selectable

array ilPersonalSkillExplorerGUI::$selectable = []
protected

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

◆ $selectable_child_nodes

array ilPersonalSkillExplorerGUI::$selectable_child_nodes = []
protected

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

◆ $skill_tree_factory

SkillTreeFactory ilPersonalSkillExplorerGUI::$skill_tree_factory
protected

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

◆ $skill_tree_manager

SkillTreeManager ilPersonalSkillExplorerGUI::$skill_tree_manager
protected

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

◆ $tree_repo

ilSkillTreeRepository ilPersonalSkillExplorerGUI::$tree_repo
protected

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


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