19 declare(strict_types=1);
31 protected \ILIAS\DI\UIServices
$ui;
40 public function __construct(
string $a_id, $a_parent_obj,
string $a_parent_cmd,
int $tree_id = 0)
44 $this->
lng = $DIC->language();
45 $this->
ctrl = $DIC->ctrl();
46 $this->
ui = $DIC->ui();
49 $this->skill_tree_manager = $DIC->skills()->internal()->manager()->getTreeManager();
50 $this->tree_factory = $DIC->skills()->internal()->factory();
53 $this->vtree = $this->tree_factory->tree()->getGlobalVirtualTree();
55 $this->vtree = $this->tree_factory->tree()->getVirtualTreeById($tree_id);
64 $this->show_draft_nodes = $a_val;
65 $this->vtree->setIncludeDrafts($a_val);
75 $this->show_outdated_nodes = $a_val;
76 $this->vtree->setIncludeOutdated($a_val);
89 return $this->vtree->getRootNode();
98 return (
string) $a_node[
"id"];
106 return parent::getDomNodeIdForNodeId(str_replace(
":",
"_", $a_node_id));
114 $id = parent::getNodeIdForDomNodeId($a_dom_node_id);
115 return str_replace(
"_",
":",
$id);
124 return $this->vtree->getChildsOfNode($a_parent_node_id);
135 $a_parent_id_parts = explode(
":", (
string) $a_node[
"id"]);
136 $a_parent_skl_tree_id = (
int) $a_parent_id_parts[0];
137 $a_parent_skl_template_tree_id = isset($a_parent_id_parts[1]) ? (
int) $a_parent_id_parts[1] : 0;
140 if ((
int) $a_node[
"parent"] == 0) {
141 $tree_obj = $this->skill_tree_manager->getTree($a_node[
"skl_tree_id"]);
142 $title = $tree_obj->getTitle();
144 $title = $a_node[
"title"];
148 if ($a_node[
"type"] ==
"skrt") {
149 $lng->
txt(
"skmg_skills");
161 $a_id_parts = explode(
":", (
string) $a_node[
"id"]);
162 $a_skl_template_tree_id = isset($a_id_parts[1]) ? (
int) $a_id_parts[1] : 0;
165 if ($a_node[
"type"] ==
"skrt") {
168 $type = $a_node[
"type"];
169 if ($type ==
"sktr") {
172 if ($type ==
"sktp") {
175 if ($type ==
"sctp") {
194 $id_parts = explode(
":", (
string) $a_node[
"id"]);
195 if (!isset($id_parts[1]) || $id_parts[1] == 0) {
197 $skill_id = $a_node[
"id"];
200 $skill_id = $id_parts[1] .
":" . $id_parts[0];
223 if ($lng->
exists(
"skmg_" . $a_node[
"type"])) {
224 return $lng->
txt(
"skmg_" . $a_node[
"type"]);
227 return $lng->
txt($a_node[
"type"]);
237 $r = $this->
ui->renderer();
246 $f = $this->
ui->factory();
254 $data = $tree->getChildsOfNode((
string) ($tree->getRootNode()[
"id"]));
263 $tree =
$f->tree()->expandable($label, $this)
265 ->withHighlightOnNodeClick(
true);
282 if ($nodeIconPath !==
'') {
301 if ($href !==
'' &&
'#' !== $href && $this->
isNodeClickable($record)) {
302 $node = $node->withLink(
new \
ILIAS\
Data\
URI(ILIAS_HTTP_PATH .
'/' . $href));
306 $node = $node->withExpanded(
true);
exists(string $a_topic)
Check if language entry exists.
setSkipRootNode(bool $a_val)
build(\ILIAS\UI\Component\Tree\Node\Factory $factory, $record, $environment=null)
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...
__construct(string $a_id, $a_parent_obj, string $a_parent_cmd, int $tree_id=0)
Interface Observer Contains several chained tasks and infos about them.
getChildsOfNode($a_parent_node_id)
SkillInternalFactoryService $tree_factory
static _lookupType(int $a_obj_id)
getNodeIdForDomNodeId(string $a_dom_node_id)
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
setShowDraftNodes(bool $a_val)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getDomNodeIdForNodeId($a_node_id)
getChildren($record, $environment=null)
Get a list of records (that list can also be empty).
static getImagePath(string $image_name, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
Skill internal factory service.
createNode(\ILIAS\UI\Component\Tree\Node\Factory $factory, $record)
__construct(Container $dic, ilPlugin $plugin)
bool $show_outdated_nodes
SkillTreeManager $skill_tree_manager
ilVirtualSkillTree $vtree
isNodeOpen($node_id)
Get all open nodes.
Virtual skill tree explorer.
setShowOutdatedNodes(bool $a_val)