Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

MINOR Merging SecurityAdmin->getEditForm() with RootForm(), in order …

…to have the form fields consistently available (there's no longer a distinction between edit/root)
  • Loading branch information...
commit 9bbac335c405cb2cecf128c39f503a4a537a049c 1 parent 1201f6c
@chillu chillu authored
Showing with 4 additions and 48 deletions.
  1. +4 −48 admin/code/SecurityAdmin.php
View
52 admin/code/SecurityAdmin.php
@@ -44,46 +44,6 @@ public function getEditForm($id = null, $fields = null) {
$record = $this->getRecord($id);
if($record && !$record->canView()) return Security::permissionFailure($this);
- if($id && is_numeric($id)) {
- $form = parent::getEditForm($id);
- if(!$form) return false;
-
- $fields = $form->Fields();
- if($fields->hasTabSet() && $record->canEdit()) {
- $fields->findOrMakeTab('Root.Import',_t('Group.IMPORTTABTITLE', 'Import'));
- $fields->addFieldToTab('Root.Import',
- new LiteralField(
- 'MemberImportFormIframe',
- sprintf(
- '<iframe src="%s" id="MemberImportFormIframe" width="100%%" height="400px" border="0"></iframe>',
- $this->Link('memberimport')
- )
- )
- );
-
- // Filter permissions
- $permissionField = $form->Fields()->dataFieldByName('Permissions');
- if($permissionField) $permissionField->setHiddenPermissions(self::$hidden_permissions);
- }
-
- $this->extend('updateEditForm', $form);
- } else {
- $form = $this->RootForm();
- }
-
- $form->setTemplate($this->getTemplatesWithSuffix('_EditForm'));
- if($form->Fields()->hasTabset()) $form->Fields()->findOrMakeTab('Root')->setTemplate('CMSTabSet');
- $form->addExtraClass('center ss-tabset ' . $this->BaseCSSClasses());
-
- return $form;
- }
-
- /**
- * The fields for individual groups will be created through {@link Group->getCMSFields()}.
- *
- * @return FieldList
- */
- function RootForm() {
$memberList = Object::create('GridField',
'Members',
false,
@@ -167,14 +127,10 @@ function RootForm() {
$actions
);
$form->addExtraClass('cms-edit-form');
-
- return $form;
- }
-
- function AddForm() {
- $form = parent::AddForm();
- $form->Actions()->fieldByName('action_doAdd')->setTitle(_t('SecurityAdmin.ActionAdd', 'Add group'));
-
+ $form->setTemplate($this->getTemplatesWithSuffix('_EditForm'));
+ if($form->Fields()->hasTabset()) $form->Fields()->findOrMakeTab('Root')->setTemplate('CMSTabSet');
+ $form->addExtraClass('center ss-tabset ' . $this->BaseCSSClasses());
+
return $form;
}
Please sign in to comment.
Something went wrong with that request. Please try again.