</table>
<p>
<?php
- $process = $_POST; // expired session
- while (list($key, $val) = each($process)) {
- if (is_array($val)) {
- foreach ($val as $k => $v) {
- $process[$key . "[$k]"] = $v;
- }
- } elseif (!in_array($key, $ignore)) {
- echo '<input type="hidden" name="' . htmlspecialchars($key) . '" value="' . htmlspecialchars($val) . '" />';
- }
- }
+ hidden_fields($_POST, $ignore); // expired session
foreach ($_FILES as $key => $val) {
echo '<input type="hidden" name="files[' . htmlspecialchars($key) . ']" value="' . ($val["error"] ? $val["error"] : base64_encode(file_get_contents($val["tmp_name"]))) . '" />';
}
$row["Comment"] = preg_replace('~(?:(.+); )?InnoDB free: .*~', '\\1', $row["Comment"]);
}
}
+
+function hidden_fields($process, $ignore) {
+ while (list($key, $val) = each($process)) {
+ if (is_array($val)) {
+ foreach ($val as $k => $v) {
+ $process[$key . "[$k]"] = $v;
+ }
+ } elseif (!in_array($key, $ignore)) {
+ echo '<input type="hidden" name="' . htmlspecialchars($key) . '" value="' . htmlspecialchars($val) . '" />';
+ }
+ }
+}
}
function switch_lang() {
- global $langs;
- echo "<p id='lang'>" . lang('Language') . ":";
- $base = remove_from_uri("lang");
+ global $LANG, $langs;
+ echo "<form action=''>\n<div id='lang'>";
+ hidden_fields($_GET, array('lang'));
+ echo lang('Language') . ": <select name='lang' onchange='this.form.submit();'>";
foreach ($langs as $lang => $val) {
- echo ' <a href="' . htmlspecialchars($base . (strpos($base, "?") !== false ? "&" : "?")) . "lang=$lang\" title='$val'>$lang</a>";
+ echo "<option value='$lang'" . ($LANG == $lang ? " selected='selected'" : "") . ">$val</option>";
}
- echo "</p>\n";
+ echo "</select>\n<noscript><div style='display: inline;'><input type='submit' value='" . lang('Use') . "' /></div></noscript>\n</div>\n</form>\n";
}
if (isset($_GET["lang"])) {