3 declare(strict_types=1);
76 string $a_select_par =
"node_id" 80 $this->
ctrl = $DIC->ctrl();
81 $this->
lng = $DIC->language();
83 $this->select_gui = (is_object($a_select_gui))
84 ? strtolower(get_class($a_select_gui))
86 $this->select_cmd = $a_select_cmd;
87 $this->select_par = $a_select_par;
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();
93 $this->
lng->loadLanguageModule(
"skmg");
95 $this->tree = $this->skill_tree_factory->getGlobalTree();
96 $this->root_id = $this->tree->readRootId();
101 $this->all_nodes = [];
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;
128 $this->has_selectable_nodes = $a_val;
144 $this->selectable[$a_node_id] =
false;
146 $this->selectable[$a_node_id] =
true;
149 while (isset($this->parent[$cid])) {
150 $this->selectable[$this->parent[$cid]] =
true;
151 $cid = $this->parent[$cid];
157 if ($this->selectable[$a_node_id]) {
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];
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];
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];
201 $skill_id = $a_node[
"child"];
204 $ret = $ilCtrl->getLinkTargetByClass($this->select_gui, $this->select_cmd);
205 $ilCtrl->setParameterByClass($this->select_gui, $this->select_par,
"");
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();
223 $title = $a_node[
"title"];
248 $t = $a_node[
"type"];
263 if (
$lng->
exists(
"skmg_" . $a_node[
"type"])) {
264 return $lng->
txt(
"skmg_" . $a_node[
"type"]);
267 return $lng->
txt($a_node[
"type"]);
exists(string $a_topic)
Check if language entry exists.
setSkipRootNode(bool $a_val)
static _lookupStatus(int $a_obj_id)
getNodeData(int $a_node_id, ?int $a_tree_pk=null)
get all information of a node.
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...
setHasSelectableNodes(bool $a_val)
static getImagePath(string $img, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
SkillTreeManager $skill_tree_manager
Explorer for selecting a personal skill.
buildSelectableTree(int $a_node_id)
setParameterByClass(string $a_class, string $a_parameter, $a_value)
static _lookupType(int $a_obj_id)
array $selectable_child_nodes
bool $has_selectable_nodes
getChildsOfNode($a_parent_node_id)
Get childs of node (selectable tree)
getNodeIcon($a_node)
get image path (may be overwritten by derived classes)
getOriginalChildsOfNode(int $a_parent_id)
Get original childs of node (whole tree)
SkillTreeFactory $skill_tree_factory
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Explorer class that works on tree objects (Services/Tree)
ilSkillTreeRepository $tree_repo
static _lookupSelfEvaluation(int $a_obj_id)
__construct( $a_parent_obj, string $a_parent_cmd, $a_select_gui, string $a_select_cmd, string $a_select_par="node_id")
getSubTree(array $a_node, bool $a_with_data=true, array $a_type=[])
get all nodes in the subtree under specified node
static sortArray(array $array, string $a_array_sortby_key, string $a_array_sortorder="asc", bool $a_numeric=false, bool $a_keep_keys=false)