-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathstart.php
63 lines (51 loc) · 1.38 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
<?php
/*
* Elgg Connect theme
*
* @author Per Jensen
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License v2
* @copyright Copyright (c) 2019, Per Jensen
*
*/
return function() {
elgg_register_event_handler('init', 'system', 'connect_init');
};
function connect_init() {
$plugin = elgg_get_plugin_from_id('elgg_connect');
// custom icon sizes
elgg_register_plugin_hook_handler('entity:icon:sizes', 'group', 'elgg_connect_custom_icon_sizes');
// theme specific CSS
elgg_extend_view('elgg.css', 'elgg_connect/elgg_connect.css');
elgg_extend_view('groups/edit/profile', 'elgg_connect/elements/info', 0);
if (elgg_is_logged_in() && ($plugin->sidebar == "yes")) {
elgg_extend_view('river/sidebar', 'elgg_connect/sidebar');
}
}
/**
* Set custom icon sizes for group icons
*
* @param string $hook "entity:icon:url"
* @param string $type "object"
* @param array $return Sizes
* @param array $params Hook params
* @return array
*/
function elgg_connect_custom_icon_sizes($hook, $type, $return, $params) {
$entity_subtype = elgg_extract('entity_subtype', $params);
if ($entity_subtype !== 'group') {
return;
}
$return['group_cover'] = [
'w' => 1200,
'h' => 500,
'square' => false,
'upscale' => false,
];
$return['group_cover_small'] = [
'w' => 400,
'h' => 167,
'square' => false,
'upscale' => false,
];
return $return;
}