-
Notifications
You must be signed in to change notification settings - Fork 204
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Unify Service/Host/UserGroup code for Objects and Forms
At least as far as possible. For objects, moved some common parts to IcingaObjectGroup, where zone_id is now in defaultProperties and thus those don't need to be overriden in IcingaHostGroup and IcingaServiceGroup anymore. Similar for relations property, which don't need to be specified in descendant classes anymore. For forms, created a intermediate class IcingaGroupForm (analog to the already existing IcingaObjectGroup for objects) which extends DirectorObjectForm, and made IcingaHostGroupForm, IcingaServiceGroupForm and IcingaUserGroupForm extend this new class instead. Moved the addZoneElements method to this new class, thus removing it from the descendant classes that had it repeated.
- Loading branch information
Showing
8 changed files
with
42 additions
and
93 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?php | ||
|
||
namespace Icinga\Module\Director\Forms; | ||
|
||
use Icinga\Module\Director\Web\Form\DirectorObjectForm; | ||
|
||
class IcingaGroupForm extends DirectorObjectForm | ||
{ | ||
/** | ||
* @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; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters