[Pieforms-commit] SF.net SVN: pieforms: [164] pieforms-php5/branches/0.2.0/src/pieform.php
Status: Alpha
Brought to you by:
oracleshinoda
|
From: <ora...@us...> - 2007-01-07 21:12:15
|
Revision: 164
http://svn.sourceforge.net/pieforms/?rev=164&view=rev
Author: oracleshinoda
Date: 2007-01-07 13:12:16 -0800 (Sun, 07 Jan 2007)
Log Message:
-----------
Merged pieform_validate patch to 0.2.0 branch
Modified Paths:
--------------
pieforms-php5/branches/0.2.0/src/pieform.php
Modified: pieforms-php5/branches/0.2.0/src/pieform.php
===================================================================
--- pieforms-php5/branches/0.2.0/src/pieform.php 2007-01-07 21:05:58 UTC (rev 163)
+++ pieforms-php5/branches/0.2.0/src/pieform.php 2007-01-07 21:12:16 UTC (rev 164)
@@ -499,11 +499,6 @@
$values = $this->get_submitted_values();
// Perform general validation first
$this->validate($values);
- // Then user specific validation if a function is available for that
- $function = $this->data['validatecallback'];
- if (is_callable($function)) {
- call_user_func_array($function, array($this, $values));
- }
// Submit the form if things went OK
if ($this->data['submit'] && !$this->has_errors()) {
@@ -805,6 +800,12 @@
* @param array $values The submitted values from the form
*/
private function validate($values) {
+ // Call the overall validation function if it is available
+ if (function_exists('pieform_validate')) {
+ pieform_validate($this, $values);
+ }
+
+ // Perform rule validation
foreach ($this->get_elements() as $element) {
if (isset($element['rules']) && is_array($element['rules'])) {
foreach ($element['rules'] as $rule => $data) {
@@ -829,6 +830,12 @@
}
}
}
+
+ // Then user specific validation if a function is available for that
+ $function = $this->data['validatecallback'];
+ if (is_callable($function)) {
+ call_user_func_array($function, array($this, $values));
+ }
}
private function whichbutton_js() {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|