mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00: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
|
* @return FieldList
|
||||||
*/
|
*/
|
||||||
function RootForm() {
|
function RootForm() {
|
||||||
$config = new GridFieldConfig_Base(25);
|
$config = new GridFieldConfig_RecordEditor();
|
||||||
$config->addComponent(new GridFieldAction_Edit());
|
|
||||||
$config->addComponent(new GridFieldAction_Delete());
|
|
||||||
$config->addComponent(new GridFieldPopupForms());
|
|
||||||
$config->addComponent(new GridFieldExporter());
|
$config->addComponent(new GridFieldExporter());
|
||||||
|
$config->getComponentByType('GridFieldPopupForms')->setValidator(new Member_Validator());
|
||||||
$memberList = new GridField('Members', 'All members', DataList::create('Member'), $config);
|
$memberList = new GridField('Members', 'All members', DataList::create('Member'), $config);
|
||||||
$memberList->addExtraClass("members_grid");
|
$memberList->addExtraClass("members_grid");
|
||||||
|
|
||||||
|
@ -55,22 +55,19 @@ class Group extends DataObject {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Caution: Only call on instances, not through a singleton.
|
* Caution: Only call on instances, not through a singleton.
|
||||||
|
* The "root group" fields will be created through {@link SecurityAdmin->RootForm()}.
|
||||||
*
|
*
|
||||||
* @return FieldList
|
* @return FieldList
|
||||||
*/
|
*/
|
||||||
public function getCMSFields() {
|
public function getCMSFields() {
|
||||||
Requirements::javascript(SAPPHIRE_DIR . '/javascript/PermissionCheckboxSetField.js');
|
Requirements::javascript(SAPPHIRE_DIR . '/javascript/PermissionCheckboxSetField.js');
|
||||||
|
|
||||||
$config = new GridFieldConfig();
|
$config = new GridFieldConfig_RelationEditor();
|
||||||
$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->addComponents(new GridFieldExporter());
|
$config->addComponents(new GridFieldExporter());
|
||||||
|
|
||||||
$config->getComponentByType('GridFieldRelationAdd')
|
$config->getComponentByType('GridFieldRelationAdd')
|
||||||
->setResultsFormat('$Title ($Email)')->setSearchFields(array('FirstName', 'Surname', 'Email'));
|
->setResultsFormat('$Title ($Email)')->setSearchFields(array('FirstName', 'Surname', 'Email'));
|
||||||
|
$config->getComponentByType('GridFieldPopupForms')->setValidator(new Member_Validator());
|
||||||
|
|
||||||
$memberList = new GridField('Members','Members', $this->Members(), $config);
|
$memberList = new GridField('Members','Members', $this->Members(), $config);
|
||||||
$memberList->addExtraClass('members_grid');
|
$memberList->addExtraClass('members_grid');
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user