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:
authorThomas Steur <thomas.steur@googlemail.com>2014-05-02 07:04:54 +0400
committerThomas Steur <thomas.steur@googlemail.com>2014-05-02 07:04:54 +0400
commitd5091534263cc61c84d1feaea29c1e26f2e16929 (patch)
treef5036e53dbedc034d794126687f537d709fe5123 /plugins/ExampleUI
parent1109a86a867381f051b8a5682e711190586caf85 (diff)
refs #1915 added missing method to delete all viewdatatableparams, metricsToPlot should be saved now as well
Diffstat (limited to 'plugins/ExampleUI')
-rw-r--r--plugins/ExampleUI/Controller.php14
1 files changed, 10 insertions, 4 deletions
diff --git a/plugins/ExampleUI/Controller.php b/plugins/ExampleUI/Controller.php
index d4dd15c3b3..5dd0e9bb52 100644
--- a/plugins/ExampleUI/Controller.php
+++ b/plugins/ExampleUI/Controller.php
@@ -46,7 +46,7 @@ class Controller extends \Piwik\Plugin\Controller
$view = new View('@ExampleUI/evolutiongraph');
$this->setPeriodVariablesView($view);
- $view->evolutionGraph = $this->getEvolutionGraph(array('server1', 'server2'));
+ $view->evolutionGraph = $this->getEvolutionGraph(array(), array('server1', 'server2'));
return $view->render();
}
@@ -78,17 +78,23 @@ class Controller extends \Piwik\Plugin\Controller
return $view->render();
}
- public function getEvolutionGraph(array $columns = array())
+ public function getEvolutionGraph(array $columns = array(), array $defaultColumns = array())
{
if (empty($columns)) {
- $columns = Common::getRequestVar('columns');
- $columns = Piwik::getArrayFromApiParameter($columns);
+ $columns = Common::getRequestVar('columns', false);
+ if (false !== $columns) {
+ $columns = Piwik::getArrayFromApiParameter($columns);
+ }
}
$view = $this->getLastUnitGraphAcrossPlugins($this->pluginName, __FUNCTION__, $columns,
$selectableColumns = array('server1', 'server2'), 'My documentation', 'ExampleUI.getTemperaturesEvolution');
$view->requestConfig->filter_sort_column = 'label';
+ if (empty($view->config->columns_to_display) && !empty($defaultColumns)) {
+ $view->config->columns_to_display = $defaultColumns;
+ }
+
return $this->renderView($view);
}