aboutsummaryrefslogtreecommitdiffstats
path: root/include/htmlfunctions.inc.php
diff options
context:
space:
mode:
authorgweltas <gweltas@piwigo.org>2004-03-27 13:24:26 +0000
committergweltas <gweltas@piwigo.org>2004-03-27 13:24:26 +0000
commit6a9c9eb91f349123850ddda0de18dde87f0565bb (patch)
tree28c5304252304a1197fb5a404c93f07b3fda6183 /include/htmlfunctions.inc.php
parenta2fe0444de049196fe203883fb426aa18e6a4b35 (diff)
- Split of infos.lang.php
git-svn-id: http://piwigo.org/svn/trunk@398 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to '')
-rw-r--r--include/htmlfunctions.inc.php12
1 files changed, 6 insertions, 6 deletions
diff --git a/include/htmlfunctions.inc.php b/include/htmlfunctions.inc.php
index 8377f8e35..25b330ff3 100644
--- a/include/htmlfunctions.inc.php
+++ b/include/htmlfunctions.inc.php
@@ -112,17 +112,17 @@ function create_navigation_bar( $url, $nb_element, $start,
//
function language_select($default, $select_name = "language")
{
- global $lang_info;
+
$dir = opendir(PHPWG_ROOT_PATH . 'language');
$available_lang= array();
while ( $file = readdir($dir) )
{
- if (is_dir ( realpath(PHPWG_ROOT_PATH.'language/'.$file) )
- && !is_link(realpath(PHPWG_ROOT_PATH . 'language/' . $file))
- && isset($lang_info['language'][$file]))
+ $path= realpath(PHPWG_ROOT_PATH . 'language/'.$file);
+ if (is_dir ($path) && !is_link($path) && file_exists($path . '/iso.txt'))
{
- $available_lang[$file] = $lang_info['language'][$file];
+ list($displayname) = @file($path . '/iso.txt');
+ $available_lang[$displayname] = $file;
}
}
closedir($dir);
@@ -130,7 +130,7 @@ function language_select($default, $select_name = "language")
@reset($available_lang);
$lang_select = '<select name="' . $select_name . '" onchange="this.form.submit()">';
- while ( list($code, $displayname) = @each($available_lang) )
+ foreach ($available_lang as $displayname => $code)
{
$selected = ( strtolower($default) == strtolower($code) ) ? ' selected="selected"' : '';
$lang_select .= '<option value="' . $code . '"' . $selected . '>' . ucwords($displayname) . '</option>';