mirror of
https://github.com/phpbb/phpbb.git
synced 2025-05-05 23:25:30 +02:00
[feature/template-engine] Use template engine class in bbcode class.
PHPBB3-9726
This commit is contained in:
parent
db257956aa
commit
df46a576e9
@ -128,28 +128,17 @@ class bbcode
|
||||
*/
|
||||
function bbcode_cache_init()
|
||||
{
|
||||
global $phpbb_root_path, $template, $user;
|
||||
global $phpbb_root_path, $phpEx, $template, $config, $user;
|
||||
|
||||
if (empty($this->template_filename))
|
||||
{
|
||||
$this->template_bitfield = new bitfield($user->theme['bbcode_bitfield']);
|
||||
$this->template_filename = $phpbb_root_path . 'styles/' . $user->theme['template_path'] . '/template/bbcode.html';
|
||||
|
||||
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))
|
||||
{
|
||||
trigger_error('The file ' . $this->template_filename . ' is missing.', E_USER_ERROR);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
trigger_error('The file ' . $this->template_filename . ' is missing.', E_USER_ERROR);
|
||||
}
|
||||
}
|
||||
$template = new phpbb_template($phpbb_root_path, $phpEx, $config, $user);
|
||||
$template->set_template();
|
||||
$locator = $template->_get_locator();
|
||||
$locator->set_filenames(array('bbcode.html' => 'bbcode.html'));
|
||||
$this->template_filename = $locator->get_source_file_for_handle('bbcode.html');
|
||||
}
|
||||
|
||||
$bbcode_ids = $rowset = $sql = array();
|
||||
|
@ -493,4 +493,17 @@ class phpbb_template
|
||||
}
|
||||
include($file);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the template locator object.
|
||||
*
|
||||
* This function is public for the benefit of bbcode implementation.
|
||||
* It should not be considered part of template class's public API.
|
||||
*
|
||||
* @return phpbb_template_locator Template locator for this template
|
||||
*/
|
||||
public function _get_locator()
|
||||
{
|
||||
return $this->locator;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user