getTitle(); $type = $node->getType(); $cssClasses = join(' ', $classes); $status = $node->getStatus(); $statusClass = $status->getOverall(); if ($type === 'host') { $icon = 'host'; $url = Url::fromPath( 'monitoring/host/show', array( 'host' => $node->get('host') ) ); } elseif ($type === 'service') { $icon = 'service'; $url = Url::fromPath( 'monitoring/service/show', array( 'host' => $node->get('host'), 'service' => $node->get('service') ) ); } elseif ($type === 'hostgroup') { $icon = 'cubes'; $url = Url::fromPath( 'monitoring/list/services', array( 'hostgroup' => $node->get('hostgroup'), 'sort' => 'service_severity', 'dir' => 'desc', ) ); if (($h = $status->getMeta('hosts_unhandled')) > 0) { $hostTitle = '(' . sprintf($this->view->translatePlural('%s unhandled host', '%s unhandled hosts', $h), $h) . ')'; } else { $h = $status->getMeta('hosts_total'); $hostTitle = '(' . sprintf($this->view->translatePlural('%s host', '%s hosts', $h), $h) . ')'; } $htmExtra .= ' ' . $this->view->qlink( $hostTitle, 'monitoring/list/hosts', array( 'hostgroup' => $node->get('hostgroup'), 'sort' => 'host_severity', 'dir' => 'desc', ), null, false ); } else { $icon = null; $url = Url::fromPath( 'toplevelview/show/tree', array( 'name' => $node->getRoot()->getConfig()->getName(), 'id' => $node->getFullId() ) ); } if ($type !== 'node') { $htm .= "
"; $htm .= $this->view->icon($icon) . ' '; $htm .= $this->view->qlink($title, $url); $htm .= $htmExtra; $htm .= ' ' . $this->view->badges($status, false); $htm .= '
'; } else { $htm .= "
"; $htm .= '
'; $htm .= $this->view->badges($status, false, $level === 0 ? true : false); $htm .= ' '; $htm .= $this->view->qlink($title, $url); $htm .= $htmExtra; $htm .= '
'; if ($node->hasChildren()) { foreach ($node->getChildren() as $child) { $htm .= $this->tree($child, $classes, $level + 1); } } $htm .= '
'; } return $htm; } }