From 3bfd87cda4e77479dd47cadc09f27956f35cd78a Mon Sep 17 00:00:00 2001 From: Oliver Schramm Date: Sun, 11 Jan 2015 19:14:25 +0100 Subject: [PATCH] [ticket/13313] Add event core.acp_email_display PHPBB3-13313 --- phpBB/includes/acp/acp_email.php | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/phpBB/includes/acp/acp_email.php b/phpBB/includes/acp/acp_email.php index fcc2bd7641..dc48171fe3 100644 --- a/phpBB/includes/acp/acp_email.php +++ b/phpBB/includes/acp/acp_email.php @@ -314,7 +314,7 @@ class acp_email $s_priority_options .= ''; $s_priority_options .= ''; - $template->assign_vars(array( + $template_data = array( 'S_WARNING' => (sizeof($error)) ? true : false, 'WARNING_MSG' => (sizeof($error)) ? implode('
', $error) : '', 'U_ACTION' => $this->u_action, @@ -323,8 +323,22 @@ class acp_email 'U_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&form=acp_email&field=usernames'), 'SUBJECT' => $subject, 'MESSAGE' => $message, - 'S_PRIORITY_OPTIONS' => $s_priority_options) + 'S_PRIORITY_OPTIONS' => $s_priority_options, ); + /** + * Modify custom email template data before we display the form + * + * @event core.acp_email_display + * @var array template_data Array with template data assigned to email template + * @var array exclude Array with groups which are excluded from group selection + * @var array usernames Usernames which will be displayed in form + * + * @since 3.1.3-RC1 + */ + $vars = array('template_data', 'exclude', 'usernames'); + extract($phpbb_dispatcher->trigger_event('core.acp_email_display', compact($vars))); + + $template->assign_vars($template_data); } }