diff options
author | Thomas Steur <thomas.steur@gmail.com> | 2013-10-21 01:06:47 +0400 |
---|---|---|
committer | Thomas Steur <thomas.steur@gmail.com> | 2013-10-21 01:06:47 +0400 |
commit | 2560e83517536859ca62440c14b04ec9db2af00e (patch) | |
tree | 6edea6ec0752aa562d85cc4a45655cbe0e867d54 /plugins/ExampleUI | |
parent | 37fc1f1cd10dfef86ac429af0f6254436d0d6ccb (diff) |
It was confusing to have a coreViewDataTable and pluginViewDataTable class. In addition the coreViewDataTable did two things: Instance creation and managing all viewDataTables --> two new classes
Diffstat (limited to 'plugins/ExampleUI')
-rw-r--r-- | plugins/ExampleUI/Controller.php | 12 | ||||
-rw-r--r-- | plugins/ExampleUI/CustomDataTable.php | 4 |
2 files changed, 8 insertions, 8 deletions
diff --git a/plugins/ExampleUI/Controller.php b/plugins/ExampleUI/Controller.php index 46d2627a3c..c059ebc89e 100644 --- a/plugins/ExampleUI/Controller.php +++ b/plugins/ExampleUI/Controller.php @@ -13,7 +13,7 @@ namespace Piwik\Plugins\ExampleUI; use Piwik\Common; use Piwik\Piwik; use Piwik\View; -use Piwik\ViewDataTable; +use Piwik\ViewDataTable\Factory; /** * @package ExampleUI @@ -59,7 +59,7 @@ class Controller extends \Piwik\Plugin\Controller public function barGraph() { - $view = ViewDataTable::factory( + $view = Factory::build( 'graphVerticalBar', 'ExampleUI.getTemperatures', $controllerAction = 'ExampleUI.barGraph'); $view->config->y_axis_unit = '°C'; @@ -73,7 +73,7 @@ class Controller extends \Piwik\Plugin\Controller public function pieGraph() { - $view = ViewDataTable::factory( + $view = Factory::build( 'graphPie', 'ExampleUI.getPlanetRatios', $controllerAction = 'ExampleUI.pieGraph'); $view->config->columns_to_display = array('value'); @@ -100,7 +100,7 @@ class Controller extends \Piwik\Plugin\Controller public function echoSimpleTagClouds() { - $view = ViewDataTable::factory( + $view = Factory::build( 'cloud', 'ExampleUI.getPlanetRatios', $controllerAction = 'ExampleUI.echoSimpleTagClouds'); $view->config->columns_to_display = array('label', 'value'); @@ -112,7 +112,7 @@ class Controller extends \Piwik\Plugin\Controller public function echoAdvancedTagClouds() { - $view = ViewDataTable::factory( + $view = Factory::build( 'cloud', 'ExampleUI.getPlanetRatiosWithLogos', $controllerAction = 'ExampleUI.echoAdvancedTagClouds'); $view->config->display_logo_instead_of_label = true; @@ -133,7 +133,7 @@ class Controller extends \Piwik\Plugin\Controller public function generateSparkline() { - $view = ViewDataTable::factory( + $view = Factory::build( 'sparkline', 'ExampleUI.getTemperaturesEvolution', $controllerAction = 'ExampleUI.generateSparkline'); $serverRequested = Common::getRequestVar('server', false); diff --git a/plugins/ExampleUI/CustomDataTable.php b/plugins/ExampleUI/CustomDataTable.php index 3f8b780a81..c7009d7c81 100644 --- a/plugins/ExampleUI/CustomDataTable.php +++ b/plugins/ExampleUI/CustomDataTable.php @@ -12,13 +12,13 @@ namespace Piwik\Plugins\ExampleUI; use Piwik\View; -use Piwik\ViewDataTable; +use Piwik\ViewDataTable\Factory; class CustomDataTable { public function render($value, $label, $apiAction, $controllerAction) { - $view = ViewDataTable::factory('table', $apiAction, $controllerAction); + $view = Factory::build('table', $apiAction, $controllerAction); $view->config->translations['value'] = $value; $view->config->translations['label'] = $label; |