1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-31 22:10:45 +02:00

Changes to the language handling during the install

git-svn-id: file:///svn/phpbb/trunk@6200 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Graham Eames
2006-07-23 16:04:51 +00:00
parent 5879c1c5c1
commit 4cf863dcb3
5 changed files with 63 additions and 48 deletions

View File

@@ -310,7 +310,9 @@ class module
global $template, $lang, $stage;
$template->assign_vars(array(
'L_CHANGE' => $lang['CHANGE'],
'L_INSTALL_PANEL' => $lang['INSTALL_PANEL'],
'L_SELECT_LANG' => $lang['SELECT_LANG'],
'PAGE_TITLE' => $this->get_page_title(),
'S_CONTENT_DIRECTION' => $lang['DIRECTION'],
@@ -629,6 +631,45 @@ class module
return $tpl;
}
/**
* Generate the drop down of available language packs
*/
function inst_language_select($default = '')
{
global $phpbb_root_path, $phpEx;
$dir = @opendir($phpbb_root_path . 'language');
while ($file = readdir($dir))
{
$path = $phpbb_root_path . 'language/' . $file;
if (is_file($path) || is_link($path) || $file == '.' || $file == '..' || $file == 'CVS')
{
continue;
}
if (file_exists($path . '/iso.txt'))
{
list($displayname) = @file($path . '/iso.txt');
$lang[$displayname] = $file;
}
}
@closedir($dir);
@asort($lang);
@reset($lang);
$user_select = '';
foreach ($lang as $displayname => $filename)
{
$selected = (strtolower($default) == strtolower($filename)) ? ' selected="selected"' : '';
$user_select .= '<option value="' . $filename . '"' . $selected . '>' . ucwords($displayname) . '</option>';
}
return $user_select;
}
}
?>