From 357e5a567d91c0c1a869175650ab991b57355490 Mon Sep 17 00:00:00 2001 From: 3D-I Date: Mon, 21 Jan 2019 17:38:44 +0100 Subject: [PATCH 1/2] [ticket/15948] Add core.mcp_change_topic_type_after/before PHPBB3-15948 --- phpBB/includes/mcp/mcp_main.php | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/phpBB/includes/mcp/mcp_main.php b/phpBB/includes/mcp/mcp_main.php index 196d2f995f..be38da6e7e 100644 --- a/phpBB/includes/mcp/mcp_main.php +++ b/phpBB/includes/mcp/mcp_main.php @@ -414,6 +414,23 @@ function change_topic_type($action, $topic_ids) if (confirm_box(true)) { + /** + * Perform additional actions before changing topic(s) type + * + * @event core.mcp_change_topic_type_before + * @var int new_topic_type The candidated topic type. + * @var int forum_id The forum ID for the topic ID(s). + * @var array topic_ids Array containing the topic ID(s) that will be changed + * @since 3.2.6-RC1 + */ + $vars = array( + 'new_topic_type', + 'forum_id', + 'topic_ids', + ); + + extract($phpbb_dispatcher->trigger_event('core.mcp_change_topic_type_before', compact($vars))); + $sql = 'UPDATE ' . TOPICS_TABLE . " SET topic_type = $new_topic_type WHERE " . $db->sql_in_set('topic_id', $topic_ids); @@ -448,6 +465,22 @@ function change_topic_type($action, $topic_ids) } } + /** + * Perform additional actions after changing topic types + * + * @event core.mcp_change_topic_type_after + * @var int new_topic_type The newly changed topic type. + * @var int forum_id The forum ID where the newly changed topic type belongs to. + * @var array topic_ids Array containing the topic IDs that have been changed + * @since 3.2.6-RC1 + */ + $vars = array( + 'new_topic_type', + 'forum_id', + 'topic_ids', + ); + extract($phpbb_dispatcher->trigger_event('core.mcp_change_topic_type_after', compact($vars))); + meta_refresh(2, $redirect); $message = $user->lang[$success_msg]; From 6c1664f6d3b85c1b4d620870444c8f4b82b08e57 Mon Sep 17 00:00:00 2001 From: 3D-I Date: Mon, 21 Jan 2019 18:18:45 +0100 Subject: [PATCH 2/2] [ticket/15948] Add core.mcp_change_topic_type_after/before PHPBB3-15948 --- phpBB/includes/mcp/mcp_main.php | 1 - 1 file changed, 1 deletion(-) diff --git a/phpBB/includes/mcp/mcp_main.php b/phpBB/includes/mcp/mcp_main.php index be38da6e7e..5319d1560b 100644 --- a/phpBB/includes/mcp/mcp_main.php +++ b/phpBB/includes/mcp/mcp_main.php @@ -428,7 +428,6 @@ function change_topic_type($action, $topic_ids) 'forum_id', 'topic_ids', ); - extract($phpbb_dispatcher->trigger_event('core.mcp_change_topic_type_before', compact($vars))); $sql = 'UPDATE ' . TOPICS_TABLE . "