2 declare(strict_types=1);
25 $html = $this->renderMenu($component, $default_renderer);
28 $tpl_name =
"tpl.drilldown.html";
30 $tpl->setVariable(
'DRILLDOWN', $html);
32 $component = $component->withAdditionalOnLoadCode(
function ($id) {
33 return "il.UI.menu.drilldown.init('$id');";
36 $tpl->setVariable(
"ID", $id);
47 protected function renderMenu(
51 $tpl_name =
"tpl.menuitem.html";
58 $tpl->setVariable(
'LABEL', $default_renderer->render($label));
60 if ($component instanceof
Menu\
Sub) {
61 if ($component->isInitiallyActive()) {
62 $tpl->touchBlock(
'active');
68 $component = $component->withAdditionalOnLoadCode(
function ($id) {
72 $tpl->setVariable(
"ID", $id);
74 foreach ($component->getItems() as $subitem) {
76 $html = $default_renderer->render($subitem);
80 $tpl->setCurrentBlock(
'subitems');
81 $tpl->setVariable(
'SUBITEMS', $html);
82 $tpl->parseCurrentBlock();
95 $tpl_name =
"tpl.menuitem.html";
98 $label = $default_renderer->render($component);
99 $tpl->setVariable(
'LABEL', $label);
110 if (is_string($label)) {
111 $label = $this->
getUIFactory()->button()->shy($label,
'');
122 parent::registerResources($registry);
123 $registry->register(
'./src/UI/templates/js/Menu/drilldown.js');
checkComponent(Component $component)
Check if a given component fits this renderer and throw if that is not the case. ...
Class ChatMainBarProvider .
render(Component $component, Renderer $default_renderer)
Render the component if possible and delegate additional rendering to the default_renderer.
getUIFactory()
Get a UI factory.
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.