From ff855703dfbd64854a5d6ba0a9dcbcc0721f8517 Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Wed, 16 Dec 2015 14:31:29 +0100 Subject: [PATCH] ObjectsController: get rid of templates action --- .../scripts/{hosttemplates => objects}/tree.phtml | 0 .../Director/Web/Controller/ObjectsController.php | 15 +++------------ 2 files changed, 3 insertions(+), 12 deletions(-) rename application/views/scripts/{hosttemplates => objects}/tree.phtml (100%) diff --git a/application/views/scripts/hosttemplates/tree.phtml b/application/views/scripts/objects/tree.phtml similarity index 100% rename from application/views/scripts/hosttemplates/tree.phtml rename to application/views/scripts/objects/tree.phtml diff --git a/library/Director/Web/Controller/ObjectsController.php b/library/Director/Web/Controller/ObjectsController.php index 788f3b5a..070044dd 100644 --- a/library/Director/Web/Controller/ObjectsController.php +++ b/library/Director/Web/Controller/ObjectsController.php @@ -47,10 +47,6 @@ abstract class ObjectsController extends ActionController 'url' => sprintf('director/%ss', strtolower($type)), 'label' => $this->translate(ucfirst($type) . 's'), )); - $tabs = $this->getTabs()->add('objecttemplates', array( - 'url' => sprintf('director/%stemplates', strtolower($type)), - 'label' => $this->translate('Templates'), - )); if ($object->supportsGroups() || $object->isGroup()) { $tabs->add('objectgroups', array( 'url' => sprintf('director/%sgroups', $type), @@ -59,7 +55,7 @@ abstract class ObjectsController extends ActionController } $tabs->add('tree', array( - 'url' => sprintf('director/%stemplates/tree', $type), + 'url' => sprintf('director/%ss/templatetree', $type), 'label' => $this->translate('Tree'), )); } @@ -75,11 +71,6 @@ abstract class ObjectsController extends ActionController if ($dummy->isGroup()) { $this->getTabs()->activate('objectgroups'); $table = 'icinga' . ucfirst($type); - } elseif ($dummy->isTemplate()) { - $this->getTabs()->activate('objecttemplates'); - $table = 'icinga' . ucfirst($type); - $this->loadTable($table); - $table = 'icinga' . ucfirst($type) . 'Template'; } else { $this->getTabs()->activate('objects'); $table = 'icinga' . ucfirst($type); @@ -109,12 +100,12 @@ abstract class ObjectsController extends ActionController $this->render('objects/table', null, true); } - public function treeAction() + public function templatetreeAction() { $this->getTabs()->activate('tree'); $this->view->tree = $this->db()->fetchTemplateTree(strtolower($this->getType())); $this->view->objectTypeName = $this->getType(); - $this->render('hosttemplates/tree', null, true); + $this->render('objects/tree', null, true); } protected function dummyObject()