mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
MINOR Re-instating Member_Validator in SecurityAdmin->RootForm() and Groups->getCMSFields() with new GridField implementation
This commit is contained in:
parent
40abab8aec
commit
f9f659672a
@ -82,14 +82,14 @@ class SecurityAdmin extends LeftAndMain implements PermissionProvider {
|
||||
}
|
||||
|
||||
/**
|
||||
* 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");
|
||||
|
||||
|
@ -55,22 +55,19 @@ class Group extends DataObject {
|
||||
|
||||
/**
|
||||
* 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');
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user