Allow arrays to be ignored in hidden_fields()

This commit is contained in:
Jakub Vrana 2014-03-21 22:45:38 -07:00
parent cd64b707bd
commit 619b49c3d4

View file

@ -747,15 +747,17 @@ function friendly_url($val) {
*/
function hidden_fields($process, $ignore = array()) {
while (list($key, $val) = each($process)) {
if (!in_array($key, $ignore)) {
if (is_array($val)) {
foreach ($val as $k => $v) {
$process[$key . "[$k]"] = $v;
}
} elseif (!in_array($key, $ignore)) {
} else {
echo '<input type="hidden" name="' . h($key) . '" value="' . h($val) . '">';
}
}
}
}
/** Print hidden fields for GET forms
* @return null