forked from ggouv/elgg-deck_river
-
Notifications
You must be signed in to change notification settings - Fork 0
/
start.php
40 lines (29 loc) · 1.27 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
<?php
elgg_register_event_handler('init','system','deck_river_init');
function deck_river_init() {
elgg_register_library('deck_river:api', elgg_get_plugins_path() . 'elgg-deck_river/lib/api.php');
elgg_load_library('deck_river:api');
elgg_extend_view('css/elgg','deck_river/css');
elgg_extend_view('js/elgg', 'deck_river/js');
elgg_register_page_handler('activity', 'deck_river_page_handler');
// register actions
$action_path = elgg_get_plugins_path() . 'elgg-deck_river/actions';
elgg_register_action('deck_river/column/settings', "$action_path/column/settings.php");
elgg_register_action('deck_river/column/move', "$action_path/column/move.php");
elgg_register_action('deck_river/tab/add', "$action_path/tab/add.php");
elgg_register_action('deck_river/tab/delete', "$action_path/tab/delete.php");
elgg_register_action('deck_river/tab/rename', "$action_path/tab/rename.php");
elgg_register_action('elgg-deck_river/settings/save', "$action_path/plugins/save.php");
}
function deck_river_page_handler($page) {
switch ($page[0]) {
case "ajax":
include_once dirname(__FILE__) . '/pages/ajax/' . $page[1] . '.php';
break;
default:
elgg_set_context(elgg_extract(0, $page, 'default'));
include_once dirname(__FILE__) . '/pages/river.php';
break;
}
return true;
}