diff options
author | Nathaniel Guse <nathaniel.guse@gmail.com> | 2013-07-04 10:13:05 -0500 |
---|---|---|
committer | Nathaniel Guse <nathaniel.guse@gmail.com> | 2013-07-04 10:13:05 -0500 |
commit | 884a5b06fa2e300285a67885d0652d201c7a330a (patch) | |
tree | 782ff0a2f77d6026dfd897809596303d0181f257 /phpBB/includes/controller | |
parent | 36f25ea09bd42de7bc705332edc5ce3c402bd844 (diff) | |
download | forums-884a5b06fa2e300285a67885d0652d201c7a330a.tar forums-884a5b06fa2e300285a67885d0652d201c7a330a.tar.gz forums-884a5b06fa2e300285a67885d0652d201c7a330a.tar.bz2 forums-884a5b06fa2e300285a67885d0652d201c7a330a.tar.xz forums-884a5b06fa2e300285a67885d0652d201c7a330a.zip |
[feature/twig] Add set_style function to controller helper
PHPBB3-11598
Diffstat (limited to 'phpBB/includes/controller')
-rw-r--r-- | phpBB/includes/controller/helper.php | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/phpBB/includes/controller/helper.php b/phpBB/includes/controller/helper.php index 74410ddfd1..ec09757a5d 100644 --- a/phpBB/includes/controller/helper.php +++ b/phpBB/includes/controller/helper.php @@ -24,6 +24,12 @@ use Symfony\Component\HttpFoundation\Response; class phpbb_controller_helper { /** + * Style object + * @var phpbb_style + */ + protected $style; + + /** * Template object * @var phpbb_template */ @@ -50,13 +56,15 @@ class phpbb_controller_helper /** * Constructor * + * @param phpbb_style $style Style object * @param phpbb_template $template Template object * @param phpbb_user $user User object * @param string $phpbb_root_path phpBB root path * @param string $php_ext PHP extension */ - public function __construct(phpbb_template $template, phpbb_user $user, $phpbb_root_path, $php_ext) + public function __construct(phpbb_style $style, phpbb_template $template, phpbb_user $user, $phpbb_root_path, $php_ext) { + $this->style = $style; $this->template = $template; $this->user = $user; $this->phpbb_root_path = $phpbb_root_path; @@ -64,6 +72,21 @@ class phpbb_controller_helper } /** + * Set style location based on (current) user's chosen style. + * + * @param array $style_directories The directories to add style paths for + * E.g. array('ext/foo/bar/styles', 'styles') + * Default: array('styles') (phpBB's style directory) + * @return phpbb_controller_helper $this + */ + public function set_style($style_base_directory = array('styles')) + { + $this->style->set_style($style_base_directory); + + return $this; + } + + /** * Automate setting up the page and creating the response object. * * @param string $handle The template handle to render |