[icinga-checkins] icinga.org: icingaweb2-module-director/fiddle/mfrosch-2: ObjectsController : Calculate tabs for base object, no the group

git at icinga.org git at icinga.org
Mon Jul 11 08:42:23 CEST 2016


Module: icingaweb2-module-director
Branch: fiddle/mfrosch-2
Commit: a90b593f9f34e439ff3e12533846976c34c0c445
URL:    https://git.icinga.org/?p=icingaweb2-module-director.git;a=commit;h=a90b593f9f34e439ff3e12533846976c34c0c445

Author: Markus Frosch <lazyfrosch at icinga.org>
Date:   Thu Jun  9 14:24:37 2016 +0200

ObjectsController: Calculate tabs for base object, no the group

---

 library/Director/Web/Controller/ObjectsController.php |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/library/Director/Web/Controller/ObjectsController.php b/library/Director/Web/Controller/ObjectsController.php
index 2f29bef..3f52bb8 100644
--- a/library/Director/Web/Controller/ObjectsController.php
+++ b/library/Director/Web/Controller/ObjectsController.php
@@ -44,7 +44,10 @@ abstract class ObjectsController extends ActionController
         /** @var IcingaObject $object */
         $object = $this->dummyObject();
         if ($object->isGroup()) {
+            /** @var IcingaObject $type */
             $type = substr($type, 0, -5);
+            $baseObject = substr($this->getObjectClassname(), 0, -5);
+            $object = $baseObject::create(array());
         }
 
         $tabs->add('objects', array(
@@ -57,7 +60,7 @@ abstract class ObjectsController extends ActionController
                 'label' => $this->translate('Templates'),
             ));
         }
-        if ($object->supportsGroups() || $object->isGroup()) {
+        if ($object->supportsGroups()) {
             $tabs->add('objectgroups', array(
                 'url'   => sprintf('director/%sgroups', $type),
                 'label' => $this->translate('Groups')



More information about the icinga-checkins mailing list