start.php ➔ gcProfilePictureBadges_init()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 21

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 0
dl 0
loc 21
rs 9.584
c 0
b 0
f 0
1
<?php
2
3
	/*
4
	 *  User picture badges
5
	*/
6
7
	/* Initialise the theme */
8
	function gcProfilePictureBadges_init(){
9
10
		//elgg_extend_view('icon/user/default', 'gcProfilePictureBadges/default');
11
		elgg_register_action( "avatar/crop", elgg_get_plugins_path() . "gcProfilePictureBadges/actions/avatar/crop.php" );
12
13
		//add pledge to group sidebar
14
			 elgg_extend_view('groups/sidebar/sidebar', 'groups/sidebar/pledge', 1);
15
16
			 //add style so badge doesnt break in admin menu
17
			 elgg_extend_view('admin/header', 'widgets/avatar_style', 1);
18
19
			 //pledge action to add badge to avatar without havign to edit avatar
20
			 elgg_register_action('badge/pledge', elgg_get_plugins_path() . "gcProfilePictureBadges/actions/pledge.php");
21
22
			 //badge css
23
			 elgg_extend_view('css/elgg', 'gcProfilePictureBadges/css');
24
25
			 //group control
26
			 elgg_extend_view('groups/edit', 'groups/edit/badge_tool', 329);
27
			 elgg_register_action('group/enable_badge', elgg_get_plugins_path() . "gcProfilePictureBadges/actions/group/enable_badge.php");
28
	}
29
30
	// Initialise log browser
31
	elgg_register_event_handler('init','system','gcProfilePictureBadges_init');
32
33
?>
0 ignored issues
show
Best Practice introduced by
It is not recommended to use PHP's closing tag ?> in files other than templates.

Using a closing tag in PHP files that only contain PHP code is not recommended as you might accidentally add whitespace after the closing tag which would then be output by PHP. This can cause severe problems, for example headers cannot be sent anymore.

A simple precaution is to leave off the closing tag as it is not required, and it also has no negative effects whatsoever.

Loading history...
34