Small fix in _checkbox() function to use sent data if available. refs #676

This commit is contained in:
Andreas Burchert (scarya)
2011-03-26 22:33:31 +01:00
parent 6b99f650ca
commit 9ff1d1cce5

View File

@@ -246,7 +246,17 @@ class htmlform
*/
public static function _checkbox($fieldname = '', $data = array()) {
// $data['value'] contains checked items
$checked = $data['value'];
if (isset($data['value'])) {
$checked = $data['value'];
} else {
$checked = array();
}
if (isset($_SESSION['requestData'])) {
if (isset($_SESSION['requestData'][$fieldname])) {
$checked[] = $_SESSION['requestData'][$fieldname];
}
}
// default value is none, so the checkbox isn't an array
$isArray = '';