|
From: Joas S. <nic...@ph...> - 2009-09-16 08:12:38
|
Author: nickvergessen
Date: Wed Sep 16 09:11:52 2009
New Revision: 10150
Log:
Fix #51285 and more issues with template inherence on set_custom_template
Conflict introduced with r9839 and r9823
Authorised by: AcydBurn
Modified:
branches/phpBB-3_0_0/phpBB/includes/bbcode.php
branches/phpBB-3_0_0/phpBB/includes/functions_messenger.php
branches/phpBB-3_0_0/phpBB/includes/template.php
Modified: branches/phpBB-3_0_0/phpBB/includes/bbcode.php
==============================================================================
*** branches/phpBB-3_0_0/phpBB/includes/bbcode.php (original)
--- branches/phpBB-3_0_0/phpBB/includes/bbcode.php Wed Sep 16 09:11:52 2009
***************
*** 128,134 ****
*/
function bbcode_cache_init()
{
! global $user, $phpbb_root_path;
if (empty($this->template_filename))
{
--- 128,134 ----
*/
function bbcode_cache_init()
{
! global $phpbb_root_path, $template, $user;
if (empty($this->template_filename))
{
***************
*** 137,143 ****
if (!@file_exists($this->template_filename))
{
! if (isset($user->theme['template_inherits_id']) && $user->theme['template_inherits_id'])
{
$this->template_filename = $phpbb_root_path . 'styles/' . $user->theme['template_inherit_path'] . '/template/bbcode.html';
if (!@file_exists($this->template_filename))
--- 137,143 ----
if (!@file_exists($this->template_filename))
{
! if (isset($template->orig_tpl_inherits_id) && $template->orig_tpl_inherits_id)
{
$this->template_filename = $phpbb_root_path . 'styles/' . $user->theme['template_inherit_path'] . '/template/bbcode.html';
if (!@file_exists($this->template_filename))
Modified: branches/phpBB-3_0_0/phpBB/includes/functions_messenger.php
==============================================================================
*** branches/phpBB-3_0_0/phpBB/includes/functions_messenger.php (original)
--- branches/phpBB-3_0_0/phpBB/includes/functions_messenger.php Wed Sep 16 09:11:52 2009
***************
*** 199,205 ****
$template_path .= $template_lang . '/email';
}
! $tpl->set_custom_template($template_path, $template_lang . '_email');
$tpl->set_filenames(array(
'body' => $template_file . '.txt',
--- 199,205 ----
$template_path .= $template_lang . '/email';
}
! $tpl->set_custom_template($template_path, $template_lang . '_email', 'email');
$tpl->set_filenames(array(
'body' => $template_file . '.txt',
Modified: branches/phpBB-3_0_0/phpBB/includes/template.php
==============================================================================
*** branches/phpBB-3_0_0/phpBB/includes/template.php (original)
--- branches/phpBB-3_0_0/phpBB/includes/template.php Wed Sep 16 09:11:52 2009
***************
*** 90,96 ****
* Set custom template location (able to use directory outside of phpBB)
* @access public
*/
! function set_custom_template($template_path, $template_name)
{
global $phpbb_root_path, $user;
--- 90,96 ----
* Set custom template location (able to use directory outside of phpBB)
* @access public
*/
! function set_custom_template($template_path, $template_name, $template_mode = 'template')
{
global $phpbb_root_path, $user;
***************
*** 102,109 ****
$this->root = $template_path;
$this->cachepath = $phpbb_root_path . 'cache/ctpl_' . str_replace('_', '-', $template_name) . '_';
! $user->theme['template_storedb'] = false;
! $user->theme['template_inherits_id'] = false;
$this->_rootref = &$this->_tpldata['.'][0];
--- 102,114 ----
$this->root = $template_path;
$this->cachepath = $phpbb_root_path . 'cache/ctpl_' . str_replace('_', '-', $template_name) . '_';
!
! // As the template-engine is used for more than the template (emails, etc.), we should not set $user->theme in all cases, but only on the real template.
! if ($template_mode == 'template')
! {
! $user->theme['template_storedb'] = false;
! $user->theme['template_inherits_id'] = false;
! }
$this->_rootref = &$this->_tpldata['.'][0];
|