diff --git a/bricks.xml b/bricks.xml index f4a16d68e97acfdb043e7a5506d279f52ab42afd..9ec76ea65573339245049dcfcc9d238cdf091beb 100644 --- a/bricks.xml +++ b/bricks.xml @@ -16,29 +16,38 @@ <settings> <setting name="display" type="select"> <locale group="quiqqer/menu" - var="menu.control.sidebarDropDownMenu.setting.display" /> + var="menu.control.sidebarDropDownMenu.setting.display"/> <option value="simple"> <locale group="quiqqer/menu" - var="menu.control.sidebarDropDownMenu.setting.display.simple" /> + var="menu.control.sidebarDropDownMenu.setting.display.simple"/> </option> <option value="advanced"> <locale group="quiqqer/menu" - var="menu.control.sidebarDropDownMenu.setting.display.advanced" /> + var="menu.control.sidebarDropDownMenu.setting.display.advanced"/> </option> </setting> + <setting name="startId" class="project-site"> <locale group="quiqqer/menu" var="menu.control.sidebarDropDownMenu.setting.startId"/> </setting> + <setting name="parentLink" type="checkbox"> <locale group="quiqqer/menu" var="menu.control.sidebarDropDownMenu.setting.parentLink"/> </setting> + + <setting name="showAllChildren" type="checkbox"> + <locale group="quiqqer/menu" + var="menu.control.sidebarDropDownMenu.setting.showAllChildren"/> + </setting> + <setting name="levels" type="number"> <locale group="quiqqer/menu" var="menu.control.sidebarDropDownMenu.setting.levels"/> </setting> + <setting name="onlyFirstLevelIcons" type="checkbox"> <locale group="quiqqer/menu" var="menu.control.sidebarDropDownMenu.setting.onlyFirstLevelIcons"/> @@ -46,19 +55,19 @@ <setting name="listType" type="select"> <locale group="quiqqer/menu" - var="menu.control.sidebarDropDownMenu.setting.listType" /> + var="menu.control.sidebarDropDownMenu.setting.listType"/> <option value="fontAwesome"> <locale group="quiqqer/menu" - var="menu.control.sidebarDropDownMenu.setting.listType.fontAwesome" /> + var="menu.control.sidebarDropDownMenu.setting.listType.fontAwesome"/> </option> <option value="sitePicture"> <locale group="quiqqer/menu" - var="menu.control.sidebarDropDownMenu.setting.listType.sitePicture" /> + var="menu.control.sidebarDropDownMenu.setting.listType.sitePicture"/> </option> <option value="none"> <locale group="quiqqer/menu" - var="menu.control.sidebarDropDownMenu.setting.listType.none" /> + var="menu.control.sidebarDropDownMenu.setting.listType.none"/> </option> </setting> </settings> diff --git a/locale.xml b/locale.xml index 0eb95daafae8c6d8bc3c2f4b29bdb0d4c3bac7c5..e96a3310e08d2405343acb79db14f8c43109a1bc 100644 --- a/locale.xml +++ b/locale.xml @@ -9,7 +9,7 @@ <de><![CDATA[Das Menü Plugin stellt verschiedene Menü-Controls zur Verfügung.]]></de> <en><![CDATA[The Plugin menu provides various menu controls.]]></en> </locale> - + <locale name="menu.settings.category"> <de><![CDATA[Menü]]></de> <en><![CDATA[Menu]]></en> @@ -110,5 +110,9 @@ <en><![CDATA[None]]></en> <pl><![CDATA[Brak]]></pl> </locale> + <locale name="menu.control.sidebarDropDownMenu.setting.showAllChildren"> + <de><![CDATA[Auch Seiten anzeigen welche die Eigenschaft nicht in Navigation anzeigen besitzen.]]></de> + <en><![CDATA[Also show pages that do not have the property Show in navigation.]]></en> + </locale> </groups> </locales> \ No newline at end of file diff --git a/src/QUI/Menu/SidebarDropDownMenu.Advanced.html b/src/QUI/Menu/SidebarDropDownMenu.Advanced.html index 0a4966ad0983b6c4ea7e1a6067bccc8259cb6b2b..c7e3454dbfc0b7fcfd9cb3e42b1791590be03afa 100644 --- a/src/QUI/Menu/SidebarDropDownMenu.Advanced.html +++ b/src/QUI/Menu/SidebarDropDownMenu.Advanced.html @@ -19,7 +19,7 @@ {/if} {strip} -{assign var=children value=$Site->getNavigation()} +{assign var=children value=$this->getChildren($Site)} {if count( $children )} <ul class="quiqqer-navigation-level-{$level}"> @@ -45,7 +45,7 @@ {/if} {foreach from=$children item=Child} <li class="quiqqer-navigation-li {if $Rewrite->isIdInPath($Child->getId())} active-bgcolor {/if}"> - {assign var=subnavigation value=$Child->getNavigation()} + {assign var=subnavigation value=$this->getChildren($Child)} {assign var=sitePicture value=''} {if $listType == 'sitePicture'} {assign var=sitePicture value='sitePicture-class'} diff --git a/src/QUI/Menu/SidebarDropDownMenu.Simple.html b/src/QUI/Menu/SidebarDropDownMenu.Simple.html index 14b3619be4bb95d21620e7cee07e9eb91c0d3ab1..739ed670f4d82d41e65c4462936cc610b7b8fe2a 100644 --- a/src/QUI/Menu/SidebarDropDownMenu.Simple.html +++ b/src/QUI/Menu/SidebarDropDownMenu.Simple.html @@ -19,7 +19,7 @@ {/if} {strip} -{assign var=children value=$Site->getNavigation()} +{assign var=children value=$this->getChildren($Site)} {if count( $children )} <ul class="quiqqer-navigation-level-{$level}"> @@ -39,7 +39,7 @@ {/if} {foreach from=$children item=Child} <li class="quiqqer-navigation-li {if $Rewrite->isIdInPath($Child->getId())} active-bgcolor {/if}"> - {assign var=subnavigation value=$Child->getNavigation()} + {assign var=subnavigation value=$this->getChildren($Child)} <div class="quiqqer-navigation-entry {if @@ -50,12 +50,10 @@ {if $activeId == $Child->getId()} quiqqer-navigation-active{/if}"> - - {if count ( $subnavigation ) && ($level < $levels || $levels == 0)} {if $levelIcon} <i class="fa quiqqer-fa-list-icon fa-fw {$levelIcon} quiqqer-fa-levels-icon - {if $Rewrite->isIdInPath($Child->getId())} fa-nav-levels-rotate{/if} "></i> + {if $Rewrite->isIdInPath($Child->getId())} fa-nav-levels-rotate{/if}"></i> {/if} {else} {if $listIcon} @@ -64,20 +62,18 @@ {/if} <a href="{url site=$Child}" class="quiqqer-navigation-link - {if !count ( $subnavigation )} quiqqer-navigation-link-no-icon{/if}"> + {if !count($subnavigation)} quiqqer-navigation-link-no-icon{/if}"> {$Child->getAttribute('title')} </a> </div> {if $levels === false || $levels-1 >= $level} <div class="quiqqer-sub-nav-div {if !$Rewrite->isIdInPath($Child->getId())}quiqqer-navigation-close{/if}"> - {include file=$navTemplate - Site=$Child - level=$level - levels=$levels + Site=$Child + level=$level + levels=$levels } - </div> {/if} </li> diff --git a/src/QUI/Menu/SidebarDropDownMenu.php b/src/QUI/Menu/SidebarDropDownMenu.php index afd7670af0de0013bfc66b4cc81be5a4fc21a2cd..661b2849b403f810640de1b317116aab8b8a839e 100644 --- a/src/QUI/Menu/SidebarDropDownMenu.php +++ b/src/QUI/Menu/SidebarDropDownMenu.php @@ -34,7 +34,8 @@ public function __construct($attributes = array()) 'listIcon' => 'fa-angle-right', 'levelIcon' => 'fa-angle-double-right', 'qui-class' => 'package/quiqqer/menu/bin/SidebarDropDownMenu', - 'display' => 'simple' + 'display' => 'simple', + 'showAllChildren' => false )); parent::__construct($attributes); @@ -79,7 +80,7 @@ public function getBody() // active site $ActiveSite = QUI::getRewrite()->getSite(); - if ($ActiveSite && $ActiveSite->getProject() == $Project) { + if ($ActiveSite && $ActiveSite->getProject() === $Project) { $activeId = $ActiveSite->getId(); } @@ -93,13 +94,13 @@ public function getBody() switch ($this->getAttribute('display')) { default: case 'simple': - $css = dirname(__FILE__) . '/SidebarDropDownMenu.Simple.css'; - $template = dirname(__FILE__) . '/SidebarDropDownMenu.Simple.html'; + $css = dirname(__FILE__).'/SidebarDropDownMenu.Simple.css'; + $template = dirname(__FILE__).'/SidebarDropDownMenu.Simple.html'; break; case 'advanced': - $css = dirname(__FILE__) . '/SidebarDropDownMenu.Advanced.css'; - $template = dirname(__FILE__) . '/SidebarDropDownMenu.Advanced.html'; + $css = dirname(__FILE__).'/SidebarDropDownMenu.Advanced.css'; + $template = dirname(__FILE__).'/SidebarDropDownMenu.Advanced.html'; break; } @@ -123,8 +124,17 @@ public function getBody() $this->addCSSFile($css); $html = $Engine->fetch($template); - $html = '<nav>' . $html . '</nav>'; + $html = '<nav>'.$html.'</nav>'; return $html; } + + public function getChildren(QUI\Projects\Site $Site) + { + if (!$this->getAttribute('showAllChildren')) { + return $Site->getNavigation(); + } + + return $Site->getChildren(); + } }