mirror of
https://github.com/Icinga/icingaweb2-module-businessprocess.git
synced 2026-01-19 19:02:54 -05:00
BpNode: rendering
This commit is contained in:
parent
057d99cab5
commit
dad4b991ea
1 changed files with 39 additions and 0 deletions
|
|
@ -190,4 +190,43 @@ class BpNode extends Node
|
|||
}
|
||||
return $this->children;
|
||||
}
|
||||
|
||||
protected function assertNumericOperator()
|
||||
{
|
||||
if (! is_numeric($this->operator)) {
|
||||
// TODO: ConfigurationError
|
||||
throw new Exception(
|
||||
sprintf(
|
||||
'Got invalid operator: %s',
|
||||
$this->operator
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
public function renderLink($view)
|
||||
{
|
||||
if (! $this->bp->isEditMode()) {
|
||||
return parent::renderLink($view);
|
||||
}
|
||||
return $view->qlink($this->name, 'bpapp/node/edit', array(
|
||||
'node' => $this->name
|
||||
));
|
||||
}
|
||||
|
||||
public function operatorHtml()
|
||||
{
|
||||
switch ($this->operator) {
|
||||
case self::OP_AND:
|
||||
return 'and';
|
||||
break;
|
||||
case self::OP_OR:
|
||||
return 'or';
|
||||
break;
|
||||
default:
|
||||
// MIN
|
||||
$this->assertNumericOperator();
|
||||
return 'min:' . $this->operator;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue