mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 06:05:56 +00:00
FEATURE Listing all members regardless of group membership by default in admin/security. Deleting a member from this list will delete it from the database instead of the group relationship
API CHANGE Renamed SecurityAdmin->getEditForm() form action HTML identifier from #action_addmember to #Form_EditForm_action_addmember git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@98826 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
1ba1c563a8
commit
555fcd94e3
@ -28,6 +28,7 @@ class SecurityAdmin extends LeftAndMain implements PermissionProvider {
|
|||||||
'memberimport',
|
'memberimport',
|
||||||
'GroupImportForm',
|
'GroupImportForm',
|
||||||
'groupimport',
|
'groupimport',
|
||||||
|
'RootForm'
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -64,9 +65,10 @@ class SecurityAdmin extends LeftAndMain implements PermissionProvider {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$form->Actions()->insertBefore(
|
$form->Actions()->insertBefore(
|
||||||
new FormAction('addmember',_t('SecurityAdmin.ADDMEMBER','Add Member')),
|
$actionAddMember = new FormAction('addmember',_t('SecurityAdmin.ADDMEMBER','Add Member')),
|
||||||
'action_save'
|
'action_save'
|
||||||
);
|
);
|
||||||
|
$actionAddMember->setForm($form);
|
||||||
|
|
||||||
// Filter permissions
|
// Filter permissions
|
||||||
$permissionField = $form->Fields()->dataFieldByName('Permissions');
|
$permissionField = $form->Fields()->dataFieldByName('Permissions');
|
||||||
@ -80,9 +82,27 @@ class SecurityAdmin extends LeftAndMain implements PermissionProvider {
|
|||||||
* @return FieldSet
|
* @return FieldSet
|
||||||
*/
|
*/
|
||||||
function RootForm() {
|
function RootForm() {
|
||||||
|
$memberList = new MemberTableField(
|
||||||
|
$this,
|
||||||
|
"Members"
|
||||||
|
);
|
||||||
|
// unset 'inlineadd' permission, we don't want inline addition
|
||||||
|
$memberList->setPermissions(array('show', 'edit', 'delete', 'add'));
|
||||||
|
|
||||||
$fields = new FieldSet(
|
$fields = new FieldSet(
|
||||||
new TabSet(
|
new TabSet(
|
||||||
'Root',
|
'Root',
|
||||||
|
new Tab('Members', singleton('Member')->i18n_plural_name(),
|
||||||
|
$memberList,
|
||||||
|
new LiteralField('MembersCautionText',
|
||||||
|
sprintf('<p class="caution-remove"><strong>%s</strong></p>',
|
||||||
|
_t(
|
||||||
|
'SecurityAdmin.MemberListCaution',
|
||||||
|
'Caution: Removing members from this list will remove them from all groups and the database'
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
),
|
||||||
new Tab('Import', _t('SecurityAdmin.TABIMPORT', 'Import'),
|
new Tab('Import', _t('SecurityAdmin.TABIMPORT', 'Import'),
|
||||||
new LiteralField(
|
new LiteralField(
|
||||||
'GroupImportFormIframe',
|
'GroupImportFormIframe',
|
||||||
@ -96,11 +116,13 @@ class SecurityAdmin extends LeftAndMain implements PermissionProvider {
|
|||||||
// necessary for tree node selection in LeftAndMain.EditForm.js
|
// necessary for tree node selection in LeftAndMain.EditForm.js
|
||||||
new HiddenField('ID', false, 0)
|
new HiddenField('ID', false, 0)
|
||||||
);
|
);
|
||||||
$actions = new FieldSet();
|
$actions = new FieldSet(
|
||||||
|
new FormAction('addmember',_t('SecurityAdmin.ADDMEMBER','Add Member'))
|
||||||
|
);
|
||||||
|
|
||||||
$form = new Form(
|
$form = new Form(
|
||||||
$this,
|
$this,
|
||||||
'Form',
|
'EditForm',
|
||||||
$fields,
|
$fields,
|
||||||
$actions
|
$actions
|
||||||
);
|
);
|
||||||
|
@ -49,7 +49,7 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
$.concrete('ss', function($){
|
$.concrete('ss', function($){
|
||||||
$('#Form_EditForm .Actions #action_addmember').concrete({
|
$('#Form_EditForm .Actions #Form_EditForm_action_addmember').concrete({
|
||||||
onclick: function(e) {
|
onclick: function(e) {
|
||||||
// CAUTION: Assumes that a MemberTableField-instance is present as an editing form
|
// CAUTION: Assumes that a MemberTableField-instance is present as an editing form
|
||||||
var t = $('#Form_EditForm_Members');
|
var t = $('#Form_EditForm_Members');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user