aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/viewtopic.php
diff options
context:
space:
mode:
authorrxu <rxu@mail.ru>2014-08-19 03:05:53 +0800
committerrxu <rxu@mail.ru>2014-08-21 04:54:26 +0800
commit60b38847d2c23c63b9a084dc7cb3c61ad021c5ea (patch)
tree289df5ab8c7740f1e6ad6916209d508b52da368f /phpBB/viewtopic.php
parenta82a88b555c8cecef1758f32518c9dcb21283bda (diff)
downloadforums-60b38847d2c23c63b9a084dc7cb3c61ad021c5ea.tar
forums-60b38847d2c23c63b9a084dc7cb3c61ad021c5ea.tar.gz
forums-60b38847d2c23c63b9a084dc7cb3c61ad021c5ea.tar.bz2
forums-60b38847d2c23c63b9a084dc7cb3c61ad021c5ea.tar.xz
forums-60b38847d2c23c63b9a084dc7cb3c61ad021c5ea.zip
[ticket/12994] Add core event to viewtopic.php before sending vars to template
Add core event to viewtopic.php before sending vars to template to allow extensions performing additional actions/modifying data first. PHPBB3-12994
Diffstat (limited to 'phpBB/viewtopic.php')
-rw-r--r--phpBB/viewtopic.php29
1 files changed, 29 insertions, 0 deletions
diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php
index 8d7ab5323d..c2faffca85 100644
--- a/phpBB/viewtopic.php
+++ b/phpBB/viewtopic.php
@@ -602,6 +602,35 @@ if (!empty($_EXTRA_URL))
// If we've got a hightlight set pass it on to pagination.
$base_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&amp;t=$topic_id" . ((strlen($u_sort_param)) ? "&amp;$u_sort_param" : '') . (($highlight_match) ? "&amp;hilit=$highlight" : ''));
+
+/**
+* Event to modify data before template variables are being assigned
+*
+* @event core.viewtopic_assign_template_vars_before
+* @var string base_url URL to be passed to generate pagination
+* @var int forum_id Forum ID
+* @var int post_id Post ID
+* @var array quickmod_array Array with quick moderation options data
+* @var int start Pagination information
+* @var array topic_data Array with topic data
+* @var int topic_id Topic ID
+* @var array topic_tracking_info Array with topic tracking data
+* @var int total_posts Topic total posts count
+* @since 3.1.0-RC4
+*/
+$vars = array(
+ 'base_url',
+ 'forum_id',
+ 'post_id',
+ 'quickmod_array',
+ 'start',
+ 'topic_data',
+ 'topic_id',
+ 'topic_tracking_info',
+ 'total_posts',
+);
+extract($phpbb_dispatcher->trigger_event('core.viewtopic_assign_template_vars_before', compact($vars)));
+
$pagination->generate_template_pagination($base_url, 'pagination', 'start', $total_posts, $config['posts_per_page'], $start);
// Send vars to template