2declare(strict_types=1);
22 $html = $this->
renderMenu($component, $default_renderer);
25 $tpl_name =
"tpl.drilldown.html";
27 $tpl->setVariable(
'DRILLDOWN', $html);
29 $component = $component->withAdditionalOnLoadCode(
function ($id) {
30 return "il.UI.menu.drilldown.init('$id');";
33 $tpl->setVariable(
"ID", $id);
49 RendererInterface $default_renderer
51 $tpl_name =
"tpl.menuitem.html";
55 $tpl->setVariable(
'LABEL', $default_renderer->render($label));
57 if ($component instanceof
Menu\
Sub) {
58 if ($component->isInitiallyActive()) {
59 $tpl->touchBlock(
'active');
62 $component = $component->withAdditionalOnLoadCode(
function ($id) {
66 $tpl->setVariable(
"ID", $id);
68 foreach ($component->getItems() as $subitem) {
69 if ($subitem instanceof Menu\Menu) {
70 $html = $default_renderer->render($subitem);
74 $tpl->setCurrentBlock(
'subitems');
75 $tpl->setVariable(
'SUBITEMS', $html);
76 $tpl->parseCurrentBlock();
90 RendererInterface $default_renderer
92 $tpl_name =
"tpl.menuitem.html";
93 $tpl = $this->getTemplate($tpl_name,
true,
true);
95 $label = $default_renderer->render($component);
96 $tpl->setVariable(
'LABEL', $label);
109 if (is_string($label)) {
110 $label = $this->getUIFactory()->button()->shy($label,
'');
121 parent::registerResources($registry);
122 $registry->register(
'./src/UI/templates/js/Menu/drilldown.js');
An exception for terminatinating execution or to throw for unit testing.
Base class for all component renderers.
getTemplate($name, $purge_unfilled_vars, $purge_unused_blocks)
Get template of component this renderer is made for.
bindJavaScript(JavaScriptBindable $component)
Bind the component to JavaScript.
checkComponent(Component $component)
Check if a given component fits this renderer and throw \LogicError if that is not the case.
A component is the most general form of an entity in the UI.
An entity that renders components to a string output.
Class ChatMainBarProvider \MainMenu\Provider.
if(isset($_FILES['img_file']['size']) && $_FILES['img_file']['size'] > 0) $tpl