diff options
author | Joas Schilling <nickvergessen@gmx.de> | 2013-07-13 09:36:24 -0400 |
---|---|---|
committer | Joas Schilling <nickvergessen@gmx.de> | 2013-07-13 09:36:24 -0400 |
commit | 8352a7cadab7e16eb8eac29d869e06864acb1a93 (patch) | |
tree | e78344d1237c9ca6e2d3004e4c6d2916c6514750 /phpBB/includes/controller | |
parent | 28e3341fcde976754f122a9c540b20aa705658fc (diff) | |
parent | b5651c0289054f2f4453806200506968241f9a82 (diff) | |
download | forums-8352a7cadab7e16eb8eac29d869e06864acb1a93.tar forums-8352a7cadab7e16eb8eac29d869e06864acb1a93.tar.gz forums-8352a7cadab7e16eb8eac29d869e06864acb1a93.tar.bz2 forums-8352a7cadab7e16eb8eac29d869e06864acb1a93.tar.xz forums-8352a7cadab7e16eb8eac29d869e06864acb1a93.zip |
Merge remote-tracking branch 'phpbb/develop' into ticket/9657
* phpbb/develop: (216 commits)
[ticket/11626] Remove last reference to template in ldap
[ticket/11626] Remove LDAP dependency on template
[develop-olympus] Increment version number to 3.0.13-dev.
[develop-olympus] Add changelog for 3.0.12 release.
[develop-olympus] Bump version numbers for 3.0.12-RC1 release.
[develop-olympus] Bumping version numbers to final for 3.0.12 releases.
[ticket/11669] Fix PHP bug #55124 (recursive mkdir on /./)
[ticket/11668] Run lint test at the end of the test suite
[ticket/11548] Fix test errors in groups test on develop
[ticket/11548] Check upload avatar URL the same way as in phpBB 3.0
[ticket/11548] Fix incorrect usage of array_map on acp groups page
[ticket/11665] Fix test class name
[ticket/11664] Stop creating php.html file in root path in tests
[ticket/11665] Can't change file names already sent to set_filenames
[ticket/11662] Typos: occured -> occurred
[ticket/11662] Typos: occured -> occurred
[ticket/11660] Fix bugs from bugs in #11651 (missing vars, db->sql_connect)
[feature/auth-refactor] Add parent::setUp() in setUp()
[feature/auth-refactor] Changes
[feature/auth-refactor] DataProvider for acp_board test
...
Diffstat (limited to 'phpBB/includes/controller')
-rw-r--r-- | phpBB/includes/controller/resolver.php | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/phpBB/includes/controller/resolver.php b/phpBB/includes/controller/resolver.php index ee469aa9c8..95dfc8da8e 100644 --- a/phpBB/includes/controller/resolver.php +++ b/phpBB/includes/controller/resolver.php @@ -38,15 +38,23 @@ class phpbb_controller_resolver implements ControllerResolverInterface protected $container; /** + * phpbb_style object + * @var phpbb_style + */ + protected $style; + + /** * Construct method * * @param phpbb_user $user User Object * @param ContainerInterface $container ContainerInterface object + * @param phpbb_style $style */ - public function __construct(phpbb_user $user, ContainerInterface $container) + public function __construct(phpbb_user $user, ContainerInterface $container, phpbb_style $style = null) { $this->user = $user; $this->container = $container; + $this->style = $style; } /** @@ -80,6 +88,24 @@ class phpbb_controller_resolver implements ControllerResolverInterface $controller_object = $this->container->get($service); + /* + * If this is an extension controller, we'll try to automatically set + * the style paths for the extension (the ext author can change them + * if necessary). + */ + $controller_dir = explode('_', get_class($controller_object)); + + // 0 phpbb, 1 ext, 2 vendor, 3 extension name, ... + if (!is_null($this->style) && isset($controller_dir[3]) && $controller_dir[1] === 'ext') + { + $controller_style_dir = 'ext/' . $controller_dir[2] . '/' . $controller_dir[3] . '/styles'; + + if (is_dir($controller_style_dir)) + { + $this->style->set_style(array($controller_style_dir, 'styles')); + } + } + return array($controller_object, $method); } |