mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-04 01:01:41 +09:00
issue 2079
git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.3.2@11033 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
18bb1ba4bf
commit
4492b4c774
3 changed files with 19 additions and 1 deletions
|
|
@ -407,6 +407,16 @@
|
|||
$rulesetFile = $oModuleModel->getValidatorFilePath($rulesetModule, $ruleset, $this->mid);
|
||||
if(!empty($rulesetFile))
|
||||
{
|
||||
if($_SESSION['XE_VALIDATOR_ERROR_LANG'])
|
||||
{
|
||||
$errorLang = $_SESSION['XE_VALIDATOR_ERROR_LANG'];
|
||||
foreach($errorLang as $key => $val)
|
||||
{
|
||||
Context::setLang($key, $val);
|
||||
}
|
||||
unset($_SESSION['XE_VALIDATOR_ERROR_LANG']);
|
||||
}
|
||||
|
||||
$Validator = new Validator($rulesetFile);
|
||||
$result = $Validator->validate();
|
||||
if(!$result)
|
||||
|
|
|
|||
|
|
@ -199,7 +199,7 @@ class Validator
|
|||
$fields = array_map(array($this, 'arrayTrim'), $fields);
|
||||
$field_names = array_keys($fields);
|
||||
|
||||
$filters = $this->_filters;
|
||||
$filters = array();
|
||||
|
||||
// get field names matching patterns
|
||||
foreach($this->_filters as $key=>$filter) {
|
||||
|
|
@ -210,6 +210,10 @@ class Validator
|
|||
$filters[substr($key,0,-2)] = $filter;
|
||||
unset($filters[$key]);
|
||||
}
|
||||
else
|
||||
{
|
||||
$filters[$key] = $filter;
|
||||
}
|
||||
|
||||
if(!count($names)) continue;
|
||||
|
||||
|
|
|
|||
|
|
@ -523,6 +523,7 @@
|
|||
$js_code[] = 'var validator = xe.getApp("validator")[0];';
|
||||
$js_code[] = 'if(!validator) return false;';
|
||||
|
||||
$errorLang = array();
|
||||
foreach($extraList as $val)
|
||||
{
|
||||
if($val->column_type == 'kr_zip' || $val->column_type == 'tel')
|
||||
|
|
@ -533,7 +534,10 @@
|
|||
{
|
||||
$js_code[] = sprintf('validator.cast("ADD_MESSAGE", ["%s","%s"]);', $val->column_name, $val->column_title);
|
||||
}
|
||||
|
||||
$errorLang[$val->column_name] = $val->column_title;
|
||||
}
|
||||
$_SESSION['XE_VALIDATOR_ERROR_LANG'] = $errorLang;
|
||||
|
||||
$js_code[] = '})(jQuery);';
|
||||
$js_code[] = '//]]></script>';
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue