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

Define and utilize $ACTIVE_ONLINE_LANGUAGES

This commit is contained in:
Philip Olson
2008-04-10 18:41:13 +00:00
parent 2bc7b6c05c
commit 0b103acf0a
4 changed files with 7 additions and 8 deletions

View File

@@ -44,8 +44,7 @@ site_header("Documentation");
// Check for really available manual languages
$man_languages = array();
// Remove inactive online languages from the list to show
$online_languages = array_diff($LANGUAGES, $INACTIVE_ONLINE_LANGUAGES);
foreach ($online_languages as $code => $langname) {
foreach ($ACTIVE_ONLINE_LANGUAGES as $code => $langname) {
// Avoid this stat call here for the moment
// if (file_exists("manual/$code/index.php")) {
$man_languages[] = $code;

View File

@@ -79,6 +79,8 @@ $INACTIVE_ONLINE_LANGUAGES = array(
'tr' => 'Turkish',
);
$ACTIVE_ONLINE_LANGUAGES = array_diff($LANGUAGES, $INACTIVE_ONLINE_LANGUAGES);
// Convert between language codes back and forth
// [We use non standard languages codes and so conversion
// is needed when communicating with the outside world]

View File

@@ -150,7 +150,7 @@ function manual_sidebar()
function manual_navbar($location = "top")
{
global $PGI, $LANG, $LANGUAGES, $INACTIVE_ONLINE_LANGUAGES;
global $PGI, $LANG, $LANGUAGES, $INACTIVE_ONLINE_LANGUAGES, $ACTIVE_ONLINE_LANGUAGES;
// Start navbar with
echo "<!--UdmComment-->\n<div class=\"manualnavbar manualnavbar_$location\">\n <span class=\"next\">\n";
@@ -182,11 +182,9 @@ function manual_navbar($location = "top")
// Quick access to filename
$filename = $PGI['this'][0];
// Disable all languages without online content
$online_languages = array_diff($LANGUAGES, $INACTIVE_ONLINE_LANGUAGES);
// Disable all languages without online content
// Add a dropdown item for all languages left
foreach ($online_languages as $code => $name) {
foreach ($ACTIVE_ONLINE_LANGUAGES as $code => $name) {
if (!preg_match("!/$code/!", $_SERVER['BASE_PAGE'])
// && file_exists($_SERVER['DOCUMENT_ROOT'] . "/$code/$filename")
) {

2
my.php
View File

@@ -7,7 +7,7 @@ include_once $_SERVER['DOCUMENT_ROOT'] . '/include/prepend.inc';
header_nocache();
// Languages array copy and options to list
$langs = array_diff($LANGUAGES, $INACTIVE_ONLINE_LANGUAGES);
$langs = $ACTIVE_ONLINE_LANGUAGES;
$options = array();
// We have post data, and it is an available language