mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
MINOR Merging SecurityAdmin->getEditForm() with RootForm(), in order to have the form fields consistently available (there's no longer a distinction between edit/root)
This commit is contained in:
parent
1201f6c8bb
commit
9bbac335c4
@ -44,46 +44,6 @@ class SecurityAdmin extends LeftAndMain implements PermissionProvider {
|
|||||||
$record = $this->getRecord($id);
|
$record = $this->getRecord($id);
|
||||||
if($record && !$record->canView()) return Security::permissionFailure($this);
|
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',
|
$memberList = Object::create('GridField',
|
||||||
'Members',
|
'Members',
|
||||||
false,
|
false,
|
||||||
@ -167,14 +127,10 @@ class SecurityAdmin extends LeftAndMain implements PermissionProvider {
|
|||||||
$actions
|
$actions
|
||||||
);
|
);
|
||||||
$form->addExtraClass('cms-edit-form');
|
$form->addExtraClass('cms-edit-form');
|
||||||
|
$form->setTemplate($this->getTemplatesWithSuffix('_EditForm'));
|
||||||
return $form;
|
if($form->Fields()->hasTabset()) $form->Fields()->findOrMakeTab('Root')->setTemplate('CMSTabSet');
|
||||||
}
|
$form->addExtraClass('center ss-tabset ' . $this->BaseCSSClasses());
|
||||||
|
|
||||||
function AddForm() {
|
|
||||||
$form = parent::AddForm();
|
|
||||||
$form->Actions()->fieldByName('action_doAdd')->setTitle(_t('SecurityAdmin.ActionAdd', 'Add group'));
|
|
||||||
|
|
||||||
return $form;
|
return $form;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user