mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-08-14 14:28:10 +02:00
objects/tree: generic template for all object types
This commit is contained in:
parent
053854e2c6
commit
8b11c07c65
@ -8,7 +8,8 @@ function dumpTree($tree, $self, $level = 0)
|
||||
if ($level === 0) {
|
||||
$class = 'root';
|
||||
} else {
|
||||
$class = 'host';
|
||||
//$class = 'host';
|
||||
$class = $self->objectTypeName;
|
||||
}
|
||||
|
||||
if ($hasChildren) {
|
||||
@ -27,10 +28,14 @@ function dumpTree($tree, $self, $level = 0)
|
||||
$html .= '<a name="Templates" class="root">' . $self->escape($tree->name) . '</a>';
|
||||
} else {
|
||||
$html .= $self->qlink(
|
||||
$tree->name,
|
||||
'director/host',
|
||||
array('name' => $tree->name),
|
||||
array('class' => $class)
|
||||
$tree->name,
|
||||
'director/' . $self->objectTypeName,
|
||||
array('name' => $tree->name),
|
||||
array('class' => $class)
|
||||
) . $self->qlink(
|
||||
'=>',
|
||||
'director/' . $self->objectTypeName . '/childlist',
|
||||
array('name' => $tree->name)
|
||||
);
|
||||
}
|
||||
|
||||
@ -48,7 +53,7 @@ function dumpTree($tree, $self, $level = 0)
|
||||
?>
|
||||
<div class="controls">
|
||||
<?= $this->tabs ?>
|
||||
<h1><?= $this->translate('Host template tree') ?></h1>
|
||||
<h1><?= $this->translate('Template tree') ?></h1>
|
||||
</div>
|
||||
|
||||
<div class="content">
|
||||
|
@ -106,6 +106,8 @@ abstract class ObjectsController extends ActionController
|
||||
{
|
||||
$this->getTabs()->activate('tree');
|
||||
$this->view->tree = $this->db()->fetchTemplateTree(strtolower($this->getType()));
|
||||
$this->view->objectTypeName = $this->getType();
|
||||
$this->render('hosttemplates/tree', null, true);
|
||||
}
|
||||
|
||||
protected function dummyObject()
|
||||
|
Loading…
x
Reference in New Issue
Block a user