From d28d90bd905152456bd2bad2f694f9ee1337b5af Mon Sep 17 00:00:00 2001 From: Kailey Truscott Date: Thu, 19 Feb 2015 20:50:51 -0500 Subject: [PATCH 1/3] [ticket/13637] Add core.ucp_pm_compose_alter_vars PHP event Add a new PHP event to ucp_pm_compose to alter the default vars PHPBB3-13637 --- phpBB/includes/ucp/ucp_pm_compose.php | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/phpBB/includes/ucp/ucp_pm_compose.php b/phpBB/includes/ucp/ucp_pm_compose.php index f3b59186a6..d3b82c4448 100644 --- a/phpBB/includes/ucp/ucp_pm_compose.php +++ b/phpBB/includes/ucp/ucp_pm_compose.php @@ -90,6 +90,32 @@ function compose_pm($id, $mode, $action, $user_folders = array()) // we include the language file here $user->add_lang('viewtopic'); + /** + * Modify the default vars before composing a PM + * + * @event core.ucp_pm_compose_alter_vars + * @var int msg_id topic_id in the page request + * @var int to_user_id The id of whom the message is to + * @var int to_group_id The id of the group whom the message is to + * @var bool submit Whether the user is sending the PM or not + * @var bool preview Whether the user is previewing the PM or not + * @var string action One of: post, reply, quote, forward, quotepost, edit, delete, smilies + * @var bool delete Whether the user is deleting the PM + * @var int reply_to_all Value of reply_to_all request variable. + * @since 3.1.4-RC1 + */ + $vars = array( + 'msg_id', + 'to_user_id', + 'to_group_id', + 'submit', + 'preview', + 'action', + 'delete', + 'reply_to_all', + ); + extract($phpbb_dispatcher->trigger_event('core.ucp_pm_compose_alter_vars', compact($vars))); + // Output PM_TO box if message composing if ($action != 'edit') { From b8c388f1841e8e83e674ca46321298394d477350 Mon Sep 17 00:00:00 2001 From: Kailey Truscott Date: Fri, 20 Feb 2015 20:36:17 -0500 Subject: [PATCH 2/3] [ticket/13637] Update event name and docblock Update the event name to core.ucp_pm_compose_modify_data Change description of to_group_id and submit dockblock PHPBB3-13637 --- phpBB/includes/ucp/ucp_pm_compose.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/phpBB/includes/ucp/ucp_pm_compose.php b/phpBB/includes/ucp/ucp_pm_compose.php index d3b82c4448..c5d87553e0 100644 --- a/phpBB/includes/ucp/ucp_pm_compose.php +++ b/phpBB/includes/ucp/ucp_pm_compose.php @@ -93,11 +93,11 @@ function compose_pm($id, $mode, $action, $user_folders = array()) /** * Modify the default vars before composing a PM * - * @event core.ucp_pm_compose_alter_vars + * @event core.ucp_pm_compose_modify_data * @var int msg_id topic_id in the page request * @var int to_user_id The id of whom the message is to - * @var int to_group_id The id of the group whom the message is to - * @var bool submit Whether the user is sending the PM or not + * @var int to_group_id The id of the group the message is to + * @var bool submit Whether the form has been submitted * @var bool preview Whether the user is previewing the PM or not * @var string action One of: post, reply, quote, forward, quotepost, edit, delete, smilies * @var bool delete Whether the user is deleting the PM @@ -114,7 +114,7 @@ function compose_pm($id, $mode, $action, $user_folders = array()) 'delete', 'reply_to_all', ); - extract($phpbb_dispatcher->trigger_event('core.ucp_pm_compose_alter_vars', compact($vars))); + extract($phpbb_dispatcher->trigger_event('core.ucp_pm_compose_modify_data', compact($vars))); // Output PM_TO box if message composing if ($action != 'edit') From 0f13635fb86fbe97f4f371f04b42fb7af6ba85a6 Mon Sep 17 00:00:00 2001 From: Kailey Truscott Date: Thu, 5 Mar 2015 13:28:19 -0500 Subject: [PATCH 3/3] [ticket/13637] Update msg_id docblock Change topic_id to post_id PHPBB3-13637 --- phpBB/includes/ucp/ucp_pm_compose.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/includes/ucp/ucp_pm_compose.php b/phpBB/includes/ucp/ucp_pm_compose.php index c5d87553e0..51018e3a5d 100644 --- a/phpBB/includes/ucp/ucp_pm_compose.php +++ b/phpBB/includes/ucp/ucp_pm_compose.php @@ -94,7 +94,7 @@ function compose_pm($id, $mode, $action, $user_folders = array()) * Modify the default vars before composing a PM * * @event core.ucp_pm_compose_modify_data - * @var int msg_id topic_id in the page request + * @var int msg_id post_id in the page request * @var int to_user_id The id of whom the message is to * @var int to_group_id The id of the group the message is to * @var bool submit Whether the form has been submitted