1
0
mirror of https://github.com/php/web-php.git synced 2026-03-23 23:02:13 +01:00

selects "Other" in language chooser if current language should not be available (fixes #67629)

This commit is contained in:
Christoph M. Becker
2015-03-24 19:43:30 +01:00
parent 94b8ec7f3b
commit a9aafdff2e

View File

@@ -464,7 +464,8 @@ function manual_language_chooser($currentlang, $currentpage) {
}
// Print out the form with all the options
$format_options = function (array $links) use ($currentlang) {
$othersel = ' selected="selected"';
$format_options = function (array $links) use ($currentlang, &$othersel) {
$out = '';
$tab = str_repeat(' ', 6);
foreach ($links as $link) {
@@ -472,6 +473,7 @@ function manual_language_chooser($currentlang, $currentpage) {
$selected = '';
if ($lang == $currentlang) {
$selected = ' selected="selected"';
$othersel = '';
}
$out .= "$tab<option value='$value'$selected>$text</option>\n";
}
@@ -483,7 +485,7 @@ function manual_language_chooser($currentlang, $currentpage) {
<label for="changelang-langs">Change language:</label>
<select onchange="document.changelang.submit()" name="page" id="changelang-langs">
{$format_options($links)}
<option value="help-translate.php">Other</option>
<option value="help-translate.php"{$othersel}>Other</option>
</select>
</fieldset>
</form>