diff options
author | Benaka Moorthi <benaka.moorthi@gmail.com> | 2013-06-25 08:42:38 +0400 |
---|---|---|
committer | Benaka Moorthi <benaka.moorthi@gmail.com> | 2013-06-25 08:42:38 +0400 |
commit | 3ef51e1ca75ddb48e6964c72cbffc15a87789514 (patch) | |
tree | ecc7348ef38106af19f61cb816a0921ff3fdde1e /plugins/ExampleUI/Controller.php | |
parent | 09c7f7b5bf8b633d9a8f5c5b42b115adc9c20aac (diff) |
Fix ExampleUI plugin's sparklines demonstration and make sure datatable JS is loaded regardless of whether the footer is shown or not.
Diffstat (limited to 'plugins/ExampleUI/Controller.php')
-rw-r--r-- | plugins/ExampleUI/Controller.php | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/plugins/ExampleUI/Controller.php b/plugins/ExampleUI/Controller.php index 8035a5271a..1535c07220 100644 --- a/plugins/ExampleUI/Controller.php +++ b/plugins/ExampleUI/Controller.php @@ -104,14 +104,10 @@ class Piwik_ExampleUI_Controller extends Piwik_Controller function sparklines() { - require_once PIWIK_INCLUDE_PATH . '/core/SmartyPlugins/function.sparkline.php'; - $srcSparkline1 = Piwik_Url::getCurrentQueryStringWithParametersModified(array('action' => 'generateSparkline', 'server' => 'server1', 'rand' => mt_rand())); - $htmlSparkline1 = smarty_function_sparkline(array('src' => $srcSparkline1)); - echo "<div class='sparkline'>$htmlSparkline1 Evolution of temperature for server piwik.org</div>"; - - $srcSparkline2 = Piwik_Url::getCurrentQueryStringWithParametersModified(array('action' => 'generateSparkline', 'server' => 'server2', 'rand' => mt_rand())); - $htmlSparkline2 = smarty_function_sparkline(array('src' => $srcSparkline2)); - echo "<div class='sparkline'>$htmlSparkline2 Evolution of temperature for server dev.piwik.org</div>"; + $view = new Piwik_View('@ExampleUI/sparklines'); + $view->urlSparkline1 = $this->getUrlSparkline('generateSparkline', array('server' => 'server1', 'rand' => mt_rand())); + $view->urlSparkline2 = $this->getUrlSparkline('generateSparkline', array('server' => 'server2', 'rand' => mt_rand())); + echo $view->render(); } function generateSparkline() |