2015-06-02 04:49:31 -04:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace Icinga\Module\Director\Forms;
|
|
|
|
|
|
|
|
|
|
use Icinga\Module\Director\Web\Form\DirectorObjectForm;
|
|
|
|
|
|
2015-06-12 05:51:12 -04:00
|
|
|
class IcingaHostGroupForm extends DirectorObjectForm
|
2015-06-02 04:49:31 -04:00
|
|
|
{
|
|
|
|
|
public function setup()
|
|
|
|
|
{
|
2016-03-05 04:36:19 -05:00
|
|
|
$this->addHidden('object_type', 'object');
|
|
|
|
|
|
2017-10-12 08:56:13 -04:00
|
|
|
$this->addElement('text', 'object_name', [
|
2015-07-30 05:33:08 -04:00
|
|
|
'label' => $this->translate('Hostgroup'),
|
|
|
|
|
'required' => true,
|
2016-03-09 14:55:26 -05:00
|
|
|
'description' => $this->translate('Icinga object name for this host group')
|
2017-10-12 08:56:13 -04:00
|
|
|
]);
|
2015-06-02 04:49:31 -04:00
|
|
|
|
2016-03-09 14:55:26 -05:00
|
|
|
$this->addGroupDisplayNameElement()
|
2016-09-09 05:06:31 -04:00
|
|
|
->addAssignmentElements()
|
2016-03-09 14:55:26 -05:00
|
|
|
->setButtons();
|
2016-06-08 10:45:46 -04:00
|
|
|
}
|
|
|
|
|
|
2016-09-09 06:01:02 -04:00
|
|
|
protected function addAssignmentElements()
|
2016-06-08 10:45:46 -04:00
|
|
|
{
|
2017-10-12 08:56:13 -04:00
|
|
|
$this->addAssignFilter([
|
|
|
|
|
'suggestionContext' => 'HostFilterColumns',
|
2017-02-27 13:34:47 -05:00
|
|
|
'required' => false,
|
2016-10-23 23:41:37 -04:00
|
|
|
'description' => $this->translate(
|
|
|
|
|
'This allows you to configure an assignment filter. Please feel'
|
2019-07-08 08:11:53 -04:00
|
|
|
. ' free to combine as many nested operators as you want. The'
|
|
|
|
|
. ' "contains" operator is valid for arrays only. Please use'
|
|
|
|
|
. ' wildcards and the = (equals) operator when searching for'
|
|
|
|
|
. ' partial string matches, like in *.example.com'
|
2016-10-23 23:41:37 -04:00
|
|
|
)
|
2017-10-12 08:56:13 -04:00
|
|
|
]);
|
2016-06-08 10:45:46 -04:00
|
|
|
|
|
|
|
|
return $this;
|
2015-06-02 04:49:31 -04:00
|
|
|
}
|
|
|
|
|
}
|