aboutsummaryrefslogtreecommitdiffstats
path: root/include
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
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/config.inc.php3
-rw-r--r--include/functions_user.inc.php4
-rw-r--r--include/htmlfunctions.inc.php12
-rw-r--r--include/page_header.php11
4 files changed, 11 insertions, 19 deletions
diff --git a/include/config.inc.php b/include/config.inc.php
index 92d3a73cc..72211789e 100644
--- a/include/config.inc.php
+++ b/include/config.inc.php
@@ -53,6 +53,5 @@ $conf['document_ext'] = array('doc','pdf','zip');
$conf['top_number'] = 10;
$conf['anti-flood_time'] = 60; // seconds between 2 comments : 0 to disable
$conf['max_LOV_categories'] = 50;
-$conf['default_style'] = 'default';
-$conf['default_lang'] = 'en_EN';
+
?>
diff --git a/include/functions_user.inc.php b/include/functions_user.inc.php
index cf3f01fb3..400e104c6 100644
--- a/include/functions_user.inc.php
+++ b/include/functions_user.inc.php
@@ -230,8 +230,7 @@ function check_login_authorization()
function init_userprefs($userdata)
{
global $conf, $template, $lang, $lang_info;
- include_once(PHPWG_ROOT_PATH . 'language/infos.lang.php');
-
+
$language = (!empty($userdata['language']) && !$userdata['is_the_guest'] )?$userdata['language']:$conf['default_lang'];
$style = (!empty($userdata['template'])&& !$userdata['is_the_guest'] )?$userdata['template']:$conf['default_style'];
@@ -251,7 +250,6 @@ function init_userprefs($userdata)
include_once(PHPWG_ROOT_PATH . 'language/' . $language . '/admin.lang.php');
}
- $lang_info['current_code']=$language;
$template= setup_style($style);
return;
}
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>';
diff --git a/include/page_header.php b/include/page_header.php
index 6067c65e8..08572804d 100644
--- a/include/page_header.php
+++ b/include/page_header.php
@@ -30,17 +30,12 @@
//
$template->set_filenames(array('header'=>'header.tpl'));
-$charset = empty($lang_info['charset'][$lang_info['current_code']])?
- $lang_info['default']['charset']:$lang_info['charset'][$lang_info['current_code']];
-$dir = empty($lang_info['direction'][$lang_info['current_code']])?
- $lang_info['default']['direction']:$lang_info['direction'][$lang_info['current_code']];
-
$css = PHPWG_ROOT_PATH.'template/'.$user['template'].'/'.$user['template'].'.css';
$template->assign_vars(array(
- 'CONTENT_ENCODING' => $charset,
+ 'CONTENT_ENCODING' => $lang_info['charset'],
'PAGE_TITLE' => $title,
- 'LANG'=>substr($lang_info['current_code'],0,2),
- 'DIR'=>$dir,
+ 'LANG'=>$lang_info['code'],
+ 'DIR'=>$lang_info['direction'],
'T_STYLE' => $css
));