forked from rainlab/googleanalytics-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPlugin.php
More file actions
83 lines (74 loc) · 2.61 KB
/
Plugin.php
File metadata and controls
83 lines (74 loc) · 2.61 KB
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
<?php namespace RainLab\GoogleAnalytics;
/**
* The plugin.php file (called the plugin initialization script) defines the plugin information class.
*/
use System\Classes\PluginBase;
class Plugin extends PluginBase
{
public function pluginDetails()
{
return [
'name' => 'Google Analytics',
'description' => 'rainlab.googleanalytics::lang.strings.plugin_desc',
'author' => 'Alexey Bobkov, Samuel Georges',
'icon' => 'icon-bar-chart-o'
];
}
public function registerComponents()
{
return [
'\RainLab\GoogleAnalytics\Components\Tracker' => 'googleTracker'
];
}
public function registerPermissions()
{
return [
'rainlab.googleanalytics.access_settings' => [
'tab' => 'rainlab.googleanalytics::lang.permissions.tab',
'label' => 'rainlab.googleanalytics::lang.permissions.settings',
],
];
}
public function registerReportWidgets()
{
return [
'RainLab\GoogleAnalytics\ReportWidgets\TrafficOverview'=>[
'label' => 'Google Analytics traffic overview',
'context' => 'dashboard'
],
'RainLab\GoogleAnalytics\ReportWidgets\TrafficSources'=>[
'label' => 'Google Analytics traffic sources',
'context' => 'dashboard'
],
'RainLab\GoogleAnalytics\ReportWidgets\Browsers'=>[
'label' => 'Google Analytics browsers',
'context' => 'dashboard'
],
'RainLab\GoogleAnalytics\ReportWidgets\TrafficGoal'=>[
'label' => 'Google Analytics traffic goal',
'context' => 'dashboard'
],
'RainLab\GoogleAnalytics\ReportWidgets\TopPages'=>[
'label' => 'Google Analytics top pages',
'context' => 'dashboard'
]
];
}
public function registerSettings()
{
return [
'config' => [
'label' => 'Google Analytics',
'icon' => 'icon-bar-chart-o',
'description' => 'rainlab.googleanalytics::lang.strings.settings_desc',
'class' => 'RainLab\GoogleAnalytics\Models\Settings',
'permissions' => ['rainlab.googleanalytics.access_settings'],
'order' => 600,
]
];
}
public function boot()
{
set_include_path(get_include_path() . PATH_SEPARATOR . __DIR__.'/vendor/google/apiclient/src');
}
}