2011-08-30 01:32:11 -04:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
*
|
|
|
|
* @package phpBB3
|
|
|
|
* @copyright (c) 2011 phpBB Group
|
2011-12-31 13:32:52 +00:00
|
|
|
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
|
2011-08-30 01:32:11 -04:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @ignore
|
|
|
|
*/
|
|
|
|
if (!defined('IN_PHPBB'))
|
|
|
|
{
|
|
|
|
exit;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2012-03-15 21:04:27 +02:00
|
|
|
* Provides a style resource locator with paths
|
2011-08-30 01:32:11 -04:00
|
|
|
*
|
2012-03-15 21:04:27 +02:00
|
|
|
* Finds installed style paths and makes them available to the resource locator.
|
2011-08-30 01:32:11 -04:00
|
|
|
*
|
|
|
|
* @package phpBB3
|
|
|
|
*/
|
2012-03-14 23:12:11 +02:00
|
|
|
class phpbb_style_path_provider implements IteratorAggregate, phpbb_style_path_provider_interface
|
2011-08-30 01:32:11 -04:00
|
|
|
{
|
2011-08-31 17:49:48 -04:00
|
|
|
protected $paths = array();
|
2011-08-30 01:32:11 -04:00
|
|
|
|
|
|
|
/**
|
2011-08-31 17:49:48 -04:00
|
|
|
* Ignores the extension dir prefix
|
2011-08-30 01:32:11 -04:00
|
|
|
*
|
|
|
|
* @param string $ext_dir_prefix The prefix including trailing slash
|
|
|
|
* @return null
|
|
|
|
*/
|
|
|
|
public function set_ext_dir_prefix($ext_dir_prefix)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2012-03-15 21:04:27 +02:00
|
|
|
* Overwrites the current style paths
|
2011-08-30 01:32:11 -04:00
|
|
|
*
|
2012-03-15 21:04:27 +02:00
|
|
|
* The first element of the passed styles map, is considered the main
|
2012-03-31 21:20:18 +03:00
|
|
|
* style.
|
2011-11-18 15:29:32 +01:00
|
|
|
*
|
2012-03-15 21:04:27 +02:00
|
|
|
* @param array $styles An array of style paths. The first element is the main style.
|
2011-08-30 01:32:11 -04:00
|
|
|
* @return null
|
|
|
|
*/
|
2012-03-15 21:04:27 +02:00
|
|
|
public function set_styles(array $styles)
|
2011-08-30 01:32:11 -04:00
|
|
|
{
|
2012-03-31 21:20:18 +03:00
|
|
|
$this->paths = array('style' => $styles);
|
2011-08-30 01:32:11 -04:00
|
|
|
}
|
2011-08-31 17:49:48 -04:00
|
|
|
|
|
|
|
/**
|
2012-03-15 21:04:27 +02:00
|
|
|
* Retrieve an iterator over all style paths
|
2011-08-31 17:49:48 -04:00
|
|
|
*
|
2012-03-15 21:04:27 +02:00
|
|
|
* @return ArrayIterator An iterator for the array of style paths
|
2011-08-31 17:49:48 -04:00
|
|
|
*/
|
|
|
|
public function getIterator()
|
|
|
|
{
|
|
|
|
return new ArrayIterator($this->paths);
|
|
|
|
}
|
2011-08-30 01:32:11 -04:00
|
|
|
}
|