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

Controller.php « Contents « plugins - github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: daf319bb535a683791f2977b059a1746aeba959c (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
<?php
/**
 * Piwik - free/libre analytics platform
 *
 * @link http://piwik.org
 * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
 *
 */
namespace Piwik\Plugins\Contents;

use Piwik\Plugin\Report;
use Piwik\Plugins\Contents\Reports\GetContentNames;
use Piwik\Plugins\Contents\Reports\GetContentPieces;
use Piwik\View;

class Controller extends \Piwik\Plugin\Controller
{

    public function index()
    {
        $reportsView = new View\ReportsByDimension('Contents');

        /** @var \Piwik\Plugin\Report[] $reports */
        $reports = array(new GetContentNames(), new GetContentPieces());

        foreach($reports as $report) {
            $reportsView->addReport(
                $report->getCategory(),
                $report->getName(),
                'Contents.menu' . ucfirst($report->getAction())
            );
        }

        return $reportsView->render();
    }

    public function menuGetContentNames()
    {
        $report = new GetContentNames();

        return View::singleReport($report->getName(), $report->render());
    }

    public function menuGetContentPieces()
    {
        $report = new GetContentPieces();

        return View::singleReport($report->getName(), $report->render());
    }

}