Code Duplication    Length = 20-23 lines in 3 locations

mod/externalpages/start.php 1 location

@@ 8-30 (lines=23) @@
5
6
elgg_register_event_handler('init', 'system', 'expages_init');
7
8
function expages_init() {
9
10
	// Register a page handler, so we can have nice URLs
11
	elgg_register_page_handler('about-a_propos', 'expages_page_handler');		// GCChange change - Ilia: Bilingual page url
12
	elgg_register_page_handler('terms', 'expages_page_handler');		// GCChange change - Ilia: Bilingual page url
13
	elgg_register_page_handler('privacy-confidentialite', 'expages_page_handler');		// GCChange change - Ilia: Bilingual page url
14
	elgg_register_page_handler('expages', 'expages_page_handler');
15
16
	// Register public external pages
17
	elgg_register_plugin_hook_handler('public_pages', 'walled_garden', 'expages_public');
18
19
	elgg_register_plugin_hook_handler('register', 'menu:expages', 'expages_menu_register_hook');
20
21
	// add a menu item for the admin edit page
22
	elgg_register_admin_menu_item('configure', 'expages', 'appearance');
23
24
	// add footer links
25
	expages_setup_footer_menu();
26
27
	// register action
28
	$actions_base = elgg_get_plugins_path() . 'externalpages/actions';
29
	elgg_register_action("expages/edit", "$actions_base/edit.php", 'admin');
30
}
31
32
/**
33
 * Extend the public pages range

mod/messageboard/start.php 1 location

@@ 13-32 (lines=20) @@
10
/**
11
 * MessageBoard initialisation
12
 */
13
function messageboard_init() {
14
	// js
15
	elgg_extend_view('js/elgg', 'messageboard/js');
16
17
	// css
18
	elgg_extend_view('css/elgg', 'messageboard/css');
19
20
	elgg_register_page_handler('messageboard', 'messageboard_page_handler');
21
22
	// messageboard widget - only for profile for now
23
	elgg_register_widget_type('messageboard', elgg_echo("messageboard:board"), elgg_echo("messageboard:desc"), array("profile"));
24
25
	// actions
26
	$action_path = dirname(__FILE__) . '/actions';
27
	elgg_register_action("messageboard/add", "$action_path/add.php");
28
	elgg_register_action("messageboard/delete", "$action_path/delete.php");
29
30
	// delete annotations for posts
31
	elgg_register_plugin_hook_handler('register', 'menu:annotation', 'messageboard_annotation_menu_setup');
32
}
33
34
/**
35
 * Messageboard dispatcher for flat message board.

mod/thewire_images/start.php 1 location

@@ 15-34 (lines=20) @@
12
 *
13
 * @return void
14
 */
15
function thewire_image() {
16
	$plugin_root = dirname(__FILE__);
17
	elgg_register_library('thewire_image', "$plugin_root/lib/thewire_image.php");
18
	elgg_register_js('dropzone', 'mod/thewire_images/js/dropzone.js');
19
	elgg_register_css('dropzone', 'mod/thewire_images/css/dropzone.css');
20
	
21
	elgg_extend_view('js/elgg', 'js/thewire_image');
22
23
	elgg_register_event_handler('create', 'object', 'thewire_image_check_attachments');
24
	elgg_register_event_handler('delete', 'object', 'thewire_image_delete_attached_files');
25
26
	// overrule default save action
27
	elgg_unregister_action("thewire/add");
28
	elgg_register_action("thewire/add", "$plugin_root/actions/thewire/add.php");
29
30
	// downloads are served through pages instead of actions so the download link can be shared.
31
	// action tokens prevent sharing action links.
32
	// this means we need to implement our own security in the page handler using gatekeeper().
33
	elgg_register_page_handler('thewire_image', 'thewire_image_page_handler');
34
}
35
36
/**
37
 * Check for attachments when wire posts are created.