-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathController.php
34 lines (29 loc) · 1.43 KB
/
Controller.php
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
<?php
namespace Piwik\Plugins\RerIntranetSubnetwork;
use Piwik\Piwik;
use Piwik\View;
use Piwik\ViewDataTable\Factory;
class Controller extends \Piwik\Plugin\Controller
{
public function getIntranetSubnetwork($fetch = false)
{
Piwik::checkUserHasSomeViewAccess();
# $this->checkTokenInUrl();
$view = Factory::build('pie', 'RerIntranetSubnetwork.getIntranetSubnetwork', $this->pluginName . '.' . __FUNCTION__);
# $view = Factory::build( 'table', 'RerIntranetSubnetwork.getIntranetSubnetwork', $this->pluginName . '.' . __FUNCTION__ );
# $view = Factory::build( $this->pluginName, "RerIntranetSubnetwork.getIntranetSubnetwork", $this->pluginName . '.' . __FUNCTION__ );
$this->setPeriodVariablesView($view);
$column = 'nb_visits';
$percCol = 'nb_visits_percentage';
$percColName = 'General_ColumnPercentageVisits';
if ($view->period == 'day') {
$column = 'nb_uniq_visitors';
}
$view->config->columns_to_display = ['label', $percCol, $column ];
$view->config->addTranslation('label', Piwik::translate('RerIntranetSubnetwork_SubnetworkName'));
# $view->config->addTranslation($percCol, str_replace('% ', '% ', Piwik::translate($percColName)));
$view->config->addTranslation($percCol, Piwik::translate($percColName));
$view->requestConfig->filter_sort_column = $percCol;
return $view->render();
}
}