mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-08-07 17:23:04 +02:00
- Split of infos.lang.php
git-svn-id: http://piwigo.org/svn/trunk@398 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
@@ -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';
|
||||
|
||||
?>
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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>';
|
||||
|
||||
@@ -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
|
||||
));
|
||||
|
||||
Reference in New Issue
Block a user