mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 06:08:52 +00:00
[feature/twig] Add set_style function to controller helper
PHPBB3-11598
This commit is contained in:
parent
36f25ea09b
commit
884a5b06fa
2 changed files with 25 additions and 1 deletions
|
@ -68,6 +68,7 @@ services:
|
||||||
controller.helper:
|
controller.helper:
|
||||||
class: phpbb_controller_helper
|
class: phpbb_controller_helper
|
||||||
arguments:
|
arguments:
|
||||||
|
- @style
|
||||||
- @template
|
- @template
|
||||||
- @user
|
- @user
|
||||||
- %core.root_path%
|
- %core.root_path%
|
||||||
|
|
|
@ -23,6 +23,12 @@ use Symfony\Component\HttpFoundation\Response;
|
||||||
*/
|
*/
|
||||||
class phpbb_controller_helper
|
class phpbb_controller_helper
|
||||||
{
|
{
|
||||||
|
/**
|
||||||
|
* Style object
|
||||||
|
* @var phpbb_style
|
||||||
|
*/
|
||||||
|
protected $style;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Template object
|
* Template object
|
||||||
* @var phpbb_template
|
* @var phpbb_template
|
||||||
|
@ -50,19 +56,36 @@ class phpbb_controller_helper
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
*
|
*
|
||||||
|
* @param phpbb_style $style Style object
|
||||||
* @param phpbb_template $template Template object
|
* @param phpbb_template $template Template object
|
||||||
* @param phpbb_user $user User object
|
* @param phpbb_user $user User object
|
||||||
* @param string $phpbb_root_path phpBB root path
|
* @param string $phpbb_root_path phpBB root path
|
||||||
* @param string $php_ext PHP extension
|
* @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->template = $template;
|
||||||
$this->user = $user;
|
$this->user = $user;
|
||||||
$this->phpbb_root_path = $phpbb_root_path;
|
$this->phpbb_root_path = $phpbb_root_path;
|
||||||
$this->php_ext = $php_ext;
|
$this->php_ext = $php_ext;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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.
|
* Automate setting up the page and creating the response object.
|
||||||
*
|
*
|
||||||
|
|
Loading…
Add table
Reference in a new issue