[ticket/10933] Initialize template context when template is constructed.

There is no apparent reason for either initializing or clearing
the context in set_style/set_custom_style.

Initially the initialization there was added in
0501640d5d, for reasons that
presently I do not see.

This permits making context property back private.

PHPBB3-10933
This commit is contained in:
Oleg Pudeyev 2012-06-11 23:11:04 -04:00
parent 000bbfd5b3
commit 8528d8ff34
2 changed files with 2 additions and 3 deletions

View file

@ -124,8 +124,6 @@ class phpbb_style
$this->template->cachepath = $this->phpbb_root_path . 'cache/tpl_' . str_replace('_', '-', $name) . '_';
$this->template->context = new phpbb_template_context();
if ($template_path !== false)
{
$this->template->template_path = $this->locator->template_path = $template_path;

View file

@ -36,7 +36,7 @@ class phpbb_template
* Stores template data used during template rendering.
* @var phpbb_template_context
*/
public $context;
private $context;
/**
* Path of the cache directory for the template
@ -95,6 +95,7 @@ class phpbb_template
$this->user = $user;
$this->locator = $locator;
$this->template_path = $this->locator->template_path;
$this->context = new phpbb_template_context();
}
/**