Added support to reuse form data if validation fails, refs #672

This commit is contained in:
Andreas Burchert (scarya)
2011-03-19 13:43:01 +01:00
parent 3a6779570f
commit ef8c3d3cf7
4 changed files with 43 additions and 4 deletions

View File

@@ -39,5 +39,14 @@ function makeyesno($name, $yesvalue, $novalue = '', $yesselected = '', $disabled
} else {
$d = '';
}
return '<select class="dropdown_noborder" id="' . $name . '" name="' . $name . '"'.$d.'><option value="' . $yesvalue . '"' . ($yesselected ? ' selected="selected"' : '') . '>' . $lng['panel']['yes'] . '</option><option value="' . $novalue . '"' . ($yesselected ? '' : ' selected="selected"') . '>' . $lng['panel']['no'] . '</option></select>';
if (isset($_SESSION['requestData'])) {
$yesselected = $yesselected & $_SESSION['requestData'][$name];
}
return '<select class="dropdown_noborder" id="' . $name . '" name="' . $name . '"'
.$d.'>
<option value="' . $yesvalue . '"' . ($yesselected ? ' selected="selected"' : '') . '>'
. $lng['panel']['yes'] . '</option><option value="' . $novalue . '"'
. ($yesselected ? '' : ' selected="selected"') . '>' . $lng['panel']['no'] . '</option></select>';
}

View File

@@ -29,6 +29,7 @@
function standard_error($errors = '', $replacer = '')
{
global $db, $userinfo, $s, $header, $footer, $lng;
$_SESSION['requestData'] = $_POST;
$replacer = htmlentities($replacer);
if(!is_array($errors))