IcingaHostForm: use display groups

This commit is contained in:
Thomas Gelf 2015-10-15 20:08:40 +02:00
parent adbb69907b
commit 764d9e4d77
1 changed files with 17 additions and 10 deletions

View File

@ -39,17 +39,24 @@ class IcingaHostForm extends DirectorObjectForm
));
*/
$elements = array(
'object_name',
'display_name',
'address',
'address6',
'imports',
);
$this->addDisplayGroup($elements, 'object_definition', array(
'decorators' => array(
'FormElements',
'DtDdWrapper',
'Fieldset',
),
'order' => 20,
'legend' => $this->translate('Host properties')
));
if ($this->isTemplate()) {
$this->addElement('text', 'address', array(
'label' => $this->translate('Host address'),
'description' => $this->translate('Host address. Usually an IPv4 address, but may be any kind of address your check plugin is able to deal with')
));
$this->addElement('text', 'address6', array(
'label' => $this->translate('IPv6 address'),
'description' => $this->translate('Usually your hosts main IPv6 address')
));
$this->addCheckExecutionElements();
} else {
$this->getElement('imports')->setRequired();