From 3aaf726856d84c48907fd7ef2d152e6fdeeac3ed Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Mon, 21 Sep 2015 11:13:05 +0200 Subject: [PATCH] Update CSS style used for the navigation refs #5600 --- .../Renderer/NavigationRenderer.php | 20 ++++++++----------- .../Renderer/NavigationRendererInterface.php | 15 +++++++++++--- 2 files changed, 20 insertions(+), 15 deletions(-) diff --git a/library/Icinga/Web/Navigation/Renderer/NavigationRenderer.php b/library/Icinga/Web/Navigation/Renderer/NavigationRenderer.php index 4818f402e..8b5caf581 100644 --- a/library/Icinga/Web/Navigation/Renderer/NavigationRenderer.php +++ b/library/Icinga/Web/Navigation/Renderer/NavigationRenderer.php @@ -304,10 +304,7 @@ class NavigationRenderer implements RecursiveIterator, NavigationRendererInterfa */ public function beginItemMarkup(NavigationItem $item) { - $cssClass = array(); - if ($item->getActive()) { - $cssClass[] = static::CSS_CLASS_ACTIVE; - } + $cssClass = array(static::CSS_CLASS_ITEM); if ($item->hasChildren() && $item->getChildren()->getLayout() === Navigation::LAYOUT_DROPDOWN) { $cssClass[] = static::CSS_CLASS_DROPDOWN; @@ -317,16 +314,15 @@ class NavigationRenderer implements RecursiveIterator, NavigationRendererInterfa ->setUrl('#'); } - if (! empty($cssClass)) { - $content = sprintf( - '
  • ', - $this->view()->escape($item->getUniqueName()), - join(' ', $cssClass) - ); - } else { - $content = '
  • '; + if ($item->getActive()) { + $cssClass[] = static::CSS_CLASS_ACTIVE; } + $content = sprintf( + '
  • ', + $this->view()->escape($item->getUniqueName()), + join(' ', $cssClass) + ); return $content; } diff --git a/library/Icinga/Web/Navigation/Renderer/NavigationRendererInterface.php b/library/Icinga/Web/Navigation/Renderer/NavigationRendererInterface.php index 4e8ce6414..0f0e5acf1 100644 --- a/library/Icinga/Web/Navigation/Renderer/NavigationRendererInterface.php +++ b/library/Icinga/Web/Navigation/Renderer/NavigationRendererInterface.php @@ -8,6 +8,13 @@ namespace Icinga\Web\Navigation\Renderer; */ interface NavigationRendererInterface { + /** + * CSS class for items + * + * @var string + */ + const CSS_CLASS_ITEM = 'nav-item'; + /** * CSS class for active items * @@ -20,10 +27,12 @@ interface NavigationRendererInterface * * @var string */ - const CSS_CLASS_DROPDOWN = 'dropdown'; + const CSS_CLASS_DROPDOWN = 'dropdown-nav-item'; /** * CSS class for a dropdown item's trigger + * + * @var string */ const CSS_CLASS_DROPDOWN_TOGGLE = 'dropdown-toggle'; @@ -39,14 +48,14 @@ interface NavigationRendererInterface * * @var string */ - const CSS_CLASS_NAV_DROPDOWN = 'dropdown-menu'; + const CSS_CLASS_NAV_DROPDOWN = 'dropdown-nav'; /** * CSS class for the ul element with tabs layout * * @var string */ - const CSS_CLASS_NAV_TABS = 'nav-tabs'; + const CSS_CLASS_NAV_TABS = 'tab-nav'; /** * Icon for a dropdown item's trigger