[ticket/16247] Quote PM has no identifier

PHPBB3-16247
This commit is contained in:
3D-I 2019-12-05 10:14:46 +01:00
parent 3002cee42a
commit d3749538f1
4 changed files with 16 additions and 1 deletions

View file

@ -999,7 +999,10 @@ function compose_pm($id, $mode, $action, $user_folders = array())
{ {
$quote_attributes['post_id'] = $post['msg_id']; $quote_attributes['post_id'] = $post['msg_id'];
} }
if ($action === 'quote')
{
$quote_attributes['msg_id'] = $post['msg_id'];
}
/** @var \phpbb\language\language $language */ /** @var \phpbb\language\language $language */
$language = $phpbb_container->get('language'); $language = $phpbb_container->get('language');
/** @var \phpbb\textformatter\utils_interface $text_formatter_utils */ /** @var \phpbb\textformatter\utils_interface $text_formatter_utils */

View file

@ -90,6 +90,8 @@ class factory implements \phpbb\textformatter\cache_interface
post_id={UINT;optional} post_id={UINT;optional}
post_url={URL;optional;postFilter=#false} post_url={URL;optional;postFilter=#false}
profile_url={URL;optional;postFilter=#false} profile_url={URL;optional;postFilter=#false}
msg_id={UINT;optional}
msg_url={URL;optional;postFilter=#false}
time={UINT;optional} time={UINT;optional}
url={URL;optional} url={URL;optional}
user_id={UINT;optional} user_id={UINT;optional}

View file

@ -40,6 +40,7 @@ class quote_helper
public function __construct(\phpbb\user $user, $root_path, $php_ext) public function __construct(\phpbb\user $user, $root_path, $php_ext)
{ {
$this->post_url = append_sid($root_path . 'viewtopic.' . $php_ext, 'p={POST_ID}#p{POST_ID}', false); $this->post_url = append_sid($root_path . 'viewtopic.' . $php_ext, 'p={POST_ID}#p{POST_ID}', false);
$this->msg_url = append_sid($root_path . 'ucp.' . $php_ext, 'i=pm&mode=view&p={MSG_ID}', false);
$this->profile_url = append_sid($root_path . 'memberlist.' . $php_ext, 'mode=viewprofile&u={USER_ID}', false); $this->profile_url = append_sid($root_path . 'memberlist.' . $php_ext, 'mode=viewprofile&u={USER_ID}', false);
$this->user = $user; $this->user = $user;
} }
@ -53,6 +54,7 @@ class quote_helper
public function inject_metadata($xml) public function inject_metadata($xml)
{ {
$post_url = $this->post_url; $post_url = $this->post_url;
$msg_url = $this->msg_url;
$profile_url = $this->profile_url; $profile_url = $this->profile_url;
$user = $this->user; $user = $this->user;
@ -65,6 +67,10 @@ class quote_helper
{ {
$attributes['post_url'] = str_replace('{POST_ID}', $attributes['post_id'], $post_url); $attributes['post_url'] = str_replace('{POST_ID}', $attributes['post_id'], $post_url);
} }
if (isset($attributes['msg_id']))
{
$attributes['msg_url'] = str_replace('{MSG_ID}', $attributes['msg_id'], $msg_url);
}
if (isset($attributes['time'])) if (isset($attributes['time']))
{ {
$attributes['date'] = $user->format_date($attributes['time']); $attributes['date'] = $user->format_date($attributes['time']);

View file

@ -37,6 +37,10 @@
<xsl:text> </xsl:text> <xsl:text> </xsl:text>
<a href="{@post_url}" data-post-id="{@post_id}" onclick="if(document.getElementById(hash.substr(1)))href=hash">&#8593;</a> <a href="{@post_url}" data-post-id="{@post_id}" onclick="if(document.getElementById(hash.substr(1)))href=hash">&#8593;</a>
</xsl:if> </xsl:if>
<xsl:if test="@msg_url">
<xsl:text> </xsl:text>
<a href="{@msg_url}" data-msg-id="{@msg_id}" onclick="if(document.getElementById(hash.substr(1)))href=hash">&#8593;</a>
</xsl:if>
<xsl:if test="@date"> <xsl:if test="@date">
<div class="responsive-hide"><xsl:value-of select="@date"/></div> <div class="responsive-hide"><xsl:value-of select="@date"/></div>
</xsl:if> </xsl:if>