From 4eb92438dd8eae3254ec602a0f4088b14577ca2c Mon Sep 17 00:00:00 2001 From: Eric Lippmann Date: Tue, 27 Oct 2015 13:52:18 +0100 Subject: [PATCH] Add nav-level-$level CSS classes to navigation --- .../Icinga/Web/Navigation/Renderer/NavigationRenderer.php | 6 +++++- .../Web/Navigation/Renderer/RecursiveNavigationRenderer.php | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/library/Icinga/Web/Navigation/Renderer/NavigationRenderer.php b/library/Icinga/Web/Navigation/Renderer/NavigationRenderer.php index fb0ca0925..7dc9da387 100644 --- a/library/Icinga/Web/Navigation/Renderer/NavigationRenderer.php +++ b/library/Icinga/Web/Navigation/Renderer/NavigationRenderer.php @@ -271,9 +271,11 @@ class NavigationRenderer implements RecursiveIterator, NavigationRendererInterfa /** * Return the opening markup for multiple navigation items * + * @param int $level + * * @return string */ - public function beginChildrenMarkup() + public function beginChildrenMarkup($level = 1) { $cssClass = array(static::CSS_CLASS_NAV); if ($this->navigation->getLayout() === Navigation::LAYOUT_TABS) { @@ -282,6 +284,8 @@ class NavigationRenderer implements RecursiveIterator, NavigationRendererInterfa $cssClass[] = static::CSS_CLASS_NAV_DROPDOWN; } + $cssClass[] = 'nav-level-' . $level; + return '