mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-24 22:34:24 +02:00
parent
76cf01869e
commit
3aaf726856
@ -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(
|
||||
'<li id="%s" class="%s">',
|
||||
$this->view()->escape($item->getUniqueName()),
|
||||
join(' ', $cssClass)
|
||||
);
|
||||
} else {
|
||||
$content = '<li id="' . $this->view()->escape($item->getUniqueName()) . '">';
|
||||
if ($item->getActive()) {
|
||||
$cssClass[] = static::CSS_CLASS_ACTIVE;
|
||||
}
|
||||
|
||||
$content = sprintf(
|
||||
'<li id="%s" class="%s">',
|
||||
$this->view()->escape($item->getUniqueName()),
|
||||
join(' ', $cssClass)
|
||||
);
|
||||
return $content;
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user