MINOR Swapped $mainFields and $fields assignments in Member->getCMSFields() to reflect what they're actually containing

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@64009 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Ingo Schommer 2008-10-09 17:31:32 +00:00
parent 53ba32a41a
commit 617711c7e6

View File

@ -910,46 +910,47 @@ class Member extends DataObject {
* editing this member. * editing this member.
*/ */
public function getCMSFields() { public function getCMSFields() {
$mainFields = parent::scaffoldCMSFields(); $fields = parent::scaffoldCMSFields();
$fields = $mainFields->fieldByName("Root")->fieldByName("Main")->Children;
$mainFields = $fields->fieldByName("Root")->fieldByName("Main")->Children;
$password = new ConfirmedPasswordField('Password', 'Password'); $password = new ConfirmedPasswordField('Password', 'Password');
$password->setCanBeEmpty(true); $password->setCanBeEmpty(true);
$fields->replaceField('Password', $password); $mainFields->replaceField('Password', $password);
$fields->insertBefore( $mainFields->insertBefore(
new HeaderField(_t('Member.PERSONALDETAILS', "Personal Details", PR_MEDIUM, 'Headline for formfields')), new HeaderField(_t('Member.PERSONALDETAILS', "Personal Details", PR_MEDIUM, 'Headline for formfields')),
'FirstName' 'FirstName'
); );
$fields->insertBefore( $mainFields->insertBefore(
new HeaderField(_t('Member.USERDETAILS', "User Details", PR_MEDIUM, 'Headline for formfields')), new HeaderField(_t('Member.USERDETAILS', "User Details", PR_MEDIUM, 'Headline for formfields')),
'Email' 'Email'
); );
$locale = ($this->Locale) ? $this->Locale : i18n::get_locale(); $locale = ($this->Locale) ? $this->Locale : i18n::get_locale();
$fields->replaceField('Locale', new DropdownField( $mainFields->replaceField('Locale', new DropdownField(
"Locale", "Locale",
_t('Member.INTERFACELANG', "Interface Language", PR_MEDIUM, 'Language of the CMS'), _t('Member.INTERFACELANG', "Interface Language", PR_MEDIUM, 'Language of the CMS'),
i18n::get_existing_translations(), i18n::get_existing_translations(),
$locale $locale
)); ));
$fields->insertAfter( $mainFields->insertAfter(
new TreeMultiselectField("Groups", _t("Member.SECURITYGROUPS", "Security groups")), new TreeMultiselectField("Groups", _t("Member.SECURITYGROUPS", "Security groups")),
'Locale' 'Locale'
); );
$fields->removeByName('Bounced'); $mainFields->removeByName('Bounced');
$fields->removeByName('RememberLoginToken'); $mainFields->removeByName('RememberLoginToken');
$fields->removeByName('AutoLoginHash'); $mainFields->removeByName('AutoLoginHash');
$fields->removeByName('AutoLoginExpired'); $mainFields->removeByName('AutoLoginExpired');
$fields->removeByName('PasswordEncryption'); $mainFields->removeByName('PasswordEncryption');
$fields->removeByName('PasswordExpiry'); $mainFields->removeByName('PasswordExpiry');
$fields->removeByName('LockedOutUntil'); $mainFields->removeByName('LockedOutUntil');
$fields->removeByName('Salt'); $mainFields->removeByName('Salt');
$fields->removeByName('NumVisit'); $mainFields->removeByName('NumVisit');
$fields->removeByName('LastVisited'); $mainFields->removeByName('LastVisited');
if($this->ID) { if($this->ID) {
$fields = $this->addScaffoldRelationFields($fields); $fields = $this->addScaffoldRelationFields($fields);
@ -961,9 +962,9 @@ class Member extends DataObject {
// Members are displayed within group edit form in SecurityAdmin // Members are displayed within group edit form in SecurityAdmin
$fields->removeByName('Groups'); $fields->removeByName('Groups');
$this->extend('updateCMSFields', $mainFields); $this->extend('updateCMSFields', $fields);
return $mainFields; return $fields;
} }
function fieldLabels() { function fieldLabels() {