X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/timetracker.git/blobdiff_plain/3705caa8680d82736ab1a1d21e8829bed1226341..62da0ed23af9ae74faf8d103bc3ce025c56b673e:/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 index 04a6333f..02061361 100644 --- a/WEB-INF/lib/form/ActionErrors.class.php +++ b/WEB-INF/lib/form/ActionErrors.class.php @@ -28,14 +28,26 @@ class ActionErrors { var $errors = array(); - + function ActionErrors() { } - + function isEmpty() { - return (count($this->errors)>0 ? false : true ); + return (count($this->errors)>0 ? false : true); } - + + function exist() { + return (count($this->errors)>0 ? true : false); + } + + 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); @@ -43,14 +55,6 @@ class ActionErrors { $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"]; }