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 | |
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')
-rw-r--r-- | plugins/VisitFrequency/Controller.php | 3 | ||||
-rw-r--r-- | plugins/VisitFrequency/templates/_sparklines.twig | 46 | ||||
-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 |
5 files changed, 46 insertions, 29 deletions
diff --git a/plugins/VisitFrequency/Controller.php b/plugins/VisitFrequency/Controller.php index ee1d3620a9..43453f06bf 100644 --- a/plugins/VisitFrequency/Controller.php +++ b/plugins/VisitFrequency/Controller.php @@ -21,8 +21,11 @@ class Controller extends \Piwik\Plugin\Controller function index() { $view = new View('@VisitFrequency/index'); + $this->setGeneralVariablesView($view); + $view->graphEvolutionVisitFrequency = $this->getEvolutionGraph(array(), array('nb_visits_returning')); $this->setSparklinesAndNumbers($view); + return $view->render(); } diff --git a/plugins/VisitFrequency/templates/_sparklines.twig b/plugins/VisitFrequency/templates/_sparklines.twig index f497c970e5..97697272e8 100644 --- a/plugins/VisitFrequency/templates/_sparklines.twig +++ b/plugins/VisitFrequency/templates/_sparklines.twig @@ -1,26 +1,26 @@ <div id="leftcolumn"> -<div class="sparkline"> - {{ sparkline(urlSparklineNbVisitsReturning) }} - {{ 'VisitFrequency_ReturnVisits'|translate("<strong>"~nbVisitsReturning~"</strong>")|raw }} -</div> -<div class="sparkline"> - {{ sparkline(urlSparklineNbActionsReturning) }} - {{ 'VisitFrequency_ReturnActions'|translate("<strong>"~nbActionsReturning~"</strong>")|raw }} -</div> -<div class="sparkline"> - {{ sparkline(urlSparklineActionsPerVisitReturning) }} - {{ 'VisitFrequency_ReturnAvgActions'|translate("<strong>"~nbActionsPerVisitReturning~"</strong>")|raw }} -</div> - </div><div id="rightcolumn"> -<div class="sparkline"> - {{ sparkline(urlSparklineAvgVisitDurationReturning) }} - {% set avgVisitDurationReturning=avgVisitDurationReturning|sumtime %} - {{ 'VisitFrequency_ReturnAverageVisitDuration'|translate("<strong>"~avgVisitDurationReturning~"</strong>")|raw }} -</div> -<div class="sparkline"> - {{ sparkline(urlSparklineBounceRateReturning) }} - {{ 'VisitFrequency_ReturnBounceRate'|translate("<strong>"~bounceRateReturning~"</strong>")|raw }} -</div> -{% include "_sparklineFooter.twig" %} + <div class="sparkline"> + {{ sparkline(urlSparklineNbVisitsReturning) }} + {{ 'VisitFrequency_ReturnVisits'|translate("<strong>"~nbVisitsReturning~"</strong>")|raw }} + </div> + <div class="sparkline"> + {{ sparkline(urlSparklineNbActionsReturning) }} + {{ 'VisitFrequency_ReturnActions'|translate("<strong>"~nbActionsReturning~"</strong>")|raw }} + </div> + <div class="sparkline"> + {{ sparkline(urlSparklineActionsPerVisitReturning) }} + {{ 'VisitFrequency_ReturnAvgActions'|translate("<strong>"~nbActionsPerVisitReturning~"</strong>")|raw }} + </div> +</div><div id="rightcolumn"> + <div class="sparkline"> + {{ sparkline(urlSparklineAvgVisitDurationReturning) }} + {% set avgVisitDurationReturning=avgVisitDurationReturning|sumtime %} + {{ 'VisitFrequency_ReturnAverageVisitDuration'|translate("<strong>"~avgVisitDurationReturning~"</strong>")|raw }} + </div> + <div class="sparkline"> + {{ sparkline(urlSparklineBounceRateReturning) }} + {{ 'VisitFrequency_ReturnBounceRate'|translate("<strong>"~bounceRateReturning~"</strong>")|raw }} + </div> + {% include "_sparklineFooter.twig" %} </div> <div style="clear:both"></div>
\ No newline at end of file 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 }} |