mirror of
https://github.com/php/web-php.git
synced 2026-03-23 23:02:13 +01:00
Adding initial support for user level preferred language. Now it is the site's
default language. Honor that setting in displaying the documentation table pages by highlighting manuals in that language specially.
This commit is contained in:
11
docs.php
11
docs.php
@@ -84,6 +84,10 @@ teams are open to contributions though.
|
||||
|
||||
// List all manual languages viewable online
|
||||
foreach ($man_languages as $langnum => $langcode) {
|
||||
|
||||
// Make preferred language bold
|
||||
if ($langcode == preferred_language()) { echo "<b>"; }
|
||||
|
||||
echo '<a href="/manual/' . $langcode . '/">' . $LANGUAGES[$langcode] . '</a>';
|
||||
echo ($lastlang != $langnum) ? ", " : "";
|
||||
|
||||
@@ -91,6 +95,9 @@ foreach ($man_languages as $langnum => $langcode) {
|
||||
if ($langcode == "fr") {
|
||||
echo '<a href="http://dev.nexen.net/docs/php/annotee/">[Special French]</a>, ';
|
||||
}
|
||||
|
||||
if ($langcode == preferred_language()) { echo "</b>"; }
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -100,8 +107,10 @@ foreach ($man_languages as $langnum => $langcode) {
|
||||
|
||||
// List printer friendly pages of all manual languages
|
||||
foreach ($man_languages as $langnum => $langcode) {
|
||||
if ($langcode == preferred_language()) { echo "<b>"; }
|
||||
echo '<a href="/manual/' . $langcode . '/print/index.php">' . $LANGUAGES[$langcode] . '</a>';
|
||||
echo ($lastlang != $langnum) ? ", " : "";
|
||||
if ($langcode == preferred_language()) { echo "</b>"; }
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -111,8 +120,10 @@ foreach ($man_languages as $langnum => $langcode) {
|
||||
|
||||
// List printer friendly pages with notes of all manual languages
|
||||
foreach ($man_languages as $langnum => $langcode) {
|
||||
if ($langcode == preferred_language()) { echo "<b>"; }
|
||||
echo '<a href="/manual/' . $langcode . '/printwn/index.php">' . $LANGUAGES[$langcode] . '</a>';
|
||||
echo ($lastlang != $langnum) ? ", " : "";
|
||||
if ($langcode == preferred_language()) { echo "</b>"; }
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
@@ -127,12 +127,19 @@ foreach ($LANGUAGES as $langcode => $language) {
|
||||
$language .= '<br /><a href="http://dev.nexen.net/docs/php/chargement.html">[Special French]</a>';
|
||||
}
|
||||
|
||||
// Highlight manual in preferred language
|
||||
if ($langcode == preferred_language()) {
|
||||
$bgcolor = "#ffffcc";
|
||||
} else {
|
||||
$bgcolor = "#eeeeee";
|
||||
}
|
||||
|
||||
echo "<tr>\n<td bgcolor=\"#dddddd\"><b>$language</b></td>\n";
|
||||
|
||||
// Print out a table cell for all formats
|
||||
foreach ($files as $fileinfo) {
|
||||
|
||||
echo "<td align=\"center\" bgcolor=\"#eeeeee\">";
|
||||
echo "<td align=\"center\" bgcolor=\"$bgcolor\">";
|
||||
|
||||
// Missing format
|
||||
if ($fileinfo == '') {
|
||||
|
||||
@@ -36,6 +36,13 @@ function default_language($site = FALSE)
|
||||
return $MIRRORS[$site][6];
|
||||
}
|
||||
|
||||
// Returns the preferred language,
|
||||
// honoring user settings [for future usage]
|
||||
function preferred_language()
|
||||
{
|
||||
return default_language();
|
||||
}
|
||||
|
||||
// Returns true if the current (or specified) mirror
|
||||
// site is registered to have local search support
|
||||
function have_search($site = FALSE)
|
||||
|
||||
Reference in New Issue
Block a user