aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB')
-rw-r--r--phpBB/includes/functions_messenger.php2
-rw-r--r--phpBB/phpbb/template/template.php10
-rw-r--r--phpBB/phpbb/template/twig/twig.php27
3 files changed, 7 insertions, 32 deletions
diff --git a/phpBB/includes/functions_messenger.php b/phpBB/includes/functions_messenger.php
index 0222a57bcc..89dd3c70fc 100644
--- a/phpBB/includes/functions_messenger.php
+++ b/phpBB/includes/functions_messenger.php
@@ -660,7 +660,7 @@ class messenger
{
$this->setup_template();
- $this->template->set_style_names(array($path_name), $paths);
+ $this->template->set_custom_style($path_name, $paths, '');
}
}
diff --git a/phpBB/phpbb/template/template.php b/phpBB/phpbb/template/template.php
index c929934376..8554365c95 100644
--- a/phpBB/phpbb/template/template.php
+++ b/phpBB/phpbb/template/template.php
@@ -63,16 +63,6 @@ interface phpbb_template
public function set_custom_style($names, $paths, $template_path = 'template/');
/**
- * Sets the style names/paths corresponding to style hierarchy being compiled
- * and/or rendered.
- *
- * @param array $style_names List of style names in inheritance tree order
- * @param array $style_paths List of style paths in inheritance tree order
- * @return phpbb_template $this
- */
- public function set_style_names(array $style_names, array $style_paths);
-
- /**
* Clears all variables and blocks assigned to this template.
*
* @return phpbb_template $this
diff --git a/phpBB/phpbb/template/twig/twig.php b/phpBB/phpbb/template/twig/twig.php
index 72ba70ecc4..26f454e972 100644
--- a/phpBB/phpbb/template/twig/twig.php
+++ b/phpBB/phpbb/template/twig/twig.php
@@ -225,7 +225,7 @@ class phpbb_template_twig implements phpbb_template
$this->twig->getLoader()->setPaths($paths, 'core');
}
- $this->set_style_names($names, $paths);
+ $this->set_custom_style($names, $paths, '');
return $this;
}
@@ -247,39 +247,24 @@ class phpbb_template_twig implements phpbb_template
$paths = array($paths);
}
- if (!is_array($names))
+ if (is_string($names))
{
$names = array($names);
}
- $new_paths = array();
+ $style_paths = array();
foreach ($paths as $path)
{
- $new_paths[] = $path . '/' . ltrim($template_path, '/');
+ $style_paths[] = $path . '/' . ltrim($template_path, '/');
}
- $this->set_style_names($names, $new_paths);
-
- return $this;
- }
-
- /**
- * Sets the style names/paths corresponding to style hierarchy being compiled
- * and/or rendered.
- *
- * @param array $style_names List of style names in inheritance tree order
- * @param array $style_paths List of style paths in inheritance tree order
- * @return phpbb_template $this
- */
- public function set_style_names(array $style_names, array $style_paths)
- {
// Set as __main__ namespace
$this->twig->getLoader()->setPaths($style_paths);
// Add all namespaces for all extensions
if ($this->extension_manager instanceof phpbb_extension_manager)
{
- $style_names[] = 'all';
+ $names[] = 'all';
foreach ($this->extension_manager->all_enabled() as $ext_namespace => $ext_path)
{
@@ -287,7 +272,7 @@ class phpbb_template_twig implements phpbb_template
$namespace = str_replace('/', '_', $ext_namespace);
$paths = array();
- foreach ($style_names as $style_name)
+ foreach ($names as $style_name)
{
$ext_style_path = $ext_path . 'styles/' . $style_name . '/template';