diff --git a/library/Director/Web/Tabs/ObjectsTabs.php b/library/Director/Web/Tabs/ObjectsTabs.php new file mode 100644 index 00000000..1a7c877d --- /dev/null +++ b/library/Director/Web/Tabs/ObjectsTabs.php @@ -0,0 +1,55 @@ +isGroup()) { + $object = IcingaObject::createByType(substr($type, 0, -5)); + } + + $this->add('index', array( + 'url' => sprintf('director/%ss', strtolower($type)), + 'label' => $this->translate(ucfirst($type) . 's'), + )); + + if ($auth->hasPermission('director/admin')) { + if ($object->supportsImports()) { + $this->add('templates', array( + 'url' => sprintf('director/%ss/templates', strtolower($type)), + 'label' => $this->translate('Templates'), + )); + } + + if ($object->supportsGroups()) { + $this->add('groups', array( + 'url' => sprintf('director/%sgroups', $type), + 'label' => $this->translate('Groups') + )); + } + + if ($object->supportsApplyRules()) { + $this->add('applyrules', array( + 'url' => sprintf('director/%ss/applyrules', $type), + 'label' => $this->translate('Apply') + )); + } + if ($object->supportsSets()) { + $this->add('sets', array( + 'url' => sprintf('director/%ss/sets', $type), + 'label' => $this->translate('Sets') + )); + } + } + } +}