mirror of
https://github.com/phpbb/phpbb.git
synced 2025-05-07 16:15:22 +02:00
[ticket/13540] Add core event for modifying topic review block data
Added event core.topic_review_modify_row in function topic_review() in functions_posting for modifying template data blocks for topic reviews. PHPBB3-13540
This commit is contained in:
parent
9cdbb69f9e
commit
40798ae616
@ -1037,7 +1037,7 @@ function load_drafts($topic_id = 0, $forum_id = 0, $id = 0, $pm_action = '', $ms
|
|||||||
function topic_review($topic_id, $forum_id, $mode = 'topic_review', $cur_post_id = 0, $show_quote_button = true)
|
function topic_review($topic_id, $forum_id, $mode = 'topic_review', $cur_post_id = 0, $show_quote_button = true)
|
||||||
{
|
{
|
||||||
global $user, $auth, $db, $template, $bbcode, $cache;
|
global $user, $auth, $db, $template, $bbcode, $cache;
|
||||||
global $config, $phpbb_root_path, $phpEx, $phpbb_container;
|
global $config, $phpbb_root_path, $phpEx, $phpbb_container, $phpbb_dispatcher;
|
||||||
|
|
||||||
$phpbb_content_visibility = $phpbb_container->get('content.visibility');
|
$phpbb_content_visibility = $phpbb_container->get('content.visibility');
|
||||||
$sql_sort = ($mode == 'post_review') ? 'ASC' : 'DESC';
|
$sql_sort = ($mode == 'post_review') ? 'ASC' : 'DESC';
|
||||||
@ -1176,7 +1176,7 @@ function topic_review($topic_id, $forum_id, $mode = 'topic_review', $cur_post_id
|
|||||||
$post_anchor = ($mode == 'post_review') ? 'ppr' . $row['post_id'] : 'pr' . $row['post_id'];
|
$post_anchor = ($mode == 'post_review') ? 'ppr' . $row['post_id'] : 'pr' . $row['post_id'];
|
||||||
$u_show_post = append_sid($phpbb_root_path . 'viewtopic.' . $phpEx, "f=$forum_id&t=$topic_id&p={$row['post_id']}&view=show#p{$row['post_id']}");
|
$u_show_post = append_sid($phpbb_root_path . 'viewtopic.' . $phpEx, "f=$forum_id&t=$topic_id&p={$row['post_id']}&view=show#p{$row['post_id']}");
|
||||||
|
|
||||||
$template->assign_block_vars($mode . '_row', array(
|
$post_row = array(
|
||||||
'POST_AUTHOR_FULL' => get_username_string('full', $poster_id, $row['username'], $row['user_colour'], $row['post_username']),
|
'POST_AUTHOR_FULL' => get_username_string('full', $poster_id, $row['username'], $row['user_colour'], $row['post_username']),
|
||||||
'POST_AUTHOR_COLOUR' => get_username_string('colour', $poster_id, $row['username'], $row['user_colour'], $row['post_username']),
|
'POST_AUTHOR_COLOUR' => get_username_string('colour', $poster_id, $row['username'], $row['user_colour'], $row['post_username']),
|
||||||
'POST_AUTHOR' => get_username_string('username', $poster_id, $row['username'], $row['user_colour'], $row['post_username']),
|
'POST_AUTHOR' => get_username_string('username', $poster_id, $row['username'], $row['user_colour'], $row['post_username']),
|
||||||
@ -1195,9 +1195,35 @@ function topic_review($topic_id, $forum_id, $mode = 'topic_review', $cur_post_id
|
|||||||
'POST_ID' => $row['post_id'],
|
'POST_ID' => $row['post_id'],
|
||||||
'U_MINI_POST' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'p=' . $row['post_id']) . '#p' . $row['post_id'],
|
'U_MINI_POST' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'p=' . $row['post_id']) . '#p' . $row['post_id'],
|
||||||
'U_MCP_DETAILS' => ($auth->acl_get('m_info', $forum_id)) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=main&mode=post_details&f=' . $forum_id . '&p=' . $row['post_id'], true, $user->session_id) : '',
|
'U_MCP_DETAILS' => ($auth->acl_get('m_info', $forum_id)) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=main&mode=post_details&f=' . $forum_id . '&p=' . $row['post_id'], true, $user->session_id) : '',
|
||||||
'POSTER_QUOTE' => ($show_quote_button && $auth->acl_get('f_reply', $forum_id)) ? addslashes(get_username_string('username', $poster_id, $row['username'], $row['user_colour'], $row['post_username'])) : '')
|
'POSTER_QUOTE' => ($show_quote_button && $auth->acl_get('f_reply', $forum_id)) ? addslashes(get_username_string('username', $poster_id, $row['username'], $row['user_colour'], $row['post_username'])) : '',
|
||||||
);
|
);
|
||||||
|
|
||||||
|
$current_row_number = $i;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Event to modify the template data block for topic reviews
|
||||||
|
*
|
||||||
|
* @event core.topic_review_modify_row
|
||||||
|
* @var string mode The review mode
|
||||||
|
* @var int topic_id The topic that is being reviewed
|
||||||
|
* @var int forum_id The topic's forum
|
||||||
|
* @var int cur_post_id Post offset id
|
||||||
|
* @var int current_row_number Number of the current row being iterated
|
||||||
|
* @var array post_row Template block array of the current post
|
||||||
|
* @since 3.1.4
|
||||||
|
*/
|
||||||
|
$vars = array(
|
||||||
|
'mode',
|
||||||
|
'topic_id',
|
||||||
|
'forum_id',
|
||||||
|
'cur_post_id',
|
||||||
|
'current_row_number',
|
||||||
|
'post_row',
|
||||||
|
);
|
||||||
|
extract($phpbb_dispatcher->trigger_event('core.topic_review_modify_row', compact($vars)));
|
||||||
|
|
||||||
|
$template->assign_block_vars($mode . '_row', $post_row);
|
||||||
|
|
||||||
// Display not already displayed Attachments for this post, we already parsed them. ;)
|
// Display not already displayed Attachments for this post, we already parsed them. ;)
|
||||||
if (!empty($attachments[$row['post_id']]))
|
if (!empty($attachments[$row['post_id']]))
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user