mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-07 15:05:43 +02:00
Merge pull request #4169 from CHItA/ticket/14460
[ticket/14460] Use the selected language with AJAX requests as well * CHItA/ticket/14460: [ticket/14460] Use the selected language with AJAX requests as well
This commit is contained in:
commit
fffbbbdcc4
@ -183,11 +183,6 @@ class helper
|
|||||||
if (!empty($submit))
|
if (!empty($submit))
|
||||||
{
|
{
|
||||||
$lang = $this->phpbb_request->variable('language', '');
|
$lang = $this->phpbb_request->variable('language', '');
|
||||||
|
|
||||||
if (!empty($lang))
|
|
||||||
{
|
|
||||||
$this->language_cookie = $lang;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Retrieve language from cookie
|
// Retrieve language from cookie
|
||||||
@ -195,10 +190,10 @@ class helper
|
|||||||
if (empty($lang) && !empty($lang_cookie))
|
if (empty($lang) && !empty($lang_cookie))
|
||||||
{
|
{
|
||||||
$lang = $lang_cookie;
|
$lang = $lang_cookie;
|
||||||
$this->language_cookie = $lang;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$lang = (!empty($lang) && strpos($lang, '/') === false) ? $lang : null;
|
$lang = (!empty($lang) && strpos($lang, '/') === false) ? $lang : null;
|
||||||
|
$this->language_cookie = $lang;
|
||||||
|
|
||||||
$this->render_language_select($lang);
|
$this->render_language_select($lang);
|
||||||
|
|
||||||
|
@ -123,6 +123,7 @@ class install
|
|||||||
|
|
||||||
// Set the appropriate input-output handler
|
// Set the appropriate input-output handler
|
||||||
$this->installer->set_iohandler($this->iohandler_factory->get());
|
$this->installer->set_iohandler($this->iohandler_factory->get());
|
||||||
|
$this->controller_helper->handle_language_select();
|
||||||
|
|
||||||
if ($this->request->is_ajax())
|
if ($this->request->is_ajax())
|
||||||
{
|
{
|
||||||
@ -142,8 +143,6 @@ class install
|
|||||||
// Determine whether the installation was started or not
|
// Determine whether the installation was started or not
|
||||||
if (true)
|
if (true)
|
||||||
{
|
{
|
||||||
$this->controller_helper->handle_language_select();
|
|
||||||
|
|
||||||
// Set active stage
|
// Set active stage
|
||||||
$this->menu_provider->set_nav_property(
|
$this->menu_provider->set_nav_property(
|
||||||
array('install', 0, 'introduction'),
|
array('install', 0, 'introduction'),
|
||||||
|
@ -122,6 +122,7 @@ class update
|
|||||||
|
|
||||||
// Set the appropriate input-output handler
|
// Set the appropriate input-output handler
|
||||||
$this->installer->set_iohandler($this->iohandler_factory->get());
|
$this->installer->set_iohandler($this->iohandler_factory->get());
|
||||||
|
$this->controller_helper->handle_language_select();
|
||||||
|
|
||||||
// Render the intro page
|
// Render the intro page
|
||||||
if ($this->request->is_ajax())
|
if ($this->request->is_ajax())
|
||||||
@ -140,8 +141,6 @@ class update
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$this->controller_helper->handle_language_select();
|
|
||||||
|
|
||||||
// Set active stage
|
// Set active stage
|
||||||
$this->menu_provider->set_nav_property(
|
$this->menu_provider->set_nav_property(
|
||||||
array('update', 0, 'introduction'),
|
array('update', 0, 'introduction'),
|
||||||
|
@ -227,18 +227,22 @@ class config
|
|||||||
$file_content = @file_get_contents($this->install_config_file);
|
$file_content = @file_get_contents($this->install_config_file);
|
||||||
$serialized_data = trim(substr($file_content, 8));
|
$serialized_data = trim(substr($file_content, 8));
|
||||||
|
|
||||||
$this->installer_config = array();
|
$installer_config = array();
|
||||||
$this->progress_data = array();
|
$progress_data = array();
|
||||||
$this->navigation_data = array();
|
$navigation_data = array();
|
||||||
|
|
||||||
if (!empty($serialized_data))
|
if (!empty($serialized_data))
|
||||||
{
|
{
|
||||||
$unserialized_data = json_decode($serialized_data, true);
|
$unserialized_data = json_decode($serialized_data, true);
|
||||||
|
|
||||||
$this->installer_config = (is_array($unserialized_data['installer_config'])) ? $unserialized_data['installer_config'] : array();
|
$installer_config = (is_array($unserialized_data['installer_config'])) ? $unserialized_data['installer_config'] : array();
|
||||||
$this->progress_data = (is_array($unserialized_data['progress_data'])) ? $unserialized_data['progress_data'] : array();
|
$progress_data = (is_array($unserialized_data['progress_data'])) ? $unserialized_data['progress_data'] : array();
|
||||||
$this->navigation_data = (is_array($unserialized_data['navigation_data'])) ? $unserialized_data['navigation_data'] : array();
|
$navigation_data = (is_array($unserialized_data['navigation_data'])) ? $unserialized_data['navigation_data'] : array();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$this->installer_config = array_merge($this->installer_config, $installer_config);
|
||||||
|
$this->progress_data = array_merge($this->progress_data, $progress_data);
|
||||||
|
$this->navigation_data = array_merge($this->navigation_data, $navigation_data);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -75,7 +75,5 @@ class factory
|
|||||||
throw new iohandler_not_implemented_exception();
|
throw new iohandler_not_implemented_exception();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
throw new iohandler_not_implemented_exception();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user