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(); } },