parent
9a725330fb
commit
a930ea7f7a
|
@ -5,6 +5,7 @@ namespace Icinga\Web\Navigation;
|
||||||
|
|
||||||
use ArrayAccess;
|
use ArrayAccess;
|
||||||
use ArrayIterator;
|
use ArrayIterator;
|
||||||
|
use Exception;
|
||||||
use Countable;
|
use Countable;
|
||||||
use InvalidArgumentException;
|
use InvalidArgumentException;
|
||||||
use IteratorAggregate;
|
use IteratorAggregate;
|
||||||
|
@ -14,6 +15,7 @@ use Icinga\Application\Logger;
|
||||||
use Icinga\Authentication\Auth;
|
use Icinga\Authentication\Auth;
|
||||||
use Icinga\Data\ConfigObject;
|
use Icinga\Data\ConfigObject;
|
||||||
use Icinga\Exception\ConfigurationError;
|
use Icinga\Exception\ConfigurationError;
|
||||||
|
use Icinga\Exception\IcingaException;
|
||||||
use Icinga\Exception\ProgrammingError;
|
use Icinga\Exception\ProgrammingError;
|
||||||
use Icinga\Util\String;
|
use Icinga\Util\String;
|
||||||
|
|
||||||
|
@ -271,6 +273,16 @@ class Navigation implements ArrayAccess, Countable, IteratorAggregate
|
||||||
return new RecursiveNavigationRenderer($this);
|
return new RecursiveNavigationRenderer($this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return this navigation rendered to HTML
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function render()
|
||||||
|
{
|
||||||
|
return $this->getRenderer()->render();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Order this navigation's items
|
* Order this navigation's items
|
||||||
*
|
*
|
||||||
|
@ -394,5 +406,18 @@ class Navigation implements ArrayAccess, Countable, IteratorAggregate
|
||||||
|
|
||||||
return $navigation;
|
return $navigation;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return this navigation rendered to HTML
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function __toString()
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
return $this->render();
|
||||||
|
} catch (Exception $e) {
|
||||||
|
return IcingaException::describe($e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue