2 declare(strict_types=1);
27 $tpl_name =
"tpl.tree.html";
30 $tpl->setVariable(
"ARIA_LABEL", $component->getLabel());
33 $environment = $component->getEnvironment();
36 foreach ($component->getData() as $record) {
38 $component->getRecursion(),
40 $component->getEnvironment()
44 $nodes_html = $default_renderer->render($nodes);
46 if ($component->isSubTree()) {
50 $tpl->setVariable(
'NODES', $nodes_html);
52 $highlight_node_on_click = $component->getHighlightOnNodeClick();
53 $component = $component->withAdditionalOnLoadCode(
54 function ($id) use ($highlight_node_on_click) {
55 return "il.UI.tree.init('$id', $highlight_node_on_click)";
60 $tpl->setVariable(
"ID", $id);
75 $node = $recursion->build(
81 foreach ($recursion->getChildren($record, $environment) as $sub_record) {
82 $node = $node->withAdditionalSubnode(
83 $this->
buildNode($recursion, $sub_record, $environment)
95 parent::registerResources($registry);
96 $registry->register(
'./src/UI/templates/js/Tree/tree.js');
105 Tree\Expandable::class
checkComponent(Component $component)
Check if a given component fits this renderer and throw if that is not the case. ...
Class ChatMainBarProvider .
getComponentInterfaceName()
registerResources(\ILIAS\UI\Implementation\Render\ResourceRegistry $registry)
This describes a Tree Control.
render(Component $component, Renderer $default_renderer)
Render the component if possible and delegate additional rendering to the default_renderer.
Interface for mapping data-structures to the Tree.
getUIFactory()
Get a UI factory.
buildNode(Tree\TreeRecursion $recursion, $record, $environment)
Trigger TreeRecursion::build and recurse into hierarchy by checking for further children of the recor...
if($DIC->http() ->request() ->getMethod()=="GET" &&isset($DIC->http() ->request() ->getQueryParams()['tex'])) $tpl
getTemplate($name, $purge_unfilled_vars, $purge_unused_blocks)
Get template of component this renderer is made for.
Base class for all component renderers.
bindJavaScript(JavaScriptBindable $component)
Bind the component to JavaScript.