2017-06-20 15:55:23 -04:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace Icinga\Module\Director\Controllers;
|
|
|
|
|
|
2017-06-29 08:06:32 -04:00
|
|
|
use Icinga\Module\Director\Web\ActionBar\ChoicesActionBar;
|
2017-06-20 15:55:23 -04:00
|
|
|
use Icinga\Module\Director\Web\Controller\ActionController;
|
|
|
|
|
use Icinga\Module\Director\Web\Table\ChoicesTable;
|
2017-06-29 08:06:32 -04:00
|
|
|
use Icinga\Module\Director\Web\Tabs\ObjectsTabs;
|
2017-06-20 15:55:23 -04:00
|
|
|
|
|
|
|
|
class TemplatechoicesController extends ActionController
|
|
|
|
|
{
|
|
|
|
|
protected function checkDirectorPermissions()
|
|
|
|
|
{
|
|
|
|
|
$this->assertPermission('director/admin');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function hostAction()
|
|
|
|
|
{
|
2017-07-05 00:14:58 -04:00
|
|
|
$this->prepare('host', $this->translate('Host template choices'));
|
2017-06-20 15:55:23 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function serviceAction()
|
|
|
|
|
{
|
2017-07-05 00:14:58 -04:00
|
|
|
$this->prepare('service', $this->translate('Service template choices'));
|
2017-06-20 15:55:23 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function notificationAction()
|
|
|
|
|
{
|
2017-07-05 00:14:58 -04:00
|
|
|
$this->prepare('notification', $this->translate('Notification template choices'));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected function prepare($type, $title)
|
|
|
|
|
{
|
2019-04-12 05:58:09 -04:00
|
|
|
$this->tabs(new ObjectsTabs($type, $this->Auth(), $type))->activate('choices');
|
2017-07-05 00:19:12 -04:00
|
|
|
$this->setAutorefreshInterval(10)->addTitle($title);
|
2017-07-12 06:34:58 -04:00
|
|
|
$this->actions(new ChoicesActionBar($type, $this->url()));
|
2017-07-05 00:19:12 -04:00
|
|
|
ChoicesTable::create($type, $this->db())->renderTo($this);
|
2017-06-29 08:06:32 -04:00
|
|
|
}
|
2017-06-20 15:55:23 -04:00
|
|
|
}
|