diff --git a/library/Icinga/Web/Navigation/Renderer/NavigationItemRenderer.php b/library/Icinga/Web/Navigation/Renderer/NavigationItemRenderer.php
index 4c872c07f..4b56b5f04 100644
--- a/library/Icinga/Web/Navigation/Renderer/NavigationItemRenderer.php
+++ b/library/Icinga/Web/Navigation/Renderer/NavigationItemRenderer.php
@@ -20,6 +20,13 @@ class NavigationItemRenderer
*/
protected $view;
+ /**
+ * The link target
+ *
+ * @var string
+ */
+ protected $target;
+
/**
* Create a new NavigationItemRenderer
*
@@ -49,6 +56,19 @@ class NavigationItemRenderer
}
}
+ /**
+ * Set the view
+ *
+ * @param View $view
+ *
+ * @return $this
+ */
+ public function setView(View $view)
+ {
+ $this->view = $view;
+ return $this;
+ }
+
/**
* Return the view
*
@@ -64,18 +84,28 @@ class NavigationItemRenderer
}
/**
- * Set the view
+ * Set the link target
*
- * @param View $view
+ * @param string $target
*
* @return $this
*/
- public function setView(View $view)
+ public function setTarget($target)
{
- $this->view = $view;
+ $this->target = $target;
return $this;
}
+ /**
+ * Return the link target
+ *
+ * @return string
+ */
+ public function getTarget()
+ {
+ return $this->target;
+ }
+
/**
* Render the given navigation item as HTML anchor
*
@@ -92,9 +122,10 @@ class NavigationItemRenderer
if (($url = $item->getUrl()) !== null) {
$content = sprintf(
- '%s',
+ '%s',
$this->view()->propertiesToString($item->getAttributes()),
$this->view()->url($url, $item->getUrlParameters()),
+ $this->target ? ' target="' . $this->view()->escape($this->target) . '"' : '',
$label
);
} else {