diff options
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 }} |