diff options
author | Thomas Steur <thomas.steur@gmail.com> | 2015-01-08 05:54:36 +0300 |
---|---|---|
committer | Thomas Steur <thomas.steur@gmail.com> | 2015-01-15 05:59:26 +0300 |
commit | 11b56513c260533c89fbef709817944227189e93 (patch) | |
tree | 5101de973a5ca6cdb2796116ba87c63319e2f1be /plugins/VisitorInterest | |
parent | 9043f427470dbfb61aed29d1e0c80e2e70d3e51f (diff) |
display returning visits still on top under engagement but all other reports grouped in a left report, could not easily add returning vs new
Diffstat (limited to 'plugins/VisitorInterest')
-rw-r--r-- | plugins/VisitorInterest/Controller.php | 23 | ||||
-rw-r--r-- | plugins/VisitorInterest/VisitorInterest.php | 2 | ||||
-rw-r--r-- | plugins/VisitorInterest/templates/index.twig | 1 |
3 files changed, 20 insertions, 6 deletions
diff --git a/plugins/VisitorInterest/Controller.php b/plugins/VisitorInterest/Controller.php index 54de697282..939318534e 100644 --- a/plugins/VisitorInterest/Controller.php +++ b/plugins/VisitorInterest/Controller.php @@ -18,11 +18,26 @@ class Controller extends \Piwik\Plugin\Controller { public function index() { + $byDimension = new View\ReportsByDimension('VisitorInterest'); + + $reportsToAdd = array( + new GetNumberOfVisitsPerVisitDuration(), + new GetNumberOfVisitsPerPage(), + new GetNumberOfVisitsByVisitCount(), + new GetNumberOfVisitsByDaysSinceLast() + ); + + foreach ($reportsToAdd as $report) { + /** @var \Piwik\Plugin\Report $report */ + $byDimension->addReport( + $report->getCategory(), + $report->getWidgetTitle(), + $report->getModule() . '.' . $report->getAction(), + array()); + } + $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->reports = $byDimension->render(); return $view->render(); } } diff --git a/plugins/VisitorInterest/VisitorInterest.php b/plugins/VisitorInterest/VisitorInterest.php index c5fdac3711..11d5f717c4 100644 --- a/plugins/VisitorInterest/VisitorInterest.php +++ b/plugins/VisitorInterest/VisitorInterest.php @@ -33,7 +33,7 @@ class VisitorInterest extends \Piwik\Plugin Piwik::addAction('Template.footerVisitsFrequency', array('Piwik\Plugins\VisitorInterest\VisitorInterest', 'footerVisitsFrequency')); } - public static function footerVisitsFrequency(&$out) + public static function footerVisitsFrequency(&$out) { $out .= FrontController::getInstance()->fetchDispatch('VisitorInterest', 'index'); } diff --git a/plugins/VisitorInterest/templates/index.twig b/plugins/VisitorInterest/templates/index.twig index 2ffae16c8f..59d474fc47 100644 --- a/plugins/VisitorInterest/templates/index.twig +++ b/plugins/VisitorInterest/templates/index.twig @@ -1,4 +1,3 @@ -<br /> <div id="leftcolumn"> <h2 piwik-enriched-headline>{{ 'VisitorInterest_VisitsPerDuration'|translate }}</h2> {{ dataTableNumberOfVisitsPerVisitDuration|raw }} |