MDL-52826 forms: Move global functions to self-contained

This commit is contained in:
David Monllao
2016-01-22 15:43:08 +08:00
parent eddec36d49
commit 2edb12ec30
5 changed files with 130 additions and 107 deletions
-9
View File
@@ -1061,9 +1061,6 @@ class HTML_QuickForm extends HTML_Common {
if (!isset($this->_rules[$element])) {
$this->_rules[$element] = array();
}
if ($validation == 'client') {
$this->updateAttributes(array('onsubmit' => 'try { var myValidator = validate_' . $this->_attributes['id'] . '; } catch(e) { return true; } return myValidator(this);'));
}
$this->_rules[$element][] = array(
'type' => $type,
'format' => $format,
@@ -1132,9 +1129,6 @@ class HTML_QuickForm extends HTML_Common {
$this->_required[] = $elementName;
$required++;
}
if ('client' == $validation) {
$this->updateAttributes(array('onsubmit' => 'try { var myValidator = validate_' . $this->_attributes['id'] . '; } catch(e) { return true; } return myValidator(this);'));
}
}
}
if ($required > 0 && count($groupObj->getElements()) == $required) {
@@ -1166,9 +1160,6 @@ class HTML_QuickForm extends HTML_Common {
if ($type == 'required') {
$this->_required[] = $group;
}
if ($validation == 'client') {
$this->updateAttributes(array('onsubmit' => 'try { var myValidator = validate_' . $this->_attributes['id'] . '; } catch(e) { return true; } return myValidator(this);'));
}
}
} // end func addGroupRule