aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/phpbb/textformatter
diff options
context:
space:
mode:
authorJoshyPHP <s9e.dev@gmail.com>2015-03-19 12:45:12 +0100
committerJoshyPHP <s9e.dev@gmail.com>2015-04-02 19:16:03 +0200
commit49b9e8e4eafff93f25a99bf263982fe79b7f0549 (patch)
treee35553682ab88a57a9520b84e4f7e1cdedf13454 /phpBB/phpbb/textformatter
parentf4f5bdbaee48d0ed341ec9b720579a4f751916fc (diff)
downloadforums-49b9e8e4eafff93f25a99bf263982fe79b7f0549.tar
forums-49b9e8e4eafff93f25a99bf263982fe79b7f0549.tar.gz
forums-49b9e8e4eafff93f25a99bf263982fe79b7f0549.tar.bz2
forums-49b9e8e4eafff93f25a99bf263982fe79b7f0549.tar.xz
forums-49b9e8e4eafff93f25a99bf263982fe79b7f0549.zip
[ticket/11768] Added configurator events
PHPBB3-11768
Diffstat (limited to 'phpBB/phpbb/textformatter')
-rw-r--r--phpBB/phpbb/textformatter/s9e/factory.php30
1 files changed, 28 insertions, 2 deletions
diff --git a/phpBB/phpbb/textformatter/s9e/factory.php b/phpBB/phpbb/textformatter/s9e/factory.php
index 01209d352a..4504a329af 100644
--- a/phpBB/phpbb/textformatter/s9e/factory.php
+++ b/phpBB/phpbb/textformatter/s9e/factory.php
@@ -101,22 +101,28 @@ class factory implements \phpbb\textformatter\cache_interface
);
/**
+ * @var \phpbb\event\dispatcher_interface
+ */
+ protected $dispatcher;
+
+ /**
* Constructor
*
* @param \phpbb\textformatter\data_access $data_access
* @param \phpbb\cache\driver\driver_interface $cache
+ * @param \phpbb\event\dispatcher_interface $dispatcher
* @param string $cache_dir Path to the cache dir
* @param string $cache_key_parser Cache key used for the parser
* @param string $cache_key_renderer Cache key used for the renderer
*/
- public function __construct(\phpbb\textformatter\data_access $data_access, \phpbb\cache\driver\driver_interface $cache, $cache_dir, $cache_key_parser, $cache_key_renderer)
+ public function __construct(\phpbb\textformatter\data_access $data_access, \phpbb\cache\driver\driver_interface $cache, \phpbb\event\dispatcher_interface $dispatcher, $cache_dir, $cache_key_parser, $cache_key_renderer)
{
$this->cache = $cache;
$this->cache_dir = $cache_dir;
$this->cache_key_parser = $cache_key_parser;
$this->cache_key_renderer = $cache_key_renderer;
-
$this->data_access = $data_access;
+ $this->dispatcher = $dispatcher;
}
/**
@@ -158,6 +164,16 @@ class factory implements \phpbb\textformatter\cache_interface
// Create a new Configurator
$configurator = new Configurator;
+ /**
+ * Modify the s9e\TextFormatter configurator before the default settings are set
+ *
+ * @event core.text_formatter_s9e_configure_before
+ * @var \s9e\TextFormatter\Configurator configurator Configurator instance
+ * @since 3.2.0-a1
+ */
+ $vars = array('configurator');
+ extract($this->dispatcher->trigger_event('core.text_formatter_s9e_configure_before', compact($vars)));
+
// Convert newlines to br elements by default
$configurator->rootRules->enableAutoLineBreaks();
@@ -288,6 +304,16 @@ class factory implements \phpbb\textformatter\cache_interface
$configurator->registeredVars['max_img_height'] = 0;
$configurator->registeredVars['max_img_width'] = 0;
+ /**
+ * Modify the s9e\TextFormatter configurator after the default settings are set
+ *
+ * @event core.text_formatter_s9e_configure_after
+ * @var \s9e\TextFormatter\Configurator configurator Configurator instance
+ * @since 3.2.0-a1
+ */
+ $vars = array('configurator');
+ extract($this->dispatcher->trigger_event('core.text_formatter_s9e_configure_after', compact($vars)));
+
return $configurator;
}