mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-12 06:18:52 +00:00
[ticket/14188] Add core.acp_styles_action_before event
PHPBB3-14188
This commit is contained in:
parent
d92a46ef02
commit
20c0b57421
1 changed files with 17 additions and 1 deletions
|
@ -56,9 +56,12 @@ class acp_styles
|
||||||
/** @var string */
|
/** @var string */
|
||||||
protected $php_ext;
|
protected $php_ext;
|
||||||
|
|
||||||
|
/** @var \phpbb\event\dispatcher_interface */
|
||||||
|
protected $dispatcher;
|
||||||
|
|
||||||
public function main($id, $mode)
|
public function main($id, $mode)
|
||||||
{
|
{
|
||||||
global $db, $user, $phpbb_admin_path, $phpbb_root_path, $phpEx, $template, $request, $cache, $auth, $config;
|
global $db, $user, $phpbb_admin_path, $phpbb_root_path, $phpEx, $template, $request, $cache, $auth, $config, $phpbb_dispatcher;
|
||||||
|
|
||||||
$this->db = $db;
|
$this->db = $db;
|
||||||
$this->user = $user;
|
$this->user = $user;
|
||||||
|
@ -69,6 +72,7 @@ class acp_styles
|
||||||
$this->config = $config;
|
$this->config = $config;
|
||||||
$this->phpbb_root_path = $phpbb_root_path;
|
$this->phpbb_root_path = $phpbb_root_path;
|
||||||
$this->php_ext = $phpEx;
|
$this->php_ext = $phpEx;
|
||||||
|
$this->dispatcher = $phpbb_dispatcher;
|
||||||
|
|
||||||
$this->default_style = $config['default_style'];
|
$this->default_style = $config['default_style'];
|
||||||
$this->styles_path = $this->phpbb_root_path . $this->styles_path_absolute . '/';
|
$this->styles_path = $this->phpbb_root_path . $this->styles_path_absolute . '/';
|
||||||
|
@ -118,6 +122,18 @@ class acp_styles
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Run code before ACP styles action execution
|
||||||
|
*
|
||||||
|
* @event core.acp_styles_action_before
|
||||||
|
* @var int id Module ID
|
||||||
|
* @var string mode Active module
|
||||||
|
* @var string action Module that should be run
|
||||||
|
* @since 3.1.7-RC1
|
||||||
|
*/
|
||||||
|
$vars = array('id', 'mode', 'action');
|
||||||
|
extract($this->dispatcher->trigger_event('core.acp_styles_action_before', compact($vars)));
|
||||||
|
|
||||||
// Execute actions
|
// Execute actions
|
||||||
switch ($action)
|
switch ($action)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Reference in a new issue