2014-10-29 10:40:34 -04:00
|
|
|
<?php
|
2016-02-08 09:41:00 -05:00
|
|
|
/* Icinga Web 2 | (c) 2014 Icinga Development Team | GPLv2+ */
|
2014-10-29 10:40:34 -04:00
|
|
|
|
2014-11-14 05:17:22 -05:00
|
|
|
namespace Icinga\Module\Monitoring\Forms\Setup;
|
2014-10-29 10:40:34 -04:00
|
|
|
|
|
|
|
|
use Icinga\Web\Form;
|
2015-08-26 09:52:36 -04:00
|
|
|
use Icinga\Module\Monitoring\Forms\Config\TransportConfigForm;
|
2014-10-29 10:40:34 -04:00
|
|
|
|
2015-08-26 09:52:36 -04:00
|
|
|
class TransportPage extends Form
|
2014-10-29 10:40:34 -04:00
|
|
|
{
|
|
|
|
|
public function init()
|
|
|
|
|
{
|
2015-08-26 09:43:30 -04:00
|
|
|
$this->setName('setup_command_transport');
|
|
|
|
|
$this->setTitle($this->translate('Command Transport', 'setup.page.title'));
|
2015-03-02 12:36:04 -05:00
|
|
|
$this->addDescription($this->translate(
|
2015-08-26 09:43:30 -04:00
|
|
|
'Please define below how you want to send commands to your monitoring instance.'
|
2015-03-02 12:36:04 -05:00
|
|
|
));
|
2014-10-29 10:40:34 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function createElements(array $formData)
|
|
|
|
|
{
|
2015-08-26 09:52:36 -04:00
|
|
|
$transportConfigForm = new TransportConfigForm();
|
2015-08-26 09:43:30 -04:00
|
|
|
$this->addSubForm($transportConfigForm, 'transport_form');
|
|
|
|
|
$transportConfigForm->create($formData);
|
2015-08-27 10:33:10 -04:00
|
|
|
$transportConfigForm->removeElement('instance');
|
2015-08-26 09:43:30 -04:00
|
|
|
$transportConfigForm->getElement('name')->setValue('icinga2');
|
2015-07-03 09:07:58 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function getValues($suppressArrayNotation = false)
|
|
|
|
|
{
|
2015-08-26 09:43:30 -04:00
|
|
|
return $this->getSubForm('transport_form')->getValues($suppressArrayNotation);
|
2014-10-29 10:40:34 -04:00
|
|
|
}
|
|
|
|
|
}
|