X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=WEB-INF%2Flib%2Fform%2FActionErrors.class.php;h=3eaf68729b8ccc6307b23126e2cad3d6a8db6187;hb=e1703495130c8ed88fe210f50a2a6b453b3c566b;hp=0206136146ea9751a01eaa8438af99c5a57586b5;hpb=62da0ed23af9ae74faf8d103bc3ce025c56b673e;p=timetracker.git diff --git a/WEB-INF/lib/form/ActionErrors.class.php b/WEB-INF/lib/form/ActionErrors.class.php index 02061361..3eaf6872 100644 --- a/WEB-INF/lib/form/ActionErrors.class.php +++ b/WEB-INF/lib/form/ActionErrors.class.php @@ -27,43 +27,31 @@ // +----------------------------------------------------------------------+ class ActionErrors { - var $errors = array(); + var $errors = array(); - function ActionErrors() { - } + function __construct() { + } - function isEmpty() { - return (count($this->errors)>0 ? false : true); - } + function no() { + return (count($this->errors) > 0 ? false : true); + } - function exist() { - return (count($this->errors)>0 ? true : false); - } + function yes() { + return (count($this->errors) > 0 ? true : false); + } - function no() { - 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 yes() { - return (count($this->errors)>0 ? true : false); - } + function dump() { + print_r($this->errors); + } - 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 getErrors() { + return $this->errors; + } }