diff options
35 files changed, 253 insertions, 239 deletions
diff --git a/core/Plugin/Controller.php b/core/Plugin/Controller.php index b1be2080b1..6d6f61a8c4 100644 --- a/core/Plugin/Controller.php +++ b/core/Plugin/Controller.php @@ -32,7 +32,7 @@ use Piwik\SettingsPiwik; use Piwik\Site; use Piwik\Url; use Piwik\View; -use Piwik\ViewDataTable as ViewDataTableBuilder; +use Piwik\ViewDataTable\Factory as ViewDataTableFactory; /** * Parent class of all plugins Controllers (located in /plugins/PluginName/Controller.php @@ -179,7 +179,7 @@ abstract class Controller */ protected function getLastUnitGraph($currentModuleName, $currentControllerAction, $apiMethod) { - $view = ViewDataTableBuilder::factory( + $view = ViewDataTableFactory::build( 'graphEvolution', $apiMethod, $currentModuleName . '.' . $currentControllerAction, $forceDefault = true); $view->config->show_goals = false; return $view; diff --git a/core/Plugin/ViewDataTable.php b/core/Plugin/ViewDataTable.php index 1063d6cdc1..90ebab310b 100644 --- a/core/Plugin/ViewDataTable.php +++ b/core/Plugin/ViewDataTable.php @@ -26,6 +26,7 @@ use Piwik\View\ViewInterface; use Piwik\ViewDataTable\Config as VizConfig; use Piwik\ViewDataTable\Request as ViewDataTableRequest; use Piwik\ViewDataTable\RequestConfig as VizRequest; +use \Piwik\ViewDataTable\Manager as ViewDataTableManager; /** * This class is used to load (from the API) and customize the output of a given DataTable. @@ -353,7 +354,7 @@ abstract class ViewDataTable implements ViewInterface } if ($this->config->show_non_core_visualizations) { - $nonCoreVisualizations = \Piwik\ViewDataTable::getNonCoreViewDataTables(); + $nonCoreVisualizations = ViewDataTableManager::getNonCoreViewDataTables(); $nonCoreVisualizationInfo = static::getVisualizationInfoFor($nonCoreVisualizations); foreach ($nonCoreVisualizationInfo as $format => $info) { diff --git a/core/ViewDataTable.php b/core/ViewDataTable/Factory.php index 3cfb95826a..b4563b0607 100644 --- a/core/ViewDataTable.php +++ b/core/ViewDataTable/Factory.php @@ -8,47 +8,38 @@ * @category Piwik * @package Piwik */ -namespace Piwik; +namespace Piwik\ViewDataTable; use Piwik\API\Proxy; use Piwik\API\Request; +use Piwik\Common; +use Piwik\Piwik; use Piwik\Plugins\API\API; use Piwik\Plugin\Visualization; /** * This class is used to load (from the API) and customize the output of a given DataTable. - * The main() method will create an object implementing ViewInterface + * The build() method will create an object implementing ViewInterface * You can customize the dataTable using the disable* methods. * - * You can also customize the dataTable rendering using row metadata: - * - 'html_label_prefix': If this metadata is present on a row, it's contents will be prepended - * the label in the HTML output. - * - 'html_label_suffix': If this metadata is present on a row, it's contents will be appended - * after the label in the HTML output. - * * Example: * In the Controller of the plugin VisitorInterest * <pre> - * function getNumberOfVisitsPerVisitDuration( $fetch = false) + * function getNumberOfVisitsPerVisitDuration( $fetch = false) * { - * $view = ViewDataTable::factory( 'cloud' ); - * $view->init( $this->pluginName, __FUNCTION__, 'VisitorInterest.getNumberOfVisitsPerVisitDuration' ); - * $view->setColumnsToDisplay( array('label','nb_visits') ); - * $view->disableSort(); - * $view->disableExcludeLowPopulation(); - * $view->disableOffsetInformation(); - * - * return $this->renderView($view, $fetch); - * } + * $view = ViewDataTable/Factory::build( 'cloud', 'VisitorInterest.getNumberOfVisitsPerVisitDuration' ); + * $view->config->show_search = true; + * $view->render(); + * } * </pre> * - * @see factory() for all the available output (cloud tags, html table, pie chart, vertical bar chart) + * @see build() for all the available output (cloud tags, html table, pie chart, vertical bar chart) * @package Piwik * @subpackage ViewDataTable * * @api */ -class ViewDataTable +class Factory { /** @@ -73,7 +64,7 @@ class ViewDataTable * @throws \Exception * @return \Piwik\Plugin\ViewDataTable|\Piwik\Plugin\Visualization|\Piwik\Plugins\CoreVisualizations\Visualizations\Sparkline; */ - public static function factory($defaultType = null, $apiAction = false, $controllerAction = false, $forceDefault = false) + public static function build($defaultType = null, $apiAction = false, $controllerAction = false, $forceDefault = false) { if (false === $controllerAction) { $controllerAction = $apiAction; @@ -87,7 +78,7 @@ class ViewDataTable $type = Common::getRequestVar('viewDataTable', $defaultType ? : 'table', 'string'); - $visualizations = static::getAvailableVisualizations(); + $visualizations = Manager::getAvailableViewDataTables(); if (array_key_exists($type, $visualizations)) { return new $visualizations[$type]($controllerAction, $apiAction); @@ -101,68 +92,6 @@ class ViewDataTable } /** - * Returns all registered visualization classes. Uses the 'Visualization.getAvailable' - * event to retrieve visualizations. - * - * @return array Array mapping visualization IDs with their associated visualization classes. - * @throws \Exception If a visualization class does not exist or if a duplicate visualization ID - * is found. - * @return array - */ - public static function getAvailableVisualizations() - { - /** @var string[] $visualizations */ - $visualizations = array(); - - /** - * This event is used to gather all available DataTable visualizations. Callbacks should add visualization - * class names to the incoming array. - */ - Piwik::postEvent('Visualization.addVisualizations', array(&$visualizations)); - - $result = array(); - - foreach ($visualizations as $viz) { - if (!class_exists($viz)) { - throw new \Exception("Invalid visualization class '$viz' found in Visualization.getAvailableVisualizations."); - } - - if (!is_subclass_of($viz, '\\Piwik\\Plugin\\ViewDataTable')) { - throw new \Exception("Visualization class '$viz' does not extend Plugin/ViewDataTable"); - } - - $vizId = $viz::getViewDataTableId(); - - if (isset($result[$vizId])) { - throw new \Exception("Visualization ID '$vizId' is already in use!"); - } - - $result[$vizId] = $viz; - } - - return $result; - } - - /** - * Returns all available visualizations that are not part of the CoreVisualizations plugin. - * - * @return array Array mapping visualization IDs with their associated visualization classes. - */ - public static function getNonCoreViewDataTables() - { - $result = array(); - - foreach (static::getAvailableVisualizations() as $vizId => $vizClass) { - if (false === strpos($vizClass, 'Piwik\\Plugins\\CoreVisualizations') - && false === strpos($vizClass, 'Piwik\\Plugins\\Goals\\Visualizations\\Goals')) { - $result[$vizId] = $vizClass; - } - } - - return $result; - } - - /** * Convenience method that creates and renders a ViewDataTable for a API method. * * @param string $pluginName The name of the plugin (eg, UserSettings). @@ -182,7 +111,7 @@ class ViewDataTable $apiAction = $apiProxy->buildApiActionName($pluginName, $apiAction); - $view = static::factory(null, $apiAction); + $view = static::build(null, $apiAction); $rendered = $view->render(); if ($fetch) { @@ -225,7 +154,7 @@ class ViewDataTable * } * ``` */ - Piwik::postEvent('Visualization.getDefaultTypeViewDataTable', array(&self::$defaultViewTypes)); + Piwik::postEvent('ViewDataTable.getDefaultType', array(&self::$defaultViewTypes)); } return self::$defaultViewTypes; diff --git a/core/ViewDataTable/Manager.php b/core/ViewDataTable/Manager.php new file mode 100644 index 0000000000..8b4ac91db4 --- /dev/null +++ b/core/ViewDataTable/Manager.php @@ -0,0 +1,85 @@ +<?php +/** + * Piwik - Open source web analytics + * + * @link http://piwik.org + * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later + * + * @category Piwik + * @package Piwik + */ +namespace Piwik\ViewDataTable; + +use Piwik\Piwik; + +/** + * ViewDataTable Manager. + * + * @package Piwik + * @subpackage ViewDataTable + */ +class Manager +{ + + /** + * Returns all registered visualization classes. Uses the 'Visualization.getAvailable' + * event to retrieve visualizations. + * + * @return array Array mapping visualization IDs with their associated visualization classes. + * @throws \Exception If a visualization class does not exist or if a duplicate visualization ID + * is found. + * @return array + */ + public static function getAvailableViewDataTables() + { + /** @var string[] $visualizations */ + $visualizations = array(); + + /** + * This event is used to gather all available DataTable visualizations. Callbacks should add visualization + * class names to the incoming array. + */ + Piwik::postEvent('ViewDataTable.addViewDataTable', array(&$visualizations)); + + $result = array(); + + foreach ($visualizations as $viz) { + if (!class_exists($viz)) { + throw new \Exception("Invalid visualization class '$viz' found in Visualization.getAvailableVisualizations."); + } + + if (!is_subclass_of($viz, '\\Piwik\\Plugin\\ViewDataTable')) { + throw new \Exception("ViewDataTable class '$viz' does not extend Plugin/ViewDataTable"); + } + + $vizId = $viz::getViewDataTableId(); + + if (isset($result[$vizId])) { + throw new \Exception("ViewDataTable ID '$vizId' is already in use!"); + } + + $result[$vizId] = $viz; + } + + return $result; + } + + /** + * Returns all available visualizations that are not part of the CoreVisualizations plugin. + * + * @return array Array mapping visualization IDs with their associated visualization classes. + */ + public static function getNonCoreViewDataTables() + { + $result = array(); + + foreach (static::getAvailableViewDataTables() as $vizId => $vizClass) { + if (false === strpos($vizClass, 'Piwik\\Plugins\\CoreVisualizations') + && false === strpos($vizClass, 'Piwik\\Plugins\\Goals\\Visualizations\\Goals')) { + $result[$vizId] = $vizClass; + } + } + + return $result; + } +}
\ No newline at end of file diff --git a/plugins/Actions/Controller.php b/plugins/Actions/Controller.php index e1c67690e8..866b030d6d 100644 --- a/plugins/Actions/Controller.php +++ b/plugins/Actions/Controller.php @@ -12,7 +12,7 @@ namespace Piwik\Plugins\Actions; use Piwik\Piwik; use Piwik\View; -use Piwik\ViewDataTable; +use Piwik\ViewDataTable\Factory; /** * Actions controller @@ -89,66 +89,66 @@ class Controller extends \Piwik\Plugin\Controller public function getPageUrls($fetch = false) { - return ViewDataTable::renderReport($this->pluginName, __FUNCTION__, $fetch); + return Factory::renderReport($this->pluginName, __FUNCTION__, $fetch); } public function getEntryPageUrls($fetch = false) { - return ViewDataTable::renderReport($this->pluginName, __FUNCTION__, $fetch); + return Factory::renderReport($this->pluginName, __FUNCTION__, $fetch); } public function getExitPageUrls($fetch = false) { - return ViewDataTable::renderReport($this->pluginName, __FUNCTION__, $fetch); + return Factory::renderReport($this->pluginName, __FUNCTION__, $fetch); } public function getSiteSearchKeywords($fetch = false) { - return ViewDataTable::renderReport($this->pluginName, __FUNCTION__, $fetch); + return Factory::renderReport($this->pluginName, __FUNCTION__, $fetch); } public function getSiteSearchNoResultKeywords($fetch = false) { - return ViewDataTable::renderReport($this->pluginName, __FUNCTION__, $fetch); + return Factory::renderReport($this->pluginName, __FUNCTION__, $fetch); } public function getSiteSearchCategories($fetch = false) { - return ViewDataTable::renderReport($this->pluginName, __FUNCTION__, $fetch); + return Factory::renderReport($this->pluginName, __FUNCTION__, $fetch); } public function getPageUrlsFollowingSiteSearch($fetch = false) { - return ViewDataTable::renderReport($this->pluginName, __FUNCTION__, $fetch); + return Factory::renderReport($this->pluginName, __FUNCTION__, $fetch); } public function getPageTitlesFollowingSiteSearch($fetch = false) { - return ViewDataTable::renderReport($this->pluginName, __FUNCTION__, $fetch); + return Factory::renderReport($this->pluginName, __FUNCTION__, $fetch); } public function getPageTitles($fetch = false) { - return ViewDataTable::renderReport($this->pluginName, __FUNCTION__, $fetch); + return Factory::renderReport($this->pluginName, __FUNCTION__, $fetch); } public function getEntryPageTitles($fetch = false) { - return ViewDataTable::renderReport($this->pluginName, __FUNCTION__, $fetch); + return Factory::renderReport($this->pluginName, __FUNCTION__, $fetch); } public function getExitPageTitles($fetch = false) { - return ViewDataTable::renderReport($this->pluginName, __FUNCTION__, $fetch); + return Factory::renderReport($this->pluginName, __FUNCTION__, $fetch); } public function getDownloads($fetch = false) { - return ViewDataTable::renderReport($this->pluginName, __FUNCTION__, $fetch); + return Factory::renderReport($this->pluginName, __FUNCTION__, $fetch); } public function getOutlinks($fetch = false) { - return ViewDataTable::renderReport($this->pluginName, __FUNCTION__, $fetch); + return Factory::renderReport($this->pluginName, __FUNCTION__, $fetch); } } diff --git a/plugins/Annotations/API.php b/plugins/Annotations/API.php index 7863d0ff5c..06f7d8ea4b 100755 --- a/plugins/Annotations/API.php +++ b/plugins/Annotations/API.php @@ -17,7 +17,7 @@ use Piwik\Period; use Piwik\Period\Range; use Piwik\Piwik; use Piwik\Plugins\CoreVisualizations\Visualizations\JqplotGraph\Evolution as EvolutionViz; -use Piwik\ViewDataTable; +use Piwik\ViewDataTable\Factory; /** * @see plugins/Annotations/AnnotationList.php diff --git a/plugins/CoreHome/DataTableRowAction/MultiRowEvolution.php b/plugins/CoreHome/DataTableRowAction/MultiRowEvolution.php index 18a0f6d6ec..ebbe52facf 100644 --- a/plugins/CoreHome/DataTableRowAction/MultiRowEvolution.php +++ b/plugins/CoreHome/DataTableRowAction/MultiRowEvolution.php @@ -12,7 +12,7 @@ namespace Piwik\Plugins\CoreHome\DataTableRowAction; use Piwik\Common; use Piwik\Piwik; -use Piwik\ViewDataTable; +use Piwik\ViewDataTable\Factory; /** * MULTI ROW EVOLUTION diff --git a/plugins/CoreHome/DataTableRowAction/RowEvolution.php b/plugins/CoreHome/DataTableRowAction/RowEvolution.php index 11039ca5a7..ad87693121 100644 --- a/plugins/CoreHome/DataTableRowAction/RowEvolution.php +++ b/plugins/CoreHome/DataTableRowAction/RowEvolution.php @@ -19,7 +19,7 @@ use Piwik\Metrics; use Piwik\Piwik; use Piwik\Plugins\CoreVisualizations\Visualizations\JqplotGraph\Evolution as EvolutionViz; use Piwik\Url; -use Piwik\ViewDataTable; +use Piwik\ViewDataTable\Factory; /** * ROW EVOLUTION @@ -184,12 +184,12 @@ class RowEvolution * Do as much as possible from outside the controller. * @param string|bool $graphType * @param array|bool $metrics - * @return ViewDataTable + * @return Factory */ public function getRowEvolutionGraph($graphType = false, $metrics = false) { // set up the view data table - $view = ViewDataTable::factory($graphType ? : $this->graphType, $this->apiMethod, + $view = Factory::build($graphType ? : $this->graphType, $this->apiMethod, $controllerAction = 'CoreHome.getRowEvolutionGraph', $forceDefault = true); $view->setDataTable($this->dataTable); diff --git a/plugins/CoreVisualizations/CoreVisualizations.php b/plugins/CoreVisualizations/CoreVisualizations.php index bab6c3f6d6..42a5d5da2e 100644 --- a/plugins/CoreVisualizations/CoreVisualizations.php +++ b/plugins/CoreVisualizations/CoreVisualizations.php @@ -30,7 +30,7 @@ class CoreVisualizations extends \Piwik\Plugin return array( 'AssetManager.getStylesheetFiles' => 'getStylesheetFiles', 'AssetManager.getJavaScriptFiles' => 'getJsFiles', - 'Visualization.addVisualizations' => 'getAvailableDataTableVisualizations', + 'ViewDataTable.addViewDataTable' => 'getAvailableDataTableVisualizations', 'Translate.getClientSideTranslationKeys' => 'getClientSideTranslationKeys' ); } diff --git a/plugins/CoreVisualizations/JqplotDataGenerator.php b/plugins/CoreVisualizations/JqplotDataGenerator.php index fdc23c93c5..f13a6cf3cc 100644 --- a/plugins/CoreVisualizations/JqplotDataGenerator.php +++ b/plugins/CoreVisualizations/JqplotDataGenerator.php @@ -65,7 +65,7 @@ class JqplotDataGenerator * @param array $properties * @param string $graphType * - * @internal param \Piwik\ViewDataTable\Visualization\ $visualization + * @internal param \Piwik\Plugin\ViewDataTable $visualization */ public function __construct($properties, $graphType) { diff --git a/plugins/CoreVisualizations/JqplotDataGenerator/Evolution.php b/plugins/CoreVisualizations/JqplotDataGenerator/Evolution.php index 7ef36c902f..48d86123ab 100644 --- a/plugins/CoreVisualizations/JqplotDataGenerator/Evolution.php +++ b/plugins/CoreVisualizations/JqplotDataGenerator/Evolution.php @@ -17,7 +17,7 @@ use Piwik\DataTable\Row; use Piwik\Menu\MenuMain; use Piwik\Plugins\CoreVisualizations\JqplotDataGenerator; use Piwik\Url; -use Piwik\ViewDataTable; +use Piwik\ViewDataTable\Factory; /** * Generates JQPlot JSON data/config for evolution graphs. diff --git a/plugins/CoreVisualizations/Visualizations/Cloud.php b/plugins/CoreVisualizations/Visualizations/Cloud.php index 8e23f5f7bc..7dffa6eb3c 100644 --- a/plugins/CoreVisualizations/Visualizations/Cloud.php +++ b/plugins/CoreVisualizations/Visualizations/Cloud.php @@ -15,7 +15,6 @@ use Piwik\DataTable; use Piwik\Log; use Piwik\View; use Piwik\Plugin\Visualization; -use Piwik\ViewDataTable\Config; /** * Generates a tag cloud from a given data array. diff --git a/plugins/CustomVariables/Controller.php b/plugins/CustomVariables/Controller.php index cfeac7b693..3ad08c6847 100644 --- a/plugins/CustomVariables/Controller.php +++ b/plugins/CustomVariables/Controller.php @@ -12,7 +12,7 @@ namespace Piwik\Plugins\CustomVariables; use Piwik\Piwik; use Piwik\View; -use Piwik\ViewDataTable; +use Piwik\ViewDataTable\Factory; /** * @package CustomVariables @@ -28,12 +28,12 @@ class Controller extends \Piwik\Plugin\Controller public function getCustomVariables($fetch = false) { - return ViewDataTable::renderReport($this->pluginName, __FUNCTION__, $fetch); + return Factory::renderReport($this->pluginName, __FUNCTION__, $fetch); } public function getCustomVariablesValuesFromNameId($fetch = false) { - return ViewDataTable::renderReport($this->pluginName, __FUNCTION__, $fetch); + return Factory::renderReport($this->pluginName, __FUNCTION__, $fetch); } } diff --git a/plugins/DBStats/Controller.php b/plugins/DBStats/Controller.php index 807357ad8f..696f52838a 100644 --- a/plugins/DBStats/Controller.php +++ b/plugins/DBStats/Controller.php @@ -13,7 +13,7 @@ namespace Piwik\Plugins\DBStats; use Piwik\MetricsFormatter; use Piwik\Piwik; use Piwik\View; -use Piwik\ViewDataTable; +use Piwik\ViewDataTable\Factory; /** * @package DBStats @@ -58,7 +58,7 @@ class Controller extends \Piwik\Plugin\ControllerAdmin public function getDatabaseUsageSummary($fetch = false) { Piwik::checkUserIsSuperUser(); - return ViewDataTable::renderReport($this->pluginName, __FUNCTION__, $fetch); + return Factory::renderReport($this->pluginName, __FUNCTION__, $fetch); } /** @@ -72,7 +72,7 @@ class Controller extends \Piwik\Plugin\ControllerAdmin public function getTrackerDataSummary($fetch = false) { Piwik::checkUserIsSuperUser(); - return ViewDataTable::renderReport($this->pluginName, __FUNCTION__, $fetch); + return Factory::renderReport($this->pluginName, __FUNCTION__, $fetch); } /** @@ -86,7 +86,7 @@ class Controller extends \Piwik\Plugin\ControllerAdmin public function getMetricDataSummary($fetch = false) { Piwik::checkUserIsSuperUser(); - return ViewDataTable::renderReport($this->pluginName, __FUNCTION__, $fetch); + return Factory::renderReport($this->pluginName, __FUNCTION__, $fetch); } /** @@ -100,7 +100,7 @@ class Controller extends \Piwik\Plugin\ControllerAdmin public function getMetricDataSummaryByYear($fetch = false) { Piwik::checkUserIsSuperUser(); - return ViewDataTable::renderReport($this->pluginName, __FUNCTION__, $fetch); + return Factory::renderReport($this->pluginName, __FUNCTION__, $fetch); } /** @@ -114,7 +114,7 @@ class Controller extends \Piwik\Plugin\ControllerAdmin public function getReportDataSummary($fetch = false) { Piwik::checkUserIsSuperUser(); - return ViewDataTable::renderReport($this->pluginName, __FUNCTION__, $fetch); + return Factory::renderReport($this->pluginName, __FUNCTION__, $fetch); } /** @@ -128,7 +128,7 @@ class Controller extends \Piwik\Plugin\ControllerAdmin public function getReportDataSummaryByYear($fetch = false) { Piwik::checkUserIsSuperUser(); - return ViewDataTable::renderReport($this->pluginName, __FUNCTION__, $fetch); + return Factory::renderReport($this->pluginName, __FUNCTION__, $fetch); } /** @@ -144,7 +144,7 @@ class Controller extends \Piwik\Plugin\ControllerAdmin public function getIndividualReportsSummary($fetch = false) { Piwik::checkUserIsSuperUser(); - return ViewDataTable::renderReport($this->pluginName, __FUNCTION__, $fetch); + return Factory::renderReport($this->pluginName, __FUNCTION__, $fetch); } /** @@ -160,7 +160,7 @@ class Controller extends \Piwik\Plugin\ControllerAdmin public function getIndividualMetricsSummary($fetch = false) { Piwik::checkUserIsSuperUser(); - return ViewDataTable::renderReport($this->pluginName, __FUNCTION__, $fetch); + return Factory::renderReport($this->pluginName, __FUNCTION__, $fetch); } /** @@ -177,6 +177,6 @@ class Controller extends \Piwik\Plugin\ControllerAdmin public function getAdminDataSummary($fetch = false) { Piwik::checkUserIsSuperUser(); - return ViewDataTable::renderReport($this->pluginName, __FUNCTION__, $fetch); + return Factory::renderReport($this->pluginName, __FUNCTION__, $fetch); } } diff --git a/plugins/DBStats/DBStats.php b/plugins/DBStats/DBStats.php index 0a1c2b29d3..63f9f439f5 100644 --- a/plugins/DBStats/DBStats.php +++ b/plugins/DBStats/DBStats.php @@ -37,11 +37,11 @@ class DBStats extends \Piwik\Plugin public function getListHooksRegistered() { return array( - 'AssetManager.getStylesheetFiles' => 'getStylesheetFiles', - 'Menu.Admin.addItems' => 'addMenu', - 'TaskScheduler.getScheduledTasks' => 'getScheduledTasks', - 'ViewDataTable.configure' => 'configureViewDataTable', - 'Visualization.getDefaultTypeViewDataTable' => 'getDefaultTypeViewDataTable' + 'AssetManager.getStylesheetFiles' => 'getStylesheetFiles', + 'Menu.Admin.addItems' => 'addMenu', + 'TaskScheduler.getScheduledTasks' => 'getScheduledTasks', + 'ViewDataTable.configure' => 'configureViewDataTable', + 'ViewDataTable.getDefaultType' => 'getDefaultTypeViewDataTable' ); } diff --git a/plugins/DevicesDetection/Controller.php b/plugins/DevicesDetection/Controller.php index ddff5a1b5f..d7b5618f1c 100644 --- a/plugins/DevicesDetection/Controller.php +++ b/plugins/DevicesDetection/Controller.php @@ -14,7 +14,7 @@ use Piwik\Common; use Piwik\Db; use Piwik\Piwik; use Piwik\View; -use Piwik\ViewDataTable; +use Piwik\ViewDataTable\Factory; use UserAgentParserEnhanced; class Controller extends \Piwik\Plugin\Controller @@ -33,37 +33,37 @@ class Controller extends \Piwik\Plugin\Controller public function getType($fetch = false) { - return ViewDataTable::renderReport($this->pluginName, __FUNCTION__, $fetch); + return Factory::renderReport($this->pluginName, __FUNCTION__, $fetch); } public function getBrand($fetch = false) { - return ViewDataTable::renderReport($this->pluginName, __FUNCTION__, $fetch); + return Factory::renderReport($this->pluginName, __FUNCTION__, $fetch); } public function getModel($fetch = false) { - return ViewDataTable::renderReport($this->pluginName, __FUNCTION__, $fetch); + return Factory::renderReport($this->pluginName, __FUNCTION__, $fetch); } public function getOsFamilies($fetch = false) { - return ViewDataTable::renderReport($this->pluginName, __FUNCTION__, $fetch); + return Factory::renderReport($this->pluginName, __FUNCTION__, $fetch); } public function getOsVersions($fetch = false) { - return ViewDataTable::renderReport($this->pluginName, __FUNCTION__, $fetch); + return Factory::renderReport($this->pluginName, __FUNCTION__, $fetch); } public function getBrowserFamilies($fetch = false) { - return ViewDataTable::renderReport($this->pluginName, __FUNCTION__, $fetch); + return Factory::renderReport($this->pluginName, __FUNCTION__, $fetch); } public function getBrowserVersions($fetch = false) { - return ViewDataTable::renderReport($this->pluginName, __FUNCTION__, $fetch); + return Factory::renderReport($this->pluginName, __FUNCTION__, $fetch); } /** 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; diff --git a/plugins/ExampleVisualization/ExampleVisualization.php b/plugins/ExampleVisualization/ExampleVisualization.php index e445bb18a4..c7a05d9584 100644 --- a/plugins/ExampleVisualization/ExampleVisualization.php +++ b/plugins/ExampleVisualization/ExampleVisualization.php @@ -23,7 +23,7 @@ class ExampleVisualization extends Plugin public function getListHooksRegistered() { return array( - 'Visualization.addVisualizations' => 'getAvailableVisualizations' + 'ViewDataTable.addViewDataTable' => 'getAvailableVisualizations' ); } diff --git a/plugins/Goals/Controller.php b/plugins/Goals/Controller.php index 87ea5ed158..38dcc9f8ad 100644 --- a/plugins/Goals/Controller.php +++ b/plugins/Goals/Controller.php @@ -21,7 +21,7 @@ use Piwik\Plugins\Referrers\API as APIReferrers; use Piwik\Plugins\VisitFrequency\VisitFrequency; use Piwik\View\ReportsByDimension; use Piwik\View; -use Piwik\ViewDataTable; +use Piwik\ViewDataTable\Factory; /** * @@ -463,26 +463,26 @@ class Controller extends \Piwik\Plugin\Controller public function getItemsSku($fetch = false) { - return ViewDataTable::renderReport($this->pluginName, __FUNCTION__, $fetch); + return Factory::renderReport($this->pluginName, __FUNCTION__, $fetch); } public function getItemsName($fetch = false) { - return ViewDataTable::renderReport($this->pluginName, __FUNCTION__, $fetch); + return Factory::renderReport($this->pluginName, __FUNCTION__, $fetch); } public function getItemsCategory($fetch = false) { - return ViewDataTable::renderReport($this->pluginName, __FUNCTION__, $fetch); + return Factory::renderReport($this->pluginName, __FUNCTION__, $fetch); } public function getVisitsUntilConversion($fetch = false) { - return ViewDataTable::renderReport($this->pluginName, __FUNCTION__, $fetch); + return Factory::renderReport($this->pluginName, __FUNCTION__, $fetch); } public function getDaysToConversion($fetch = false) { - return ViewDataTable::renderReport($this->pluginName, __FUNCTION__, $fetch); + return Factory::renderReport($this->pluginName, __FUNCTION__, $fetch); } } diff --git a/plugins/Goals/Goals.php b/plugins/Goals/Goals.php index 31db9f742e..e6c0ebe80f 100644 --- a/plugins/Goals/Goals.php +++ b/plugins/Goals/Goals.php @@ -102,7 +102,7 @@ class Goals extends \Piwik\Plugin 'Goals.getReportsWithGoalMetrics' => 'getActualReportsWithGoalMetrics', 'ViewDataTable.configure' => 'configureViewDataTable', 'Translate.getClientSideTranslationKeys' => 'getClientSideTranslationKeys', - 'Visualization.addVisualizations' => 'getAvailableDataTableVisualizations' + 'ViewDataTable.addViewDataTable' => 'getAvailableDataTableVisualizations' ); return $hooks; } diff --git a/plugins/Live/Controller.php b/plugins/Live/Controller.php index 05740915f4..f4c7ac2acd 100644 --- a/plugins/Live/Controller.php +++ b/plugins/Live/Controller.php @@ -19,7 +19,7 @@ use Piwik\Plugins\Goals\API as APIGoals; use Piwik\Plugin\Manager; use Piwik\Url; use Piwik\View; -use Piwik\ViewDataTable; +use Piwik\ViewDataTable\Factory; /** * @package Live @@ -96,7 +96,7 @@ class Controller extends \Piwik\Plugin\Controller public function getLastVisitsDetails($fetch = false) { - return ViewDataTable::renderReport($this->pluginName, __FUNCTION__, $fetch); + return Factory::renderReport($this->pluginName, __FUNCTION__, $fetch); } /** diff --git a/plugins/Live/Live.php b/plugins/Live/Live.php index 66eca4b35b..f1403c6983 100644 --- a/plugins/Live/Live.php +++ b/plugins/Live/Live.php @@ -31,13 +31,13 @@ class Live extends \Piwik\Plugin public function getListHooksRegistered() { return array( - 'AssetManager.getJavaScriptFiles' => 'getJsFiles', - 'AssetManager.getStylesheetFiles' => 'getStylesheetFiles', - 'WidgetsList.addWidgets' => 'addWidget', - 'Menu.Reporting.addItems' => 'addMenu', - 'ViewDataTable.configure' => 'configureViewDataTable', - 'Translate.getClientSideTranslationKeys' => 'getClientSideTranslationKeys', - 'Visualization.getDefaultTypeViewDataTable' => 'getDefaultTypeViewDataTable' + 'AssetManager.getJavaScriptFiles' => 'getJsFiles', + 'AssetManager.getStylesheetFiles' => 'getStylesheetFiles', + 'WidgetsList.addWidgets' => 'addWidget', + 'Menu.Reporting.addItems' => 'addMenu', + 'ViewDataTable.configure' => 'configureViewDataTable', + 'Translate.getClientSideTranslationKeys' => 'getClientSideTranslationKeys', + 'ViewDataTable.getDefaultType' => 'getDefaultTypeViewDataTable' ); } diff --git a/plugins/Provider/Controller.php b/plugins/Provider/Controller.php index 4fde51d552..8c4df83174 100644 --- a/plugins/Provider/Controller.php +++ b/plugins/Provider/Controller.php @@ -10,7 +10,7 @@ */ namespace Piwik\Plugins\Provider; -use Piwik\ViewDataTable; +use Piwik\ViewDataTable\Factory; /** * @@ -25,7 +25,7 @@ class Controller extends \Piwik\Plugin\Controller */ public function getProvider($fetch = false) { - return ViewDataTable::renderReport($this->pluginName, __FUNCTION__, $fetch); + return Factory::renderReport($this->pluginName, __FUNCTION__, $fetch); } } diff --git a/plugins/Referrers/Controller.php b/plugins/Referrers/Controller.php index bf15aa9f74..eaacb1d920 100644 --- a/plugins/Referrers/Controller.php +++ b/plugins/Referrers/Controller.php @@ -18,7 +18,7 @@ use Piwik\Period\Range; use Piwik\Piwik; use Piwik\Url; use Piwik\View; -use Piwik\ViewDataTable; +use Piwik\ViewDataTable\Factory; /** * @@ -139,7 +139,7 @@ class Controller extends \Piwik\Plugin\Controller public function getReferrerType($fetch = false) { - return ViewDataTable::renderReport($this->pluginName, __FUNCTION__, $fetch); + return Factory::renderReport($this->pluginName, __FUNCTION__, $fetch); } /** @@ -152,27 +152,27 @@ class Controller extends \Piwik\Plugin\Controller */ public function getAll($fetch = false) { - return ViewDataTable::renderReport($this->pluginName, __FUNCTION__, $fetch); + return Factory::renderReport($this->pluginName, __FUNCTION__, $fetch); } public function getKeywords($fetch = false) { - return ViewDataTable::renderReport($this->pluginName, __FUNCTION__, $fetch); + return Factory::renderReport($this->pluginName, __FUNCTION__, $fetch); } public function getSearchEnginesFromKeywordId($fetch = false) { - return ViewDataTable::renderReport($this->pluginName, __FUNCTION__, $fetch); + return Factory::renderReport($this->pluginName, __FUNCTION__, $fetch); } public function getSearchEngines($fetch = false) { - return ViewDataTable::renderReport($this->pluginName, __FUNCTION__, $fetch); + return Factory::renderReport($this->pluginName, __FUNCTION__, $fetch); } public function getKeywordsFromSearchEngineId($fetch = false) { - return ViewDataTable::renderReport($this->pluginName, __FUNCTION__, $fetch); + return Factory::renderReport($this->pluginName, __FUNCTION__, $fetch); } public function indexWebsites($fetch = false) @@ -189,17 +189,17 @@ class Controller extends \Piwik\Plugin\Controller public function getWebsites($fetch = false) { - return ViewDataTable::renderReport($this->pluginName, __FUNCTION__, $fetch); + return Factory::renderReport($this->pluginName, __FUNCTION__, $fetch); } public function getSocials($fetch = false) { - return ViewDataTable::renderReport($this->pluginName, __FUNCTION__, $fetch); + return Factory::renderReport($this->pluginName, __FUNCTION__, $fetch); } public function getUrlsForSocial($fetch = false) { - return ViewDataTable::renderReport($this->pluginName, __FUNCTION__, $fetch); + return Factory::renderReport($this->pluginName, __FUNCTION__, $fetch); } public function indexCampaigns($fetch = false) @@ -211,17 +211,17 @@ class Controller extends \Piwik\Plugin\Controller public function getCampaigns($fetch = false) { - return ViewDataTable::renderReport($this->pluginName, __FUNCTION__, $fetch); + return Factory::renderReport($this->pluginName, __FUNCTION__, $fetch); } public function getKeywordsFromCampaignId($fetch = false) { - return ViewDataTable::renderReport($this->pluginName, __FUNCTION__, $fetch); + return Factory::renderReport($this->pluginName, __FUNCTION__, $fetch); } public function getUrlsFromWebsiteId($fetch = false) { - return ViewDataTable::renderReport($this->pluginName, __FUNCTION__, $fetch); + return Factory::renderReport($this->pluginName, __FUNCTION__, $fetch); } protected function getReferrersVisitorsByType($date = false) diff --git a/plugins/Referrers/Referrers.php b/plugins/Referrers/Referrers.php index b452ebc4e3..cd3a5f0920 100644 --- a/plugins/Referrers/Referrers.php +++ b/plugins/Referrers/Referrers.php @@ -37,15 +37,15 @@ class Referrers extends \Piwik\Plugin public function getListHooksRegistered() { $hooks = array( - 'ArchiveProcessor.Day.compute' => 'archiveDay', - 'ArchiveProcessor.Period.compute' => 'archivePeriod', - 'WidgetsList.addWidgets' => 'addWidgets', - 'Menu.Reporting.addItems' => 'addMenus', - 'Goals.getReportsWithGoalMetrics' => 'getReportsWithGoalMetrics', - 'API.getReportMetadata' => 'getReportMetadata', - 'API.getSegmentsMetadata' => 'getSegmentsMetadata', - 'ViewDataTable.configure' => 'configureViewDataTable', - 'Visualization.getDefaultTypeViewDataTable' => 'getDefaultTypeViewDataTable' + 'ArchiveProcessor.Day.compute' => 'archiveDay', + 'ArchiveProcessor.Period.compute' => 'archivePeriod', + 'WidgetsList.addWidgets' => 'addWidgets', + 'Menu.Reporting.addItems' => 'addMenus', + 'Goals.getReportsWithGoalMetrics' => 'getReportsWithGoalMetrics', + 'API.getReportMetadata' => 'getReportMetadata', + 'API.getSegmentsMetadata' => 'getSegmentsMetadata', + 'ViewDataTable.configure' => 'configureViewDataTable', + 'ViewDataTable.getDefaultType' => 'getDefaultTypeViewDataTable' ); return $hooks; } diff --git a/plugins/UserCountry/Controller.php b/plugins/UserCountry/Controller.php index 7390c8d687..8cc5b02aea 100644 --- a/plugins/UserCountry/Controller.php +++ b/plugins/UserCountry/Controller.php @@ -22,7 +22,7 @@ use Piwik\Plugins\UserCountry\LocationProvider; use Piwik\Plugins\UserCountry\LocationProvider\GeoIp; use Piwik\Plugins\UserCountry\LocationProvider\GeoIp\ServerBased; use Piwik\View; -use Piwik\ViewDataTable; +use Piwik\ViewDataTable\Factory; /** * @@ -327,12 +327,12 @@ class Controller extends \Piwik\Plugin\ControllerAdmin public function getCountry($fetch = false) { - return ViewDataTable::renderReport($this->pluginName, __FUNCTION__, $fetch); + return Factory::renderReport($this->pluginName, __FUNCTION__, $fetch); } public function getContinent($fetch = false) { - return ViewDataTable::renderReport($this->pluginName, __FUNCTION__, $fetch); + return Factory::renderReport($this->pluginName, __FUNCTION__, $fetch); } /** @@ -343,7 +343,7 @@ class Controller extends \Piwik\Plugin\ControllerAdmin */ public function getRegion($fetch = false) { - return ViewDataTable::renderReport($this->pluginName, __FUNCTION__, $fetch); + return Factory::renderReport($this->pluginName, __FUNCTION__, $fetch); } /** @@ -354,7 +354,7 @@ class Controller extends \Piwik\Plugin\ControllerAdmin */ public function getCity($fetch = false) { - return ViewDataTable::renderReport($this->pluginName, __FUNCTION__, $fetch); + return Factory::renderReport($this->pluginName, __FUNCTION__, $fetch); } public function getNumberOfDistinctCountries($fetch = false) diff --git a/plugins/UserCountryMap/Controller.php b/plugins/UserCountryMap/Controller.php index 235370d12f..2cd241e2e4 100644 --- a/plugins/UserCountryMap/Controller.php +++ b/plugins/UserCountryMap/Controller.php @@ -18,7 +18,7 @@ use Piwik\Piwik; use Piwik\Plugins\Goals\API as APIGoals; use Piwik\Site; use Piwik\View; -use Piwik\ViewDataTable; +use Piwik\ViewDataTable\Factory; /** * diff --git a/plugins/UserSettings/Controller.php b/plugins/UserSettings/Controller.php index 3b9d6b331d..b674d326a4 100644 --- a/plugins/UserSettings/Controller.php +++ b/plugins/UserSettings/Controller.php @@ -11,7 +11,7 @@ namespace Piwik\Plugins\UserSettings; use Piwik\View; -use Piwik\ViewDataTable; +use Piwik\ViewDataTable\Factory; /** * @@ -37,56 +37,56 @@ class Controller extends \Piwik\Plugin\Controller public function getResolution($fetch = false) { - return ViewDataTable::renderReport($this->pluginName, __FUNCTION__, $fetch); + return Factory::renderReport($this->pluginName, __FUNCTION__, $fetch); } public function getConfiguration($fetch = false) { - return ViewDataTable::renderReport($this->pluginName, __FUNCTION__, $fetch); + return Factory::renderReport($this->pluginName, __FUNCTION__, $fetch); } public function getOS($fetch = false) { - return ViewDataTable::renderReport($this->pluginName, __FUNCTION__, $fetch); + return Factory::renderReport($this->pluginName, __FUNCTION__, $fetch); } public function getOSFamily($fetch = false) { - return ViewDataTable::renderReport($this->pluginName, __FUNCTION__, $fetch); + return Factory::renderReport($this->pluginName, __FUNCTION__, $fetch); } public function getMobileVsDesktop($fetch = false) { - return ViewDataTable::renderReport($this->pluginName, __FUNCTION__, $fetch); + return Factory::renderReport($this->pluginName, __FUNCTION__, $fetch); } public function getBrowserVersion($fetch = false) { - return ViewDataTable::renderReport($this->pluginName, __FUNCTION__, $fetch); + return Factory::renderReport($this->pluginName, __FUNCTION__, $fetch); } public function getBrowser($fetch = false) { - return ViewDataTable::renderReport($this->pluginName, __FUNCTION__, $fetch); + return Factory::renderReport($this->pluginName, __FUNCTION__, $fetch); } public function getBrowserType($fetch = false) { - return ViewDataTable::renderReport($this->pluginName, __FUNCTION__, $fetch); + return Factory::renderReport($this->pluginName, __FUNCTION__, $fetch); } public function getWideScreen($fetch = false) { - return ViewDataTable::renderReport($this->pluginName, __FUNCTION__, $fetch); + return Factory::renderReport($this->pluginName, __FUNCTION__, $fetch); } public function getPlugin($fetch = false) { - return ViewDataTable::renderReport($this->pluginName, __FUNCTION__, $fetch); + return Factory::renderReport($this->pluginName, __FUNCTION__, $fetch); } public function getLanguage($fetch = false) { - return ViewDataTable::renderReport($this->pluginName, __FUNCTION__, $fetch); + return Factory::renderReport($this->pluginName, __FUNCTION__, $fetch); } } diff --git a/plugins/UserSettings/UserSettings.php b/plugins/UserSettings/UserSettings.php index 6617fe8d05..540a20a5de 100644 --- a/plugins/UserSettings/UserSettings.php +++ b/plugins/UserSettings/UserSettings.php @@ -169,14 +169,14 @@ class UserSettings extends \Piwik\Plugin public function getListHooksRegistered() { $hooks = array( - 'ArchiveProcessor.Day.compute' => 'archiveDay', - 'ArchiveProcessor.Period.compute' => 'archivePeriod', - 'WidgetsList.addWidgets' => 'addWidgets', - 'Menu.Reporting.addItems' => 'addMenu', - 'API.getReportMetadata' => 'getReportMetadata', - 'API.getSegmentsMetadata' => 'getSegmentsMetadata', - 'ViewDataTable.configure' => 'configureViewDataTable', - 'Visualization.getDefaultTypeViewDataTable' => 'getDefaultTypeViewDataTable' + 'ArchiveProcessor.Day.compute' => 'archiveDay', + 'ArchiveProcessor.Period.compute' => 'archivePeriod', + 'WidgetsList.addWidgets' => 'addWidgets', + 'Menu.Reporting.addItems' => 'addMenu', + 'API.getReportMetadata' => 'getReportMetadata', + 'API.getSegmentsMetadata' => 'getSegmentsMetadata', + 'ViewDataTable.configure' => 'configureViewDataTable', + 'ViewDataTable.getDefaultType' => 'getDefaultTypeViewDataTable' ); return $hooks; } diff --git a/plugins/VisitTime/Controller.php b/plugins/VisitTime/Controller.php index 25411acbe9..d779d3fa3c 100644 --- a/plugins/VisitTime/Controller.php +++ b/plugins/VisitTime/Controller.php @@ -11,7 +11,7 @@ namespace Piwik\Plugins\VisitTime; use Piwik\View; -use Piwik\ViewDataTable; +use Piwik\ViewDataTable\Factory; /** * @@ -29,16 +29,16 @@ class Controller extends \Piwik\Plugin\Controller public function getVisitInformationPerServerTime($fetch = false) { - return ViewDataTable::renderReport($this->pluginName, __FUNCTION__, $fetch); + return Factory::renderReport($this->pluginName, __FUNCTION__, $fetch); } public function getVisitInformationPerLocalTime($fetch = false) { - return ViewDataTable::renderReport($this->pluginName, __FUNCTION__, $fetch); + return Factory::renderReport($this->pluginName, __FUNCTION__, $fetch); } public function getByDayOfWeek($fetch = false) { - return ViewDataTable::renderReport($this->pluginName, __FUNCTION__, $fetch); + return Factory::renderReport($this->pluginName, __FUNCTION__, $fetch); } } diff --git a/plugins/VisitTime/VisitTime.php b/plugins/VisitTime/VisitTime.php index c33d7cef3f..2053192514 100644 --- a/plugins/VisitTime/VisitTime.php +++ b/plugins/VisitTime/VisitTime.php @@ -35,15 +35,15 @@ class VisitTime extends \Piwik\Plugin public function getListHooksRegistered() { $hooks = array( - 'ArchiveProcessor.Day.compute' => 'archiveDay', - 'ArchiveProcessor.Period.compute' => 'archivePeriod', - 'WidgetsList.addWidgets' => 'addWidgets', - 'Menu.Reporting.addItems' => 'addMenu', - 'Goals.getReportsWithGoalMetrics' => 'getReportsWithGoalMetrics', - 'API.getReportMetadata' => 'getReportMetadata', - 'API.getSegmentsMetadata' => 'getSegmentsMetadata', - 'ViewDataTable.configure' => 'configureViewDataTable', - 'Visualization.getDefaultTypeViewDataTable' => 'getDefaultTypeViewDataTable' + 'ArchiveProcessor.Day.compute' => 'archiveDay', + 'ArchiveProcessor.Period.compute' => 'archivePeriod', + 'WidgetsList.addWidgets' => 'addWidgets', + 'Menu.Reporting.addItems' => 'addMenu', + 'Goals.getReportsWithGoalMetrics' => 'getReportsWithGoalMetrics', + 'API.getReportMetadata' => 'getReportMetadata', + 'API.getSegmentsMetadata' => 'getSegmentsMetadata', + 'ViewDataTable.configure' => 'configureViewDataTable', + 'ViewDataTable.getDefaultType' => 'getDefaultTypeViewDataTable' ); return $hooks; } diff --git a/plugins/VisitorInterest/Controller.php b/plugins/VisitorInterest/Controller.php index e57b48fe35..2cb63a188d 100644 --- a/plugins/VisitorInterest/Controller.php +++ b/plugins/VisitorInterest/Controller.php @@ -11,7 +11,7 @@ namespace Piwik\Plugins\VisitorInterest; use Piwik\View; -use Piwik\ViewDataTable; +use Piwik\ViewDataTable\Factory; /** * @package VisitorInterest @@ -30,12 +30,12 @@ class Controller extends \Piwik\Plugin\Controller public function getNumberOfVisitsPerVisitDuration($fetch = false) { - return ViewDataTable::renderReport($this->pluginName, __FUNCTION__, $fetch); + return Factory::renderReport($this->pluginName, __FUNCTION__, $fetch); } public function getNumberOfVisitsPerPage($fetch = false) { - return ViewDataTable::renderReport($this->pluginName, __FUNCTION__, $fetch); + return Factory::renderReport($this->pluginName, __FUNCTION__, $fetch); } /** @@ -47,7 +47,7 @@ class Controller extends \Piwik\Plugin\Controller */ public function getNumberOfVisitsByVisitCount($fetch = false) { - return ViewDataTable::renderReport($this->pluginName, __FUNCTION__, $fetch); + return Factory::renderReport($this->pluginName, __FUNCTION__, $fetch); } /** @@ -59,6 +59,6 @@ class Controller extends \Piwik\Plugin\Controller */ public function getNumberOfVisitsByDaysSinceLast($fetch = false) { - return ViewDataTable::renderReport($this->pluginName, __FUNCTION__, $fetch); + return Factory::renderReport($this->pluginName, __FUNCTION__, $fetch); } } diff --git a/plugins/VisitorInterest/VisitorInterest.php b/plugins/VisitorInterest/VisitorInterest.php index a93d203ace..6651c4d4ca 100644 --- a/plugins/VisitorInterest/VisitorInterest.php +++ b/plugins/VisitorInterest/VisitorInterest.php @@ -33,13 +33,13 @@ class VisitorInterest extends \Piwik\Plugin public function getListHooksRegistered() { $hooks = array( - 'ArchiveProcessor.Day.compute' => 'archiveDay', - 'ArchiveProcessor.Period.compute' => 'archivePeriod', - 'WidgetsList.addWidgets' => 'addWidgets', - 'Menu.Reporting.addItems' => 'addMenu', - 'API.getReportMetadata' => 'getReportMetadata', - 'ViewDataTable.configure' => 'configureViewDataTable', - 'Visualization.getDefaultTypeViewDataTable' => 'getDefaultTypeViewDataTable' + 'ArchiveProcessor.Day.compute' => 'archiveDay', + 'ArchiveProcessor.Period.compute' => 'archivePeriod', + 'WidgetsList.addWidgets' => 'addWidgets', + 'Menu.Reporting.addItems' => 'addMenu', + 'API.getReportMetadata' => 'getReportMetadata', + 'ViewDataTable.configure' => 'configureViewDataTable', + 'ViewDataTable.getDefaultType' => 'getDefaultTypeViewDataTable' ); return $hooks; } diff --git a/plugins/VisitsSummary/Controller.php b/plugins/VisitsSummary/Controller.php index 27c249f7a9..1d4ad2cb26 100644 --- a/plugins/VisitsSummary/Controller.php +++ b/plugins/VisitsSummary/Controller.php @@ -18,7 +18,7 @@ use Piwik\Piwik; use Piwik\Plugins\Actions\API as APIActions; use Piwik\Site; use Piwik\View; -use Piwik\ViewDataTable; +use Piwik\ViewDataTable\Factory; /** * |