Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ticket/14188] Add core.acp_styles_action_before event #3922

Merged
merged 1 commit into from Oct 12, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
18 changes: 17 additions & 1 deletion phpBB/includes/acp/acp_styles.php
Expand Up @@ -56,9 +56,12 @@ class acp_styles
/** @var string */
protected $php_ext;

/** @var \phpbb\event\dispatcher_interface */
protected $dispatcher;

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->user = $user;
Expand All @@ -69,6 +72,7 @@ public function main($id, $mode)
$this->config = $config;
$this->phpbb_root_path = $phpbb_root_path;
$this->php_ext = $phpEx;
$this->dispatcher = $phpbb_dispatcher;

$this->default_style = $config['default_style'];
$this->styles_path = $this->phpbb_root_path . $this->styles_path_absolute . '/';
Expand Down Expand Up @@ -118,6 +122,18 @@ public function main($id, $mode)
)
);

/**
* 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
switch ($action)
{
Expand Down