diff --git a/library/Businessprocess/BpNode.php b/library/Businessprocess/BpNode.php index ccb3b19..767193d 100644 --- a/library/Businessprocess/BpNode.php +++ b/library/Businessprocess/BpNode.php @@ -246,16 +246,18 @@ class BpNode extends Node )); } - public function toLegacyConfigString() + public function toLegacyConfigString(& $rendered = array()) { $cfg = ''; $children = array(); foreach ($this->getChildren() as $name => $child) { $children[] = (string) $child; + if (array_key_exists($name, $rendered)) { continue; } if ($child instanceof BpNode) { - $cfg .= $child->toLegacyConfigString() . "\n"; + $cfg .= $child->toLegacyConfigString($rendered) . "\n"; } + $rendered[$name] = true; } $eq = '='; $op = $this->operator; diff --git a/library/Businessprocess/BusinessProcess.php b/library/Businessprocess/BusinessProcess.php index ae1962b..316b625 100644 --- a/library/Businessprocess/BusinessProcess.php +++ b/library/Businessprocess/BusinessProcess.php @@ -408,8 +408,9 @@ class BusinessProcess date('Y-m-d H:i:s') ); + $rendered = array(); foreach ($this->getChildren() as $child) { - $conf .= $child->toLegacyConfigString(); + $conf .= $child->toLegacyConfigString($rendered); } return $conf . "\n"; } diff --git a/library/Businessprocess/HostNode.php b/library/Businessprocess/HostNode.php index dc3db39..bcd9c61 100644 --- a/library/Businessprocess/HostNode.php +++ b/library/Businessprocess/HostNode.php @@ -27,7 +27,7 @@ class HostNode extends Node )); } else { return $view->qlink($this->getHostname(), 'monitoring/host/show', array( - 'host' => $this->getHostname, + 'host' => $this->getHostname(), 'processName' => $this->bp->getName() )); } diff --git a/library/Businessprocess/Node.php b/library/Businessprocess/Node.php index f8fb075..8973141 100644 --- a/library/Businessprocess/Node.php +++ b/library/Businessprocess/Node.php @@ -340,7 +340,7 @@ abstract class Node return ' '; } - public function toLegacyConfigString() { return '';} + public function toLegacyConfigString(& $rendered = array()) { return '';} //abstract public function toLegacyConfigString(); public function __toString()