From fce0276f57cec6986ac62721d78c16aea283da4f Mon Sep 17 00:00:00 2001 From: Benjamin Renard Date: Fri, 18 Jul 2008 14:43:19 +0000 Subject: [PATCH] =?UTF-8?q?-=20trunk/includes/class/class.LSattr=5Fhtml=5F?= =?UTF-8?q?textarea.php=20=20=20->=20Correction=20d'un=20bug=20:=20reste?= =?UTF-8?q?=20d'une=20impossibilit=C3=A9=20d'une=20valeur=20multiple=20-?= =?UTF-8?q?=20trunk/includes/class/class.LSattr=5Fhtml=5Fimage.php=20&=20?= =?UTF-8?q?=20=20trunk/includes/class/class.LSattr=5Fhtml=5Fpassword.php?= =?UTF-8?q?=20=20=20->=20Correction=20d'un=20bug=20:=20Retour=20d'erreur?= =?UTF-8?q?=20lors=20d'une=20valeur=20multiple=20-=20trunk/includes/class/?= =?UTF-8?q?class.LSattribute.php=20:=20=20=20->=20Correction=20d'un=20bug?= =?UTF-8?q?=20lors=20d'un=20mauvais=20retour=20du=20LSattr=5Fhtml::addToFo?= =?UTF-8?q?rm()=20-=20trunk/includes/js/LSdefault.js=20:=20Correction=20d'?= =?UTF-8?q?un=20bug=20d'affichage=20des=20erreurs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- trunk/includes/class/class.LSattr_html_image.php | 12 +++++++++++- trunk/includes/class/class.LSattr_html_password.php | 9 +++++++-- trunk/includes/class/class.LSattr_html_textarea.php | 4 ---- trunk/includes/class/class.LSattribute.php | 3 ++- trunk/includes/js/LSdefault.js | 2 +- 5 files changed, 21 insertions(+), 9 deletions(-) diff --git a/trunk/includes/class/class.LSattr_html_image.php b/trunk/includes/class/class.LSattr_html_image.php index e0e4fe93..862f1e3b 100644 --- a/trunk/includes/class/class.LSattr_html_image.php +++ b/trunk/includes/class/class.LSattr_html_image.php @@ -42,8 +42,18 @@ class LSattr_html_image extends LSattr_html { $GLOBALS['LSerror'] -> addErrorCode(206,$this -> name); return; } + + if (count($data)>1) { + $GLOBALS['LSerror'] -> addErrorCode(103,'password'); + } + if ($data) { - $element -> setValue($data); + if(is_array($data)) { + $element -> setValue($data[0]); + } + else { + $element -> setValue($data); + } } return $element; } diff --git a/trunk/includes/class/class.LSattr_html_password.php b/trunk/includes/class/class.LSattr_html_password.php index ec0d9ddb..34020cf1 100644 --- a/trunk/includes/class/class.LSattr_html_password.php +++ b/trunk/includes/class/class.LSattr_html_password.php @@ -45,10 +45,15 @@ class LSattr_html_password extends LSattr_html { if (count($data)>1) { $GLOBALS['LSerror'] -> addErrorCode(103,'password'); - return; } + if ($data) { - $element -> setValue($data); + if(is_array($data)) { + $element -> setValue($data[0]); + } + else { + $element -> setValue($data); + } } return $element; } diff --git a/trunk/includes/class/class.LSattr_html_textarea.php b/trunk/includes/class/class.LSattr_html_textarea.php index 5082738d..6f052f53 100644 --- a/trunk/includes/class/class.LSattr_html_textarea.php +++ b/trunk/includes/class/class.LSattr_html_textarea.php @@ -43,10 +43,6 @@ class LSattr_html_textarea extends LSattr_html { return; } - if (count($data)>1) { - $GLOBALS['LSerror'] -> addErrorCode(103,'textarea'); - return; - } if ($data) { $element -> setValue($data); } diff --git a/trunk/includes/class/class.LSattribute.php b/trunk/includes/class/class.LSattribute.php index 82caa5be..d51533be 100644 --- a/trunk/includes/class/class.LSattribute.php +++ b/trunk/includes/class/class.LSattribute.php @@ -294,8 +294,9 @@ class LSattribute { $data=''; } $element = $this -> html -> addToForm($form,'view',$data); - if(!$element) { + if(!$element instanceof LSformElement) { $GLOBALS['LSerror'] -> addErrorCode(206,$this -> name); + return; } $element -> freeze(); return true; diff --git a/trunk/includes/js/LSdefault.js b/trunk/includes/js/LSdefault.js index 17eeec68..6b7669fd 100644 --- a/trunk/includes/js/LSdefault.js +++ b/trunk/includes/js/LSdefault.js @@ -36,7 +36,7 @@ var LSdefault = new Class({ } if (this.LSerror.innerHTML != '') { - this.displayErrorBox.bind(this); + this.displayErrorBox(); } },