mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-31 05:50:42 +02:00
[ticket/11628] Remove template_path option on set_custom_style
This was set to default 'template/' to append template/ to all the paths, but every location was actually just setting it to '' to not append anything. So removed the option entirely (additional paths can be appended to the paths being sent to the function already) PHPBB3-11628
This commit is contained in:
@@ -57,10 +57,9 @@ interface phpbb_template
|
||||
*
|
||||
* @param string|array $names Array of names or string of name of template(s) in inheritance tree order, used by extensions.
|
||||
* @param array or string $paths Array of style paths, relative to current root directory
|
||||
* @param string $template_path Path to templates, relative to style directory. Default (template/).
|
||||
* @return phpbb_template $this
|
||||
*/
|
||||
public function set_custom_style($names, $paths, $template_path = 'template/');
|
||||
public function set_custom_style($names, $paths);
|
||||
|
||||
/**
|
||||
* Clears all variables and blocks assigned to this template.
|
||||
|
@@ -225,7 +225,7 @@ class phpbb_template_twig implements phpbb_template
|
||||
$this->twig->getLoader()->setPaths($paths, 'core');
|
||||
}
|
||||
|
||||
$this->set_custom_style($names, $paths, '');
|
||||
$this->set_custom_style($names, $paths);
|
||||
|
||||
return $this;
|
||||
}
|
||||
@@ -237,10 +237,9 @@ class phpbb_template_twig implements phpbb_template
|
||||
*
|
||||
* @param string|array $names Array of names or string of name of template(s) in inheritance tree order, used by extensions.
|
||||
* @param array or string $paths Array of style paths, relative to current root directory
|
||||
* @param string $template_path Path to templates, relative to style directory. Default (template/).
|
||||
* @return phpbb_template $this
|
||||
*/
|
||||
public function set_custom_style($names, $paths, $template_path = 'template/')
|
||||
public function set_custom_style($names, $paths)
|
||||
{
|
||||
if (is_string($paths))
|
||||
{
|
||||
@@ -252,14 +251,8 @@ class phpbb_template_twig implements phpbb_template
|
||||
$names = array($names);
|
||||
}
|
||||
|
||||
$style_paths = array();
|
||||
foreach ($paths as $path)
|
||||
{
|
||||
$style_paths[] = $path . '/' . ltrim($template_path, '/');
|
||||
}
|
||||
|
||||
// Set as __main__ namespace
|
||||
$this->twig->getLoader()->setPaths($style_paths);
|
||||
$this->twig->getLoader()->setPaths($paths);
|
||||
|
||||
// Add all namespaces for all extensions
|
||||
if ($this->extension_manager instanceof phpbb_extension_manager)
|
||||
|
Reference in New Issue
Block a user