Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/Twig.php11
1 files changed, 10 insertions, 1 deletions
diff --git a/core/Twig.php b/core/Twig.php
index 4da7a364f8..16348e524c 100644
--- a/core/Twig.php
+++ b/core/Twig.php
@@ -118,8 +118,17 @@ class Twig
protected function addFunction_postEvent()
{
$postEventFunction = new Twig_SimpleFunction('postEvent', function ($eventName) {
+ // get parameters to twig function
+ $params = func_get_args();
+ // remove the first value (event name)
+ array_shift($params);
+
+ // make the first value the string that will get output in the template
+ // plugins can modify this string
$str = '';
- Piwik::postEvent($eventName, array(&$str));
+ $params = array_merge( array( &$str ), $params);
+
+ Piwik::postEvent($eventName, $params);
return $str;
}, array('is_safe' => array('html')));
$this->twig->addFunction($postEventFunction);