cvs: phpweb / docs.php
| From: | Hannes Magnusson | Date: | Fri, 11 Apr 2008 15:26:21 +0000 |
| Subject: | cvs: phpweb / docs.php | ||
| Groups: | php.webmaster | ||
| Request: | Send a blank email to php-webmaster+get-1524@lists.php.net to get a copy of this message | ||
bjori Fri Apr 11 15:26:21 2008 UTC
Modified files:
/phpweb docs.php
Log:
Simplify
http://cvs.php.net/viewvc.cgi/phpweb/docs.php?r1=1.144&r2=1.145&diff_format=u
Index: phpweb/docs.php
diff -u phpweb/docs.php:1.144 phpweb/docs.php:1.145
--- phpweb/docs.php:1.144 Fri Apr 11 15:23:09 2008
+++ phpweb/docs.php Fri Apr 11 15:26:21 2008
@@ -1,5 +1,5 @@
<?php
-// $Id: docs.php,v 1.144 2008/04/11 15:23:09 philip Exp $
+// $Id: docs.php,v 1.145 2008/04/11 15:26:21 bjori Exp $
$_SERVER['BASE_PAGE'] = 'docs.php';
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/prepend.inc';
@@ -41,16 +41,6 @@
site_header("Documentation");
-// Check for really available manual languages
-$man_languages = array();
-// Remove inactive online languages from the list to show
-foreach ($ACTIVE_ONLINE_LANGUAGES as $code => $langname) {
- if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/manual/$code/index.php")) {
- $man_languages[] = $code;
- }
-}
-$lastlang = count($man_languages) - 1;
-
?>
<h1>Documentation</h1>
@@ -85,13 +75,17 @@
<?php
// List all manual languages viewable online
-foreach ($man_languages as $langnum => $langcode) {
+$lastlang = end($ACTIVE_ONLINE_LANGUAGES);
+foreach ($ACTIVE_ONLINE_LANGUAGES as $langcode => $langname) {
+ if (!file_exists($_SERVER["DOCUMENT_ROOT"] . "/manual/{$langcode}/index.php"))
{
+ continue;
+ }
// Make preferred language bold
if ($langcode == $LANG) { echo "<strong>"; }
- echo '<a href="/manual/' . $langcode . '/">' .
$LANGUAGES[$langcode] . '</a>';
- echo ($lastlang != $langnum) ? ",\n" : "\n";
+ echo '<a href="/manual/' . $langcode . '/">' . $langname .
'</a>';
+ echo ($lastlang != $langname) ? ",\n" : "\n";
if ($langcode == $LANG) { echo "</strong>"; }
}