-
Notifications
You must be signed in to change notification settings - Fork 1
/
start.php
106 lines (87 loc) · 2.77 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
<?php
/**
* Elgg theme plugin
*
* @package ElggTheme
*/
elgg_register_event_handler('init','system','elgg_theme_init');
function elgg_theme_init() {
elgg_register_event_handler('pagesetup', 'system', 'elgg_theme_pagesetup', 1000);
// theme specific CSS
elgg_extend_view('css/elgg', 'elgg_theme/css');
elgg_extend_view('page/elements/head', 'elgg_theme/meta', 1);
elgg_register_js('respond', 'mod/elgg_theme/vendors/js/respond.min.js');
elgg_load_js('respond');
elgg_register_js('elgg.theme', 'mod/elgg_theme/vendors/js/elgg_theme.js', 'footer');
elgg_load_js('elgg.theme');
if (!elgg_is_logged_in()) {
elgg_unregister_plugin_hook_handler('output:before', 'layout', 'elgg_views_add_rss_link');
}
}
function elgg_theme_pagesetup() {
elgg_unextend_view('page/elements/header', 'search/header');
if (elgg_is_logged_in()) {
elgg_extend_view('page/elements/sidebar', 'search/header', 0);
}
elgg_unregister_menu_item('topbar', 'dashboard');
if (elgg_is_active_plugin('dashboard')) {
elgg_register_menu_item('site', array(
'name' => 'dashboard',
'href' => 'dashboard',
'text' => elgg_echo('dashboard'),
));
}
if (elgg_is_logged_in()) {
$user = elgg_get_logged_in_user_entity();
elgg_register_menu_item('topbar', array(
'name' => 'account',
'text' => elgg_echo('account'),
'href' => "#",
'priority' => 100,
'section' => 'alt',
));
elgg_unregister_menu_item('topbar', 'usersettings');
elgg_register_menu_item('topbar', array(
'name' => 'usersettings',
'parent_name' => 'account',
'href' => "/settings/user/$user->username",
'text' => elgg_echo('settings'),
'priority' => 103,
'section' => 'alt',
));
elgg_unregister_menu_item('topbar', 'logout');
elgg_register_menu_item('topbar', array(
'name' => 'logout',
'parent_name' => 'account',
'href' => '/action/logout',
'is_action' => TRUE,
'text' => elgg_echo('logout'),
'priority' => 104,
'section' => 'alt',
));
elgg_unregister_menu_item('topbar', 'administration');
if (elgg_is_admin_logged_in()) {
elgg_register_menu_item('topbar', array(
'name' => 'administration',
'parent_name' => 'account',
'href' => 'admin',
'text' => elgg_echo('admin'),
'priority' => 101,
'section' => 'alt',
));
}
elgg_unregister_menu_item('footer', 'report_this');
if (elgg_is_active_plugin('reportedcontent')) {
$href = "javascript:elgg.forward('reportedcontent/add'";
$href .= "+'?address='+encodeURIComponent(location.href)";
$href .= "+'&title='+encodeURIComponent(document.title));";
elgg_register_menu_item('extras', array(
'name' => 'report_this',
'href' => $href,
'title' => elgg_echo('reportedcontent:this:tooltip'),
'text' => elgg_view_icon('report-this'),
'priority' => 500,
));
}
}
}