aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoroxcom <andrii@crytek.de>2019-08-30 09:07:20 +0200
committeroxcom <andrii@crytek.de>2019-08-30 09:07:20 +0200
commit2e7d58c63b4b27036f76b6e5637ac3e1d7852a05 (patch)
treefdf0d813d898f1155d3a4882a06c01474492c2b4
parent9c15594fe498a8a1640bb89aa0c93800918a9798 (diff)
downloadforums-2e7d58c63b4b27036f76b6e5637ac3e1d7852a05.tar
forums-2e7d58c63b4b27036f76b6e5637ac3e1d7852a05.tar.gz
forums-2e7d58c63b4b27036f76b6e5637ac3e1d7852a05.tar.bz2
forums-2e7d58c63b4b27036f76b6e5637ac3e1d7852a05.tar.xz
forums-2e7d58c63b4b27036f76b6e5637ac3e1d7852a05.zip
[ticket/16143] Add new events before and after move topics
PHPBB3-16143
-rw-r--r--phpBB/includes/functions_admin.php30
1 files changed, 30 insertions, 0 deletions
diff --git a/phpBB/includes/functions_admin.php b/phpBB/includes/functions_admin.php
index c19d48b0be..cc82fdbda3 100644
--- a/phpBB/includes/functions_admin.php
+++ b/phpBB/includes/functions_admin.php
@@ -543,6 +543,20 @@ function move_topics($topic_ids, $forum_id, $auto_sync = true)
$topic_ids = array($topic_ids);
}
+ /**
+ * Perform additional actions before topics move
+ *
+ * @event core.move_topics_before
+ * @var array topic_ids Array of the moved topic ids
+ * @var string forum_id The forum id from where the topics are moved
+ * @since 3.2.9-RC1
+ */
+ $vars = array(
+ 'topic_ids',
+ 'forum_id',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.move_topics_before', compact($vars)));
+
$sql = 'DELETE FROM ' . TOPICS_TABLE . '
WHERE ' . $db->sql_in_set('topic_moved_id', $topic_ids) . '
AND forum_id = ' . $forum_id;
@@ -593,6 +607,22 @@ function move_topics($topic_ids, $forum_id, $auto_sync = true)
}
unset($table_ary);
+ /**
+ * Perform additional actions after topics move
+ *
+ * @event core.move_topics_after
+ * @var array topic_ids Array of the moved topic ids
+ * @var string forum_id The forum id from where the topics were moved
+ * @var array forum_ids Array of the forums where the topics were moved (includes also forum_id)
+ * @since 3.2.9-RC1
+ */
+ $vars = array(
+ 'topic_ids',
+ 'forum_id',
+ 'forum_ids',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.move_topics_after', compact($vars)));
+
if ($auto_sync)
{
sync('forum', 'forum_id', $forum_ids, true, true);