mirror of
https://github.com/Icinga/icingaweb2-module-businessprocess.git
synced 2026-05-28 04:34:08 -04:00
Renderer, Breadcrumb: let them know from each...
...other. Not nice, but helps for now
This commit is contained in:
parent
d8a8e488a7
commit
191edb794c
2 changed files with 21 additions and 1 deletions
|
|
@ -53,6 +53,8 @@ class Breadcrumb extends BaseElement
|
|||
protected static function renderNode(BpNode $node, $path, Renderer $renderer)
|
||||
{
|
||||
// TODO: something more generic than NodeTile?
|
||||
$renderer = clone($renderer);
|
||||
$renderer->lock()->setIsBreadcrumb();
|
||||
$p = new NodeTile($renderer, (string) $node, $node, $path);
|
||||
$p->attributes()->add('class', $renderer->getNodeClasses($node));
|
||||
$p->setTag('li');
|
||||
|
|
|
|||
|
|
@ -12,7 +12,6 @@ use Icinga\Module\Businessprocess\Html\Html;
|
|||
use Icinga\Module\Businessprocess\Html\HtmlString;
|
||||
use Icinga\Module\Businessprocess\Node;
|
||||
use Icinga\Module\Businessprocess\Web\Url;
|
||||
use Icinga\Web\Request;
|
||||
|
||||
abstract class Renderer extends Html
|
||||
{
|
||||
|
|
@ -34,6 +33,9 @@ abstract class Renderer extends Html
|
|||
/** @var array */
|
||||
protected $path = array();
|
||||
|
||||
/** @var bool */
|
||||
protected $isBreadcrumb = false;
|
||||
|
||||
/**
|
||||
* Renderer constructor.
|
||||
*
|
||||
|
|
@ -253,6 +255,22 @@ abstract class Renderer extends Html
|
|||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* TODO: Get rid of this
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setIsBreadcrumb()
|
||||
{
|
||||
$this->isBreadcrumb = true;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function isBreadcrumb()
|
||||
{
|
||||
return $this->isBreadcrumb;
|
||||
}
|
||||
|
||||
public function timeSince($time, $timeOnly = false)
|
||||
{
|
||||
if (! $time) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue