Skip to content

Commit

Permalink
Navigation: Support empty labels for creating containers
Browse files Browse the repository at this point in the history
refs #5543
  • Loading branch information
lippserd committed Sep 27, 2015
1 parent d8f45fc commit 63e0549
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion library/Icinga/Web/Navigation/NavigationItem.php
Expand Up @@ -436,7 +436,7 @@ public function getParent()
*/
public function getLabel()
{
return $this->label ?: $this->getName();
return $this->label !== null ? $this->label : $this->getName();
}

/**
Expand Down
Expand Up @@ -56,7 +56,7 @@ public function __construct(array $options = null)
*/
public function init()
{

}

/**
Expand Down Expand Up @@ -164,13 +164,15 @@ public function render(NavigationItem $item = null)
$this->renderTargetAttribute(),
$label
);
} else {
} elseif ($label) {
$content = sprintf(
'<%1$s%2$s>%3$s</%1$s>',
$item::LINK_ALTERNATIVE,
$this->view()->propertiesToString($item->getAttributes()),
$label
);
} else {
$content = '';
}

return $content;
Expand Down

0 comments on commit 63e0549

Please sign in to comment.