aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/viewtopic.php
diff options
context:
space:
mode:
authorMarc Alexander <admin@m-a-styles.de>2018-10-08 21:16:58 +0200
committerMarc Alexander <admin@m-a-styles.de>2018-10-08 21:16:58 +0200
commitcd17633235fd62c057fe0d4ce8c1b244b161377b (patch)
tree010be43f613e20ba1882037b3c9ce4e5095dbed3 /phpBB/viewtopic.php
parent3c7e8325a00f25cf3e0efc7570a5a3bc114b1033 (diff)
parentfbd1741107c2eda9d009efcc794b53d3b703bd92 (diff)
downloadforums-cd17633235fd62c057fe0d4ce8c1b244b161377b.tar
forums-cd17633235fd62c057fe0d4ce8c1b244b161377b.tar.gz
forums-cd17633235fd62c057fe0d4ce8c1b244b161377b.tar.bz2
forums-cd17633235fd62c057fe0d4ce8c1b244b161377b.tar.xz
forums-cd17633235fd62c057fe0d4ce8c1b244b161377b.zip
Merge pull request #5219 from senky/ticket/15661
[ticket/15661] Add core.viewtopic_modify_poll_ajax_data
Diffstat (limited to 'phpBB/viewtopic.php')
-rw-r--r--phpBB/viewtopic.php23
1 files changed, 23 insertions, 0 deletions
diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php
index 79852330d9..c1746e0676 100644
--- a/phpBB/viewtopic.php
+++ b/phpBB/viewtopic.php
@@ -998,6 +998,29 @@ if (!empty($topic_data['poll_start']))
'total_votes' => array_sum($vote_counts),
'can_vote' => !count($valid_user_votes) || ($auth->acl_get('f_votechg', $forum_id) && $topic_data['poll_vote_change']),
);
+
+ /**
+ * Event to manipulate the poll data sent by AJAX response
+ *
+ * @event core.viewtopic_modify_poll_ajax_data
+ * @var array data JSON response data
+ * @var array valid_user_votes Valid user votes
+ * @var array vote_counts Vote counts
+ * @var int forum_id Forum ID
+ * @var array topic_data Topic data
+ * @var array poll_info Array with the poll information
+ * @since 3.2.4-RC1
+ */
+ $vars = array(
+ 'data',
+ 'valid_user_votes',
+ 'vote_counts',
+ 'forum_id',
+ 'topic_data',
+ 'poll_info',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.viewtopic_modify_poll_ajax_data', compact($vars)));
+
$json_response = new \phpbb\json_response();
$json_response->send($data);
}