diff options
author | alf007 <alf007@free.fr> | 2015-05-30 17:48:18 +0200 |
---|---|---|
committer | alf007 <alf007@free.fr> | 2015-05-30 17:48:18 +0200 |
commit | 1f385b536a74e22096c4ecb32643639642fac336 (patch) | |
tree | af70de319ded8cb984ae356be0891f48ba885a8e /phpBB/includes | |
parent | 6025c40cab2d768c3cad3586fa1bfbfa6c9eeb3b (diff) | |
download | forums-1f385b536a74e22096c4ecb32643639642fac336.tar forums-1f385b536a74e22096c4ecb32643639642fac336.tar.gz forums-1f385b536a74e22096c4ecb32643639642fac336.tar.bz2 forums-1f385b536a74e22096c4ecb32643639642fac336.tar.xz forums-1f385b536a74e22096c4ecb32643639642fac336.zip |
[ticket/13841] Add core event on functions_admin for topics move
Event added for the function move_topics() in
includes/functions_admin.php, so that you can insert any extension's table(s)
to be updated when topics are moved between forums
Added parameters topic_ids, forum_id, forum_ids and auto_sync
PHPBB3-13841
Diffstat (limited to 'phpBB/includes')
-rw-r--r-- | phpBB/includes/functions_admin.php | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/phpBB/includes/functions_admin.php b/phpBB/includes/functions_admin.php index b016659541..2f966d3956 100644 --- a/phpBB/includes/functions_admin.php +++ b/phpBB/includes/functions_admin.php @@ -500,7 +500,7 @@ function filelist($rootdir, $dir = '', $type = 'gif|jpg|jpeg|png') */ function move_topics($topic_ids, $forum_id, $auto_sync = true) { - global $db; + global $db, $phpbb_dispatcher; if (empty($topic_ids)) { @@ -534,6 +534,27 @@ function move_topics($topic_ids, $forum_id, $auto_sync = true) } $table_ary = array(TOPICS_TABLE, POSTS_TABLE, LOG_TABLE, DRAFTS_TABLE, TOPICS_TRACK_TABLE); + + /** + * Perform additional actions before topics move + * + * @event core.move_topics_before_query + * @var array table_ary Array of tables from which forum_id will be updated for all rows that hold the moved topics + * @var array topic_ids Array of the moved topic ids + * @var string forum_id The forum id from where the topics are moved + * @var array forum_ids Array of the forums where the topics are moving (includes also forum_id) + * @var bool auto_sync Whether or not to perform auto sync + * @since 3.1.5 + */ + $vars = array( + 'table_ary', + 'topic_ids', + 'forum_id', + 'forum_ids', + 'auto_sync', + ); + extract($phpbb_dispatcher->trigger_event('core.move_topics_before_query', compact($vars))); + foreach ($table_ary as $table) { $sql = "UPDATE $table |