aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes
diff options
context:
space:
mode:
authorMeik Sievertsen <acydburn@phpbb.com>2004-02-28 21:16:15 +0000
committerMeik Sievertsen <acydburn@phpbb.com>2004-02-28 21:16:15 +0000
commit52cc21864c570170067e8d81d1af1f8d1a2a0291 (patch)
treeefcfe680c390b4f581a1758292a639b2f3da74f0 /phpBB/includes
parent77dedf68a070197bdc4ace8809ab49b2df945847 (diff)
downloadforums-52cc21864c570170067e8d81d1af1f8d1a2a0291.tar
forums-52cc21864c570170067e8d81d1af1f8d1a2a0291.tar.gz
forums-52cc21864c570170067e8d81d1af1f8d1a2a0291.tar.bz2
forums-52cc21864c570170067e8d81d1af1f8d1a2a0291.tar.xz
forums-52cc21864c570170067e8d81d1af1f8d1a2a0291.zip
splitted language files
git-svn-id: file:///svn/phpbb/trunk@4844 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes')
-rw-r--r--phpBB/includes/functions.php2
-rw-r--r--phpBB/includes/functions_posting.php2
-rw-r--r--phpBB/includes/functions_profile_fields.php2
-rw-r--r--phpBB/includes/session.php99
-rw-r--r--phpBB/includes/ucp/ucp_pm.php2
-rw-r--r--phpBB/includes/ucp/ucp_profile.php2
6 files changed, 82 insertions, 27 deletions
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php
index c8965c9168..3cfec6a91e 100644
--- a/phpBB/includes/functions.php
+++ b/phpBB/includes/functions.php
@@ -1452,7 +1452,7 @@ function page_header($page_title = '')
'S_CONTENT_ENCODING' => $user->lang['ENCODING'],
'S_CONTENT_DIR_LEFT' => $user->lang['LEFT'],
'S_CONTENT_DIR_RIGHT' => $user->lang['RIGHT'],
- 'S_TIMEZONE' => ($user->data['user_dst'] || ($user->data['user_id'] == ANONYMOUS && $config['board_dst'])) ? sprintf($user->lang['ALL_TIMES'], $user->lang[$tz], $user->lang['tz']['dst']) : sprintf($user->lang['ALL_TIMES'], $user->lang[$tz], ''),
+ 'S_TIMEZONE' => ($user->data['user_dst'] || ($user->data['user_id'] == ANONYMOUS && $config['board_dst'])) ? sprintf($user->lang['ALL_TIMES'], $user->lang['tz'][$tz], $user->lang['tz']['dst']) : sprintf($user->lang['ALL_TIMES'], $user->lang['tz'][$tz], ''),
'S_DISPLAY_ONLINE_LIST' => (!empty($config['load_online'])) ? 1 : 0,
'S_DISPLAY_SEARCH' => (!empty($config['load_search'])) ? 1 : 0,
'S_DISPLAY_PM' => (empty($config['privmsg_disable'])) ? 1 : 0,
diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php
index 2383558100..26c81cc9d5 100644
--- a/phpBB/includes/functions_posting.php
+++ b/phpBB/includes/functions_posting.php
@@ -31,7 +31,7 @@ function generate_smilies($mode, $forum_id)
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
- $user->setup(false, (int) $row['forum_style']);
+ $user->setup('posting', (int) $row['forum_style']);
page_header($user->lang['SMILIES']);
diff --git a/phpBB/includes/functions_profile_fields.php b/phpBB/includes/functions_profile_fields.php
index c706508c52..be31d9f701 100644
--- a/phpBB/includes/functions_profile_fields.php
+++ b/phpBB/includes/functions_profile_fields.php
@@ -43,7 +43,7 @@ class custom_profile
function generate_profile_fields($mode, $lang_id, $cp_error)
{
- global $db, $template, $auth;
+ global $db, $template, $auth, $user;
$sql = "SELECT l.*, f.*
FROM phpbb_profile_lang l, phpbb_profile_fields f
diff --git a/phpBB/includes/session.php b/phpBB/includes/session.php
index 81700c7415..55d9d6d603 100644
--- a/phpBB/includes/session.php
+++ b/phpBB/includes/session.php
@@ -453,6 +453,7 @@ class session
class user extends session
{
var $lang = array();
+ var $help = array();
var $theme = array();
var $date_format;
var $timezone;
@@ -467,7 +468,7 @@ class user extends session
function setup($lang_set = false, $style = false)
{
- global $db, $template, $config, $auth, $phpEx, $phpbb_root_path;
+ global $db, $template, $config, $auth, $phpEx, $phpbb_root_path, $lang, $help;
if ($this->data['user_id'] != ANONYMOUS)
{
@@ -514,28 +515,9 @@ class user extends session
}
}
- include($this->lang_path . 'lang_main.' . $phpEx);
- if (defined('IN_ADMIN'))
- {
- include($this->lang_path . 'lang_admin.' . $phpEx);
- }
- $this->lang = &$lang;
-
-/* if (is_array($lang_set))
- {
- include($this->lang_path . '/common.' . $phpEx);
-
- foreach ($lang_set as $lang_file)
- {
- include($this->lang_path . '/' . $lang_file . '.' . $phpEx);
- }
- unset($lang_set);
- }
- else
- {
- include($this->lang_path . '/common.' . $phpEx);
- include($this->lang_path . '/' . $lang_set . '.' . $phpEx);
- }*/
+ include($this->lang_path . '/common.' . $phpEx);
+ $this->add_lang($lang_set);
+ unset($lang_set);
if (!empty($_GET['style']) && $auth->acl_get('a_styles'))
{
@@ -591,6 +573,77 @@ class user extends session
return;
}
+ // Internal usage
+ function set_lang($lang_file, $use_db = false, $use_help = false)
+ {
+ global $lang, $help, $phpEx;
+
+ if (!$use_db)
+ {
+ include($this->lang_path . '/' . (($use_help) ? 'help_' : '') . $lang_file . '.' . $phpEx);
+ }
+ else if ($use_db)
+ {
+ // Get Database Language Strings
+ // Put them into $lang if nothing is prefixed, put them into $help if help: is prefixed
+ // For example: help:faq, posting
+ }
+ }
+
+ // Add Language Items - use_db and use_help are assigned where needed (only use them to force inclusion)
+ //
+ // $lang_set = array('posting', 'help' => 'faq');
+ // $lang_set = array('posting', 'viewtopic', 'help' => array('bbcode', 'faq'))
+ // $lang_set = array(array('posting', 'viewtopic'), 'help' => array('bbcode', 'faq'))
+ // $lang_set = 'posting'
+ // $lang_set = array('help' => 'faq', 'db' => array('help:faq', 'posting'))
+ function add_lang($lang_set, $use_db = false, $use_help = false)
+ {
+ global $lang, $help, $phpEx;
+
+ if (is_array($lang_set))
+ {
+ foreach ($lang_set as $key => $lang_file)
+ {
+ $key = (string) $key;
+ if ($key == 'db')
+ {
+ $this->add_lang($lang_file, true, $use_help);
+ }
+ else if ($key == 'help')
+ {
+ $this->add_lang($lang_file, $use_db, true);
+ }
+ else if (!is_array($lang_file))
+ {
+ $this->set_lang($lang_file, $use_db, $use_help);
+ }
+ else
+ {
+ $this->add_lang($lang_file, $use_db, $use_help);
+ }
+ }
+ unset($lang_set);
+ }
+ else if ($lang_set)
+ {
+ $this->set_lang($lang_set, $use_db, $use_help);
+ }
+
+ if ($use_help || sizeof($help))
+ {
+ $this->help += $help;
+ unset($help);
+ }
+
+ if (sizeof($lang))
+ {
+ $this->lang += $lang;
+ // Yes, we unset $lang here, this variable is in use elsewhere
+ unset($lang);
+ }
+ }
+
function format_date($gmepoch, $format = false)
{
static $lang_dates;
diff --git a/phpBB/includes/ucp/ucp_pm.php b/phpBB/includes/ucp/ucp_pm.php
index afe2c68489..0ef90bde51 100644
--- a/phpBB/includes/ucp/ucp_pm.php
+++ b/phpBB/includes/ucp/ucp_pm.php
@@ -50,7 +50,7 @@ class ucp_pm extends ucp
// Is PM disabled?
if (!empty($config['privmsg_disable']))
{
- trigger_error($user->lang['PM_disabled']);
+ trigger_error($user->lang['PM_DISABLED']);
}
$html_entities_match = array('#&#', '#<#', '#>#');
diff --git a/phpBB/includes/ucp/ucp_profile.php b/phpBB/includes/ucp/ucp_profile.php
index fcfbd8336d..dcf0fdbb8f 100644
--- a/phpBB/includes/ucp/ucp_profile.php
+++ b/phpBB/includes/ucp/ucp_profile.php
@@ -17,6 +17,8 @@ class ucp_profile extends module
{
global $config, $db, $user, $auth, $SID, $template, $phpbb_root_path, $phpEx;
+ $user->add_lang('posting');
+
$preview = (!empty($_POST['preview'])) ? true : false;
$submit = (!empty($_POST['submit'])) ? true : false;
$delete = (!empty($_POST['delete'])) ? true : false;