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

Controller.php « CustomVariables « plugins - github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: ea00259d3ee355f61025a025cc3d79dd882393d1 (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
<?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 Piwik_CustomVariables
 */

/**
 *
 * @package Piwik_CustomVariables
 */
class Piwik_CustomVariables_Controller extends Piwik_Controller
{

    function index($fetch = false)
    {
        return Piwik_View::singleReport(
            Piwik_Translate('CustomVariables_CustomVariables'),
            $this->getCustomVariables(true), $fetch);
    }

    function getCustomVariables($fetch = false)
    {
        $view = Piwik_ViewDataTable::factory();
        $view->init($this->pluginName, __FUNCTION__, "CustomVariables.getCustomVariables", "getCustomVariablesValuesFromNameId");

        $this->setPeriodVariablesView($view);
        $view->enableShowGoals();

        $view->setColumnsToDisplay(array('label', 'nb_visits', 'nb_actions'));
        $view->setColumnTranslation('label', Piwik_Translate('CustomVariables_ColumnCustomVariableName'));
        $view->setSortedColumn('nb_visits');
        $view->setLimit(10);
        $view->setFooterMessage(Piwik_Translate('CustomVariables_TrackingHelp', array('<a target="_blank" href="http://piwik.org/docs/custom-variables/">', '</a>')));
        $this->setMetricsVariablesView($view);
        return $this->renderView($view, $fetch);
    }

    function getCustomVariablesValuesFromNameId($fetch = false)
    {
        $view = Piwik_ViewDataTable::factory();
        $view->init($this->pluginName, __FUNCTION__, 'CustomVariables.getCustomVariablesValuesFromNameId');

        $view->disableSearchBox();
        $view->enableShowGoals();
        $view->disableExcludeLowPopulation();
        $view->setColumnsToDisplay(array('label', 'nb_visits', 'nb_actions'));
        $view->setColumnTranslation('label', Piwik_Translate('CustomVariables_ColumnCustomVariableValue'));

        return $this->renderView($view, $fetch);
    }

}