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
|
<?php
/**
* Matomo - free/libre analytics platform
*
* @link https://matomo.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*
*/
namespace Piwik\Plugins\MultiSites;
use Piwik\Piwik;
class MultiSites extends \Piwik\Plugin
{
/**
* @see \Piwik\Plugin::registerEvents
*/
public function registerEvents()
{
return array(
'AssetManager.getStylesheetFiles' => 'getStylesheetFiles',
'AssetManager.getJavaScriptFiles' => 'getJsFiles',
'Translate.getClientSideTranslationKeys' => 'getClientSideTranslationKeys',
'Metrics.getDefaultMetricTranslations' => 'addMetricTranslations',
'API.getPagesComparisonsDisabledFor' => 'getPagesComparisonsDisabledFor',
);
}
public function getPagesComparisonsDisabledFor(&$pages)
{
$pages[] = 'MultiSites.index';
}
public function addMetricTranslations(&$translations)
{
$appendix = " " . Piwik::translate('MultiSites_Evolution');
$metrics = array(
'visits_evolution' => Piwik::translate('General_ColumnNbVisits') . $appendix,
'actions_evolution' => Piwik::translate('General_ColumnNbActions') . $appendix,
'pageviews_evolution' => Piwik::translate('General_ColumnPageviews') . $appendix,
'revenue_evolution' => Piwik::translate('General_ColumnRevenue') . $appendix,
'nb_conversions_evolution' => Piwik::translate('Goals_ColumnConversions') . $appendix,
'orders_evolution' => Piwik::translate('General_EcommerceOrders') . $appendix,
'ecommerce_revenue_evolution' => Piwik::translate('General_ProductRevenue') . $appendix,
);
$translations = array_merge($translations, $metrics);
}
public function getClientSideTranslationKeys(&$translations)
{
$translations[] = 'General_Website';
$translations[] = 'General_ColumnNbVisits';
$translations[] = 'General_ColumnPageviews';
$translations[] = 'General_ColumnRevenue';
$translations[] = 'General_TotalVisitsPageviewsActionsRevenue';
$translations[] = 'General_EvolutionSummaryGeneric';
$translations[] = 'General_AllWebsitesDashboard';
$translations[] = 'General_NVisits';
$translations[] = 'MultiSites_Evolution';
$translations[] = 'SitesManager_AddSite';
$translations[] = 'General_Next';
$translations[] = 'General_Previous';
$translations[] = 'General_GoTo';
$translations[] = 'Dashboard_DashboardOf';
$translations[] = 'Actions_SubmenuSitesearch';
$translations[] = 'MultiSites_LoadingWebsites';
$translations[] = 'General_ErrorRequest';
$translations[] = 'General_Pagination';
$translations[] = 'General_ClickToSearch';
$translations[] = 'General_NeedMoreHelp';
$translations[] = 'General_Faq';
$translations[] = 'Feedback_CommunityHelp';
$translations[] = 'Feedback_ProfessionalHelp';
}
public function getJsFiles(&$jsFiles)
{
$jsFiles[] = "plugins/MultiSites/angularjs/dashboard/dashboard-model.service.js";
$jsFiles[] = "plugins/MultiSites/angularjs/dashboard/dashboard.controller.js";
$jsFiles[] = "plugins/MultiSites/angularjs/dashboard/dashboard.directive.js";
$jsFiles[] = "plugins/MultiSites/angularjs/site/site.controller.js";
$jsFiles[] = "plugins/MultiSites/angularjs/site/site.directive.js";
}
public function getStylesheetFiles(&$stylesheets)
{
$stylesheets[] = "plugins/MultiSites/angularjs/dashboard/dashboard.directive.less";
}
}
|