1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-07 17:27:16 +02:00

[ticket/10735] Changing locator paths structure

Changing locator paths to 2 dimensional array

PHPBB3-10735
This commit is contained in:
Vjacheslav Trushkin
2012-03-31 21:20:18 +03:00
parent 7e2f16aafa
commit b3f46b9565
6 changed files with 62 additions and 85 deletions

View File

@@ -82,22 +82,26 @@ class phpbb_style_extension_path_provider extends phpbb_extension_provider imple
$directories = array();
$finder = $this->extension_manager->get_finder();
foreach ($this->base_path_provider as $path)
foreach ($this->base_path_provider as $key => $paths)
{
if ($path && !phpbb_is_absolute($path))
if ($key == 'style')
{
$directories = array_merge($directories, $finder
->directory('/' . $this->ext_dir_prefix . $path)
->get_directories()
);
foreach ($paths as $path)
{
$directories['style'][] = $path;
if ($path && !phpbb_is_absolute($path))
{
$result = $finder->directory('/' . $this->ext_dir_prefix . $path)
->get_directories(true, true);
foreach ($result as $ext => $ext_path)
{
$directories[$ext][] = $ext_path;
}
}
}
}
}
foreach ($this->base_path_provider as $path)
{
$directories[] = $path;
}
return $directories;
}
@@ -112,14 +116,4 @@ class phpbb_style_extension_path_provider extends phpbb_extension_provider imple
$this->base_path_provider->set_styles($styles);
$this->items = null;
}
/**
* Retrieves the path to the main style passed into set_styles()
*
* @return string Main style path
*/
public function get_main_style_path()
{
return $this->base_path_provider->get_main_style_path();
}
}