2015-06-02 14:19:05 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Icinga\Module\Director\Forms;
|
|
|
|
|
|
|
|
use Icinga\Module\Director\Web\Form\DirectorObjectForm;
|
|
|
|
|
2015-06-12 12:07:53 +02:00
|
|
|
class IcingaUserGroupForm extends DirectorObjectForm
|
2015-06-02 14:19:05 +02:00
|
|
|
{
|
2018-07-13 10:35:28 +02:00
|
|
|
/**
|
|
|
|
* @throws \Zend_Form_Exception
|
|
|
|
*/
|
2015-06-02 14:19:05 +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('Usergroup'),
|
|
|
|
'required' => true,
|
2016-03-09 20:55:26 +01:00
|
|
|
'description' => $this->translate('Icinga object name for this user group')
|
2015-06-02 14:19:05 +02:00
|
|
|
));
|
|
|
|
|
2016-03-09 20:55:26 +01:00
|
|
|
$this->addGroupDisplayNameElement()
|
2018-07-13 10:35:28 +02:00
|
|
|
->addZoneElements()
|
2016-11-02 18:04:35 +01:00
|
|
|
->groupMainProperties()
|
2016-03-09 20:55:26 +01:00
|
|
|
->setButtons();
|
2015-06-02 14:19:05 +02:00
|
|
|
}
|
2016-11-02 18:04:35 +01:00
|
|
|
|
2018-07-13 10:35:28 +02:00
|
|
|
/**
|
|
|
|
* @return $this
|
|
|
|
* @throws \Zend_Form_Exception
|
|
|
|
*/
|
2016-11-02 18:04:35 +01:00
|
|
|
protected function addZoneElements()
|
|
|
|
{
|
2018-07-13 10:35:28 +02:00
|
|
|
$this->addZoneElement(true);
|
|
|
|
$this->addDisplayGroup(['zone_id'], 'clustering', [
|
|
|
|
'decorators' => [
|
2016-11-02 18:04:35 +01:00
|
|
|
'FormElements',
|
2018-07-13 10:35:28 +02:00
|
|
|
['HtmlTag', ['tag' => 'dl']],
|
2016-11-02 18:04:35 +01:00
|
|
|
'Fieldset',
|
2018-07-13 10:35:28 +02:00
|
|
|
],
|
|
|
|
'order' => 80,
|
2016-11-02 18:04:35 +01:00
|
|
|
'legend' => $this->translate('Zone settings')
|
2018-07-13 10:35:28 +02:00
|
|
|
]);
|
2016-11-02 18:04:35 +01:00
|
|
|
|
|
|
|
return $this;
|
|
|
|
}
|
2015-06-02 14:19:05 +02:00
|
|
|
}
|