diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-14 13:17:31 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-14 13:17:31 +0000 |
commit | f66ab8dae2f3d0418759f81a3a64dc9517a62449 (patch) | |
tree | fbff2135e7013f196b891bbde54618eb050e4aaf /application/controllers/TemplatechoicesController.php | |
parent | Initial commit. (diff) | |
download | icingaweb2-module-director-637719940e1afc77920a3277535a10f7abc06f7f.tar.xz icingaweb2-module-director-637719940e1afc77920a3277535a10f7abc06f7f.zip |
Adding upstream version 1.10.2.upstream/1.10.2
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'application/controllers/TemplatechoicesController.php')
-rw-r--r-- | application/controllers/TemplatechoicesController.php | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/application/controllers/TemplatechoicesController.php b/application/controllers/TemplatechoicesController.php new file mode 100644 index 0000000..753591a --- /dev/null +++ b/application/controllers/TemplatechoicesController.php @@ -0,0 +1,39 @@ +<?php + +namespace Icinga\Module\Director\Controllers; + +use Icinga\Module\Director\Web\ActionBar\ChoicesActionBar; +use Icinga\Module\Director\Web\Controller\ActionController; +use Icinga\Module\Director\Web\Table\ChoicesTable; +use Icinga\Module\Director\Web\Tabs\ObjectsTabs; + +class TemplatechoicesController extends ActionController +{ + protected function checkDirectorPermissions() + { + $this->assertPermission('director/admin'); + } + + public function hostAction() + { + $this->prepare('host', $this->translate('Host template choices')); + } + + public function serviceAction() + { + $this->prepare('service', $this->translate('Service template choices')); + } + + public function notificationAction() + { + $this->prepare('notification', $this->translate('Notification template choices')); + } + + protected function prepare($type, $title) + { + $this->tabs(new ObjectsTabs($type, $this->Auth(), $type))->activate('choices'); + $this->setAutorefreshInterval(10)->addTitle($title); + $this->actions(new ChoicesActionBar($type, $this->url())); + ChoicesTable::create($type, $this->db())->renderTo($this); + } +} |