diff options
author | rechosen <rechosen@gmail.com> | 2013-09-23 18:08:29 +0200 |
---|---|---|
committer | rechosen <rechosen@gmail.com> | 2013-09-23 18:08:29 +0200 |
commit | e45b69ee094d8e3cb8cb91ebdcddb8f50db7b806 (patch) | |
tree | 0c7421d14d3f803358740a2febb84bc06acd4dac /phpBB/phpbb/user.php | |
parent | 564a7cc89dcd2464024b78fe2e70adef771368f2 (diff) | |
parent | 717e2337b9276d9f9680110dff552ea536d0723c (diff) | |
download | forums-e45b69ee094d8e3cb8cb91ebdcddb8f50db7b806.tar forums-e45b69ee094d8e3cb8cb91ebdcddb8f50db7b806.tar.gz forums-e45b69ee094d8e3cb8cb91ebdcddb8f50db7b806.tar.bz2 forums-e45b69ee094d8e3cb8cb91ebdcddb8f50db7b806.tar.xz forums-e45b69ee094d8e3cb8cb91ebdcddb8f50db7b806.zip |
Merge branch 'develop' of git://github.com/phpbb/phpbb3 into ticket/11786
Diffstat (limited to 'phpBB/phpbb/user.php')
-rw-r--r-- | phpBB/phpbb/user.php | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/phpBB/phpbb/user.php b/phpBB/phpbb/user.php index b39438e315..36120798e5 100644 --- a/phpBB/phpbb/user.php +++ b/phpBB/phpbb/user.php @@ -75,7 +75,7 @@ class phpbb_user extends phpbb_session */ function setup($lang_set = false, $style_id = false) { - global $db, $phpbb_style, $template, $config, $auth, $phpEx, $phpbb_root_path, $cache; + global $db, $template, $config, $auth, $phpEx, $phpbb_root_path, $cache; global $phpbb_dispatcher; if ($this->data['user_id'] != ANONYMOUS) @@ -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')) { @@ -236,7 +251,7 @@ class phpbb_user extends phpbb_session } } - $phpbb_style->set_style(); + $template->set_style(); $this->img_lang = $this->lang_name; |