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:
authormattab <matthieu.aubry@gmail.com>2013-08-11 13:19:59 +0400
committermattab <matthieu.aubry@gmail.com>2013-08-11 13:19:59 +0400
commitf9b15e948fc9639ada0f925a5d450e6e158b5f56 (patch)
tree3d6a25c8a271deee7d1136a11c11926be1d33529 /core/Twig.php
parenta96ec40e983a8b64f4c25def541a519ff3670e6a (diff)
parent64ca5d548c0cf0c4eef9f5f104901fbf14800127 (diff)
Merge remote-tracking branch 'origin/master' into plugin_namespaces
Conflicts: core/Tracker/Request.php core/ViewDataTable.php core/ViewDataTable/HtmlTable/Goals.php plugins/Actions/Actions.php plugins/Annotations/API.php plugins/CoreHome/CoreHome.php plugins/DBStats/DBStats.php plugins/DevicesDetection/DevicesDetection.php plugins/Goals/Goals.php plugins/Live/Live.php plugins/Referers/Referers.php plugins/UserSettings/UserSettings.php plugins/UsersManager/API.php plugins/VisitTime/VisitTime.php plugins/VisitorInterest/VisitorInterest.php
Diffstat (limited to 'core/Twig.php')
-rw-r--r--core/Twig.php13
1 files changed, 11 insertions, 2 deletions
diff --git a/core/Twig.php b/core/Twig.php
index ae79b90e89..5f6550512e 100644
--- a/core/Twig.php
+++ b/core/Twig.php
@@ -34,8 +34,8 @@ use Twig_SimpleFunction;
*/
class Twig
{
- const SPARKLINE_TEMPLATE = '<img class="sparkline" alt="" data-src="%s" width="%d" height="%d" />
- <script type="text/javascript">$(document).ready(function () { piwik.initSparklines(); });</script>';
+ const SPARKLINE_TEMPLATE = '<img alt="" data-src="%s" width="%d" height="%d" />
+ <script type="text/javascript">$(function() { piwik.initSparklines(); });</script>';
/**
* @var Twig_Environment
@@ -74,6 +74,15 @@ class Twig
$this->addFunction_loadJavascriptTranslations();
$this->addFunction_sparkline();
$this->addFunction_postEvent();
+ $this->addFunction_isPluginLoaded();
+ }
+
+ protected function addFunction_isPluginLoaded()
+ {
+ $isPluginLoadedFunction = new Twig_SimpleFunction('isPluginLoaded', function ($pluginName) {
+ return PluginsManager::getInstance()->isPluginLoaded($pluginName);
+ });
+ $this->twig->addFunction($isPluginLoadedFunction);
}
protected function addFunction_includeAssets()