1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-03-19 07:00:14 +01:00

[ticket/16023] Add core.message_history_modify_template_vars

PHPBB3-16023
This commit is contained in:
Dark❶ 2019-04-20 14:38:25 +05:30
parent f905b40ce8
commit f7a208d103
No known key found for this signature in database
GPG Key ID: FAE32A15F9132DE8

View File

@ -2087,7 +2087,7 @@ function message_history($msg_id, $user_id, $message_row, $folder, $in_post_mode
$previous_history_pm = $prev_id;
}
$template->assign_block_vars('history_row', array(
$template_vars = array(
'MESSAGE_AUTHOR_QUOTE' => (($decoded_message) ? addslashes(get_username_string('username', $author_id, $row['username'], $row['user_colour'], $row['username'])) : ''),
'MESSAGE_AUTHOR_FULL' => get_username_string('full', $author_id, $row['username'], $row['user_colour'], $row['username']),
'MESSAGE_AUTHOR_COLOUR' => get_username_string('colour', $author_id, $row['username'], $row['user_colour'], $row['username']),
@ -2109,8 +2109,25 @@ function message_history($msg_id, $user_id, $message_row, $folder, $in_post_mode
'USER_ID' => $row['user_id'],
'U_VIEW_MESSAGE' => "$url&f=$folder_id&p=" . $row['msg_id'],
'U_QUOTE' => (!$in_post_mode && $auth->acl_get('u_sendpm') && $author_id != ANONYMOUS) ? "$url&mode=compose&action=quote&f=" . $folder_id . "&p=" . $row['msg_id'] : '',
'U_POST_REPLY_PM' => ($author_id != $user->data['user_id'] && $author_id != ANONYMOUS && $auth->acl_get('u_sendpm')) ? "$url&mode=compose&action=reply&f=$folder_id&p=" . $row['msg_id'] : '')
'U_POST_REPLY_PM' => ($author_id != $user->data['user_id'] && $author_id != ANONYMOUS && $auth->acl_get('u_sendpm')) ? "$url&mode=compose&action=reply&f=$folder_id&p=" . $row['msg_id'] : ''
);
/**
* Modify the template vars for displaying the message history in private message
*
* @event core.message_history_modify_template_vars
* @var array template_vars Array containing the query
* @var array row Array containing the action user row
* @since 3.2.6-RC1
*/
$vars = array(
'template_vars',
'row',
);
extract($phpbb_dispatcher->trigger_event('core.message_history_modify_template_vars', compact($vars)));
$template->assign_block_vars('history_row', $template_vars);
unset($rowset[$i]);
$prev_id = $id;
}