File: Config.php

package info (click to toggle)
matomo 5.5.1%2Bdfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 73,596 kB
  • sloc: php: 231,041; javascript: 102,286; python: 202; xml: 189; sh: 172; makefile: 20; sql: 10
file content (156 lines) | stat: -rw-r--r-- 4,384 bytes parent folder | download
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
<?php

/**
 * Matomo - free/libre analytics platform
 *
 * @link    https://matomo.org
 * @license https://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
 */

namespace Piwik\Plugins\CoreVisualizations\Visualizations\HtmlTable;

use Piwik\ViewDataTable\Config as VisualizationConfig;

/**
 * DataTable Visualization that derives from HtmlTable and sets show_extra_columns to true.
 */
class Config extends VisualizationConfig
{
    /**
     * If this property is set to true, subtables will be shown as embedded in the original table.
     * If false, subtables will be shown as whole tables between rows.
     *
     * Default value: false
     */
    public $show_embedded_subtable = false;

    /**
     * Controls whether the entire DataTable should be rendered (including subtables) or just one
     * specific table in the tree.
     *
     * Default value: false
     */
    public $show_expanded = false;

    /**
     * When showing an expanded datatable, this property controls whether rows with subtables are
     * replaced with their subtables, or if they are shown alongside their subtables.
     *
     * Default value: false
     */
    public $replace_row_with_subtable = false;

    /**
     * Controls whether any DataTable Row Action icons are shown. If true, no icons are shown.
     *
     * Default value: false
     */
    public $disable_row_actions = false;

    /**
     * Controls whether the row evolution DataTable Row Action icon is shown or not.
     *
     * Default value: false
     */
    public $disable_row_evolution = false;

    /**
     * Controls whether the summary row is displayed on every page of the datatable view or not.
     * If false, the summary row will be treated as the last row of the dataset and will only visible
     * when viewing the last rows.
     *
     * Default value: false
     */
    public $keep_summary_row = false;

    /**
     * If true, the 'label', 'nb_visits', 'nb_uniq_visitors' (if present), 'nb_actions',
     * 'nb_actions_per_visit', 'avg_time_on_site', 'bounce_rate' and 'conversion_rate' (if
     * goals view is not allowed) are displayed.
     *
     * Default value: false
     */
    public $show_extra_columns = false;

    /**
     * If true, conversions for each existing goal will be displayed for the visits in
     * each row.
     *
     * Default value: false
     */
    public $show_goals_columns = false;

    /**
     * If true, subtables will not be loaded when rows are clicked, but only if the
     * 'show_goals_columns' property is also true.
     *
     * Default value: false
     */
    public $disable_subtable_when_show_goals = false;

    /**
     * If true, the summary row will be colored differently than all other DataTable rows.
     *
     * Default value: false
     */
    public $highlight_summary_row = false;

    /**
     * If true, the totals row will be shown
     *
     * Default value: false
     */
    public $show_totals_row = true;

    /**
     * A list of columns that support showing the ratio percentage on hover
     * @var array
     */
    public $report_ratio_columns = array();

    /**
     * The minimum width for the label column in table visualizations.
     *
     * @var null|int
     */
    public $min_label_width = 125;

    /**
     * The maximum allowed width for the label column in table visualizations.
     *
     * @var null|int
     */
    public $max_label_width = 440;

    public function __construct()
    {
        parent::__construct();

        $this->enable_sort       = true;
        $this->datatable_js_type = 'DataTable';

        $this->addPropertiesThatShouldBeAvailableClientSide(array(
            'show_extra_columns',
            'show_goals_columns',
            'disable_row_evolution',
            'disable_row_actions',
            'enable_sort',
            'keep_summary_row',
            'subtable_controller_action',
            'row_identifier',
            'min_label_width',
            'max_label_width',
        ));

        $this->addPropertiesThatCanBeOverwrittenByQueryParams(array(
            'show_expanded',
            'disable_row_actions',
            'disable_row_evolution',
            'show_extra_columns',
            'show_goals_columns',
            'disable_subtable_when_show_goals',
            'keep_summary_row',
            'highlight_summary_row',
        ));
    }
}