From 911831a9c5d7971ec8c6155360115246c9a871e0 Mon Sep 17 00:00:00 2001 From: Tristan Darricau Date: Sun, 5 Oct 2014 18:39:23 +0200 Subject: [ticket/13133] Allow @vendor_name for includecss PHPBB3-13133 --- phpBB/phpbb/template/twig/twig.php | 32 ++++++++++++++++++++++++++++---- 1 file changed, 28 insertions(+), 4 deletions(-) (limited to 'phpBB/phpbb/template') diff --git a/phpBB/phpbb/template/twig/twig.php b/phpBB/phpbb/template/twig/twig.php index a3b002f350..84d5450d98 100644 --- a/phpBB/phpbb/template/twig/twig.php +++ b/phpBB/phpbb/template/twig/twig.php @@ -189,13 +189,24 @@ class twig extends \phpbb\template\base { $path = $this->phpbb_root_path . trim($directory, '/') . "/{$name}/"; $template_path = $path . 'template/'; + $theme_path = $path . 'theme/'; + $ok = false; if (is_dir($template_path)) + { + $ok = true; + $paths[] = $template_path; + } + if (is_dir($theme_path)) + { + $ok = true; + $paths[] = $theme_path; + } + + if ($ok) { // Add the base style directory as a safe directory $this->twig->getLoader()->addSafeDirectory($path); - - $paths[] = $template_path; } } } @@ -253,25 +264,38 @@ class twig extends \phpbb\template\base { $ext_style_template_path = $ext_path . $template_dir['ext_path']; $ext_style_path = dirname($ext_style_template_path); + $ext_style_theme_path = $ext_style_path . 'theme/'; } else { $ext_style_path = $ext_path . 'styles/' . $template_dir['name'] . '/'; $ext_style_template_path = $ext_style_path . 'template/'; + $ext_style_theme_path = $ext_style_path . 'theme/'; } } else { $ext_style_path = $ext_path . 'styles/' . $template_dir . '/'; $ext_style_template_path = $ext_style_path . 'template/'; + $ext_style_theme_path = $ext_style_path . 'theme/'; } + $ok = false; if (is_dir($ext_style_template_path)) + { + $ok = true; + $paths[] = $ext_style_template_path; + } + if (is_dir($ext_style_theme_path)) + { + $ok = true; + $paths[] = $ext_style_theme_path; + } + + if ($ok) { // Add the base style directory as a safe directory $this->twig->getLoader()->addSafeDirectory($ext_style_path); - - $paths[] = $ext_style_template_path; } } -- cgit v1.2.1 From 4522db76247b1a4f81a11869e06a7bfc0e64bc5e Mon Sep 17 00:00:00 2001 From: Jakub Senko Date: Sat, 1 Nov 2014 12:31:58 +0100 Subject: [ticket/13266] Enable twig dump function PHPBB3-13266 --- phpBB/phpbb/template/twig/twig.php | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'phpBB/phpbb/template') diff --git a/phpBB/phpbb/template/twig/twig.php b/phpBB/phpbb/template/twig/twig.php index a3b002f350..4d9ca44007 100644 --- a/phpBB/phpbb/template/twig/twig.php +++ b/phpBB/phpbb/template/twig/twig.php @@ -115,6 +115,11 @@ class twig extends \phpbb\template\base ) ); + if (defined('DEBUG')) + { + $this->twig->addExtension(new \Twig_Extension_Debug()); + } + $lexer = new \phpbb\template\twig\lexer($this->twig); $this->twig->setLexer($lexer); -- cgit v1.2.1 From 9aa8f44489d5a94368e2e30bfa73c1278abfcce7 Mon Sep 17 00:00:00 2001 From: Tristan Darricau Date: Fri, 7 Nov 2014 15:57:31 +0100 Subject: [ticket/13133] Rename $ok variable PHPBB3-13133 --- phpBB/phpbb/template/twig/twig.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'phpBB/phpbb/template') diff --git a/phpBB/phpbb/template/twig/twig.php b/phpBB/phpbb/template/twig/twig.php index 84d5450d98..5b71bb5e8a 100644 --- a/phpBB/phpbb/template/twig/twig.php +++ b/phpBB/phpbb/template/twig/twig.php @@ -191,19 +191,19 @@ class twig extends \phpbb\template\base $template_path = $path . 'template/'; $theme_path = $path . 'theme/'; - $ok = false; + $is_valid_dir = false; if (is_dir($template_path)) { - $ok = true; + $is_valid_dir = true; $paths[] = $template_path; } if (is_dir($theme_path)) { - $ok = true; + $is_valid_dir = true; $paths[] = $theme_path; } - if ($ok) + if ($is_valid_dir) { // Add the base style directory as a safe directory $this->twig->getLoader()->addSafeDirectory($path); -- cgit v1.2.1 From 41966c481fd0b9a9414f670c0297cdd5dd9ce60d Mon Sep 17 00:00:00 2001 From: Matt Friedman Date: Tue, 20 Jan 2015 14:21:02 -0800 Subject: [ticket/13133] Fix variable name in set_custom_style() PHPBB3-13133 --- phpBB/phpbb/template/twig/twig.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'phpBB/phpbb/template') diff --git a/phpBB/phpbb/template/twig/twig.php b/phpBB/phpbb/template/twig/twig.php index db3a8e3571..bd754d9bbd 100644 --- a/phpBB/phpbb/template/twig/twig.php +++ b/phpBB/phpbb/template/twig/twig.php @@ -285,19 +285,19 @@ class twig extends \phpbb\template\base $ext_style_theme_path = $ext_style_path . 'theme/'; } - $ok = false; + $is_valid_dir = false; if (is_dir($ext_style_template_path)) { - $ok = true; + $is_valid_dir = true; $paths[] = $ext_style_template_path; } if (is_dir($ext_style_theme_path)) { - $ok = true; + $is_valid_dir = true; $paths[] = $ext_style_theme_path; } - if ($ok) + if ($is_valid_dir) { // Add the base style directory as a safe directory $this->twig->getLoader()->addSafeDirectory($ext_style_path); -- cgit v1.2.1