mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-05-03 09:14:48 +09:00
issue 2079 added the name of extra variables in a member information modify page and a signup page.
git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.3.2@11011 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
acbad1b6d9
commit
e62403ab10
2 changed files with 60 additions and 0 deletions
|
|
@ -106,6 +106,8 @@
|
|||
$identifierForm->value = $member_info->{$member_config->identifier};
|
||||
Context::set('identifierForm', $identifierForm);
|
||||
|
||||
$this->addExtraFormValidatorMessage();
|
||||
|
||||
// Set a template file
|
||||
$this->setTemplateFile('signup_form');
|
||||
}
|
||||
|
|
@ -157,6 +159,9 @@
|
|||
$identifierForm->name = $member_config->identifier;
|
||||
$identifierForm->value = $member_info->{$member_config->identifier};
|
||||
Context::set('identifierForm', $identifierForm);
|
||||
|
||||
$this->addExtraFormValidatorMessage();
|
||||
|
||||
// Set a template file
|
||||
$this->setTemplateFile('modify_info');
|
||||
}
|
||||
|
|
@ -404,5 +409,31 @@
|
|||
|
||||
$this->setTemplateFile('modify_email_address');
|
||||
}
|
||||
|
||||
/**
|
||||
* Add javascript codes into the header by checking values of member join form, required and others
|
||||
* @return void
|
||||
*/
|
||||
function addExtraFormValidatorMessage() {
|
||||
$oMemberModel = &getModel('member');
|
||||
$extraList = $oMemberModel->getUsedJoinFormList();
|
||||
|
||||
$js_code = array();
|
||||
$js_code[] = '<script type="text/javascript">//<![CDATA[';
|
||||
$js_code[] = '(function($){';
|
||||
$js_code[] = 'var validator = xe.getApp("validator")[0];';
|
||||
$js_code[] = 'if(!validator) return false;';
|
||||
|
||||
foreach($extraList as $val)
|
||||
{
|
||||
$js_code[] = sprintf('validator.cast("ADD_MESSAGE", ["%s","%s"]);', $val->column_name, $val->column_title);
|
||||
}
|
||||
|
||||
$js_code[] = '})(jQuery);';
|
||||
$js_code[] = '//]]></script>';
|
||||
$js_code = implode("\n", $js_code);
|
||||
|
||||
Context::addHtmlHeader($js_code);
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue