aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/phpbb
diff options
context:
space:
mode:
authorNathaniel Guse <nathaniel.guse@gmail.com>2013-07-24 13:04:27 -0500
committerNathaniel Guse <nathaniel.guse@gmail.com>2013-07-24 13:05:27 -0500
commit44142782095f4a847e575dde40faef867c704220 (patch)
treee4448bb67acb6d267266f54aebfb3eaf001e6fb0 /phpBB/phpbb
parent67627f3336f7a90a7de67427d25c8cdd43d74f6e (diff)
downloadforums-44142782095f4a847e575dde40faef867c704220.tar
forums-44142782095f4a847e575dde40faef867c704220.tar.gz
forums-44142782095f4a847e575dde40faef867c704220.tar.bz2
forums-44142782095f4a847e575dde40faef867c704220.tar.xz
forums-44142782095f4a847e575dde40faef867c704220.zip
[ticket/11628] Set admin namespace in the constructor
PHPBB3-11628
Diffstat (limited to 'phpBB/phpbb')
-rw-r--r--phpBB/phpbb/template/twig/twig.php19
1 files changed, 6 insertions, 13 deletions
diff --git a/phpBB/phpbb/template/twig/twig.php b/phpBB/phpbb/template/twig/twig.php
index 5537b1195c..72ba70ecc4 100644
--- a/phpBB/phpbb/template/twig/twig.php
+++ b/phpBB/phpbb/template/twig/twig.php
@@ -44,12 +44,6 @@ class phpbb_template_twig implements phpbb_template
protected $phpbb_root_path;
/**
- * adm relative path
- * @var string
- */
- protected $adm_relative_path;
-
- /**
* PHP file extension
* @var string
*/
@@ -102,7 +96,6 @@ class phpbb_template_twig implements phpbb_template
public function __construct($phpbb_root_path, $php_ext, $config, $user, phpbb_template_context $context, phpbb_extension_manager $extension_manager = null, $adm_relative_path = null)
{
$this->phpbb_root_path = $phpbb_root_path;
- $this->adm_relative_path = $adm_relative_path;
$this->php_ext = $php_ext;
$this->config = $config;
$this->user = $user;
@@ -137,6 +130,12 @@ class phpbb_template_twig implements phpbb_template
$lexer = new phpbb_template_twig_lexer($this->twig);
$this->twig->setLexer($lexer);
+
+ // Add admin namespace
+ if ($adm_relative_path !== null && is_dir($this->phpbb_root_path . $adm_relative_path . 'style/'))
+ {
+ $this->twig->getLoader()->setPaths($this->phpbb_root_path . $adm_relative_path . 'style/', 'admin');
+ }
}
/**
@@ -277,12 +276,6 @@ class phpbb_template_twig implements phpbb_template
// Set as __main__ namespace
$this->twig->getLoader()->setPaths($style_paths);
- // Add admin namespace
- if (is_dir($this->phpbb_root_path . $this->adm_relative_path . 'style/'))
- {
- $this->twig->getLoader()->setPaths($this->phpbb_root_path . $this->adm_relative_path . 'style/', 'admin');
- }
-
// Add all namespaces for all extensions
if ($this->extension_manager instanceof phpbb_extension_manager)
{