From fd7f2eb469de77ce2a87b41d1b0119d68e4079bb Mon Sep 17 00:00:00 2001 From: Sean Harvey Date: Mon, 26 Mar 2012 14:51:40 +1300 Subject: [PATCH] ENHANCEMENT Use of Object::create('GridField') for Roles grid in SecurityAdmin, to be consistent with Members and Groups grid instantiation. MINOR Removing comments referring to CTF --- admin/code/SecurityAdmin.php | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/admin/code/SecurityAdmin.php b/admin/code/SecurityAdmin.php index 2973197c9..556c761f1 100755 --- a/admin/code/SecurityAdmin.php +++ b/admin/code/SecurityAdmin.php @@ -44,18 +44,18 @@ class SecurityAdmin extends LeftAndMain implements PermissionProvider { if($record && !$record->canView()) return Security::permissionFailure($this); $memberList = Object::create('GridField', - 'Members', - false, - DataList::create('Member'), + 'Members', + false, + DataList::create('Member'), $memberListConfig = GridFieldConfig_RecordEditor::create() ->addComponent(new GridFieldExportButton()) )->addExtraClass("members_grid"); $memberListConfig->getComponentByType('GridFieldDetailForm')->setValidator(new Member_Validator()); $groupList = Object::create('GridField', - 'Groups', - false, - DataList::create('Group'), + 'Groups', + false, + DataList::create('Group'), GridFieldConfig_RecordEditor::create() )->setDisplayFields(array( 'Breadcrumbs' => singleton('Group')->fieldLabel('Title') @@ -67,7 +67,7 @@ class SecurityAdmin extends LeftAndMain implements PermissionProvider { 'Root', new Tab('Users', _t('SecurityAdmin.Users', 'Users'), $memberList, - new LiteralField('MembersCautionText', + new LiteralField('MembersCautionText', sprintf('

%s

', _t( 'SecurityAdmin.MemberListCaution', @@ -104,19 +104,14 @@ class SecurityAdmin extends LeftAndMain implements PermissionProvider { // Add roles editing interface if(Permission::check('APPLY_ROLES')) { - $rolesField = new GridField( + $rolesField = Object::create('GridField', 'Roles', false, DataList::create('PermissionRole'), GridFieldConfig_RecordEditor::create() ); - // $rolesCTF->setPermissions(array('add', 'edit', 'delete')); $rolesTab = $fields->findOrMakeTab('Root.Roles', _t('SecurityAdmin.TABROLES', 'Roles')); - $rolesTab->push(new LiteralField( - 'RolesDescription', - '' - )); $rolesTab->push($rolesField); } @@ -134,7 +129,7 @@ class SecurityAdmin extends LeftAndMain implements PermissionProvider { $form->addExtraClass('center ss-tabset ' . $this->BaseCSSClasses()); $this->extend('updateEditForm', $form); - + return $form; }