X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/timetracker.git/blobdiff_plain/098a79f0819ebb89b7d48df4a6b154af4560f68e..9a23a8c0a51b7ec38a96f525484134f3cb85dc7e:/WEB-INF/lib/form/ActionErrors.class.php diff --git a/WEB-INF/lib/form/ActionErrors.class.php b/WEB-INF/lib/form/ActionErrors.class.php new file mode 100644 index 00000000..44b2b2c0 --- /dev/null +++ b/WEB-INF/lib/form/ActionErrors.class.php @@ -0,0 +1,66 @@ +errors)>0 ? false : true ); + } + + function add($message, $arg0 = '', $arg1 = '') { + $patterns = array ("/\{0\}/","/\{1\}/"); + $replace = array ($arg0, $arg1); + $message = preg_replace ($patterns, $replace, $message); + $this->errors[]["message"] = $message; + } + + function addAll($arr) { + if (is_array($arr)) { + foreach ($arr as $k=>$v) { + $this->errors[$k] = $v; + } + } + } + + function get($key) { + return $this->errors["$key"]["message"]; + } + + function dump() { + print_r($this->errors); + } + + function getErrors() { + return $this->errors; + } +} +?> \ No newline at end of file