From c36093d350cfd6f72773b9d7090131d3985b196e Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Mon, 21 Mar 2016 21:24:22 +0100 Subject: [PATCH] ObjectController: combine preview & external info --- .../views/scripts/object/externalinfo.phtml | 17 --------------- .../Web/Controller/ObjectController.php | 21 ++++--------------- 2 files changed, 4 insertions(+), 34 deletions(-) delete mode 100644 application/views/scripts/object/externalinfo.phtml diff --git a/application/views/scripts/object/externalinfo.phtml b/application/views/scripts/object/externalinfo.phtml deleted file mode 100644 index fe958483..00000000 --- a/application/views/scripts/object/externalinfo.phtml +++ /dev/null @@ -1,17 +0,0 @@ -
-tabs ?> -

escape($this->title) ?>

- -actionLinks ?> - -
- -
-

translate( - 'This is an external object. It has been imported from Icinga 2 throught the' - . ' Core API and cannot be managed with the Icinga Director. It is however' - . ' perfectly valid to create objects using this or referring to this object.' - . ' You might also want to define related Fields to make work based on this' - . ' object more enjoyable' -) ?>

-
diff --git a/library/Director/Web/Controller/ObjectController.php b/library/Director/Web/Controller/ObjectController.php index ded12395..435bc858 100644 --- a/library/Director/Web/Controller/ObjectController.php +++ b/library/Director/Web/Controller/ObjectController.php @@ -26,11 +26,7 @@ abstract class ObjectController extends ActionController $params = $object->getUrlParams(); if ($object->isExternal()) { - $tabs = $this->getTabs()->add('modify', array( - 'url' => sprintf('director/%s', $type), - 'urlParams' => $params, - 'label' => $this->translate(ucfirst($type)) - )); + $tabs = $this->getTabs(); } else { $tabs = $this->getTabs()->add('modify', array( 'url' => sprintf('director/%s', $type), @@ -91,7 +87,9 @@ abstract class ObjectController extends ActionController && $this->object->isExternal() && ! in_array($this->object->getShortTableName(), $allowedExternals) ) { - return $this->externalObjectInfo(); + $this->redirectNow( + $this->getRequest()->getUrl()->setPath(sprintf('director/%s/render', $this->getType())) + ); } return $this->editAction(); @@ -283,17 +281,6 @@ abstract class ObjectController extends ActionController ); } - protected function externalObjectInfo() - { - $this->view->title = sprintf( - $this->translate('External object: %s'), - $this->object->object_name - ); - $this->getTabs()->activate('modify'); - - $this->render('object/externalinfo', null, true); - } - protected function loadObject() { if ($this->object === null) {