diff options
author | Nathan Guse <nathaniel.guse@gmail.com> | 2013-08-28 13:30:48 -0500 |
---|---|---|
committer | Nathan Guse <nathaniel.guse@gmail.com> | 2013-08-28 13:30:48 -0500 |
commit | 68ed2b603556dd509172a2c061622ded693e88db (patch) | |
tree | 5424c5e3d4dd6d451e9971e905f6026ac0372479 /phpBB/phpbb/user.php | |
parent | 57bc3c7d3aaa66fc66798bc1e60b88ae17b110a9 (diff) | |
parent | dcf82d9a5ae26de462687325b4d8553e4aaca7d4 (diff) | |
download | forums-68ed2b603556dd509172a2c061622ded693e88db.tar forums-68ed2b603556dd509172a2c061622ded693e88db.tar.gz forums-68ed2b603556dd509172a2c061622ded693e88db.tar.bz2 forums-68ed2b603556dd509172a2c061622ded693e88db.tar.xz forums-68ed2b603556dd509172a2c061622ded693e88db.zip |
Merge branch 'develop' of github.com:phpbb/phpbb3 into ticket/11628
# By Bruno Ais (42) and others
# Via Joas Schilling (39) and others
* 'develop' of github.com:phpbb/phpbb3: (157 commits)
[ticket/11803] Revert POLL_MAX_OPTIONS min value to 0
[ticket/11799] Send anti abuse headers in "new password" emails.
[ticket/11792] Add functional test for var lang_set_ext of core.user_setup
[ticket/11804] Remove </li> from overall_header which was not open
[ticket/11802] replace $browser with $user->browser
[ticket/11801] removed some whitespace and added missing semi colon's in css
[ticket/11792] Add performance remark to core.user_setup event PHPDoc
[ticket/11792] Add variable 'lang_set_ext' to event core.user_setup
[ticket/11789] Remove inline color in memberlist_view
[ticket/11800] Fix scripts variable in subsilver simple_footer
[ticket/11800] Fix JavaScript in simple_footer.html
[ticket/11800] Remove forum_fn from memberlist_search.html
[ticket/11796] Replace pagination with pagination.html
[ticket/11794] Add missing array element commas to docs/coding-guidelines.html
[ticket/11775] Fix doc blocks syntax
[ticket/11775] Remove spaces at line ends
[ticket/11789] Remove colors from HTML code
[ticket/11784] Remove naming redundancy for event listeners
[ticket/11775] Split test into multiple steps
[ticket/11777] Fix new test for loop variables in extension template listeners
...
Conflicts:
phpBB/install/index.php
phpBB/install/install_update.php
Diffstat (limited to 'phpBB/phpbb/user.php')
-rw-r--r-- | phpBB/phpbb/user.php | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/phpBB/phpbb/user.php b/phpBB/phpbb/user.php index 2828bab6a8..36120798e5 100644 --- a/phpBB/phpbb/user.php +++ b/phpBB/phpbb/user.php @@ -128,6 +128,7 @@ class phpbb_user extends phpbb_session } $user_data = $this->data; + $lang_set_ext = array(); /** * Event to load language files and modify user data on every page @@ -139,10 +140,18 @@ class phpbb_user extends phpbb_session * @var string user_timezone User's timezone, should be one of * http://www.php.net/manual/en/timezones.php * @var mixed lang_set String or array of language files + * @var array lang_set_ext Array containing entries of format + * array( + * 'ext_name' => (string) [extension name], + * 'lang_set' => (string|array) [language files], + * ) + * For performance reasons, only load translations + * that are absolutely needed globally using this + * event. Use local events otherwise. * @var mixed style_id Style we are going to display * @since 3.1-A1 */ - $vars = array('user_data', 'user_lang_name', 'user_date_format', 'user_timezone', 'lang_set', 'style_id'); + $vars = array('user_data', 'user_lang_name', 'user_date_format', 'user_timezone', 'lang_set', 'lang_set_ext', 'style_id'); extract($phpbb_dispatcher->trigger_event('core.user_setup', compact($vars))); $this->data = $user_data; @@ -173,6 +182,12 @@ class phpbb_user extends phpbb_session $this->add_lang($lang_set); unset($lang_set); + foreach ($lang_set_ext as $ext_lang_pair) + { + $this->add_lang_ext($ext_lang_pair['ext_name'], $ext_lang_pair['lang_set']); + } + unset($lang_set_ext); + $style_request = request_var('style', 0); if ($style_request && $auth->acl_get('a_styles') && !defined('ADMIN_START')) { @@ -590,6 +605,13 @@ class phpbb_user extends phpbb_session $language_filename = $lang_path . $this->lang_name . '/' . $filename . '.' . $phpEx; } + // If we are in install, try to use the updated version, when available + $install_language_filename = str_replace('language/', 'install/update/new/language/', $language_filename); + if (defined('IN_INSTALL') && file_exists($install_language_filename)) + { + $language_filename = $install_language_filename; + } + if (!file_exists($language_filename)) { global $config; |