mirror of
https://github.com/phpbb/phpbb.git
synced 2025-05-05 23:25:30 +02:00
[ticket/10743] Renaming user->theme
Renaming user->theme to user->style PHPBB3-10743
This commit is contained in:
parent
33b72ec62b
commit
71ca9b4fe6
@ -130,7 +130,7 @@ class bbcode
|
||||
|
||||
if (empty($this->template_filename))
|
||||
{
|
||||
$this->template_bitfield = new bitfield($user->theme['bbcode_bitfield']);
|
||||
$this->template_bitfield = new bitfield($user->style['bbcode_bitfield']);
|
||||
|
||||
$style_resource_locator = new phpbb_style_resource_locator();
|
||||
$style_path_provider = new phpbb_style_extension_path_provider($phpbb_extension_manager, new phpbb_style_path_provider());
|
||||
|
@ -4772,9 +4772,9 @@ function page_header($page_title = '', $display_online_list = true, $item_id = 0
|
||||
|
||||
'T_ASSETS_VERSION' => $config['assets_version'],
|
||||
'T_ASSETS_PATH' => "{$web_path}assets",
|
||||
'T_THEME_PATH' => "{$web_path}styles/" . rawurlencode($user->theme['style_path']) . '/theme',
|
||||
'T_TEMPLATE_PATH' => "{$web_path}styles/" . rawurlencode($user->theme['style_path']) . '/template',
|
||||
'T_SUPER_TEMPLATE_PATH' => "{$web_path}styles/" . rawurlencode($user->theme['style_path']) . '/template',
|
||||
'T_THEME_PATH' => "{$web_path}styles/" . rawurlencode($user->style['style_path']) . '/theme',
|
||||
'T_TEMPLATE_PATH' => "{$web_path}styles/" . rawurlencode($user->style['style_path']) . '/template',
|
||||
'T_SUPER_TEMPLATE_PATH' => "{$web_path}styles/" . rawurlencode($user->style['style_path']) . '/template',
|
||||
'T_IMAGES_PATH' => "{$web_path}images/",
|
||||
'T_SMILIES_PATH' => "{$web_path}{$config['smilies_path']}/",
|
||||
'T_AVATAR_PATH' => "{$web_path}{$config['avatar_path']}/",
|
||||
@ -4782,16 +4782,16 @@ function page_header($page_title = '', $display_online_list = true, $item_id = 0
|
||||
'T_ICONS_PATH' => "{$web_path}{$config['icons_path']}/",
|
||||
'T_RANKS_PATH' => "{$web_path}{$config['ranks_path']}/",
|
||||
'T_UPLOAD_PATH' => "{$web_path}{$config['upload_path']}/",
|
||||
'T_STYLESHEET_LINK' => "{$web_path}styles/" . rawurlencode($user->theme['style_path']) . '/theme/stylesheet.css?assets_version=' . $config['assets_version'],
|
||||
'T_STYLESHEET_LANG_LINK' => "{$web_path}styles/" . rawurlencode($user->theme['style_path']) . '/theme/' . $user->lang_name . '/stylesheet.css?assets_version=' . $config['assets_version'],
|
||||
'T_STYLESHEET_NAME' => $user->theme['style_name'],
|
||||
'T_STYLESHEET_LINK' => "{$web_path}styles/" . rawurlencode($user->style['style_path']) . '/theme/stylesheet.css?assets_version=' . $config['assets_version'],
|
||||
'T_STYLESHEET_LANG_LINK' => "{$web_path}styles/" . rawurlencode($user->style['style_path']) . '/theme/' . $user->lang_name . '/stylesheet.css?assets_version=' . $config['assets_version'],
|
||||
'T_STYLESHEET_NAME' => $user->style['style_name'],
|
||||
'T_JQUERY_LINK' => ($config['load_jquery_cdn'] && !empty($config['load_jquery_url'])) ? $config['load_jquery_url'] : "{$web_path}assets/javascript/jquery.js?assets_version=" . $config['assets_version'],
|
||||
'S_JQUERY_FALLBACK' => ($config['load_jquery_cdn']) ? true : false,
|
||||
|
||||
'T_THEME_NAME' => rawurlencode($user->theme['style_path']),
|
||||
'T_THEME_NAME' => rawurlencode($user->style['style_path']),
|
||||
'T_THEME_LANG_NAME' => $user->data['user_lang'],
|
||||
'T_TEMPLATE_NAME' => $user->theme['style_path'],
|
||||
'T_SUPER_TEMPLATE_NAME' => rawurlencode((isset($user->theme['style_parent_tree']) && $user->theme['style_parent_tree']) ? $user->theme['style_parent_tree'] : $user->theme['style_path']),
|
||||
'T_TEMPLATE_NAME' => $user->style['style_path'],
|
||||
'T_SUPER_TEMPLATE_NAME' => rawurlencode((isset($user->style['style_parent_tree']) && $user->style['style_parent_tree']) ? $user->style['style_parent_tree'] : $user->style['style_path']),
|
||||
'T_IMAGES' => 'images',
|
||||
'T_SMILIES' => $config['smilies_path'],
|
||||
'T_AVATAR' => $config['avatar_path'],
|
||||
|
@ -89,8 +89,8 @@ class phpbb_style
|
||||
*/
|
||||
public function set_style()
|
||||
{
|
||||
$style_name = $this->user->theme['style_path'];
|
||||
$style_dirs = ($this->user->theme['style_parent_id']) ? array_reverse(explode('/', $this->user->theme['style_parent_tree'])) : array();
|
||||
$style_name = $this->user->style['style_path'];
|
||||
$style_dirs = ($this->user->style['style_parent_id']) ? array_reverse(explode('/', $this->user->style['style_parent_tree'])) : array();
|
||||
$paths = array($this->get_style_path($style_name));
|
||||
foreach ($style_dirs as $dir)
|
||||
{
|
||||
|
@ -27,7 +27,7 @@ class phpbb_user extends phpbb_session
|
||||
{
|
||||
var $lang = array();
|
||||
var $help = array();
|
||||
var $theme = array();
|
||||
var $style = array();
|
||||
var $date_format;
|
||||
var $timezone;
|
||||
var $dst;
|
||||
@ -159,11 +159,11 @@ class phpbb_user extends phpbb_session
|
||||
FROM ' . STYLES_TABLE . " s
|
||||
WHERE s.style_id = $style_id";
|
||||
$result = $db->sql_query($sql, 3600);
|
||||
$this->theme = $db->sql_fetchrow($result);
|
||||
$this->style = $db->sql_fetchrow($result);
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
// User has wrong style
|
||||
if (!$this->theme && $style_id == $this->data['user_style'])
|
||||
if (!$this->style && $style_id == $this->data['user_style'])
|
||||
{
|
||||
$style_id = $this->data['user_style'] = $config['default_style'];
|
||||
|
||||
@ -176,17 +176,17 @@ class phpbb_user extends phpbb_session
|
||||
FROM ' . STYLES_TABLE . " s
|
||||
WHERE s.style_id = $style_id";
|
||||
$result = $db->sql_query($sql, 3600);
|
||||
$this->theme = $db->sql_fetchrow($result);
|
||||
$this->style = $db->sql_fetchrow($result);
|
||||
$db->sql_freeresult($result);
|
||||
}
|
||||
|
||||
if (!$this->theme)
|
||||
if (!$this->style)
|
||||
{
|
||||
trigger_error('Could not get style data', E_USER_ERROR);
|
||||
}
|
||||
|
||||
// Now parse the cfg file and cache it
|
||||
$parsed_items = $cache->obtain_cfg_items($this->theme);
|
||||
$parsed_items = $cache->obtain_cfg_items($this->style);
|
||||
|
||||
$check_for = array(
|
||||
'pagination_sep' => (string) ', '
|
||||
@ -194,12 +194,12 @@ class phpbb_user extends phpbb_session
|
||||
|
||||
foreach ($check_for as $key => $default_value)
|
||||
{
|
||||
$this->theme[$key] = (isset($parsed_items[$key])) ? $parsed_items[$key] : $default_value;
|
||||
settype($this->theme[$key], gettype($default_value));
|
||||
$this->style[$key] = (isset($parsed_items[$key])) ? $parsed_items[$key] : $default_value;
|
||||
settype($this->style[$key], gettype($default_value));
|
||||
|
||||
if (is_string($default_value))
|
||||
{
|
||||
$this->theme[$key] = htmlspecialchars($this->theme[$key]);
|
||||
$this->style[$key] = htmlspecialchars($this->style[$key]);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user