diff options
author | Thomas Steur <thomas.steur@gmail.com> | 2015-07-03 03:54:27 +0300 |
---|---|---|
committer | sgiehl <stefan@piwik.org> | 2015-10-06 18:25:13 +0300 |
commit | 9ba8f216fd7856ce5fef06bf82ecb8f8a2e7e630 (patch) | |
tree | 6ce07d18a85d00b39ab720abe042361c0775aead /core/Plugin/ViewDataTable.php | |
parent | 8ccc9dc05da021325cdbf141a548637fa52f16b2 (diff) |
generate pages instead of implementing them in each controller
Diffstat (limited to 'core/Plugin/ViewDataTable.php')
-rw-r--r-- | core/Plugin/ViewDataTable.php | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/core/Plugin/ViewDataTable.php b/core/Plugin/ViewDataTable.php index 6e190388b6..5ca7e2e9ba 100644 --- a/core/Plugin/ViewDataTable.php +++ b/core/Plugin/ViewDataTable.php @@ -13,6 +13,7 @@ use Piwik\Common; use Piwik\DataTable; use Piwik\Period; use Piwik\Piwik; +use Piwik\Plugin\Reports; use Piwik\View; use Piwik\View\ViewInterface; use Piwik\ViewDataTable\Config as VizConfig; @@ -191,7 +192,7 @@ abstract class ViewDataTable implements ViewInterface $this->requestConfig->apiMethodToRequestDataTable = $apiMethodToRequestDataTable; - $report = Report::factory($this->requestConfig->getApiModuleToRequest(), $this->requestConfig->getApiMethodToRequest()); + $report = Reports::factory($this->requestConfig->getApiModuleToRequest(), $this->requestConfig->getApiMethodToRequest()); if (!empty($report)) { /** @var Report $report */ @@ -205,13 +206,7 @@ abstract class ViewDataTable implements ViewInterface $relatedReports = $report->getRelatedReports(); if (!empty($relatedReports)) { foreach ($relatedReports as $relatedReport) { - $widgetTitle = $relatedReport->getWidgetTitle(); - - if ($widgetTitle && Common::getRequestVar('widget', 0, 'int')) { - $relatedReportName = $widgetTitle; - } else { - $relatedReportName = $relatedReport->getName(); - } + $relatedReportName = $relatedReport->getName(); $this->config->addRelatedReport($relatedReport->getModule() . '.' . $relatedReport->getAction(), $relatedReportName); @@ -273,7 +268,7 @@ abstract class ViewDataTable implements ViewInterface $this->overrideViewPropertiesWithQueryParams(); } - protected function assignRelatedReportsTitle() + private function assignRelatedReportsTitle() { if (!empty($this->config->related_reports_title)) { // title already assigned by a plugin @@ -411,12 +406,9 @@ abstract class ViewDataTable implements ViewInterface */ public function render() { - $view = $this->buildView(); - return $view->render(); + return ''; } - abstract protected function buildView(); - protected function getDefaultDataTableCssClass() { return 'dataTableViz' . Piwik::getUnnamespacedClassName(get_class($this)); |