diff --git a/src/QUI/Menu/Controls/FloatedNav.css b/src/QUI/Menu/Controls/FloatedNav.css new file mode 100644 index 0000000000000000000000000000000000000000..4052c70ee0ec4aedc772c6d1e8fc3430a582d49e --- /dev/null +++ b/src/QUI/Menu/Controls/FloatedNav.css @@ -0,0 +1,94 @@ +/*************/ +/* variables */ +/*************/ +.quiqqer-floatedNav__size-medium { + --quiqqer-floatedNav-spacing: 0.75rem; + --quiqqer-floatedNav-fontSize: 1.75rem; + --quiqqer-floatedNav-size: 3rem; +} + +.quiqqer-floatedNav__size-small { + --quiqqer-floatedNav-spacing: 0.5rem; + --quiqqer-floatedNav-fontSize: 1.25rem; + --quiqqer-floatedNav-size: 2rem; +} + +.quiqqer-floatedNav__size-large { + --quiqqer-floatedNav-spacing: 1rem; + --quiqqer-floatedNav-fontSize: 2rem; + --quiqqer-floatedNav-size: 3.5rem; +} + +/***********/ +/* control */ +/***********/ +.quiqqer-floatedNav { + background: #fff; + position: fixed; + right: 0; + top: 50%; + transform: translateY(-50%); + z-index: 10; +} + +.quiqqer-floatedNav-entry-inner { + background: var(--qui-color-main, #333); + border: var(--qui-border-width, 2px) solid var(--qui-color-main, #333); + color: var(--qui-color-main-contrast, #fff); + cursor: pointer; + display: block; + font-size: var(--quiqqer-floatedNav-fontSize); + line-height: var(--quiqqer-floatedNav-size); + text-align: center; + width: var(--quiqqer-floatedNav-size); +} + +/* lang switch */ +.quiqqer-floatedNav .quiqqer-bricks-languageswitch-flag { + font-size: calc(0.75 * var(--quiqqer-floatedNav-fontSize)); + width: var(--quiqqer-floatedNav-size); + background: var(--qui-color-main, #333); + display: flex; + flex-direction: column; +} + +.quiqqer-floatedNav .quiqqer-bricks-languageswitch-flag-entry { + line-height: calc(0.5 * var(--quiqqer-floatedNav-size)); + padding: 0; + text-align: center; + color: var(--qui-color-main-contrast, #fff); + font-weight: bold; + text-transform: uppercase; +} + +.quiqqer-floatedNav .quiqqer-bricks-languageswitch-flag-entry-text { + line-height: inherit; + display: block; +} + + +/***********/ +/* Designs */ +/***********/ + +/* Design: Bar with icons */ +.quiqqer-floatedNav__iconsBar { + border-bottom-left-radius: 0.75rem; + border-top-left-radius: 0.75rem; + box-shadow: -3px 3px 8px rgb(0 0 0 / 30%); + padding: var(--quiqqer-floatedNav-spacing); +} + +.quiqqer-floatedNav__iconsBar .quiqqer-floatedNav-entry-inner, +.quiqqer-floatedNav__iconsBar .quiqqer-bricks-languageswitch-flag { + border-radius: var(--qui-btn-border-radius, 5px); +} + +.quiqqer-floatedNav__iconsBar .quiqqer-floatedNav-entry:not(:last-child) .quiqqer-floatedNav-entry-inner { + margin-bottom: var(--quiqqer-floatedNav-spacing); +} + +/* Design: flat */ +.quiqqer-floatedNav__flat .quiqqer-floatedNav-entry:not(:last-child) { + margin-bottom: 4px; +} diff --git a/src/QUI/Menu/Controls/FloatedNav.html b/src/QUI/Menu/Controls/FloatedNav.html new file mode 100644 index 0000000000000000000000000000000000000000..47b5d866b8a1e703ae29bb562c4a51196ac9e127 --- /dev/null +++ b/src/QUI/Menu/Controls/FloatedNav.html @@ -0,0 +1,28 @@ +<nav class="quiqqer-floatedNav {$design} {$size}"> + {foreach $children as $Child} + {assign var=hasUrl value=1} + {if !$Child->getUrl()} + {assign var=hasUrl value=0} + {/if} + {if $Child->getIcon() && $Child->getIcon()|strpos:'image.php' !== 0} + <div class="quiqqer-floatedNav-entry quiqqer-floatedNav-entry__id-{$Child->getIdentifier()} {if !$hasUrl}quiqqer-floatedNav-entry__noUrl{/if}"> + {if $Child->getUrl()} + <a href="{$Child->getUrl()}" + class="quiqqer-floatedNav-entry-inner" + title="{$Child->getTitleAttribute()|escape:'html'}" + {if $Child->getTarget()}target="{$Child->getTarget()}"{/if} + > + {image src=$Child->getIcon() onlyicon=1} + </a> + {else} + <span class="quiqqer-floatedNav-entry-inner" title="{$Child->getTitleAttribute()|escape:'html'}"> + {image src=$Child->getIcon() onlyicon=1} + </span> + {/if} + </div> + {/if} + {/foreach} + {if $LangSwitch} + {$LangSwitch->create()} + {/if} +</nav> \ No newline at end of file diff --git a/src/QUI/Menu/Controls/FloatedNav.php b/src/QUI/Menu/Controls/FloatedNav.php new file mode 100644 index 0000000000000000000000000000000000000000..bf5abb4a3c8b9f2f7e77491ae6550a0dc1c4667e --- /dev/null +++ b/src/QUI/Menu/Controls/FloatedNav.php @@ -0,0 +1,86 @@ +<?php + +/** + * This file contains QUI\Menu\Controls\FloatedNav + */ + +namespace QUI\Menu\Controls; + +use QUI; +use QUI\Menu\Independent; + +/** + * Class WallpaperText + * + * @package quiqqer/menu + */ +class FloatedNav extends QUI\Control +{ + /** + * constructor + * + * @param array $attributes + */ + public function __construct($attributes = []) + { + // default options + $this->setAttributes([ + 'menuId' => false, + 'size' => 'medium', // small, medium, large + 'design' => 'iconBar', // iconBar, flat + ]); + + parent::__construct($attributes); + + $this->addCSSFile( + dirname(__FILE__).'/FloatedNav.css' + ); + } + + /** + * (non-PHPdoc) + * + * @see \QUI\Control::create() + */ + public function getBody() + { + $Engine = QUI::getTemplateManager()->getEngine(); + $size = 'quiqqer-floatedNav__size-medium'; + $design = 'quiqqer-floatedNav__iconsBar'; + $showLangSwitch = false; + + $IndependentMenu = Independent\Handler::getMenu($this->getAttribute('menuId')); + + if (!$IndependentMenu) { + return ''; + } + + if ($this->getAttribute('size')) { + $size = 'quiqqer-floatedNav__size-'.$this->getAttribute('size'); + } + + if ($this->getAttribute('design')) { + $design = 'quiqqer-floatedNav__'.$this->getAttribute('design'); + } + + + $showLangSwitch = true; + + $LangSwitch = new QUI\Bricks\Controls\LanguageSwitches\Flags([ + 'showFlags' => 0 + ]); + + $children = $IndependentMenu->getChildren(); + + $Engine->assign([ + 'this' => $this, + 'children' => $children, + 'size' => $size, + 'design' => $design, + 'showLangSwitch' => $showLangSwitch, + 'LangSwitch' => $LangSwitch + ]); + + return $Engine->fetch(dirname(__FILE__).'/FloatedNav.html'); + } +} diff --git a/src/QUI/Menu/Mega/Simple.Independent.html b/src/QUI/Menu/Mega/Simple.Independent.html index 9cf023f335089315af9f62dc526354b80b91425b..18475c94d130f7482b3321c7d7c144aef7ece4c5 100644 --- a/src/QUI/Menu/Mega/Simple.Independent.html +++ b/src/QUI/Menu/Mega/Simple.Independent.html @@ -10,7 +10,7 @@ title="{$Child->getTitleAttribute()|escape:'html'}" {if $Child->getTarget()}target="{$Child->getTarget()}"{/if} > - {if $Child->getIcon() && $Child->getIcon()|strpos:'image' !== 'false' } + {if $Child->getIcon() && $Child->getIcon()|strpos:'image.php' !== 0 } {image src=$Child->getIcon() onlyicon=1} {/if} @@ -20,7 +20,7 @@ </a> {else} <span class="qui-menu-siteid-{$Child->getIdentifier()}"> - {if $Child->getIcon() && $Child->getIcon()|strpos:'image' !== 'false' } + {if $Child->getIcon() && $Child->getIcon()|strpos:'image.php' !== 0 } {image src=$Child->getIcon() onlyicon=1} {/if} diff --git a/src/QUI/Menu/Menu.Children.Independent.html b/src/QUI/Menu/Menu.Children.Independent.html index c66049221cc92bf6cccc86d4debebc98a1c998d5..2f9e704cf958eecba3a89878500a6ad5c11be2ea 100644 --- a/src/QUI/Menu/Menu.Children.Independent.html +++ b/src/QUI/Menu/Menu.Children.Independent.html @@ -13,7 +13,7 @@ title="{$Child->getTitleAttribute()|escape:'html'}" {if $Child->getTarget()}target="{$Child->getTarget()}"{/if} > - {if $this->getAttribute('showFirstLevelIcons') && $Child->getIcon() && $Child->getIcon()|strpos:'image' !== 'false' } + {if $this->getAttribute('showFirstLevelIcons') && $Child->getIcon() && $Child->getIcon()|strpos:'image.php' !== 0 } {image src=$Child->getIcon() onlyicon=1} {/if} <span class="fa fa-angle-right"></span>