2017-06-27 00:24:30 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Icinga\Module\Director\Controllers;
|
|
|
|
|
2017-07-05 05:46:16 +02:00
|
|
|
use Icinga\Module\Director\Forms\IcingaTemplateChoiceForm;
|
2017-06-29 14:06:32 +02:00
|
|
|
use Icinga\Module\Director\Objects\IcingaTemplateChoiceService;
|
2017-06-27 00:24:30 +02:00
|
|
|
use Icinga\Module\Director\Web\Controller\ActionController;
|
|
|
|
|
|
|
|
class TemplatechoiceController extends ActionController
|
|
|
|
{
|
|
|
|
protected function checkDirectorPermissions()
|
|
|
|
{
|
|
|
|
$this->assertPermission('director/admin');
|
|
|
|
}
|
|
|
|
|
|
|
|
public function hostAction()
|
|
|
|
{
|
2017-07-05 05:46:16 +02:00
|
|
|
$form = IcingaTemplateChoiceForm::create('host', $this->db())
|
|
|
|
->optionallyLoad($this->params->get('name'))
|
|
|
|
->handleRequest();
|
2017-06-27 00:24:30 +02:00
|
|
|
$this->addSingleTab('Choice')
|
2017-07-05 05:46:16 +02:00
|
|
|
->addTitle($this->translate('Host template choice'))
|
|
|
|
->content()->add($form);
|
2017-06-27 00:24:30 +02:00
|
|
|
}
|
2017-06-29 14:06:32 +02:00
|
|
|
|
|
|
|
public function serviceAction()
|
|
|
|
{
|
2017-07-05 05:46:16 +02:00
|
|
|
$form = IcingaTemplateChoiceForm::create('service', $this->db())
|
|
|
|
->optionallyLoad($this->params->get('name'))
|
|
|
|
->handleRequest();
|
2017-06-29 14:06:32 +02:00
|
|
|
$this->addSingleTab('Choice')
|
2017-07-05 05:46:16 +02:00
|
|
|
->addTitle($this->translate('Service template choice'))
|
|
|
|
->content()->add($form);
|
2017-06-29 14:06:32 +02:00
|
|
|
}
|
2017-06-27 00:24:30 +02:00
|
|
|
}
|