NavigationItem: Rename method getView() to view()

refs #5600
This commit is contained in:
Johannes Meyer 2015-09-03 10:39:11 +02:00
parent 206168672b
commit 811269df01
1 changed files with 6 additions and 8 deletions

View File

@ -505,7 +505,7 @@ class NavigationItem implements IteratorAggregate
* *
* @return View * @return View
*/ */
public function getView() public function view()
{ {
if ($this->view === null) { if ($this->view === null) {
$this->setView(Icinga::app()->getViewRenderer()->view); $this->setView(Icinga::app()->getViewRenderer()->view);
@ -607,25 +607,23 @@ class NavigationItem implements IteratorAggregate
*/ */
public function render() public function render()
{ {
$view = $this->getView(); $label = $this->view()->escape($this->getLabel());
$label = $view->escape($this->getLabel());
if (($icon = $this->getIcon()) !== null) { if (($icon = $this->getIcon()) !== null) {
$label = $view->icon($icon) . $label; $label = $this->view()->icon($icon) . $label;
} }
if (($url = $this->getUrl()) !== null) { if (($url = $this->getUrl()) !== null) {
$content = sprintf( $content = sprintf(
'<a%s href="%s">%s</a>', '<a%s href="%s">%s</a>',
$view->propertiesToString($this->getAttributes()), $this->view()->propertiesToString($this->getAttributes()),
$view->url($url, $this->getUrlParameters()), $this->view()->url($url, $this->getUrlParameters()),
$label $label
); );
} else { } else {
$content = sprintf( $content = sprintf(
'<%1$s%2$s>%3$s</%1$s>', '<%1$s%2$s>%3$s</%1$s>',
static::LINK_ALTERNATIVE, static::LINK_ALTERNATIVE,
$view->propertiesToString($this->getAttributes()), $this->view()->propertiesToString($this->getAttributes()),
$label $label
); );
} }