diff --git a/library/Icinga/Web/Menu/ForeignMenuItemRenderer.php b/library/Icinga/Web/Menu/ForeignMenuItemRenderer.php index 2ed418bf3..b898b4d08 100644 --- a/library/Icinga/Web/Menu/ForeignMenuItemRenderer.php +++ b/library/Icinga/Web/Menu/ForeignMenuItemRenderer.php @@ -9,15 +9,9 @@ use Icinga\Web\Url; /** * A menu item with a link that surpasses the regular navigation link behavior */ -class ForeignMenuItemRenderer implements MenuItemRenderer { - - public function render(Menu $menu) - { - return sprintf( - '%s%s', - $menu->getUrl() ?: '#', - $menu->getIcon() ? ' ' : '', - htmlspecialchars($menu->getTitle()) - ); - } +class ForeignMenuItemRenderer extends MenuItemRenderer +{ + protected $attributes = array( + 'target' => '_self' + ); } diff --git a/modules/monitoring/library/Monitoring/Web/Menu/MonitoringMenuItemRenderer.php b/modules/monitoring/library/Monitoring/Web/Menu/MonitoringMenuItemRenderer.php index 7df80e034..80ffb3d9c 100644 --- a/modules/monitoring/library/Monitoring/Web/Menu/MonitoringMenuItemRenderer.php +++ b/modules/monitoring/library/Monitoring/Web/Menu/MonitoringMenuItemRenderer.php @@ -6,10 +6,9 @@ namespace Icinga\Module\Monitoring\Web\Menu; use Icinga\Web\Menu as Menu; use Icinga\Module\Monitoring\Backend\MonitoringBackend; use Icinga\Web\Menu\MenuItemRenderer; -use Icinga\Web\Url; - -class MonitoringMenuItemRenderer implements MenuItemRenderer { +class MonitoringMenuItemRenderer extends MenuItemRenderer +{ protected static $summary; protected $columns = array(); @@ -70,31 +69,18 @@ class MonitoringMenuItemRenderer implements MenuItemRenderer { public function render(Menu $menu) { - $count = $this->countItems(); - $badge = ''; - if ($count) { - $badge = sprintf( + return $this->getBadge() . $this->createLink($menu); + } + + protected function getBadge() + { + if ($count = $this->countItems()) { + return sprintf( '
%s
', $this->getBadgeTitle(), $count ); } - if ($menu->getIcon() && strpos($menu->getIcon(), '.') === false) { - return sprintf( - '%s %s', - $badge, - $menu->getUrl() ?: '#', - $menu->getIcon(), - htmlspecialchars($menu->getTitle()) - ); - } - - return sprintf( - '%s%s%s', - $badge, - $menu->getUrl() ?: '#', - $menu->getIcon() ? ' ' : '', - htmlspecialchars($menu->getTitle()) - ); + return ''; } }