From 11b56513c260533c89fbef709817944227189e93 Mon Sep 17 00:00:00 2001 From: Thomas Steur Date: Thu, 8 Jan 2015 02:54:36 +0000 Subject: display returning visits still on top under engagement but all other reports grouped in a left report, could not easily add returning vs new --- plugins/VisitorInterest/Controller.php | 23 +++++++++++++++++++---- plugins/VisitorInterest/VisitorInterest.php | 2 +- plugins/VisitorInterest/templates/index.twig | 1 - 3 files changed, 20 insertions(+), 6 deletions(-) (limited to 'plugins/VisitorInterest') 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 @@ -

{{ 'VisitorInterest_VisitsPerDuration'|translate }}

{{ dataTableNumberOfVisitsPerVisitDuration|raw }} -- cgit v1.2.3