3 declare(strict_types=1);
42 $tpl_name =
"tpl.tree.html";
45 $tpl->setVariable(
"ARIA_LABEL", $component->getLabel());
48 foreach ($component->getData() as $record) {
50 $component->getRecursion(),
52 $component->getEnvironment()
56 $nodes_html = $default_renderer->render($nodes);
58 if ($component->isSubTree()) {
62 $tpl->setVariable(
'NODES', $nodes_html);
64 $highlight_node_on_click = $component->getHighlightOnNodeClick();
65 $component = $component->withAdditionalOnLoadCode(
66 fn (
$id) =>
"il.UI.tree.init('$id', $highlight_node_on_click)" 85 $node = $recursion->build(
91 foreach ($recursion->getChildren($record, $environment) as $sub_record) {
92 $node = $node->withAdditionalSubnode(
93 $this->
buildNode($recursion, $sub_record, $environment)
105 parent::registerResources($registry);
106 $registry->
register(
'./src/UI/templates/js/Tree/tree.js');
115 Tree\Expandable::class
Registry for resources required by rendered output like Javascript or CSS.
checkComponent(Component $component)
Check if a given component fits this renderer and throw if that is not the case. ...
getComponentInterfaceName()
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getTemplate(string $name, bool $purge_unfilled_vars, bool $purge_unused_blocks)
Get template of component this renderer is made for.
register(string $name)
Add a dependency.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
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.
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
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...
registerResources(ResourceRegistry $registry)
Announce resources this renderer requires.
if($DIC->http() ->request() ->getMethod()=="GET" &&isset($DIC->http() ->request() ->getQueryParams()['tex'])) $tpl
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Base class for all component renderers.
bindJavaScript(JavaScriptBindable $component)
Bind the component to JavaScript.