X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=WEB-INF%2Flib%2Fform%2FActionErrors.class.php;h=3eaf68729b8ccc6307b23126e2cad3d6a8db6187;hb=75a1eedb8977b8f2db459128bab9aaf367e3b58b;hp=9cdc21b6ef624b2d3541abeb262475f0533d37a6;hpb=1fad211ab12fc66117094e33425f8414fccd2cfa;p=timetracker.git diff --git a/WEB-INF/lib/form/ActionErrors.class.php b/WEB-INF/lib/form/ActionErrors.class.php index 9cdc21b6..3eaf6872 100644 --- a/WEB-INF/lib/form/ActionErrors.class.php +++ b/WEB-INF/lib/form/ActionErrors.class.php @@ -27,39 +27,31 @@ // +----------------------------------------------------------------------+ class ActionErrors { - var $errors = array(); + var $errors = array(); - function ActionErrors() { - } + function __construct() { + } - function exist() { - return (count($this->errors)>0 ? true : false); - } + function no() { + return (count($this->errors) > 0 ? false : true); + } - function no() { - return (count($this->errors)>0 ? false : true); - } + function yes() { + return (count($this->errors) > 0 ? true : false); + } - 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 add($message, $arg0 = '', $arg1 = '') { - $patterns = array ("/\{0\}/","/\{1\}/"); - $replace = array ($arg0, $arg1); - $message = preg_replace ($patterns, $replace, $message); - $this->errors[]["message"] = $message; - } - - function get($key) { - return $this->errors["$key"]["message"]; - } - - function dump() { - print_r($this->errors); - } - - function getErrors() { - return $this->errors; - } + function dump() { + print_r($this->errors); + } + + function getErrors() { + return $this->errors; + } }