From 4cf863dcb32ebbbf4dfbf706d9e00891dd65b8ad Mon Sep 17 00:00:00 2001 From: Graham Eames Date: Sun, 23 Jul 2006 16:04:51 +0000 Subject: Changes to the language handling during the install git-svn-id: file:///svn/phpbb/trunk@6200 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/install/index.php | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) (limited to 'phpBB/install/index.php') diff --git a/phpBB/install/index.php b/phpBB/install/index.php index 86baa63d59..75819c02a1 100755 --- a/phpBB/install/index.php +++ b/phpBB/install/index.php @@ -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 .= ''; + } + + return $user_select; + } } ?> \ No newline at end of file -- cgit v1.2.1