mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-31 22:10:45 +02:00
[ticket/13713] Add mention BBCode
PHPBB3-13713
This commit is contained in:
@@ -138,6 +138,7 @@ class data_access
|
||||
'email' => 10,
|
||||
'flash' => 11,
|
||||
'attachment' => 12,
|
||||
'mention' => 13,
|
||||
);
|
||||
|
||||
$styles = array();
|
||||
|
@@ -84,6 +84,12 @@ class factory implements \phpbb\textformatter\cache_interface
|
||||
'img' => '[IMG src={IMAGEURL;useContent}]',
|
||||
'list' => '[LIST type={HASHMAP=1:decimal,a:lower-alpha,A:upper-alpha,i:lower-roman,I:upper-roman;optional;postFilter=#simpletext} #createChild=LI]{TEXT}[/LIST]',
|
||||
'li' => '[* $tagName=LI]{TEXT}[/*]',
|
||||
'mention' =>
|
||||
"[MENTION
|
||||
group_id={UINT;optional}
|
||||
profile_url={URL;optional;postFilter=#false}
|
||||
user_id={UINT;optional}
|
||||
]{TEXT}[/MENTION]",
|
||||
'quote' =>
|
||||
"[QUOTE
|
||||
author={TEXT1;optional}
|
||||
|
@@ -28,6 +28,11 @@ class renderer implements \phpbb\textformatter\renderer_interface
|
||||
*/
|
||||
protected $dispatcher;
|
||||
|
||||
/**
|
||||
* @var mention_helper
|
||||
*/
|
||||
protected $mention_helper;
|
||||
|
||||
/**
|
||||
* @var quote_helper
|
||||
*/
|
||||
@@ -117,6 +122,16 @@ class renderer implements \phpbb\textformatter\renderer_interface
|
||||
extract($dispatcher->trigger_event('core.text_formatter_s9e_renderer_setup', compact($vars)));
|
||||
}
|
||||
|
||||
/**
|
||||
* Configure the mention_helper object used to display extended information in mentions
|
||||
*
|
||||
* @param mention_helper $mention_helper
|
||||
*/
|
||||
public function configure_mention_helper(mention_helper $mention_helper)
|
||||
{
|
||||
$this->mention_helper = $mention_helper;
|
||||
}
|
||||
|
||||
/**
|
||||
* Configure the quote_helper object used to display extended information in quotes
|
||||
*
|
||||
@@ -229,6 +244,11 @@ class renderer implements \phpbb\textformatter\renderer_interface
|
||||
*/
|
||||
public function render($xml)
|
||||
{
|
||||
if (isset($this->mention_helper))
|
||||
{
|
||||
$xml = $this->mention_helper->inject_metadata($xml);
|
||||
}
|
||||
|
||||
if (isset($this->quote_helper))
|
||||
{
|
||||
$xml = $this->quote_helper->inject_metadata($xml);
|
||||
|
Reference in New Issue
Block a user