base_path_provider = $base_path_provider; } /** * Sets a prefix for style paths searched within extensions. * * The prefix is inserted between the extension's path e.g. ext/foo/ and * the looked up style path, e.g. styles/bar/. So it should not have a * leading slash, but should have a trailing slash. * * @param string $ext_dir_prefix The prefix including trailing slash * @return null */ public function set_ext_dir_prefix($ext_dir_prefix) { $this->ext_dir_prefix = $ext_dir_prefix; } /** * Finds style paths using the extension manager * * Locates a path (e.g. styles/prosilver/) in all active extensions. * Then appends the core style paths based in the current working * directory. * * @return array List of style paths */ public function find() { $directories = array(); $finder = $this->extension_manager->get_finder(); foreach ($this->base_path_provider as $path) { if ($path && !phpbb_is_absolute($path)) { $directories = array_merge($directories, $finder ->directory('/' . $this->ext_dir_prefix . $path) ->get_directories() ); } } foreach ($this->base_path_provider as $path) { $directories[] = $path; } return $directories; } /** * Overwrites the current style paths * * @param array $styles An array of style paths. The first element is the main style. * @return null */ public function set_styles(array $styles) { $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(); } }