1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-02 06:51:08 +02:00

[feature/template-events] Handle user access correctly.

Pass through $user from template to filter.

Allow $user to be null for standalone usage of the template engine.

PHPBB3-9550
This commit is contained in:
Oleg Pudeyev
2012-05-10 04:23:18 -04:00
parent 45a1219886
commit 1b36fc3a60
2 changed files with 21 additions and 3 deletions

View File

@@ -40,8 +40,9 @@ class phpbb_template_compile
* @param phpbb_style_resource_locator $locator Resource locator
* @param string $phpbb_root_path Path to phpBB root directory
* @param phpbb_extension_manager $extension_manager Extension manager to use for finding template fragments in extensions; if null, template hooks will not be invoked
* @param phpbb_user $user Current user
*/
public function __construct($allow_php, $template_name, $locator, $phpbb_root_path, $extension_manager = null)
public function __construct($allow_php, $template_name, $locator, $phpbb_root_path, $extension_manager = null, $user = null)
{
$this->filter_params = array(
'allow_php' => $allow_php,
@@ -49,6 +50,7 @@ class phpbb_template_compile
'locator' => $locator,
'phpbb_root_path' => $phpbb_root_path,
'extension_manager' => $extension_manager,
'user' => $user,
'template_compile' => $this,
);
}