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