Completed
Push — master ( 659947...097daa )
by
unknown
09:31
created
src/bp-settings/bp-settings-actions.php 2 patches
Switch Indentation   +30 added lines, -30 removed lines patch added patch discarded remove patch
@@ -189,40 +189,40 @@
 block discarded – undo
189 189
 
190 190
 	// Email feedback.
191 191
 	switch ( $email_error ) {
192
-		case 'invalid' :
193
-			$feedback['email_invalid']  = __( 'That email address is invalid. Check the formatting and try again.', 'buddypress' );
194
-			break;
195
-		case 'blocked' :
196
-			$feedback['email_blocked']  = __( 'That email address is currently unavailable for use.', 'buddypress' );
197
-			break;
198
-		case 'taken' :
199
-			$feedback['email_taken']    = __( 'That email address is already taken.', 'buddypress' );
200
-			break;
201
-		case 'empty' :
202
-			$feedback['email_empty']    = __( 'Email address cannot be empty.', 'buddypress' );
203
-			break;
204
-		case false :
205
-			// No change.
206
-			break;
192
+	case 'invalid' :
193
+		$feedback['email_invalid']  = __( 'That email address is invalid. Check the formatting and try again.', 'buddypress' );
194
+		break;
195
+	case 'blocked' :
196
+		$feedback['email_blocked']  = __( 'That email address is currently unavailable for use.', 'buddypress' );
197
+		break;
198
+	case 'taken' :
199
+		$feedback['email_taken']    = __( 'That email address is already taken.', 'buddypress' );
200
+		break;
201
+	case 'empty' :
202
+		$feedback['email_empty']    = __( 'Email address cannot be empty.', 'buddypress' );
203
+		break;
204
+	case false :
205
+		// No change.
206
+		break;
207 207
 	}
208 208
 
209 209
 	// Password feedback.
210 210
 	switch ( $pass_error ) {
211
-		case 'invalid' :
212
-			$feedback['pass_error']    = __( 'Your current password is invalid.', 'buddypress' );
213
-			break;
214
-		case 'mismatch' :
215
-			$feedback['pass_mismatch'] = __( 'The new password fields did not match.', 'buddypress' );
216
-			break;
217
-		case 'empty' :
218
-			$feedback['pass_empty']    = __( 'One of the password fields was empty.', 'buddypress' );
219
-			break;
220
-		case 'same' :
221
-			$feedback['pass_same'] 	   = __( 'The new password must be different from the current password.', 'buddypress' );
222
-			break;
223
-		case false :
224
-			// No change.
225
-			break;
211
+	case 'invalid' :
212
+		$feedback['pass_error']    = __( 'Your current password is invalid.', 'buddypress' );
213
+		break;
214
+	case 'mismatch' :
215
+		$feedback['pass_mismatch'] = __( 'The new password fields did not match.', 'buddypress' );
216
+		break;
217
+	case 'empty' :
218
+		$feedback['pass_empty']    = __( 'One of the password fields was empty.', 'buddypress' );
219
+		break;
220
+	case 'same' :
221
+		$feedback['pass_same'] 	   = __( 'The new password must be different from the current password.', 'buddypress' );
222
+		break;
223
+	case false :
224
+		// No change.
225
+		break;
226 226
 	}
227 227
 
228 228
 	// No errors so show a simple success message.
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -139,7 +139,7 @@
 block discarded – undo
139 139
 			if ( ( $_POST['pass1'] == $_POST['pass2'] ) && !strpos( " " . wp_unslash( $_POST['pass1'] ), "\\" ) ) {
140 140
 
141 141
 				// Password change attempt is successful.
142
-				if ( ( ! empty( $_POST['pwd'] ) && $_POST['pwd'] != $_POST['pass1'] ) || is_super_admin() )  {
142
+				if ( ( ! empty( $_POST['pwd'] ) && $_POST['pwd'] != $_POST['pass1'] ) || is_super_admin() ) {
143 143
 					$update_user->user_pass = $_POST['pass1'];
144 144
 					$pass_changed = true;
145 145
 
Please login to merge, or discard this patch.
src/bp-templates/bp-nouveau/includes/ajax.php 1 patch
Switch Indentation   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -45,33 +45,33 @@
 block discarded – undo
45 45
 
46 46
 		// We need to calculate and return the feed URL for each scope.
47 47
 		switch ( $scope ) {
48
-			case 'friends':
49
-				$feed_url = bp_loggedin_user_domain() . bp_get_activity_slug() . '/friends/feed/';
50
-				break;
51
-			case 'groups':
52
-				$feed_url = bp_loggedin_user_domain() . bp_get_activity_slug() . '/groups/feed/';
53
-				break;
54
-			case 'favorites':
55
-				$feed_url = bp_loggedin_user_domain() . bp_get_activity_slug() . '/favorites/feed/';
56
-				break;
57
-			case 'mentions':
58
-				$feed_url = bp_loggedin_user_domain() . bp_get_activity_slug() . '/mentions/feed/';
59
-
60
-				// Get user new mentions
61
-				$new_mentions = bp_get_user_meta( bp_loggedin_user_id(), 'bp_new_mentions', true );
62
-
63
-				// If we have some, include them into the returned json before deleting them
64
-				if ( is_array( $new_mentions ) ) {
65
-					$result['new_mentions'] = $new_mentions;
66
-
67
-					// Clear new mentions
68
-					bp_activity_clear_new_mentions( bp_loggedin_user_id() );
69
-				}
70
-
71
-				break;
72
-			default:
73
-				$feed_url = home_url( bp_get_activity_root_slug() . '/feed/' );
74
-				break;
48
+		case 'friends':
49
+			$feed_url = bp_loggedin_user_domain() . bp_get_activity_slug() . '/friends/feed/';
50
+			break;
51
+		case 'groups':
52
+			$feed_url = bp_loggedin_user_domain() . bp_get_activity_slug() . '/groups/feed/';
53
+			break;
54
+		case 'favorites':
55
+			$feed_url = bp_loggedin_user_domain() . bp_get_activity_slug() . '/favorites/feed/';
56
+			break;
57
+		case 'mentions':
58
+			$feed_url = bp_loggedin_user_domain() . bp_get_activity_slug() . '/mentions/feed/';
59
+
60
+			// Get user new mentions
61
+			$new_mentions = bp_get_user_meta( bp_loggedin_user_id(), 'bp_new_mentions', true );
62
+
63
+			// If we have some, include them into the returned json before deleting them
64
+			if ( is_array( $new_mentions ) ) {
65
+				$result['new_mentions'] = $new_mentions;
66
+
67
+				// Clear new mentions
68
+				bp_activity_clear_new_mentions( bp_loggedin_user_id() );
69
+			}
70
+
71
+			break;
72
+		default:
73
+			$feed_url = home_url( bp_get_activity_root_slug() . '/feed/' );
74
+			break;
75 75
 		}
76 76
 
77 77
 		$result['feed_url'] = apply_filters( 'bp_legacy_theme_activity_feed_url', $feed_url, $scope );
Please login to merge, or discard this patch.
src/bp-templates/bp-nouveau/includes/groups/ajax.php 1 patch
Switch Indentation   +136 added lines, -136 removed lines patch added patch discarded remove patch
@@ -86,148 +86,148 @@
 block discarded – undo
86 86
 	// Manage all button's possible actions here.
87 87
 	switch ( $_POST['action'] ) {
88 88
 
89
-		case 'groups_accept_invite':
90
-			if ( ! groups_accept_invite( bp_loggedin_user_id(), $group_id ) ) {
91
-				$response = array(
92
-					'feedback' => sprintf(
93
-						'<div class="bp-feedback error"><span class="bp-icon" aria-hidden="true"></span><p>%s</p></div>',
94
-						esc_html__( 'Group invite could not be accepted.', 'buddypress' )
95
-					),
96
-					'type'     => 'error',
97
-				);
89
+	case 'groups_accept_invite':
90
+		if ( ! groups_accept_invite( bp_loggedin_user_id(), $group_id ) ) {
91
+			$response = array(
92
+				'feedback' => sprintf(
93
+					'<div class="bp-feedback error"><span class="bp-icon" aria-hidden="true"></span><p>%s</p></div>',
94
+					esc_html__( 'Group invite could not be accepted.', 'buddypress' )
95
+				),
96
+				'type'     => 'error',
97
+			);
98 98
 
99
-			} else {
100
-				groups_record_activity(
101
-					array(
102
-						'type'    => 'joined_group',
103
-						'item_id' => $group->id,
104
-					)
105
-				);
99
+		} else {
100
+			groups_record_activity(
101
+				array(
102
+					'type'    => 'joined_group',
103
+					'item_id' => $group->id,
104
+				)
105
+			);
106 106
 
107
-				// User is now a member of the group
108
-				$group->is_member = '1';
109
-
110
-				$response = array(
111
-					'feedback' => sprintf(
112
-						'<div class="bp-feedback success"><span class="bp-icon" aria-hidden="true"></span><p>%s</p></div>',
113
-						esc_html__( 'Group invite accepted.', 'buddypress' )
114
-					),
115
-					'type'     => 'success',
116
-					'is_user'  => bp_is_user(),
117
-					'contents' => bp_get_group_join_button( $group ),
118
-					'is_group' => bp_is_group(),
119
-				);
120
-			}
121
-			break;
122
-
123
-		case 'groups_reject_invite':
124
-			if ( ! groups_reject_invite( bp_loggedin_user_id(), $group_id ) ) {
125
-				$response = array(
126
-					'feedback' => sprintf(
127
-						'<div class="bp-feedback error"><span class="bp-icon" aria-hidden="true"></span><p>%s</p></div>',
128
-						esc_html__( 'Group invite could not be rejected', 'buddypress' )
129
-					),
130
-					'type'     => 'error',
131
-				);
132
-			} else {
133
-				$response = array(
134
-					'feedback' => sprintf(
135
-						'<div class="bp-feedback success"><span class="bp-icon" aria-hidden="true"></span><p>%s</p></div>',
136
-						esc_html__( 'Group invite rejected', 'buddypress' )
137
-					),
138
-					'type'     => 'success',
139
-					'is_user'  => bp_is_user(),
140
-				);
141
-			}
142
-			break;
107
+			// User is now a member of the group
108
+			$group->is_member = '1';
109
+
110
+			$response = array(
111
+				'feedback' => sprintf(
112
+					'<div class="bp-feedback success"><span class="bp-icon" aria-hidden="true"></span><p>%s</p></div>',
113
+					esc_html__( 'Group invite accepted.', 'buddypress' )
114
+				),
115
+				'type'     => 'success',
116
+				'is_user'  => bp_is_user(),
117
+				'contents' => bp_get_group_join_button( $group ),
118
+				'is_group' => bp_is_group(),
119
+			);
120
+		}
121
+		break;
122
+
123
+	case 'groups_reject_invite':
124
+		if ( ! groups_reject_invite( bp_loggedin_user_id(), $group_id ) ) {
125
+			$response = array(
126
+				'feedback' => sprintf(
127
+					'<div class="bp-feedback error"><span class="bp-icon" aria-hidden="true"></span><p>%s</p></div>',
128
+					esc_html__( 'Group invite could not be rejected', 'buddypress' )
129
+				),
130
+				'type'     => 'error',
131
+			);
132
+		} else {
133
+			$response = array(
134
+				'feedback' => sprintf(
135
+					'<div class="bp-feedback success"><span class="bp-icon" aria-hidden="true"></span><p>%s</p></div>',
136
+					esc_html__( 'Group invite rejected', 'buddypress' )
137
+				),
138
+				'type'     => 'success',
139
+				'is_user'  => bp_is_user(),
140
+			);
141
+		}
142
+		break;
143 143
 
144
-		case 'groups_join_group':
145
-			if ( groups_is_user_member( bp_loggedin_user_id(), $group->id ) ) {
146
-				$response = array(
147
-					'feedback' => $errors['member'],
148
-					'type'     => 'error',
149
-				);
150
-			} elseif ( 'public' !== $group->status ) {
151
-				$response = array(
152
-					'feedback' => $errors['cannot'],
153
-					'type'     => 'error',
154
-				);
155
-			} elseif ( ! groups_join_group( $group->id ) ) {
156
-				$response = array(
157
-					'feedback' => sprintf(
158
-						'<div class="bp-feedback error"><span class="bp-icon" aria-hidden="true"></span><p>%s</p></div>',
159
-						esc_html__( 'Error joining this group.', 'buddypress' )
160
-					),
161
-					'type'     => 'error',
162
-				);
163
-			} else {
164
-				// User is now a member of the group
165
-				$group->is_member = '1';
166
-
167
-				$response = array(
168
-					'contents' => bp_get_group_join_button( $group ),
169
-					'is_group' => bp_is_group(),
170
-					'type'     => 'success',
171
-				);
172
-			}
173
-			break;
174
-
175
-			case 'groups_request_membership' :
176
-				if ( ! groups_send_membership_request( bp_loggedin_user_id(), $group->id ) ) {
177
-					$response = array(
178
-						'feedback' => sprintf(
179
-							'<div class="bp-feedback error"><span class="bp-icon" aria-hidden="true"></span><p>%s</p></div>',
180
-							esc_html__( 'Error requesting membership.', 'buddypress' )
181
-						),
182
-						'type'     => 'error',
183
-					);
184
-				} else {
185
-					// Request is pending
186
-					$group->is_pending = '1';
187
-
188
-					$response = array(
189
-						'contents' => bp_get_group_join_button( $group ),
190
-						'is_group' => bp_is_group(),
191
-						'type'     => 'success',
192
-					);
193
-				}
194
-				break;
195
-
196
-			case 'groups_leave_group' :
197
-				if (  groups_leave_group( $group->id ) ) {
198
-					$response = array(
199
-						'feedback' => sprintf(
200
-							'<div class="bp-feedback error"><span class="bp-icon" aria-hidden="true"></span><p>%s</p></div>',
201
-							esc_html__( 'Error leaving group.', 'buddypress' )
202
-						),
203
-						'type'     => 'error',
204
-					);
205
-				} else {
206
-					// User is no more a member of the group
207
-					$group->is_member = '0';
208
-					$bp               = buddypress();
209
-
210
-					/**
144
+	case 'groups_join_group':
145
+		if ( groups_is_user_member( bp_loggedin_user_id(), $group->id ) ) {
146
+			$response = array(
147
+				'feedback' => $errors['member'],
148
+				'type'     => 'error',
149
+			);
150
+		} elseif ( 'public' !== $group->status ) {
151
+			$response = array(
152
+				'feedback' => $errors['cannot'],
153
+				'type'     => 'error',
154
+			);
155
+		} elseif ( ! groups_join_group( $group->id ) ) {
156
+			$response = array(
157
+				'feedback' => sprintf(
158
+					'<div class="bp-feedback error"><span class="bp-icon" aria-hidden="true"></span><p>%s</p></div>',
159
+					esc_html__( 'Error joining this group.', 'buddypress' )
160
+				),
161
+				'type'     => 'error',
162
+			);
163
+		} else {
164
+			// User is now a member of the group
165
+			$group->is_member = '1';
166
+
167
+			$response = array(
168
+				'contents' => bp_get_group_join_button( $group ),
169
+				'is_group' => bp_is_group(),
170
+				'type'     => 'success',
171
+			);
172
+		}
173
+		break;
174
+
175
+	case 'groups_request_membership' :
176
+		if ( ! groups_send_membership_request( bp_loggedin_user_id(), $group->id ) ) {
177
+			$response = array(
178
+				'feedback' => sprintf(
179
+					'<div class="bp-feedback error"><span class="bp-icon" aria-hidden="true"></span><p>%s</p></div>',
180
+					esc_html__( 'Error requesting membership.', 'buddypress' )
181
+				),
182
+				'type'     => 'error',
183
+			);
184
+		} else {
185
+			// Request is pending
186
+			$group->is_pending = '1';
187
+
188
+			$response = array(
189
+				'contents' => bp_get_group_join_button( $group ),
190
+				'is_group' => bp_is_group(),
191
+				'type'     => 'success',
192
+			);
193
+		}
194
+		break;
195
+
196
+	case 'groups_leave_group' :
197
+		if (  groups_leave_group( $group->id ) ) {
198
+			$response = array(
199
+				'feedback' => sprintf(
200
+					'<div class="bp-feedback error"><span class="bp-icon" aria-hidden="true"></span><p>%s</p></div>',
201
+					esc_html__( 'Error leaving group.', 'buddypress' )
202
+				),
203
+				'type'     => 'error',
204
+			);
205
+		} else {
206
+			// User is no more a member of the group
207
+			$group->is_member = '0';
208
+			$bp               = buddypress();
209
+
210
+			/**
211 211
 					 * When inside the group or in the loggedin user's group memberships screen
212 212
 					 * we need to reload the page.
213 213
 					 */
214
-					$bp_is_group = bp_is_group() || ( bp_is_user_groups() && bp_is_my_profile() );
215
-
216
-					$response = array(
217
-						'contents' => bp_get_group_join_button( $group ),
218
-						'is_group' => $bp_is_group,
219
-						'type'     => 'success',
220
-					);
221
-
222
-					// Reset the message if not in a Group or in a loggedin user's group memberships one!
223
-					if ( ! $bp_is_group && isset( $bp->template_message ) && isset( $bp->template_message_type ) ) {
224
-						unset( $bp->template_message, $bp->template_message_type );
225
-
226
-						@setcookie( 'bp-message', false, time() - 1000, COOKIEPATH, COOKIE_DOMAIN, is_ssl() );
227
-						@setcookie( 'bp-message-type', false, time() - 1000, COOKIEPATH, COOKIE_DOMAIN, is_ssl() );
228
-					}
229
-				}
230
-				break;
214
+			$bp_is_group = bp_is_group() || ( bp_is_user_groups() && bp_is_my_profile() );
215
+
216
+			$response = array(
217
+				'contents' => bp_get_group_join_button( $group ),
218
+				'is_group' => $bp_is_group,
219
+				'type'     => 'success',
220
+			);
221
+
222
+			// Reset the message if not in a Group or in a loggedin user's group memberships one!
223
+			if ( ! $bp_is_group && isset( $bp->template_message ) && isset( $bp->template_message_type ) ) {
224
+				unset( $bp->template_message, $bp->template_message_type );
225
+
226
+				@setcookie( 'bp-message', false, time() - 1000, COOKIEPATH, COOKIE_DOMAIN, is_ssl() );
227
+				@setcookie( 'bp-message-type', false, time() - 1000, COOKIEPATH, COOKIE_DOMAIN, is_ssl() );
228
+			}
229
+		}
230
+		break;
231 231
 	}
232 232
 
233 233
 	if ( 'error' === $response['type'] ) {
Please login to merge, or discard this patch.
src/bp-templates/bp-legacy/buddypress-functions.php 2 patches
Switch Indentation   +995 added lines, -995 removed lines patch added patch discarded remove patch
@@ -34,19 +34,19 @@  discard block
 block discarded – undo
34 34
  */
35 35
 class BP_Legacy extends BP_Theme_Compat {
36 36
 
37
-	/** Functions *************************************************************/
37
+/** Functions *************************************************************/
38 38
 
39
-	/**
39
+/**
40 40
 	 * The main BuddyPress (Legacy) Loader.
41 41
 	 *
42 42
 	 * @since 1.7.0
43 43
 	 *
44 44
 	 */
45
-	public function __construct() {
46
-		parent::start();
47
-	}
45
+public function __construct() {
46
+parent::start();
47
+}
48 48
 
49
-	/**
49
+/**
50 50
 	 * Component global variables.
51 51
 	 *
52 52
 	 * You'll want to customize the values in here, so they match whatever your
@@ -54,295 +54,295 @@  discard block
 block discarded – undo
54 54
 	 *
55 55
 	 * @since 1.7.0
56 56
 	 */
57
-	protected function setup_globals() {
58
-		$bp            = buddypress();
59
-		$this->id      = 'legacy';
60
-		$this->name    = __( 'BuddyPress Legacy', 'buddypress' );
61
-		$this->version = bp_get_version();
62
-		$this->dir     = trailingslashit( $bp->themes_dir . '/bp-legacy' );
63
-		$this->url     = trailingslashit( $bp->themes_url . '/bp-legacy' );
64
-	}
65
-
66
-	/**
57
+protected function setup_globals() {
58
+$bp            = buddypress();
59
+$this->id      = 'legacy';
60
+$this->name    = __( 'BuddyPress Legacy', 'buddypress' );
61
+$this->version = bp_get_version();
62
+$this->dir     = trailingslashit( $bp->themes_dir . '/bp-legacy' );
63
+$this->url     = trailingslashit( $bp->themes_url . '/bp-legacy' );
64
+}
65
+
66
+/**
67 67
 	 * Setup the theme hooks.
68 68
 	 *
69 69
 	 * @since 1.7.0
70 70
 	 *
71 71
 	 */
72
-	protected function setup_actions() {
72
+protected function setup_actions() {
73 73
 
74
-		// Template Output.
75
-		add_filter( 'bp_get_activity_action_pre_meta', array( $this, 'secondary_avatars' ), 10, 2 );
74
+// Template Output.
75
+add_filter( 'bp_get_activity_action_pre_meta', array( $this, 'secondary_avatars' ), 10, 2 );
76 76
 
77
-		// Filter BuddyPress template hierarchy and look for page templates.
78
-		add_filter( 'bp_get_buddypress_template', array( $this, 'theme_compat_page_templates' ), 10, 1 );
77
+// Filter BuddyPress template hierarchy and look for page templates.
78
+add_filter( 'bp_get_buddypress_template', array( $this, 'theme_compat_page_templates' ), 10, 1 );
79 79
 
80
-		/** Scripts ***********************************************************/
80
+/** Scripts ***********************************************************/
81 81
 
82
-		add_action( 'bp_enqueue_scripts', array( $this, 'enqueue_styles'   ) ); // Enqueue theme CSS
83
-		add_action( 'bp_enqueue_scripts', array( $this, 'enqueue_scripts'  ) ); // Enqueue theme JS
84
-		add_filter( 'bp_enqueue_scripts', array( $this, 'localize_scripts' ) ); // Enqueue theme script localization
82
+add_action( 'bp_enqueue_scripts', array( $this, 'enqueue_styles'   ) ); // Enqueue theme CSS
83
+add_action( 'bp_enqueue_scripts', array( $this, 'enqueue_scripts'  ) ); // Enqueue theme JS
84
+add_filter( 'bp_enqueue_scripts', array( $this, 'localize_scripts' ) ); // Enqueue theme script localization
85 85
 
86
-		/** Body no-js Class **************************************************/
86
+/** Body no-js Class **************************************************/
87 87
 
88
-		add_filter( 'body_class', array( $this, 'add_nojs_body_class' ), 20, 1 );
88
+add_filter( 'body_class', array( $this, 'add_nojs_body_class' ), 20, 1 );
89 89
 
90
-		/** Buttons ***********************************************************/
90
+/** Buttons ***********************************************************/
91 91
 
92
-		if ( ! is_admin() || ( defined( 'DOING_AJAX' ) && DOING_AJAX ) ) {
93
-			// Register buttons for the relevant component templates
94
-			// Friends button.
95
-			if ( bp_is_active( 'friends' ) )
96
-				add_action( 'bp_member_header_actions',    'bp_add_friend_button',           5 );
92
+if ( ! is_admin() || ( defined( 'DOING_AJAX' ) && DOING_AJAX ) ) {
93
+// Register buttons for the relevant component templates
94
+// Friends button.
95
+if ( bp_is_active( 'friends' ) )
96
+add_action( 'bp_member_header_actions',    'bp_add_friend_button',           5 );
97 97
 
98
-			// Activity button.
99
-			if ( bp_is_active( 'activity' ) && bp_activity_do_mentions() )
100
-				add_action( 'bp_member_header_actions',    'bp_send_public_message_button',  20 );
98
+// Activity button.
99
+if ( bp_is_active( 'activity' ) && bp_activity_do_mentions() )
100
+add_action( 'bp_member_header_actions',    'bp_send_public_message_button',  20 );
101 101
 
102
-			// Messages button.
103
-			if ( bp_is_active( 'messages' ) )
104
-				add_action( 'bp_member_header_actions',    'bp_send_private_message_button', 20 );
102
+// Messages button.
103
+if ( bp_is_active( 'messages' ) )
104
+add_action( 'bp_member_header_actions',    'bp_send_private_message_button', 20 );
105 105
 
106
-			// Group buttons.
107
-			if ( bp_is_active( 'groups' ) ) {
108
-				add_action( 'bp_group_header_actions',          'bp_group_join_button',               5           );
109
-				add_action( 'bp_directory_groups_actions',      'bp_group_join_button'                            );
110
-				add_action( 'bp_groups_directory_group_filter', 'bp_legacy_theme_group_create_nav', 999           );
111
-				add_action( 'bp_after_group_admin_content',     'bp_legacy_groups_admin_screen_hidden_input'      );
112
-				add_action( 'bp_before_group_admin_form',       'bp_legacy_theme_group_manage_members_add_search' );
113
-			}
106
+// Group buttons.
107
+if ( bp_is_active( 'groups' ) ) {
108
+add_action( 'bp_group_header_actions',          'bp_group_join_button',               5           );
109
+add_action( 'bp_directory_groups_actions',      'bp_group_join_button'                            );
110
+add_action( 'bp_groups_directory_group_filter', 'bp_legacy_theme_group_create_nav', 999           );
111
+add_action( 'bp_after_group_admin_content',     'bp_legacy_groups_admin_screen_hidden_input'      );
112
+add_action( 'bp_before_group_admin_form',       'bp_legacy_theme_group_manage_members_add_search' );
113
+}
114 114
 
115
-			// Blog button.
116
-			if ( bp_is_active( 'blogs' ) ) {
117
-				add_action( 'bp_directory_blogs_actions',    'bp_blogs_visit_blog_button'           );
118
-				add_action( 'bp_blogs_directory_blog_types', 'bp_legacy_theme_blog_create_nav', 999 );
119
-			}
120
-		}
115
+// Blog button.
116
+if ( bp_is_active( 'blogs' ) ) {
117
+add_action( 'bp_directory_blogs_actions',    'bp_blogs_visit_blog_button'           );
118
+add_action( 'bp_blogs_directory_blog_types', 'bp_legacy_theme_blog_create_nav', 999 );
119
+}
120
+}
121 121
 
122
-		/** Notices ***********************************************************/
122
+/** Notices ***********************************************************/
123 123
 
124
-		// Only hook the 'sitewide_notices' overlay if the Sitewide
125
-		// Notices widget is not in use (to avoid duplicate content).
126
-		if ( bp_is_active( 'messages' ) && ! is_active_widget( false, false, 'bp_messages_sitewide_notices_widget', true ) ) {
127
-			add_action( 'wp_footer', array( $this, 'sitewide_notices' ), 9999 );
128
-		}
124
+// Only hook the 'sitewide_notices' overlay if the Sitewide
125
+// Notices widget is not in use (to avoid duplicate content).
126
+if ( bp_is_active( 'messages' ) && ! is_active_widget( false, false, 'bp_messages_sitewide_notices_widget', true ) ) {
127
+add_action( 'wp_footer', array( $this, 'sitewide_notices' ), 9999 );
128
+}
129 129
 
130
-		/** Ajax **************************************************************/
131
-
132
-		$actions = array(
133
-
134
-			// Directory filters.
135
-			'blogs_filter'    => 'bp_legacy_theme_object_template_loader',
136
-			'forums_filter'   => 'bp_legacy_theme_object_template_loader',
137
-			'groups_filter'   => 'bp_legacy_theme_object_template_loader',
138
-			'members_filter'  => 'bp_legacy_theme_object_template_loader',
139
-			'messages_filter' => 'bp_legacy_theme_messages_template_loader',
140
-			'invite_filter'   => 'bp_legacy_theme_invite_template_loader',
141
-			'requests_filter' => 'bp_legacy_theme_requests_template_loader',
142
-
143
-			// Friends.
144
-			'accept_friendship' => 'bp_legacy_theme_ajax_accept_friendship',
145
-			'addremove_friend'  => 'bp_legacy_theme_ajax_addremove_friend',
146
-			'reject_friendship' => 'bp_legacy_theme_ajax_reject_friendship',
147
-
148
-			// Activity.
149
-			'activity_get_older_updates'  => 'bp_legacy_theme_activity_template_loader',
150
-			'activity_mark_fav'           => 'bp_legacy_theme_mark_activity_favorite',
151
-			'activity_mark_unfav'         => 'bp_legacy_theme_unmark_activity_favorite',
152
-			'activity_widget_filter'      => 'bp_legacy_theme_activity_template_loader',
153
-			'delete_activity'             => 'bp_legacy_theme_delete_activity',
154
-			'delete_activity_comment'     => 'bp_legacy_theme_delete_activity_comment',
155
-			'get_single_activity_content' => 'bp_legacy_theme_get_single_activity_content',
156
-			'new_activity_comment'        => 'bp_legacy_theme_new_activity_comment',
157
-			'post_update'                 => 'bp_legacy_theme_post_update',
158
-			'bp_spam_activity'            => 'bp_legacy_theme_spam_activity',
159
-			'bp_spam_activity_comment'    => 'bp_legacy_theme_spam_activity',
160
-
161
-			// Groups.
162
-			'groups_invite_user' => 'bp_legacy_theme_ajax_invite_user',
163
-			'joinleave_group'    => 'bp_legacy_theme_ajax_joinleave_group',
164
-
165
-			// Messages.
166
-			'messages_autocomplete_results' => 'bp_legacy_theme_ajax_messages_autocomplete_results',
167
-			'messages_close_notice'         => 'bp_legacy_theme_ajax_close_notice',
168
-			'messages_delete'               => 'bp_legacy_theme_ajax_messages_delete',
169
-			'messages_markread'             => 'bp_legacy_theme_ajax_message_markread',
170
-			'messages_markunread'           => 'bp_legacy_theme_ajax_message_markunread',
171
-			'messages_send_reply'           => 'bp_legacy_theme_ajax_messages_send_reply',
172
-		);
173
-
174
-		// Conditional actions.
175
-		if ( bp_is_active( 'messages', 'star' ) ) {
176
-			$actions['messages_star'] = 'bp_legacy_theme_ajax_messages_star_handler';
177
-		}
130
+/** Ajax **************************************************************/
131
+
132
+$actions = array(
133
+
134
+// Directory filters.
135
+'blogs_filter'    => 'bp_legacy_theme_object_template_loader',
136
+'forums_filter'   => 'bp_legacy_theme_object_template_loader',
137
+'groups_filter'   => 'bp_legacy_theme_object_template_loader',
138
+'members_filter'  => 'bp_legacy_theme_object_template_loader',
139
+'messages_filter' => 'bp_legacy_theme_messages_template_loader',
140
+'invite_filter'   => 'bp_legacy_theme_invite_template_loader',
141
+'requests_filter' => 'bp_legacy_theme_requests_template_loader',
142
+
143
+// Friends.
144
+'accept_friendship' => 'bp_legacy_theme_ajax_accept_friendship',
145
+'addremove_friend'  => 'bp_legacy_theme_ajax_addremove_friend',
146
+'reject_friendship' => 'bp_legacy_theme_ajax_reject_friendship',
147
+
148
+// Activity.
149
+'activity_get_older_updates'  => 'bp_legacy_theme_activity_template_loader',
150
+'activity_mark_fav'           => 'bp_legacy_theme_mark_activity_favorite',
151
+'activity_mark_unfav'         => 'bp_legacy_theme_unmark_activity_favorite',
152
+'activity_widget_filter'      => 'bp_legacy_theme_activity_template_loader',
153
+'delete_activity'             => 'bp_legacy_theme_delete_activity',
154
+'delete_activity_comment'     => 'bp_legacy_theme_delete_activity_comment',
155
+'get_single_activity_content' => 'bp_legacy_theme_get_single_activity_content',
156
+'new_activity_comment'        => 'bp_legacy_theme_new_activity_comment',
157
+'post_update'                 => 'bp_legacy_theme_post_update',
158
+'bp_spam_activity'            => 'bp_legacy_theme_spam_activity',
159
+'bp_spam_activity_comment'    => 'bp_legacy_theme_spam_activity',
160
+
161
+// Groups.
162
+'groups_invite_user' => 'bp_legacy_theme_ajax_invite_user',
163
+'joinleave_group'    => 'bp_legacy_theme_ajax_joinleave_group',
164
+
165
+// Messages.
166
+'messages_autocomplete_results' => 'bp_legacy_theme_ajax_messages_autocomplete_results',
167
+'messages_close_notice'         => 'bp_legacy_theme_ajax_close_notice',
168
+'messages_delete'               => 'bp_legacy_theme_ajax_messages_delete',
169
+'messages_markread'             => 'bp_legacy_theme_ajax_message_markread',
170
+'messages_markunread'           => 'bp_legacy_theme_ajax_message_markunread',
171
+'messages_send_reply'           => 'bp_legacy_theme_ajax_messages_send_reply',
172
+);
173
+
174
+// Conditional actions.
175
+if ( bp_is_active( 'messages', 'star' ) ) {
176
+$actions['messages_star'] = 'bp_legacy_theme_ajax_messages_star_handler';
177
+}
178 178
 
179
-		/**
179
+/**
180 180
 		 * Register all of these AJAX handlers.
181 181
 		 *
182 182
 		 * The "wp_ajax_" action is used for logged in users, and "wp_ajax_nopriv_"
183 183
 		 * executes for users that aren't logged in. This is for backpat with BP <1.6.
184 184
 		 */
185
-		foreach( $actions as $name => $function ) {
186
-			add_action( 'wp_ajax_'        . $name, $function );
187
-			add_action( 'wp_ajax_nopriv_' . $name, $function );
188
-		}
185
+foreach( $actions as $name => $function ) {
186
+add_action( 'wp_ajax_'        . $name, $function );
187
+add_action( 'wp_ajax_nopriv_' . $name, $function );
188
+}
189 189
 
190
-		add_filter( 'bp_ajax_querystring', 'bp_legacy_theme_ajax_querystring', 10, 2 );
190
+add_filter( 'bp_ajax_querystring', 'bp_legacy_theme_ajax_querystring', 10, 2 );
191 191
 
192
-		/** Override **********************************************************/
192
+/** Override **********************************************************/
193 193
 
194
-		/**
194
+/**
195 195
 		 * Fires after all of the BuddyPress theme compat actions have been added.
196 196
 		 *
197 197
 		 * @since 1.7.0
198 198
 		 *
199 199
 		 * @param BP_Legacy $this Current BP_Legacy instance.
200 200
 		 */
201
-		do_action_ref_array( 'bp_theme_compat_actions', array( &$this ) );
202
-	}
201
+do_action_ref_array( 'bp_theme_compat_actions', array( &$this ) );
202
+}
203 203
 
204
-	/**
204
+/**
205 205
 	 * Load the theme CSS
206 206
 	 *
207 207
 	 * @since 1.7.0
208 208
 	 * @since 2.3.0 Support custom CSS file named after the current theme or parent theme.
209 209
 	 *
210 210
 	 */
211
-	public function enqueue_styles() {
212
-		$min = bp_core_get_minified_asset_suffix();
211
+public function enqueue_styles() {
212
+$min = bp_core_get_minified_asset_suffix();
213 213
 
214
-		// Locate the BP stylesheet.
215
-		$ltr = $this->locate_asset_in_stack( "buddypress{$min}.css",     'css' );
214
+// Locate the BP stylesheet.
215
+$ltr = $this->locate_asset_in_stack( "buddypress{$min}.css",     'css' );
216 216
 
217
-		// LTR.
218
-		if ( ! is_rtl() && isset( $ltr['location'], $ltr['handle'] ) ) {
219
-			wp_enqueue_style( $ltr['handle'], $ltr['location'], array(), $this->version, 'screen' );
217
+// LTR.
218
+if ( ! is_rtl() && isset( $ltr['location'], $ltr['handle'] ) ) {
219
+wp_enqueue_style( $ltr['handle'], $ltr['location'], array(), $this->version, 'screen' );
220 220
 
221
-			if ( $min ) {
222
-				wp_style_add_data( $ltr['handle'], 'suffix', $min );
223
-			}
224
-		}
221
+if ( $min ) {
222
+wp_style_add_data( $ltr['handle'], 'suffix', $min );
223
+}
224
+}
225 225
 
226
-		// RTL.
227
-		if ( is_rtl() ) {
228
-			$rtl = $this->locate_asset_in_stack( "buddypress-rtl{$min}.css", 'css' );
226
+// RTL.
227
+if ( is_rtl() ) {
228
+$rtl = $this->locate_asset_in_stack( "buddypress-rtl{$min}.css", 'css' );
229 229
 
230
-			if ( isset( $rtl['location'], $rtl['handle'] ) ) {
231
-				$rtl['handle'] = str_replace( '-css', '-css-rtl', $rtl['handle'] );  // Backwards compatibility.
232
-				wp_enqueue_style( $rtl['handle'], $rtl['location'], array(), $this->version, 'screen' );
230
+if ( isset( $rtl['location'], $rtl['handle'] ) ) {
231
+$rtl['handle'] = str_replace( '-css', '-css-rtl', $rtl['handle'] );  // Backwards compatibility.
232
+wp_enqueue_style( $rtl['handle'], $rtl['location'], array(), $this->version, 'screen' );
233 233
 
234
-				if ( $min ) {
235
-					wp_style_add_data( $rtl['handle'], 'suffix', $min );
236
-				}
237
-			}
238
-		}
234
+if ( $min ) {
235
+wp_style_add_data( $rtl['handle'], 'suffix', $min );
236
+}
237
+}
238
+}
239 239
 
240
-		// Compatibility stylesheets for specific themes.
241
-		$theme = $this->locate_asset_in_stack( get_template() . "{$min}.css", 'css' );
242
-		if ( ! is_rtl() && isset( $theme['location'] ) ) {
243
-			// Use a unique handle.
244
-			$theme['handle'] = 'bp-' . get_template();
245
-			wp_enqueue_style( $theme['handle'], $theme['location'], array(), $this->version, 'screen' );
240
+// Compatibility stylesheets for specific themes.
241
+$theme = $this->locate_asset_in_stack( get_template() . "{$min}.css", 'css' );
242
+if ( ! is_rtl() && isset( $theme['location'] ) ) {
243
+// Use a unique handle.
244
+$theme['handle'] = 'bp-' . get_template();
245
+wp_enqueue_style( $theme['handle'], $theme['location'], array(), $this->version, 'screen' );
246 246
 
247
-			if ( $min ) {
248
-				wp_style_add_data( $theme['handle'], 'suffix', $min );
249
-			}
250
-		}
247
+if ( $min ) {
248
+wp_style_add_data( $theme['handle'], 'suffix', $min );
249
+}
250
+}
251 251
 
252
-		// Compatibility stylesheet for specific themes, RTL-version.
253
-		if ( is_rtl() ) {
254
-			$theme_rtl = $this->locate_asset_in_stack( get_template() . "-rtl{$min}.css", 'css' );
252
+// Compatibility stylesheet for specific themes, RTL-version.
253
+if ( is_rtl() ) {
254
+$theme_rtl = $this->locate_asset_in_stack( get_template() . "-rtl{$min}.css", 'css' );
255 255
 
256
-			if ( isset( $theme_rtl['location'] ) ) {
257
-				$theme_rtl['handle'] = $theme['handle'] . '-rtl';
258
-				wp_enqueue_style( $theme_rtl['handle'], $theme_rtl['location'], array(), $this->version, 'screen' );
256
+if ( isset( $theme_rtl['location'] ) ) {
257
+$theme_rtl['handle'] = $theme['handle'] . '-rtl';
258
+wp_enqueue_style( $theme_rtl['handle'], $theme_rtl['location'], array(), $this->version, 'screen' );
259 259
 
260
-				if ( $min ) {
261
-					wp_style_add_data( $theme_rtl['handle'], 'suffix', $min );
262
-				}
263
-			}
264
-		}
265
-	}
260
+if ( $min ) {
261
+wp_style_add_data( $theme_rtl['handle'], 'suffix', $min );
262
+}
263
+}
264
+}
265
+}
266 266
 
267
-	/**
267
+/**
268 268
 	 * Enqueue the required JavaScript files
269 269
 	 *
270 270
 	 * @since 1.7.0
271 271
 	 */
272
-	public function enqueue_scripts() {
273
-		$min = bp_core_get_minified_asset_suffix();
272
+public function enqueue_scripts() {
273
+$min = bp_core_get_minified_asset_suffix();
274 274
 
275
-		// Locate the BP JS file.
276
-		$asset = $this->locate_asset_in_stack( "buddypress{$min}.js", 'js' );
275
+// Locate the BP JS file.
276
+$asset = $this->locate_asset_in_stack( "buddypress{$min}.js", 'js' );
277 277
 
278
-		// Enqueue the global JS, if found - AJAX will not work
279
-		// without it.
280
-		if ( isset( $asset['location'], $asset['handle'] ) ) {
281
-			wp_enqueue_script( $asset['handle'], $asset['location'], bp_core_get_js_dependencies(), $this->version );
282
-		}
278
+// Enqueue the global JS, if found - AJAX will not work
279
+// without it.
280
+if ( isset( $asset['location'], $asset['handle'] ) ) {
281
+wp_enqueue_script( $asset['handle'], $asset['location'], bp_core_get_js_dependencies(), $this->version );
282
+}
283 283
 
284
-		/**
284
+/**
285 285
 		 * Filters core JavaScript strings for internationalization before AJAX usage.
286 286
 		 *
287 287
 		 * @since 2.0.0
288 288
 		 *
289 289
 		 * @param array $value Array of key/value pairs for AJAX usage.
290 290
 		 */
291
-		$params = apply_filters( 'bp_core_get_js_strings', array(
292
-			'accepted'            => __( 'Accepted', 'buddypress' ),
293
-			'close'               => __( 'Close', 'buddypress' ),
294
-			'comments'            => __( 'comments', 'buddypress' ),
295
-			'leave_group_confirm' => __( 'Are you sure you want to leave this group?', 'buddypress' ),
296
-			'mark_as_fav'	      => __( 'Favorite', 'buddypress' ),
297
-			'my_favs'             => __( 'My Favorites', 'buddypress' ),
298
-			'rejected'            => __( 'Rejected', 'buddypress' ),
299
-			'remove_fav'	      => __( 'Remove Favorite', 'buddypress' ),
300
-			'show_all'            => __( 'Show all', 'buddypress' ),
301
-			'show_all_comments'   => __( 'Show all comments for this thread', 'buddypress' ),
302
-			'show_x_comments'     => __( 'Show all comments (%d)', 'buddypress' ),
303
-			'unsaved_changes'     => __( 'Your profile has unsaved changes. If you leave the page, the changes will be lost.', 'buddypress' ),
304
-			'view'                => __( 'View', 'buddypress' ),
305
-		) );
306
-		wp_localize_script( $asset['handle'], 'BP_DTheme', $params );
307
-
308
-		// Maybe enqueue comment reply JS.
309
-		if ( is_singular() && bp_is_blog_page() && get_option( 'thread_comments' ) ) {
310
-			wp_enqueue_script( 'comment-reply' );
311
-		}
291
+$params = apply_filters( 'bp_core_get_js_strings', array(
292
+'accepted'            => __( 'Accepted', 'buddypress' ),
293
+'close'               => __( 'Close', 'buddypress' ),
294
+'comments'            => __( 'comments', 'buddypress' ),
295
+'leave_group_confirm' => __( 'Are you sure you want to leave this group?', 'buddypress' ),
296
+'mark_as_fav'	      => __( 'Favorite', 'buddypress' ),
297
+'my_favs'             => __( 'My Favorites', 'buddypress' ),
298
+'rejected'            => __( 'Rejected', 'buddypress' ),
299
+'remove_fav'	      => __( 'Remove Favorite', 'buddypress' ),
300
+'show_all'            => __( 'Show all', 'buddypress' ),
301
+'show_all_comments'   => __( 'Show all comments for this thread', 'buddypress' ),
302
+'show_x_comments'     => __( 'Show all comments (%d)', 'buddypress' ),
303
+'unsaved_changes'     => __( 'Your profile has unsaved changes. If you leave the page, the changes will be lost.', 'buddypress' ),
304
+'view'                => __( 'View', 'buddypress' ),
305
+) );
306
+wp_localize_script( $asset['handle'], 'BP_DTheme', $params );
307
+
308
+// Maybe enqueue comment reply JS.
309
+if ( is_singular() && bp_is_blog_page() && get_option( 'thread_comments' ) ) {
310
+wp_enqueue_script( 'comment-reply' );
311
+}
312