aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobertHeim <robert.heim@rwth-aachen.de>2015-02-27 18:01:26 +0100
committerRobertHeim <robert.heim@rwth-aachen.de>2015-02-27 18:01:26 +0100
commit71828ee8df7fe4d1be551a89086dd8de4df146a9 (patch)
tree54acdc16673346abbe3fbd7bf03e7e98cbcf11d0
parente15b9dc7828de8644775709155c157a71bddb832 (diff)
downloadforums-71828ee8df7fe4d1be551a89086dd8de4df146a9.tar
forums-71828ee8df7fe4d1be551a89086dd8de4df146a9.tar.gz
forums-71828ee8df7fe4d1be551a89086dd8de4df146a9.tar.bz2
forums-71828ee8df7fe4d1be551a89086dd8de4df146a9.tar.xz
forums-71828ee8df7fe4d1be551a89086dd8de4df146a9.zip
[ticket/13658] add event before and after topics are deleted
PHPBB3-13658
-rw-r--r--phpBB/includes/functions_admin.php26
1 files changed, 25 insertions, 1 deletions
diff --git a/phpBB/includes/functions_admin.php b/phpBB/includes/functions_admin.php
index b016659541..e8f8e40443 100644
--- a/phpBB/includes/functions_admin.php
+++ b/phpBB/includes/functions_admin.php
@@ -618,7 +618,7 @@ function move_posts($post_ids, $topic_id, $auto_sync = true)
*/
function delete_topics($where_type, $where_ids, $auto_sync = true, $post_count_sync = true, $call_delete_posts = true)
{
- global $db, $config, $phpbb_container;
+ global $db, $config, $phpbb_container, $phpbb_dispatcher;
$approved_topics = 0;
$forum_ids = $topic_ids = array();
@@ -672,6 +672,18 @@ function delete_topics($where_type, $where_ids, $auto_sync = true, $post_count_s
$table_ary = array(BOOKMARKS_TABLE, TOPICS_TRACK_TABLE, TOPICS_POSTED_TABLE, POLL_VOTES_TABLE, POLL_OPTIONS_TABLE, TOPICS_WATCH_TABLE, TOPICS_TABLE);
+ /**
+ * Perform additional actions before topic(s) deletion
+ *
+ * @event core.delete_topics_before
+ * @var array topic_ids Array of topic ids to delete
+ * @since 3.1.4-RC1
+ */
+ $vars = array(
+ 'topic_ids',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.delete_topics_before', compact($vars)));
+
foreach ($table_ary as $table)
{
$sql = "DELETE FROM $table
@@ -680,6 +692,18 @@ function delete_topics($where_type, $where_ids, $auto_sync = true, $post_count_s
}
unset($table_ary);
+ /**
+ * Perform additional actions after topic(s) deletion
+ *
+ * @event core.delete_topics_after
+ * @var array topic_ids Array of topic ids that were deleted
+ * @since 3.1.4-RC1
+ */
+ $vars = array(
+ 'topic_ids',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.delete_topics_after', compact($vars)));
+
$moved_topic_ids = array();
// update the other forums