diff options
author | Thomas Steur <thomas.steur@gmail.com> | 2015-05-07 04:55:23 +0300 |
---|---|---|
committer | Thomas Steur <thomas.steur@gmail.com> | 2015-05-07 04:55:23 +0300 |
commit | 12868d4bd0277305583b15c0c1c078437bb49056 (patch) | |
tree | 1e34d7e59968526425c3314a7a6ef0966aa90e71 | |
parent | c6ed2a5a74fd1fa8aeec23b6f4c81666a8647c8b (diff) |
refs #7821 do not instantiate reports directly
28 files changed, 72 insertions, 98 deletions
diff --git a/plugins/Actions/Controller.php b/plugins/Actions/Controller.php index f28ba54ca2..51c7d7ba3a 100644 --- a/plugins/Actions/Controller.php +++ b/plugins/Actions/Controller.php @@ -9,10 +9,6 @@ namespace Piwik\Plugins\Actions; use Piwik\Plugin\Report; -use Piwik\Plugins\Actions\Reports\GetPageUrlsFollowingSiteSearch; -use Piwik\Plugins\Actions\Reports\GetSiteSearchCategories; -use Piwik\Plugins\Actions\Reports\GetSiteSearchKeywords; -use Piwik\Plugins\Actions\Reports\GetSiteSearchNoResultKeywords; use Piwik\View; /** @@ -29,9 +25,9 @@ class Controller extends \Piwik\Plugin\Controller { $view = new View('@Actions/indexSiteSearch'); - $keyword = new GetSiteSearchKeywords(); - $noResult = new GetSiteSearchNoResultKeywords(); - $pageUrls = new GetPageUrlsFollowingSiteSearch(); + $keyword = Report::factory($this->pluginName, 'getSiteSearchKeywords'); + $noResult = Report::factory($this->pluginName, 'getSiteSearchNoResultKeywords'); + $pageUrls = Report::factory($this->pluginName, 'getPageUrlsFollowingSiteSearch'); $view->keywords = $keyword->render(); $view->noResultKeywords = $noResult->render(); @@ -39,7 +35,7 @@ class Controller extends \Piwik\Plugin\Controller $categoryTrackingEnabled = Actions::isCustomVariablesPluginsEnabled(); if ($categoryTrackingEnabled) { - $categories = new GetSiteSearchCategories(); + $categories = Report::factory($this->pluginName, 'getSiteSearchCategories'); $view->categories = $categories->render(); } diff --git a/plugins/Actions/Reports/GetEntryPageTitles.php b/plugins/Actions/Reports/GetEntryPageTitles.php index e773f0ce43..e166c87cb8 100644 --- a/plugins/Actions/Reports/GetEntryPageTitles.php +++ b/plugins/Actions/Reports/GetEntryPageTitles.php @@ -79,8 +79,8 @@ class GetEntryPageTitles extends Base public function getRelatedReports() { return array( - new GetPageTitles(), - new GetEntryPageUrls() + self::factory('Actions', 'getPageTitles'), + self::factory('Actions', 'getEntryPageUrls') ); } } diff --git a/plugins/Actions/Reports/GetEntryPageUrls.php b/plugins/Actions/Reports/GetEntryPageUrls.php index 05b1102299..dfb3febee6 100644 --- a/plugins/Actions/Reports/GetEntryPageUrls.php +++ b/plugins/Actions/Reports/GetEntryPageUrls.php @@ -83,7 +83,7 @@ class GetEntryPageUrls extends Base public function getRelatedReports() { return array( - new GetEntryPageTitles() + self::factory('Actions', 'getEntryPageTitles'), ); } } diff --git a/plugins/Actions/Reports/GetExitPageTitles.php b/plugins/Actions/Reports/GetExitPageTitles.php index f6d15db0c1..6cc5b1f320 100644 --- a/plugins/Actions/Reports/GetExitPageTitles.php +++ b/plugins/Actions/Reports/GetExitPageTitles.php @@ -86,8 +86,8 @@ class GetExitPageTitles extends Base public function getRelatedReports() { return array( - new GetPageTitles(), - new GetExitPageUrls() + self::factory('Actions', 'getPageTitles'), + self::factory('Actions', 'getExitPageUrls'), ); } } diff --git a/plugins/Actions/Reports/GetExitPageUrls.php b/plugins/Actions/Reports/GetExitPageUrls.php index 2762a1139a..2ef5d7a957 100644 --- a/plugins/Actions/Reports/GetExitPageUrls.php +++ b/plugins/Actions/Reports/GetExitPageUrls.php @@ -97,7 +97,7 @@ class GetExitPageUrls extends Base public function getRelatedReports() { return array( - new GetExitPageTitles() + self::factory('Actions', 'getExitPageTitles'), ); } diff --git a/plugins/Actions/Reports/GetPageTitles.php b/plugins/Actions/Reports/GetPageTitles.php index d41082d149..8f7e193f9b 100644 --- a/plugins/Actions/Reports/GetPageTitles.php +++ b/plugins/Actions/Reports/GetPageTitles.php @@ -81,8 +81,8 @@ class GetPageTitles extends Base public function getRelatedReports() { return array( - new GetEntryPageTitles(), - new GetExitPageTitles() + self::factory('Actions', 'getEntryPageTitles'), + self::factory('Actions', 'getExitPageTitles'), ); } } diff --git a/plugins/Actions/Reports/GetPageTitlesFollowingSiteSearch.php b/plugins/Actions/Reports/GetPageTitlesFollowingSiteSearch.php index 620b1af214..657e88211d 100644 --- a/plugins/Actions/Reports/GetPageTitlesFollowingSiteSearch.php +++ b/plugins/Actions/Reports/GetPageTitlesFollowingSiteSearch.php @@ -80,7 +80,7 @@ class GetPageTitlesFollowingSiteSearch extends SiteSearchBase public function getRelatedReports() { return array( - new GetPageUrlsFollowingSiteSearch() + self::factory('Actions', 'getPageUrlsFollowingSiteSearch'), ); } } diff --git a/plugins/Actions/Reports/GetPageUrlsFollowingSiteSearch.php b/plugins/Actions/Reports/GetPageUrlsFollowingSiteSearch.php index 032fdadafc..2d8ba1a3a2 100644 --- a/plugins/Actions/Reports/GetPageUrlsFollowingSiteSearch.php +++ b/plugins/Actions/Reports/GetPageUrlsFollowingSiteSearch.php @@ -34,7 +34,7 @@ class GetPageUrlsFollowingSiteSearch extends GetPageTitlesFollowingSiteSearch public function getRelatedReports() { return array( - new GetPageTitlesFollowingSiteSearch() + self::factory('Actions', 'getPageTitlesFollowingSiteSearch'), ); } } diff --git a/plugins/Contents/Controller.php b/plugins/Contents/Controller.php index 5785ba478c..a17ec3fdce 100644 --- a/plugins/Contents/Controller.php +++ b/plugins/Contents/Controller.php @@ -9,8 +9,6 @@ namespace Piwik\Plugins\Contents; use Piwik\Plugin\Report; -use Piwik\Plugins\Contents\Reports\GetContentNames; -use Piwik\Plugins\Contents\Reports\GetContentPieces; use Piwik\View; class Controller extends \Piwik\Plugin\Controller @@ -21,7 +19,9 @@ class Controller extends \Piwik\Plugin\Controller $reportsView = new View\ReportsByDimension('Contents'); /** @var \Piwik\Plugin\Report[] $reports */ - $reports = array(new GetContentNames(), new GetContentPieces()); + $contentNames = Report::factory($this->pluginName, 'getContentNames'); + $contentPieces = Report::factory($this->pluginName, 'getContentPieces'); + $reports = array($contentNames, $contentPieces); foreach($reports as $report) { $reportsView->addReport( @@ -36,14 +36,14 @@ class Controller extends \Piwik\Plugin\Controller public function menuGetContentNames() { - $report = new GetContentNames(); + $report = Report::factory($this->pluginName, 'getContentNames'); return View::singleReport($report->getName(), $report->render()); } public function menuGetContentPieces() { - $report = new GetContentPieces(); + $report = Report::factory($this->pluginName, 'getContentPieces'); return View::singleReport($report->getName(), $report->render()); } diff --git a/plugins/DBStats/Controller.php b/plugins/DBStats/Controller.php index 1e8aad1311..8db31cf4df 100644 --- a/plugins/DBStats/Controller.php +++ b/plugins/DBStats/Controller.php @@ -10,11 +10,6 @@ namespace Piwik\Plugins\DBStats; use Piwik\Metrics\Formatter; use Piwik\Piwik; -use Piwik\Plugins\DBStats\Reports\GetAdminDataSummary; -use Piwik\Plugins\DBStats\Reports\GetDatabaseUsageSummary; -use Piwik\Plugins\DBStats\Reports\GetMetricDataSummary; -use Piwik\Plugins\DBStats\Reports\GetReportDataSummary; -use Piwik\Plugins\DBStats\Reports\GetTrackerDataSummary; use Piwik\View; /** @@ -34,11 +29,11 @@ class Controller extends \Piwik\Plugin\ControllerAdmin $view = new View('@DBStats/index'); $this->setBasicVariablesView($view); - $view->databaseUsageSummary = $this->renderReport(new GetDatabaseUsageSummary()); - $view->trackerDataSummary = $this->renderReport(new GetTrackerDataSummary()); - $view->metricDataSummary = $this->renderReport(new GetMetricDataSummary()); - $view->reportDataSummary = $this->renderReport(new GetReportDataSummary()); - $view->adminDataSummary = $this->renderReport(new GetAdminDataSummary()); + $view->databaseUsageSummary = $this->renderReport('getDatabaseUsageSummary'); + $view->trackerDataSummary = $this->renderReport('getTrackerDataSummary'); + $view->metricDataSummary = $this->renderReport('getMetricDataSummary'); + $view->reportDataSummary = $this->renderReport('getReportDataSummary'); + $view->adminDataSummary = $this->renderReport('getAdminDataSummary'); list($siteCount, $userCount, $totalSpaceUsed) = API::getInstance()->getGeneralInformation(); diff --git a/plugins/DBStats/Reports/GetMetricDataSummary.php b/plugins/DBStats/Reports/GetMetricDataSummary.php index ed88a50803..92b93fce9b 100644 --- a/plugins/DBStats/Reports/GetMetricDataSummary.php +++ b/plugins/DBStats/Reports/GetMetricDataSummary.php @@ -33,7 +33,9 @@ class GetMetricDataSummary extends Base public function getRelatedReports() { - return array(new GetMetricDataSummaryByYear()); + return array( + self::factory('DBStats', 'getMetricDataSummaryByYear'), + ); } } diff --git a/plugins/DBStats/Reports/GetMetricDataSummaryByYear.php b/plugins/DBStats/Reports/GetMetricDataSummaryByYear.php index 4d370fc642..74907d4d9f 100644 --- a/plugins/DBStats/Reports/GetMetricDataSummaryByYear.php +++ b/plugins/DBStats/Reports/GetMetricDataSummaryByYear.php @@ -34,7 +34,9 @@ class GetMetricDataSummaryByYear extends Base public function getRelatedReports() { - return array(new GetMetricDataSummary()); + return array( + self::factory('DBStats', 'getMetricDataSummary'), + ); } } diff --git a/plugins/DBStats/Reports/GetReportDataSummary.php b/plugins/DBStats/Reports/GetReportDataSummary.php index b3383570a8..d38f3ee717 100644 --- a/plugins/DBStats/Reports/GetReportDataSummary.php +++ b/plugins/DBStats/Reports/GetReportDataSummary.php @@ -33,6 +33,8 @@ class GetReportDataSummary extends Base public function getRelatedReports() { - return array(new GetReportDataSummaryByYear()); + return array( + self::factory('DBStats', 'getReportDataSummaryByYear'), + ); } } diff --git a/plugins/DBStats/Reports/GetReportDataSummaryByYear.php b/plugins/DBStats/Reports/GetReportDataSummaryByYear.php index 3b538fc26f..173bdd2037 100644 --- a/plugins/DBStats/Reports/GetReportDataSummaryByYear.php +++ b/plugins/DBStats/Reports/GetReportDataSummaryByYear.php @@ -34,7 +34,9 @@ class GetReportDataSummaryByYear extends Base public function getRelatedReports() { - return array(new GetReportDataSummary()); + return array( + self::factory('DBStats', 'getReportDataSummary'), + ); } } diff --git a/plugins/DevicesDetection/Controller.php b/plugins/DevicesDetection/Controller.php index d7ec33d111..636a757d05 100644 --- a/plugins/DevicesDetection/Controller.php +++ b/plugins/DevicesDetection/Controller.php @@ -14,15 +14,7 @@ use Piwik\Db; use Piwik\Piwik; use Piwik\Plugin\ControllerAdmin; use Piwik\Plugin\Manager AS PluginManager; -use Piwik\Plugins\DevicePlugins\Reports\GetPlugin; -use Piwik\Plugins\DevicesDetection\Reports\GetBrand; -use Piwik\Plugins\DevicesDetection\Reports\GetBrowserEngines; -use Piwik\Plugins\DevicesDetection\Reports\GetBrowsers; -use Piwik\Plugins\DevicesDetection\Reports\GetModel; -use Piwik\Plugins\DevicesDetection\Reports\GetOsVersions; -use Piwik\Plugins\DevicesDetection\Reports\GetType; -use Piwik\Plugins\Resolution\Reports\GetConfiguration; -use Piwik\Plugins\Resolution\Reports\GetResolution; +use Piwik\Plugin\Report; use Piwik\View; class Controller extends \Piwik\Plugin\Controller @@ -35,13 +27,13 @@ class Controller extends \Piwik\Plugin\Controller public function devices() { $view = new View('@DevicesDetection/devices'); - $view->deviceTypes = $this->renderReport(new GetType()); - $view->deviceBrands = $this->renderReport(new GetBrand()); - $view->deviceModels = $this->renderReport(new GetModel()); + $view->deviceTypes = $this->renderReport('getType'); + $view->deviceBrands = $this->renderReport('getBrand'); + $view->deviceModels = $this->renderReport('getModel'); $isResolutionEnabled = PluginManager::getInstance()->isPluginActivated('Resolution'); if ($isResolutionEnabled) { - $view->resolutions = $this->renderReport(new GetResolution()); + $view->resolutions = $this->renderReport(Report::factory('Resolution', 'getResolution')); } return $view->render(); @@ -50,18 +42,18 @@ class Controller extends \Piwik\Plugin\Controller public function software() { $view = new View('@DevicesDetection/software'); - $view->osReport = $this->renderReport(new GetOsVersions()); - $view->browserReport = $this->renderReport(new GetBrowsers()); - $view->browserEngineReport = $this->renderReport(new GetBrowserEngines()); + $view->osReport = $this->renderReport('getOsVersions'); + $view->browserReport = $this->renderReport('getBrowsers'); + $view->browserEngineReport = $this->renderReport('getBrowserEngines'); $isResolutionEnabled = PluginManager::getInstance()->isPluginActivated('Resolution'); if ($isResolutionEnabled) { - $view->configurations = $this->renderReport(new GetConfiguration()); + $view->configurations = $this->renderReport(Report::factory('Resolution', 'getConfiguration')); } $isDevicePluginsEnabled = PluginManager::getInstance()->isPluginActivated('DevicePlugins'); if ($isDevicePluginsEnabled) { - $view->browserPlugins = $this->renderReport(new GetPlugin()); + $view->browserPlugins = $this->renderReport(Report::factory('DevicePlugins', 'getPlugin')); } return $view->render(); diff --git a/plugins/DevicesDetection/Reports/GetBrowserVersions.php b/plugins/DevicesDetection/Reports/GetBrowserVersions.php index 77f1541785..4f5875199a 100644 --- a/plugins/DevicesDetection/Reports/GetBrowserVersions.php +++ b/plugins/DevicesDetection/Reports/GetBrowserVersions.php @@ -34,7 +34,7 @@ class GetBrowserVersions extends Base public function getRelatedReports() { return array( - new GetBrowsers() + self::factory('DevicesDetection', 'getBrowsers'), ); } } diff --git a/plugins/DevicesDetection/Reports/GetBrowsers.php b/plugins/DevicesDetection/Reports/GetBrowsers.php index c34c604da8..7d08a51ce5 100644 --- a/plugins/DevicesDetection/Reports/GetBrowsers.php +++ b/plugins/DevicesDetection/Reports/GetBrowsers.php @@ -35,7 +35,7 @@ class GetBrowsers extends Base public function getRelatedReports() { return array( - new GetBrowserVersions() + self::factory('DevicesDetection', 'getBrowserVersions'), ); } } diff --git a/plugins/DevicesDetection/Reports/GetOsFamilies.php b/plugins/DevicesDetection/Reports/GetOsFamilies.php index 5f9418f75e..61b393cb44 100644 --- a/plugins/DevicesDetection/Reports/GetOsFamilies.php +++ b/plugins/DevicesDetection/Reports/GetOsFamilies.php @@ -35,7 +35,7 @@ class GetOsFamilies extends Base public function getRelatedReports() { return array( - new GetOsVersions() + self::factory('DevicesDetection', 'getOsVersions'), ); } diff --git a/plugins/DevicesDetection/Reports/GetOsVersions.php b/plugins/DevicesDetection/Reports/GetOsVersions.php index 76ded09255..8676f38776 100644 --- a/plugins/DevicesDetection/Reports/GetOsVersions.php +++ b/plugins/DevicesDetection/Reports/GetOsVersions.php @@ -35,7 +35,7 @@ class GetOsVersions extends Base public function getRelatedReports() { return array( - new GetOsFamilies() + self::factory('DevicesDetection', 'getOsFamilies'), ); } } diff --git a/plugins/Live/Controller.php b/plugins/Live/Controller.php index a2b0d74612..a74b4424ec 100644 --- a/plugins/Live/Controller.php +++ b/plugins/Live/Controller.php @@ -12,7 +12,6 @@ use Piwik\API\Request; use Piwik\Common; use Piwik\Config; use Piwik\Piwik; -use Piwik\Plugins\Live\Reports\GetLastVisitsDetails; use Piwik\Plugins\Goals\API as APIGoals; use Piwik\Url; use Piwik\View; @@ -57,7 +56,7 @@ class Controller extends \Piwik\Plugin\Controller public function indexVisitorLog() { $view = new View('@Live/indexVisitorLog.twig'); - $view->visitorLog = $this->renderReport(new GetLastVisitsDetails()); + $view->visitorLog = $this->renderReport('getLastVisitsDetails'); return $view->render(); } @@ -66,7 +65,7 @@ class Controller extends \Piwik\Plugin\Controller */ public function getVisitorLog() { - return $this->renderReport(new GetLastVisitsDetails()); + return $this->renderReport('getLastVisitsDetails'); } public function getLastVisitsStart() diff --git a/plugins/Referrers/Controller.php b/plugins/Referrers/Controller.php index 2a962755ee..efd1820d44 100644 --- a/plugins/Referrers/Controller.php +++ b/plugins/Referrers/Controller.php @@ -14,12 +14,6 @@ use Piwik\DataTable\Map; use Piwik\Metrics; use Piwik\Period\Range; use Piwik\Piwik; -use Piwik\Plugins\Referrers\Reports\GetAll; -use Piwik\Plugins\Referrers\Reports\GetKeywords; -use Piwik\Plugins\Referrers\Reports\GetReferrerType; -use Piwik\Plugins\Referrers\Reports\GetSearchEngines; -use Piwik\Plugins\Referrers\Reports\GetSocials; -use Piwik\Plugins\Referrers\Reports\GetWebsites; use Piwik\SettingsPiwik; use Piwik\Translation\Translator; use Piwik\View; @@ -107,7 +101,7 @@ class Controller extends \Piwik\Plugin\Controller $view = new View('@Referrers/allReferrers'); // building the referrers summary report - $view->dataTableReferrerType = $this->renderReport(new GetReferrerType()); + $view->dataTableReferrerType = $this->renderReport('getReferrerType'); $nameValues = $this->getReferrersVisitorsByType(); @@ -125,7 +119,7 @@ class Controller extends \Piwik\Plugin\Controller } $view->totalVisits = $totalVisits; - $view->referrersReportsByDimension = $this->renderReport(new GetAll()); + $view->referrersReportsByDimension = $this->renderReport('getAll'); return $view->render(); } @@ -133,16 +127,16 @@ class Controller extends \Piwik\Plugin\Controller public function getSearchEnginesAndKeywords() { $view = new View('@Referrers/getSearchEnginesAndKeywords'); - $view->searchEngines = $this->renderReport(new GetSearchEngines()); - $view->keywords = $this->renderReport(new GetKeywords()); + $view->searchEngines = $this->renderReport('getSearchEngines'); + $view->keywords = $this->renderReport('getKeywords'); return $view->render(); } public function indexWebsites() { $view = new View('@Referrers/indexWebsites'); - $view->websites = $this->renderReport(new GetWebsites()); - $view->socials = $this->renderReport(new GetSocials()); + $view->websites = $this->renderReport('getWebsites'); + $view->socials = $this->renderReport('getSocials'); return $view->render(); } diff --git a/plugins/Resolution/Reports/GetConfiguration.php b/plugins/Resolution/Reports/GetConfiguration.php index 6b20f4ac96..c01c4f3b07 100644 --- a/plugins/Resolution/Reports/GetConfiguration.php +++ b/plugins/Resolution/Reports/GetConfiguration.php @@ -36,7 +36,7 @@ class GetConfiguration extends Base public function getRelatedReports() { return array( - new GetResolution() + self::factory('Resolution', 'getResolution'), ); } } diff --git a/plugins/Resolution/Reports/GetResolution.php b/plugins/Resolution/Reports/GetResolution.php index 5e42df64d9..f9066ce19c 100644 --- a/plugins/Resolution/Reports/GetResolution.php +++ b/plugins/Resolution/Reports/GetResolution.php @@ -34,7 +34,7 @@ class GetResolution extends Base public function getRelatedReports() { return array( - new GetConfiguration() + self::factory('Resolution', 'getConfiguration'), ); } } diff --git a/plugins/UserCountry/Controller.php b/plugins/UserCountry/Controller.php index 145f981cc3..d5afd0e1b9 100644 --- a/plugins/UserCountry/Controller.php +++ b/plugins/UserCountry/Controller.php @@ -19,10 +19,6 @@ use Piwik\Plugins\UserCountry\LocationProvider\GeoIp; use Piwik\Plugins\UserCountry\LocationProvider; use Piwik\Plugins\UserCountry\LocationProvider\DefaultProvider; use Piwik\Plugins\UserCountry\LocationProvider\GeoIp\Pecl; -use Piwik\Plugins\UserCountry\Reports\GetCity; -use Piwik\Plugins\UserCountry\Reports\GetContinent; -use Piwik\Plugins\UserCountry\Reports\GetCountry; -use Piwik\Plugins\UserCountry\Reports\GetRegion; use Piwik\View; /** @@ -37,10 +33,10 @@ class Controller extends \Piwik\Plugin\ControllerAdmin $view->urlSparklineCountries = $this->getUrlSparkline('getLastDistinctCountriesGraph'); $view->numberDistinctCountries = $this->getNumberOfDistinctCountries(true); - $view->dataTableCountry = $this->renderReport(new GetCountry()); - $view->dataTableContinent = $this->renderReport(new GetContinent()); - $view->dataTableRegion = $this->renderReport(new GetRegion()); - $view->dataTableCity = $this->renderReport(new GetCity()); + $view->dataTableCountry = $this->renderReport('getCountry'); + $view->dataTableContinent = $this->renderReport('getContinent'); + $view->dataTableRegion = $this->renderReport('getRegion'); + $view->dataTableCity = $this->renderReport('getCity'); return $view->render(); } diff --git a/plugins/UserLanguage/Reports/GetLanguage.php b/plugins/UserLanguage/Reports/GetLanguage.php index 70f4304fa6..f5babd65b8 100644 --- a/plugins/UserLanguage/Reports/GetLanguage.php +++ b/plugins/UserLanguage/Reports/GetLanguage.php @@ -37,7 +37,7 @@ class GetLanguage extends Base public function getRelatedReports() { return array( - new GetLanguageCode() + self::factory('UserLanguage', 'getLanguageCode'), ); } diff --git a/plugins/UserLanguage/Reports/GetLanguageCode.php b/plugins/UserLanguage/Reports/GetLanguageCode.php index 9b2ab021d9..0ca2c64bb2 100644 --- a/plugins/UserLanguage/Reports/GetLanguageCode.php +++ b/plugins/UserLanguage/Reports/GetLanguageCode.php @@ -26,7 +26,7 @@ class GetLanguageCode extends GetLanguage public function getRelatedReports() { return array( - new GetLanguage() + self::factory('UserLanguage', 'getLanguage'), ); } diff --git a/plugins/VisitTime/Controller.php b/plugins/VisitTime/Controller.php index 24bbf39a80..08af238213 100644 --- a/plugins/VisitTime/Controller.php +++ b/plugins/VisitTime/Controller.php @@ -8,8 +8,6 @@ */ namespace Piwik\Plugins\VisitTime; -use Piwik\Plugins\VisitTime\Reports\GetVisitInformationPerLocalTime; -use Piwik\Plugins\VisitTime\Reports\GetVisitInformationPerServerTime; use Piwik\View; /** @@ -20,8 +18,8 @@ class Controller extends \Piwik\Plugin\Controller public function index() { $view = new View('@VisitTime/index'); - $view->dataTableVisitInformationPerLocalTime = $this->renderReport(new GetVisitInformationPerLocalTime()); - $view->dataTableVisitInformationPerServerTime = $this->renderReport(new GetVisitInformationPerServerTime()); + $view->dataTableVisitInformationPerLocalTime = $this->renderReport('getVisitInformationPerLocalTime'); + $view->dataTableVisitInformationPerServerTime = $this->renderReport('getVisitInformationPerServerTime'); return $view->render(); } } diff --git a/plugins/VisitorInterest/Controller.php b/plugins/VisitorInterest/Controller.php index 835af723fe..8cb5200c4d 100644 --- a/plugins/VisitorInterest/Controller.php +++ b/plugins/VisitorInterest/Controller.php @@ -8,10 +8,6 @@ */ namespace Piwik\Plugins\VisitorInterest; -use Piwik\Plugins\VisitorInterest\Reports\GetNumberOfVisitsByDaysSinceLast; -use Piwik\Plugins\VisitorInterest\Reports\GetNumberOfVisitsByVisitCount; -use Piwik\Plugins\VisitorInterest\Reports\GetNumberOfVisitsPerPage; -use Piwik\Plugins\VisitorInterest\Reports\GetNumberOfVisitsPerVisitDuration; use Piwik\View; class Controller extends \Piwik\Plugin\Controller @@ -19,10 +15,10 @@ class Controller extends \Piwik\Plugin\Controller public function index() { $view = new View('@VisitorInterest/index'); - $view->dataTableNumberOfVisitsPerVisitDuration = $this->renderReport(new GetNumberOfVisitsPerVisitDuration()); - $view->dataTableNumberOfVisitsPerPage = $this->renderReport(new GetNumberOfVisitsPerPage()); - $view->dataTableNumberOfVisitsByVisitNum = $this->renderReport(new GetNumberOfVisitsByVisitCount()); - $view->dataTableNumberOfVisitsByDaysSinceLast = $this->renderReport(new GetNumberOfVisitsByDaysSinceLast()); + $view->dataTableNumberOfVisitsPerVisitDuration = $this->renderReport('getNumberOfVisitsPerVisitDuration'); + $view->dataTableNumberOfVisitsPerPage = $this->renderReport('getNumberOfVisitsPerPage'); + $view->dataTableNumberOfVisitsByVisitNum = $this->renderReport('getNumberOfVisitsByVisitCount'); + $view->dataTableNumberOfVisitsByDaysSinceLast = $this->renderReport('getNumberOfVisitsByDaysSinceLast'); return $view->render(); } }
\ No newline at end of file |