blob: dcd754de49493166d32d23ada73580e8f53d34aa (
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
65
|
<?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
* @package Piwik
*/
/**
* @package Piwik
* @subpackage Piwik_ViewDataTable
*/
class Piwik_ViewDataTable_HtmlTable_AllColumns extends Piwik_ViewDataTable_HtmlTable
{
protected function getViewDataTableId()
{
return 'tableAllColumns';
}
public function main()
{
$this->viewProperties['show_exclude_low_population'] = true;
parent::main();
}
protected function getRequestString()
{
$requestString = parent::getRequestString();
return $requestString . '&filter_add_columns_when_show_all_columns=1';
}
protected function postDataTableLoadedFromAPI()
{
$valid = parent::postDataTableLoadedFromAPI();
if (!$valid) return false;
Piwik_Controller::setPeriodVariablesView($this);
$columnUniqueVisitors = false;
if ($this->period == 'day') {
$columnUniqueVisitors = 'nb_uniq_visitors';
}
// only display conversion rate for the plugins that do not provide "per goal" metrics
// otherwise, conversion rate is meaningless as a whole (since we don't process 'cross goals' conversions)
$columnConversionRate = false;
if (empty($this->viewProperties['show_goals'])) {
$columnConversionRate = 'conversion_rate';
}
$this->setColumnsToDisplay(array('label',
'nb_visits',
$columnUniqueVisitors,
'nb_actions',
'nb_actions_per_visit',
'avg_time_on_site',
'bounce_rate',
$columnConversionRate
));
$this->dataTable->filter('ColumnCallbackReplace', array('avg_time_on_site', create_function('$averageTimeOnSite', 'return Piwik::getPrettyTimeFromSeconds($averageTimeOnSite);')));
return true;
}
}
|