cvs: phpweb / docs.php download-docs.php /include site.inc
| From: | Gabor Hojtsy | Date: | Thu, 02 Jan 2003 21:52:31 +0000 |
| Subject: | cvs: phpweb / docs.php download-docs.php /include site.inc | ||
| Groups: | php.mirrors | ||
| Request: | Send a blank email to php-mirrors+get-14639@lists.php.net to get a copy of this message | ||
goba Thu Jan 2 16:52:31 2003 EDT
Modified files:
/phpweb download-docs.php docs.php
/phpweb/include site.inc
Log:
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.
Index: phpweb/download-docs.php
diff -u phpweb/download-docs.php:1.42 phpweb/download-docs.php:1.43
--- phpweb/download-docs.php:1.42 Sat Dec 28 09:09:14 2002
+++ phpweb/download-docs.php Thu Jan 2 16:52:31 2003
@@ -127,12 +127,19 @@
$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 == '') {
Index: phpweb/docs.php
diff -u phpweb/docs.php:1.119 phpweb/docs.php:1.120
--- phpweb/docs.php:1.119 Sat Dec 28 08:40:16 2002
+++ phpweb/docs.php Thu Jan 2 16:52:31 2003
@@ -84,6 +84,10 @@
// 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 @@
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 @@
// 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 @@
// 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>"; }
}
?>
Index: phpweb/include/site.inc
diff -u phpweb/include/site.inc:1.234 phpweb/include/site.inc:1.235
--- phpweb/include/site.inc:1.234 Sun Dec 22 18:16:03 2002
+++ phpweb/include/site.inc Thu Jan 2 16:52:31 2003
@@ -36,6 +36,13 @@
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)