1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-02-24 12:03:21 +01:00

[ticket/11628] Remove set_style_names function, moved to set_custom_style

PHPBB3-11628
This commit is contained in:
Nathaniel Guse 2013-07-24 13:19:20 -05:00
parent 4414278209
commit 863592a8be
3 changed files with 7 additions and 32 deletions

View File

@ -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, '');
}
}

View File

@ -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.
*

View File

@ -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';