-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart.php
More file actions
67 lines (48 loc) · 1.67 KB
/
start.php
File metadata and controls
67 lines (48 loc) · 1.67 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
<?php
namespace AU\GroupTagMenu;
/**
* Group tag menu
* allows tags to become menu items in groups
* Jon Dron (jond@athabascau.ca)
* copyright Athabasca University 2013
* GPL2 licence - see manifest.xml
*/
const PLUGIN_ID = 'au_group_tag_menu';
elgg_register_event_handler('init', 'system', __NAMESPACE__ . '\\init');
function init() {
// add settings for tools
elgg_extend_view('groups/edit','au_group_tag_menu/tagmenu_settings');
//add the tag menu at the bottom of the sidebar
elgg_extend_view('page/elements/sidebar','au_group_tag_menu/sidebar/tagmenu');
// register group option to show tag menu
add_group_tool_option("tag_menu",elgg_echo("au_group_tag_menu:enable"),true);
//register action to save settings
elgg_register_action("au_group_tag_menu/groups/save_tagmenu", __DIR__ . "/actions/groups/save_tagmenu.php");
//register the tag type for menu tags
elgg_register_tag_metadata_name('menu_tags');
//register the page to show results
elgg_register_page_handler('group_tag_menu', __NAMESPACE__ . '\\group_tag_menu_page_handler');
// hook view vars for tags inputs
elgg_extend_view('input/tags', 'au_group_tag_menu/tag_extension');
elgg_extend_view('input/tags', 'au_group_tag_menu/tag_suggestions');
}
function group_tag_menu_page_handler($page){
$content = false;
//show the page of search results
// assumes url of group/guid/tag
// if the tag is 'all' then will display a tagcloud
switch ($page[0]){
case 'group':
$entity = get_entity($page[1]);
$content = elgg_view_resource('au_group_tag_menu/group', array(
'entity' => $entity,
'page' => $page
));
break;
}
if ($content) {
echo $content;
return true;
}
return false;
}