LSformElement::valueWithUnit : Added compatibility with data entry form

This commit is contained in:
Benjamin Renard 2011-12-15 12:17:46 +01:00
parent 3838af68bf
commit e224144fdd

View file

@ -149,6 +149,12 @@ class LSformElement_valueWithUnit extends LSformElement {
} }
} }
} }
if (isset($_POST[$this -> name])) {
if(!is_array($_POST[$this -> name])) {
$_POST[$this -> name] = array($_POST[$this -> name]);
}
$return[$this -> name]=array_merge($return[$this -> name],$_POST[$this -> name]);
}
if (isset($_POST[$this -> name.'_value'])) { if (isset($_POST[$this -> name.'_value'])) {
if (!is_array($_POST[$this -> name.'_value'])) { if (!is_array($_POST[$this -> name.'_value'])) {
$_POST[$this -> name.'_value']=array($_POST[$this -> name.'_value']); $_POST[$this -> name.'_value']=array($_POST[$this -> name.'_value']);