Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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
  • Loading branch information...
commit 555fcd94e3c31c0dedf2f12f1076d4e3fa3a2ecf 1 parent 1ba1c56
Ingo Schommer chillu authored
Showing with 26 additions and 4 deletions.
  1. +25 −3 code/SecurityAdmin.php
  2. +1 −1  javascript/SecurityAdmin.js
28 code/SecurityAdmin.php
View
@@ -28,6 +28,7 @@ class SecurityAdmin extends LeftAndMain implements PermissionProvider {
'memberimport',
'GroupImportForm',
'groupimport',
+ 'RootForm'
);
/**
@@ -64,9 +65,10 @@ function getEditForm($id = null) {
}
$form->Actions()->insertBefore(
- new FormAction('addmember',_t('SecurityAdmin.ADDMEMBER','Add Member')),
+ $actionAddMember = new FormAction('addmember',_t('SecurityAdmin.ADDMEMBER','Add Member')),
'action_save'
);
+ $actionAddMember->setForm($form);
// Filter permissions
$permissionField = $form->Fields()->dataFieldByName('Permissions');
@@ -80,9 +82,27 @@ function getEditForm($id = null) {
* @return FieldSet
*/
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(
new TabSet(
'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 LiteralField(
'GroupImportFormIframe',
@@ -96,11 +116,13 @@ function RootForm() {
// necessary for tree node selection in LeftAndMain.EditForm.js
new HiddenField('ID', false, 0)
);
- $actions = new FieldSet();
+ $actions = new FieldSet(
+ new FormAction('addmember',_t('SecurityAdmin.ADDMEMBER','Add Member'))
+ );
$form = new Form(
$this,
- 'Form',
+ 'EditForm',
$fields,
$actions
);
2  javascript/SecurityAdmin.js
View
@@ -49,7 +49,7 @@
});
$.concrete('ss', function($){
- $('#Form_EditForm .Actions #action_addmember').concrete({
+ $('#Form_EditForm .Actions #Form_EditForm_action_addmember').concrete({
onclick: function(e) {
// CAUTION: Assumes that a MemberTableField-instance is present as an editing form
var t = $('#Form_EditForm_Members');
Please sign in to comment.
Something went wrong with that request. Please try again.