From 863592a8bedbacf3e7bf6bee458797e819020e6f Mon Sep 17 00:00:00 2001 From: Nathaniel Guse Date: Wed, 24 Jul 2013 13:19:20 -0500 Subject: [ticket/11628] Remove set_style_names function, moved to set_custom_style PHPBB3-11628 --- phpBB/phpbb/template/template.php | 10 ---------- phpBB/phpbb/template/twig/twig.php | 27 ++++++--------------------- 2 files changed, 6 insertions(+), 31 deletions(-) (limited to 'phpBB/phpbb') 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 @@ -62,16 +62,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. * 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'; -- cgit v1.2.1