diff options
author | JoshyPHP <s9e.dev@gmail.com> | 2015-03-26 05:20:23 +0100 |
---|---|---|
committer | JoshyPHP <s9e.dev@gmail.com> | 2015-04-02 19:16:04 +0200 |
commit | f75f63b264b2005faedb699dd867bd1d9c429a09 (patch) | |
tree | 31504b8cc529aa313c2ce31a177ac672292762c5 /phpBB/phpbb/textformatter | |
parent | a04fca86ee4fec3cb615f358f3dc914564d9a9b1 (diff) | |
download | forums-f75f63b264b2005faedb699dd867bd1d9c429a09.tar forums-f75f63b264b2005faedb699dd867bd1d9c429a09.tar.gz forums-f75f63b264b2005faedb699dd867bd1d9c429a09.tar.bz2 forums-f75f63b264b2005faedb699dd867bd1d9c429a09.tar.xz forums-f75f63b264b2005faedb699dd867bd1d9c429a09.zip |
[ticket/11768] Added parser events
Added core.text_formatter_s9e_parse_before and
core.text_formatter_s9e_parse_after
PHPBB3-11768
Diffstat (limited to 'phpBB/phpbb/textformatter')
-rw-r--r-- | phpBB/phpbb/textformatter/s9e/parser.php | 28 | ||||
-rw-r--r-- | phpBB/phpbb/textformatter/s9e/renderer.php | 2 |
2 files changed, 28 insertions, 2 deletions
diff --git a/phpBB/phpbb/textformatter/s9e/parser.php b/phpBB/phpbb/textformatter/s9e/parser.php index 37900d3d7c..f220dd3e64 100644 --- a/phpBB/phpbb/textformatter/s9e/parser.php +++ b/phpBB/phpbb/textformatter/s9e/parser.php @@ -83,7 +83,33 @@ class parser implements \phpbb\textformatter\parser_interface */ public function parse($text) { - return $this->parser->parse($text); + $self = $this; + + /** + * Modify a text before it is parsed + * + * @event core.text_formatter_s9e_parse_before + * @var \phpbb\textformatter\s9e\parser self This parser service + * @var string text The original text + * @since 3.2.0-a1 + */ + $vars = array('self', 'text'); + extract($this->dispatcher->trigger_event('core.text_formatter_s9e_parse_before', compact($vars))); + + $xml = $this->parser->parse($text); + + /** + * Modify a parsed text in its XML form + * + * @event core.text_formatter_s9e_parse_after + * @var \phpbb\textformatter\s9e\parser self This parser service + * @var string xml The parsed text, in XML + * @since 3.2.0-a1 + */ + $vars = array('self', 'xml'); + extract($this->dispatcher->trigger_event('core.text_formatter_s9e_parse_after', compact($vars))); + + return $xml; } /** diff --git a/phpBB/phpbb/textformatter/s9e/renderer.php b/phpBB/phpbb/textformatter/s9e/renderer.php index 484b067d47..272cc5e6f3 100644 --- a/phpBB/phpbb/textformatter/s9e/renderer.php +++ b/phpBB/phpbb/textformatter/s9e/renderer.php @@ -256,7 +256,7 @@ class renderer implements \phpbb\textformatter\renderer_interface * Modify a rendered text * * @event core.text_formatter_s9e_render_after - * @var string html The renderer text's HTML + * @var string html The rendered text's HTML * @var \phpbb\textformatter\s9e\renderer self This renderer service * @since 3.2.0-a1 */ |