1
0
mirror of https://github.com/php/web-php.git synced 2026-04-26 16:38:04 +02:00

Add the language chooser back

This commit is contained in:
Hannes Magnusson
2011-01-01 15:03:27 +00:00
parent 68cb0565a3
commit ad52834641
3 changed files with 53 additions and 3 deletions
+32
View File
@@ -531,6 +531,38 @@ function manual_setup_beta($setup) {
$_SERVER["BASE_PAGE"] = "/manual/" . $setup["head"][1] . "/" . $setup["this"][0];
site_header($setup["this"][1] . " - Manual ", array("current" => "docs", "leftmenu" => $menu));
echo '<aside id="quicktoc"></aside>';
manual_language_chooser($setup['head'][1], $setup['this'][0]);
}
function manual_language_chooser($currentlang, $currentpage) {
global $ACTIVE_ONLINE_LANGUAGES;
$links = array();
foreach ($ACTIVE_ONLINE_LANGUAGES as $lang => $name) {
$links[] = array("$lang/$currentpage", $name, $lang);
}
$links[] = array('help-translate.php', 'Other');
// Print out the form with all the options
echo <<< FORM
<form action="/manual/change.php" method="get" id="changelang">
<fieldset>
<select name="page" id="changelang-langs">
FORM;
foreach ($links as $link) {
echo "<option value='{$link[0]}' " .($link[2] == $currentlang ? "selected" : ""). ">{$link[1]}</option>\n";
}
echo <<< FORM
</select>
<input type="submit"
value="Go"
id="changelang-submit"
class="submit" />
</fieldset>
</form>
FORM;
}
function manual_header_beta(){}
+3 -1
View File
@@ -50,7 +50,9 @@ h1 {
width: 14em;
}
#headsearch-submit {
#headsearch-submit,
#changelang-submit
{
border: 0;
margin: 1px;
padding: 2px 5px;
+18 -2
View File
@@ -80,7 +80,9 @@ a:hover {
border-radius: 5px;
}
#headsearch-keywords {
#headsearch-keywords,
#changelang-langs
{
color: #666;
background: transparent;
-webkit-appearance: none;
@@ -90,7 +92,9 @@ a:hover {
color: #000;
}
#headsearch-submit {
#headsearch-submit,
#changelang-submit
{
border-color: #987db3;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
@@ -99,6 +103,14 @@ a:hover {
background: #604080;
color: #fff;
}
#changelang {
border-color: #987db3;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
border-radius: 5px;
border: 1px solid #604080;
float: right;
}
#headnav li dl {
line-height: 1;
@@ -290,3 +302,7 @@ a.genanchor:hover {
}
/* }}} */
#langform {
float: right;
}