X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=WEB-INF%2Flib%2Fform%2FActionErrors.class.php;h=3eaf68729b8ccc6307b23126e2cad3d6a8db6187;hb=f787edd7045299de3885c052d243b446f7324ea0;hp=44b2b2c033f4efd557b59eb624e60a08fb721bb4;hpb=9a23a8c0a51b7ec38a96f525484134f3cb85dc7e;p=timetracker.git diff --git a/WEB-INF/lib/form/ActionErrors.class.php b/WEB-INF/lib/form/ActionErrors.class.php index 44b2b2c0..3eaf6872 100644 --- a/WEB-INF/lib/form/ActionErrors.class.php +++ b/WEB-INF/lib/form/ActionErrors.class.php @@ -27,40 +27,31 @@ // +----------------------------------------------------------------------+ class ActionErrors { - var $errors = array(); - - function ActionErrors() { - } - - function isEmpty() { - return (count($this->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; - } + var $errors = array(); + + function __construct() { + } + + function no() { + return (count($this->errors) > 0 ? false : true); + } + + function yes() { + return (count($this->errors) > 0 ? true : false); + } + + function add($message, $arg0 = '', $arg1 = '') { + $patterns = array ('/\{0\}/','/\{1\}/'); + $replace = array($arg0, $arg1); + $message = preg_replace ($patterns, $replace, $message); + $this->errors[]['message'] = $message; + } + + function dump() { + print_r($this->errors); + } + + function getErrors() { + return $this->errors; + } } -?> \ No newline at end of file