From 1015869e285a35aa70feb531483adad759898061 Mon Sep 17 00:00:00 2001 From: Benjamin Renard Date: Sun, 9 Nov 2008 23:20:34 +0000 Subject: [PATCH] =?UTF-8?q?-=20LSform=20:=20=09->=20Ajout=20de=20la=20m?= =?UTF-8?q?=C3=A9thode=20getErrors()=20:=20retourne=20les=20erreurs=20d?= =?UTF-8?q?=C3=A9finies=20=09->=20Correction=20de=20la=20m=C3=A9thode=20de?= =?UTF-8?q?finedError()=20:=20ajout=20de=20la=20possibilite=20=09=09=20de?= =?UTF-8?q?=20savoir=20si=20globalement=20des=20erreurs=20sont=20d=C3=A9fi?= =?UTF-8?q?nies.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- trunk/includes/class/class.LSform.php | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/trunk/includes/class/class.LSform.php b/trunk/includes/class/class.LSform.php index 8b980e15..c33e7d0f 100644 --- a/trunk/includes/class/class.LSform.php +++ b/trunk/includes/class/class.LSform.php @@ -180,8 +180,22 @@ class LSform { * * @retval boolean */ - function definedError($element) { - return isset($this -> _elementsErrors[$element]); + function definedError($element=NULL) { + if ($element) { + return isset($this -> _elementsErrors[$element]); + } + else { + return !empty($this -> _elementsErrors); + } + } + + /** + * Retourne le tableau des erreurs + * + * @retval Array array(element => array(errors)) + */ + function getErrors() { + return $this -> _elementsErrors; } /**