Completed
Push — master ( 980246...2fd399 )
by
unknown
09:03
created
src/bp-templates/bp-nouveau/includes/messages/functions.php 3 patches
Doc Comments   +1 added lines patch added patch discarded remove patch
@@ -331,6 +331,7 @@
 block discarded – undo
331 331
 
332 332
 /**
333 333
  * @since 1.0.0
334
+ * @param string $date
334 335
  */
335 336
 function bp_nouveau_get_message_date( $date ) {
336 337
 	$now  = bp_core_current_time( true, 'timestamp' );
Please login to merge, or discard this patch.
Switch Indentation   +230 added lines, -230 removed lines patch added patch discarded remove patch
@@ -18,17 +18,17 @@  discard block
 block discarded – undo
18 18
  * @return array The same array with the specific messages styles.
19 19
  */
20 20
 function bp_nouveau_messages_enqueue_styles( $styles = array() ) {
21
-	if ( ! bp_is_user_messages() ) {
22
-		return $styles;
23
-	}
21
+if ( ! bp_is_user_messages() ) {
22
+return $styles;
23
+}
24 24
 
25
-	return array_merge( $styles, array(
26
-		'bp-nouveau-messages-at' => array(
27
-			'file'         => buddypress()->plugin_url . 'bp-activity/css/mentions%1$s%2$s.css',
28
-			'dependencies' => array( 'bp-nouveau' ),
29
-			'version'      => bp_get_version(),
30
-		),
31
-	) );
25
+return array_merge( $styles, array(
26
+'bp-nouveau-messages-at' => array(
27
+'file'         => buddypress()->plugin_url . 'bp-activity/css/mentions%1$s%2$s.css',
28
+'dependencies' => array( 'bp-nouveau' ),
29
+'version'      => bp_get_version(),
30
+),
31
+) );
32 32
 }
33 33
 
34 34
 /**
@@ -41,23 +41,23 @@  discard block
 block discarded – undo
41 41
  * @return array The same array with the specific messages scripts.
42 42
  */
43 43
 function bp_nouveau_messages_register_scripts( $scripts = array() ) {
44
-	if ( ! isset( $scripts['bp-nouveau'] ) ) {
45
-		return $scripts;
46
-	}
47
-
48
-	return array_merge( $scripts, array(
49
-		'bp-nouveau-messages-at' => array(
50
-			'file'         => buddypress()->plugin_url . 'bp-activity/js/mentions%s.js',
51
-			'dependencies' => array( 'bp-nouveau', 'jquery', 'jquery-atwho' ),
52
-			'version'      => bp_get_version(),
53
-			'footer'       => true,
54
-		),
55
-		'bp-nouveau-messages' => array(
56
-			'file'         => 'js/buddypress-messages%s.js',
57
-			'dependencies' => array( 'bp-nouveau', 'json2', 'wp-backbone', 'bp-nouveau-messages-at' ),
58
-			'footer'       => true,
59
-		),
60
-	) );
44
+if ( ! isset( $scripts['bp-nouveau'] ) ) {
45
+return $scripts;
46
+}
47
+
48
+return array_merge( $scripts, array(
49
+'bp-nouveau-messages-at' => array(
50
+'file'         => buddypress()->plugin_url . 'bp-activity/js/mentions%s.js',
51
+'dependencies' => array( 'bp-nouveau', 'jquery', 'jquery-atwho' ),
52
+'version'      => bp_get_version(),
53
+'footer'       => true,
54
+),
55
+'bp-nouveau-messages' => array(
56
+'file'         => 'js/buddypress-messages%s.js',
57
+'dependencies' => array( 'bp-nouveau', 'json2', 'wp-backbone', 'bp-nouveau-messages-at' ),
58
+'footer'       => true,
59
+),
60
+) );
61 61
 }
62 62
 
63 63
 /**
@@ -66,14 +66,14 @@  discard block
 block discarded – undo
66 66
  * @since 1.0.0
67 67
  */
68 68
 function bp_nouveau_messages_enqueue_scripts() {
69
-	if ( ! bp_is_user_messages() ) {
70
-		return;
71
-	}
69
+if ( ! bp_is_user_messages() ) {
70
+return;
71
+}
72 72
 
73
-	wp_enqueue_script( 'bp-nouveau-messages' );
73
+wp_enqueue_script( 'bp-nouveau-messages' );
74 74
 
75
-	// Add The tiny MCE init specific function.
76
-	add_filter( 'tiny_mce_before_init', 'bp_nouveau_messages_at_on_tinymce_init', 10, 2 );
75
+// Add The tiny MCE init specific function.
76
+add_filter( 'tiny_mce_before_init', 'bp_nouveau_messages_at_on_tinymce_init', 10, 2 );
77 77
 }
78 78
 
79 79
 /**
@@ -85,63 +85,63 @@  discard block
 block discarded – undo
85 85
  * @return array         The same array with specific strings for the messages UI if needed.
86 86
  */
87 87
 function bp_nouveau_messages_localize_scripts( $params = array() ) {
88
-	if ( ! bp_is_user_messages() ) {
89
-		return $params;
90
-	}
91
-
92
-	$params['messages'] = array(
93
-		'errors' => array(
94
-			'send_to'         => __( 'Please add at least a user to send the message to, using their @username.', 'buddypress' ),
95
-			'subject'         => __( 'Please add a subject to your message.', 'buddypress' ),
96
-			'message_content' => __( 'Please add some content to your message.', 'buddypress' ),
97
-		),
98
-		'nonces' => array(
99
-			'send' => wp_create_nonce( 'messages_send_message' ),
100
-		),
101
-		'loading' => '<div class="bp-feedback info"><span class="bp-icon"></span><p>' . __( 'Loading messages, please wait.', 'buddypress' ) . '</p></div>',
102
-		'bulk_actions' => bp_nouveau_messages_get_bulk_actions(),
103
-	);
104
-
105
-	// Star private messages.
106
-	if ( bp_is_active( 'messages', 'star' ) ) {
107
-		$params['messages'] = array_merge( $params['messages'], array(
108
-			'strings' => array(
109
-				'text_unstar'  => __( 'Unstar', 'buddypress' ),
110
-				'text_star'    => __( 'Star', 'buddypress' ),
111
-				'title_unstar' => __( 'Starred', 'buddypress' ),
112
-				'title_star'   => __( 'Not starred', 'buddypress' ),
113
-				'title_unstar_thread' => __( 'Remove all starred messages in this thread', 'buddypress' ),
114
-				'title_star_thread'   => __( 'Star the first message in this thread', 'buddypress' ),
115
-			),
116
-			'is_single_thread' => (int) bp_is_messages_conversation(),
117
-			'star_counter'     => 0,
118
-			'unstar_counter'   => 0
119
-		) );
120
-	}
121
-
122
-	return $params;
88
+if ( ! bp_is_user_messages() ) {
89
+return $params;
90
+}
91
+
92
+$params['messages'] = array(
93
+'errors' => array(
94
+'send_to'         => __( 'Please add at least a user to send the message to, using their @username.', 'buddypress' ),
95
+'subject'         => __( 'Please add a subject to your message.', 'buddypress' ),
96
+'message_content' => __( 'Please add some content to your message.', 'buddypress' ),
97
+),
98
+'nonces' => array(
99
+'send' => wp_create_nonce( 'messages_send_message' ),
100
+),
101
+'loading' => '<div class="bp-feedback info"><span class="bp-icon"></span><p>' . __( 'Loading messages, please wait.', 'buddypress' ) . '</p></div>',
102
+'bulk_actions' => bp_nouveau_messages_get_bulk_actions(),
103
+);
104
+
105
+// Star private messages.
106
+if ( bp_is_active( 'messages', 'star' ) ) {
107
+$params['messages'] = array_merge( $params['messages'], array(
108
+'strings' => array(
109
+'text_unstar'  => __( 'Unstar', 'buddypress' ),
110
+'text_star'    => __( 'Star', 'buddypress' ),
111
+'title_unstar' => __( 'Starred', 'buddypress' ),
112
+'title_star'   => __( 'Not starred', 'buddypress' ),
113
+'title_unstar_thread' => __( 'Remove all starred messages in this thread', 'buddypress' ),
114
+'title_star_thread'   => __( 'Star the first message in this thread', 'buddypress' ),
115
+),
116
+'is_single_thread' => (int) bp_is_messages_conversation(),
117
+'star_counter'     => 0,
118
+'unstar_counter'   => 0
119
+) );
120
+}
121
+
122
+return $params;
123 123
 }
124 124
 
125 125
 /**
126 126
  * @since 1.0.0
127 127
  */
128 128
 function bp_nouveau_message_search_form() {
129
-	$query_arg   = bp_core_get_component_search_query_arg( 'messages' );
130
-	$placeholder = bp_get_search_default_text( 'messages' );
129
+$query_arg   = bp_core_get_component_search_query_arg( 'messages' );
130
+$placeholder = bp_get_search_default_text( 'messages' );
131 131
 
132
-	$search_form_html = '<form action="" method="get" id="search-messages-form">
132
+$search_form_html = '<form action="" method="get" id="search-messages-form">
133 133
 		<label for="messages_search"><input type="text" name="' . esc_attr( $query_arg ) . '" id="messages_search" placeholder="' . esc_attr( $placeholder ) . '" /></label>
134 134
 		<input type="submit" id="messages_search_submit" name="messages_search_submit" value="' . esc_attr_e( 'Search', 'buddypress' ) . '" />
135 135
 	</form>';
136 136
 
137
-	/**
137
+/**
138 138
 	 * Filters the private message component search form.
139 139
 	 *
140 140
 	 * @since 1.0.0
141 141
 	 *
142 142
 	 * @param string $search_form_html HTML markup for the message search form.
143 143
 	 */
144
-	echo apply_filters( 'bp_nouveau_message_search_form', $search_form_html );
144
+echo apply_filters( 'bp_nouveau_message_search_form', $search_form_html );
145 145
 }
146 146
 add_filter( 'bp_message_search_form', 'bp_nouveau_message_search_form', 10, 1 );
147 147
 
@@ -149,113 +149,113 @@  discard block
 block discarded – undo
149 149
  * @since 1.0.0
150 150
  */
151 151
 function bp_nouveau_messages_adjust_nav() {
152
-	$bp = buddypress();
152
+$bp = buddypress();
153 153
 
154
-	$secondary_nav_items = $bp->members->nav->get_secondary( array( 'parent_slug' => bp_get_messages_slug() ), false );
154
+$secondary_nav_items = $bp->members->nav->get_secondary( array( 'parent_slug' => bp_get_messages_slug() ), false );
155 155
 
156
-	if ( empty( $secondary_nav_items ) ) {
157
-		return;
158
-	}
156
+if ( empty( $secondary_nav_items ) ) {
157
+return;
158
+}
159 159
 
160
-	foreach ( $secondary_nav_items as $secondary_nav_item ) {
161
-		if ( empty( $secondary_nav_item->slug ) ) {
162
-			continue;
163
-		}
160
+foreach ( $secondary_nav_items as $secondary_nav_item ) {
161
+if ( empty( $secondary_nav_item->slug ) ) {
162
+continue;
163
+}
164 164
 
165
-		if ( 'notices' === $secondary_nav_item->slug ) {
166
-			bp_core_remove_subnav_item( bp_get_messages_slug(), $secondary_nav_item->slug, 'members' );
167
-		} else {
168
-			$params = array( 'link' => '#' . $secondary_nav_item->slug );
165
+if ( 'notices' === $secondary_nav_item->slug ) {
166
+bp_core_remove_subnav_item( bp_get_messages_slug(), $secondary_nav_item->slug, 'members' );
167
+} else {
168
+$params = array( 'link' => '#' . $secondary_nav_item->slug );
169 169
 
170
-			// Make sure Admins won't write a messages from the user's account.
171
-			if ( 'compose' === $secondary_nav_item->slug ) {
172
-				$params['user_has_access'] = bp_is_my_profile();
173
-			}
170
+// Make sure Admins won't write a messages from the user's account.
171
+if ( 'compose' === $secondary_nav_item->slug ) {
172
+$params['user_has_access'] = bp_is_my_profile();
173
+}
174 174
 
175
-			$bp->members->nav->edit_nav( $params, $secondary_nav_item->slug, bp_get_messages_slug() );
176
-		}
177
-	}
175
+$bp->members->nav->edit_nav( $params, $secondary_nav_item->slug, bp_get_messages_slug() );
176
+}
177
+}
178 178
 }
179 179
 
180 180
 /**
181 181
  * @since 1.0.0
182 182
  */
183 183
 function bp_nouveau_messages_adjust_admin_nav( $admin_nav ) {
184
-	if ( empty( $admin_nav ) ) {
185
-		return $admin_nav;
186
-	}
184
+if ( empty( $admin_nav ) ) {
185
+return $admin_nav;
186
+}
187 187
 
188
-	$user_messages_link = trailingslashit( bp_loggedin_user_domain() . bp_get_messages_slug() );
188
+$user_messages_link = trailingslashit( bp_loggedin_user_domain() . bp_get_messages_slug() );
189 189
 
190
-	foreach ( $admin_nav as $nav_iterator => $nav ) {
191
-		$nav_id = str_replace( 'my-account-messages-', '', $nav['id'] );
190
+foreach ( $admin_nav as $nav_iterator => $nav ) {
191
+$nav_id = str_replace( 'my-account-messages-', '', $nav['id'] );
192 192
 
193
-		if ( 'my-account-messages' !== $nav_id ) {
194
-			if ( 'notices' === $nav_id ) {
195
-				$admin_nav[ $nav_iterator ]['href'] = esc_url( add_query_arg( array( 'page' => 'bp-notices' ), bp_get_admin_url( 'users.php' ) ) );
196
-			} else {
197
-				$admin_nav[ $nav_iterator ]['href'] = $user_messages_link . '#' . trim( $nav_id );
198
-			}
199
-		}
200
-	}
193
+if ( 'my-account-messages' !== $nav_id ) {
194
+if ( 'notices' === $nav_id ) {
195
+$admin_nav[ $nav_iterator ]['href'] = esc_url( add_query_arg( array( 'page' => 'bp-notices' ), bp_get_admin_url( 'users.php' ) ) );
196
+} else {
197
+$admin_nav[ $nav_iterator ]['href'] = $user_messages_link . '#' . trim( $nav_id );
198
+}
199
+}
200
+}
201 201
 
202
-	return $admin_nav;
202
+return $admin_nav;
203 203
 }
204 204
 
205 205
 /**
206 206
  * @since 1.0.0
207 207
  */
208 208
 function bp_nouveau_add_notice_notification_for_user( $notifications, $user_id ) {
209
-	if ( ! bp_is_active( 'messages' ) || ! doing_action( 'admin_bar_menu' ) ) {
210
-		return $notifications;
211
-	}
212
-
213
-	$notice = BP_Messages_Notice::get_active();
214
-	if ( empty( $notice->id ) ) {
215
-		return $notifications;
216
-	}
209
+if ( ! bp_is_active( 'messages' ) || ! doing_action( 'admin_bar_menu' ) ) {
210
+return $notifications;
211
+}
217 212
 
218
-	$closed_notices = bp_get_user_meta( $user_id, 'closed_notices', true );
219
-	if ( empty( $closed_notices ) ) {
220
-		$closed_notices = array();
221
-	}
213
+$notice = BP_Messages_Notice::get_active();
214
+if ( empty( $notice->id ) ) {
215
+return $notifications;
216
+}
222 217
 
223
-	if ( in_array( $notice->id, $closed_notices, true ) ) {
224
-		return $notifications;
225
-	}
218
+$closed_notices = bp_get_user_meta( $user_id, 'closed_notices', true );
219
+if ( empty( $closed_notices ) ) {
220
+$closed_notices = array();
221
+}
226 222
 
227
-	$notice_notification                    = new stdClass;
228
-	$notice_notification->id                = 0;
229
-	$notice_notification->user_id           = $user_id;
230
-	$notice_notification->item_id           = $notice->id;
231
-	$notice_notification->secondary_item_id = '';
232
-	$notice_notification->component_name    = 'messages';
233
-	$notice_notification->component_action  = 'new_notice';
234
-	$notice_notification->date_notified     = $notice->date_sent;
235
-	$notice_notification->is_new            = '1';
223
+if ( in_array( $notice->id, $closed_notices, true ) ) {
224
+return $notifications;
225
+}
236 226
 
237
-	return array_merge( $notifications, array( $notice_notification ) );
227
+$notice_notification                    = new stdClass;
228
+$notice_notification->id                = 0;
229
+$notice_notification->user_id           = $user_id;
230
+$notice_notification->item_id           = $notice->id;
231
+$notice_notification->secondary_item_id = '';
232
+$notice_notification->component_name    = 'messages';
233
+$notice_notification->component_action  = 'new_notice';
234
+$notice_notification->date_notified     = $notice->date_sent;
235
+$notice_notification->is_new            = '1';
236
+
237
+return array_merge( $notifications, array( $notice_notification ) );
238 238
 }
239 239
 
240 240
 /**
241 241
  * @since 1.0.0
242 242
  */
243 243
 function bp_nouveau_format_notice_notification_for_user( $array ) {
244
-	if ( ! empty( $array['text'] ) || ! doing_action( 'admin_bar_menu' ) ) {
245
-		return $array;
246
-	}
244
+if ( ! empty( $array['text'] ) || ! doing_action( 'admin_bar_menu' ) ) {
245
+return $array;
246
+}
247 247
 
248
-	return array(
249
-		'text' => esc_html__( 'New site wide notice', 'buddypress' ),
250
-		'link' => bp_loggedin_user_domain(),
251
-	);
248
+return array(
249
+'text' => esc_html__( 'New site wide notice', 'buddypress' ),
250
+'link' => bp_loggedin_user_domain(),
251
+);
252 252
 }
253 253
 
254 254
 /**
255 255
  * @since 1.0.0
256 256
  */
257 257
 function bp_nouveau_unregister_notices_widget() {
258
-	unregister_widget( 'BP_Messages_Sitewide_Notices_Widget' );
258
+unregister_widget( 'BP_Messages_Sitewide_Notices_Widget' );
259 259
 }
260 260
 
261 261
 /**
@@ -264,133 +264,133 @@  discard block
 block discarded – undo
264 264
  * @since 1.0.0
265 265
  */
266 266
 function bp_nouveau_push_sitewide_notices() {
267
-	// Do not show notices if user is not logged in.
268
-	if ( ! is_user_logged_in() || ! bp_is_my_profile() ) {
269
-		return;
270
-	}
267
+// Do not show notices if user is not logged in.
268
+if ( ! is_user_logged_in() || ! bp_is_my_profile() ) {
269
+return;
270
+}
271 271
 
272
-	$notice = BP_Messages_Notice::get_active();
273
-	if ( empty( $notice ) ) {
274
-		return;
275
-	}
272
+$notice = BP_Messages_Notice::get_active();
273
+if ( empty( $notice ) ) {
274
+return;
275
+}
276 276
 
277
-	$user_id = bp_loggedin_user_id();
277
+$user_id = bp_loggedin_user_id();
278 278
 
279
-	$closed_notices = bp_get_user_meta( $user_id, 'closed_notices', true );
280
-	if ( empty( $closed_notices ) ) {
281
-		$closed_notices = array();
282
-	}
279
+$closed_notices = bp_get_user_meta( $user_id, 'closed_notices', true );
280
+if ( empty( $closed_notices ) ) {
281
+$closed_notices = array();
282
+}
283 283
 
284
-	if ( $notice->id && is_array( $closed_notices ) && ! in_array( $notice->id, $closed_notices ) ) {
285
-		// Inject the notice into the template_message if no other message has priority.
286
-		$bp = buddypress();
284
+if ( $notice->id && is_array( $closed_notices ) && ! in_array( $notice->id, $closed_notices ) ) {
285
+// Inject the notice into the template_message if no other message has priority.
286
+$bp = buddypress();
287 287
 
288
-		if ( empty( $bp->template_message ) ) {
289
-			$message = sprintf( '<strong class="subject">%s</strong>
288
+if ( empty( $bp->template_message ) ) {
289
+$message = sprintf( '<strong class="subject">%s</strong>
290 290
 				%s',
291
-				stripslashes( $notice->subject ),
292
-				stripslashes( $notice->message )
293
-			);
294
-			$bp->template_message      = $message;
295
-			$bp->template_message_type = 'bp-sitewide-notice';
296
-		}
297
-	}
291
+stripslashes( $notice->subject ),
292
+stripslashes( $notice->message )
293
+);
294
+$bp->template_message      = $message;
295
+$bp->template_message_type = 'bp-sitewide-notice';
296
+}
297
+}
298 298
 }
299 299
 
300 300
 /**
301 301
  * @since 1.0.0
302 302
  */
303 303
 function bp_nouveau_mce_buttons( $buttons = array() ) {
304
-	$remove_buttons = array(
305
-		'wp_more',
306
-		'spellchecker',
307
-		'wp_adv',
308
-		'fullscreen',
309
-	);
304
+$remove_buttons = array(
305
+'wp_more',
306
+'spellchecker',
307
+'wp_adv',
308
+'fullscreen',
309
+);
310 310
 
311
-	// Remove unused buttons
312
-	$buttons = array_diff( $buttons, $remove_buttons );
311
+// Remove unused buttons
312
+$buttons = array_diff( $buttons, $remove_buttons );
313 313
 
314
-	// Add the image button
315
-	array_push( $buttons, 'image' );
314
+// Add the image button
315
+array_push( $buttons, 'image' );
316 316
 
317
-	return $buttons;
317
+return $buttons;
318 318
 }
319 319
 
320 320
 /**
321 321
  * @since 1.0.0
322 322
  */
323 323
 function bp_nouveau_messages_at_on_tinymce_init( $settings, $editor_id ) {
324
-	// We only apply the mentions init to the visual post editor in the WP dashboard.
325
-	if ( 'message_content' === $editor_id ) {
326
-		$settings['init_instance_callback'] = 'window.bp.Nouveau.Messages.tinyMCEinit';
327
-	}
324
+// We only apply the mentions init to the visual post editor in the WP dashboard.
325
+if ( 'message_content' === $editor_id ) {
326
+$settings['init_instance_callback'] = 'window.bp.Nouveau.Messages.tinyMCEinit';
327
+}
328 328
 
329
-	return $settings;
329
+return $settings;
330 330
 }
331 331
 
332 332
 /**
333 333
  * @since 1.0.0
334 334
  */
335 335
 function bp_nouveau_get_message_date( $date ) {
336
-	$now  = bp_core_current_time( true, 'timestamp' );
337
-	$date = strtotime( $date );
338
-
339
-	$now_date    = getdate( $now );
340
-	$date_date   = getdate( $date );
341
-	$compare     = array_diff( $date_date, $now_date );
342
-	$date_format = 'Y/m/d';
343
-
344
-	// Use Timezone string if set.
345
-	$timezone_string = bp_get_option( 'timezone_string' );
346
-	if ( ! empty( $timezone_string ) ) {
347
-		$timezone_object = timezone_open( $timezone_string );
348
-		$datetime_object = date_create( "@{$date}" );
349
-		$timezone_offset = timezone_offset_get( $timezone_object, $datetime_object ) / HOUR_IN_SECONDS;
350
-
351
-	// Fall back on less reliable gmt_offset
352
-	} else {
353
-		$timezone_offset = bp_get_option( 'gmt_offset' );
354
-	}
336
+$now  = bp_core_current_time( true, 'timestamp' );
337
+$date = strtotime( $date );
338
+
339
+$now_date    = getdate( $now );
340
+$date_date   = getdate( $date );
341
+$compare     = array_diff( $date_date, $now_date );
342
+$date_format = 'Y/m/d';
343
+
344
+// Use Timezone string if set.
345
+$timezone_string = bp_get_option( 'timezone_string' );
346
+if ( ! empty( $timezone_string ) ) {
347
+$timezone_object = timezone_open( $timezone_string );
348
+$datetime_object = date_create( "@{$date}" );
349
+$timezone_offset = timezone_offset_get( $timezone_object, $datetime_object ) / HOUR_IN_SECONDS;
350
+
351
+// Fall back on less reliable gmt_offset
352
+} else {
353
+$timezone_offset = bp_get_option( 'gmt_offset' );
354
+}
355 355
 
356
-	// Calculate time based on the offset
357
-	$calculated_time = $date + ( $timezone_offset * HOUR_IN_SECONDS );
356
+// Calculate time based on the offset
357
+$calculated_time = $date + ( $timezone_offset * HOUR_IN_SECONDS );
358 358
 
359
-	if ( empty( $compare['mday'] ) && empty( $compare['mon'] ) && empty( $compare['year'] ) ) {
360
-		$date_format = 'H:i';
359
+if ( empty( $compare['mday'] ) && empty( $compare['mon'] ) && empty( $compare['year'] ) ) {
360
+$date_format = 'H:i';
361 361
 
362
-	} elseif ( empty( $compare['mon'] ) || empty( $compare['year'] ) ) {
363
-		$date_format = 'M j';
364
-	}
362
+} elseif ( empty( $compare['mon'] ) || empty( $compare['year'] ) ) {
363
+$date_format = 'M j';
364
+}
365 365
 
366
-	return apply_filters( 'bp_nouveau_get_message_date', date_i18n( $date_format, $calculated_time, true ), $calculated_time, $date, $date_format );
366
+return apply_filters( 'bp_nouveau_get_message_date', date_i18n( $date_format, $calculated_time, true ), $calculated_time, $date, $date_format );
367 367
 }
368 368
 
369 369
 /**
370 370
  * @since 1.0.0
371 371
  */
372 372
 function bp_nouveau_messages_get_bulk_actions() {
373
-	ob_start();
374
-	bp_messages_bulk_management_dropdown();
373
+ob_start();
374
+bp_messages_bulk_management_dropdown();
375 375
 
376
-	$bulk_actions = array();
377
-	$bulk_options = ob_get_clean();
376
+$bulk_actions = array();
377
+$bulk_options = ob_get_clean();
378 378
 
379
-	$matched = preg_match_all( '/<option value="(.*?)"\s*>(.*?)<\/option>/', $bulk_options, $matches, PREG_SET_ORDER );
379
+$matched = preg_match_all( '/<option value="(.*?)"\s*>(.*?)<\/option>/', $bulk_options, $matches, PREG_SET_ORDER );
380 380
 
381
-	if ( $matched && is_array( $matches ) ) {
382
-		foreach ( $matches as $i => $match ) {
383
-			if ( 0 === $i ) {
384
-				continue;
385
-			}
381
+if ( $matched && is_array( $matches ) ) {
382
+foreach ( $matches as $i => $match ) {
383
+if ( 0 === $i ) {
384
+continue;
385
+}
386 386
 
387
-			if ( isset( $match[1] ) && isset( $match[2] ) ) {
388
-				$bulk_actions[] = array( 'value' => trim( $match[1] ), 'label' => trim( $match[2] ) );
389
-			}
390
-		}
391
-	}
387
+if ( isset( $match[1] ) && isset( $match[2] ) ) {
388
+$bulk_actions[] = array( 'value' => trim( $match[1] ), 'label' => trim( $match[2] ) );
389
+}
390
+}
391
+}
392 392
 
393
-	return $bulk_actions;
393
+return $bulk_actions;
394 394
 }
395 395
 
396 396
 /**
@@ -399,9 +399,9 @@  discard block
 block discarded – undo
399 399
  * @since 1.0.0
400 400
  */
401 401
 function bp_nouveau_messages_notification_filters() {
402
-	bp_nouveau_notifications_register_filter( array(
403
-		'id'       => 'new_message',
404
-		'label'    => __( 'New private messages', 'buddypress' ),
405
-		'position' => 115,
406
-	) );
402
+bp_nouveau_notifications_register_filter( array(
403
+'id'       => 'new_message',
404
+'label'    => __( 'New private messages', 'buddypress' ),
405
+'position' => 115,
406
+) );
407 407
 }
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -192,9 +192,9 @@
 block discarded – undo
192 192
 
193 193
 		if ( 'my-account-messages' !== $nav_id ) {
194 194
 			if ( 'notices' === $nav_id ) {
195
-				$admin_nav[ $nav_iterator ]['href'] = esc_url( add_query_arg( array( 'page' => 'bp-notices' ), bp_get_admin_url( 'users.php' ) ) );
195
+				$admin_nav[$nav_iterator]['href'] = esc_url( add_query_arg( array( 'page' => 'bp-notices' ), bp_get_admin_url( 'users.php' ) ) );
196 196
 			} else {
197
-				$admin_nav[ $nav_iterator ]['href'] = $user_messages_link . '#' . trim( $nav_id );
197
+				$admin_nav[$nav_iterator]['href'] = $user_messages_link . '#' . trim( $nav_id );
198 198
 			}
199 199
 		}
200 200
 	}
Please login to merge, or discard this patch.
src/bp-templates/bp-nouveau/buddypress/activity/widget.php 1 patch
Braces   +10 added lines, -4 removed lines patch added patch discarded remove patch
@@ -36,9 +36,12 @@  discard block
 block discarded – undo
36 36
 
37 37
 					</blockquote>
38 38
 
39
-				<?php else : ?>
39
+				<?php else {
40
+	: ?>
40 41
 
41
-					<p><?php bp_activity_action(); ?></p>
42
+					<p><?php bp_activity_action();
43
+}
44
+?></p>
42 45
 
43 46
 				<?php endif; ?>
44 47
 
@@ -46,10 +49,13 @@  discard block
 block discarded – undo
46 49
 
47 50
 		</div>
48 51
 
49
-<?php else : ?>
52
+<?php else {
53
+	: ?>
50 54
 
51 55
 	<div class="widget-error">
52
-		<?php bp_nouveau_user_feedback( 'activity-loop-none' ); ?>
56
+		<?php bp_nouveau_user_feedback( 'activity-loop-none' );
57
+}
58
+?>
53 59
 	</div>
54 60
 
55 61
 <?php endif; ?>
Please login to merge, or discard this patch.
src/bp-templates/bp-nouveau/buddypress/blogs/blogs-loop.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -60,9 +60,11 @@
 block discarded – undo
60 60
 	<?php bp_nouveau_pagination( 'bottom' ); ?>
61 61
 
62 62
 <?php
63
-else :
63
+else {
64
+	:
64 65
 
65 66
 	bp_nouveau_user_feedback( 'blogs-loop-none' );
67
+}
66 68
 
67 69
 endif;
68 70
 ?>
Please login to merge, or discard this patch.
src/bp-templates/bp-nouveau/buddypress/blogs/create.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -16,9 +16,11 @@
 block discarded – undo
16 16
 	<?php bp_show_blog_signup_form(); ?>
17 17
 
18 18
 <?php
19
-else :
19
+else {
20
+	:
20 21
 
21 22
 	bp_nouveau_user_feedback( 'blogs-no-signup' );
23
+}
22 24
 
23 25
 endif;
24 26
 ?>
Please login to merge, or discard this patch.
src/bp-templates/bp-nouveau/buddypress/groups/groups-loop.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -65,9 +65,11 @@
 block discarded – undo
65 65
 	<?php bp_nouveau_pagination( 'bottom' ); ?>
66 66
 
67 67
 <?php
68
-else :
68
+else {
69
+	:
69 70
 
70 71
 	bp_nouveau_user_feedback( 'groups-loop-none' );
72
+}
71 73
 
72 74
 endif;
73 75
 ?>
Please login to merge, or discard this patch.
src/bp-templates/bp-nouveau/buddypress/groups/single/requests-loop.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -28,8 +28,10 @@
 block discarded – undo
28 28
 
29 29
 	<?php bp_nouveau_pagination( 'bottom' ); ?>
30 30
 
31
-	<?php else:
31
+	<?php else {
32
+	:
32 33
 
33 34
 		bp_nouveau_user_feedback( 'group-requests-none' );
35
+}
34 36
 
35 37
 	endif; ?>
Please login to merge, or discard this patch.
bp-templates/bp-nouveau/buddypress/groups/single/admin/manage-members.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
 
83 83
 			<?php if ( bp_group_member_needs_pagination() ) : ?>
84 84
 
85
-				<?php bp_nouveau_pagination( 'top' ) ; ?>
85
+				<?php bp_nouveau_pagination( 'top' ); ?>
86 86
 
87 87
 			<?php endif; ?>
88 88
 
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
 							<span class="banned warn"><?php if ( bp_get_group_member_is_banned() ) _e( '(banned)', 'buddypress' ); ?></span>
98 98
 						</p>
99 99
 
100
-						<?php bp_nouveau_groups_manage_members_buttons( array( 'container' => 'div', 'container_classes' => array( 'members-manage-buttons', 'text-links-list' ), 'parent_element' => '  ' ) ) ; ?>
100
+						<?php bp_nouveau_groups_manage_members_buttons( array( 'container' => 'div', 'container_classes' => array( 'members-manage-buttons', 'text-links-list' ), 'parent_element' => '  ' ) ); ?>
101 101
 
102 102
 					</li>
103 103
 
Please login to merge, or discard this patch.
src/bp-templates/bp-nouveau/buddypress/groups/single/admin/group-avatar.php 1 patch
Braces   +9 added lines, -3 removed lines patch added patch discarded remove patch
@@ -12,8 +12,11 @@  discard block
 block discarded – undo
12 12
 <?php if ( ! bp_is_group_create() ) : ?>
13 13
 	<?php if ( ! bp_get_group_has_avatar() ) : ?>
14 14
 		<p class="bp-help-text"><?php _e( 'Add an image to use as a profile photo for this group. The image will be shown on the main group page, and in search results.', 'buddypress' ); ?></p>
15
-	<?php else : ?>
16
-		<p class="bp-help-text"><?php _e( 'Edit or update your avatar image for this group.', 'buddypress' ); ?></p>
15
+	<?php else {
16
+	: ?>
17
+		<p class="bp-help-text"><?php _e( 'Edit or update your avatar image for this group.', 'buddypress' );
18
+}
19
+?></p>
17 20
 	<?php endif; ?>
18 21
 <?php endif; ?>
19 22
 
@@ -60,7 +63,10 @@  discard block
 block discarded – undo
60 63
 	 */
61 64
 	bp_avatar_get_templates(); ?>
62 65
 
63
-	<?php if ( ! bp_is_group_create() ) wp_nonce_field( 'bp_avatar_upload' ); ?>
66
+	<?php if ( ! bp_is_group_create() ) {
67
+	wp_nonce_field( 'bp_avatar_upload' );
68
+}
69
+?>
64 70
 
65 71
 <?php endif;
66 72
 
Please login to merge, or discard this patch.
bp-nouveau/buddypress/groups/single/admin/group-cover-image.php 1 patch
Braces   +5 added lines, -2 removed lines patch added patch discarded remove patch
@@ -14,9 +14,12 @@
 block discarded – undo
14 14
 
15 15
 	<div id="header-cover-image"></div>
16 16
 
17
-<?php else : ?>
17
+<?php else {
18
+	: ?>
18 19
 
19
-	<h2 class="bp-screen-title"><?php _e( 'Change Cover Image', 'buddypress' ); ?></h2>
20
+	<h2 class="bp-screen-title"><?php _e( 'Change Cover Image', 'buddypress' );
21
+}
22
+?></h2>
20 23
 
21 24
 <?php endif; ?>
22 25
 
Please login to merge, or discard this patch.