2015-06-02 08:19:05 -04:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace Icinga\Module\Director\Forms;
|
|
|
|
|
|
|
|
|
|
use Icinga\Module\Director\Web\Form\DirectorObjectForm;
|
|
|
|
|
|
2015-06-12 06:07:53 -04:00
|
|
|
class IcingaUserGroupForm extends DirectorObjectForm
|
2015-06-02 08:19:05 -04:00
|
|
|
{
|
2018-07-13 04:35:28 -04:00
|
|
|
/**
|
|
|
|
|
* @throws \Zend_Form_Exception
|
|
|
|
|
*/
|
2015-06-02 08:19:05 -04:00
|
|
|
public function setup()
|
|
|
|
|
{
|
2016-03-05 04:36:19 -05:00
|
|
|
$this->addHidden('object_type', 'object');
|
|
|
|
|
|
2015-07-30 05:33:08 -04:00
|
|
|
$this->addElement('text', 'object_name', array(
|
|
|
|
|
'label' => $this->translate('Usergroup'),
|
|
|
|
|
'required' => true,
|
2016-03-09 14:55:26 -05:00
|
|
|
'description' => $this->translate('Icinga object name for this user group')
|
2015-06-02 08:19:05 -04:00
|
|
|
));
|
|
|
|
|
|
2016-03-09 14:55:26 -05:00
|
|
|
$this->addGroupDisplayNameElement()
|
2018-07-13 04:35:28 -04:00
|
|
|
->addZoneElements()
|
2016-11-02 13:04:35 -04:00
|
|
|
->groupMainProperties()
|
2016-03-09 14:55:26 -05:00
|
|
|
->setButtons();
|
2015-06-02 08:19:05 -04:00
|
|
|
}
|
2016-11-02 13:04:35 -04:00
|
|
|
|
2018-07-13 04:35:28 -04:00
|
|
|
/**
|
|
|
|
|
* @return $this
|
|
|
|
|
* @throws \Zend_Form_Exception
|
|
|
|
|
*/
|
2016-11-02 13:04:35 -04:00
|
|
|
protected function addZoneElements()
|
|
|
|
|
{
|
2018-07-13 04:35:28 -04:00
|
|
|
$this->addZoneElement(true);
|
|
|
|
|
$this->addDisplayGroup(['zone_id'], 'clustering', [
|
|
|
|
|
'decorators' => [
|
2016-11-02 13:04:35 -04:00
|
|
|
'FormElements',
|
2018-07-13 04:35:28 -04:00
|
|
|
['HtmlTag', ['tag' => 'dl']],
|
2016-11-02 13:04:35 -04:00
|
|
|
'Fieldset',
|
2018-07-13 04:35:28 -04:00
|
|
|
],
|
2020-11-30 06:39:48 -05:00
|
|
|
'order' => self::GROUP_ORDER_CLUSTERING,
|
2016-11-02 13:04:35 -04:00
|
|
|
'legend' => $this->translate('Zone settings')
|
2018-07-13 04:35:28 -04:00
|
|
|
]);
|
2016-11-02 13:04:35 -04:00
|
|
|
|
|
|
|
|
return $this;
|
|
|
|
|
}
|
2015-06-02 08:19:05 -04:00
|
|
|
}
|