From d59b09ca48fe5dfcd4be4c1fa55006a3e6081e01 Mon Sep 17 00:00:00 2001 From: Eric Lippmann Date: Sun, 27 Sep 2015 14:16:51 +0200 Subject: [PATCH] Fix badge markup in the BadgeNavigationItemRenderer refs #5543 --- .../Renderer/BadgeNavigationItemRenderer.php | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/library/Icinga/Web/Navigation/Renderer/BadgeNavigationItemRenderer.php b/library/Icinga/Web/Navigation/Renderer/BadgeNavigationItemRenderer.php index fa0d82324..5160d5d66 100644 --- a/library/Icinga/Web/Navigation/Renderer/BadgeNavigationItemRenderer.php +++ b/library/Icinga/Web/Navigation/Renderer/BadgeNavigationItemRenderer.php @@ -19,7 +19,7 @@ abstract class BadgeNavigationItemRenderer extends NavigationItemRenderer /** * The tooltip text for the badge * - * @var string + * @var string */ protected $title; @@ -28,7 +28,7 @@ abstract class BadgeNavigationItemRenderer extends NavigationItemRenderer * * The state identifier defines the background color of the badge. * - * @var string + * @var string */ protected $state; @@ -94,7 +94,7 @@ abstract class BadgeNavigationItemRenderer extends NavigationItemRenderer */ public function render(NavigationItem $item = null) { - return $this->renderBadge() . parent::render($item); + return '
' . $this->renderBadge() . parent::render($item) . '
'; } /** @@ -104,11 +104,12 @@ abstract class BadgeNavigationItemRenderer extends NavigationItemRenderer */ protected function renderBadge() { - if (($count = $this->getCount()) > 0) { + if ($count = $this->getCount()) { + $view = $this->view(); return sprintf( - '
%s
', - $this->view()->escape($this->getTitle()), - $this->view()->escape($this->getState()), + '%s', + $view->escape($this->getTitle()), + $view->escape($this->getState()), $count ); }