mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-24 19:08:53 +00:00
[feature/extension-manager] Make sure named styles are loaded from root dir
PHPBB3-10323
This commit is contained in:
parent
4d08d769c2
commit
e52022c572
4 changed files with 12 additions and 6 deletions
|
@ -91,11 +91,13 @@ class phpbb_template_extension_path_provider extends phpbb_extension_provider im
|
||||||
* The first element is the main template.
|
* The first element is the main template.
|
||||||
* If the path is false, it will be generated from
|
* If the path is false, it will be generated from
|
||||||
* the supplied name.
|
* the supplied name.
|
||||||
|
* @param string $style_root_path The root directory for styles identified
|
||||||
|
* by name only.
|
||||||
* @return null
|
* @return null
|
||||||
*/
|
*/
|
||||||
public function set_templates(array $templates)
|
public function set_templates(array $templates, $style_root_path)
|
||||||
{
|
{
|
||||||
$this->base_paths->set_templates($templates);
|
$this->base_paths->set_templates($templates, $style_root_path);
|
||||||
$this->items = null;
|
$this->items = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -44,9 +44,11 @@ class phpbb_template_path_provider implements IteratorAggregate, phpbb_template_
|
||||||
* The first element is the main template.
|
* The first element is the main template.
|
||||||
* If the path is false, it will be generated from
|
* If the path is false, it will be generated from
|
||||||
* the supplied name.
|
* the supplied name.
|
||||||
|
* @param string $style_root_path The root directory for styles identified
|
||||||
|
* by name only.
|
||||||
* @return null
|
* @return null
|
||||||
*/
|
*/
|
||||||
public function set_templates(array $templates)
|
public function set_templates(array $templates, $style_root_path)
|
||||||
{
|
{
|
||||||
$this->paths;
|
$this->paths;
|
||||||
|
|
||||||
|
@ -54,7 +56,7 @@ class phpbb_template_path_provider implements IteratorAggregate, phpbb_template_
|
||||||
{
|
{
|
||||||
if (!$path)
|
if (!$path)
|
||||||
{
|
{
|
||||||
$path = $this->template_root_for_style($name);
|
$path = $style_root_path . $this->template_root_for_style($name);
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->paths[] = $path;
|
$this->paths[] = $path;
|
||||||
|
|
|
@ -39,9 +39,11 @@ interface phpbb_template_path_provider_interface extends Traversable
|
||||||
* The first element is the main template.
|
* The first element is the main template.
|
||||||
* If the path is false, it will be generated from
|
* If the path is false, it will be generated from
|
||||||
* the supplied name.
|
* the supplied name.
|
||||||
|
* @param string $style_root_path The root directory for styles identified
|
||||||
|
* by name only.
|
||||||
* @return null
|
* @return null
|
||||||
*/
|
*/
|
||||||
public function set_templates(array $templates);
|
public function set_templates(array $templates, $style_root_path);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieves the path to the main template passed into set_templates()
|
* Retrieves the path to the main template passed into set_templates()
|
||||||
|
|
|
@ -133,7 +133,7 @@ class phpbb_template
|
||||||
$templates[$fallback_template_name] = $fallback_template_path;
|
$templates[$fallback_template_name] = $fallback_template_path;
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->provider->set_templates($templates);
|
$this->provider->set_templates($templates, $this->phpbb_root_path);
|
||||||
$this->locator->set_paths($this->provider);
|
$this->locator->set_paths($this->provider);
|
||||||
$this->locator->set_main_template($this->provider->get_main_template_path());
|
$this->locator->set_main_template($this->provider->get_main_template_path());
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue