-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathstart.php
128 lines (103 loc) · 3.87 KB
/
start.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
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
<?php
namespace AU\Analytics;
const PLUGIN_ID = 'au_analytics';
const PLUGIN_VERSION = 20151005;
// include our procedural functions
require_once __DIR__ . '/lib/functions.php';
require_once __DIR__ . '/lib/hooks.php';
require_once __DIR__ . '/lib/events.php';
require_once __DIR__ . '/lib/batches.php';
elgg_register_event_handler('init', 'system', __NAMESPACE__ . '\\init');
// plugin init
function init() {
// extend our views
elgg_extend_view('css/admin', 'css/au_analytics');
elgg_register_ajax_view('au_analytics/results/pageview');
elgg_register_ajax_view('au_analytics/results/timeline');
// register page-specific css
elgg_register_css('au_analytics/jqplot', elgg_get_site_url() . 'mod/au_analytics/js/jqplot/jquery.jqplot.min.css');
elgg_register_css('au_analytics/tablesorter', elgg_get_site_url() . 'mod/au_analytics/js/tablesorter/style.css');
$cache = elgg_get_config('lastcache');
if (!elgg_get_config('simplecache_enabled')) {
$cache = time();
}
// Register our javascript
elgg_define_js('au_analytics/jqplot', array(
'src' => elgg_get_site_url() . 'mod/au_analytics/js/jqplot/jquery.jqplot.min.js?c='.$cache,
'deps' => array(
'jquery'
)
));
elgg_define_js('au_analytics/jqplot/canvas', array(
'src' => elgg_get_site_url() . 'mod/au_analytics/js/jqplot/excanvas.min.js?c='.$cache,
'deps' => array(
'au_analytics/jqplot'
)
));
elgg_define_js('au_analytics/jqplot/highlighter', array(
'src' => elgg_get_site_url() . 'mod/au_analytics/js/jqplot/plugins/jqplot.highlighter.min.js?c='.$cache,
'deps' => array(
'au_analytics/jqplot'
)
));
elgg_define_js('au_analytics/jqplot/cursor', array(
'src' => elgg_get_site_url() . 'mod/au_analytics/js/jqplot/plugins/jqplot.cursor.min.js?c='.$cache,
'deps' => array(
'au_analytics/jqplot'
)
));
elgg_define_js('au_analytics/jqplot/dateaxis', array(
'src' => elgg_get_site_url() . 'mod/au_analytics/js/jqplot/plugins/jqplot.dateAxisRenderer.min.js?c='.$cache,
'deps' => array(
'au_analytics/jqplot'
)
));
elgg_define_js('au_analytics/jqplot/barRender', array(
'src' => elgg_get_site_url() . 'mod/au_analytics/js/jqplot/plugins/jqplot.barRenderer.min.js?c='.$cache,
'deps' => array(
'au_analytics/jqplot'
)
));
elgg_define_js('au_analytics/jqplot/categoryAxis', array(
'src' => elgg_get_site_url() . 'mod/au_analytics/js/jqplot/plugins/jqplot.categoryAxisRenderer.min.js?c='.$cache,
'deps' => array(
'au_analytics/jqplot'
)
));
elgg_define_js('au_analytics/jqplot/pointLabels', array(
'src' => elgg_get_site_url() . 'mod/au_analytics/js/jqplot/plugins/jqplot.pointLabels.min.js?c='.$cache,
'deps' => array(
'au_analytics/jqplot'
)
));
elgg_define_js('au_analytics/jqplot/canvasAxisLabel', array(
'src' => elgg_get_site_url() . 'mod/au_analytics/js/jqplot/plugins/jqplot.canvasAxisLabelRenderer.min.js?c='.$cache,
'deps' => array(
'au_analytics/jqplot'
)
));
elgg_define_js('au_analytics/jqplot/canvasText', array(
'src' => elgg_get_site_url() . 'mod/au_analytics/js/jqplot/plugins/jqplot.canvasTextRenderer.min.js?c='.$cache,
'deps' => array(
'au_analytics/jqplot'
)
));
elgg_define_js('au_analytics/tablesorter', array(
'src' => elgg_get_site_url() . 'mod/au_analytics/js/tablesorter/jquery.tablesorter.min.js?c='.$cache
));
elgg_define_js('au_analytics/tablesorter/pager', array(
'src' => elgg_get_site_url() . 'mod/au_analytics/js/tablesorter/jquery.tablesorter.pager.js?c='.$cache,
'deps' => array(
'au_analytics/tablesorter'
)
));
// navigation
elgg_register_admin_menu_item('administer', 'au_pageview', 'statistics', 0);
elgg_register_admin_menu_item('administer', 'au_timeline', 'statistics', 0);
/*
* plugin hooks
*/
// log page views
elgg_register_plugin_hook_handler('output:before', 'page', __NAMESPACE__ . '\\record_pageview');
elgg_register_event_handler('upgrade', 'system', __NAMESPACE__ . '\\upgrades');
}