function EditForm() { $member = Member::currentUser(); if ($member) { list($fields, $requiredFields) = MerchantAdminDOD::get_edit_fields(); $actions = new FieldSet(new FormAction('save', _t('MerchantAdminAccountPage_Controller.SAVE_DETAILS', 'Save Details'))); $form = new Form($this, 'EditForm', $fields, $actions, $requiredFields); $form->loadDataFrom($member); $form->dataFieldByName("Password")->setValue(""); return $form; } }
function MemberForm() { $member = Member::currentUser(); list($fields, $requiredFields) = MerchantAdminDOD::get_edit_fields(); $actions = new FieldSet(new FormAction('savememberform', _t('MerchantPage_Controller.SAVE_PERSONAL_DETAILS', 'Save My Personal Details'))); $form = new Form($this, 'MemberForm', $fields, $actions, $requiredFields); $form->loadDataFrom($member); if ($member && $member->Password) { if (!isset($_REQUEST["Password"])) { $fields->fieldByName("Password")->SetValue(""); } $fields->fieldByName("Password")->setCanBeEmpty(true); } return $form; }