Simplify switch lang form

This commit is contained in:
Jakub Vrana 2012-09-06 23:07:31 -07:00
parent 4cb14deac1
commit 195a811466

View file

@ -73,7 +73,7 @@ function switch_lang() {
global $LANG, $langs;
echo "<form action=''>\n<div id='lang'>";
hidden_fields($_GET, array('lang'));
echo lang('Language') . ": " . html_select("lang", $langs, $LANG, "var loc = location.search.replace(/[?&]lang=[^&]*/, ''); location.search = loc + (loc ? '&' : '') + 'lang=' + this.value;");
echo lang('Language') . ": " . html_select("lang", $langs, $LANG, "this.form.submit();");
echo " <input type='submit' value='" . lang('Use') . "' class='hidden'>\n";
echo "</div>\n</form>\n";
}