Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

MINOR Re-instating Member_Validator in SecurityAdmin->RootForm() and …

…Groups->getCMSFields() with new GridField implementation
  • Loading branch information...
commit f9f659672acaedcaa4dae360102df96bd1f7d699 1 parent 40abab8
@chillu chillu authored
Showing with 8 additions and 11 deletions.
  1. +4 −4 admin/code/SecurityAdmin.php
  2. +4 −7 security/Group.php
View
8 admin/code/SecurityAdmin.php
@@ -82,14 +82,14 @@ public function getEditForm($id = null, $fields = null) {
}
/**
+ * The fields for individual groups will be created through {@link Group->getCMSFields()}.
+ *
* @return FieldList
*/
function RootForm() {
- $config = new GridFieldConfig_Base(25);
- $config->addComponent(new GridFieldAction_Edit());
- $config->addComponent(new GridFieldAction_Delete());
- $config->addComponent(new GridFieldPopupForms());
+ $config = new GridFieldConfig_RecordEditor();
$config->addComponent(new GridFieldExporter());
+ $config->getComponentByType('GridFieldPopupForms')->setValidator(new Member_Validator());
$memberList = new GridField('Members', 'All members', DataList::create('Member'), $config);
$memberList->addExtraClass("members_grid");
View
11 security/Group.php
@@ -55,22 +55,19 @@ function getAllChildren() {
/**
* Caution: Only call on instances, not through a singleton.
+ * The "root group" fields will be created through {@link SecurityAdmin->RootForm()}.
*
* @return FieldList
*/
public function getCMSFields() {
Requirements::javascript(SAPPHIRE_DIR . '/javascript/PermissionCheckboxSetField.js');
- $config = new GridFieldConfig();
- $config->addComponent(new GridFieldTitle());
- $components = $configs->getComponents();
- foreach($components as $component) $config->addComponent($component);
- $config = new GridFieldConfig_RelationEditor('FirstName', 20);
- $config = new GridFieldConfig_RelationEditor(20);
+ $config = new GridFieldConfig_RelationEditor();
$config->addComponents(new GridFieldExporter());
-
$config->getComponentByType('GridFieldRelationAdd')
->setResultsFormat('$Title ($Email)')->setSearchFields(array('FirstName', 'Surname', 'Email'));
+ $config->getComponentByType('GridFieldPopupForms')->setValidator(new Member_Validator());
+
$memberList = new GridField('Members','Members', $this->Members(), $config);
$memberList->addExtraClass('members_grid');
Please sign in to comment.
Something went wrong with that request. Please try again.