diff --git a/src/QUI/Menu/MegaMenu.Independent.html b/src/QUI/Menu/MegaMenu.Independent.html new file mode 100644 index 0000000000000000000000000000000000000000..0bcd7f3d4f967d3949cd381faefad1269fd84260 --- /dev/null +++ b/src/QUI/Menu/MegaMenu.Independent.html @@ -0,0 +1,53 @@ +<nav class="hide-on-mobile"> + {$prepend} + + <ul class="quiqqer-menu-megaMenu-list"> + + {foreach $children as $Child} + + {assign var=usedControl value=$childControl} + + <li class="quiqqer-menu-megaMenu-list-item"> + {assign var=subchildren value=$Child->getChildren()} + <a href="" + class="qui-menu-siteid-{$Child->getIdentifier()}" + {*title="{$Child->getAttribute('title')|escape:'html'}"*}> + {$Child->getTitle()} + + {if count($subchildren)} + <span class="fa fa-angle-down"></span> + {/if} + </a> + + {*if $Child->getAttribute('quiqqer.megamenu.settings.type') && $Child->getAttribute('quiqqer.megamenu.settings.type') !== ''} + {assign var=usedControl value=$this->getMenuControl($Child->getAttribute('quiqqer.megamenu.settings.type'))} + {/if*} + + {*if $usedControl} + {control control=$usedControl Site=$Child assign=Control} + {assign var=t_ value=$this->addSubMenu($usedControl)} + {if $Control->count()} + <div class="quiqqer-menu-megaMenu-list-item-menu"> + {$Control->create()} + </div> + {/if} + {/if*} + </li> + {/foreach} + </ul> + + {$append} +</nav> +{*if $Mobile} + <div class="hide-on-desktop"> + {$prepend} + + <div class="quiqqer-menu-megaMenu-mobile"> + <span class="fa fa-bars"></span> + <span>Menü</span> + </div> + + {$append} + {$Mobile->create()} + </div> +{/if*} diff --git a/src/QUI/Menu/MegaMenu.php b/src/QUI/Menu/MegaMenu.php index 29c849e8e165fd2fd7b6d3bbb2d9ef58ee7a0036..ae1fbb7619bdf57685a0b4de0fcf256c6a49301f 100644 --- a/src/QUI/Menu/MegaMenu.php +++ b/src/QUI/Menu/MegaMenu.php @@ -124,28 +124,48 @@ public function getBody() $this->setAttribute('data-qui-options-enablemobile', $this->getAttribute('enableMobile') ? 1 : 0); - $Engine->assign([ - 'this' => $this, - 'Site' => $this->getSite(), - 'Project' => $this->getProject(), - 'Mobile' => $this->Mobile, - 'Start' => $this->getStart(), - 'children' => $this->getStart()->getNavigation(), - 'Rewrite' => QUI::getRewrite(), - 'jsControl' => 'package/quiqqer/menu/bin/MegaMenu', - 'prepend' => $this->prepend, - 'append' => $this->append, - 'childControl' => $childControl, - 'showMenu' => true - ]); - if ($this->getProject()->getConfig('menu.settings.type') == 'noMenu') { - $Engine->assign('showMenu', false); - } + if ($this->getAttribute('menuId')) { + $IndependentMenu = Independent\Handler::getMenu($this->getAttribute('menuId')); + + $children = $IndependentMenu->getChildren(); + + $Engine->assign([ + 'this' => $this, + 'Mobile' => $this->Mobile, + 'children' => $children, + 'prepend' => $this->prepend, + 'append' => $this->append, + 'childControl' => $childControl, + 'showMenu' => true + ]); + + $result = []; + $result['html'] = $Engine->fetch(dirname(__FILE__).'/MegaMenu.Independent.html'); + } else { + $Engine->assign([ + 'this' => $this, + 'Site' => $this->getSite(), + 'Project' => $this->getProject(), + 'Mobile' => $this->Mobile, + 'Start' => $this->getStart(), + 'children' => $this->getStart()->getNavigation(), + 'Rewrite' => QUI::getRewrite(), + 'jsControl' => 'package/quiqqer/menu/bin/MegaMenu', + 'prepend' => $this->prepend, + 'append' => $this->append, + 'childControl' => $childControl, + 'showMenu' => true + ]); + + if ($this->getProject()->getConfig('menu.settings.type') == 'noMenu') { + $Engine->assign('showMenu', false); + } - $result = []; - $result['html'] = $Engine->fetch(dirname(__FILE__).'/MegaMenu.html'); - $result['subMenus'] = \array_unique($this->subMenus); + $result = []; + $result['html'] = $Engine->fetch(dirname(__FILE__).'/MegaMenu.html'); + $result['subMenus'] = \array_unique($this->subMenus); + } QUI\Cache\Manager::set($cache, $result);