2015-06-02 10:49:31 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Icinga\Module\Director\Forms;
|
|
|
|
|
|
|
|
use Icinga\Module\Director\Web\Form\DirectorObjectForm;
|
|
|
|
|
2015-06-12 11:51:12 +02:00
|
|
|
class IcingaHostGroupForm extends DirectorObjectForm
|
2015-06-02 10:49:31 +02:00
|
|
|
{
|
|
|
|
public function setup()
|
|
|
|
{
|
2016-03-05 10:36:19 +01:00
|
|
|
$this->addHidden('object_type', 'object');
|
|
|
|
|
2017-10-12 14:56:13 +02:00
|
|
|
$this->addElement('text', 'object_name', [
|
2015-07-30 11:33:08 +02:00
|
|
|
'label' => $this->translate('Hostgroup'),
|
|
|
|
'required' => true,
|
2016-03-09 20:55:26 +01:00
|
|
|
'description' => $this->translate('Icinga object name for this host group')
|
2017-10-12 14:56:13 +02:00
|
|
|
]);
|
2015-06-02 10:49:31 +02:00
|
|
|
|
2016-03-09 20:55:26 +01:00
|
|
|
$this->addGroupDisplayNameElement()
|
2016-09-09 11:06:31 +02:00
|
|
|
->addAssignmentElements()
|
2016-03-09 20:55:26 +01:00
|
|
|
->setButtons();
|
2016-06-08 16:45:46 +02:00
|
|
|
}
|
|
|
|
|
2016-09-09 12:01:02 +02:00
|
|
|
protected function addAssignmentElements()
|
2016-06-08 16:45:46 +02:00
|
|
|
{
|
2017-10-12 14:56:13 +02:00
|
|
|
$this->addAssignFilter([
|
|
|
|
'suggestionContext' => 'HostFilterColumns',
|
2017-02-27 19:34:47 +01:00
|
|
|
'required' => false,
|
2016-10-24 05:41:37 +02:00
|
|
|
'description' => $this->translate(
|
|
|
|
'This allows you to configure an assignment filter. Please feel'
|
2019-07-08 14:11:53 +02: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-24 05:41:37 +02:00
|
|
|
)
|
2017-10-12 14:56:13 +02:00
|
|
|
]);
|
2016-06-08 16:45:46 +02:00
|
|
|
|
|
|
|
return $this;
|
2015-06-02 10:49:31 +02:00
|
|
|
}
|
|
|
|
}
|