Permalink
Browse files

MINOR Removed unused SecurityAdmin->MemberForm() and savemember() (se…

…e MemberTableField)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/branches/2.4@113281 467b73ca-7a2a-4603-9d3b-597d59a354a9
  • Loading branch information...
chillu authored and sminnee committed Nov 1, 2010
1 parent b31cb67 commit 4bc9a5aee85c731722b88a58c6eaaad04131140c
Showing with 0 additions and 68 deletions.
  1. +0 −66 code/SecurityAdmin.php
  2. +0 −2 javascript/LeftAndMain_right.js
View
@@ -22,7 +22,6 @@ class SecurityAdmin extends LeftAndMain implements PermissionProvider {
'removememberfromgroup',
'savemember',
'AddRecordForm',
- 'MemberForm',
'EditForm',
'MemberImportForm',
'memberimport',
@@ -296,71 +295,6 @@ public function autocomplete() {
}
}
- public function MemberForm() {
- $id = $_REQUEST['ID'] ? $_REQUEST['ID'] : Session::get('currentMember');
- if($id) return $this->getMemberForm($id);
- }
-
- public function getMemberForm($id) {
- if($id && $id != 'new') $record = DataObject::get_by_id('Member', (int) $id);
- if($record || $id == 'new') {
- $fields = new FieldSet(
- new HiddenField('MemberListBaseGroup', '', $this->currentPageID() )
- );
-
- if($extraFields = $record->getCMSFields()) {
- foreach($extraFields as $extra) {
- $fields->push( $extra );
- }
- }
-
- $fields->push($idField = new HiddenField('ID'));
- $fields->push($groupIDField = new HiddenField('GroupID'));
-
- $actions = new FieldSet();
- $actions->push(new FormAction('savemember', _t('SecurityAdmin.SAVE', 'Save')));
-
- $form = new Form($this, 'MemberForm', $fields, $actions);
- if($record) $form->loadDataFrom($record);
-
- $idField->setValue($id);
- $groupIDField->setValue($this->currentPageID());
-
- if($record && !$record->canEdit()) {
- $readonlyFields = $form->Fields()->makeReadonly();
- $form->setFields($readonlyFields);
- }
-
- return $form;
- }
- }
-
- function savemember() {
- $data = $_REQUEST;
- $className = $this->stat('subitem_class');
-
- $id = $_REQUEST['ID'];
- if($id == 'new') $id = null;
-
- if($id) {
- $record = DataObject::get_by_id($className, $id);
- if($record && !$record->canEdit()) return Security::permissionFailure($this);
- } else {
- if(!singleton($this->stat('subitem_class'))->canCreate()) return Security::permissionFailure($this);
- $record = new $className();
- }
-
- $record->update($data);
- $record->ID = $id;
- $record->write();
-
- $record->Groups()->add($data['GroupID']);
-
- FormResponse::add("reloadMemberTableField();");
-
- return FormResponse::respond();
- }
-
/**
* Return the entire site tree as a nested set of ULs.
* @return string Unordered list HTML
@@ -256,7 +256,6 @@ CMSRightForm.prototype = {
this.loadNewPage(response.responseText);
var subform;
- if(subform = $('Form_MemberForm')) subform.close();
if(subform = $('Form_SubForm')) subform.close();
if(this.elements.ID) {
@@ -368,7 +367,6 @@ function autoSave(confirmation, callAfter) {
var __forms = []
if($('Form_EditForm')) __forms.push($('Form_EditForm'));
if($('Form_SubForm')) __forms.push($('Form_SubForm'));
- if($('Form_MemberForm')) __forms.push($('Form_MemberForm'));
var __somethingHasChanged = false;
var __callAfter = callAfter;

0 comments on commit 4bc9a5a

Please sign in to comment.