Choose language through option-list
git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@517 7c3ca157-0c34-0410-bff1-cbf682f78f5c
This commit is contained in:
parent
3920ebbe37
commit
5d7071a539
11
auth.inc.php
11
auth.inc.php
|
@ -49,16 +49,7 @@ function auth_error() {
|
|||
</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"]))) . '" />';
|
||||
}
|
||||
|
|
|
@ -340,3 +340,15 @@ function table_comment(&$row) {
|
|||
$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) . '" />';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
11
lang.inc.php
11
lang.inc.php
|
@ -29,13 +29,14 @@ function lang($idf, $number = null) {
|
|||
}
|
||||
|
||||
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"])) {
|
||||
|
|
Loading…
Reference in a new issue