1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-07 09:16:55 +02:00

[ticket/11832] Fix INCLUDE(JS/CSS)

PHPBB3-11832
This commit is contained in:
Nathan Guse
2013-09-13 10:58:03 -05:00
parent 21624e79fc
commit b4a374dc73
21 changed files with 170 additions and 41 deletions

View File

@@ -23,9 +23,15 @@ class phpbb_template_twig_environment extends Twig_Environment
/** @var phpbb_config */
protected $phpbb_config;
/** @var phpbb_filesystem */
protected $phpbb_filesystem;
/** @var string */
protected $phpbb_root_path;
/** @var string */
protected $web_root_path;
/** @var array **/
protected $namespace_look_up_order = array('__main__');
@@ -38,11 +44,14 @@ class phpbb_template_twig_environment extends Twig_Environment
* @param Twig_LoaderInterface $loader
* @param array $options Array of options to pass to Twig
*/
public function __construct($phpbb_config, $phpbb_extensions, $phpbb_root_path, Twig_LoaderInterface $loader = null, $options = array())
public function __construct($phpbb_config, $phpbb_extensions, phpbb_filesystem $phpbb_filesystem, Twig_LoaderInterface $loader = null, $options = array())
{
$this->phpbb_config = $phpbb_config;
$this->phpbb_extensions = $phpbb_extensions;
$this->phpbb_root_path = $phpbb_root_path;
$this->phpbb_filesystem = $phpbb_filesystem;
$this->phpbb_root_path = $this->phpbb_filesystem->get_phpbb_root_path();
$this->web_root_path = $this->phpbb_filesystem->get_web_root_path();
return parent::__construct($loader, $options);
}
@@ -79,6 +88,26 @@ class phpbb_template_twig_environment extends Twig_Environment
return $this->phpbb_root_path;
}
/**
* Get the web root path
*
* @return string
*/
public function get_web_root_path()
{
return $this->web_root_path;
}
/**
* Get the phpbb_filesystem object
*
* @return phpbb_filesystem
*/
public function get_filesystem()
{
return $this->phpbb_filesystem;
}
/**
* Get the namespace look up order
*