[feature/merging-style-components] Updating style initialization

Changing template initialization to style initialization.

PHPBB3-10632
This commit is contained in:
Vjacheslav Trushkin 2012-03-15 21:11:34 +02:00
parent 1ce4d4c4fc
commit fd96f97dc3
6 changed files with 14 additions and 14 deletions

View file

@ -50,9 +50,9 @@ $file_uploads = (@ini_get('file_uploads') == '1' || strtolower(@ini_get('file_up
$module_id = request_var('i', ''); $module_id = request_var('i', '');
$mode = request_var('mode', ''); $mode = request_var('mode', '');
// Set custom template for admin area // Set custom style for admin area
$template->set_ext_dir_prefix('adm/'); $style->set_ext_dir_prefix('adm/');
$template->set_custom_template($phpbb_admin_path . 'style', 'admin'); $style->set_custom_style('admin', $phpbb_admin_path . 'style', '');
$template->assign_var('T_ASSETS_PATH', $phpbb_root_path . 'assets'); $template->assign_var('T_ASSETS_PATH', $phpbb_root_path . 'assets');
$template->assign_var('T_TEMPLATE_PATH', $phpbb_admin_path . 'style'); $template->assign_var('T_TEMPLATE_PATH', $phpbb_admin_path . 'style');

View file

@ -133,8 +133,8 @@ class bbcode
$this->template_bitfield = new bitfield($user->theme['bbcode_bitfield']); $this->template_bitfield = new bitfield($user->theme['bbcode_bitfield']);
$style = new phpbb_style($phpbb_root_path, $phpEx, $config, $user, $phpbb_extension_manager); $style = new phpbb_style($phpbb_root_path, $phpEx, $config, $user, $phpbb_extension_manager);
$style->set_style();
$template = $style->template; $template = $style->template;
$template->set_template();
$template->set_filenames(array('bbcode.html' => 'bbcode.html')); $template->set_filenames(array('bbcode.html' => 'bbcode.html'));
$this->template_filename = $style->locator->get_source_file_for_handle('bbcode.html'); $this->template_filename = $style->locator->get_source_file_for_handle('bbcode.html');
} }

View file

@ -201,7 +201,7 @@ class messenger
{ {
// fall back to board default language if the user's language is // fall back to board default language if the user's language is
// missing $template_file. If this does not exist either, // missing $template_file. If this does not exist either,
// $tpl->set_custom_template will do a trigger_error // $tpl->set_filenames will do a trigger_error
$template_lang = basename($config['default_lang']); $template_lang = basename($config['default_lang']);
} }
@ -209,8 +209,8 @@ class messenger
if (!isset($this->tpl_msg[$template_lang . $template_file])) if (!isset($this->tpl_msg[$template_lang . $template_file]))
{ {
$this->tpl_msg[$template_lang . $template_file] = new phpbb_style($phpbb_root_path, $phpEx, $config, $user, $phpbb_extension_manager); $this->tpl_msg[$template_lang . $template_file] = new phpbb_style($phpbb_root_path, $phpEx, $config, $user, $phpbb_extension_manager);
$tpl = &$this->tpl_msg[$template_lang . $template_file]; $stl = &$this->tpl_msg[$template_lang . $template_file];
$tpl = $tpl->template; $tpl = $stl->template;
$fallback_template_path = false; $fallback_template_path = false;
@ -228,7 +228,7 @@ class messenger
} }
} }
$tpl->set_custom_template($template_path, $template_lang . '_email', $fallback_template_path); $stl->set_custom_style($template_lang . '_email', array($template_path, $fallback_template_path), '');
$tpl->set_filenames(array( $tpl->set_filenames(array(
'body' => $template_file . '.txt', 'body' => $template_file . '.txt',

View file

@ -1570,7 +1570,7 @@ class user extends session
*/ */
function setup($lang_set = false, $style_id = false) function setup($lang_set = false, $style_id = false)
{ {
global $db, $template, $config, $auth, $phpEx, $phpbb_root_path, $cache; global $db, $style, $template, $config, $auth, $phpEx, $phpbb_root_path, $cache;
if ($this->data['user_id'] != ANONYMOUS) if ($this->data['user_id'] != ANONYMOUS)
{ {
@ -1704,7 +1704,7 @@ class user extends session
} }
} }
$template->set_template(); $style->set_style();
$this->img_lang = $this->lang_name; $this->img_lang = $this->lang_name;

View file

@ -202,9 +202,9 @@ $config = new phpbb_config(array(
)); ));
$style = new phpbb_style($phpbb_root_path, $phpEx, $config, $user, false); $style = new phpbb_style($phpbb_root_path, $phpEx, $config, $user, false);
$style->set_ext_dir_prefix('adm/');
$style->set_custom_style('admin', '../adm/style', '');
$template = $style->template; $template = $style->template;
$template->set_ext_dir_prefix('adm/');
$template->set_custom_template('../adm/style', 'admin');
$template->assign_var('T_ASSETS_PATH', '../assets'); $template->assign_var('T_ASSETS_PATH', '../assets');
$template->assign_var('T_TEMPLATE_PATH', '../adm/style'); $template->assign_var('T_TEMPLATE_PATH', '../adm/style');

View file

@ -71,7 +71,7 @@ class install_update extends module
function main($mode, $sub) function main($mode, $sub)
{ {
global $template, $phpEx, $phpbb_root_path, $user, $db, $config, $cache, $auth, $language; global $style, $template, $phpEx, $phpbb_root_path, $user, $db, $config, $cache, $auth, $language;
global $request; global $request;
$this->tpl_name = 'install_update'; $this->tpl_name = 'install_update';
@ -131,7 +131,7 @@ class install_update extends module
} }
// Set custom template again. ;) // Set custom template again. ;)
$template->set_custom_template('../adm/style', 'admin'); $style->set_custom_style('admin', '../adm/style', '');
$template->assign_vars(array( $template->assign_vars(array(
'S_USER_LANG' => $user->lang['USER_LANG'], 'S_USER_LANG' => $user->lang['USER_LANG'],