-
Notifications
You must be signed in to change notification settings - Fork 206
Expand file tree
/
Copy pathIcingaUserGroupForm.php
More file actions
73 lines (63 loc) · 2.09 KB
/
IcingaUserGroupForm.php
File metadata and controls
73 lines (63 loc) · 2.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
<?php
namespace Icinga\Module\Director\Forms;
use Icinga\Module\Director\Web\Form\DirectorObjectForm;
use ipl\Web\Url;
class IcingaUserGroupForm extends DirectorObjectForm
{
/**
* @throws \Zend_Form_Exception
*/
public function setup()
{
$this->addHidden('object_type', 'object');
$this->addElement('text', 'object_name', array(
'label' => $this->translate('Usergroup'),
'required' => true,
'description' => $this->translate('Icinga object name for this user group')
));
$this->addGroupDisplayNameElement()
->addAssignmentElements()
->addZoneElements()
->groupMainProperties()
->setButtons();
}
/**
* @return $this
* @throws \Zend_Form_Exception
*/
protected function addZoneElements()
{
$this->addZoneElement(true);
$this->addDisplayGroup(['zone_id'], 'clustering', [
'decorators' => [
'FormElements',
['HtmlTag', ['tag' => 'dl']],
'Fieldset',
],
'order' => self::GROUP_ORDER_CLUSTERING,
'legend' => $this->translate('Zone settings')
]);
return $this;
}
protected function addAssignmentElements()
{
$this->addAssignFilter([
'suggestionContext' => 'UserFilterColumns',
'required' => false,
'description' => $this->translate(
'This allows you to configure an assignment filter. Please feel'
. ' 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'
)
]);
return $this;
}
protected function deleteObject($object)
{
$this->redirectAndExit(
Url::fromPath('director/usergroup/delete', ['uuid' => $object->getUniqueId()->toString()])
);
}
}