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');
|
|
|
|
|
2015-07-30 11:33:08 +02:00
|
|
|
$this->addElement('text', 'object_name', array(
|
|
|
|
'label' => $this->translate('Hostgroup'),
|
|
|
|
'required' => true,
|
2016-03-09 20:55:26 +01:00
|
|
|
'description' => $this->translate('Icinga object name for this host group')
|
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
|
|
|
{
|
|
|
|
$sub = new AssignListSubForm();
|
|
|
|
$sub->setObject($this->object());
|
|
|
|
$sub->setup();
|
|
|
|
$sub->setOrder(30);
|
|
|
|
|
|
|
|
$this->addSubForm($sub, 'assignlist');
|
|
|
|
|
|
|
|
return $this;
|
2015-06-02 10:49:31 +02:00
|
|
|
}
|
|
|
|
}
|