[feature/extension-manager] Make sure named styles are loaded from root dir

PHPBB3-10323
This commit is contained in:
Nils Adermann 2011-09-01 15:16:21 -04:00
parent 4d08d769c2
commit e52022c572
4 changed files with 12 additions and 6 deletions

View file

@ -91,11 +91,13 @@ class phpbb_template_extension_path_provider extends phpbb_extension_provider im
* The first element is the main template.
* If the path is false, it will be generated from
* the supplied name.
* @param string $style_root_path The root directory for styles identified
* by name only.
* @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;
}

View file

@ -44,9 +44,11 @@ class phpbb_template_path_provider implements IteratorAggregate, phpbb_template_
* The first element is the main template.
* If the path is false, it will be generated from
* the supplied name.
* @param string $style_root_path The root directory for styles identified
* by name only.
* @return null
*/
public function set_templates(array $templates)
public function set_templates(array $templates, $style_root_path)
{
$this->paths;
@ -54,7 +56,7 @@ class phpbb_template_path_provider implements IteratorAggregate, phpbb_template_
{
if (!$path)
{
$path = $this->template_root_for_style($name);
$path = $style_root_path . $this->template_root_for_style($name);
}
$this->paths[] = $path;

View file

@ -39,9 +39,11 @@ interface phpbb_template_path_provider_interface extends Traversable
* The first element is the main template.
* If the path is false, it will be generated from
* the supplied name.
* @param string $style_root_path The root directory for styles identified
* by name only.
* @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()

View file

@ -133,7 +133,7 @@ class phpbb_template
$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_main_template($this->provider->get_main_template_path());