Make sure that the language does get passed between all modules

git-svn-id: file:///svn/phpbb/trunk@6201 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Graham Eames 2006-07-23 17:43:48 +00:00
parent 4cf863dcb3
commit ba5d555669
3 changed files with 14 additions and 10 deletions

View file

@ -412,7 +412,7 @@ class module
*/ */
function generate_navigation() function generate_navigation()
{ {
global $lang, $template, $phpEx; global $lang, $template, $phpEx, $language;
if (is_array($this->module_ary)) if (is_array($this->module_ary))
{ {
@ -422,7 +422,7 @@ class module
$cat = $cat_ary['name']; $cat = $cat_ary['name'];
$l_cat = (!empty($lang['CAT_' . $cat])) ? $lang['CAT_' . $cat] : preg_replace('#_#', ' ', $cat); $l_cat = (!empty($lang['CAT_' . $cat])) ? $lang['CAT_' . $cat] : preg_replace('#_#', ' ', $cat);
$cat = strtolower($cat); $cat = strtolower($cat);
$url = $this->module_url . '?mode=' . $cat; $url = $this->module_url . "?mode=$cat&language=$language";
if ($this->mode == $cat) if ($this->mode == $cat)
{ {
@ -439,7 +439,7 @@ class module
{ {
$l_option = (!empty($lang['SUB_' . $option])) ? $lang['SUB_' . $option] : preg_replace('#_#', ' ', $option); $l_option = (!empty($lang['SUB_' . $option])) ? $lang['SUB_' . $option] : preg_replace('#_#', ' ', $option);
$option = strtolower($option); $option = strtolower($option);
$url = $this->module_url . '?mode=' . $this->mode . '&sub=' . $option; $url = $this->module_url . '?mode=' . $this->mode . "&sub=&language=$language";
$template->assign_block_vars('l_block1', array( $template->assign_block_vars('l_block1', array(
'L_TITLE' => $l_option, 'L_TITLE' => $l_option,

View file

@ -43,7 +43,7 @@ class install_install extends module
function main($mode, $sub) function main($mode, $sub)
{ {
global $lang, $template; global $lang, $template, $language;
switch ($sub) switch ($sub)
{ {
@ -55,7 +55,7 @@ class install_install extends module
'BODY' => $lang['INSTALL_INTRO_BODY'], 'BODY' => $lang['INSTALL_INTRO_BODY'],
'L_SUBMIT' => $lang['NEXT'], 'L_SUBMIT' => $lang['NEXT'],
'S_LANG_SELECT' => '<select name="language">' . $this->p_master->inst_language_select() . '</select>', 'S_LANG_SELECT' => '<select name="language">' . $this->p_master->inst_language_select() . '</select>',
'U_ACTION' => $this->p_master->module_url . "?mode=$mode&amp;sub=requirements", 'U_ACTION' => $this->p_master->module_url . "?mode=$mode&amp;sub=requirements&amp;language=$language",
)); ));
break; break;
@ -107,7 +107,7 @@ class install_install extends module
*/ */
function check_server_requirements($mode, $sub) function check_server_requirements($mode, $sub)
{ {
global $lang, $template, $phpbb_root_path, $phpEx; global $lang, $template, $phpbb_root_path, $phpEx, $language;
$this->page_title = $lang['STAGE_REQUIREMENTS']; $this->page_title = $lang['STAGE_REQUIREMENTS'];
@ -367,7 +367,7 @@ class install_install extends module
// And finally where do we want to go next (well today is taken isn't it :P) // And finally where do we want to go next (well today is taken isn't it :P)
$s_hidden_fields = ($img_imagick) ? '<input type="hidden" name="img_imagick" value="' . addslashes($img_imagick) . '" />' : ''; $s_hidden_fields = ($img_imagick) ? '<input type="hidden" name="img_imagick" value="' . addslashes($img_imagick) . '" />' : '';
$url = ($passed['php'] && $passed['db'] && $passed['files']) ? $this->p_master->module_url . "?mode=$mode&amp;sub=database" : $this->p_master->module_url . "?mode=$mode&amp;sub=requirements"; $url = ($passed['php'] && $passed['db'] && $passed['files']) ? $this->p_master->module_url . "?mode=$mode&amp;sub=database&amp;language=$language" : $this->p_master->module_url . "?mode=$mode&amp;sub=requirements&amp;language=$language ";
$submit = ($passed['php'] && $passed['db'] && $passed['files']) ? $lang['INSTALL_START'] : $lang['INSTALL_TEST']; $submit = ($passed['php'] && $passed['db'] && $passed['files']) ? $lang['INSTALL_START'] : $lang['INSTALL_TEST'];
@ -495,6 +495,7 @@ class install_install extends module
// And finally where do we want to go next (well today is taken isn't it :P) // And finally where do we want to go next (well today is taken isn't it :P)
$s_hidden_fields = ($img_imagick) ? '<input type="hidden" name="img_imagick" value="' . addslashes($img_imagick) . '" />' : ''; $s_hidden_fields = ($img_imagick) ? '<input type="hidden" name="img_imagick" value="' . addslashes($img_imagick) . '" />' : '';
$s_hidden_fields .= '<input type="hidden" name="language" value="' . $language . '" />';
if ($connect_test) if ($connect_test)
{ {
foreach ($this->db_config_options as $config_key => $vars) foreach ($this->db_config_options as $config_key => $vars)
@ -666,6 +667,7 @@ class install_install extends module
} }
$s_hidden_fields .= ($img_imagick) ? '<input type="hidden" name="img_imagick" value="' . addslashes($img_imagick) . '" />' : ''; $s_hidden_fields .= ($img_imagick) ? '<input type="hidden" name="img_imagick" value="' . addslashes($img_imagick) . '" />' : '';
$s_hidden_fields .= '<input type="hidden" name="language" value="' . $language . '" />';
foreach ($this->db_config_options as $config_key => $vars) foreach ($this->db_config_options as $config_key => $vars)
{ {
@ -711,6 +713,7 @@ class install_install extends module
} }
$s_hidden_fields = ($img_imagick) ? '<input type="hidden" name="img_imagick" value="' . addslashes($img_imagick) . '" />' : ''; $s_hidden_fields = ($img_imagick) ? '<input type="hidden" name="img_imagick" value="' . addslashes($img_imagick) . '" />' : '';
$s_hidden_fields .= '<input type="hidden" name="language" value="' . $language . '" />';
$written = false; $written = false;
// Create a list of any PHP modules we wish to have loaded // Create a list of any PHP modules we wish to have loaded
@ -784,6 +787,7 @@ class install_install extends module
} }
$config_options = array_merge($this->db_config_options, $this->admin_config_options); $config_options = array_merge($this->db_config_options, $this->admin_config_options);
foreach ($config_options as $config_key => $vars) foreach ($config_options as $config_key => $vars)
{ {
if (!is_array($vars)) if (!is_array($vars))
@ -855,13 +859,13 @@ class install_install extends module
} }
$s_hidden_fields = ($img_imagick) ? '<input type="hidden" name="img_imagick" value="' . addslashes($img_imagick) . '" />' : ''; $s_hidden_fields = ($img_imagick) ? '<input type="hidden" name="img_imagick" value="' . addslashes($img_imagick) . '" />' : '';
$email_enable = ($email_enable !== '') ? $email_enable : true; $s_hidden_fields .= '<input type="hidden" name="language" value="' . $language . '" />';
$email_enable = ($email_enable !== '') ? $email_enable : true;
$server_name = ($server_name !== '') ? $server_name : ((!empty($_SERVER['SERVER_NAME'])) ? $_SERVER['SERVER_NAME'] : getenv('SERVER_NAME')); $server_name = ($server_name !== '') ? $server_name : ((!empty($_SERVER['SERVER_NAME'])) ? $_SERVER['SERVER_NAME'] : getenv('SERVER_NAME'));
$server_port = ($server_port !== '') ? $server_port : ((!empty($_SERVER['SERVER_PORT'])) ? (int) $_SERVER['SERVER_PORT'] : (int) getenv('SERVER_PORT')); $server_port = ($server_port !== '') ? $server_port : ((!empty($_SERVER['SERVER_PORT'])) ? (int) $_SERVER['SERVER_PORT'] : (int) getenv('SERVER_PORT'));
$server_protocol = ($server_protocol !== '') ? $server_protocol : ((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? 'https://' : 'http://'); $server_protocol = ($server_protocol !== '') ? $server_protocol : ((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? 'https://' : 'http://');
$cookie_secure = ($cookie_secure !== '') ? $cookie_secure : ((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? true : false); $cookie_secure = ($cookie_secure !== '') ? $cookie_secure : ((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? true : false);
foreach ($this->advanced_config_options as $config_key => $vars) foreach ($this->advanced_config_options as $config_key => $vars)
{ {

View file

@ -35,7 +35,7 @@ $lang = array_merge($lang, array(
'ADMIN_PASSWORD_EXPLAIN' => '(Please enter a password between 6 and 30 characters is length)', 'ADMIN_PASSWORD_EXPLAIN' => '(Please enter a password between 6 and 30 characters is length)',
'ADMIN_TEST' => 'Check administrator settings', 'ADMIN_TEST' => 'Check administrator settings',
'ADMIN_USERNAME' => 'Administrator username', 'ADMIN_USERNAME' => 'Administrator username',
'ADMIN_USERNAME_EXPLAIN' => '(Please enter a password between 3 and 20 characters is length)', 'ADMIN_USERNAME_EXPLAIN' => '(Please enter a username between 3 and 20 characters is length)',
'APP_MAGICK' => 'Imagemagick support [ Attachments ]', 'APP_MAGICK' => 'Imagemagick support [ Attachments ]',
'AUTHOR_NOTES' => 'Author Notes<br />&#187; %s', 'AUTHOR_NOTES' => 'Author Notes<br />&#187; %s',
'AVAILABLE' => 'Available', 'AVAILABLE' => 'Available',