Welcome to mirror list, hosted at ThFree Co, Russian Federation.

Controller.php « VisitorInterest « plugins - github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: a17b2e74ca1bbe8be4563bb692ef8f398220b5e3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<?php
/**
 * Piwik - Open source web analytics
 *
 * @link http://piwik.org
 * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
 *
 * @category Piwik_Plugins
 * @package VisitorInterest
 */
namespace Piwik\Plugins\VisitorInterest;

use Piwik\View;
use Piwik\ViewDataTable\Factory;

/**
 * @package VisitorInterest
 */
class Controller extends \Piwik\Plugin\Controller
{
    public function index()
    {
        $view = new View('@VisitorInterest/index');
        $view->dataTableNumberOfVisitsPerVisitDuration = $this->getNumberOfVisitsPerVisitDuration(true);
        $view->dataTableNumberOfVisitsPerPage = $this->getNumberOfVisitsPerPage(true);
        $view->dataTableNumberOfVisitsByVisitNum = $this->getNumberOfVisitsByVisitCount(true);
        $view->dataTableNumberOfVisitsByDaysSinceLast = $this->getNumberOfVisitsByDaysSinceLast(true);
        echo $view->render();
    }

    public function getNumberOfVisitsPerVisitDuration($fetch = false)
    {
        return $this->renderReport(__FUNCTION__, $fetch);
    }

    public function getNumberOfVisitsPerPage($fetch = false)
    {
        return $this->renderReport(__FUNCTION__, $fetch);
    }

    /**
     * Returns a report that lists the count of visits for different ranges of
     * a visitor's visit number.
     *
     * @param bool $fetch Whether to return the rendered view as a string or echo it.
     * @return string The rendered report or nothing if $fetch is set to false.
     */
    public function getNumberOfVisitsByVisitCount($fetch = false)
    {
        return $this->renderReport(__FUNCTION__, $fetch);
    }

    /**
     * Returns a rendered report that lists the count of visits for different ranges
     * of days since a visitor's last visit.
     *
     * @param bool $fetch Whether to return the rendered view as a string or echo it.
     * @return string The rendered report or nothing if $fetch is set to false.
     */
    public function getNumberOfVisitsByDaysSinceLast($fetch = false)
    {
        return $this->renderReport(__FUNCTION__, $fetch);
    }
}