ILIAS  release_8 Revision v8.24
class.ilMaterialExplorer.php
Go to the documentation of this file.
1<?php
2
24{
25 protected string $current_type;
26
27 public function __construct(
28 object $a_parent_obj,
29 string $a_parent_cmd,
30 string $a_selectable_type
31 ) {
32 global $DIC;
33
34 $this->tree = $DIC->repositoryTree();
35 $this->ctrl = $DIC->ctrl();
36 $tree = $DIC->repositoryTree();
37
38 parent::__construct("mat_rep_exp", $a_parent_obj, $a_parent_cmd, $tree);
39
40 $this->current_type = $a_selectable_type;
41
42 $this->setTypeWhiteList(array("root", "cat", "grp", "fold", "crs", $this->current_type));
43 $this->setSkipRootNode(true);
44 $this->setAjax(true);
45 }
46
47 public function getNodeContent($a_node): string
48 {
49 return $a_node["title"];
50 }
51
52 public function getNodeIcon($a_node): string
53 {
54 $obj_id = ilObject::_lookupObjId($a_node["child"]);
55 return ilObject::_getIcon($obj_id, "tiny", $a_node["type"]);
56 }
57
58 public function getNodeHref($a_node): string
59 {
60 $ilCtrl = $this->ctrl;
61
62 $ilCtrl->setParameter($this->parent_obj, 'source_id', $a_node["child"]);
63 return $ilCtrl->getLinkTarget($this->parent_obj, 'linkChilds');
64 }
65
66 public function isNodeClickable($a_node): bool
67 {
68 return ($a_node["type"] === $this->current_type);
69 }
70}
setParameter(object $a_gui_obj, string $a_parameter, $a_value)
@inheritDoc
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getNodeContent($a_node)
Get content of a node.
isNodeClickable($a_node)
Is node clickable?
getNodeHref($a_node)
Get href for node.
getNodeIcon($a_node)
Get node icon path.
__construct(object $a_parent_obj, string $a_parent_cmd, string $a_selectable_type)
static _getIcon(int $obj_id=0, string $size="big", string $type="", bool $offline=false)
Get icon for repository item.
static _lookupObjId(int $ref_id)
Explorer class that works on tree objects (Services/Tree)
setTypeWhiteList(array $a_val)
Set type white list.
global $DIC
Definition: feed.php:28
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc