aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB
diff options
context:
space:
mode:
authorJoshyPHP <s9e.dev@gmail.com>2015-03-26 04:39:36 +0100
committerJoshyPHP <s9e.dev@gmail.com>2015-04-02 19:16:04 +0200
commitaf4f9b860f50a562a03f55efad1da7e0854bdfda (patch)
tree58770761233846d03a7c94d45b5baf1764be1b72 /phpBB
parentc89188132114b4d9ff483c5b1579c53cdeb69703 (diff)
downloadforums-af4f9b860f50a562a03f55efad1da7e0854bdfda.tar
forums-af4f9b860f50a562a03f55efad1da7e0854bdfda.tar.gz
forums-af4f9b860f50a562a03f55efad1da7e0854bdfda.tar.bz2
forums-af4f9b860f50a562a03f55efad1da7e0854bdfda.tar.xz
forums-af4f9b860f50a562a03f55efad1da7e0854bdfda.zip
[ticket/11768] Added core.text_formatter_s9e_renderer_setup event
PHPBB3-11768
Diffstat (limited to 'phpBB')
-rw-r--r--phpBB/config/default/container/services_text_formatter.yml1
-rw-r--r--phpBB/phpbb/textformatter/s9e/renderer.php23
2 files changed, 21 insertions, 3 deletions
diff --git a/phpBB/config/default/container/services_text_formatter.yml b/phpBB/config/default/container/services_text_formatter.yml
index e95cafcc7e..972be31b31 100644
--- a/phpBB/config/default/container/services_text_formatter.yml
+++ b/phpBB/config/default/container/services_text_formatter.yml
@@ -52,6 +52,7 @@ services:
- %text_formatter.cache.dir%
- %text_formatter.cache.renderer.key%
- @text_formatter.s9e.factory
+ - @dispatcher
calls:
- [configure_smilies_path, [@config, @path_helper]]
- [configure_user, [@user, @config, @auth]]
diff --git a/phpBB/phpbb/textformatter/s9e/renderer.php b/phpBB/phpbb/textformatter/s9e/renderer.php
index b68c9dd9be..7b8b382074 100644
--- a/phpBB/phpbb/textformatter/s9e/renderer.php
+++ b/phpBB/phpbb/textformatter/s9e/renderer.php
@@ -24,6 +24,11 @@ class renderer implements \phpbb\textformatter\renderer_interface
protected $censor;
/**
+ * @var \phpbb\event\dispatcher_interface
+ */
+ protected $dispatcher;
+
+ /**
* @var \s9e\TextFormatter\Renderer
*/
protected $renderer;
@@ -55,8 +60,9 @@ class renderer implements \phpbb\textformatter\renderer_interface
* @param string $cache_dir Path to the cache dir
* @param string $key Cache key
* @param factory $factory
+ * @param \phpbb\event\dispatcher_interface $dispatcher
*/
- public function __construct(\phpbb\cache\driver\driver_interface $cache, $cache_dir, $key, factory $factory)
+ public function __construct(\phpbb\cache\driver\driver_interface $cache, $cache_dir, $key, factory $factory, \phpbb\event\dispatcher_interface $dispatcher)
{
$renderer_data = $cache->get($key);
if ($renderer_data)
@@ -81,18 +87,29 @@ class renderer implements \phpbb\textformatter\renderer_interface
$censor = $renderer_data['censor'];
}
}
-
if (!isset($renderer))
{
$objects = $factory->regenerate();
$renderer = $objects['renderer'];
}
+ $self = $this;
+
+ /**
+ * Configure the renderer service
+ *
+ * @event core.text_formatter_s9e_renderer_setup
+ * @var \s9e\TextFormatter\Renderer renderer s9e\TextFormatter renderer instance
+ * @var \phpbb\textformatter\s9e\renderer self This renderer service
+ * @since 3.2.0-a1
+ */
+ $vars = array('renderer', 'self');
+ extract($dispatcher->trigger_event('core.text_formatter_s9e_renderer_setup', compact($vars)));
if (isset($censor))
{
$this->censor = $censor;
}
-
+ $this->dispatcher = $dispatcher;
$this->renderer = $renderer;
}