From 332e43403992cc114a21cb03aa8296a9a8da16d8 Mon Sep 17 00:00:00 2001 From: Benaka Moorthi Date: Fri, 19 Jul 2013 10:27:58 -0400 Subject: Refs #3942, allow server-side and JS UI code to use colors defined in CSS. Notes: - Removed colors.piwik.json loading code. No longer necessary. - UserCountryMap is the only remaining portion of Piwik that doesn't use this technique. Not yet, anyway. --- core/Twig.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'core/Twig.php') diff --git a/core/Twig.php b/core/Twig.php index a3f69dbc7e..8e4bcb7c01 100644 --- a/core/Twig.php +++ b/core/Twig.php @@ -18,6 +18,9 @@ */ class Piwik_Twig { + const SPARKLINE_TEMPLATE = ' + '; + /** * @var Twig_Environment */ @@ -90,10 +93,9 @@ class Piwik_Twig protected function addFunction_sparkline() { $sparklineFunction = new Twig_SimpleFunction('sparkline', function ($src) { - $graph = new Piwik_Visualization_Sparkline(); - $width = $graph->getWidth(); - $height = $graph->getHeight(); - return sprintf('', $src, $width, $height); + $width = Piwik_Visualization_Sparkline::DEFAULT_WIDTH; + $height = Piwik_Visualization_Sparkline::DEFAULT_HEIGHT; + return sprintf(Piwik_Twig::SPARKLINE_TEMPLATE, $src, $width, $height); }, array('is_safe' => array('html'))); $this->twig->addFunction($sparklineFunction); } -- cgit v1.2.3