aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/phpbb/template
diff options
context:
space:
mode:
authorTristan Darricau <github@nicofuma.fr>2014-05-13 23:22:54 +0200
committerTristan Darricau <github@nicofuma.fr>2014-05-13 23:22:54 +0200
commit300d5c32db82a72309d389860864e5513ca45ce4 (patch)
treef6d1de27fcee6930c5777cb1db0233919454858d /phpBB/phpbb/template
parentbec9b7c34e63c7485477fa1edc2f6330889cc699 (diff)
downloadforums-300d5c32db82a72309d389860864e5513ca45ce4.tar
forums-300d5c32db82a72309d389860864e5513ca45ce4.tar.gz
forums-300d5c32db82a72309d389860864e5513ca45ce4.tar.bz2
forums-300d5c32db82a72309d389860864e5513ca45ce4.tar.xz
forums-300d5c32db82a72309d389860864e5513ca45ce4.zip
[ticket/12509] Add an option to set the path of custom file for extensions
https://tracker.phpbb.com/browse/PHPBB3-12509 PHPBB3-12509
Diffstat (limited to 'phpBB/phpbb/template')
-rw-r--r--phpBB/phpbb/template/twig/twig.php18
1 files changed, 13 insertions, 5 deletions
diff --git a/phpBB/phpbb/template/twig/twig.php b/phpBB/phpbb/template/twig/twig.php
index 83630f5992..9e5a572cb5 100644
--- a/phpBB/phpbb/template/twig/twig.php
+++ b/phpBB/phpbb/template/twig/twig.php
@@ -211,8 +211,8 @@ class twig extends \phpbb\template\base
*
* Note: Templates are still compiled to phpBB's cache directory.
*
- * @param string|array $names Array of names or string of name of template(s) in inheritance tree order, used by extensions.
- * @param string|array or string $paths Array of style paths, relative to current root directory
+ * @param string|array $names Array of names (or detailed names) or string of name of template(s) in inheritance tree order, used by extensions.
+ * @param string|array of string $paths Array of style paths, relative to current root directory
* @return phpbb_template $this
*/
public function set_custom_style($names, $paths)
@@ -234,10 +234,18 @@ class twig extends \phpbb\template\base
$namespace = str_replace('/', '_', $ext_namespace);
$paths = array();
- foreach ($names as $style_name)
+ foreach ($names as $template_dir)
{
- $ext_style_path = $ext_path . 'styles/' . $style_name . '/';
- $ext_style_template_path = $ext_style_path . 'template/';
+ if (is_array($template_dir) && isset($template_dir['ext_path']))
+ {
+ $ext_style_template_path = $ext_path . $template_dir['ext_path'];
+ $ext_style_path = dirname($ext_style_template_path);
+ }
+ else
+ {
+ $ext_style_path = $ext_path . 'styles/' . $template_dir . '/';
+ $ext_style_template_path = $ext_style_path . 'template/';
+ }
if (is_dir($ext_style_template_path))
{