Completed
Branch BUG-9623-config-log (1352ef)
by
unknown
225:37 queued 211:25
created
public/template_tags.php 2 patches
Doc Comments   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
  * can_use_espresso_conditionals
148 148
  * tests whether the Espresso Conditional tags like is_espresso_event_single() can be called
149 149
  *
150
- * @param $conditional_tag
150
+ * @param string $conditional_tag
151 151
  * @return bool
152 152
  */
153 153
 function can_use_espresso_conditionals( $conditional_tag ) {
@@ -877,7 +877,7 @@  discard block
 block discarded – undo
877 877
 	/**
878 878
 	 * espresso_event_venues
879 879
 	 *
880
-	 * @return array  all venues related to an event
880
+	 * @return EE_Venue[]  all venues related to an event
881 881
 	 */
882 882
 	function espresso_event_venues() {
883 883
 		EE_Registry::instance()->load_helper( 'Venue_View' );
@@ -912,7 +912,7 @@  discard block
 block discarded – undo
912 912
 	 *
913 913
 	 * @param int     $VNU_ID optional, the venue id to check.
914 914
 	 *
915
-	 * @return bool | null
915
+	 * @return null|boolean | null
916 916
 	 */
917 917
 	function espresso_is_venue_private( $VNU_ID = 0 ) {
918 918
 		EE_Registry::instance()->load_helper( 'Venue_View' );
@@ -927,7 +927,7 @@  discard block
 block discarded – undo
927 927
 	 * returns true or false if a venue is password protected or not
928 928
 	 *
929 929
 	 * @param int     $VNU_ID optional, the venue id to check.
930
-	 * @return string
930
+	 * @return boolean
931 931
 	 */
932 932
 	function espresso_venue_is_password_protected( $VNU_ID = 0 ) {
933 933
 		EE_Registry::instance()->load_helper( 'Venue_View' );
Please login to merge, or discard this patch.
Spacing   +311 added lines, -311 removed lines patch added patch discarded remove patch
@@ -27,14 +27,14 @@  discard block
 block discarded – undo
27 27
  * @param int | \EE_Event $event
28 28
  * @return bool
29 29
  */
30
-function is_espresso_event( $event = NULL ) {
31
-	if ( can_use_espresso_conditionals( __FUNCTION__ )) {
30
+function is_espresso_event($event = NULL) {
31
+	if (can_use_espresso_conditionals(__FUNCTION__)) {
32 32
 		// load event view helper
33
-		EE_Registry::instance()->load_helper( 'Event_View' );
33
+		EE_Registry::instance()->load_helper('Event_View');
34 34
 		// extract EE_Event object from passed param regardless of what it is (within reason of course)
35
-		$event = EEH_Event_View::get_event( $event );
35
+		$event = EEH_Event_View::get_event($event);
36 36
 		// do we have a valid event ?
37
-		return $event instanceof EE_Event  ? TRUE : FALSE;
37
+		return $event instanceof EE_Event ? TRUE : FALSE;
38 38
 	}
39 39
 	return FALSE;
40 40
 }
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
  * @return bool
47 47
  */
48 48
 function is_espresso_event_single() {
49
-	if ( can_use_espresso_conditionals( __FUNCTION__ )) {
49
+	if (can_use_espresso_conditionals(__FUNCTION__)) {
50 50
 		global $wp_query;
51 51
 		// return conditionals set by CPTs
52 52
 		return $wp_query instanceof WP_Query ? $wp_query->is_espresso_event_single : FALSE;
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
  * @return bool
62 62
  */
63 63
 function is_espresso_event_archive() {
64
-	if ( can_use_espresso_conditionals( __FUNCTION__ )) {
64
+	if (can_use_espresso_conditionals(__FUNCTION__)) {
65 65
 		global $wp_query;
66 66
 		return $wp_query instanceof WP_Query ? $wp_query->is_espresso_event_archive : FALSE;
67 67
 	}
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
  * @return bool
76 76
  */
77 77
 function is_espresso_event_taxonomy() {
78
-	if ( can_use_espresso_conditionals( __FUNCTION__ )) {
78
+	if (can_use_espresso_conditionals(__FUNCTION__)) {
79 79
 		global $wp_query;
80 80
 		return $wp_query instanceof WP_Query ? $wp_query->is_espresso_event_taxonomy : FALSE;
81 81
 	}
@@ -89,12 +89,12 @@  discard block
 block discarded – undo
89 89
  * @param int | \EE_Venue $venue
90 90
  * @return bool
91 91
  */
92
-function is_espresso_venue( $venue = NULL ) {
93
-	if ( can_use_espresso_conditionals( __FUNCTION__ )) {
92
+function is_espresso_venue($venue = NULL) {
93
+	if (can_use_espresso_conditionals(__FUNCTION__)) {
94 94
 		// load event view helper
95
-		EE_Registry::instance()->load_helper( 'Venue_View' );
95
+		EE_Registry::instance()->load_helper('Venue_View');
96 96
 		// extract EE_Venue object from passed param regardless of what it is (within reason of course)
97
-		$venue = EEH_Venue_View::get_venue( $venue, FALSE );
97
+		$venue = EEH_Venue_View::get_venue($venue, FALSE);
98 98
 		// do we have a valid event ?
99 99
 		return $venue instanceof EE_Venue ? TRUE : FALSE;
100 100
 	}
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
  * @return bool
109 109
  */
110 110
 function is_espresso_venue_single() {
111
-	if ( can_use_espresso_conditionals( __FUNCTION__ )) {
111
+	if (can_use_espresso_conditionals(__FUNCTION__)) {
112 112
 		global $wp_query;
113 113
 		return $wp_query instanceof WP_Query ? $wp_query->is_espresso_venue_single : FALSE;
114 114
 	}
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
  * @return bool
123 123
  */
124 124
 function is_espresso_venue_archive() {
125
-	if ( can_use_espresso_conditionals( __FUNCTION__ )) {
125
+	if (can_use_espresso_conditionals(__FUNCTION__)) {
126 126
 		global $wp_query;
127 127
 		return $wp_query instanceof WP_Query ? $wp_query->is_espresso_venue_archive : FALSE;
128 128
 	}
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
  * @return bool
137 137
  */
138 138
 function is_espresso_venue_taxonomy() {
139
-	if ( can_use_espresso_conditionals( __FUNCTION__ )) {
139
+	if (can_use_espresso_conditionals(__FUNCTION__)) {
140 140
 		global $wp_query;
141 141
 		return $wp_query instanceof WP_Query ? $wp_query->is_espresso_venue_taxonomy : FALSE;
142 142
 	}
@@ -150,12 +150,12 @@  discard block
 block discarded – undo
150 150
  * @param $conditional_tag
151 151
  * @return bool
152 152
  */
153
-function can_use_espresso_conditionals( $conditional_tag ) {
154
-	if ( ! did_action( 'AHEE__EE_System__initialize' )) {
153
+function can_use_espresso_conditionals($conditional_tag) {
154
+	if ( ! did_action('AHEE__EE_System__initialize')) {
155 155
 		EE_Error::doing_it_wrong(
156 156
 			__FUNCTION__,
157 157
 			sprintf(
158
-				__( 'The "%s" conditional tag can not be used until after the "init" hook has run, but works best when used within a theme\'s template files.','event_espresso'),
158
+				__('The "%s" conditional tag can not be used until after the "init" hook has run, but works best when used within a theme\'s template files.', 'event_espresso'),
159 159
 				$conditional_tag
160 160
 			),
161 161
 			'4.4.0'
@@ -170,13 +170,13 @@  discard block
 block discarded – undo
170 170
 
171 171
 /*************************** Event Queries ***************************/
172 172
 
173
-if ( ! function_exists( 'espresso_get_events' )) {
173
+if ( ! function_exists('espresso_get_events')) {
174 174
 	/**
175 175
 	 * 	espresso_get_events
176 176
 	 * @param array $params
177 177
 	 * @return array
178 178
 	 */
179
-	function espresso_get_events( $params = array() ) {
179
+	function espresso_get_events($params = array()) {
180 180
 		//set default params
181 181
 		$default_espresso_events_params = array(
182 182
 			'limit' => 10,
@@ -187,18 +187,18 @@  discard block
 block discarded – undo
187 187
 			'sort' => 'ASC'
188 188
 		);
189 189
 		// allow the defaults to be filtered
190
-		$default_espresso_events_params = apply_filters( 'espresso_get_events__default_espresso_events_params', $default_espresso_events_params );
190
+		$default_espresso_events_params = apply_filters('espresso_get_events__default_espresso_events_params', $default_espresso_events_params);
191 191
 		// grab params and merge with defaults, then extract
192
-		$params = array_merge( $default_espresso_events_params, $params );
192
+		$params = array_merge($default_espresso_events_params, $params);
193 193
 		// run the query
194
-		$events_query = new EE_Event_List_Query( $params );
194
+		$events_query = new EE_Event_List_Query($params);
195 195
 		// assign results to a variable so we can return it
196 196
 		$events = $events_query->have_posts() ? $events_query->posts : array();
197 197
 		// but first reset the query and postdata
198 198
 		wp_reset_query();
199 199
 		wp_reset_postdata();
200 200
 		EED_Events_Archive::remove_all_events_archive_filters();
201
-		unset( $events_query );
201
+		unset($events_query);
202 202
 		return $events;
203 203
 	}
204 204
 }
@@ -212,32 +212,32 @@  discard block
 block discarded – undo
212 212
  * espresso_load_ticket_selector
213 213
  */
214 214
 function espresso_load_ticket_selector() {
215
-	EE_Registry::instance()->load_file( EE_MODULES . 'ticket_selector', 'EED_Ticket_Selector', 'module' );
215
+	EE_Registry::instance()->load_file(EE_MODULES.'ticket_selector', 'EED_Ticket_Selector', 'module');
216 216
 }
217 217
 
218
-if ( ! function_exists( 'espresso_ticket_selector' )) {
218
+if ( ! function_exists('espresso_ticket_selector')) {
219 219
 	/**
220 220
 	 * espresso_ticket_selector
221 221
 	 * @param null $event
222 222
 	 */
223
-	function espresso_ticket_selector( $event = NULL ) {
224
-		if (  ! apply_filters( 'FHEE_disable_espresso_ticket_selector', FALSE ) ) {
223
+	function espresso_ticket_selector($event = NULL) {
224
+		if ( ! apply_filters('FHEE_disable_espresso_ticket_selector', FALSE)) {
225 225
 			espresso_load_ticket_selector();
226
-			echo EED_Ticket_Selector::display_ticket_selector( $event );
226
+			echo EED_Ticket_Selector::display_ticket_selector($event);
227 227
 		}
228 228
 	}
229 229
 }
230 230
 
231 231
 
232
-	if ( ! function_exists( 'espresso_view_details_btn' )) {
232
+	if ( ! function_exists('espresso_view_details_btn')) {
233 233
 	/**
234 234
 	 * espresso_view_details_btn
235 235
 	 * @param null $event
236 236
 	 */
237
-	function espresso_view_details_btn( $event = NULL ) {
238
-		if (  ! apply_filters( 'FHEE_disable_espresso_view_details_btn', FALSE ) ) {
237
+	function espresso_view_details_btn($event = NULL) {
238
+		if ( ! apply_filters('FHEE_disable_espresso_view_details_btn', FALSE)) {
239 239
 			espresso_load_ticket_selector();
240
-			echo EED_Ticket_Selector::display_ticket_selector( $event, TRUE );
240
+			echo EED_Ticket_Selector::display_ticket_selector($event, TRUE);
241 241
 		}
242 242
 	}
243 243
 }
@@ -247,7 +247,7 @@  discard block
 block discarded – undo
247 247
 
248 248
 /*************************** EEH_Event_View ***************************/
249 249
 
250
-if ( ! function_exists( 'espresso_load_event_list_assets' )) {
250
+if ( ! function_exists('espresso_load_event_list_assets')) {
251 251
 	/**
252 252
 	 * espresso_load_event_list_assets
253 253
 	 * ensures that event list styles and scripts are loaded
@@ -256,13 +256,13 @@  discard block
 block discarded – undo
256 256
 	 */
257 257
 	function espresso_load_event_list_assets() {
258 258
 		$event_list = EED_Events_Archive::instance();
259
-		add_action( 'AHEE__EE_System__initialize_last', array( $event_list, 'load_event_list_assets' ), 10 );
260
-		add_filter( 'FHEE_enable_default_espresso_css', '__return_true' );
259
+		add_action('AHEE__EE_System__initialize_last', array($event_list, 'load_event_list_assets'), 10);
260
+		add_filter('FHEE_enable_default_espresso_css', '__return_true');
261 261
 	}
262 262
 }
263 263
 
264 264
 
265
-if ( ! function_exists( 'espresso_event_reg_button' )) {
265
+if ( ! function_exists('espresso_event_reg_button')) {
266 266
 	/**
267 267
 	 * espresso_event_reg_button
268 268
 	 * returns the "Register Now" button if event is active,
@@ -274,10 +274,10 @@  discard block
 block discarded – undo
274 274
 	 * @param bool $EVT_ID
275 275
 	 * @return string
276 276
 	 */
277
-	function espresso_event_reg_button( $btn_text_if_active = NULL, $btn_text_if_inactive = FALSE, $EVT_ID = FALSE ) {
278
-		EE_Registry::instance()->load_helper( 'Event_View' );
279
-		$event_status = EEH_Event_View::event_active_status( $EVT_ID );
280
-		switch ( $event_status ) {
277
+	function espresso_event_reg_button($btn_text_if_active = NULL, $btn_text_if_inactive = FALSE, $EVT_ID = FALSE) {
278
+		EE_Registry::instance()->load_helper('Event_View');
279
+		$event_status = EEH_Event_View::event_active_status($EVT_ID);
280
+		switch ($event_status) {
281 281
 			case EE_Datetime::sold_out :
282 282
 				$btn_text = __('Sold Out', 'event_espresso');
283 283
 				$class = 'ee-pink';
@@ -293,10 +293,10 @@  discard block
 block discarded – undo
293 293
 			case EE_Datetime::upcoming :
294 294
 			case EE_Datetime::active :
295 295
 			default :
296
-				$btn_text =! empty( $btn_text_if_active ) ? $btn_text_if_active : __( 'Register Now', 'event_espresso' );
296
+				$btn_text = ! empty($btn_text_if_active) ? $btn_text_if_active : __('Register Now', 'event_espresso');
297 297
 				$class = 'ee-green';
298 298
 		}
299
-		if ( $event_status < 1 && ! empty( $btn_text_if_inactive )) {
299
+		if ($event_status < 1 && ! empty($btn_text_if_inactive)) {
300 300
 			$btn_text = $btn_text_if_inactive;
301 301
 			$class = 'ee-grey';
302 302
 		}
@@ -310,7 +310,7 @@  discard block
 block discarded – undo
310 310
 
311 311
 
312 312
 
313
-if ( ! function_exists( 'espresso_display_ticket_selector' )) {
313
+if ( ! function_exists('espresso_display_ticket_selector')) {
314 314
 	/**
315 315
 	 * espresso_display_ticket_selector
316 316
 	 * whether or not to display the Ticket Selector for an event
@@ -318,15 +318,15 @@  discard block
 block discarded – undo
318 318
 	 * @param bool $EVT_ID
319 319
 	 * @return boolean
320 320
 	 */
321
-	function espresso_display_ticket_selector( $EVT_ID = FALSE ) {
322
-		EE_Registry::instance()->load_helper( 'Event_View' );
323
-		return EEH_Event_View::display_ticket_selector( $EVT_ID );
321
+	function espresso_display_ticket_selector($EVT_ID = FALSE) {
322
+		EE_Registry::instance()->load_helper('Event_View');
323
+		return EEH_Event_View::display_ticket_selector($EVT_ID);
324 324
 	}
325 325
 }
326 326
 
327 327
 
328 328
 
329
-if ( ! function_exists( 'espresso_event_status_banner' )) {
329
+if ( ! function_exists('espresso_event_status_banner')) {
330 330
 	/**
331 331
 	 * espresso_event_status
332 332
 	 * returns a banner showing the event status if it is sold out, expired, or inactive
@@ -334,14 +334,14 @@  discard block
 block discarded – undo
334 334
 	 * @param bool $EVT_ID
335 335
 	 * @return string
336 336
 	 */
337
-	function espresso_event_status_banner( $EVT_ID = FALSE ) {
338
-		EE_Registry::instance()->load_helper( 'Event_View' );
339
-		return EEH_Event_View::event_status( $EVT_ID );
337
+	function espresso_event_status_banner($EVT_ID = FALSE) {
338
+		EE_Registry::instance()->load_helper('Event_View');
339
+		return EEH_Event_View::event_status($EVT_ID);
340 340
 	}
341 341
 }
342 342
 
343 343
 
344
-if ( ! function_exists( 'espresso_event_status' )) {
344
+if ( ! function_exists('espresso_event_status')) {
345 345
 	/**
346 346
 	 * espresso_event_status
347 347
 	 * returns the event status if it is sold out, expired, or inactive
@@ -350,18 +350,18 @@  discard block
 block discarded – undo
350 350
 	 * @param bool $echo
351 351
 	 * @return string
352 352
 	 */
353
-	function espresso_event_status( $EVT_ID = 0, $echo = TRUE ) {
354
-		EE_Registry::instance()->load_helper( 'Event_View' );
355
-		if ( $echo ) {
356
-			echo EEH_Event_View::event_active_status( $EVT_ID );
353
+	function espresso_event_status($EVT_ID = 0, $echo = TRUE) {
354
+		EE_Registry::instance()->load_helper('Event_View');
355
+		if ($echo) {
356
+			echo EEH_Event_View::event_active_status($EVT_ID);
357 357
 			return '';
358 358
 		}
359
-		return EEH_Event_View::event_active_status( $EVT_ID );
359
+		return EEH_Event_View::event_active_status($EVT_ID);
360 360
 	}
361 361
 }
362 362
 
363 363
 
364
-if ( ! function_exists( 'espresso_event_categories' )) {
364
+if ( ! function_exists('espresso_event_categories')) {
365 365
 	/**
366 366
 	 * espresso_event_categories
367 367
 	 * returns the terms associated with an event
@@ -371,18 +371,18 @@  discard block
 block discarded – undo
371 371
 	 * @param bool $echo
372 372
 	 * @return string
373 373
 	 */
374
-	function espresso_event_categories( $EVT_ID = 0, $hide_uncategorized = TRUE, $echo = TRUE ) {
375
-		EE_Registry::instance()->load_helper( 'Event_View' );
376
-		if ( $echo ) {
377
-			echo EEH_Event_View::event_categories( $EVT_ID, $hide_uncategorized );
374
+	function espresso_event_categories($EVT_ID = 0, $hide_uncategorized = TRUE, $echo = TRUE) {
375
+		EE_Registry::instance()->load_helper('Event_View');
376
+		if ($echo) {
377
+			echo EEH_Event_View::event_categories($EVT_ID, $hide_uncategorized);
378 378
 			return '';
379 379
 		}
380
-		return EEH_Event_View::event_categories( $EVT_ID, $hide_uncategorized );
380
+		return EEH_Event_View::event_categories($EVT_ID, $hide_uncategorized);
381 381
 	}
382 382
 }
383 383
 
384 384
 
385
-if ( ! function_exists( 'espresso_event_tickets_available' )) {
385
+if ( ! function_exists('espresso_event_tickets_available')) {
386 386
 	/**
387 387
 	 * espresso_event_tickets_available
388 388
 	 * returns the ticket types available for purchase for an event
@@ -392,27 +392,27 @@  discard block
 block discarded – undo
392 392
 	 * @param bool $format
393 393
 	 * @return string
394 394
 	 */
395
-	function espresso_event_tickets_available( $EVT_ID = 0, $echo = TRUE, $format = TRUE ) {
396
-		EE_Registry::instance()->load_helper( 'Event_View' );
397
-		$tickets = EEH_Event_View::event_tickets_available( $EVT_ID );
398
-		if ( is_array( $tickets ) && ! empty( $tickets )) {
395
+	function espresso_event_tickets_available($EVT_ID = 0, $echo = TRUE, $format = TRUE) {
396
+		EE_Registry::instance()->load_helper('Event_View');
397
+		$tickets = EEH_Event_View::event_tickets_available($EVT_ID);
398
+		if (is_array($tickets) && ! empty($tickets)) {
399 399
 			// if formatting then $html will be a string, else it will be an array of ticket objects
400
-			$html = $format ? '<ul id="ee-event-tickets-ul-' . $EVT_ID . '" class="ee-event-tickets-ul">' : array();
401
-			foreach ( $tickets as $ticket ) {
402
-				if ( $ticket instanceof EE_Ticket ) {
403
-					if ( $format ) {
404
-						$html .= '<li id="ee-event-tickets-li-' . $ticket->ID() . '" class="ee-event-tickets-li">';
405
-						$html .= $ticket->name() . ' ' . EEH_Template::format_currency( $ticket->get_ticket_total_with_taxes() );
400
+			$html = $format ? '<ul id="ee-event-tickets-ul-'.$EVT_ID.'" class="ee-event-tickets-ul">' : array();
401
+			foreach ($tickets as $ticket) {
402
+				if ($ticket instanceof EE_Ticket) {
403
+					if ($format) {
404
+						$html .= '<li id="ee-event-tickets-li-'.$ticket->ID().'" class="ee-event-tickets-li">';
405
+						$html .= $ticket->name().' '.EEH_Template::format_currency($ticket->get_ticket_total_with_taxes());
406 406
 						$html .= '</li>';
407 407
 					} else {
408 408
 						$html[] = $ticket;
409 409
 					}
410 410
 				}
411 411
 			}
412
-			if ( $format ) {
412
+			if ($format) {
413 413
 				$html .= '</ul>';
414 414
 			}
415
-			if ( $echo && ! $format ) {
415
+			if ($echo && ! $format) {
416 416
 				echo $html;
417 417
 				return '';
418 418
 			}
@@ -422,7 +422,7 @@  discard block
 block discarded – undo
422 422
 	}
423 423
 }
424 424
 
425
-if ( ! function_exists( 'espresso_event_date_obj' )) {
425
+if ( ! function_exists('espresso_event_date_obj')) {
426 426
 	/**
427 427
 	 * espresso_event_date_obj
428 428
 	 * returns the primary date object for an event
@@ -430,14 +430,14 @@  discard block
 block discarded – undo
430 430
 	 * @param bool $EVT_ID
431 431
 	 * @return object
432 432
 	 */
433
-	function espresso_event_date_obj( $EVT_ID = FALSE ) {
434
-		EE_Registry::instance()->load_helper( 'Event_View' );
435
-		return EEH_Event_View::get_primary_date_obj( $EVT_ID );
433
+	function espresso_event_date_obj($EVT_ID = FALSE) {
434
+		EE_Registry::instance()->load_helper('Event_View');
435
+		return EEH_Event_View::get_primary_date_obj($EVT_ID);
436 436
 	}
437 437
 }
438 438
 
439 439
 
440
-if ( ! function_exists( 'espresso_event_date' )) {
440
+if ( ! function_exists('espresso_event_date')) {
441 441
 	/**
442 442
 	 * espresso_event_date
443 443
 	 * returns the primary date for an event
@@ -448,23 +448,23 @@  discard block
 block discarded – undo
448 448
 	 * @param bool $echo
449 449
 	 * @return string
450 450
 	 */
451
-	function espresso_event_date( $date_format = '', $time_format = '', $EVT_ID = FALSE, $echo = TRUE ) {
452
-		$date_format = ! empty( $date_format ) ? $date_format : get_option( 'date_format' );
453
-		$time_format = ! empty( $time_format ) ? $time_format : get_option( 'time_format' );
454
-		$date_format = apply_filters( 'FHEE__espresso_event_date__date_format', $date_format );
455
-		$time_format = apply_filters( 'FHEE__espresso_event_date__time_format', $time_format );
456
-		EE_Registry::instance()->load_helper( 'Event_View' );
457
-		if($echo){
458
-			echo EEH_Event_View::the_event_date( $date_format, $time_format, $EVT_ID );
451
+	function espresso_event_date($date_format = '', $time_format = '', $EVT_ID = FALSE, $echo = TRUE) {
452
+		$date_format = ! empty($date_format) ? $date_format : get_option('date_format');
453
+		$time_format = ! empty($time_format) ? $time_format : get_option('time_format');
454
+		$date_format = apply_filters('FHEE__espresso_event_date__date_format', $date_format);
455
+		$time_format = apply_filters('FHEE__espresso_event_date__time_format', $time_format);
456
+		EE_Registry::instance()->load_helper('Event_View');
457
+		if ($echo) {
458
+			echo EEH_Event_View::the_event_date($date_format, $time_format, $EVT_ID);
459 459
 			return '';
460 460
 		}
461
-		return EEH_Event_View::the_event_date( $date_format, $time_format, $EVT_ID );
461
+		return EEH_Event_View::the_event_date($date_format, $time_format, $EVT_ID);
462 462
 
463 463
 	}
464 464
 }
465 465
 
466 466
 
467
-if ( ! function_exists( 'espresso_list_of_event_dates' )) {
467
+if ( ! function_exists('espresso_list_of_event_dates')) {
468 468
 	/**
469 469
 	 * espresso_list_of_event_dates
470 470
 	 * returns a unordered list of dates for an event
@@ -479,41 +479,41 @@  discard block
 block discarded – undo
479 479
 	 * @param null   $limit
480 480
 	 * @return string
481 481
 	 */
482
-	function espresso_list_of_event_dates( $EVT_ID = 0, $date_format = '', $time_format = '', $echo = TRUE, $show_expired = NULL, $format = TRUE, $add_breaks = TRUE, $limit = NULL ) {
483
-		$date_format = ! empty( $date_format ) ? $date_format : get_option( 'date_format' );
484
-		$time_format = ! empty( $time_format ) ? $time_format : get_option( 'time_format' );
485
-		$date_format = apply_filters( 'FHEE__espresso_list_of_event_dates__date_format', $date_format );
486
-		$time_format = apply_filters( 'FHEE__espresso_list_of_event_dates__time_format', $time_format );
487
-		EE_Registry::instance()->load_helper( 'Event_View' );
488
-		$datetimes = EEH_Event_View::get_all_date_obj( $EVT_ID, $show_expired, FALSE, $limit );
489
-		if ( ! $format ) {
490
-			return apply_filters( 'FHEE__espresso_list_of_event_dates__datetimes', $datetimes );
482
+	function espresso_list_of_event_dates($EVT_ID = 0, $date_format = '', $time_format = '', $echo = TRUE, $show_expired = NULL, $format = TRUE, $add_breaks = TRUE, $limit = NULL) {
483
+		$date_format = ! empty($date_format) ? $date_format : get_option('date_format');
484
+		$time_format = ! empty($time_format) ? $time_format : get_option('time_format');
485
+		$date_format = apply_filters('FHEE__espresso_list_of_event_dates__date_format', $date_format);
486
+		$time_format = apply_filters('FHEE__espresso_list_of_event_dates__time_format', $time_format);
487
+		EE_Registry::instance()->load_helper('Event_View');
488
+		$datetimes = EEH_Event_View::get_all_date_obj($EVT_ID, $show_expired, FALSE, $limit);
489
+		if ( ! $format) {
490
+			return apply_filters('FHEE__espresso_list_of_event_dates__datetimes', $datetimes);
491 491
 		}
492 492
 		//d( $datetimes );
493
-		if ( is_array( $datetimes ) && ! empty( $datetimes )) {
493
+		if (is_array($datetimes) && ! empty($datetimes)) {
494 494
 			global $post;
495
-			$html = $format ? '<ul id="ee-event-datetimes-ul-' . $post->ID . '" class="ee-event-datetimes-ul ee-clearfix">' : '';
496
-			foreach ( $datetimes as $datetime ) {
497
-				if ( $datetime instanceof EE_Datetime ) {
498
-					$html .= '<li id="ee-event-datetimes-li-' . $datetime->ID();
499
-					$html .= '" class="ee-event-datetimes-li ee-event-datetimes-li-' . $datetime->get_active_status() . '">';
495
+			$html = $format ? '<ul id="ee-event-datetimes-ul-'.$post->ID.'" class="ee-event-datetimes-ul ee-clearfix">' : '';
496
+			foreach ($datetimes as $datetime) {
497
+				if ($datetime instanceof EE_Datetime) {
498
+					$html .= '<li id="ee-event-datetimes-li-'.$datetime->ID();
499
+					$html .= '" class="ee-event-datetimes-li ee-event-datetimes-li-'.$datetime->get_active_status().'">';
500 500
 					$datetime_name = $datetime->name();
501
-					$html .= ! empty( $datetime_name ) ? '<strong>' . $datetime_name . '</strong>' : '';
502
-					$html .= ! empty( $datetime_name )  && $add_breaks ? '<br />' : '';
503
-					$html .= '<span class="dashicons dashicons-calendar"></span>' . $datetime->date_range( $date_format ) . '<br/>';
504
-					$html .= '<span class="dashicons dashicons-clock"></span>' . $datetime->time_range( $time_format );
501
+					$html .= ! empty($datetime_name) ? '<strong>'.$datetime_name.'</strong>' : '';
502
+					$html .= ! empty($datetime_name) && $add_breaks ? '<br />' : '';
503
+					$html .= '<span class="dashicons dashicons-calendar"></span>'.$datetime->date_range($date_format).'<br/>';
504
+					$html .= '<span class="dashicons dashicons-clock"></span>'.$datetime->time_range($time_format);
505 505
 					$datetime_description = $datetime->description();
506
-					$html .= ! empty( $datetime_description )  && $add_breaks ? '<br />' : '';
507
-					$html .= ! empty( $datetime_description ) ? ' - ' . $datetime_description : '';
508
-					$html = apply_filters( 'FHEE__espresso_list_of_event_dates__datetime_html', $html, $datetime );
506
+					$html .= ! empty($datetime_description) && $add_breaks ? '<br />' : '';
507
+					$html .= ! empty($datetime_description) ? ' - '.$datetime_description : '';
508
+					$html = apply_filters('FHEE__espresso_list_of_event_dates__datetime_html', $html, $datetime);
509 509
 					$html .= '</li>';
510 510
 				}
511 511
 			}
512 512
 			$html .= $format ? '</ul>' : '';
513 513
 		} else {
514
-			$html = $format ?  '<p><span class="dashicons dashicons-marker pink-text"></span>' . __( 'There are no upcoming dates for this event.', 'event_espresso' ) . '</p><br/>' : '';
514
+			$html = $format ? '<p><span class="dashicons dashicons-marker pink-text"></span>'.__('There are no upcoming dates for this event.', 'event_espresso').'</p><br/>' : '';
515 515
 		}
516
-		if ( $echo ) {
516
+		if ($echo) {
517 517
 			echo $html;
518 518
 			return '';
519 519
 		}
@@ -522,7 +522,7 @@  discard block
 block discarded – undo
522 522
 }
523 523
 
524 524
 
525
-if ( ! function_exists( 'espresso_event_end_date' )) {
525
+if ( ! function_exists('espresso_event_end_date')) {
526 526
 	/**
527 527
 	 * espresso_event_end_date
528 528
 	 * returns the last date for an event
@@ -533,21 +533,21 @@  discard block
 block discarded – undo
533 533
 	 * @param bool   $echo
534 534
 	 * @return string
535 535
 	 */
536
-	function espresso_event_end_date( $date_format = '', $time_format = '', $EVT_ID = FALSE, $echo = TRUE ) {
537
-		$date_format = ! empty( $date_format ) ? $date_format : get_option( 'date_format' );
538
-		$time_format = ! empty( $time_format ) ? $time_format : get_option( 'time_format' );
539
-		$date_format = apply_filters( 'FHEE__espresso_event_end_date__date_format', $date_format );
540
-		$time_format = apply_filters( 'FHEE__espresso_event_end_date__time_format', $time_format );
541
-		EE_Registry::instance()->load_helper( 'Event_View' );
542
-		if($echo){
543
-			echo EEH_Event_View::the_event_end_date( $date_format, $time_format, $EVT_ID );
536
+	function espresso_event_end_date($date_format = '', $time_format = '', $EVT_ID = FALSE, $echo = TRUE) {
537
+		$date_format = ! empty($date_format) ? $date_format : get_option('date_format');
538
+		$time_format = ! empty($time_format) ? $time_format : get_option('time_format');
539
+		$date_format = apply_filters('FHEE__espresso_event_end_date__date_format', $date_format);
540
+		$time_format = apply_filters('FHEE__espresso_event_end_date__time_format', $time_format);
541
+		EE_Registry::instance()->load_helper('Event_View');
542
+		if ($echo) {
543
+			echo EEH_Event_View::the_event_end_date($date_format, $time_format, $EVT_ID);
544 544
 			return '';
545 545
 		}
546
-		return EEH_Event_View::the_event_end_date( $date_format, $time_format, $EVT_ID );
546
+		return EEH_Event_View::the_event_end_date($date_format, $time_format, $EVT_ID);
547 547
 	}
548 548
 }
549 549
 
550
-if ( ! function_exists( 'espresso_event_date_range' )) {
550
+if ( ! function_exists('espresso_event_date_range')) {
551 551
 	/**
552 552
 	 * espresso_event_date_range
553 553
 	 * returns the first and last chronologically ordered dates for an event (if different)
@@ -560,32 +560,32 @@  discard block
 block discarded – undo
560 560
 	 * @param bool   $echo
561 561
 	 * @return string
562 562
 	 */
563
-	function espresso_event_date_range( $date_format = '', $time_format = '', $single_date_format = '', $single_time_format = '', $EVT_ID = FALSE, $echo = TRUE ) {
564
-		EE_Registry::instance()->load_helper( 'Event_View' );
563
+	function espresso_event_date_range($date_format = '', $time_format = '', $single_date_format = '', $single_time_format = '', $EVT_ID = FALSE, $echo = TRUE) {
564
+		EE_Registry::instance()->load_helper('Event_View');
565 565
 		// set and filter date and time formats when a range is returned
566
-		$date_format = ! empty( $date_format ) ? $date_format : get_option( 'date_format' );
567
-		$date_format = apply_filters( 'FHEE__espresso_event_date_range__date_format', $date_format );
566
+		$date_format = ! empty($date_format) ? $date_format : get_option('date_format');
567
+		$date_format = apply_filters('FHEE__espresso_event_date_range__date_format', $date_format);
568 568
 		// get the start and end date with NO time portion
569
-		$the_event_date = EEH_Event_View::the_earliest_event_date( $date_format, '', $EVT_ID );
570
-		$the_event_end_date = EEH_Event_View::the_latest_event_date( $date_format, '', $EVT_ID );
569
+		$the_event_date = EEH_Event_View::the_earliest_event_date($date_format, '', $EVT_ID);
570
+		$the_event_end_date = EEH_Event_View::the_latest_event_date($date_format, '', $EVT_ID);
571 571
 		// now we can determine if date range spans more than one day
572
-		if ( $the_event_date != $the_event_end_date ) {
573
-			$time_format = ! empty( $time_format ) ? $time_format : get_option( 'time_format' );
574
-			$time_format = apply_filters( 'FHEE__espresso_event_date_range__time_format', $time_format );
572
+		if ($the_event_date != $the_event_end_date) {
573
+			$time_format = ! empty($time_format) ? $time_format : get_option('time_format');
574
+			$time_format = apply_filters('FHEE__espresso_event_date_range__time_format', $time_format);
575 575
 			$html = sprintf(
576
-				__( '%1$s - %2$s', 'event_espresso' ),
577
-				EEH_Event_View::the_earliest_event_date( $date_format, $time_format, $EVT_ID ),
578
-				EEH_Event_View::the_latest_event_date( $date_format, $time_format, $EVT_ID )
576
+				__('%1$s - %2$s', 'event_espresso'),
577
+				EEH_Event_View::the_earliest_event_date($date_format, $time_format, $EVT_ID),
578
+				EEH_Event_View::the_latest_event_date($date_format, $time_format, $EVT_ID)
579 579
 			);
580 580
 		} else {
581 581
 			// set and filter date and time formats when only a single datetime is returned
582
-			$single_date_format = ! empty( $single_date_format ) ? $single_date_format : get_option( 'date_format' );
583
-			$single_time_format = ! empty( $single_time_format ) ? $single_time_format : get_option( 'time_format' );
584
-			$single_date_format = apply_filters( 'FHEE__espresso_event_date_range__single_date_format', $single_date_format );
585
-			$single_time_format = apply_filters( 'FHEE__espresso_event_date_range__single_time_format', $single_time_format );
586
-			$html = EEH_Event_View::the_earliest_event_date( $single_date_format, $single_time_format, $EVT_ID );
582
+			$single_date_format = ! empty($single_date_format) ? $single_date_format : get_option('date_format');
583
+			$single_time_format = ! empty($single_time_format) ? $single_time_format : get_option('time_format');
584
+			$single_date_format = apply_filters('FHEE__espresso_event_date_range__single_date_format', $single_date_format);
585
+			$single_time_format = apply_filters('FHEE__espresso_event_date_range__single_time_format', $single_time_format);
586
+			$html = EEH_Event_View::the_earliest_event_date($single_date_format, $single_time_format, $EVT_ID);
587 587
 		}
588
-		if ( $echo ) {
588
+		if ($echo) {
589 589
 			echo $html;
590 590
 			return '';
591 591
 		}
@@ -594,7 +594,7 @@  discard block
 block discarded – undo
594 594
 }
595 595
 
596 596
 
597
-if ( ! function_exists( 'espresso_event_date_as_calendar_page' )) {
597
+if ( ! function_exists('espresso_event_date_as_calendar_page')) {
598 598
 	/**
599 599
 	 * espresso_event_date_as_calendar_page
600 600
 	 * returns the primary date for an event, stylized to appear as the page of a calendar
@@ -602,16 +602,16 @@  discard block
 block discarded – undo
602 602
 	 * @param bool $EVT_ID
603 603
 	 * @return string
604 604
 	 */
605
-	function espresso_event_date_as_calendar_page( $EVT_ID = FALSE ) {
606
-		EE_Registry::instance()->load_helper( 'Event_View' );
607
-		EEH_Event_View::event_date_as_calendar_page( $EVT_ID );
605
+	function espresso_event_date_as_calendar_page($EVT_ID = FALSE) {
606
+		EE_Registry::instance()->load_helper('Event_View');
607
+		EEH_Event_View::event_date_as_calendar_page($EVT_ID);
608 608
 	}
609 609
 }
610 610
 
611 611
 
612 612
 
613 613
 
614
-if ( ! function_exists( 'espresso_event_link_url' )) {
614
+if ( ! function_exists('espresso_event_link_url')) {
615 615
 	/**
616 616
 	 * espresso_event_link_url
617 617
 	 *
@@ -619,19 +619,19 @@  discard block
 block discarded – undo
619 619
 	 * @param bool $echo
620 620
 	 * @return string
621 621
 	 */
622
-	function espresso_event_link_url( $EVT_ID = 0, $echo = TRUE ) {
623
-		EE_Registry::instance()->load_helper( 'Event_View' );
624
-		if ( $echo ) {
625
-			echo EEH_Event_View::event_link_url( $EVT_ID );
622
+	function espresso_event_link_url($EVT_ID = 0, $echo = TRUE) {
623
+		EE_Registry::instance()->load_helper('Event_View');
624
+		if ($echo) {
625
+			echo EEH_Event_View::event_link_url($EVT_ID);
626 626
 			return '';
627 627
 		}
628
-		return EEH_Event_View::event_link_url( $EVT_ID );
628
+		return EEH_Event_View::event_link_url($EVT_ID);
629 629
 	}
630 630
 }
631 631
 
632 632
 
633 633
 
634
-if ( ! function_exists( 'espresso_event_has_content_or_excerpt' )) {
634
+if ( ! function_exists('espresso_event_has_content_or_excerpt')) {
635 635
 	/**
636 636
 	 *    espresso_event_has_content_or_excerpt
637 637
 	 *
@@ -639,16 +639,16 @@  discard block
 block discarded – undo
639 639
 	 * @param bool $EVT_ID
640 640
 	 * @return    boolean
641 641
 	 */
642
-	function espresso_event_has_content_or_excerpt( $EVT_ID = FALSE ) {
643
-		EE_Registry::instance()->load_helper( 'Event_View' );
644
-		return EEH_Event_View::event_has_content_or_excerpt( $EVT_ID );
642
+	function espresso_event_has_content_or_excerpt($EVT_ID = FALSE) {
643
+		EE_Registry::instance()->load_helper('Event_View');
644
+		return EEH_Event_View::event_has_content_or_excerpt($EVT_ID);
645 645
 	}
646 646
 }
647 647
 
648 648
 
649 649
 
650 650
 
651
-if ( ! function_exists( 'espresso_event_content_or_excerpt' )) {
651
+if ( ! function_exists('espresso_event_content_or_excerpt')) {
652 652
 	/**
653 653
 	 * espresso_event_content_or_excerpt
654 654
 	 *
@@ -657,19 +657,19 @@  discard block
 block discarded – undo
657 657
 	 * @param bool $echo
658 658
 	 * @return string
659 659
 	 */
660
-	function espresso_event_content_or_excerpt( $num_words = 55, $more = NULL, $echo = TRUE ) {
661
-		EE_Registry::instance()->load_helper( 'Event_View' );
662
-		if ( $echo ) {
663
-			echo EEH_Event_View::event_content_or_excerpt( $num_words, $more );
660
+	function espresso_event_content_or_excerpt($num_words = 55, $more = NULL, $echo = TRUE) {
661
+		EE_Registry::instance()->load_helper('Event_View');
662
+		if ($echo) {
663
+			echo EEH_Event_View::event_content_or_excerpt($num_words, $more);
664 664
 			return '';
665 665
 		}
666
-		return EEH_Event_View::event_content_or_excerpt( $num_words, $more );
666
+		return EEH_Event_View::event_content_or_excerpt($num_words, $more);
667 667
 	}
668 668
 }
669 669
 
670 670
 
671 671
 
672
-if ( ! function_exists( 'espresso_event_phone' )) {
672
+if ( ! function_exists('espresso_event_phone')) {
673 673
 	/**
674 674
 	 * espresso_event_phone
675 675
 	 *
@@ -677,19 +677,19 @@  discard block
 block discarded – undo
677 677
 	 * @param bool $echo
678 678
 	 * @return string
679 679
 	 */
680
-	function espresso_event_phone( $EVT_ID = 0, $echo = TRUE ) {
681
-		EE_Registry::instance()->load_helper( 'Event_View' );
682
-		if ( $echo ) {
683
-			echo EEH_Event_View::event_phone( $EVT_ID );
680
+	function espresso_event_phone($EVT_ID = 0, $echo = TRUE) {
681
+		EE_Registry::instance()->load_helper('Event_View');
682
+		if ($echo) {
683
+			echo EEH_Event_View::event_phone($EVT_ID);
684 684
 			return '';
685 685
 		}
686
-		return EEH_Event_View::event_phone( $EVT_ID );
686
+		return EEH_Event_View::event_phone($EVT_ID);
687 687
 	}
688 688
 }
689 689
 
690 690
 
691 691
 
692
-if ( ! function_exists( 'espresso_edit_event_link' )) {
692
+if ( ! function_exists('espresso_edit_event_link')) {
693 693
 	/**
694 694
 	 * espresso_edit_event_link
695 695
 	 * returns a link to edit an event
@@ -698,41 +698,41 @@  discard block
 block discarded – undo
698 698
 	 * @param bool $echo
699 699
 	 * @return string
700 700
 	 */
701
-	function espresso_edit_event_link( $EVT_ID = 0, $echo = TRUE ) {
702
-		EE_Registry::instance()->load_helper( 'Event_View' );
703
-		if ( $echo ) {
704
-			echo EEH_Event_View::edit_event_link( $EVT_ID );
701
+	function espresso_edit_event_link($EVT_ID = 0, $echo = TRUE) {
702
+		EE_Registry::instance()->load_helper('Event_View');
703
+		if ($echo) {
704
+			echo EEH_Event_View::edit_event_link($EVT_ID);
705 705
 			return '';
706 706
 		}
707
-		return EEH_Event_View::edit_event_link( $EVT_ID );
707
+		return EEH_Event_View::edit_event_link($EVT_ID);
708 708
 	}
709 709
 }
710 710
 
711 711
 
712
-if ( ! function_exists( 'espresso_organization_name' )) {
712
+if ( ! function_exists('espresso_organization_name')) {
713 713
 	/**
714 714
 	 * espresso_organization_name
715 715
 	 * @param bool $echo
716 716
 	 * @return string
717 717
 	 */
718 718
 	function espresso_organization_name($echo = TRUE) {
719
-		if($echo){
720
-			echo EE_Registry::instance()->CFG->organization->get_pretty( 'name' );
719
+		if ($echo) {
720
+			echo EE_Registry::instance()->CFG->organization->get_pretty('name');
721 721
 			return '';
722 722
 		}
723
-		return EE_Registry::instance()->CFG->organization->get_pretty( 'name' );
723
+		return EE_Registry::instance()->CFG->organization->get_pretty('name');
724 724
 	}
725 725
 }
726 726
 
727
-if ( ! function_exists( 'espresso_organization_address' )) {
727
+if ( ! function_exists('espresso_organization_address')) {
728 728
 	/**
729 729
 	 * espresso_organization_address
730 730
 	 * @param string $type
731 731
 	 * @return string
732 732
 	 */
733
-	function espresso_organization_address( $type = 'inline' ) {
734
-		if ( EE_Registry::instance()->CFG->organization instanceof EE_Organization_Config ) {
735
-			EE_Registry::instance()->load_helper( 'Formatter' );
733
+	function espresso_organization_address($type = 'inline') {
734
+		if (EE_Registry::instance()->CFG->organization instanceof EE_Organization_Config) {
735
+			EE_Registry::instance()->load_helper('Formatter');
736 736
 			$address = new EE_Generic_Address(
737 737
 				EE_Registry::instance()->CFG->organization->address_1,
738 738
 				EE_Registry::instance()->CFG->organization->address_2,
@@ -741,129 +741,129 @@  discard block
 block discarded – undo
741 741
 				EE_Registry::instance()->CFG->organization->zip,
742 742
 				EE_Registry::instance()->CFG->organization->CNT_ISO
743 743
 			);
744
-			return EEH_Address::format( $address, $type );
744
+			return EEH_Address::format($address, $type);
745 745
 		}
746 746
 		return '';
747 747
 	}
748 748
 }
749 749
 
750
-if ( ! function_exists( 'espresso_organization_email' )) {
750
+if ( ! function_exists('espresso_organization_email')) {
751 751
 	/**
752 752
 	 * espresso_organization_email
753 753
 	 * @param bool $echo
754 754
 	 * @return string
755 755
 	 */
756
-	function espresso_organization_email( $echo = TRUE ) {
757
-		if($echo){
758
-			echo EE_Registry::instance()->CFG->organization->get_pretty( 'email' );
756
+	function espresso_organization_email($echo = TRUE) {
757
+		if ($echo) {
758
+			echo EE_Registry::instance()->CFG->organization->get_pretty('email');
759 759
 			return '';
760 760
 		}
761
-		return EE_Registry::instance()->CFG->organization->get_pretty( 'email' );
761
+		return EE_Registry::instance()->CFG->organization->get_pretty('email');
762 762
 	}
763 763
 }
764 764
 
765
-if ( ! function_exists( 'espresso_organization_logo_url' )) {
765
+if ( ! function_exists('espresso_organization_logo_url')) {
766 766
 	/**
767 767
 	 * espresso_organization_logo_url
768 768
 	 * @param bool $echo
769 769
 	 * @return string
770 770
 	 */
771
-	function espresso_organization_logo_url( $echo = TRUE ) {
772
-		if($echo){
773
-			echo EE_Registry::instance()->CFG->organization->get_pretty( 'logo_url' );
771
+	function espresso_organization_logo_url($echo = TRUE) {
772
+		if ($echo) {
773
+			echo EE_Registry::instance()->CFG->organization->get_pretty('logo_url');
774 774
 			return '';
775 775
 		}
776
-		return EE_Registry::instance()->CFG->organization->get_pretty( 'logo_url' );
776
+		return EE_Registry::instance()->CFG->organization->get_pretty('logo_url');
777 777
 	}
778 778
 }
779 779
 
780
-if ( ! function_exists( 'espresso_organization_facebook' )) {
780
+if ( ! function_exists('espresso_organization_facebook')) {
781 781
 	/**
782 782
 	 * espresso_organization_facebook
783 783
 	 * @param bool $echo
784 784
 	 * @return string
785 785
 	 */
786
-	function espresso_organization_facebook( $echo = TRUE ) {
787
-		if($echo){
788
-			echo EE_Registry::instance()->CFG->organization->get_pretty( 'facebook' );
786
+	function espresso_organization_facebook($echo = TRUE) {
787
+		if ($echo) {
788
+			echo EE_Registry::instance()->CFG->organization->get_pretty('facebook');
789 789
 			return '';
790 790
 		}
791
-		return EE_Registry::instance()->CFG->organization->get_pretty( 'facebook' );
791
+		return EE_Registry::instance()->CFG->organization->get_pretty('facebook');
792 792
 	}
793 793
 }
794 794
 
795
-if ( ! function_exists( 'espresso_organization_twitter' )) {
795
+if ( ! function_exists('espresso_organization_twitter')) {
796 796
 	/**
797 797
 	 * espresso_organization_twitter
798 798
 	 * @param bool $echo
799 799
 	 * @return string
800 800
 	 */
801
-	function espresso_organization_twitter( $echo = TRUE ) {
802
-		if($echo){
803
-			echo EE_Registry::instance()->CFG->organization->get_pretty( 'twitter' );
801
+	function espresso_organization_twitter($echo = TRUE) {
802
+		if ($echo) {
803
+			echo EE_Registry::instance()->CFG->organization->get_pretty('twitter');
804 804
 			return '';
805 805
 		}
806
-		return EE_Registry::instance()->CFG->organization->get_pretty( 'twitter' );
806
+		return EE_Registry::instance()->CFG->organization->get_pretty('twitter');
807 807
 	}
808 808
 }
809 809
 
810
-if ( ! function_exists( 'espresso_organization_linkedin' )) {
810
+if ( ! function_exists('espresso_organization_linkedin')) {
811 811
 	/**
812 812
 	 * espresso_organization_linkedin
813 813
 	 * @param bool $echo
814 814
 	 * @return string
815 815
 	 */
816
-	function espresso_organization_linkedin( $echo = TRUE ) {
817
-		if($echo){
818
-			echo EE_Registry::instance()->CFG->organization->get_pretty( 'linkedin' );
816
+	function espresso_organization_linkedin($echo = TRUE) {
817
+		if ($echo) {
818
+			echo EE_Registry::instance()->CFG->organization->get_pretty('linkedin');
819 819
 			return '';
820 820
 		}
821
-		return EE_Registry::instance()->CFG->organization->get_pretty( 'linkedin' );
821
+		return EE_Registry::instance()->CFG->organization->get_pretty('linkedin');
822 822
 	}
823 823
 }
824 824
 
825
-if ( ! function_exists( 'espresso_organization_pinterest' )) {
825
+if ( ! function_exists('espresso_organization_pinterest')) {
826 826
 	/**
827 827
 	 * espresso_organization_pinterest
828 828
 	 * @param bool $echo
829 829
 	 * @return string
830 830
 	 */
831
-	function espresso_organization_pinterest( $echo = TRUE ) {
832
-		if($echo){
833
-			echo EE_Registry::instance()->CFG->organization->get_pretty( 'pinterest' );
831
+	function espresso_organization_pinterest($echo = TRUE) {
832
+		if ($echo) {
833
+			echo EE_Registry::instance()->CFG->organization->get_pretty('pinterest');
834 834
 			return '';
835 835
 		}
836
-		return EE_Registry::instance()->CFG->organization->get_pretty( 'pinterest' );
836
+		return EE_Registry::instance()->CFG->organization->get_pretty('pinterest');
837 837
 	}
838 838
 }
839 839
 
840
-if ( ! function_exists( 'espresso_organization_google' )) {
840
+if ( ! function_exists('espresso_organization_google')) {
841 841
 	/**
842 842
 	 * espresso_organization_google
843 843
 	 * @param bool $echo
844 844
 	 * @return string
845 845
 	 */
846
-	function espresso_organization_google( $echo = TRUE ) {
847
-		if($echo){
848
-			echo EE_Registry::instance()->CFG->organization->get_pretty( 'google' );
846
+	function espresso_organization_google($echo = TRUE) {
847
+		if ($echo) {
848
+			echo EE_Registry::instance()->CFG->organization->get_pretty('google');
849 849
 			return '';
850 850
 		}
851
-		return EE_Registry::instance()->CFG->organization->get_pretty( 'google' );
851
+		return EE_Registry::instance()->CFG->organization->get_pretty('google');
852 852
 	}
853 853
 }
854 854
 
855
-if ( ! function_exists( 'espresso_organization_instagram' )) {
855
+if ( ! function_exists('espresso_organization_instagram')) {
856 856
 	/**
857 857
 	 * espresso_organization_instagram
858 858
 	 * @param bool $echo
859 859
 	 * @return string
860 860
 	 */
861
-	function espresso_organization_instagram( $echo = TRUE ) {
862
-		if($echo){
863
-			echo EE_Registry::instance()->CFG->organization->get_pretty( 'instagram' );
861
+	function espresso_organization_instagram($echo = TRUE) {
862
+		if ($echo) {
863
+			echo EE_Registry::instance()->CFG->organization->get_pretty('instagram');
864 864
 			return '';
865 865
 		}
866
-		return EE_Registry::instance()->CFG->organization->get_pretty( 'instagram' );
866
+		return EE_Registry::instance()->CFG->organization->get_pretty('instagram');
867 867
 	}
868 868
 }
869 869
 
@@ -873,14 +873,14 @@  discard block
 block discarded – undo
873 873
 
874 874
 
875 875
 
876
-if ( ! function_exists( 'espresso_event_venues' )) {
876
+if ( ! function_exists('espresso_event_venues')) {
877 877
 	/**
878 878
 	 * espresso_event_venues
879 879
 	 *
880 880
 	 * @return array  all venues related to an event
881 881
 	 */
882 882
 	function espresso_event_venues() {
883
-		EE_Registry::instance()->load_helper( 'Venue_View' );
883
+		EE_Registry::instance()->load_helper('Venue_View');
884 884
 		return EEH_Venue_View::get_event_venues();
885 885
 	}
886 886
 }
@@ -888,7 +888,7 @@  discard block
 block discarded – undo
888 888
 
889 889
 
890 890
 
891
-if ( ! function_exists( 'espresso_venue_id' )) {
891
+if ( ! function_exists('espresso_venue_id')) {
892 892
 	/**
893 893
 	 *    espresso_venue_name
894 894
 	 *
@@ -896,16 +896,16 @@  discard block
 block discarded – undo
896 896
 	 * @param     int $EVT_ID
897 897
 	 * @return    string
898 898
 	 */
899
-	function espresso_venue_id( $EVT_ID = 0 ) {
900
-		EE_Registry::instance()->load_helper( 'Venue_View' );
901
-		$venue = EEH_Venue_View::get_venue( $EVT_ID );
899
+	function espresso_venue_id($EVT_ID = 0) {
900
+		EE_Registry::instance()->load_helper('Venue_View');
901
+		$venue = EEH_Venue_View::get_venue($EVT_ID);
902 902
 		return $venue instanceof EE_Venue ? $venue->ID() : 0;
903 903
 	}
904 904
 }
905 905
 
906 906
 
907 907
 
908
-if ( ! function_exists( 'espresso_is_venue_private' ) ) {
908
+if ( ! function_exists('espresso_is_venue_private')) {
909 909
 	/**
910 910
 	 * Return whether a venue is private or not.
911 911
 	 * @see EEH_Venue_View::get_venue() for more info on expected return results.
@@ -914,46 +914,46 @@  discard block
 block discarded – undo
914 914
 	 *
915 915
 	 * @return bool | null
916 916
 	 */
917
-	function espresso_is_venue_private( $VNU_ID = 0 ) {
918
-		EE_Registry::instance()->load_helper( 'Venue_View' );
919
-		return EEH_Venue_View::is_venue_private( $VNU_ID );
917
+	function espresso_is_venue_private($VNU_ID = 0) {
918
+		EE_Registry::instance()->load_helper('Venue_View');
919
+		return EEH_Venue_View::is_venue_private($VNU_ID);
920 920
 	}
921 921
 }
922 922
 
923 923
 
924 924
 
925
-if ( ! function_exists( 'espresso_venue_is_password_protected' ) ) {
925
+if ( ! function_exists('espresso_venue_is_password_protected')) {
926 926
 	/**
927 927
 	 * returns true or false if a venue is password protected or not
928 928
 	 *
929 929
 	 * @param int     $VNU_ID optional, the venue id to check.
930 930
 	 * @return string
931 931
 	 */
932
-	function espresso_venue_is_password_protected( $VNU_ID = 0 ) {
933
-		EE_Registry::instance()->load_helper( 'Venue_View' );
934
-		return EEH_Venue_View::is_venue_password_protected( $VNU_ID );
932
+	function espresso_venue_is_password_protected($VNU_ID = 0) {
933
+		EE_Registry::instance()->load_helper('Venue_View');
934
+		return EEH_Venue_View::is_venue_password_protected($VNU_ID);
935 935
 	}
936 936
 }
937 937
 
938 938
 
939 939
 
940
-if ( ! function_exists( 'espresso_password_protected_venue_form' ) ) {
940
+if ( ! function_exists('espresso_password_protected_venue_form')) {
941 941
 	/**
942 942
 	 * Returns a password form if venue is password protected.
943 943
 	 *
944 944
 	 * @param int     $VNU_ID optional, the venue id to check.
945 945
 	 * @return string
946 946
 	 */
947
-	function espresso_password_protected_venue_form( $VNU_ID = 0 ) {
948
-		EE_Registry::instance()->load_helper( 'Venue_View' );
949
-		return EEH_Venue_View::password_protected_venue_form( $VNU_ID );
947
+	function espresso_password_protected_venue_form($VNU_ID = 0) {
948
+		EE_Registry::instance()->load_helper('Venue_View');
949
+		return EEH_Venue_View::password_protected_venue_form($VNU_ID);
950 950
 	}
951 951
 }
952 952
 
953 953
 
954 954
 
955 955
 
956
-if ( ! function_exists( 'espresso_venue_name' )) {
956
+if ( ! function_exists('espresso_venue_name')) {
957 957
 	/**
958 958
 	 *    espresso_venue_name
959 959
 	 *
@@ -963,20 +963,20 @@  discard block
 block discarded – undo
963 963
 	 * @param bool   $echo
964 964
 	 * @return    string
965 965
 	 */
966
-	function espresso_venue_name( $VNU_ID = 0, $link_to = 'details', $echo = TRUE ) {
967
-		EE_Registry::instance()->load_helper( 'Venue_View' );
968
-		if($echo){
969
-			echo EEH_Venue_View::venue_name( $link_to, $VNU_ID );
966
+	function espresso_venue_name($VNU_ID = 0, $link_to = 'details', $echo = TRUE) {
967
+		EE_Registry::instance()->load_helper('Venue_View');
968
+		if ($echo) {
969
+			echo EEH_Venue_View::venue_name($link_to, $VNU_ID);
970 970
 			return '';
971 971
 		}
972
-		return EEH_Venue_View::venue_name( $link_to, $VNU_ID );
972
+		return EEH_Venue_View::venue_name($link_to, $VNU_ID);
973 973
 	}
974 974
 }
975 975
 
976 976
 
977 977
 
978 978
 
979
-if ( ! function_exists( 'espresso_venue_link' )) {
979
+if ( ! function_exists('espresso_venue_link')) {
980 980
 	/**
981 981
 	 * 	espresso_venue_link
982 982
 	 *
@@ -985,15 +985,15 @@  discard block
 block discarded – undo
985 985
 	 *  @param 	string 	$text
986 986
 	 *  @return 	string
987 987
 	 */
988
-	function espresso_venue_link( $VNU_ID = 0, $text = '' ) {
989
-		EE_Registry::instance()->load_helper( 'Venue_View' );
990
-		return EEH_Venue_View::venue_details_link( $VNU_ID, $text );
988
+	function espresso_venue_link($VNU_ID = 0, $text = '') {
989
+		EE_Registry::instance()->load_helper('Venue_View');
990
+		return EEH_Venue_View::venue_details_link($VNU_ID, $text);
991 991
 	}
992 992
 }
993 993
 
994 994
 
995 995
 
996
-if ( ! function_exists( 'espresso_venue_description' )) {
996
+if ( ! function_exists('espresso_venue_description')) {
997 997
 	/**
998 998
 	 *    espresso_venue_description
999 999
 	 *
@@ -1002,18 +1002,18 @@  discard block
 block discarded – undo
1002 1002
 	 * @param bool $echo
1003 1003
 	 * @return    string
1004 1004
 	 */
1005
-	function espresso_venue_description( $VNU_ID = FALSE, $echo = TRUE ) {
1006
-		EE_Registry::instance()->load_helper( 'Venue_View' );
1007
-		if($echo){
1008
-			echo EEH_Venue_View::venue_description( $VNU_ID );
1005
+	function espresso_venue_description($VNU_ID = FALSE, $echo = TRUE) {
1006
+		EE_Registry::instance()->load_helper('Venue_View');
1007
+		if ($echo) {
1008
+			echo EEH_Venue_View::venue_description($VNU_ID);
1009 1009
 			return '';
1010 1010
 		}
1011
-		return EEH_Venue_View::venue_description( $VNU_ID );
1011
+		return EEH_Venue_View::venue_description($VNU_ID);
1012 1012
 	}
1013 1013
 }
1014 1014
 
1015 1015
 
1016
-if ( ! function_exists( 'espresso_venue_excerpt' )) {
1016
+if ( ! function_exists('espresso_venue_excerpt')) {
1017 1017
 	/**
1018 1018
 	 *    espresso_venue_excerpt
1019 1019
 	 *
@@ -1022,19 +1022,19 @@  discard block
 block discarded – undo
1022 1022
 	 * @param bool $echo
1023 1023
 	 * @return    string
1024 1024
 	 */
1025
-	function espresso_venue_excerpt( $VNU_ID = 0,  $echo = TRUE ) {
1026
-		EE_Registry::instance()->load_helper( 'Venue_View' );
1027
-		if ( $echo ) {
1028
-			echo EEH_Venue_View::venue_excerpt( $VNU_ID );
1025
+	function espresso_venue_excerpt($VNU_ID = 0, $echo = TRUE) {
1026
+		EE_Registry::instance()->load_helper('Venue_View');
1027
+		if ($echo) {
1028
+			echo EEH_Venue_View::venue_excerpt($VNU_ID);
1029 1029
 			return '';
1030 1030
 		}
1031
-		return EEH_Venue_View::venue_excerpt( $VNU_ID );
1031
+		return EEH_Venue_View::venue_excerpt($VNU_ID);
1032 1032
 	}
1033 1033
 }
1034 1034
 
1035 1035
 
1036 1036
 
1037
-if ( ! function_exists( 'espresso_venue_categories' )) {
1037
+if ( ! function_exists('espresso_venue_categories')) {
1038 1038
 	/**
1039 1039
 	 * espresso_venue_categories
1040 1040
 	 * returns the terms associated with a venue
@@ -1044,18 +1044,18 @@  discard block
 block discarded – undo
1044 1044
 	 * @param bool $echo
1045 1045
 	 * @return string
1046 1046
 	 */
1047
-	function espresso_venue_categories( $VNU_ID = 0, $hide_uncategorized = TRUE,  $echo = TRUE ) {
1048
-		EE_Registry::instance()->load_helper( 'Venue_View' );
1049
-		if ( $echo ) {
1050
-			echo EEH_Venue_View::venue_categories( $VNU_ID, $hide_uncategorized );
1047
+	function espresso_venue_categories($VNU_ID = 0, $hide_uncategorized = TRUE, $echo = TRUE) {
1048
+		EE_Registry::instance()->load_helper('Venue_View');
1049
+		if ($echo) {
1050
+			echo EEH_Venue_View::venue_categories($VNU_ID, $hide_uncategorized);
1051 1051
 			return '';
1052 1052
 		}
1053
-		return EEH_Venue_View::venue_categories( $VNU_ID, $hide_uncategorized );
1053
+		return EEH_Venue_View::venue_categories($VNU_ID, $hide_uncategorized);
1054 1054
 	}
1055 1055
 }
1056 1056
 
1057 1057
 
1058
-if ( ! function_exists( 'espresso_venue_address' )) {
1058
+if ( ! function_exists('espresso_venue_address')) {
1059 1059
 	/**
1060 1060
 	 * espresso_venue_address
1061 1061
 	 * returns a formatted block of html  for displaying a venue's address
@@ -1065,18 +1065,18 @@  discard block
 block discarded – undo
1065 1065
 	 * @param bool   $echo
1066 1066
 	 * @return string
1067 1067
 	 */
1068
-	function espresso_venue_address( $type = 'multiline', $VNU_ID = 0, $echo = TRUE ) {
1069
-		EE_Registry::instance()->load_helper( 'Venue_View' );
1070
-		if ( $echo ) {
1071
-			echo EEH_Venue_View::venue_address( $type, $VNU_ID );
1068
+	function espresso_venue_address($type = 'multiline', $VNU_ID = 0, $echo = TRUE) {
1069
+		EE_Registry::instance()->load_helper('Venue_View');
1070
+		if ($echo) {
1071
+			echo EEH_Venue_View::venue_address($type, $VNU_ID);
1072 1072
 			return '';
1073 1073
 		}
1074
-		return EEH_Venue_View::venue_address( $type, $VNU_ID );
1074
+		return EEH_Venue_View::venue_address($type, $VNU_ID);
1075 1075
 	}
1076 1076
 }
1077 1077
 
1078 1078
 
1079
-if ( ! function_exists( 'espresso_venue_raw_address' )) {
1079
+if ( ! function_exists('espresso_venue_raw_address')) {
1080 1080
 	/**
1081 1081
 	 * espresso_venue_address
1082 1082
 	 * returns an UN-formatted string containing a venue's address
@@ -1086,18 +1086,18 @@  discard block
 block discarded – undo
1086 1086
 	 * @param bool     $echo
1087 1087
 	 * @return string
1088 1088
 	 */
1089
-	function espresso_venue_raw_address( $type = 'multiline', $VNU_ID = 0, $echo = TRUE ) {
1090
-		EE_Registry::instance()->load_helper( 'Venue_View' );
1091
-		if ( $echo ) {
1092
-			echo EEH_Venue_View::venue_address( $type, $VNU_ID, FALSE, FALSE );
1089
+	function espresso_venue_raw_address($type = 'multiline', $VNU_ID = 0, $echo = TRUE) {
1090
+		EE_Registry::instance()->load_helper('Venue_View');
1091
+		if ($echo) {
1092
+			echo EEH_Venue_View::venue_address($type, $VNU_ID, FALSE, FALSE);
1093 1093
 			return '';
1094 1094
 		}
1095
-		return EEH_Venue_View::venue_address( $type, $VNU_ID, FALSE, FALSE );
1095
+		return EEH_Venue_View::venue_address($type, $VNU_ID, FALSE, FALSE);
1096 1096
 	}
1097 1097
 }
1098 1098
 
1099 1099
 
1100
-if ( ! function_exists( 'espresso_venue_has_address' )) {
1100
+if ( ! function_exists('espresso_venue_has_address')) {
1101 1101
 	/**
1102 1102
 	 * espresso_venue_has_address
1103 1103
 	 * returns TRUE or FALSE if a Venue has address information
@@ -1105,14 +1105,14 @@  discard block
 block discarded – undo
1105 1105
 	 * @param int $VNU_ID
1106 1106
 	 * @return bool
1107 1107
 	 */
1108
-	function espresso_venue_has_address( $VNU_ID = 0 ) {
1109
-		EE_Registry::instance()->load_helper( 'Venue_View' );
1110
-		return EEH_Venue_View::venue_has_address( $VNU_ID );
1108
+	function espresso_venue_has_address($VNU_ID = 0) {
1109
+		EE_Registry::instance()->load_helper('Venue_View');
1110
+		return EEH_Venue_View::venue_has_address($VNU_ID);
1111 1111
 	}
1112 1112
 }
1113 1113
 
1114 1114
 
1115
-if ( ! function_exists( 'espresso_venue_gmap' )) {
1115
+if ( ! function_exists('espresso_venue_gmap')) {
1116 1116
 	/**
1117 1117
 	 * espresso_venue_gmap
1118 1118
 	 * returns a google map for the venue address
@@ -1123,18 +1123,18 @@  discard block
 block discarded – undo
1123 1123
 	 * @param bool     $echo
1124 1124
 	 * @return string
1125 1125
 	 */
1126
-	function espresso_venue_gmap( $VNU_ID = 0, $map_ID = FALSE, $gmap = array(), $echo = TRUE  ) {
1127
-		EE_Registry::instance()->load_helper( 'Venue_View' );
1128
-		if ( $echo ) {
1129
-			echo EEH_Venue_View::venue_gmap( $VNU_ID, $map_ID, $gmap );
1126
+	function espresso_venue_gmap($VNU_ID = 0, $map_ID = FALSE, $gmap = array(), $echo = TRUE) {
1127
+		EE_Registry::instance()->load_helper('Venue_View');
1128
+		if ($echo) {
1129
+			echo EEH_Venue_View::venue_gmap($VNU_ID, $map_ID, $gmap);
1130 1130
 			return '';
1131 1131
 		}
1132
-		return EEH_Venue_View::venue_gmap( $VNU_ID, $map_ID, $gmap );
1132
+		return EEH_Venue_View::venue_gmap($VNU_ID, $map_ID, $gmap);
1133 1133
 	}
1134 1134
 }
1135 1135
 
1136 1136
 
1137
-if ( ! function_exists( 'espresso_venue_phone' )) {
1137
+if ( ! function_exists('espresso_venue_phone')) {
1138 1138
 	/**
1139 1139
 	 * espresso_venue_phone
1140 1140
 	 *
@@ -1142,19 +1142,19 @@  discard block
 block discarded – undo
1142 1142
 	 * @param bool $echo
1143 1143
 	 * @return string
1144 1144
 	 */
1145
-	function espresso_venue_phone( $VNU_ID = 0, $echo = TRUE ) {
1146
-		EE_Registry::instance()->load_helper( 'Venue_View' );
1147
-		if ( $echo ) {
1148
-			echo EEH_Venue_View::venue_phone( $VNU_ID );
1145
+	function espresso_venue_phone($VNU_ID = 0, $echo = TRUE) {
1146
+		EE_Registry::instance()->load_helper('Venue_View');
1147
+		if ($echo) {
1148
+			echo EEH_Venue_View::venue_phone($VNU_ID);
1149 1149
 			return '';
1150 1150
 		}
1151
-		return EEH_Venue_View::venue_phone( $VNU_ID );
1151
+		return EEH_Venue_View::venue_phone($VNU_ID);
1152 1152
 	}
1153 1153
 }
1154 1154
 
1155 1155
 
1156 1156
 
1157
-if ( ! function_exists( 'espresso_venue_website' )) {
1157
+if ( ! function_exists('espresso_venue_website')) {
1158 1158
 	/**
1159 1159
 	 * espresso_venue_website
1160 1160
 	 *
@@ -1162,19 +1162,19 @@  discard block
 block discarded – undo
1162 1162
 	 * @param bool $echo
1163 1163
 	 * @return string
1164 1164
 	 */
1165
-	function espresso_venue_website( $VNU_ID = 0, $echo = TRUE ) {
1166
-		EE_Registry::instance()->load_helper( 'Venue_View' );
1167
-		if ( $echo ) {
1168
-			echo EEH_Venue_View::venue_website_link( $VNU_ID );
1165
+	function espresso_venue_website($VNU_ID = 0, $echo = TRUE) {
1166
+		EE_Registry::instance()->load_helper('Venue_View');
1167
+		if ($echo) {
1168
+			echo EEH_Venue_View::venue_website_link($VNU_ID);
1169 1169
 			return '';
1170 1170
 		}
1171
-		return EEH_Venue_View::venue_website_link( $VNU_ID );
1171
+		return EEH_Venue_View::venue_website_link($VNU_ID);
1172 1172
 	}
1173 1173
 }
1174 1174
 
1175 1175
 
1176 1176
 
1177
-if ( ! function_exists( 'espresso_edit_venue_link' )) {
1177
+if ( ! function_exists('espresso_edit_venue_link')) {
1178 1178
 	/**
1179 1179
 	 * espresso_edit_venue_link
1180 1180
 	 *
@@ -1182,13 +1182,13 @@  discard block
 block discarded – undo
1182 1182
 	 * @param bool $echo
1183 1183
 	 * @return string
1184 1184
 	 */
1185
-	function espresso_edit_venue_link( $VNU_ID = 0, $echo = TRUE ) {
1186
-		EE_Registry::instance()->load_helper( 'Venue_View' );
1187
-		if($echo){
1188
-			echo EEH_Venue_View::edit_venue_link( $VNU_ID );
1185
+	function espresso_edit_venue_link($VNU_ID = 0, $echo = TRUE) {
1186
+		EE_Registry::instance()->load_helper('Venue_View');
1187
+		if ($echo) {
1188
+			echo EEH_Venue_View::edit_venue_link($VNU_ID);
1189 1189
 			return '';
1190 1190
 		}
1191
-		return EEH_Venue_View::edit_venue_link( $VNU_ID );
1191
+		return EEH_Venue_View::edit_venue_link($VNU_ID);
1192 1192
 	}
1193 1193
 }
1194 1194
 
Please login to merge, or discard this patch.
modules/venues_archive/EED_Venues_Archive.module.php 1 patch
Spacing   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
 	 * @return EED_Venues_Archive
28 28
 	 */
29 29
 	public static function instance() {
30
-		return parent::get_instance( __CLASS__ );
30
+		return parent::get_instance(__CLASS__);
31 31
 	}
32 32
 
33 33
 	/**
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
 	 *  @return 	void
38 38
 	 */
39 39
 	public static function set_hooks() {
40
-		EE_Config::register_route( 'venues', 'Venues_Archive', 'run' );
40
+		EE_Config::register_route('venues', 'Venues_Archive', 'run');
41 41
 //		EE_Config::register_view( 'venues', 0, EE_TEMPLATES . EE_Config::get_current_theme() . DS . 'archive-espresso_venues.php' );
42 42
 	}
43 43
 
@@ -58,10 +58,10 @@  discard block
 block discarded – undo
58 58
 	 * @access    public
59 59
 	 * @param \WP $WP
60 60
 	 */
61
-	public function run( $WP ) {
61
+	public function run($WP) {
62 62
 		// check what template is loaded
63
-		add_filter( 'template_include',  array( $this, 'template_include' ), 999, 1 );
64
-		add_action('wp_enqueue_scripts', array( $this, 'wp_enqueue_scripts' ), 10 );
63
+		add_filter('template_include', array($this, 'template_include'), 999, 1);
64
+		add_action('wp_enqueue_scripts', array($this, 'wp_enqueue_scripts'), 10);
65 65
 	}
66 66
 
67 67
 
@@ -73,18 +73,18 @@  discard block
 block discarded – undo
73 73
 	 * @param  string $template
74 74
 	 * @return string
75 75
 	 */
76
-	public function template_include( $template ) {
76
+	public function template_include($template) {
77 77
 		// not a custom template?
78
-		if ( EE_Front_Controller::instance()->get_selected_template() != 'archive-espresso_venues.php' ) {
78
+		if (EE_Front_Controller::instance()->get_selected_template() != 'archive-espresso_venues.php') {
79 79
 			EEH_Template::load_espresso_theme_functions();
80 80
 			// then add extra event data via hooks
81
-			add_filter( 'the_title', array( $this, 'the_title' ), 100, 1 );
81
+			add_filter('the_title', array($this, 'the_title'), 100, 1);
82 82
 			// don't know if theme uses the_excerpt
83
-			add_filter( 'the_excerpt', array( $this, 'venue_details' ), 100 );
83
+			add_filter('the_excerpt', array($this, 'venue_details'), 100);
84 84
 			// or the_content
85
-			add_filter( 'the_content', array( $this, 'venue_details' ), 100 );
85
+			add_filter('the_content', array($this, 'venue_details'), 100);
86 86
 			// don't display entry meta because the existing theme will take care of that
87
-			add_filter( 'FHEE__content_espresso_venues_details_template__display_entry_meta', '__return_false' );
87
+			add_filter('FHEE__content_espresso_venues_details_template__display_entry_meta', '__return_false');
88 88
 		}
89 89
 		return $template;
90 90
 	}
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
 	 * @param  string $title
99 99
 	 * @return string
100 100
 	 */
101
-	public function the_title( $title = '' ) {
101
+	public function the_title($title = '') {
102 102
 		return $title;
103 103
 	}
104 104
 
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
 	 * @param  string $content
111 111
 	 * @return string
112 112
 	 */
113
-	public function venue_details( $content ) {
113
+	public function venue_details($content) {
114 114
 		global $post;
115 115
 		if (
116 116
 			$post->post_type == 'espresso_venues'
@@ -120,22 +120,22 @@  discard block
 block discarded – undo
120 120
 			// it uses the_content() for displaying the $post->post_content
121 121
 			// so in order to load a template that uses the_content() from within a callback being used to filter the_content(),
122 122
 			// we need to first remove this callback from being applied to the_content() (otherwise it will recurse and blow up the interweb)
123
-			remove_filter( 'the_excerpt', array( $this, 'venue_details' ), 100 );
124
-			remove_filter( 'the_content', array( $this, 'venue_details' ), 100 );
123
+			remove_filter('the_excerpt', array($this, 'venue_details'), 100);
124
+			remove_filter('the_content', array($this, 'venue_details'), 100);
125 125
 			// add filters we want
126
-			add_filter( 'the_content', array( $this, 'venue_location' ), 110 );
127
-			add_filter( 'the_excerpt', array( $this, 'venue_location' ), 110 );
126
+			add_filter('the_content', array($this, 'venue_location'), 110);
127
+			add_filter('the_excerpt', array($this, 'venue_location'), 110);
128 128
 			// now load our template
129
-			$template = EEH_Template::locate_template( 'content-espresso_venues-details.php' );
129
+			$template = EEH_Template::locate_template('content-espresso_venues-details.php');
130 130
 			//now add our filter back in, plus some others
131
-			add_filter( 'the_excerpt', array( $this, 'venue_details' ), 100 );
132
-			add_filter( 'the_content', array( $this, 'venue_details' ), 100 );
131
+			add_filter('the_excerpt', array($this, 'venue_details'), 100);
132
+			add_filter('the_content', array($this, 'venue_details'), 100);
133 133
 			// remove other filters we added so they won't get applied to the next post
134
-			remove_filter( 'the_content', array( $this, 'venue_location' ), 110 );
135
-			remove_filter( 'the_excerpt', array( $this, 'venue_location' ), 110 );
134
+			remove_filter('the_content', array($this, 'venue_location'), 110);
135
+			remove_filter('the_excerpt', array($this, 'venue_location'), 110);
136 136
 			// we're not returning the $content directly because the template we are loading uses the_content (or the_excerpt)
137 137
 		}
138
-		return ! empty( $template ) ? $template : $content;
138
+		return ! empty($template) ? $template : $content;
139 139
 	}
140 140
 
141 141
 
@@ -147,8 +147,8 @@  discard block
 block discarded – undo
147 147
 	 * @param  string $content
148 148
 	 * @return string
149 149
 	 */
150
-	public function venue_location( $content ) {
151
-		return $content . EEH_Template::locate_template( 'content-espresso_venues-location.php' );
150
+	public function venue_location($content) {
151
+		return $content.EEH_Template::locate_template('content-espresso_venues-location.php');
152 152
 	}
153 153
 
154 154
 
@@ -162,14 +162,14 @@  discard block
 block discarded – undo
162 162
 	 */
163 163
 	public function wp_enqueue_scripts() {
164 164
 		// get some style
165
-		if ( apply_filters( 'FHEE_enable_default_espresso_css', TRUE ) && is_archive() ) {
165
+		if (apply_filters('FHEE_enable_default_espresso_css', TRUE) && is_archive()) {
166 166
 			// first check theme folder
167
-			if ( is_readable( get_stylesheet_directory() . $this->theme . DS . 'style.css' )) {
168
-				wp_register_style( $this->theme, get_stylesheet_directory_uri() . $this->theme . DS . 'style.css', array( 'dashicons', 'espresso_default' ) );
169
-			} else if ( is_readable( EE_TEMPLATES . $this->theme . DS . 'style.css' )) {
170
-				wp_register_style( $this->theme, EE_TEMPLATES_URL . $this->theme . DS . 'style.css', array( 'dashicons', 'espresso_default' ) );
167
+			if (is_readable(get_stylesheet_directory().$this->theme.DS.'style.css')) {
168
+				wp_register_style($this->theme, get_stylesheet_directory_uri().$this->theme.DS.'style.css', array('dashicons', 'espresso_default'));
169
+			} else if (is_readable(EE_TEMPLATES.$this->theme.DS.'style.css')) {
170
+				wp_register_style($this->theme, EE_TEMPLATES_URL.$this->theme.DS.'style.css', array('dashicons', 'espresso_default'));
171 171
 			}
172
-			wp_enqueue_style( $this->theme );
172
+			wp_enqueue_style($this->theme);
173 173
 		}
174 174
 	}
175 175
 
Please login to merge, or discard this patch.
modules/venue_single/EED_Venue_Single.module.php 1 patch
Spacing   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
 	 * @return EED_Venue_Single
28 28
 	 */
29 29
 	public static function instance() {
30
-		return parent::get_instance( __CLASS__ );
30
+		return parent::get_instance(__CLASS__);
31 31
 	}
32 32
 
33 33
 	/**
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
 	 *  @return 	void
38 38
 	 */
39 39
 	public static function set_hooks() {
40
-		EE_Config::register_route( 'venue', 'Venue_Single', 'run' );
40
+		EE_Config::register_route('venue', 'Venue_Single', 'run');
41 41
 //		EE_Config::register_view( 'venue', 0, EE_TEMPLATES . EE_Config::get_current_theme() . DS . 'single-espresso_venues.php' );
42 42
 	}
43 43
 
@@ -58,10 +58,10 @@  discard block
 block discarded – undo
58 58
 	 * @access    public
59 59
 	 * @param \WP $WP
60 60
 	 */
61
-	public function run( $WP ) {
61
+	public function run($WP) {
62 62
 		// check what template is loaded
63
-		add_filter( 'template_include',  array( $this, 'template_include' ), 999, 1 );
64
-		add_action('wp_enqueue_scripts', array( $this, 'wp_enqueue_scripts' ), 10 );
63
+		add_filter('template_include', array($this, 'template_include'), 999, 1);
64
+		add_action('wp_enqueue_scripts', array($this, 'wp_enqueue_scripts'), 10);
65 65
 	}
66 66
 
67 67
 
@@ -73,15 +73,15 @@  discard block
 block discarded – undo
73 73
 	 * @param  string $template
74 74
 	 * @return string
75 75
 	 */
76
-	public function template_include( $template ) {
76
+	public function template_include($template) {
77 77
 		// not a custom template?
78
-		if ( EE_Front_Controller::instance()->get_selected_template() != 'single-espresso_venues.php' ) {
78
+		if (EE_Front_Controller::instance()->get_selected_template() != 'single-espresso_venues.php') {
79 79
 			EEH_Template::load_espresso_theme_functions();
80 80
 			// then add extra event data via hooks
81
-			add_filter( 'the_title', array( $this, 'the_title' ), 100, 1 );
82
-			add_filter( 'the_content', array( $this, 'venue_details' ), 100 );
81
+			add_filter('the_title', array($this, 'the_title'), 100, 1);
82
+			add_filter('the_content', array($this, 'venue_details'), 100);
83 83
 			// don't display entry meta because the existing theme will take car of that
84
-			add_filter( 'FHEE__content_espresso_venues_details_template__display_entry_meta', '__return_false' );
84
+			add_filter('FHEE__content_espresso_venues_details_template__display_entry_meta', '__return_false');
85 85
 		}
86 86
 		return $template;
87 87
 	}
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
 	 * @param  string $title
96 96
 	 * @return string
97 97
 	 */
98
-	public function the_title( $title = '' ) {
98
+	public function the_title($title = '') {
99 99
 		return $title;
100 100
 	}
101 101
 
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
 	 * @param  string $content
108 108
 	 * @return string
109 109
 	 */
110
-	public function venue_details( $content ) {
110
+	public function venue_details($content) {
111 111
 		global $post;
112 112
 		if (
113 113
 			$post->post_type == 'espresso_venues'
@@ -117,16 +117,16 @@  discard block
 block discarded – undo
117 117
 			// it uses the_content() for displaying the $post->post_content
118 118
 			// so in order to load a template that uses the_content() from within a callback being used to filter the_content(),
119 119
 			// we need to first remove this callback from being applied to the_content() (otherwise it will recurse and blow up the interweb)
120
-			remove_filter( 'the_content', array( $this, 'venue_details' ), 100 );
120
+			remove_filter('the_content', array($this, 'venue_details'), 100);
121 121
 			// add filters we want
122
-			add_filter( 'the_content', array( $this, 'venue_location' ), 110 );
122
+			add_filter('the_content', array($this, 'venue_location'), 110);
123 123
 			// now load our template
124
-			$template = EEH_Template::locate_template( 'content-espresso_venues-details.php' );
124
+			$template = EEH_Template::locate_template('content-espresso_venues-details.php');
125 125
 			// remove other filters we added so they won't get applied to the next post
126
-			remove_filter( 'the_content', array( $this, 'venue_location' ), 110 );
126
+			remove_filter('the_content', array($this, 'venue_location'), 110);
127 127
 		}
128 128
 		// we're not returning the $content directly because the template we are loading uses the_content (or the_excerpt)
129
-		return ! empty( $template ) ? $template : $content;
129
+		return ! empty($template) ? $template : $content;
130 130
 	}
131 131
 
132 132
 
@@ -138,8 +138,8 @@  discard block
 block discarded – undo
138 138
 	 * @param  string $content
139 139
 	 * @return string
140 140
 	 */
141
-	public function venue_location( $content ) {
142
-		return $content . EEH_Template::locate_template( 'content-espresso_venues-location.php' );
141
+	public function venue_location($content) {
142
+		return $content.EEH_Template::locate_template('content-espresso_venues-location.php');
143 143
 	}
144 144
 
145 145
 
@@ -152,17 +152,17 @@  discard block
 block discarded – undo
152 152
 	 */
153 153
 	public function wp_enqueue_scripts() {
154 154
 		// get some style
155
-		if ( apply_filters( 'FHEE_enable_default_espresso_css', TRUE ) && is_single() ) {
155
+		if (apply_filters('FHEE_enable_default_espresso_css', TRUE) && is_single()) {
156 156
 			// first check theme folder
157
-			if ( is_readable( get_stylesheet_directory() . $this->theme . DS . 'style.css' )) {
158
-				wp_register_style( $this->theme, get_stylesheet_directory_uri() . $this->theme . DS . 'style.css', array( 'dashicons', 'espresso_default' ) );
159
-			} else if ( is_readable( EE_TEMPLATES . $this->theme . DS . 'style.css' )) {
160
-				wp_register_style( $this->theme, EE_TEMPLATES_URL . $this->theme . DS . 'style.css', array( 'dashicons', 'espresso_default' ) );
157
+			if (is_readable(get_stylesheet_directory().$this->theme.DS.'style.css')) {
158
+				wp_register_style($this->theme, get_stylesheet_directory_uri().$this->theme.DS.'style.css', array('dashicons', 'espresso_default'));
159
+			} else if (is_readable(EE_TEMPLATES.$this->theme.DS.'style.css')) {
160
+				wp_register_style($this->theme, EE_TEMPLATES_URL.$this->theme.DS.'style.css', array('dashicons', 'espresso_default'));
161 161
 			}
162
-			wp_enqueue_style( $this->theme );
163
-			if ( EE_Registry::instance()->CFG->map_settings->use_google_maps ) {
164
-				EE_Registry::instance()->load_helper( 'Maps' );
165
-				add_action('wp_enqueue_scripts', array( 'EEH_Maps', 'espresso_google_map_js' ), 11 );
162
+			wp_enqueue_style($this->theme);
163
+			if (EE_Registry::instance()->CFG->map_settings->use_google_maps) {
164
+				EE_Registry::instance()->load_helper('Maps');
165
+				add_action('wp_enqueue_scripts', array('EEH_Maps', 'espresso_google_map_js'), 11);
166 166
 			}
167 167
 		}
168 168
 	}
Please login to merge, or discard this patch.
core/helpers/EEH_Venue_View.helper.php 2 patches
Spacing   +117 added lines, -117 removed lines patch added patch discarded remove patch
@@ -45,16 +45,16 @@  discard block
 block discarded – undo
45 45
 	 * @param bool $password_check
46 46
 	 * @return \EE_Venue|null
47 47
 	 */
48
-	public static function get_venue( $VNU_ID = 0, $look_in_event = TRUE, $privacy_check = true, $password_check = true ) {
49
-		$VNU_ID = absint( $VNU_ID );
48
+	public static function get_venue($VNU_ID = 0, $look_in_event = TRUE, $privacy_check = true, $password_check = true) {
49
+		$VNU_ID = absint($VNU_ID);
50 50
 		// do we already have the Venue you are looking for?
51
-		if ( EEH_Venue_View::$_venue instanceof EE_Venue && EEH_Venue_View::$_venue->ID() == $VNU_ID ) {
52
-			return EEH_Venue_View::_get_venue( $privacy_check );
51
+		if (EEH_Venue_View::$_venue instanceof EE_Venue && EEH_Venue_View::$_venue->ID() == $VNU_ID) {
52
+			return EEH_Venue_View::_get_venue($privacy_check);
53 53
 		}
54 54
 		// international newspaper?
55 55
 		global $post;
56
-		if ( $post instanceof WP_Post ) {
57
-			switch ( $post->post_type ) {
56
+		if ($post instanceof WP_Post) {
57
+			switch ($post->post_type) {
58 58
 				// if this is being called from an EE_Venue post,
59 59
 				// and the EE_Venue post corresponds to the EE_Venue that is being asked for,
60 60
 				// then we can try to just grab the attached EE_Venue object
@@ -62,31 +62,31 @@  discard block
 block discarded – undo
62 62
 					// the post already contains the related EE_Venue object AND one of the following is TRUE:
63 63
 					// the requested Venue ID matches the post ID OR...
64 64
 					// there was no specific Venue ID requested
65
-					if ( isset( $post->EE_Venue ) && ( $VNU_ID == $post->ID || ! $VNU_ID )) {
65
+					if (isset($post->EE_Venue) && ($VNU_ID == $post->ID || ! $VNU_ID)) {
66 66
 						// use existing related EE_Venue object
67
-						EEH_Venue_View::$_venue =  $post->EE_Venue;
68
-					} else if ( $VNU_ID ) {
67
+						EEH_Venue_View::$_venue = $post->EE_Venue;
68
+					} else if ($VNU_ID) {
69 69
 						// there WAS a specific Venue ID requested, but it's NOT the current post object
70
-						EEH_Venue_View::$_venue = EEM_Venue::instance()->get_one_by_ID( $VNU_ID );
70
+						EEH_Venue_View::$_venue = EEM_Venue::instance()->get_one_by_ID($VNU_ID);
71 71
 					} else {
72 72
 						// no specific Venue ID requested, so use post ID to generate EE_Venue object
73
-						EEH_Venue_View::$_venue = EEM_Venue::instance()->get_one_by_ID( $post->ID );
73
+						EEH_Venue_View::$_venue = EEM_Venue::instance()->get_one_by_ID($post->ID);
74 74
 					}
75 75
 				break;
76 76
 
77 77
 				case 'espresso_events':
78
-					if ( $look_in_event ) {
78
+					if ($look_in_event) {
79 79
 						// grab the events related venues
80 80
 						$venues = EEH_Venue_View::get_event_venues();
81 81
 						// make sure the result is an array
82
-						$venues = is_array( $venues ) ? $venues : array();
82
+						$venues = is_array($venues) ? $venues : array();
83 83
 						// do we have an ID for a specific venue?
84
-						if ( $VNU_ID ) {
84
+						if ($VNU_ID) {
85 85
 							// loop thru the related venues
86
-							foreach( $venues as $venue ) {
87
-								if ( $venue instanceof EE_Venue ) {
86
+							foreach ($venues as $venue) {
87
+								if ($venue instanceof EE_Venue) {
88 88
 									// until we find the venue we're looking for
89
-									if ( $venue->ID() == $VNU_ID ) {
89
+									if ($venue->ID() == $VNU_ID) {
90 90
 										EEH_Venue_View::$_venue = $venue;
91 91
 										break;
92 92
 									}
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
 							// then the global post is an events post and this function was called with no argument
99 99
 						} else {
100 100
 							// just grab the first related event venue
101
-							EEH_Venue_View::$_venue = reset( $venues );
101
+							EEH_Venue_View::$_venue = reset($venues);
102 102
 						}
103 103
 					}
104 104
 				break;
@@ -106,11 +106,11 @@  discard block
 block discarded – undo
106 106
 			}
107 107
 		}
108 108
 		// now if we STILL do NOT have an EE_Venue model object, BUT we have a Venue ID...
109
-		if ( ! EEH_Venue_View::$_venue instanceof EE_Venue && $VNU_ID ) {
109
+		if ( ! EEH_Venue_View::$_venue instanceof EE_Venue && $VNU_ID) {
110 110
 			// sigh... pull it from the db
111
-			EEH_Venue_View::$_venue = EEM_Venue::instance()->get_one_by_ID( $VNU_ID );
111
+			EEH_Venue_View::$_venue = EEM_Venue::instance()->get_one_by_ID($VNU_ID);
112 112
 		}
113
-		return EEH_Venue_View::_get_venue( $privacy_check, $password_check );
113
+		return EEH_Venue_View::_get_venue($privacy_check, $password_check);
114 114
 	}
115 115
 
116 116
 
@@ -123,13 +123,13 @@  discard block
 block discarded – undo
123 123
 	 * @param bool $password_check
124 124
 	 * @return 	EE_Venue
125 125
 	 */
126
-	protected static function _get_venue( $privacy_check = true, $password_check = true ) {
126
+	protected static function _get_venue($privacy_check = true, $password_check = true) {
127 127
 		// check for private venues.
128 128
 		if (
129 129
 			EEH_Venue_View::$_venue instanceof EE_Venue
130 130
 			&& EEH_Venue_View::$_venue->status() == 'private'
131 131
 			&& $privacy_check
132
-			&& ! EE_Registry::instance()->CAP->current_user_can( 'ee_read_private_venues', 'get_venues' )
132
+			&& ! EE_Registry::instance()->CAP->current_user_can('ee_read_private_venues', 'get_venues')
133 133
 		) {
134 134
 			return null;
135 135
 		}
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
 		if (
138 138
 			EEH_Venue_View::$_venue instanceof EE_Venue
139 139
 			&& $password_check
140
-			&& post_password_required( EEH_Venue_View::$_venue->ID() )
140
+			&& post_password_required(EEH_Venue_View::$_venue->ID())
141 141
 		) {
142 142
 			return null;
143 143
 		}
@@ -154,8 +154,8 @@  discard block
 block discarded – undo
154 154
 	 */
155 155
 	public static function get_event_venues() {
156 156
 		global $post;
157
-		if ( $post->post_type == 'espresso_events' ) {
158
-			if ( isset( $post->EE_Event ) && $post->EE_Event instanceof EE_Event ) {
157
+		if ($post->post_type == 'espresso_events') {
158
+			if (isset($post->EE_Event) && $post->EE_Event instanceof EE_Event) {
159 159
 				return $post->EE_Event->venues();
160 160
 			}
161 161
 		}
@@ -175,9 +175,9 @@  discard block
 block discarded – undo
175 175
 	 *
176 176
 	 * @return bool|null
177 177
 	 */
178
-	public static function is_venue_private( $VNU_ID = false ) {
179
-		$venue = EEH_Venue_View::get_venue( $VNU_ID, true, true );
180
-		if ( ! $venue instanceof EE_Venue ) {
178
+	public static function is_venue_private($VNU_ID = false) {
179
+		$venue = EEH_Venue_View::get_venue($VNU_ID, true, true);
180
+		if ( ! $venue instanceof EE_Venue) {
181 181
 			return null;
182 182
 		}
183 183
 
@@ -192,11 +192,11 @@  discard block
 block discarded – undo
192 192
 	 * @param bool $VNU_ID venue to check (optional). If not included will use internally derived venue object.
193 193
 	 * @return bool
194 194
 	 */
195
-	public static function is_venue_password_protected( $VNU_ID = false ) {
196
-		$venue = EEH_Venue_View::get_venue( $VNU_ID, true, true, false );
195
+	public static function is_venue_password_protected($VNU_ID = false) {
196
+		$venue = EEH_Venue_View::get_venue($VNU_ID, true, true, false);
197 197
 		if (
198 198
 			$venue instanceof EE_Venue
199
-			&& post_password_required( $venue->ID() )
199
+			&& post_password_required($venue->ID())
200 200
 		) {
201 201
 			return true;
202 202
 		}
@@ -213,13 +213,13 @@  discard block
 block discarded – undo
213 213
 	 *
214 214
 	 * @return string
215 215
 	 */
216
-	public static function password_protected_venue_form( $VNU_ID = false ) {
217
-		$venue = EEH_Venue_View::get_venue( $VNU_ID, true, true, false );
216
+	public static function password_protected_venue_form($VNU_ID = false) {
217
+		$venue = EEH_Venue_View::get_venue($VNU_ID, true, true, false);
218 218
 		if (
219 219
 			$venue instanceof EE_Venue
220
-			&& post_password_required( $venue->ID() )
220
+			&& post_password_required($venue->ID())
221 221
 		) {
222
-			return get_the_password_form( $venue->ID() );
222
+			return get_the_password_form($venue->ID());
223 223
 		}
224 224
 		return '';
225 225
 	}
@@ -233,9 +233,9 @@  discard block
 block discarded – undo
233 233
 	 * @param int $VNU_ID
234 234
 	 * @return string
235 235
 	 */
236
-	public static function venue_description( $VNU_ID = 0 ) {
237
-		$venue = EEH_Venue_View::get_venue( $VNU_ID );
238
-		if ( $venue instanceof EE_Venue ) {
236
+	public static function venue_description($VNU_ID = 0) {
237
+		$venue = EEH_Venue_View::get_venue($VNU_ID);
238
+		if ($venue instanceof EE_Venue) {
239 239
 			return$venue->description();
240 240
 		}
241 241
 		return '';
@@ -250,12 +250,12 @@  discard block
 block discarded – undo
250 250
 	 * @param int $VNU_ID
251 251
 	 * @return string
252 252
 	 */
253
-	public static function venue_excerpt( $VNU_ID = 0 ) {
254
-		$venue = EEH_Venue_View::get_venue( $VNU_ID );
255
-		if ( $venue instanceof EE_Venue ) {
253
+	public static function venue_excerpt($VNU_ID = 0) {
254
+		$venue = EEH_Venue_View::get_venue($VNU_ID);
255
+		if ($venue instanceof EE_Venue) {
256 256
 			$excerpt = $venue->excerpt() != NULL && $venue->excerpt() ? $venue->excerpt() : $venue->description();
257
-			$venue_link = ' ' . EEH_Venue_View::venue_details_link( $venue->ID(), __( 'more', 'event_espresso' ) . '&hellip;' );
258
-			return ! empty( $excerpt ) ? wp_trim_words( $excerpt, 25, '' ) . $venue_link : '';
257
+			$venue_link = ' '.EEH_Venue_View::venue_details_link($venue->ID(), __('more', 'event_espresso').'&hellip;');
258
+			return ! empty($excerpt) ? wp_trim_words($excerpt, 25, '').$venue_link : '';
259 259
 		}
260 260
 		return '';
261 261
 	}
@@ -270,22 +270,22 @@  discard block
 block discarded – undo
270 270
 	 * @param bool $hide_uncategorized
271 271
 	 * @return string
272 272
 	 */
273
-	public static function venue_categories( $VNU_ID = 0, $hide_uncategorized = TRUE ) {
273
+	public static function venue_categories($VNU_ID = 0, $hide_uncategorized = TRUE) {
274 274
 		$category_links = array();
275
-		$venue = EEH_Venue_View::get_venue( $VNU_ID );
276
-		if ( $venue instanceof EE_Venue ) {
275
+		$venue = EEH_Venue_View::get_venue($VNU_ID);
276
+		if ($venue instanceof EE_Venue) {
277 277
 			// get category terms
278
-			if ( $venue_categories = get_the_terms( $venue->ID(), 'espresso_venue_categories' )) {
278
+			if ($venue_categories = get_the_terms($venue->ID(), 'espresso_venue_categories')) {
279 279
 				// loop thru terms and create links
280
-				foreach ( $venue_categories as $term ) {
281
-					$url = get_term_link( $term, 'espresso_venue_categories' );
282
-					if ( ! is_wp_error( $url ) && (( $hide_uncategorized && strtolower( $term->name ) != __( 'uncategorized', 'event_espresso' )) || ! $hide_uncategorized )) {
283
-						$category_links[] = '<a href="' . esc_url( $url ) . '" rel="tag">' . $term->name . '</a> ';
280
+				foreach ($venue_categories as $term) {
281
+					$url = get_term_link($term, 'espresso_venue_categories');
282
+					if ( ! is_wp_error($url) && (($hide_uncategorized && strtolower($term->name) != __('uncategorized', 'event_espresso')) || ! $hide_uncategorized)) {
283
+						$category_links[] = '<a href="'.esc_url($url).'" rel="tag">'.$term->name.'</a> ';
284 284
 					}
285 285
 				}
286 286
 			}
287 287
 		}
288
-		return implode( ', ', $category_links );
288
+		return implode(', ', $category_links);
289 289
 	}
290 290
 
291 291
 
@@ -300,11 +300,11 @@  discard block
 block discarded – undo
300 300
 	 * @param bool $add_wrapper
301 301
 	 * @return string
302 302
 	 */
303
-	public static function venue_address( $type = 'multiline', $VNU_ID = 0, $use_schema = true, $add_wrapper = true ) {
304
-		$venue = EEH_Venue_View::get_venue( $VNU_ID );
305
-		if ( $venue instanceof EE_Venue ) {
306
-			EE_Registry::instance()->load_helper( 'Formatter' );
307
-			return EEH_Address::format( $venue, $type, $use_schema, $add_wrapper );
303
+	public static function venue_address($type = 'multiline', $VNU_ID = 0, $use_schema = true, $add_wrapper = true) {
304
+		$venue = EEH_Venue_View::get_venue($VNU_ID);
305
+		if ($venue instanceof EE_Venue) {
306
+			EE_Registry::instance()->load_helper('Formatter');
307
+			return EEH_Address::format($venue, $type, $use_schema, $add_wrapper);
308 308
 		}
309 309
 		return '';
310 310
 	}
@@ -318,11 +318,11 @@  discard block
 block discarded – undo
318 318
 	 * @param int $VNU_ID
319 319
 	 * @return bool|string
320 320
 	 */
321
-	public static function venue_has_address( $VNU_ID = 0 ) {
322
-		$venue = EEH_Venue_View::get_venue( $VNU_ID );
323
-		if ( $venue instanceof EE_Venue ) {
324
-			EE_Registry::instance()->load_helper( 'Formatter' );
325
-			return EEH_Address::format( $venue, 'inline', FALSE, FALSE );
321
+	public static function venue_has_address($VNU_ID = 0) {
322
+		$venue = EEH_Venue_View::get_venue($VNU_ID);
323
+		if ($venue instanceof EE_Venue) {
324
+			EE_Registry::instance()->load_helper('Formatter');
325
+			return EEH_Address::format($venue, 'inline', FALSE, FALSE);
326 326
 		}
327 327
 		return false;
328 328
 	}
@@ -337,31 +337,31 @@  discard block
 block discarded – undo
337 337
 	 * @param int $VNU_ID
338 338
 	 * @return string
339 339
 	 */
340
-	public static function venue_name( $link_to = 'details', $VNU_ID = 0 ) {
341
-		$venue = EEH_Venue_View::get_venue( $VNU_ID );
342
-		if ( $venue instanceof EE_Venue ) {
343
-			EE_Registry::instance()->load_helper( 'Formatter' );
340
+	public static function venue_name($link_to = 'details', $VNU_ID = 0) {
341
+		$venue = EEH_Venue_View::get_venue($VNU_ID);
342
+		if ($venue instanceof EE_Venue) {
343
+			EE_Registry::instance()->load_helper('Formatter');
344 344
 			$venue_name = apply_filters(
345 345
 				'FHEE__EEH_Venue__venue_name__append_private_venue_name',
346 346
 				EEH_Venue_View::is_venue_private()
347
-					? EEH_Venue_View::$_venue->name() . "&nbsp;" . __( '(Private)', 'event_espresso' )
347
+					? EEH_Venue_View::$_venue->name()."&nbsp;".__('(Private)', 'event_espresso')
348 348
 					: EEH_Venue_View::$_venue->name(),
349 349
 				EEH_Venue_View::$_venue
350 350
 			);
351
-			$venue_name = EEH_Schema::name( $venue_name );
351
+			$venue_name = EEH_Schema::name($venue_name);
352 352
 
353 353
 			//if venue is trashed then ignore the "link to" setting because the venue is trashed.
354
-			if ( $venue->get('status') == 'trash' ) {
354
+			if ($venue->get('status') == 'trash') {
355 355
 				$link_to = '';
356 356
 			}
357
-			switch( $link_to ) {
357
+			switch ($link_to) {
358 358
 
359 359
 				case 'details' :
360
-					return EEH_Venue_View::venue_details_link( $venue->ID(), $venue_name );
360
+					return EEH_Venue_View::venue_details_link($venue->ID(), $venue_name);
361 361
 				break;
362 362
 
363 363
 				case 'website' :
364
-					return EEH_Venue_View::venue_website_link( $venue->ID(), $venue_name );
364
+					return EEH_Venue_View::venue_website_link($venue->ID(), $venue_name);
365 365
 				break;
366 366
 
367 367
 				default :
@@ -381,10 +381,10 @@  discard block
 block discarded – undo
381 381
 	 * @param    string $text
382 382
 	 * @return string
383 383
 	 */
384
-	public static function venue_details_link( $VNU_ID = 0, $text = '' ) {
385
-		$venue = EEH_Venue_View::get_venue( $VNU_ID );
386
-		if ( $venue instanceof EE_Venue ) {
387
-			return EEH_Schema::url( get_permalink( $venue->ID() ), $text );
384
+	public static function venue_details_link($VNU_ID = 0, $text = '') {
385
+		$venue = EEH_Venue_View::get_venue($VNU_ID);
386
+		if ($venue instanceof EE_Venue) {
387
+			return EEH_Schema::url(get_permalink($venue->ID()), $text);
388 388
 		}
389 389
 		return '';
390 390
 	}
@@ -399,13 +399,13 @@  discard block
 block discarded – undo
399 399
 	 * @param    string $text
400 400
 	 * @return string
401 401
 	 */
402
-	public static function venue_website_link( $VNU_ID = 0, $text = '' ) {
403
-		$venue = EEH_Venue_View::get_venue( $VNU_ID );
404
-		if ( $venue instanceof EE_Venue ) {
405
-			EE_Registry::instance()->load_helper( 'Formatter' );
402
+	public static function venue_website_link($VNU_ID = 0, $text = '') {
403
+		$venue = EEH_Venue_View::get_venue($VNU_ID);
404
+		if ($venue instanceof EE_Venue) {
405
+			EE_Registry::instance()->load_helper('Formatter');
406 406
 			$url = $venue->venue_url();
407
-			$text = ! empty( $text ) ? $text : $url;
408
-			return ! empty( $url ) ? EEH_Schema::url( $url, $text ) : '';
407
+			$text = ! empty($text) ? $text : $url;
408
+			return ! empty($url) ? EEH_Schema::url($url, $text) : '';
409 409
 		}
410 410
 		return '';
411 411
 	}
@@ -419,11 +419,11 @@  discard block
 block discarded – undo
419 419
 	 * @param int $VNU_ID
420 420
 	 * @return string
421 421
 	 */
422
-	public static function venue_phone( $VNU_ID = 0) {
423
-		$venue = EEH_Venue_View::get_venue( $VNU_ID );
424
-		if ( $venue instanceof EE_Venue ) {
425
-			EE_Registry::instance()->load_helper( 'Formatter' );
426
-			return EEH_Schema::telephone( $venue->phone() );
422
+	public static function venue_phone($VNU_ID = 0) {
423
+		$venue = EEH_Venue_View::get_venue($VNU_ID);
424
+		if ($venue instanceof EE_Venue) {
425
+			EE_Registry::instance()->load_helper('Formatter');
426
+			return EEH_Schema::telephone($venue->phone());
427 427
 		}
428 428
 		return '';
429 429
 	}
@@ -439,51 +439,51 @@  discard block
 block discarded – undo
439 439
 	 * @param    array $gmap map options
440 440
 	 * @return string
441 441
 	 */
442
-	public static function venue_gmap( $VNU_ID = 0, $map_ID = FALSE, $gmap = array() ) {
442
+	public static function venue_gmap($VNU_ID = 0, $map_ID = FALSE, $gmap = array()) {
443 443
 
444
-		$venue = EEH_Venue_View::get_venue( $VNU_ID );
445
-		if ( $venue instanceof EE_Venue ) {
444
+		$venue = EEH_Venue_View::get_venue($VNU_ID);
445
+		if ($venue instanceof EE_Venue) {
446 446
 			// check for global espresso_events post and use it's ID if no map_ID is set
447 447
 			global $post;
448
-			$map_ID = empty( $map_ID ) && $post->post_type == 'espresso_events' ? $post->ID : $map_ID;
448
+			$map_ID = empty($map_ID) && $post->post_type == 'espresso_events' ? $post->ID : $map_ID;
449 449
 			// grab map settings
450 450
 			$map_cfg = EE_Registry::instance()->CFG->map_settings;
451 451
 			// are maps enabled ?
452
-			if ( $map_cfg->use_google_maps && $venue->enable_for_gmap() ) {
452
+			if ($map_cfg->use_google_maps && $venue->enable_for_gmap()) {
453 453
 
454
-				EE_Registry::instance()->load_helper( 'Maps' );
455
-				EE_Registry::instance()->load_helper( 'Formatter' );
454
+				EE_Registry::instance()->load_helper('Maps');
455
+				EE_Registry::instance()->load_helper('Formatter');
456 456
 
457 457
 				$details_page = is_single();
458 458
 				$options = array();
459
-				$options['map_ID'] = $map_ID && $map_ID != $venue->ID() ? $map_ID . '-' . $venue->ID()/* . '-' . $static_map_id*/ : $venue->ID()/* . '-' . $static_map_id*/;
459
+				$options['map_ID'] = $map_ID && $map_ID != $venue->ID() ? $map_ID.'-'.$venue->ID()/* . '-' . $static_map_id*/ : $venue->ID()/* . '-' . $static_map_id*/;
460 460
 
461
-				$options['location'] = EEH_Address::format( $venue, 'inline', FALSE, FALSE );
461
+				$options['location'] = EEH_Address::format($venue, 'inline', FALSE, FALSE);
462 462
 
463 463
 				$options['ee_map_width'] = $details_page ? $map_cfg->event_details_map_width : $map_cfg->event_list_map_width;
464
-				$options['ee_map_width'] = isset( $gmap['ee_map_width'] ) && ! empty( $gmap['ee_map_width'] ) ? $gmap['ee_map_width'] : $options['ee_map_width'];
464
+				$options['ee_map_width'] = isset($gmap['ee_map_width']) && ! empty($gmap['ee_map_width']) ? $gmap['ee_map_width'] : $options['ee_map_width'];
465 465
 
466 466
 				$options['ee_map_height'] = $details_page ? $map_cfg->event_details_map_height : $map_cfg->event_list_map_height;
467
-				$options['ee_map_height'] = isset( $gmap['ee_map_height'] ) && ! empty( $gmap['ee_map_height'] ) ? $gmap['ee_map_height'] : $options['ee_map_height'];
467
+				$options['ee_map_height'] = isset($gmap['ee_map_height']) && ! empty($gmap['ee_map_height']) ? $gmap['ee_map_height'] : $options['ee_map_height'];
468 468
 
469 469
 				$options['ee_map_zoom'] = $details_page ? $map_cfg->event_details_map_zoom : $map_cfg->event_list_map_zoom;
470
-				$options['ee_map_zoom'] = isset( $gmap['ee_map_zoom'] ) && ! empty( $gmap['ee_map_zoom'] ) ? $gmap['ee_map_zoom'] : $options['ee_map_zoom'];
470
+				$options['ee_map_zoom'] = isset($gmap['ee_map_zoom']) && ! empty($gmap['ee_map_zoom']) ? $gmap['ee_map_zoom'] : $options['ee_map_zoom'];
471 471
 
472 472
 				$options['ee_map_nav_display'] = $details_page ? $map_cfg->event_details_display_nav : $map_cfg->event_list_display_nav;
473
-				$options['ee_map_nav_display'] = isset( $gmap['ee_map_nav_display'] ) && ! empty( $gmap['ee_map_nav_display'] ) ? 'true' : $options['ee_map_nav_display'];;
473
+				$options['ee_map_nav_display'] = isset($gmap['ee_map_nav_display']) && ! empty($gmap['ee_map_nav_display']) ? 'true' : $options['ee_map_nav_display']; ;
474 474
 
475 475
 				$options['ee_map_nav_size'] = $details_page ? $map_cfg->event_details_nav_size : $map_cfg->event_list_nav_size;
476
-				$options['ee_map_nav_size'] =  isset( $gmap['ee_map_nav_size'] ) && ! empty( $gmap['ee_map_nav_size'] )? $gmap['ee_map_nav_size'] : $options['ee_map_nav_size'];
476
+				$options['ee_map_nav_size'] = isset($gmap['ee_map_nav_size']) && ! empty($gmap['ee_map_nav_size']) ? $gmap['ee_map_nav_size'] : $options['ee_map_nav_size'];
477 477
 
478 478
 				$options['ee_map_type_control'] = $details_page ? $map_cfg->event_details_control_type : $map_cfg->event_list_control_type;
479
-				$options['ee_map_type_control'] =  isset( $gmap['ee_map_type_control'] ) && ! empty( $gmap['ee_map_type_control'] )? $gmap['ee_map_type_control'] : $options['ee_map_type_control'];
479
+				$options['ee_map_type_control'] = isset($gmap['ee_map_type_control']) && ! empty($gmap['ee_map_type_control']) ? $gmap['ee_map_type_control'] : $options['ee_map_type_control'];
480 480
 
481 481
 				$options['ee_map_align'] = $details_page ? $map_cfg->event_details_map_align : $map_cfg->event_list_map_align;
482
-				$options['ee_map_align'] =  isset( $gmap['ee_map_align'] ) && ! empty( $gmap['ee_map_align'] )? $gmap['ee_map_align'] : $options['ee_map_align'];
482
+				$options['ee_map_align'] = isset($gmap['ee_map_align']) && ! empty($gmap['ee_map_align']) ? $gmap['ee_map_align'] : $options['ee_map_align'];
483 483
 
484
-				$options['ee_static_url'] =  isset( $gmap['ee_static_url'] ) && ! empty( $gmap['ee_static_url'] ) ? (bool)absint( $gmap['ee_static_url'] ) : $venue->google_map_link();
484
+				$options['ee_static_url'] = isset($gmap['ee_static_url']) && ! empty($gmap['ee_static_url']) ? (bool) absint($gmap['ee_static_url']) : $venue->google_map_link();
485 485
 
486
-				return EEH_Maps::google_map( $options );
486
+				return EEH_Maps::google_map($options);
487 487
 
488 488
 			}
489 489
 		}
@@ -498,7 +498,7 @@  discard block
 block discarded – undo
498 498
 	 * @param array $atts like EEH_Maps::google_map_link
499 499
 	 * @return string
500 500
 	 */
501
-	public static function espresso_google_static_map( EE_Venue $venue, $atts = array() ){
501
+	public static function espresso_google_static_map(EE_Venue $venue, $atts = array()) {
502 502
 		EE_Registry::instance()->load_helper('Maps');
503 503
 		$state = $venue->state_obj();
504 504
 		$country = $venue->country_obj();
@@ -530,23 +530,23 @@  discard block
 block discarded – undo
530 530
 	 * @param string $after
531 531
 	 * @return string
532 532
 	 */
533
-	public static function edit_venue_link( $VNU_ID = 0, $link = '', $before = '<p class="edit-venue-lnk small-txt">', $after = '</p>' ) {
534
-		$venue = EEH_Venue_View::get_venue( $VNU_ID );
535
-		if ( $venue instanceof EE_Venue ) {
533
+	public static function edit_venue_link($VNU_ID = 0, $link = '', $before = '<p class="edit-venue-lnk small-txt">', $after = '</p>') {
534
+		$venue = EEH_Venue_View::get_venue($VNU_ID);
535
+		if ($venue instanceof EE_Venue) {
536 536
 			// can the user edit this post ?
537
-			if ( current_user_can( 'edit_post', $venue->ID() )) {
537
+			if (current_user_can('edit_post', $venue->ID())) {
538 538
 				// set link text
539
-				$link = ! empty( $link ) ? $link : __('edit this venue');
539
+				$link = ! empty($link) ? $link : __('edit this venue');
540 540
 				// generate nonce
541
-				$nonce = wp_create_nonce( 'edit_nonce' );
541
+				$nonce = wp_create_nonce('edit_nonce');
542 542
 				// generate url to venue editor for this venue
543
-				$url = add_query_arg( array( 'page' => 'espresso_venues', 'action' => 'edit', 'post' => $venue->ID(), 'edit_nonce' => $nonce ), admin_url( 'admin.php' ) );
543
+				$url = add_query_arg(array('page' => 'espresso_venues', 'action' => 'edit', 'post' => $venue->ID(), 'edit_nonce' => $nonce), admin_url('admin.php'));
544 544
 				// get edit CPT text
545
-				$post_type_obj = get_post_type_object( 'espresso_venues' );
545
+				$post_type_obj = get_post_type_object('espresso_venues');
546 546
 				// build final link html
547
-				$link = '<a class="post-edit-link" href="' . $url . '" title="' . esc_attr( $post_type_obj->labels->edit_item ) . '">' . $link . '</a>';
547
+				$link = '<a class="post-edit-link" href="'.$url.'" title="'.esc_attr($post_type_obj->labels->edit_item).'">'.$link.'</a>';
548 548
 				// put it all together
549
-				return $before . apply_filters( 'edit_post_link', $link, $venue->ID() ) . $after;
549
+				return $before.apply_filters('edit_post_link', $link, $venue->ID()).$after;
550 550
 			}
551 551
 		}
552 552
 		return '';
Please login to merge, or discard this patch.
Indentation   -1 removed lines patch added patch discarded remove patch
@@ -799,7 +799,6 @@
 block discarded – undo
799 799
 
800 800
 
801 801
 	/**
802
-
803 802
 	 *
804 803
 	 * 	 If the the first date starts at midnight on one day, and the next date ends at midnight on the
805 804
 	 * 	 very next day then this method will return true.
Please login to merge, or discard this patch.
public/Espresso_Arabica_2014/content-espresso_events-venues.php 2 patches
Spacing   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -1,64 +1,64 @@
 block discarded – undo
1 1
 <?php
2 2
 //echo '<br/><h6 style="color:#2EA2CC;">'. __FILE__ . ' &nbsp; <span style="font-weight:normal;color:#E76700"> Line #: ' . __LINE__ . '</span></h6>';
3 3
 if (
4
-	( is_single() && espresso_display_venue_in_event_details() )
5
-	|| ( is_archive() && espresso_display_venue_in_event_list() )
4
+	(is_single() && espresso_display_venue_in_event_details())
5
+	|| (is_archive() && espresso_display_venue_in_event_list())
6 6
 ) :
7 7
 	global $post;
8
-	do_action( 'AHEE_event_details_before_venue_details', $post );
9
-	$venue_name = espresso_venue_name( 0, 'details', FALSE );
10
-	if ( empty( $venue_name ) && espresso_is_venue_private() ) {
11
-		do_action( 'AHEE_event_details_after_venue_details', $post );
8
+	do_action('AHEE_event_details_before_venue_details', $post);
9
+	$venue_name = espresso_venue_name(0, 'details', FALSE);
10
+	if (empty($venue_name) && espresso_is_venue_private()) {
11
+		do_action('AHEE_event_details_after_venue_details', $post);
12 12
 		return '';
13 13
 	}
14 14
 ?>
15 15
 
16 16
 <div class="espresso-venue-dv<?php echo espresso_is_venue_private() ? ' espresso-private-venue-dv' : ''; ?>">
17 17
 	<h3 class="event-venues-h3 ee-event-h3">
18
-		<?php _e( 'Location', 'event_espresso' ); ?>
18
+		<?php _e('Location', 'event_espresso'); ?>
19 19
 	</h3>
20
-	<h4><strong><?php _e( 'Venue:', 'event_espresso' ); ?></strong>&nbsp;&nbsp; <strong> <?php echo $venue_name; ?></strong></h4>
20
+	<h4><strong><?php _e('Venue:', 'event_espresso'); ?></strong>&nbsp;&nbsp; <strong> <?php echo $venue_name; ?></strong></h4>
21 21
 	<p><span class="smaller-text tags-links"><?php echo espresso_venue_categories(); ?></span></p>
22
-<?php  if ( $venue_phone = espresso_venue_phone( $post->ID, FALSE )) : ?>
22
+<?php  if ($venue_phone = espresso_venue_phone($post->ID, FALSE)) : ?>
23 23
 	<p>
24
-		<span class="small-text"><strong><?php _e( 'Venue Phone:', 'event_espresso' ); ?></strong></span> <?php echo $venue_phone; ?>
24
+		<span class="small-text"><strong><?php _e('Venue Phone:', 'event_espresso'); ?></strong></span> <?php echo $venue_phone; ?>
25 25
 	</p>
26
-<?php endif;  ?>
27
-<?php  if ( espresso_venue_has_address( $post->ID )) : ?>
28
-	<strong><span class="dashicons dashicons-location-alt"></span><?php _e( 'Address:', 'event_espresso' ); ?></strong>
29
-	<?php espresso_venue_address( 'inline' ); ?>
30
-	<?php espresso_venue_gmap( $post->ID ); ?>
26
+<?php endif; ?>
27
+<?php  if (espresso_venue_has_address($post->ID)) : ?>
28
+	<strong><span class="dashicons dashicons-location-alt"></span><?php _e('Address:', 'event_espresso'); ?></strong>
29
+	<?php espresso_venue_address('inline'); ?>
30
+	<?php espresso_venue_gmap($post->ID); ?>
31 31
 	<div class="clear"><br/></div>
32
-<?php endif;  ?>
32
+<?php endif; ?>
33 33
 
34
-	<?php $VNU_ID = espresso_venue_id( $post->ID ); ?>
35
-	<?php if ( is_single() ) : ?>
36
-		<?php $venue_description = espresso_venue_description( $VNU_ID, FALSE ); ?>
37
-		<?php if ( $venue_description ) : ?>
34
+	<?php $VNU_ID = espresso_venue_id($post->ID); ?>
35
+	<?php if (is_single()) : ?>
36
+		<?php $venue_description = espresso_venue_description($VNU_ID, FALSE); ?>
37
+		<?php if ($venue_description) : ?>
38 38
 	<p>
39
-		<strong><?php _e( 'Description:', 'event_espresso' ); ?></strong><br/>
40
-		<?php echo do_shortcode( $venue_description ); ?>
39
+		<strong><?php _e('Description:', 'event_espresso'); ?></strong><br/>
40
+		<?php echo do_shortcode($venue_description); ?>
41 41
 	</p>
42
-		<?php endif;  ?>
42
+		<?php endif; ?>
43 43
 	<?php else : ?>
44
-		<?php $venue_excerpt = espresso_venue_excerpt( $VNU_ID, FALSE ); ?>
45
-		<?php if ( $venue_excerpt ) : ?>
44
+		<?php $venue_excerpt = espresso_venue_excerpt($VNU_ID, FALSE); ?>
45
+		<?php if ($venue_excerpt) : ?>
46 46
 	<p>
47
-		<strong><?php _e( 'Description:', 'event_espresso' ); ?></strong><br/>
47
+		<strong><?php _e('Description:', 'event_espresso'); ?></strong><br/>
48 48
 		<?php echo $venue_excerpt; ?>
49 49
 	</p>
50
-			<?php endif;  ?>
51
-		<?php endif;  ?>
50
+			<?php endif; ?>
51
+		<?php endif; ?>
52 52
 </div>
53 53
 <!-- .espresso-venue-dv -->
54 54
 <?php
55
-do_action( 'AHEE_event_details_after_venue_details', $post );
55
+do_action('AHEE_event_details_after_venue_details', $post);
56 56
 else :
57
-	if ( espresso_venue_is_password_protected() ) :
57
+	if (espresso_venue_is_password_protected()) :
58 58
 ?>
59 59
 	<div class="espresso-venue-dv  espresso-password-protected-venue-dv" >
60 60
 		<h3 class="event-venues-h3 ee-event-h3">
61
-			<?php _e( 'Location', 'event_espresso' );?>
61
+			<?php _e('Location', 'event_espresso'); ?>
62 62
 		</h3>
63 63
 		<?php echo espresso_password_protected_venue_form(); ?>
64 64
 	</div>
Please login to merge, or discard this patch.
Braces   +10 added lines, -4 removed lines patch added patch discarded remove patch
@@ -40,8 +40,11 @@  discard block
 block discarded – undo
40 40
 		<?php echo do_shortcode( $venue_description ); ?>
41 41
 	</p>
42 42
 		<?php endif;  ?>
43
-	<?php else : ?>
44
-		<?php $venue_excerpt = espresso_venue_excerpt( $VNU_ID, FALSE ); ?>
43
+	<?php else {
44
+	: ?>
45
+		<?php $venue_excerpt = espresso_venue_excerpt( $VNU_ID, FALSE );
46
+}
47
+?>
45 48
 		<?php if ( $venue_excerpt ) : ?>
46 49
 	<p>
47 50
 		<strong><?php _e( 'Description:', 'event_espresso' ); ?></strong><br/>
@@ -53,12 +56,15 @@  discard block
 block discarded – undo
53 56
 <!-- .espresso-venue-dv -->
54 57
 <?php
55 58
 do_action( 'AHEE_event_details_after_venue_details', $post );
56
-else :
59
+else {
60
+	:
57 61
 	if ( espresso_venue_is_password_protected() ) :
58 62
 ?>
59 63
 	<div class="espresso-venue-dv  espresso-password-protected-venue-dv" >
60 64
 		<h3 class="event-venues-h3 ee-event-h3">
61
-			<?php _e( 'Location', 'event_espresso' );?>
65
+			<?php _e( 'Location', 'event_espresso' );
66
+}
67
+?>
62 68
 		</h3>
63 69
 		<?php echo espresso_password_protected_venue_form(); ?>
64 70
 	</div>
Please login to merge, or discard this patch.
core/db_models/EEM_Question.model.php 1 patch
Spacing   +58 added lines, -58 removed lines patch added patch discarded remove patch
@@ -1,8 +1,8 @@  discard block
 block discarded – undo
1 1
 <?php if ( ! defined('EVENT_ESPRESSO_VERSION')) {
2 2
 	exit('No direct script access allowed');
3 3
 }
4
-require_once( EE_MODELS . 'EEM_Soft_Delete_Base.model.php' );
5
-require_once( EE_CLASSES . 'EE_Question.class.php' );
4
+require_once(EE_MODELS.'EEM_Soft_Delete_Base.model.php');
5
+require_once(EE_CLASSES.'EE_Question.class.php');
6 6
 
7 7
 
8 8
 
@@ -74,24 +74,24 @@  discard block
 block discarded – undo
74 74
 	/**
75 75
 	 * @param null $timezone
76 76
 	 */
77
-	protected function __construct( $timezone = NULL ) {
78
-		$this->singular_item = __('Question','event_espresso');
79
-		$this->plural_item = __('Questions','event_espresso');
80
-		$this->_allowed_question_types=apply_filters(
77
+	protected function __construct($timezone = NULL) {
78
+		$this->singular_item = __('Question', 'event_espresso');
79
+		$this->plural_item = __('Questions', 'event_espresso');
80
+		$this->_allowed_question_types = apply_filters(
81 81
 			'FHEE__EEM_Question__construct__allowed_question_types',
82 82
 			array(
83
-				EEM_Question::QST_type_text =>__('Text','event_espresso'),
84
-				EEM_Question::QST_type_textarea =>__('Textarea','event_espresso'),
85
-				EEM_Question::QST_type_checkbox =>__('Checkboxes','event_espresso'),
86
-				EEM_Question::QST_type_radio =>__('Radio Buttons','event_espresso'),
87
-				EEM_Question::QST_type_dropdown =>__('Dropdown','event_espresso'),
88
-				EEM_Question::QST_type_state =>__('State/Province Dropdown','event_espresso'),
89
-				EEM_Question::QST_type_country =>__('Country Dropdown','event_espresso'),
90
-				EEM_Question::QST_type_date =>__('Date Picker','event_espresso'),
91
-				EEM_Question::QST_type_html_textarea => __( 'HTML Textarea', 'event_espresso' ),
83
+				EEM_Question::QST_type_text =>__('Text', 'event_espresso'),
84
+				EEM_Question::QST_type_textarea =>__('Textarea', 'event_espresso'),
85
+				EEM_Question::QST_type_checkbox =>__('Checkboxes', 'event_espresso'),
86
+				EEM_Question::QST_type_radio =>__('Radio Buttons', 'event_espresso'),
87
+				EEM_Question::QST_type_dropdown =>__('Dropdown', 'event_espresso'),
88
+				EEM_Question::QST_type_state =>__('State/Province Dropdown', 'event_espresso'),
89
+				EEM_Question::QST_type_country =>__('Country Dropdown', 'event_espresso'),
90
+				EEM_Question::QST_type_date =>__('Date Picker', 'event_espresso'),
91
+				EEM_Question::QST_type_html_textarea => __('HTML Textarea', 'event_espresso'),
92 92
 			)
93 93
 		);
94
-		$this->_question_type_categories = (array)apply_filters(
94
+		$this->_question_type_categories = (array) apply_filters(
95 95
 				'FHEE__EEM_Question__construct__question_type_categories',
96 96
 				array(
97 97
 				'text' => array(
@@ -107,22 +107,22 @@  discard block
 block discarded – undo
107 107
 		);
108 108
 
109 109
 		$this->_tables = array(
110
-			'Question'=>new EE_Primary_Table('esp_question','QST_ID')
110
+			'Question'=>new EE_Primary_Table('esp_question', 'QST_ID')
111 111
 		);
112 112
 		$this->_fields = array(
113 113
 			'Question'=>array(
114
-				'QST_ID'=>new EE_Primary_Key_Int_Field('QST_ID', __('Question ID','event_espresso')),
115
-				'QST_display_text'=>new EE_Full_HTML_Field('QST_display_text', __('Question Text','event_espresso'), true, ''),
116
-				'QST_admin_label'=>new EE_Plain_Text_Field('QST_admin_label', __('Question Label (admin-only)','event_espresso'), true, ''),
117
-				'QST_system'=>new EE_Plain_Text_Field('QST_system', __('Internal string ID for question','event_espresso'), false, '' ),
118
-				'QST_type'=>new EE_Enum_Text_Field('QST_type', __('Question Type','event_espresso'),false, 'TEXT',$this->_allowed_question_types),
119
-				'QST_required'=>new EE_Boolean_Field('QST_required', __('Required Question?','event_espresso'), false, false),
120
-				'QST_required_text'=>new EE_Simple_HTML_Field('QST_required_text', __('Text to Display if Not Provided','event_espresso'), true, ''),
121
-				'QST_order'=>new EE_Integer_Field('QST_order', __('Question Order','event_espresso'), false, 0),
122
-				'QST_admin_only'=>new EE_Boolean_Field('QST_admin_only', __('Admin-Only Question?','event_espresso'), false, false),
123
-				'QST_max' => new EE_Infinite_Integer_Field( 'QST_max', __( 'Max Size', 'event_espresso'	), false, EE_INF ),
124
-				'QST_wp_user'=>new EE_WP_User_Field('QST_wp_user', __('Question Creator ID','event_espresso'), false ),
125
-				'QST_deleted'=>new EE_Trashed_Flag_Field('QST_deleted', __('Flag Indicating question was deleted','event_espresso'), false, false)
114
+				'QST_ID'=>new EE_Primary_Key_Int_Field('QST_ID', __('Question ID', 'event_espresso')),
115
+				'QST_display_text'=>new EE_Full_HTML_Field('QST_display_text', __('Question Text', 'event_espresso'), true, ''),
116
+				'QST_admin_label'=>new EE_Plain_Text_Field('QST_admin_label', __('Question Label (admin-only)', 'event_espresso'), true, ''),
117
+				'QST_system'=>new EE_Plain_Text_Field('QST_system', __('Internal string ID for question', 'event_espresso'), false, ''),
118
+				'QST_type'=>new EE_Enum_Text_Field('QST_type', __('Question Type', 'event_espresso'), false, 'TEXT', $this->_allowed_question_types),
119
+				'QST_required'=>new EE_Boolean_Field('QST_required', __('Required Question?', 'event_espresso'), false, false),
120
+				'QST_required_text'=>new EE_Simple_HTML_Field('QST_required_text', __('Text to Display if Not Provided', 'event_espresso'), true, ''),
121
+				'QST_order'=>new EE_Integer_Field('QST_order', __('Question Order', 'event_espresso'), false, 0),
122
+				'QST_admin_only'=>new EE_Boolean_Field('QST_admin_only', __('Admin-Only Question?', 'event_espresso'), false, false),
123
+				'QST_max' => new EE_Infinite_Integer_Field('QST_max', __('Max Size', 'event_espresso'), false, EE_INF),
124
+				'QST_wp_user'=>new EE_WP_User_Field('QST_wp_user', __('Question Creator ID', 'event_espresso'), false),
125
+				'QST_deleted'=>new EE_Trashed_Flag_Field('QST_deleted', __('Flag Indicating question was deleted', 'event_espresso'), false, false)
126 126
 			)
127 127
 		);
128 128
 		$this->_model_relations = array(
@@ -134,11 +134,11 @@  discard block
 block discarded – undo
134 134
 			'Question_Group_Question'=>new EE_Has_Many_Relation()
135 135
 		);
136 136
 		//this model is generally available for reading
137
-		$this->_cap_restriction_generators[ EEM_Base::caps_read ] = new EE_Restriction_Generator_Public();
138
-		$this->_cap_restriction_generators[ EEM_Base::caps_read_admin ] = new EE_Restriction_Generator_Reg_Form('QST_system');
139
-		$this->_cap_restriction_generators[ EEM_Base::caps_edit ] = new EE_Restriction_Generator_Reg_Form('QST_system');
140
-		$this->_cap_restriction_generators[ EEM_Base::caps_delete ] = new EE_Restriction_Generator_Reg_Form('QST_system');
141
-		parent::__construct( $timezone );
137
+		$this->_cap_restriction_generators[EEM_Base::caps_read] = new EE_Restriction_Generator_Public();
138
+		$this->_cap_restriction_generators[EEM_Base::caps_read_admin] = new EE_Restriction_Generator_Reg_Form('QST_system');
139
+		$this->_cap_restriction_generators[EEM_Base::caps_edit] = new EE_Restriction_Generator_Reg_Form('QST_system');
140
+		$this->_cap_restriction_generators[EEM_Base::caps_delete] = new EE_Restriction_Generator_Reg_Form('QST_system');
141
+		parent::__construct($timezone);
142 142
 	}
143 143
 
144 144
 	/**
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
 	 * but they can be extended
147 147
 	 * @return string[]
148 148
 	 */
149
-	public function allowed_question_types(){
149
+	public function allowed_question_types() {
150 150
 		return $this->_allowed_question_types;
151 151
 	}
152 152
 	/**
@@ -154,16 +154,16 @@  discard block
 block discarded – undo
154 154
 	 * @param string $question_type one of EEM_Question::allowed_question_types(
155 155
 	 * @return string[] like EEM_Question::allowed_question_types()
156 156
 	 */
157
-	public function question_types_in_same_category( $question_type ) {
158
-		$question_types = array( $question_type );
159
-		foreach( $this->_question_type_categories as $category => $question_types_in_category ) {
160
-			if( in_array( $question_type, $question_types_in_category ) ) {
157
+	public function question_types_in_same_category($question_type) {
158
+		$question_types = array($question_type);
159
+		foreach ($this->_question_type_categories as $category => $question_types_in_category) {
160
+			if (in_array($question_type, $question_types_in_category)) {
161 161
 				$question_types = $question_types_in_category;
162 162
 				break;
163 163
 			}
164 164
 		}
165 165
 
166
-		return array_intersect_key( $this->allowed_question_types(), array_flip( $question_types ) );
166
+		return array_intersect_key($this->allowed_question_types(), array_flip($question_types));
167 167
 	}
168 168
 
169 169
 	/**
@@ -172,11 +172,11 @@  discard block
 block discarded – undo
172 172
 	 * @param string $category one of the top-level keys of EEM_Question::question_type_categories()
173 173
 	 * @return boolean
174 174
 	 */
175
-	public function question_type_is_in_category( $question_type, $category ) {
176
-		if( ! isset( $this->_question_type_categories[ $category ] ) ) {
175
+	public function question_type_is_in_category($question_type, $category) {
176
+		if ( ! isset($this->_question_type_categories[$category])) {
177 177
 			return false;
178 178
 		}
179
-		return in_array( $question_type, $this->_question_type_categories[ $category ] );
179
+		return in_array($question_type, $this->_question_type_categories[$category]);
180 180
 	}
181 181
 
182 182
 	/**
@@ -193,9 +193,9 @@  discard block
 block discarded – undo
193 193
 	 * @param string $system_question_group_id QSG_system
194 194
 	 * @return array of system question names (QST_system)
195 195
 	 */
196
-	public function allowed_system_questions_in_system_question_group( $system_question_group_id ) {
196
+	public function allowed_system_questions_in_system_question_group($system_question_group_id) {
197 197
 		$question_system_ids = array();
198
-		switch( $system_question_group_id ) {
198
+		switch ($system_question_group_id) {
199 199
 			case EEM_Question_Group::system_personal:
200 200
 				$question_system_ids = array(
201 201
 					EEM_Attendee::system_question_fname,
@@ -216,7 +216,7 @@  discard block
 block discarded – undo
216 216
 				);
217 217
 				break;
218 218
 		}
219
-		return apply_filters( 'FHEE__EEM_Question__system_questions_allowed_in_system_question_group__return', $question_system_ids, $system_question_group_id );
219
+		return apply_filters('FHEE__EEM_Question__system_questions_allowed_in_system_question_group__return', $question_system_ids, $system_question_group_id);
220 220
 	}
221 221
 
222 222
 	/**
@@ -225,11 +225,11 @@  discard block
 block discarded – undo
225 225
 	 * @param string $system_question_group_id QSG_system
226 226
 	 * @return array of system question names (QST_system)
227 227
 	 */
228
-	public function required_system_questions_in_system_question_group( $system_question_group_id ) {
228
+	public function required_system_questions_in_system_question_group($system_question_group_id) {
229 229
 		$question_system_ids = null;
230
-		switch( $system_question_group_id ) {
230
+		switch ($system_question_group_id) {
231 231
 			case EEM_Question_Group::system_personal:
232
-				$question_system_ids =  array(
232
+				$question_system_ids = array(
233 233
 					EEM_Attendee::system_question_fname,
234 234
 					EEM_Attendee::system_question_email,
235 235
 				);
@@ -237,7 +237,7 @@  discard block
 block discarded – undo
237 237
 			default:
238 238
 				$question_system_ids = array();
239 239
 		}
240
-		return apply_filters( 'FHEE__EEM_Question__system_questions_required_in_system_question_group', $question_system_ids, $system_question_group_id );
240
+		return apply_filters('FHEE__EEM_Question__system_questions_required_in_system_question_group', $question_system_ids, $system_question_group_id);
241 241
 	}
242 242
 
243 243
 
@@ -248,8 +248,8 @@  discard block
 block discarded – undo
248 248
 	 * @param $QST_system
249 249
 	 * @return int of QST_ID for the question that corresponds to that QST_system
250 250
 	 */
251
-	public function get_Question_ID_from_system_string( $QST_system ){
252
-		 return $this->get_var( array( array( 'QST_system' => $QST_system ) ) );
251
+	public function get_Question_ID_from_system_string($QST_system) {
252
+		 return $this->get_var(array(array('QST_system' => $QST_system)));
253 253
 	}
254 254
 
255 255
 
@@ -261,10 +261,10 @@  discard block
 block discarded – undo
261 261
 	 */
262 262
 	public function get_latest_question_order() {
263 263
 		$columns_to_select = array(
264
-			'max_order' => array("MAX(QST_order)","%d")
264
+			'max_order' => array("MAX(QST_order)", "%d")
265 265
 		);
266
-		$max = $this->_get_all_wpdb_results( array(), ARRAY_A, $columns_to_select );
267
-		return isset( $max[0], $max[0]['max_order'] ) ? $max[0]['max_order'] : 0;
266
+		$max = $this->_get_all_wpdb_results(array(), ARRAY_A, $columns_to_select);
267
+		return isset($max[0], $max[0]['max_order']) ? $max[0]['max_order'] : 0;
268 268
 	}
269 269
 
270 270
 	/**
@@ -293,10 +293,10 @@  discard block
 block discarded – undo
293 293
 	 * @param string $system_question_value
294 294
 	 * @return int|float
295 295
 	 */
296
-	public function absolute_max_for_system_question( $system_question_value ) {
296
+	public function absolute_max_for_system_question($system_question_value) {
297 297
 		$maxes = $this->system_question_maxes();
298
-		if( isset( $maxes[ $system_question_value ] ) ) {
299
-			return $maxes[ $system_question_value ];
298
+		if (isset($maxes[$system_question_value])) {
299
+			return $maxes[$system_question_value];
300 300
 		} else {
301 301
 			return EE_INF;
302 302
 		}
Please login to merge, or discard this patch.
registrations/form_sections/EE_Registration_Custom_Questions_Form.form.php 1 patch
Spacing   +37 added lines, -37 removed lines patch added patch discarded remove patch
@@ -13,11 +13,11 @@  discard block
 block discarded – undo
13 13
  * @since		 	   4.8.30.rc.009
14 14
  *
15 15
  */
16
-if( !defined( 'EVENT_ESPRESSO_VERSION' ) ) {
17
-	exit( 'No direct script access allowed' );
16
+if ( ! defined('EVENT_ESPRESSO_VERSION')) {
17
+	exit('No direct script access allowed');
18 18
 }
19 19
 
20
-class EE_Registration_Custom_Questions_Form extends EE_Form_Section_Proper{
20
+class EE_Registration_Custom_Questions_Form extends EE_Form_Section_Proper {
21 21
 	/**
22 22
 	 *
23 23
 	 * @var EE_Registration
@@ -29,16 +29,16 @@  discard block
 block discarded – undo
29 29
 	 * @param EE_Registration $reg
30 30
 	 * @param array $options
31 31
 	 */
32
-	public function __construct( EE_Registration $reg, $options = array() ) {
32
+	public function __construct(EE_Registration $reg, $options = array()) {
33 33
 		$this->_registration = $reg;
34
-		if( ! isset( $options[ 'layout_strategy' ] ) ) {
35
-			$options[ 'layout_strategy' ] = new EE_Admin_Two_Column_Layout();
34
+		if ( ! isset($options['layout_strategy'])) {
35
+			$options['layout_strategy'] = new EE_Admin_Two_Column_Layout();
36 36
 		}
37
-		if( ! isset( $options[ 'html_id' ] ) ) {
38
-			$options[ 'html_id' ] = 'reg-admin-attendee-questions-frm';
37
+		if ( ! isset($options['html_id'])) {
38
+			$options['html_id'] = 'reg-admin-attendee-questions-frm';
39 39
 		}
40 40
 		$this->build_form_from_registration();
41
-		parent::__construct( $options );
41
+		parent::__construct($options);
42 42
 	}
43 43
 
44 44
 
@@ -52,8 +52,8 @@  discard block
 block discarded – undo
52 52
 
53 53
 	public function build_form_from_registration() {
54 54
 		$reg = $this->get_registration();
55
-		if( ! $reg instanceof EE_Registration ) {
56
-			throw new EE_Error( __( 'We cannot build the registration custom questions form because there is no registration set on it yet', 'event_espresso') );
55
+		if ( ! $reg instanceof EE_Registration) {
56
+			throw new EE_Error(__('We cannot build the registration custom questions form because there is no registration set on it yet', 'event_espresso'));
57 57
 		}
58 58
 		//we want to get all their question groups
59 59
 		$question_groups = EEM_Question_Group::instance()->get_all(
@@ -63,16 +63,16 @@  discard block
 block discarded – undo
63 63
 					'Event_Question_Group.EQG_primary' => $reg->count() == 1 ? TRUE : FALSE,
64 64
 					'OR' => array(
65 65
 						'Question.QST_system*blank' =>  '',
66
-						'Question.QST_system*null' => array( 'IS_NULL' ) 
66
+						'Question.QST_system*null' => array('IS_NULL') 
67 67
 					)
68 68
 				),
69
-				'order_by' => array( 'QSG_order' => 'ASC' )
69
+				'order_by' => array('QSG_order' => 'ASC')
70 70
 			)
71 71
 		);
72 72
 		//get each question groups questions
73
-		foreach( $question_groups as $question_group ) {
74
-			if ( $question_group instanceof EE_Question_Group ) {
75
-				$this->_subsections[ $question_group->ID() ] = $this->build_subform_from_question_group(
73
+		foreach ($question_groups as $question_group) {
74
+			if ($question_group instanceof EE_Question_Group) {
75
+				$this->_subsections[$question_group->ID()] = $this->build_subform_from_question_group(
76 76
 					$question_group,
77 77
 					$reg
78 78
 				);
@@ -89,16 +89,16 @@  discard block
 block discarded – undo
89 89
 	 * @return \EE_Form_Section_Proper
90 90
 	 * @throws \EE_Error
91 91
 	 */
92
-	public function build_subform_from_question_group( $question_group, $registration ) {
93
-		if( ! $question_group instanceof EE_Question_Group ||
92
+	public function build_subform_from_question_group($question_group, $registration) {
93
+		if ( ! $question_group instanceof EE_Question_Group ||
94 94
 			! $registration instanceof EE_Registration) {
95
-			throw new EE_Error( __( 'A valid question group and registration must be passed to EE_Registration_Custom_Question_Form', 'event_espresso' ) );
95
+			throw new EE_Error(__('A valid question group and registration must be passed to EE_Registration_Custom_Question_Form', 'event_espresso'));
96 96
 		}
97 97
 		$parts_of_subsection = array(
98 98
 			'title' => new EE_Form_Section_HTML(
99
-					EEH_HTML::h5( $question_group->name(),
99
+					EEH_HTML::h5($question_group->name(),
100 100
 					$question_group->identifier(),
101
-					'espresso-question-group-title-h5 section-title' )
101
+					'espresso-question-group-title-h5 section-title')
102 102
 				)
103 103
 		);
104 104
 		$questions = $question_group->questions( 
@@ -106,17 +106,17 @@  discard block
 block discarded – undo
106 106
 				array( 
107 107
 					'OR' => array(
108 108
 						'QST_system*blank' => '',
109
-						'QST_system*null' => array( 'IS_NULL' )
109
+						'QST_system*null' => array('IS_NULL')
110 110
 					)
111 111
 				)
112 112
 			)
113 113
 		);
114
-		foreach( $questions as $question ) {
115
-			$parts_of_subsection[ $question->ID() ] = $question->generate_form_input( $registration );
114
+		foreach ($questions as $question) {
115
+			$parts_of_subsection[$question->ID()] = $question->generate_form_input($registration);
116 116
 		}
117
-		$parts_of_subsection[ 'edit_link' ] = new EE_Form_Section_HTML(
118
-				'<tr><th/><td class="reg-admin-edit-attendee-question-td"><a class="reg-admin-edit-attendee-question-lnk" href="#" title="' . esc_attr__( 'click to edit question', 'event_espresso' ) . '">
119
-					<span class="reg-admin-edit-question-group-spn lt-grey-txt">' . __( 'edit the above question group', 'event_espresso' ) . '</span>
117
+		$parts_of_subsection['edit_link'] = new EE_Form_Section_HTML(
118
+				'<tr><th/><td class="reg-admin-edit-attendee-question-td"><a class="reg-admin-edit-attendee-question-lnk" href="#" title="'.esc_attr__('click to edit question', 'event_espresso').'">
119
+					<span class="reg-admin-edit-question-group-spn lt-grey-txt">' . __('edit the above question group', 'event_espresso').'</span>
120 120
 					<div class="dashicons dashicons-edit"></div>
121 121
 				</a></td></tr>'
122 122
 			);
@@ -136,12 +136,12 @@  discard block
 block discarded – undo
136 136
 	protected function _normalize($req_data) {
137 137
 		$this->_received_submission = TRUE;
138 138
 		$this->_validation_errors = array();
139
-		foreach($this->get_validatable_subsections() as $subsection){
140
-			if( $subsection->form_data_present_in( $req_data ) ) {
141
-				try{
139
+		foreach ($this->get_validatable_subsections() as $subsection) {
140
+			if ($subsection->form_data_present_in($req_data)) {
141
+				try {
142 142
 					$subsection->_normalize($req_data);
143
-				}catch( EE_Validation_Error $e ){
144
-					$subsection->add_validation_error( $e );
143
+				} catch (EE_Validation_Error $e) {
144
+					$subsection->add_validation_error($e);
145 145
 				}
146 146
 			}
147 147
 		}
@@ -156,13 +156,13 @@  discard block
 block discarded – undo
156 156
 	 * calling parent::_validate() first.
157 157
 	 */
158 158
 	protected function _validate() {
159
-		foreach($this->get_validatable_subsections() as $subsection_name => $subsection){
160
-			if( $subsection->form_data_present_in( array_merge( $_GET, $_POST ) ) ) {
161
-				if(method_exists($this,'_validate_'.$subsection_name)){
162
-					call_user_func_array(array($this,'_validate_'.$subsection_name), array($subsection));
159
+		foreach ($this->get_validatable_subsections() as $subsection_name => $subsection) {
160
+			if ($subsection->form_data_present_in(array_merge($_GET, $_POST))) {
161
+				if (method_exists($this, '_validate_'.$subsection_name)) {
162
+					call_user_func_array(array($this, '_validate_'.$subsection_name), array($subsection));
163 163
 				}
164 164
 				$subsection->_validate();
165
-			} elseif( $subsection instanceof EE_Form_Section_Proper ) {
165
+			} elseif ($subsection instanceof EE_Form_Section_Proper) {
166 166
 				$subsection->_received_submission = true;
167 167
 			}
168 168
 		}
Please login to merge, or discard this patch.
admin_pages/registrations/Registrations_Admin_Page.core.php 1 patch
Spacing   +545 added lines, -545 removed lines patch added patch discarded remove patch
@@ -56,26 +56,26 @@  discard block
 block discarded – undo
56 56
 	 * @param bool $routing
57 57
 	 * @return Registrations_Admin_Page
58 58
 	 */
59
-	public function __construct( $routing = TRUE ) {
60
-		parent::__construct( $routing );
61
-		add_action( 'wp_loaded', array( $this, 'wp_loaded' ));
59
+	public function __construct($routing = TRUE) {
60
+		parent::__construct($routing);
61
+		add_action('wp_loaded', array($this, 'wp_loaded'));
62 62
 	}
63 63
 
64 64
 
65 65
 
66 66
 	public function wp_loaded() {
67 67
 		// when adding a new registration...
68
-		if ( isset( $this->_req_data[ 'action' ] ) && $this->_req_data[ 'action' ] == 'new_registration' ) {
68
+		if (isset($this->_req_data['action']) && $this->_req_data['action'] == 'new_registration') {
69 69
 			EE_System::do_not_cache();
70 70
 			if (
71
-				! isset( $this->_req_data[ 'processing_registration' ] )
72
-				|| absint( $this->_req_data[ 'processing_registration' ] ) !== 1
71
+				! isset($this->_req_data['processing_registration'])
72
+				|| absint($this->_req_data['processing_registration']) !== 1
73 73
 			) {
74 74
 				// and it's NOT the attendee information reg step
75 75
 				// force cookie expiration by setting time to last week
76
-				setcookie( 'ee_registration_added', 0, time() - WEEK_IN_SECONDS, '/' );
76
+				setcookie('ee_registration_added', 0, time() - WEEK_IN_SECONDS, '/');
77 77
 				// and update the global
78
-				$_COOKIE[ 'ee_registration_added' ] = 0;
78
+				$_COOKIE['ee_registration_added'] = 0;
79 79
 			}
80 80
 		}
81 81
 	}
@@ -109,16 +109,16 @@  discard block
 block discarded – undo
109 109
 				'trash' => 'post.php'
110 110
 			);
111 111
 
112
-		add_action('edit_form_after_title', array($this, 'after_title_form_fields'), 10 );
112
+		add_action('edit_form_after_title', array($this, 'after_title_form_fields'), 10);
113 113
 		//add filters so that the comment urls don't take users to a confusing 404 page
114
-		add_filter('get_comment_link', array( $this, 'clear_comment_link' ), 10, 3 );
114
+		add_filter('get_comment_link', array($this, 'clear_comment_link'), 10, 3);
115 115
 	}
116 116
 
117 117
 
118
-	public function clear_comment_link( $link, $comment, $args ) {
118
+	public function clear_comment_link($link, $comment, $args) {
119 119
 		//gotta make sure this only happens on this route
120
-		$post_type = get_post_type( $comment->comment_post_ID);
121
-		if ( $post_type == 'espresso_attendees' )
120
+		$post_type = get_post_type($comment->comment_post_ID);
121
+		if ($post_type == 'espresso_attendees')
122 122
 			return '#commentsdiv';
123 123
 		return $link;
124 124
 	}
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
 
127 127
 	protected function _ajax_hooks() {
128 128
 		//todo: all hooks for registrations ajax goes in here
129
-		add_action( 'wp_ajax_toggle_checkin_status', array( $this, 'toggle_checkin_status' ));
129
+		add_action('wp_ajax_toggle_checkin_status', array($this, 'toggle_checkin_status'));
130 130
 	}
131 131
 
132 132
 
@@ -141,8 +141,8 @@  discard block
 block discarded – undo
141 141
 				'add-attendee' => __('Add Contact', 'event_espresso'),
142 142
 				'edit' => __('Edit Contact', 'event_espresso'),
143 143
 				'report'=>  __("Event Registrations CSV Report", "event_espresso"),
144
-				'report_all' => __( 'All Registrations CSV Report', 'event_espresso' ),
145
-				'contact_list_report' => __( 'Contact List Report', 'event_espresso' ),
144
+				'report_all' => __('All Registrations CSV Report', 'event_espresso'),
145
+				'contact_list_report' => __('Contact List Report', 'event_espresso'),
146 146
 				'contact_list_export'=>  __("Export Data", "event_espresso"),
147 147
 			),
148 148
 			'publishbox' => array(
@@ -170,9 +170,9 @@  discard block
 block discarded – undo
170 170
 
171 171
 		$this->_get_registration_status_array();
172 172
 
173
-		$reg_id = ! empty( $this->_req_data['_REG_ID'] ) && ! is_array( $this->_req_data['_REG_ID'] ) ? $this->_req_data['_REG_ID'] : 0;
174
-		$att_id = ! empty( $this->_req_data[ 'ATT_ID' ] ) && ! is_array( $this->_req_data['ATT_ID'] ) ? $this->_req_data['ATT_ID'] : 0;
175
-		$att_id = ! empty( $this->_req_data['post'] ) && ! is_array( $this->_req_data['post'] ) ? $this->_req_data['post'] : $att_id;
173
+		$reg_id = ! empty($this->_req_data['_REG_ID']) && ! is_array($this->_req_data['_REG_ID']) ? $this->_req_data['_REG_ID'] : 0;
174
+		$att_id = ! empty($this->_req_data['ATT_ID']) && ! is_array($this->_req_data['ATT_ID']) ? $this->_req_data['ATT_ID'] : 0;
175
+		$att_id = ! empty($this->_req_data['post']) && ! is_array($this->_req_data['post']) ? $this->_req_data['post'] : $att_id;
176 176
 
177 177
 		$this->_page_routes = array(
178 178
 
@@ -205,7 +205,7 @@  discard block
 block discarded – undo
205 205
 
206 206
 				'restore_registrations' => array(
207 207
 					'func' => '_trash_or_restore_registrations',
208
-					'args' => array( 'trash' => FALSE ),
208
+					'args' => array('trash' => FALSE),
209 209
 					'noheader' => TRUE,
210 210
 					'capability' => 'ee_delete_registrations'
211 211
 					),
@@ -438,7 +438,7 @@  discard block
 block discarded – undo
438 438
 						'filename' => 'registrations_overview_other'
439 439
 					)
440 440
                 ),
441
-				'help_tour' => array( 'Registration_Overview_Help_Tour' ),
441
+				'help_tour' => array('Registration_Overview_Help_Tour'),
442 442
 				'qtips' => array('Registration_List_Table_Tips'),
443 443
 				'list_table' => 'EE_Registrations_List_Table',
444 444
 				'require_nonce' => FALSE
@@ -448,7 +448,7 @@  discard block
 block discarded – undo
448 448
 				'nav' => array(
449 449
 					'label' => __('REG Details', 'event_espresso'),
450 450
 					'order' => 15,
451
-					'url' => isset($this->_req_data['_REG_ID']) ? add_query_arg(array('_REG_ID' => $this->_req_data['_REG_ID'] ), $this->_current_page_view_url )  : $this->_admin_base_url,
451
+					'url' => isset($this->_req_data['_REG_ID']) ? add_query_arg(array('_REG_ID' => $this->_req_data['_REG_ID']), $this->_current_page_view_url) : $this->_admin_base_url,
452 452
 					'persistent' => FALSE
453 453
 				),
454 454
                 'help_tabs' => array(
@@ -469,8 +469,8 @@  discard block
 block discarded – undo
469 469
 						'filename' => 'registrations_details_registrant_details'
470 470
 					)
471 471
 				),
472
-				'help_tour' => array( 'Registration_Details_Help_Tour' ),
473
-				'metaboxes' => array_merge( $this->_default_espresso_metaboxes, array( '_registration_details_metaboxes' ) ),
472
+				'help_tour' => array('Registration_Details_Help_Tour'),
473
+				'metaboxes' => array_merge($this->_default_espresso_metaboxes, array('_registration_details_metaboxes')),
474 474
 				'require_nonce' => FALSE
475 475
 			),
476 476
 
@@ -494,7 +494,7 @@  discard block
 block discarded – undo
494 494
 					'order' => 15,
495 495
 					'persistent' => FALSE
496 496
 				),
497
-				'metaboxes' => array_merge( $this->_default_espresso_metaboxes, array('_publish_post_box', 'attendee_editor_metaboxes' ) ),
497
+				'metaboxes' => array_merge($this->_default_espresso_metaboxes, array('_publish_post_box', 'attendee_editor_metaboxes')),
498 498
 				'require_nonce' => FALSE
499 499
 			),
500 500
 
@@ -503,7 +503,7 @@  discard block
 block discarded – undo
503 503
 					'label' => __('Edit Contact', 'event_espresso'),
504 504
 					'order' => 15,
505 505
 					'persistent' => FALSE,
506
-					'url' => isset($this->_req_data['ATT_ID']) ? add_query_arg(array('ATT_ID' => $this->_req_data['ATT_ID'] ), $this->_current_page_view_url )  : $this->_admin_base_url
506
+					'url' => isset($this->_req_data['ATT_ID']) ? add_query_arg(array('ATT_ID' => $this->_req_data['ATT_ID']), $this->_current_page_view_url) : $this->_admin_base_url
507 507
 				),
508 508
 				'metaboxes' => array('attendee_editor_metaboxes'),
509 509
 				'require_nonce' => FALSE
@@ -533,7 +533,7 @@  discard block
 block discarded – undo
533 533
 						'filename' => 'registrations_contact_list_other'
534 534
 					)
535 535
                 ),
536
-				'help_tour' => array( 'Contact_List_Help_Tour' ),
536
+				'help_tour' => array('Contact_List_Help_Tour'),
537 537
 				'metaboxes' => array(),
538 538
 				'require_nonce' => FALSE
539 539
 			),
@@ -552,7 +552,7 @@  discard block
 block discarded – undo
552 552
 	protected function _add_screen_options() {}
553 553
 	protected function _add_feature_pointers() {}
554 554
 	public function admin_init() {
555
-		EE_Registry::$i18n_js_strings[ 'update_att_qstns' ] = __( 'click "Update Registration Questions" to save your changes', 'event_espresso' );
555
+		EE_Registry::$i18n_js_strings['update_att_qstns'] = __('click "Update Registration Questions" to save your changes', 'event_espresso');
556 556
 	}
557 557
 	public function admin_notices() {}
558 558
 	public function admin_footer_scripts() {}
@@ -570,7 +570,7 @@  discard block
 block discarded – undo
570 570
 	*		@return void
571 571
 	*/
572 572
 	private function _get_registration_status_array() {
573
-		self::$_reg_status = EEM_Registration::reg_status_array( array(), TRUE);
573
+		self::$_reg_status = EEM_Registration::reg_status_array(array(), TRUE);
574 574
 	}
575 575
 
576 576
 
@@ -593,11 +593,11 @@  discard block
 block discarded – undo
593 593
 	public function load_scripts_styles() {
594 594
 		//style
595 595
 		//wp_register_style('espresso_attendees', ATT_ASSETS_URL . 'espresso_attendees_admin.css', array(), EVENT_ESPRESSO_VERSION );
596
-		wp_register_style('espresso_reg', REG_ASSETS_URL . 'espresso_registrations_admin.css', array('ee-admin-css'), EVENT_ESPRESSO_VERSION );
596
+		wp_register_style('espresso_reg', REG_ASSETS_URL.'espresso_registrations_admin.css', array('ee-admin-css'), EVENT_ESPRESSO_VERSION);
597 597
 		wp_enqueue_style('espresso_reg');
598 598
 
599 599
 		//script
600
-		wp_register_script('espresso_reg', REG_ASSETS_URL . 'espresso_registrations_admin.js', array('jquery-ui-datepicker', 'jquery-ui-draggable', 'ee_admin_js'), EVENT_ESPRESSO_VERSION, TRUE);
600
+		wp_register_script('espresso_reg', REG_ASSETS_URL.'espresso_registrations_admin.js', array('jquery-ui-datepicker', 'jquery-ui-draggable', 'ee_admin_js'), EVENT_ESPRESSO_VERSION, TRUE);
601 601
 		wp_enqueue_script('espresso_reg');
602 602
 	}
603 603
 
@@ -606,9 +606,9 @@  discard block
 block discarded – undo
606 606
 	public function load_scripts_styles_edit_attendee() {
607 607
 		//stuff to only show up on our attendee edit details page.
608 608
 		$attendee_details_translations = array(
609
-			'att_publish_text' => sprintf( __('Created on: <b>%1$s</b>', 'event_espresso'), $this->_cpt_model_obj->get_datetime('ATT_created') )
609
+			'att_publish_text' => sprintf(__('Created on: <b>%1$s</b>', 'event_espresso'), $this->_cpt_model_obj->get_datetime('ATT_created'))
610 610
 			);
611
-		wp_localize_script( 'espresso_reg', 'ATTENDEE_DETAILS', $attendee_details_translations );
611
+		wp_localize_script('espresso_reg', 'ATTENDEE_DETAILS', $attendee_details_translations);
612 612
 		wp_enqueue_script('jquery-validate');
613 613
 	}
614 614
 
@@ -617,8 +617,8 @@  discard block
 block discarded – undo
617 617
 		//styles
618 618
 		wp_enqueue_style('espresso-ui-theme');
619 619
 		//scripts
620
-		$this->_get_reg_custom_questions_form( $this->_registration->ID() );
621
-		$this->_reg_custom_questions_form->wp_enqueue_scripts( true );
620
+		$this->_get_reg_custom_questions_form($this->_registration->ID());
621
+		$this->_reg_custom_questions_form->wp_enqueue_scripts(true);
622 622
 	}
623 623
 
624 624
 
@@ -628,7 +628,7 @@  discard block
 block discarded – undo
628 628
 
629 629
 	public function load_scripts_styles_contact_list() {
630 630
 		wp_deregister_style('espresso_reg');
631
-		wp_register_style('espresso_att', REG_ASSETS_URL . 'espresso_attendees_admin.css', array('ee-admin-css'), EVENT_ESPRESSO_VERSION );
631
+		wp_register_style('espresso_att', REG_ASSETS_URL.'espresso_attendees_admin.css', array('ee-admin-css'), EVENT_ESPRESSO_VERSION);
632 632
 		wp_enqueue_style('espresso_att');
633 633
 	}
634 634
 
@@ -637,9 +637,9 @@  discard block
 block discarded – undo
637 637
 
638 638
 
639 639
 	public function load_scripts_styles_new_registration() {
640
-		wp_register_script( 'ee-spco-for-admin', REG_ASSETS_URL . 'spco_for_admin.js', array('underscore', 'jquery'), EVENT_ESPRESSO_VERSION, TRUE );
640
+		wp_register_script('ee-spco-for-admin', REG_ASSETS_URL.'spco_for_admin.js', array('underscore', 'jquery'), EVENT_ESPRESSO_VERSION, TRUE);
641 641
 		wp_enqueue_script('ee-spco-for-admin');
642
-		add_filter('FHEE__EED_Ticket_Selector__load_tckt_slctr_assets', '__return_true' );
642
+		add_filter('FHEE__EED_Ticket_Selector__load_tckt_slctr_assets', '__return_true');
643 643
 		EE_Form_Section_Proper::wp_enqueue_scripts();
644 644
 		EED_Ticket_Selector::load_tckt_slctr_assets();
645 645
 		EE_Datepicker_Input::enqueue_styles_and_scripts();
@@ -678,23 +678,23 @@  discard block
 block discarded – undo
678 678
 
679 679
 		/** setup reg status bulk actions **/
680 680
 		$def_reg_status_actions['approve_registration'] = __('Approve Registrations', 'event_espresso');
681
-		if ( in_array( $match_array['approve_registration'], $active_mts ) && EE_Registry::instance()->CAP->current_user_can( 'ee_send_message', 'batch_send_messages' ) ) {
681
+		if (in_array($match_array['approve_registration'], $active_mts) && EE_Registry::instance()->CAP->current_user_can('ee_send_message', 'batch_send_messages')) {
682 682
 			$def_reg_status_actions['approve_and_notify_registration'] = __('Approve and Notify Registrations', 'event_espresso');
683 683
 		}
684 684
 		$def_reg_status_actions['decline_registration'] = __('Decline Registrations', 'event_espresso');
685
-		if ( in_array( $match_array['decline_registration'], $active_mts ) && EE_Registry::instance()->CAP->current_user_can( 'ee_send_message', 'batch_send_messages' ) ) {
685
+		if (in_array($match_array['decline_registration'], $active_mts) && EE_Registry::instance()->CAP->current_user_can('ee_send_message', 'batch_send_messages')) {
686 686
 			$def_reg_status_actions['decline_and_notify_registration'] = __('Decline and Notify Registrations', 'event_espresso');
687 687
 		}
688 688
 		$def_reg_status_actions['pending_registration'] = __('Set Registrations to Pending Payment', 'event_espresso');
689
-		if ( in_array( $match_array['pending_registration'], $active_mts ) && EE_Registry::instance()->CAP->current_user_can( 'ee_send_message', 'batch_send_messages' ) ) {
689
+		if (in_array($match_array['pending_registration'], $active_mts) && EE_Registry::instance()->CAP->current_user_can('ee_send_message', 'batch_send_messages')) {
690 690
 			$def_reg_status_actions['pending_and_notify_registration'] = __('Set Registrations to Pending Payment and Notify', 'event_espresso');
691 691
 		}
692 692
 		$def_reg_status_actions['no_approve_registration'] = __('Set Registrations to Not Approved', 'event_espresso');
693
-		if ( in_array( $match_array['no_approve_registration'], $active_mts ) && EE_Registry::instance()->CAP->current_user_can( 'ee_send_message', 'batch_send_messages' ) ) {
693
+		if (in_array($match_array['no_approve_registration'], $active_mts) && EE_Registry::instance()->CAP->current_user_can('ee_send_message', 'batch_send_messages')) {
694 694
 			$def_reg_status_actions['no_approve_and_notify_registration'] = __('Set Registrations to Not Approved and Notify', 'event_espresso');
695 695
 		}
696 696
 		$def_reg_status_actions['cancel_registration'] = __('Cancel Registrations', 'event_espresso');
697
-		if ( in_array( $match_array['cancel_registration'], $active_mts ) && EE_Registry::instance()->CAP->current_user_can( 'ee_send_message', 'batch_send_messages' ) ) {
697
+		if (in_array($match_array['cancel_registration'], $active_mts) && EE_Registry::instance()->CAP->current_user_can('ee_send_message', 'batch_send_messages')) {
698 698
 			$def_reg_status_actions['cancel_and_notify_registration'] = __('Cancel Registrations and Notify', 'event_espresso');
699 699
 		}
700 700
 
@@ -703,29 +703,29 @@  discard block
 block discarded – undo
703 703
 				'slug' => 'all',
704 704
 				'label' => __('View All Registrations', 'event_espresso'),
705 705
 				'count' => 0,
706
-				'bulk_action' => array_merge( $def_reg_status_actions, array(
706
+				'bulk_action' => array_merge($def_reg_status_actions, array(
707 707
 					'trash_registrations' => __('Trash Registrations', 'event_espresso')
708
-					) )
708
+					))
709 709
 				),
710 710
 			'month' => array(
711 711
 				'slug' => 'month',
712 712
 				'label' => __('This Month', 'event_espresso'),
713 713
 				'count' => 0,
714
-				'bulk_action' => array_merge( $def_reg_status_actions, array(
714
+				'bulk_action' => array_merge($def_reg_status_actions, array(
715 715
 					'trash_registrations' => __('Trash Registrations', 'event_espresso')
716 716
 					))
717 717
 				),
718 718
 			'today' => array(
719 719
 				'slug' => 'today',
720
-				'label' => sprintf( __('Today - %s', 'event_espresso'), date('M d, Y', current_time('timestamp' ) ) ),
720
+				'label' => sprintf(__('Today - %s', 'event_espresso'), date('M d, Y', current_time('timestamp'))),
721 721
 				'count' => 0,
722
-				'bulk_action' => array_merge( $def_reg_status_actions,  array(
722
+				'bulk_action' => array_merge($def_reg_status_actions, array(
723 723
 					'trash_registrations' => __('Trash Registrations', 'event_espresso')
724 724
 					))
725 725
 				)
726 726
 			);
727 727
 
728
-		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_delete_registrations', 'espresso_registrations_delete_registration' ) ) {
728
+		if (EE_Registry::instance()->CAP->current_user_can('ee_delete_registrations', 'espresso_registrations_delete_registration')) {
729 729
 			$this->_views['incomplete'] = array(
730 730
 				'slug' => 'incomplete',
731 731
 				'label' => __('Incomplete', 'event_espresso'),
@@ -761,7 +761,7 @@  discard block
 block discarded – undo
761 761
 				)
762 762
 			);
763 763
 
764
-		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_delete_contacts', 'espresso_registrations_trash_attendees' ) ) {
764
+		if (EE_Registry::instance()->CAP->current_user_can('ee_delete_contacts', 'espresso_registrations_trash_attendees')) {
765 765
 			$this->_views['trash'] = array(
766 766
 				'slug' => 'trash',
767 767
 				'label' => __('Trash', 'event_espresso'),
@@ -800,42 +800,42 @@  discard block
 block discarded – undo
800 800
 				'desc' => __('View Transaction Invoice', 'event_espresso')
801 801
 				),
802 802
  			);
803
-		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_send_message', 'espresso_registrations_resend_registration' ) ) {
803
+		if (EE_Registry::instance()->CAP->current_user_can('ee_send_message', 'espresso_registrations_resend_registration')) {
804 804
 			$fc_items['resend_registration'] = array(
805 805
 				'class' => 'dashicons dashicons-email-alt',
806 806
 				'desc' => __('Resend Registration Details', 'event_espresso')
807 807
 				);
808 808
 		} else {
809
-			$fc_items['blank'] = array( 'class' => 'blank', 'desc' => '' );
809
+			$fc_items['blank'] = array('class' => 'blank', 'desc' => '');
810 810
 		}
811 811
 
812 812
 		$sc_items = array(
813 813
 			'approved_status' => array(
814
-				'class' => 'ee-status-legend ee-status-legend-' . EEM_Registration::status_id_approved,
815
-				'desc' => EEH_Template::pretty_status( EEM_Registration::status_id_approved, FALSE, 'sentence' )
814
+				'class' => 'ee-status-legend ee-status-legend-'.EEM_Registration::status_id_approved,
815
+				'desc' => EEH_Template::pretty_status(EEM_Registration::status_id_approved, FALSE, 'sentence')
816 816
 				),
817 817
 			'pending_status' => array(
818
-				'class' => 'ee-status-legend ee-status-legend-' . EEM_Registration::status_id_pending_payment,
819
-				'desc' => EEH_Template::pretty_status( EEM_Registration::status_id_pending_payment, FALSE, 'sentence' )
818
+				'class' => 'ee-status-legend ee-status-legend-'.EEM_Registration::status_id_pending_payment,
819
+				'desc' => EEH_Template::pretty_status(EEM_Registration::status_id_pending_payment, FALSE, 'sentence')
820 820
 				),
821 821
 			'incomplete_status' => array(
822
-				'class' => 'ee-status-legend ee-status-legend-' . EEM_Registration::status_id_incomplete,
823
-				'desc' => EEH_Template::pretty_status( EEM_Registration::status_id_incomplete, FALSE, 'sentence' )
822
+				'class' => 'ee-status-legend ee-status-legend-'.EEM_Registration::status_id_incomplete,
823
+				'desc' => EEH_Template::pretty_status(EEM_Registration::status_id_incomplete, FALSE, 'sentence')
824 824
 			),
825 825
 			'not_approved' => array(
826
-				'class' => 'ee-status-legend ee-status-legend-' . EEM_Registration::status_id_not_approved,
827
-				'desc' => EEH_Template::pretty_status( EEM_Registration::status_id_not_approved, FALSE, 'sentence' )
826
+				'class' => 'ee-status-legend ee-status-legend-'.EEM_Registration::status_id_not_approved,
827
+				'desc' => EEH_Template::pretty_status(EEM_Registration::status_id_not_approved, FALSE, 'sentence')
828 828
 				),
829 829
 			'declined_status' => array(
830
-				'class' => 'ee-status-legend ee-status-legend-' . EEM_Registration::status_id_declined,
831
-				'desc' => EEH_Template::pretty_status( EEM_Registration::status_id_declined, FALSE, 'sentence' )
830
+				'class' => 'ee-status-legend ee-status-legend-'.EEM_Registration::status_id_declined,
831
+				'desc' => EEH_Template::pretty_status(EEM_Registration::status_id_declined, FALSE, 'sentence')
832 832
 				),
833 833
 			'cancelled_status' => array(
834
-				'class' => 'ee-status-legend ee-status-legend-' . EEM_Registration::status_id_cancelled,
835
-				'desc' => EEH_Template::pretty_status( EEM_Registration::status_id_cancelled, FALSE, 'sentence' )
834
+				'class' => 'ee-status-legend ee-status-legend-'.EEM_Registration::status_id_cancelled,
835
+				'desc' => EEH_Template::pretty_status(EEM_Registration::status_id_cancelled, FALSE, 'sentence')
836 836
 				)
837 837
 			);
838
-		return array_merge( $fc_items, $sc_items );
838
+		return array_merge($fc_items, $sc_items);
839 839
 	}
840 840
 
841 841
 
@@ -848,15 +848,15 @@  discard block
 block discarded – undo
848 848
 
849 849
 
850 850
 	protected function _registrations_overview_list_table() {
851
-		$EVT_ID = ( ! empty( $this->_req_data['event_id'] )) ? absint( $this->_req_data['event_id'] ) : FALSE;
852
-		if ( $EVT_ID ) {
853
-			if ( EE_Registry::instance()->CAP->current_user_can( 'ee_edit_registrations', 'espresso_registrations_new_registration', $EVT_ID ) ) {
854
-				$this->_admin_page_title .= $this->get_action_link_or_button( 'new_registration', 'add-registrant', array( 'event_id' => $EVT_ID ), 'add-new-h2' );
851
+		$EVT_ID = ( ! empty($this->_req_data['event_id'])) ? absint($this->_req_data['event_id']) : FALSE;
852
+		if ($EVT_ID) {
853
+			if (EE_Registry::instance()->CAP->current_user_can('ee_edit_registrations', 'espresso_registrations_new_registration', $EVT_ID)) {
854
+				$this->_admin_page_title .= $this->get_action_link_or_button('new_registration', 'add-registrant', array('event_id' => $EVT_ID), 'add-new-h2');
855 855
 			}
856
-			$event = EEM_Event::instance()->get_one_by_ID( $EVT_ID );
857
-			$this->_template_args['admin_page_header'] = $event instanceof EE_Event ? sprintf( __('%s Viewing registrations for the event: %s%s', 'event_espresso'), '<h2>', '<a href="' . EE_Admin_Page::add_query_args_and_nonce( array('action' => 'edit', 'post' => $event->ID() ), EVENTS_ADMIN_URL ) . '">' . $event->get('EVT_name') . '</a>', '</h2>' ) : '';
856
+			$event = EEM_Event::instance()->get_one_by_ID($EVT_ID);
857
+			$this->_template_args['admin_page_header'] = $event instanceof EE_Event ? sprintf(__('%s Viewing registrations for the event: %s%s', 'event_espresso'), '<h2>', '<a href="'.EE_Admin_Page::add_query_args_and_nonce(array('action' => 'edit', 'post' => $event->ID()), EVENTS_ADMIN_URL).'">'.$event->get('EVT_name').'</a>', '</h2>') : '';
858 858
 		}
859
-		$this->_template_args['after_list_table'] = $this->_display_legend( $this->_registration_legend_items() );
859
+		$this->_template_args['after_list_table'] = $this->_display_legend($this->_registration_legend_items());
860 860
 		$this->display_admin_list_table_page_with_no_sidebar();
861 861
 	}
862 862
 
@@ -871,19 +871,19 @@  discard block
 block discarded – undo
871 871
 	 */
872 872
 	private function _set_registration_object() {
873 873
 		//get out if we've already set the object
874
-		if ( is_object( $this->_registration )) {
874
+		if (is_object($this->_registration)) {
875 875
 			return TRUE;
876 876
 		}
877 877
 
878 878
 	    $REG = EEM_Registration::instance();
879 879
 
880
-		$REG_ID = ( ! empty( $this->_req_data['_REG_ID'] )) ? absint( $this->_req_data['_REG_ID'] ) : FALSE;
880
+		$REG_ID = ( ! empty($this->_req_data['_REG_ID'])) ? absint($this->_req_data['_REG_ID']) : FALSE;
881 881
 
882
-		if ( $this->_registration = $REG->get_one_by_ID( $REG_ID ))
882
+		if ($this->_registration = $REG->get_one_by_ID($REG_ID))
883 883
 			return TRUE;
884 884
 		else {
885
-			$error_msg = sprintf( __('An error occurred and the details for Registration ID #%s could not be retrieved.', 'event_espresso'), $REG_ID );
886
-			EE_Error::add_error( $error_msg, __FILE__, __FUNCTION__, __LINE__ );
885
+			$error_msg = sprintf(__('An error occurred and the details for Registration ID #%s could not be retrieved.', 'event_espresso'), $REG_ID);
886
+			EE_Error::add_error($error_msg, __FILE__, __FUNCTION__, __LINE__);
887 887
 			$this->_registration = NULL;
888 888
 			return FALSE;
889 889
 		}
@@ -902,25 +902,25 @@  discard block
 block discarded – undo
902 902
 	 * @internal param bool $all whether to ignore all query params and just return ALL registrations (or count if count is set)
903 903
 	 * @return mixed (int|array)  int = count || array of registration objects
904 904
 	 */
905
-	public function get_registrations( $per_page = 10, $count = FALSE, $this_month = FALSE, $today = FALSE ) {
906
-
907
-		$EVT_ID = ! empty( $this->_req_data['event_id'] ) && $this->_req_data['event_id'] > 0 ? absint( $this->_req_data['event_id'] ) : FALSE;
908
-		$CAT_ID = ! empty( $this->_req_data['EVT_CAT'] ) && (int) $this->_req_data['EVT_CAT'] > 0? absint( $this->_req_data['EVT_CAT'] ) : FALSE;
909
-		$reg_status = ! empty( $this->_req_data['_reg_status'] ) ? sanitize_text_field( $this->_req_data['_reg_status'] ) : FALSE;
910
-		$month_range = ! empty( $this->_req_data['month_range'] ) ? sanitize_text_field( $this->_req_data['month_range'] ) : FALSE;//should be like 2013-april
911
-		$today_a = ! empty( $this->_req_data['status'] ) && $this->_req_data['status'] == 'today' ? TRUE : FALSE;
912
-		$this_month_a = ! empty( $this->_req_data['status'] ) && $this->_req_data['status'] == 'month' ? TRUE  : FALSE;
905
+	public function get_registrations($per_page = 10, $count = FALSE, $this_month = FALSE, $today = FALSE) {
906
+
907
+		$EVT_ID = ! empty($this->_req_data['event_id']) && $this->_req_data['event_id'] > 0 ? absint($this->_req_data['event_id']) : FALSE;
908
+		$CAT_ID = ! empty($this->_req_data['EVT_CAT']) && (int) $this->_req_data['EVT_CAT'] > 0 ? absint($this->_req_data['EVT_CAT']) : FALSE;
909
+		$reg_status = ! empty($this->_req_data['_reg_status']) ? sanitize_text_field($this->_req_data['_reg_status']) : FALSE;
910
+		$month_range = ! empty($this->_req_data['month_range']) ? sanitize_text_field($this->_req_data['month_range']) : FALSE; //should be like 2013-april
911
+		$today_a = ! empty($this->_req_data['status']) && $this->_req_data['status'] == 'today' ? TRUE : FALSE;
912
+		$this_month_a = ! empty($this->_req_data['status']) && $this->_req_data['status'] == 'month' ? TRUE : FALSE;
913 913
 		$start_date = FALSE;
914 914
 		$end_date = FALSE;
915 915
 		$_where = array();
916
-		$trash = ! empty( $this->_req_data['status'] ) && $this->_req_data['status'] == 'trash' ? TRUE : FALSE;
917
-		$incomplete = ! empty( $this->_req_data['status'] ) && $this->_req_data['status'] == 'incomplete' ? TRUE : FALSE;
916
+		$trash = ! empty($this->_req_data['status']) && $this->_req_data['status'] == 'trash' ? TRUE : FALSE;
917
+		$incomplete = ! empty($this->_req_data['status']) && $this->_req_data['status'] == 'incomplete' ? TRUE : FALSE;
918 918
 
919 919
 		//set orderby
920 920
 		$this->_req_data['orderby'] = ! empty($this->_req_data['orderby']) ? $this->_req_data['orderby'] : '';
921 921
 
922 922
 
923
-		switch ( $this->_req_data['orderby'] ) {
923
+		switch ($this->_req_data['orderby']) {
924 924
 			case '_REG_ID':
925 925
 				$orderby = 'REG_ID';
926 926
 				break;
@@ -940,26 +940,26 @@  discard block
 block discarded – undo
940 940
 				$orderby = 'REG_date';
941 941
 		}
942 942
 
943
-		$sort = ( isset( $this->_req_data['order'] ) && ! empty( $this->_req_data['order'] )) ? $this->_req_data['order'] : 'DESC';
944
-		$current_page = isset( $this->_req_data['paged'] ) && !empty( $this->_req_data['paged'] ) ? $this->_req_data['paged'] : 1;
945
-		$per_page = isset( $this->_req_data['perpage'] ) && !empty( $this->_req_data['perpage'] ) ? $this->_req_data['perpage'] : $per_page;
943
+		$sort = (isset($this->_req_data['order']) && ! empty($this->_req_data['order'])) ? $this->_req_data['order'] : 'DESC';
944
+		$current_page = isset($this->_req_data['paged']) && ! empty($this->_req_data['paged']) ? $this->_req_data['paged'] : 1;
945
+		$per_page = isset($this->_req_data['perpage']) && ! empty($this->_req_data['perpage']) ? $this->_req_data['perpage'] : $per_page;
946 946
 
947 947
 
948
-		$offset = ($current_page-1)*$per_page;
949
-		$limit = $count  ? NULL : array( $offset, $per_page );
948
+		$offset = ($current_page - 1) * $per_page;
949
+		$limit = $count ? NULL : array($offset, $per_page);
950 950
 
951
-		if($EVT_ID){
952
-			$_where['EVT_ID']=$EVT_ID;
951
+		if ($EVT_ID) {
952
+			$_where['EVT_ID'] = $EVT_ID;
953 953
 		}
954
-		if($CAT_ID){
954
+		if ($CAT_ID) {
955 955
 			$_where['Event.Term_Taxonomy.term_id'] = $CAT_ID;
956 956
 		}
957
-		if ( $incomplete ) {
957
+		if ($incomplete) {
958 958
 			$_where['STS_ID'] = EEM_Registration::status_id_incomplete;
959 959
 		} else if ( ! $trash) {
960
-			$_where['STS_ID'] = array( '!=', EEM_Registration::status_id_incomplete );
960
+			$_where['STS_ID'] = array('!=', EEM_Registration::status_id_incomplete);
961 961
 		}
962
-		if($reg_status){
962
+		if ($reg_status) {
963 963
 			$_where['STS_ID'] = $reg_status;
964 964
 		}
965 965
 
@@ -971,105 +971,105 @@  discard block
 block discarded – undo
971 971
 		$time_start = ' 00:00:00';
972 972
 		$time_end = ' 23:59:59';
973 973
 
974
-		if($today_a || $today ){
974
+		if ($today_a || $today) {
975 975
 			$curdate = date('Y-m-d', current_time('timestamp'));
976
-			$_where['REG_date']= array('BETWEEN',
976
+			$_where['REG_date'] = array('BETWEEN',
977 977
 				array(
978
-					EEM_Registration::instance()->convert_datetime_for_query( 'REG_date', $curdate . $time_start, 'Y-m-d H:i:s' ),
979
-					EEM_Registration::instance()->convert_datetime_for_query( 'REG_date', $curdate . $time_end, 'Y-m-d H:i:s' ),
978
+					EEM_Registration::instance()->convert_datetime_for_query('REG_date', $curdate.$time_start, 'Y-m-d H:i:s'),
979
+					EEM_Registration::instance()->convert_datetime_for_query('REG_date', $curdate.$time_end, 'Y-m-d H:i:s'),
980 980
 			));
981
-		}elseif($this_month_a || $this_month){
981
+		}elseif ($this_month_a || $this_month) {
982 982
 			$this_month_r = date('m', current_time('timestamp'));
983
-			$days_this_month = date( 't', current_time('timestamp') );
984
-			$_where['REG_date']= array('BETWEEN',
983
+			$days_this_month = date('t', current_time('timestamp'));
984
+			$_where['REG_date'] = array('BETWEEN',
985 985
 				array(
986
-					EEM_Registration::instance()->convert_datetime_for_query( 'REG_date', $this_year_r . '-' . $this_month_r . '-01' . ' ' . $time_start, 'Y-m-d H:i:s' ),
987
-					EEM_Registration::instance()->convert_datetime_for_query( 'REG_date', $this_year_r . '-' . $this_month_r . '-' . $days_this_month . ' ' . $time_end, 'Y-m-d H:i:s' )
986
+					EEM_Registration::instance()->convert_datetime_for_query('REG_date', $this_year_r.'-'.$this_month_r.'-01'.' '.$time_start, 'Y-m-d H:i:s'),
987
+					EEM_Registration::instance()->convert_datetime_for_query('REG_date', $this_year_r.'-'.$this_month_r.'-'.$days_this_month.' '.$time_end, 'Y-m-d H:i:s')
988 988
 			));
989
-		}elseif($month_range){
989
+		}elseif ($month_range) {
990 990
 			$pieces = explode(' ', $this->_req_data['month_range'], 3);
991
-			$month_r = !empty($pieces[0]) ? date('m', strtotime($pieces[0])) : '';
992
-			$year_r = !empty($pieces[1]) ? $pieces[1] : '';
993
-			$days_in_month = date('t', strtotime($year_r .  '-' . $month_r . '-' . '01') );
994
-			$_where['REG_date']= array('BETWEEN',
995
-				array(  EEM_Registration::instance()->convert_datetime_for_query( 'REG_date', $year_r . '-' . $month_r . '-01 00:00:00', 'Y-m-d H:i:s'), EEM_Registration::instance()->convert_datetime_for_query( 'REG_date', $year_r . '-' . $month_r . '-' . $days_in_month .  ' 23:59:59', 'Y-m-d H:i:s' ) ) );
996
-		}elseif($start_date && $end_date){
991
+			$month_r = ! empty($pieces[0]) ? date('m', strtotime($pieces[0])) : '';
992
+			$year_r = ! empty($pieces[1]) ? $pieces[1] : '';
993
+			$days_in_month = date('t', strtotime($year_r.'-'.$month_r.'-'.'01'));
994
+			$_where['REG_date'] = array('BETWEEN',
995
+				array(EEM_Registration::instance()->convert_datetime_for_query('REG_date', $year_r.'-'.$month_r.'-01 00:00:00', 'Y-m-d H:i:s'), EEM_Registration::instance()->convert_datetime_for_query('REG_date', $year_r.'-'.$month_r.'-'.$days_in_month.' 23:59:59', 'Y-m-d H:i:s')));
996
+		}elseif ($start_date && $end_date) {
997 997
 			throw new EE_Error("not yet supported");
998
-		}elseif($start_date){
998
+		}elseif ($start_date) {
999 999
 			throw new EE_Error("not yet supported");
1000
-		}elseif($end_date){
1000
+		}elseif ($end_date) {
1001 1001
 			throw new EE_Error("not yet supported");
1002 1002
 		}
1003 1003
 
1004
-		if ( ! empty( $this->_req_data['s'] ) ) {
1005
-			$sstr = '%' . $this->_req_data['s'] . '%';
1004
+		if ( ! empty($this->_req_data['s'])) {
1005
+			$sstr = '%'.$this->_req_data['s'].'%';
1006 1006
 			$_where['OR'] = array(
1007
-				'Event.EVT_name' => array( 'LIKE', $sstr),
1008
-				'Event.EVT_desc' => array( 'LIKE', $sstr ),
1009
-				'Event.EVT_short_desc' => array( 'LIKE' , $sstr ),
1010
-				'Attendee.ATT_full_name' => array( 'LIKE', $sstr ),
1011
-				'Attendee.ATT_fname' => array( 'LIKE', $sstr ),
1012
-				'Attendee.ATT_lname' => array( 'LIKE', $sstr ),
1013
-				'Attendee.ATT_short_bio' => array( 'LIKE', $sstr ),
1014
-				'Attendee.ATT_email' => array('LIKE', $sstr ),
1015
-				'Attendee.ATT_address' => array( 'LIKE', $sstr ),
1016
-				'Attendee.ATT_address2' => array( 'LIKE', $sstr ),
1017
-				'Attendee.ATT_city' => array( 'LIKE', $sstr ),
1018
-				'REG_final_price' => array( 'LIKE', $sstr ),
1019
-				'REG_code' => array( 'LIKE', $sstr ),
1020
-				'REG_count' => array( 'LIKE' , $sstr ),
1021
-				'REG_group_size' => array( 'LIKE' , $sstr ),
1022
-				'Ticket.TKT_name' => array( 'LIKE', $sstr ),
1023
-				'Ticket.TKT_description' => array( 'LIKE', $sstr ),
1024
-				'Transaction.Payment.PAY_txn_id_chq_nmbr' => array( 'LIKE', $sstr )
1007
+				'Event.EVT_name' => array('LIKE', $sstr),
1008
+				'Event.EVT_desc' => array('LIKE', $sstr),
1009
+				'Event.EVT_short_desc' => array('LIKE', $sstr),
1010
+				'Attendee.ATT_full_name' => array('LIKE', $sstr),
1011
+				'Attendee.ATT_fname' => array('LIKE', $sstr),
1012
+				'Attendee.ATT_lname' => array('LIKE', $sstr),
1013
+				'Attendee.ATT_short_bio' => array('LIKE', $sstr),
1014
+				'Attendee.ATT_email' => array('LIKE', $sstr),
1015
+				'Attendee.ATT_address' => array('LIKE', $sstr),
1016
+				'Attendee.ATT_address2' => array('LIKE', $sstr),
1017
+				'Attendee.ATT_city' => array('LIKE', $sstr),
1018
+				'REG_final_price' => array('LIKE', $sstr),
1019
+				'REG_code' => array('LIKE', $sstr),
1020
+				'REG_count' => array('LIKE', $sstr),
1021
+				'REG_group_size' => array('LIKE', $sstr),
1022
+				'Ticket.TKT_name' => array('LIKE', $sstr),
1023
+				'Ticket.TKT_description' => array('LIKE', $sstr),
1024
+				'Transaction.Payment.PAY_txn_id_chq_nmbr' => array('LIKE', $sstr)
1025 1025
 				);
1026 1026
 		}
1027 1027
 
1028 1028
 		//capability checks
1029
-		if ( ! EE_Registry::instance()->CAP->current_user_can('ee_read_others_registrations', 'get_registrations' ) ) {
1029
+		if ( ! EE_Registry::instance()->CAP->current_user_can('ee_read_others_registrations', 'get_registrations')) {
1030 1030
 			$_where['AND'] = array(
1031 1031
 				'Event.EVT_wp_user' => get_current_user_id()
1032 1032
 				);
1033 1033
 		}
1034 1034
 
1035 1035
 
1036
-		if( $count ){
1037
-			if ( $trash ) {
1038
-				return EEM_Registration::instance()->count_deleted( array( $_where ));
1039
-			} else if ( $incomplete ) {
1040
-				return EEM_Registration::instance()->count( array( $_where ));
1036
+		if ($count) {
1037
+			if ($trash) {
1038
+				return EEM_Registration::instance()->count_deleted(array($_where));
1039
+			} else if ($incomplete) {
1040
+				return EEM_Registration::instance()->count(array($_where));
1041 1041
 			} else {
1042
-				return EEM_Registration::instance()->count( array( $_where, 'default_where_conditions' => 'this_model_only' ));
1042
+				return EEM_Registration::instance()->count(array($_where, 'default_where_conditions' => 'this_model_only'));
1043 1043
 			}
1044 1044
 		} else {
1045 1045
 			//make sure we remove default where conditions cause all registrations matching query are returned
1046
-			$query_params = array( $_where, 'order_by' => array( $orderby => $sort ), 'default_where_conditions' => 'this_model_only' );
1047
-			if ( $per_page !== -1 ) {
1046
+			$query_params = array($_where, 'order_by' => array($orderby => $sort), 'default_where_conditions' => 'this_model_only');
1047
+			if ($per_page !== -1) {
1048 1048
 				$query_params['limit'] = $limit;
1049 1049
 			}
1050
-			$registrations =  $trash ? EEM_Registration::instance()->get_all_deleted($query_params) : EEM_Registration::instance()->get_all($query_params);
1050
+			$registrations = $trash ? EEM_Registration::instance()->get_all_deleted($query_params) : EEM_Registration::instance()->get_all($query_params);
1051 1051
 
1052 1052
 
1053
-			if ( $EVT_ID && isset( $registrations[0] ) && $registrations[0] instanceof EE_Registration &&  $registrations[0]->event_obj()) {
1053
+			if ($EVT_ID && isset($registrations[0]) && $registrations[0] instanceof EE_Registration && $registrations[0]->event_obj()) {
1054 1054
 				$first_registration = $registrations[0];
1055 1055
 				//EEH_Debug_Tools::printr( $registrations[0], '$registrations  <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span>', 'auto' );
1056 1056
 				$event_name = $first_registration->event_obj()->name();
1057
-				$event_date = $first_registration->date_obj()->start_date_and_time('l F j, Y,', 'g:i:s a');// isset( $registrations[0]->DTT_EVT_start ) ? date( 'l F j, Y,    g:i:s a', $registrations[0]->DTT_EVT_start ) : '';
1057
+				$event_date = $first_registration->date_obj()->start_date_and_time('l F j, Y,', 'g:i:s a'); // isset( $registrations[0]->DTT_EVT_start ) ? date( 'l F j, Y,    g:i:s a', $registrations[0]->DTT_EVT_start ) : '';
1058 1058
 				// edit event link
1059
-				if ( $event_name != '' ) {
1060
-					$edit_event_url = self::add_query_args_and_nonce( array( 'action'=>'edit_event', 'EVT_ID'=>$EVT_ID ), EVENTS_ADMIN_URL );
1061
-					$edit_event_lnk = '<a href="'.$edit_event_url.'" title="' . esc_attr__( 'Edit ', 'event_espresso' ) . $event_name . '">' . __( 'Edit Event', 'event_espresso' ) . '</a>';
1062
-					$event_name .= ' <span class="admin-page-header-edit-lnk not-bold">' . $edit_event_lnk . '</span>' ;
1059
+				if ($event_name != '') {
1060
+					$edit_event_url = self::add_query_args_and_nonce(array('action'=>'edit_event', 'EVT_ID'=>$EVT_ID), EVENTS_ADMIN_URL);
1061
+					$edit_event_lnk = '<a href="'.$edit_event_url.'" title="'.esc_attr__('Edit ', 'event_espresso').$event_name.'">'.__('Edit Event', 'event_espresso').'</a>';
1062
+					$event_name .= ' <span class="admin-page-header-edit-lnk not-bold">'.$edit_event_lnk.'</span>';
1063 1063
 				}
1064 1064
 
1065
-				$back_2_reg_url = self::add_query_args_and_nonce( array( 'action'=>'default' ), REG_ADMIN_URL );
1066
-				$back_2_reg_lnk = '<a href="'.$back_2_reg_url.'" title="' . esc_attr__( 'click to return to viewing all registrations ', 'event_espresso' ) . '">&laquo; ' . __( 'Back to All Registrations', 'event_espresso' ) . '</a>';
1065
+				$back_2_reg_url = self::add_query_args_and_nonce(array('action'=>'default'), REG_ADMIN_URL);
1066
+				$back_2_reg_lnk = '<a href="'.$back_2_reg_url.'" title="'.esc_attr__('click to return to viewing all registrations ', 'event_espresso').'">&laquo; '.__('Back to All Registrations', 'event_espresso').'</a>';
1067 1067
 
1068 1068
 				$this->_template_args['before_admin_page_content'] = '
1069 1069
 			<div id="admin-page-header">
1070
-				<h1><span class="small-text not-bold">'.__( 'Event: ', 'event_espresso' ).'</span>'. $event_name .'</h1>
1071
-				<h3><span class="small-text not-bold">'.__( 'Date: ', 'event_espresso' ). '</span>'. $event_date .'</h3>
1072
-				<span class="admin-page-header-go-back-lnk not-bold">' . $back_2_reg_lnk . '</span>
1070
+				<h1><span class="small-text not-bold">'.__('Event: ', 'event_espresso').'</span>'.$event_name.'</h1>
1071
+				<h3><span class="small-text not-bold">'.__('Date: ', 'event_espresso').'</span>'.$event_date.'</h3>
1072
+				<span class="admin-page-header-go-back-lnk not-bold">' . $back_2_reg_lnk.'</span>
1073 1073
 			</div>
1074 1074
 			';
1075 1075
 
@@ -1107,7 +1107,7 @@  discard block
 block discarded – undo
1107 1107
 
1108 1108
 		$this->_set_registration_object();
1109 1109
 
1110
-		if ( is_object( $this->_registration )) {
1110
+		if (is_object($this->_registration)) {
1111 1111
 			$transaction = $this->_registration->transaction() ? $this->_registration->transaction() : EE_Transaction::new_instance();
1112 1112
 			$this->_session = $transaction->session_data();
1113 1113
 
@@ -1115,10 +1115,10 @@  discard block
 block discarded – undo
1115 1115
 
1116 1116
 
1117 1117
 			$this->_template_args['reg_nmbr']['value'] = $this->_registration->ID();
1118
-			$this->_template_args['reg_nmbr']['label'] = __( 'Registration Number', 'event_espresso' );
1118
+			$this->_template_args['reg_nmbr']['label'] = __('Registration Number', 'event_espresso');
1119 1119
 
1120
-			$this->_template_args['reg_datetime']['value'] =  $this->_registration->get_i18n_datetime( 'REG_date' );
1121
-			$this->_template_args['reg_datetime']['label'] = __( 'Date', 'event_espresso' );
1120
+			$this->_template_args['reg_datetime']['value'] = $this->_registration->get_i18n_datetime('REG_date');
1121
+			$this->_template_args['reg_datetime']['label'] = __('Date', 'event_espresso');
1122 1122
 
1123 1123
 			$this->_template_args['grand_total'] = $transaction->total();
1124 1124
 
@@ -1126,19 +1126,19 @@  discard block
 block discarded – undo
1126 1126
 			// link back to overview
1127 1127
 			$this->_template_args['reg_overview_url'] = REG_ADMIN_URL;
1128 1128
 			$this->_template_args['registration'] = $this->_registration;
1129
-			$this->_template_args['filtered_registrations_link'] = EE_Admin_Page::add_query_args_and_nonce( array( 'action' => 'default', 'event_id' => $event_id ), REG_ADMIN_URL );
1130
-			$this->_template_args['filtered_transactions_link'] = EE_Admin_Page::add_query_args_and_nonce( array( 'action' => 'default', 'EVT_ID' => $event_id, 'page' => 'espresso_transactions' ), admin_url( 'admin.php' ) );
1131
-			$this->_template_args['event_link'] = EE_Admin_Page::add_query_args_and_nonce( array( 'page' => 'espresso_events', 'action' => 'edit', 'post' => $event_id ), admin_url( 'admin.php' ) );
1129
+			$this->_template_args['filtered_registrations_link'] = EE_Admin_Page::add_query_args_and_nonce(array('action' => 'default', 'event_id' => $event_id), REG_ADMIN_URL);
1130
+			$this->_template_args['filtered_transactions_link'] = EE_Admin_Page::add_query_args_and_nonce(array('action' => 'default', 'EVT_ID' => $event_id, 'page' => 'espresso_transactions'), admin_url('admin.php'));
1131
+			$this->_template_args['event_link'] = EE_Admin_Page::add_query_args_and_nonce(array('page' => 'espresso_events', 'action' => 'edit', 'post' => $event_id), admin_url('admin.php'));
1132 1132
 
1133 1133
 			//next and previous links
1134
-			$next_reg = $this->_registration->next(null, array(), 'REG_ID' );
1135
-			$this->_template_args['next_registration'] = $next_reg ? $this->_next_link( EE_Admin_Page::add_query_args_and_nonce( array( 'action' => 'view_registration', '_REG_ID' => $next_reg['REG_ID'] ), REG_ADMIN_URL ), 'dashicons dashicons-arrow-right ee-icon-size-22' ) : '';
1136
-			$previous_reg = $this->_registration->previous( null, array(), 'REG_ID' );
1137
-			$this->_template_args['previous_registration'] = $previous_reg ? $this->_previous_link( EE_Admin_Page::add_query_args_and_nonce( array( 'action' => 'view_registration', '_REG_ID' => $previous_reg['REG_ID'] ), REG_ADMIN_URL ), 'dashicons dashicons-arrow-left ee-icon-size-22' ) : '';
1134
+			$next_reg = $this->_registration->next(null, array(), 'REG_ID');
1135
+			$this->_template_args['next_registration'] = $next_reg ? $this->_next_link(EE_Admin_Page::add_query_args_and_nonce(array('action' => 'view_registration', '_REG_ID' => $next_reg['REG_ID']), REG_ADMIN_URL), 'dashicons dashicons-arrow-right ee-icon-size-22') : '';
1136
+			$previous_reg = $this->_registration->previous(null, array(), 'REG_ID');
1137
+			$this->_template_args['previous_registration'] = $previous_reg ? $this->_previous_link(EE_Admin_Page::add_query_args_and_nonce(array('action' => 'view_registration', '_REG_ID' => $previous_reg['REG_ID']), REG_ADMIN_URL), 'dashicons dashicons-arrow-left ee-icon-size-22') : '';
1138 1138
 
1139 1139
 			// grab header
1140
-			$template_path = REG_TEMPLATE_PATH . 'reg_admin_details_header.template.php';
1141
-			$this->_template_args['admin_page_header'] = EEH_Template::display_template( $template_path, $this->_template_args, TRUE );
1140
+			$template_path = REG_TEMPLATE_PATH.'reg_admin_details_header.template.php';
1141
+			$this->_template_args['admin_page_header'] = EEH_Template::display_template($template_path, $this->_template_args, TRUE);
1142 1142
 
1143 1143
 		} else {
1144 1144
 
@@ -1157,17 +1157,17 @@  discard block
 block discarded – undo
1157 1157
 
1158 1158
 
1159 1159
 	protected function _registration_details_metaboxes() {
1160
-		do_action( 'AHEE__Registrations_Admin_Page___registration_details_metabox__start', $this );
1160
+		do_action('AHEE__Registrations_Admin_Page___registration_details_metabox__start', $this);
1161 1161
 		$this->_set_registration_object();
1162 1162
 		$attendee = $this->_registration instanceof EE_Registration ? $this->_registration->attendee() : null;
1163
-		add_meta_box( 'edit-reg-status-mbox', __( 'Registration Status', 'event_espresso' ), array( $this, 'set_reg_status_buttons_metabox' ), $this->wp_page_slug, 'normal', 'high' );
1164
-		add_meta_box( 'edit-reg-details-mbox', __( 'Registration Details', 'event_espresso' ), array( $this, '_reg_details_meta_box' ), $this->wp_page_slug, 'normal', 'high' );
1165
-		if ( $attendee instanceof EE_Attendee && EE_Registry::instance()->CAP->current_user_can('ee_edit_registration', 'edit-reg-questions-mbox' ) ) {
1166
-			add_meta_box( 'edit-reg-questions-mbox', __( 'Registration Form Answers', 'event_espresso' ), array( $this, '_reg_questions_meta_box' ), $this->wp_page_slug, 'normal', 'high' );
1163
+		add_meta_box('edit-reg-status-mbox', __('Registration Status', 'event_espresso'), array($this, 'set_reg_status_buttons_metabox'), $this->wp_page_slug, 'normal', 'high');
1164
+		add_meta_box('edit-reg-details-mbox', __('Registration Details', 'event_espresso'), array($this, '_reg_details_meta_box'), $this->wp_page_slug, 'normal', 'high');
1165
+		if ($attendee instanceof EE_Attendee && EE_Registry::instance()->CAP->current_user_can('ee_edit_registration', 'edit-reg-questions-mbox')) {
1166
+			add_meta_box('edit-reg-questions-mbox', __('Registration Form Answers', 'event_espresso'), array($this, '_reg_questions_meta_box'), $this->wp_page_slug, 'normal', 'high');
1167 1167
 		}
1168
-		add_meta_box( 'edit-reg-registrant-mbox', __( 'Contact Details', 'event_espresso' ), array( $this, '_reg_registrant_side_meta_box' ), $this->wp_page_slug, 'side', 'high' );
1169
-		if ( $this->_registration->group_size() > 1 ) {
1170
-			add_meta_box( 'edit-reg-attendees-mbox', __( 'Other Registrations in this Transaction', 'event_espresso' ), array( $this, '_reg_attendees_meta_box' ), $this->wp_page_slug, 'normal', 'high' );
1168
+		add_meta_box('edit-reg-registrant-mbox', __('Contact Details', 'event_espresso'), array($this, '_reg_registrant_side_meta_box'), $this->wp_page_slug, 'side', 'high');
1169
+		if ($this->_registration->group_size() > 1) {
1170
+			add_meta_box('edit-reg-attendees-mbox', __('Other Registrations in this Transaction', 'event_espresso'), array($this, '_reg_attendees_meta_box'), $this->wp_page_slug, 'normal', 'high');
1171 1171
 		}
1172 1172
 	}
1173 1173
 
@@ -1188,23 +1188,23 @@  discard block
 block discarded – undo
1188 1188
 
1189 1189
 		//let's get an array of all possible buttons that we can just reference
1190 1190
 		$status_buttons = $this->_get_reg_status_buttons();
1191
-		$template_args[ 'reg_status_value' ] = $this->_registration->pretty_status();
1192
-		$template_args[ 'reg_status_class' ] = 'status-' . $this->_registration->status_ID();
1191
+		$template_args['reg_status_value'] = $this->_registration->pretty_status();
1192
+		$template_args['reg_status_class'] = 'status-'.$this->_registration->status_ID();
1193 1193
 		$template_args['attendee'] = $this->_registration->attendee();
1194
-		$template = REG_TEMPLATE_PATH . 'reg_status_change_buttons.template.php';
1195
-		if ( $this->_set_registration_object() ) {
1194
+		$template = REG_TEMPLATE_PATH.'reg_status_change_buttons.template.php';
1195
+		if ($this->_set_registration_object()) {
1196 1196
 			$current_status = $this->_registration->status_ID();
1197
-			unset( $status_buttons[$current_status] );
1198
-			if ( $current_status != EEM_Registration::status_id_pending_payment && $is_complete ) {
1199
-				unset( $status_buttons[EEM_Registration::status_id_pending_payment] );
1197
+			unset($status_buttons[$current_status]);
1198
+			if ($current_status != EEM_Registration::status_id_pending_payment && $is_complete) {
1199
+				unset($status_buttons[EEM_Registration::status_id_pending_payment]);
1200 1200
 			}
1201
-			$template_args['status_buttons'] = implode( "\n", $status_buttons );
1201
+			$template_args['status_buttons'] = implode("\n", $status_buttons);
1202 1202
 		}
1203 1203
 		$template_args['form_url'] = REG_ADMIN_URL;
1204 1204
 		$template_args['REG_ID'] = $this->_registration->ID();
1205
-		$template_args['nonce'] = wp_nonce_field( 'change_reg_status_nonce',  'change_reg_status_nonce', FALSE, FALSE );
1205
+		$template_args['nonce'] = wp_nonce_field('change_reg_status_nonce', 'change_reg_status_nonce', FALSE, FALSE);
1206 1206
 
1207
-		EEH_Template::display_template( $template, $template_args );
1207
+		EEH_Template::display_template($template, $template_args);
1208 1208
 
1209 1209
 	}
1210 1210
 
@@ -1218,11 +1218,11 @@  discard block
 block discarded – undo
1218 1218
 	private function _get_reg_status_buttons() {
1219 1219
 
1220 1220
 		$buttons = array(
1221
-			EEM_Registration::status_id_approved => '<input type="submit" name="_reg_status_id" class="button-secondary ee-status-strip reg-status-' . EEM_Registration::status_id_approved . '" value="' . EEH_Template::pretty_status( EEM_Registration::status_id_approved, FALSE, 'sentence' ) . '">',
1222
-			EEM_Registration::status_id_pending_payment => '<input type="submit" name="_reg_status_id" class="button-secondary ee-status-strip reg-status-' . EEM_Registration::status_id_pending_payment . '" value="' . EEH_Template::pretty_status( EEM_Registration::status_id_pending_payment, FALSE, 'sentence' ) . '">',
1223
-			EEM_Registration::status_id_not_approved => '<input type="submit" name="_reg_status_id" class="button-secondary ee-status-strip reg-status-' . EEM_Registration::status_id_not_approved . '" value="' . EEH_Template::pretty_status( EEM_Registration::status_id_not_approved, FALSE, 'sentence' ) . '">',
1224
-			EEM_Registration::status_id_declined => '<input type="submit" name="_reg_status_id" class="button-secondary ee-status-strip reg-status-' . EEM_Registration::status_id_declined . '" value="' . EEH_Template::pretty_status( EEM_Registration::status_id_declined, FALSE, 'sentence' ) . '">',
1225
-			EEM_Registration::status_id_cancelled =>'<input type="submit" name="_reg_status_id" class="button-secondary ee-status-strip reg-status-' . EEM_Registration::status_id_cancelled . '" value="' . EEH_Template::pretty_status( EEM_Registration::status_id_cancelled, FALSE, 'sentence' ) . '">',
1221
+			EEM_Registration::status_id_approved => '<input type="submit" name="_reg_status_id" class="button-secondary ee-status-strip reg-status-'.EEM_Registration::status_id_approved.'" value="'.EEH_Template::pretty_status(EEM_Registration::status_id_approved, FALSE, 'sentence').'">',
1222
+			EEM_Registration::status_id_pending_payment => '<input type="submit" name="_reg_status_id" class="button-secondary ee-status-strip reg-status-'.EEM_Registration::status_id_pending_payment.'" value="'.EEH_Template::pretty_status(EEM_Registration::status_id_pending_payment, FALSE, 'sentence').'">',
1223
+			EEM_Registration::status_id_not_approved => '<input type="submit" name="_reg_status_id" class="button-secondary ee-status-strip reg-status-'.EEM_Registration::status_id_not_approved.'" value="'.EEH_Template::pretty_status(EEM_Registration::status_id_not_approved, FALSE, 'sentence').'">',
1224
+			EEM_Registration::status_id_declined => '<input type="submit" name="_reg_status_id" class="button-secondary ee-status-strip reg-status-'.EEM_Registration::status_id_declined.'" value="'.EEH_Template::pretty_status(EEM_Registration::status_id_declined, FALSE, 'sentence').'">',
1225
+			EEM_Registration::status_id_cancelled =>'<input type="submit" name="_reg_status_id" class="button-secondary ee-status-strip reg-status-'.EEM_Registration::status_id_cancelled.'" value="'.EEH_Template::pretty_status(EEM_Registration::status_id_cancelled, FALSE, 'sentence').'">',
1226 1226
 			);
1227 1227
 		return $buttons;
1228 1228
 	}
@@ -1236,13 +1236,13 @@  discard block
 block discarded – undo
1236 1236
 	 *
1237 1237
 	 * @return array  (array with reg_id(s) updated and whether update was successful.
1238 1238
 	 */
1239
-	protected function _set_registration_status_from_request( $status = false, $notify = false ) {
1240
-		$REG_ID = isset( $this->_req_data['_REG_ID'] ) ? (array) $this->_req_data['_REG_ID'] : array();
1239
+	protected function _set_registration_status_from_request($status = false, $notify = false) {
1240
+		$REG_ID = isset($this->_req_data['_REG_ID']) ? (array) $this->_req_data['_REG_ID'] : array();
1241 1241
 
1242
-		$success = $this->_set_registration_status( $REG_ID, $status );
1242
+		$success = $this->_set_registration_status($REG_ID, $status);
1243 1243
 
1244 1244
 		//notify?
1245
-		if ( $success && $notify && EE_Registry::instance()->CAP->current_user_can( 'ee_send_message', 'espresso_registrations_resend_registration' ) ) {
1245
+		if ($success && $notify && EE_Registry::instance()->CAP->current_user_can('ee_send_message', 'espresso_registrations_resend_registration')) {
1246 1246
 			$this->_process_resend_registration();
1247 1247
 		}
1248 1248
 
@@ -1260,19 +1260,19 @@  discard block
 block discarded – undo
1260 1260
 	 * @param bool $status
1261 1261
 	 * @return array (an array with 'success' key representing whether status change was successful, and 'REG_ID' as the array of updated registrations).
1262 1262
 	 */
1263
-	protected function _set_registration_status( $REG_ID, $status = false ) {
1263
+	protected function _set_registration_status($REG_ID, $status = false) {
1264 1264
 		$success = true;
1265 1265
 		// set default status if none is passed
1266 1266
 		$status = $status ? $status : EEM_Registration::status_id_pending_payment;
1267 1267
 
1268 1268
 		//typecast and sanitize reg_id
1269
-		$reg_ids = array_filter( (array) $REG_ID, 'absint' );
1269
+		$reg_ids = array_filter((array) $REG_ID, 'absint');
1270 1270
 
1271 1271
 		//loop through REG_ID's and change status
1272
-		foreach ( $reg_ids as $r_id ) {
1273
-			$registration = EEM_Registration::instance()->get_one_by_ID( $r_id );
1274
-			if ( $registration instanceof EE_Registration ) {
1275
-				$registration->set_status( $status );
1272
+		foreach ($reg_ids as $r_id) {
1273
+			$registration = EEM_Registration::instance()->get_one_by_ID($r_id);
1274
+			if ($registration instanceof EE_Registration) {
1275
+				$registration->set_status($status);
1276 1276
 				$result = $registration->save();
1277 1277
 
1278 1278
 				//verifying explicit fails because update *may* just return 0 for 0 rows affected
@@ -1284,7 +1284,7 @@  discard block
 block discarded – undo
1284 1284
 		$this->_req_data['_REG_ID'] = $reg_ids;
1285 1285
 
1286 1286
 		//return $success and processed registrations
1287
-		return array( 'REG_ID' => $reg_ids, 'success' => $success );
1287
+		return array('REG_ID' => $reg_ids, 'success' => $success);
1288 1288
 	}
1289 1289
 
1290 1290
 
@@ -1296,37 +1296,37 @@  discard block
 block discarded – undo
1296 1296
 	 * @param   bool    $notify indicates whether the _set_registration_status_from_request does notifications or not.
1297 1297
 	 * @return void
1298 1298
 	 */
1299
-	protected function _reg_status_change_return( $STS_ID, $notify = false ) {
1299
+	protected function _reg_status_change_return($STS_ID, $notify = false) {
1300 1300
 
1301
-		$result = ! empty( $STS_ID ) ? $this->_set_registration_status_from_request( $STS_ID, $notify ) : array( 'success' => false );
1301
+		$result = ! empty($STS_ID) ? $this->_set_registration_status_from_request($STS_ID, $notify) : array('success' => false);
1302 1302
 
1303 1303
 
1304
-		$success = isset( $result['success'] ) && $result['success'];
1304
+		$success = isset($result['success']) && $result['success'];
1305 1305
 
1306 1306
 		//setup success message
1307
-		if ( $success ) {
1308
-			$msg = is_array( $result['REG_ID'] ) && count( $result['REG_ID'] ) > 1  ? sprintf( __('Registration status has been set to %s', 'event_espresso'), EEH_Template::pretty_status($STS_ID, false, 'lower' ) ) :  sprintf( __('Registrations have been set to %s.', 'event_espresso'), EEH_Template::pretty_status($STS_ID, false, 'lower' ) ) ;
1309
-			EE_Error::add_success( $msg );
1307
+		if ($success) {
1308
+			$msg = is_array($result['REG_ID']) && count($result['REG_ID']) > 1 ? sprintf(__('Registration status has been set to %s', 'event_espresso'), EEH_Template::pretty_status($STS_ID, false, 'lower')) : sprintf(__('Registrations have been set to %s.', 'event_espresso'), EEH_Template::pretty_status($STS_ID, false, 'lower'));
1309
+			EE_Error::add_success($msg);
1310 1310
 		} else {
1311
-			EE_Error::add_error( __('Something went wrong, and the status was not changed', 'event_espresso' ), __FILE__, __LINE__, __FUNCTION__ );
1311
+			EE_Error::add_error(__('Something went wrong, and the status was not changed', 'event_espresso'), __FILE__, __LINE__, __FUNCTION__);
1312 1312
 		}
1313 1313
 
1314
-		$route = isset( $this->_req_data['return'] ) && $this->_req_data['return'] == 'view_registration' ? array( 'action' => 'view_registration', '_REG_ID' => $result['REG_ID'][0] ) : array( 'action' => 'default' );
1314
+		$route = isset($this->_req_data['return']) && $this->_req_data['return'] == 'view_registration' ? array('action' => 'view_registration', '_REG_ID' => $result['REG_ID'][0]) : array('action' => 'default');
1315 1315
 		//unset nonces
1316
-		foreach ( $this->_req_data as $ref => $value ) {
1317
-			if ( strpos( $ref, 'nonce' ) !== false ) {
1318
-				unset( $this->_req_data[$ref] );
1316
+		foreach ($this->_req_data as $ref => $value) {
1317
+			if (strpos($ref, 'nonce') !== false) {
1318
+				unset($this->_req_data[$ref]);
1319 1319
 				continue;
1320 1320
 			}
1321 1321
 
1322
-			$value = is_array( $value ) ? array_map( 'urlencode', $value ) : urlencode( $value );
1322
+			$value = is_array($value) ? array_map('urlencode', $value) : urlencode($value);
1323 1323
 			$this->_req_data[$ref] = $value;
1324 1324
 		}
1325 1325
 
1326 1326
 		//merge request vars so that the reloaded list table contains any existing filter query params
1327
-		$route = array_merge( $this->_req_data, $route );
1327
+		$route = array_merge($this->_req_data, $route);
1328 1328
 
1329
-		$this->_redirect_after_action( false, '', '', $route, true );
1329
+		$this->_redirect_after_action(false, '', '', $route, true);
1330 1330
 	}
1331 1331
 
1332 1332
 
@@ -1338,29 +1338,29 @@  discard block
 block discarded – undo
1338 1338
 	protected function _change_reg_status() {
1339 1339
 		$this->_req_data['return'] = 'view_registration';
1340 1340
 		//set notify based on whether the send notifications toggle is set or not
1341
-		$notify = ! empty( $this->_req_data['txn_reg_status_change']['send_notifications'] );
1342
-		$this->_req_data[ '_reg_status_id' ] = isset( $this->_req_data[ '_reg_status_id' ] ) ? $this->_req_data[ '_reg_status_id' ] : '';
1341
+		$notify = ! empty($this->_req_data['txn_reg_status_change']['send_notifications']);
1342
+		$this->_req_data['_reg_status_id'] = isset($this->_req_data['_reg_status_id']) ? $this->_req_data['_reg_status_id'] : '';
1343 1343
 
1344
-		switch ( $this->_req_data['_reg_status_id'] ) {
1345
-			case EEH_Template::pretty_status( EEM_Registration::status_id_approved, false, 'sentence' ) :
1346
-				$this->approve_registration( $notify );
1344
+		switch ($this->_req_data['_reg_status_id']) {
1345
+			case EEH_Template::pretty_status(EEM_Registration::status_id_approved, false, 'sentence') :
1346
+				$this->approve_registration($notify);
1347 1347
 				break;
1348
-			case EEH_Template::pretty_status( EEM_Registration::status_id_pending_payment, false, 'sentence' ) :
1349
-				$this->pending_registration( $notify );
1348
+			case EEH_Template::pretty_status(EEM_Registration::status_id_pending_payment, false, 'sentence') :
1349
+				$this->pending_registration($notify);
1350 1350
 				break;
1351
-			case EEH_Template::pretty_status( EEM_Registration::status_id_not_approved, false, 'sentence' ) :
1352
-				$this->not_approve_registration( $notify );
1351
+			case EEH_Template::pretty_status(EEM_Registration::status_id_not_approved, false, 'sentence') :
1352
+				$this->not_approve_registration($notify);
1353 1353
 				break;
1354
-			case EEH_Template::pretty_status( EEM_Registration::status_id_declined, false, 'sentence' ) :
1355
-				$this->decline_registration( $notify );
1354
+			case EEH_Template::pretty_status(EEM_Registration::status_id_declined, false, 'sentence') :
1355
+				$this->decline_registration($notify);
1356 1356
 				break;
1357
-			case EEH_Template::pretty_status( EEM_Registration::status_id_cancelled, false, 'sentence' ) :
1358
-				$this->cancel_registration( $notify );
1357
+			case EEH_Template::pretty_status(EEM_Registration::status_id_cancelled, false, 'sentence') :
1358
+				$this->cancel_registration($notify);
1359 1359
 				break;
1360 1360
 			default :
1361 1361
 				$result['success'] = false;
1362
-				unset( $this->_req_data['return'] );
1363
-				$this->_reg_status_change_return( '', false );
1362
+				unset($this->_req_data['return']);
1363
+				$this->_reg_status_change_return('', false);
1364 1364
 				break;
1365 1365
 		}
1366 1366
 	}
@@ -1373,8 +1373,8 @@  discard block
 block discarded – undo
1373 1373
 	*		@param bool $notify whether or not to notify the registrant about their approval.
1374 1374
 	*		@return void
1375 1375
 	*/
1376
-	protected function approve_registration( $notify = false ) {
1377
-		$this->_reg_status_change_return( EEM_Registration::status_id_approved, $notify );
1376
+	protected function approve_registration($notify = false) {
1377
+		$this->_reg_status_change_return(EEM_Registration::status_id_approved, $notify);
1378 1378
 	}
1379 1379
 
1380 1380
 
@@ -1386,8 +1386,8 @@  discard block
 block discarded – undo
1386 1386
 	*		@param bool $notify whether or not to notify the registrant about their approval.
1387 1387
 	*		@return void
1388 1388
 	*/
1389
-	protected function decline_registration( $notify = false ) {
1390
-		$this->_reg_status_change_return( EEM_Registration::status_id_declined, $notify );
1389
+	protected function decline_registration($notify = false) {
1390
+		$this->_reg_status_change_return(EEM_Registration::status_id_declined, $notify);
1391 1391
 	}
1392 1392
 
1393 1393
 
@@ -1399,8 +1399,8 @@  discard block
 block discarded – undo
1399 1399
 	*		@param bool $notify whether or not to notify the registrant about their approval.
1400 1400
 	*		@return void
1401 1401
 	*/
1402
-	protected function cancel_registration( $notify = false ) {
1403
-		$this->_reg_status_change_return( EEM_Registration::status_id_cancelled, $notify );
1402
+	protected function cancel_registration($notify = false) {
1403
+		$this->_reg_status_change_return(EEM_Registration::status_id_cancelled, $notify);
1404 1404
 	}
1405 1405
 
1406 1406
 
@@ -1413,8 +1413,8 @@  discard block
 block discarded – undo
1413 1413
 	*		@param bool $notify whether or not to notify the registrant about their approval.
1414 1414
 	*		@return void
1415 1415
 	*/
1416
-	protected function not_approve_registration( $notify = false ) {
1417
-		$this->_reg_status_change_return( EEM_Registration::status_id_not_approved, $notify );
1416
+	protected function not_approve_registration($notify = false) {
1417
+		$this->_reg_status_change_return(EEM_Registration::status_id_not_approved, $notify);
1418 1418
 	}
1419 1419
 
1420 1420
 
@@ -1425,8 +1425,8 @@  discard block
 block discarded – undo
1425 1425
 	*		@param bool $notify whether or not to notify the registrant about their approval.
1426 1426
 	*		@return void
1427 1427
 	*/
1428
-	protected function pending_registration( $notify = false ) {
1429
-		$this->_reg_status_change_return( EEM_Registration::status_id_pending_payment, $notify );
1428
+	protected function pending_registration($notify = false) {
1429
+		$this->_reg_status_change_return(EEM_Registration::status_id_pending_payment, $notify);
1430 1430
 	}
1431 1431
 
1432 1432
 
@@ -1440,75 +1440,75 @@  discard block
 block discarded – undo
1440 1440
 	public function _reg_details_meta_box() {
1441 1441
 		EEH_Autoloader::register_line_item_display_autoloaders();
1442 1442
 		EEH_Autoloader::register_line_item_filter_autoloaders();
1443
-		EE_Registry::instance()->load_Helper( 'Line_Item' );
1443
+		EE_Registry::instance()->load_Helper('Line_Item');
1444 1444
 		$transaction = $this->_registration->transaction() ? $this->_registration->transaction() : EE_Transaction::new_instance();
1445 1445
 		$this->_session = $transaction->session_data();
1446 1446
 
1447 1447
 		$filters = new EE_Line_Item_Filter_Collection();
1448
-		$filters->add( new EE_Single_Registration_Line_Item_Filter( $this->_registration ) );
1449
-		$filters->add( new EE_Non_Zero_Line_Item_Filter() );
1450
-		$line_item_filter_processor = new EE_Line_Item_Filter_Processor( $filters, $transaction->total_line_item() );
1448
+		$filters->add(new EE_Single_Registration_Line_Item_Filter($this->_registration));
1449
+		$filters->add(new EE_Non_Zero_Line_Item_Filter());
1450
+		$line_item_filter_processor = new EE_Line_Item_Filter_Processor($filters, $transaction->total_line_item());
1451 1451
 		$filtered_line_item_tree = $line_item_filter_processor->process();
1452 1452
 
1453 1453
 		$this->_template_args['REG_ID'] = $this->_registration->ID();
1454
-		$line_item_display = new EE_Line_Item_Display( 'reg_admin_table', 'EE_Admin_Table_Registration_Line_Item_Display_Strategy' );
1455
-		$this->_template_args['line_item_table'] = $line_item_display->display_line_item( $filtered_line_item_tree, array( 'EE_Registration' => $this->_registration ) );
1454
+		$line_item_display = new EE_Line_Item_Display('reg_admin_table', 'EE_Admin_Table_Registration_Line_Item_Display_Strategy');
1455
+		$this->_template_args['line_item_table'] = $line_item_display->display_line_item($filtered_line_item_tree, array('EE_Registration' => $this->_registration));
1456 1456
 
1457 1457
 
1458 1458
 		$attendee = $this->_registration->attendee();
1459 1459
 
1460 1460
 
1461
-		$this->_template_args['view_transaction_button'] = EE_Registry::instance()->CAP->current_user_can( 'ee_read_transaction', 'espresso_transactions_view_transaction' ) ?EEH_Template::get_button_or_link( EE_Admin_Page::add_query_args_and_nonce( array('action'=> 'view_transaction', 'TXN_ID' => $transaction->ID() ), TXN_ADMIN_URL ), __(' View Transaction'), 'button secondary-button right', 'dashicons dashicons-cart' ) : '';
1462
-		$this->_template_args['resend_registration_button'] = $attendee instanceof EE_Attendee && EE_Registry::instance()->CAP->current_user_can( 'ee_send_message', 'espresso_registrations_resend_registration' ) ?EEH_Template::get_button_or_link( EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'resend_registration', '_REG_ID'=>$this->_registration->ID(), 'redirect_to' => 'view_registration' ), REG_ADMIN_URL ), __(' Resend Registration'), 'button secondary-button right', 'dashicons dashicons-email-alt' ) : '';
1461
+		$this->_template_args['view_transaction_button'] = EE_Registry::instance()->CAP->current_user_can('ee_read_transaction', 'espresso_transactions_view_transaction') ? EEH_Template::get_button_or_link(EE_Admin_Page::add_query_args_and_nonce(array('action'=> 'view_transaction', 'TXN_ID' => $transaction->ID()), TXN_ADMIN_URL), __(' View Transaction'), 'button secondary-button right', 'dashicons dashicons-cart') : '';
1462
+		$this->_template_args['resend_registration_button'] = $attendee instanceof EE_Attendee && EE_Registry::instance()->CAP->current_user_can('ee_send_message', 'espresso_registrations_resend_registration') ? EEH_Template::get_button_or_link(EE_Admin_Page::add_query_args_and_nonce(array('action'=>'resend_registration', '_REG_ID'=>$this->_registration->ID(), 'redirect_to' => 'view_registration'), REG_ADMIN_URL), __(' Resend Registration'), 'button secondary-button right', 'dashicons dashicons-email-alt') : '';
1463 1463
 
1464 1464
 
1465 1465
 		$this->_template_args['currency_sign'] = EE_Registry::instance()->CFG->currency->sign;
1466
-		$payment = $transaction->get_first_related( 'Payment' );
1466
+		$payment = $transaction->get_first_related('Payment');
1467 1467
 		$payment = ! $payment instanceof EE_Payment ? EE_Payment::new_instance() : $payment;
1468
-		$payment_method = $payment->get_first_related( 'Payment_Method' );
1468
+		$payment_method = $payment->get_first_related('Payment_Method');
1469 1469
 		$payment_method = ! $payment_method instanceof EE_Payment_Method ? EE_Payment_Method::new_instance() : $payment_method;
1470
-		$reg_status_class = 'status-' . $this->_registration->status_ID();
1470
+		$reg_status_class = 'status-'.$this->_registration->status_ID();
1471 1471
 		$reg_details = array(
1472 1472
 			'payment_method' => $payment_method->name(),
1473 1473
 			'response_msg' => $payment->gateway_response(),
1474
-			'registration_id' => $this->_registration->get( 'REG_code' ),
1474
+			'registration_id' => $this->_registration->get('REG_code'),
1475 1475
 			'registration_session' => $this->_registration->session_ID(),
1476
-			'ip_address' => isset( $this->_session['ip_address'] ) ? $this->_session['ip_address'] : '',
1477
-			'user_agent' => isset( $this->_session['user_agent'] ) ? $this->_session['user_agent'] : '',
1476
+			'ip_address' => isset($this->_session['ip_address']) ? $this->_session['ip_address'] : '',
1477
+			'user_agent' => isset($this->_session['user_agent']) ? $this->_session['user_agent'] : '',
1478 1478
 			);
1479 1479
 
1480 1480
 
1481
-		if ( isset( $reg_details['registration_id'] )) {
1481
+		if (isset($reg_details['registration_id'])) {
1482 1482
 			$this->_template_args['reg_details']['registration_id']['value'] = $reg_details['registration_id'];
1483
-			$this->_template_args['reg_details']['registration_id']['label'] = __( 'Registration ID', 'event_espresso' );
1483
+			$this->_template_args['reg_details']['registration_id']['label'] = __('Registration ID', 'event_espresso');
1484 1484
 			$this->_template_args['reg_details']['registration_id']['class'] = 'regular-text';
1485 1485
 		}
1486 1486
 
1487
-		if ( isset( $reg_details['payment_method'] ) ) {
1487
+		if (isset($reg_details['payment_method'])) {
1488 1488
 			$this->_template_args['reg_details']['payment_method']['value'] = $reg_details['payment_method'];
1489
-			$this->_template_args['reg_details']['payment_method']['label'] = __( 'Most Recent Payment Method', 'event_espresso' );
1489
+			$this->_template_args['reg_details']['payment_method']['label'] = __('Most Recent Payment Method', 'event_espresso');
1490 1490
 			$this->_template_args['reg_details']['payment_method']['class'] = 'regular-text';
1491 1491
 			$this->_template_args['reg_details']['response_msg']['value'] = $reg_details['response_msg'];
1492
-			$this->_template_args['reg_details']['response_msg']['label'] = __( 'Payment method response', 'event_espresso' );
1492
+			$this->_template_args['reg_details']['response_msg']['label'] = __('Payment method response', 'event_espresso');
1493 1493
 			$this->_template_args['reg_details']['response_msg']['class'] = 'regular-text';
1494 1494
 		}
1495 1495
 
1496 1496
 		$this->_template_args['reg_details']['registration_session']['value'] = $reg_details['registration_session'];
1497
-		$this->_template_args['reg_details']['registration_session']['label'] = __( 'Registration Session', 'event_espresso' );
1497
+		$this->_template_args['reg_details']['registration_session']['label'] = __('Registration Session', 'event_espresso');
1498 1498
 		$this->_template_args['reg_details']['registration_session']['class'] = 'regular-text';
1499 1499
 
1500 1500
 		$this->_template_args['reg_details']['ip_address']['value'] = $reg_details['ip_address'];
1501
-		$this->_template_args['reg_details']['ip_address']['label'] = __( 'Registration placed from IP', 'event_espresso' );
1501
+		$this->_template_args['reg_details']['ip_address']['label'] = __('Registration placed from IP', 'event_espresso');
1502 1502
 		$this->_template_args['reg_details']['ip_address']['class'] = 'regular-text';
1503 1503
 
1504 1504
 		$this->_template_args['reg_details']['user_agent']['value'] = $reg_details['user_agent'];
1505
-		$this->_template_args['reg_details']['user_agent']['label'] = __( 'Registrant User Agent', 'event_espresso' );
1505
+		$this->_template_args['reg_details']['user_agent']['label'] = __('Registrant User Agent', 'event_espresso');
1506 1506
 		$this->_template_args['reg_details']['user_agent']['class'] = 'large-text';
1507 1507
 
1508
-		$this->_template_args['event_link'] = EE_Admin_Page::add_query_args_and_nonce( array( 'action' => 'default', 'event_id' => $this->_registration->event_ID()), REG_ADMIN_URL );
1508
+		$this->_template_args['event_link'] = EE_Admin_Page::add_query_args_and_nonce(array('action' => 'default', 'event_id' => $this->_registration->event_ID()), REG_ADMIN_URL);
1509 1509
 
1510
-		$template_path = REG_TEMPLATE_PATH . 'reg_admin_details_main_meta_box_reg_details.template.php';
1511
-		echo EEH_Template::display_template( $template_path, $this->_template_args, TRUE );
1510
+		$template_path = REG_TEMPLATE_PATH.'reg_admin_details_main_meta_box_reg_details.template.php';
1511
+		echo EEH_Template::display_template($template_path, $this->_template_args, TRUE);
1512 1512
 
1513 1513
 	}
1514 1514
 
@@ -1522,14 +1522,14 @@  discard block
 block discarded – undo
1522 1522
 	*/
1523 1523
 	public function _reg_questions_meta_box() {
1524 1524
 		//allow someone to override this method entirely
1525
-		if( apply_filters( 'FHEE__Registrations_Admin_Page___reg_questions_meta_box__do_default', true, $this, $this->_registration ) ) {
1526
-			$form = $this->_get_reg_custom_questions_form( $this->_registration->ID() );
1527
-			$this->_template_args[ 'att_questions' ] = count( $form->subforms() ) > 0 ? $form->get_html_and_js() : '';
1525
+		if (apply_filters('FHEE__Registrations_Admin_Page___reg_questions_meta_box__do_default', true, $this, $this->_registration)) {
1526
+			$form = $this->_get_reg_custom_questions_form($this->_registration->ID());
1527
+			$this->_template_args['att_questions'] = count($form->subforms()) > 0 ? $form->get_html_and_js() : '';
1528 1528
 			$this->_template_args['reg_questions_form_action'] = 'edit_registration';
1529 1529
 			$this->_template_args['REG_ID'] = $this->_registration->ID();
1530 1530
 
1531
-			$template_path = REG_TEMPLATE_PATH . 'reg_admin_details_main_meta_box_reg_questions.template.php';
1532
-			echo EEH_Template::display_template( $template_path, $this->_template_args, TRUE );
1531
+			$template_path = REG_TEMPLATE_PATH.'reg_admin_details_main_meta_box_reg_questions.template.php';
1532
+			echo EEH_Template::display_template($template_path, $this->_template_args, TRUE);
1533 1533
 		}
1534 1534
 	}
1535 1535
 
@@ -1543,12 +1543,12 @@  discard block
 block discarded – undo
1543 1543
 	 * @param        string $output
1544 1544
 	 * @return        string
1545 1545
 	 */
1546
-	public function form_before_question_group( $output ) {
1546
+	public function form_before_question_group($output) {
1547 1547
 		EE_Error::doing_it_wrong(
1548
-			__CLASS__ . '::' . __FUNCTION__,
1549
-			__( 'This method would have been protected but was used on a filter callback'
1548
+			__CLASS__.'::'.__FUNCTION__,
1549
+			__('This method would have been protected but was used on a filter callback'
1550 1550
 				. 'so needed to be public. Please discontinue usage as it will be removed soon.',
1551
-				'event_espresso' ),
1551
+				'event_espresso'),
1552 1552
 			'4.8.32.rc.000'
1553 1553
 		);
1554 1554
 		return '
@@ -1567,20 +1567,20 @@  discard block
 block discarded – undo
1567 1567
 	 * @param        string $output
1568 1568
 	 * @return        string
1569 1569
 	 */
1570
-	public function form_after_question_group( $output ) {
1570
+	public function form_after_question_group($output) {
1571 1571
 		EE_Error::doing_it_wrong(
1572
-			__CLASS__ . '::' . __FUNCTION__,
1573
-			__( 'This method would have been protected but was used on a filter callback'
1572
+			__CLASS__.'::'.__FUNCTION__,
1573
+			__('This method would have been protected but was used on a filter callback'
1574 1574
 				. 'so needed to be public. Please discontinue usage as it will be removed soon.',
1575
-				'event_espresso' ),
1575
+				'event_espresso'),
1576 1576
 			'4.8.32.rc.000'
1577 1577
 		);
1578 1578
 		return  '
1579 1579
 			<tr class="hide-if-no-js">
1580 1580
 				<th> </th>
1581 1581
 				<td class="reg-admin-edit-attendee-question-td">
1582
-					<a class="reg-admin-edit-attendee-question-lnk" href="#" title="' . esc_attr__( 'click to edit question', 'event_espresso' ) . '">
1583
-						<span class="reg-admin-edit-question-group-spn lt-grey-txt">' . __( 'edit the above question group', 'event_espresso' ) . '</span>
1582
+					<a class="reg-admin-edit-attendee-question-lnk" href="#" title="' . esc_attr__('click to edit question', 'event_espresso').'">
1583
+						<span class="reg-admin-edit-question-group-spn lt-grey-txt">' . __('edit the above question group', 'event_espresso').'</span>
1584 1584
 						<div class="dashicons dashicons-edit"></div>
1585 1585
 					</a>
1586 1586
 				</td>
@@ -1600,18 +1600,18 @@  discard block
 block discarded – undo
1600 1600
 	 * @param        string $label
1601 1601
 	 * @return        string
1602 1602
 	 */
1603
-	public function form_form_field_label_wrap( $label ) {
1603
+	public function form_form_field_label_wrap($label) {
1604 1604
 		EE_Error::doing_it_wrong(
1605
-			__CLASS__ . '::' . __FUNCTION__,
1606
-			__( 'This method would have been protected but was used on a filter callback'
1605
+			__CLASS__.'::'.__FUNCTION__,
1606
+			__('This method would have been protected but was used on a filter callback'
1607 1607
 				. 'so needed to be public. Please discontinue usage as it will be removed soon.',
1608
-				'event_espresso' ),
1608
+				'event_espresso'),
1609 1609
 			'4.8.32.rc.000'
1610 1610
 		);
1611 1611
 		return '
1612 1612
 			<tr>
1613 1613
 				<th>
1614
-					' . $label  . '
1614
+					' . $label.'
1615 1615
 				</th>';
1616 1616
 	}
1617 1617
 
@@ -1625,17 +1625,17 @@  discard block
 block discarded – undo
1625 1625
 	 * @param        string $input
1626 1626
 	 * @return        string
1627 1627
 	 */
1628
-	public function form_form_field_input__wrap( $input ) {
1628
+	public function form_form_field_input__wrap($input) {
1629 1629
 		EE_Error::doing_it_wrong(
1630
-			__CLASS__ . '::' . __FUNCTION__,
1631
-			__( 'This method would have been protected but was used on a filter callback'
1630
+			__CLASS__.'::'.__FUNCTION__,
1631
+			__('This method would have been protected but was used on a filter callback'
1632 1632
 				. 'so needed to be public. Please discontinue usage as it will be removed soon.',
1633
-				'event_espresso' ),
1633
+				'event_espresso'),
1634 1634
 			'4.8.32.rc.000'
1635 1635
 		);
1636 1636
 		return '
1637 1637
 				<td class="reg-admin-attendee-questions-input-td disabled-input">
1638
-					' . $input . '
1638
+					' . $input.'
1639 1639
 				</td>
1640 1640
 			</tr>';
1641 1641
 	}
@@ -1649,14 +1649,14 @@  discard block
 block discarded – undo
1649 1649
 	 * @return void
1650 1650
 	 */
1651 1651
 	protected function _update_attendee_registration_form() {
1652
-		do_action( 'AHEE__Registrations_Admin_Page___update_attendee_registration_form__start', $this );
1653
-		if( $_SERVER['REQUEST_METHOD'] == 'POST'){
1654
-			$REG_ID = isset( $this->_req_data['_REG_ID'] ) ? absint( $this->_req_data['_REG_ID'] ) : FALSE;
1655
-			$success = $this->_save_reg_custom_questions_form( $REG_ID );
1656
-			if( $success ) {
1652
+		do_action('AHEE__Registrations_Admin_Page___update_attendee_registration_form__start', $this);
1653
+		if ($_SERVER['REQUEST_METHOD'] == 'POST') {
1654
+			$REG_ID = isset($this->_req_data['_REG_ID']) ? absint($this->_req_data['_REG_ID']) : FALSE;
1655
+			$success = $this->_save_reg_custom_questions_form($REG_ID);
1656
+			if ($success) {
1657 1657
 				$what = __('Registration Form', 'event_espresso');
1658
-				$route = $REG_ID ? array( 'action' => 'view_registration', '_REG_ID' => $REG_ID ) : array( 'action' => 'default' );
1659
-				$this->_redirect_after_action( $success, $what, __('updated', 'event_espresso'), $route );
1658
+				$route = $REG_ID ? array('action' => 'view_registration', '_REG_ID' => $REG_ID) : array('action' => 'default');
1659
+				$this->_redirect_after_action($success, $what, __('updated', 'event_espresso'), $route);
1660 1660
 			}
1661 1661
 		}
1662 1662
 	}
@@ -1667,11 +1667,11 @@  discard block
 block discarded – undo
1667 1667
 	 * @param int $REG_ID
1668 1668
 	 * @return EE_Registration_Custom_Questions_Form
1669 1669
 	 */
1670
-	protected function _get_reg_custom_questions_form( $REG_ID ) {
1671
-		if( ! $this->_reg_custom_questions_form ) {
1672
-			require_once( REG_ADMIN . 'form_sections' . DS . 'EE_Registration_Custom_Questions_Form.form.php' );
1673
-			$this->_reg_custom_questions_form = new EE_Registration_Custom_Questions_Form( EEM_Registration::instance()->get_one_by_ID( $REG_ID ) );
1674
-			$this->_reg_custom_questions_form->_construct_finalize( null, null );
1670
+	protected function _get_reg_custom_questions_form($REG_ID) {
1671
+		if ( ! $this->_reg_custom_questions_form) {
1672
+			require_once(REG_ADMIN.'form_sections'.DS.'EE_Registration_Custom_Questions_Form.form.php');
1673
+			$this->_reg_custom_questions_form = new EE_Registration_Custom_Questions_Form(EEM_Registration::instance()->get_one_by_ID($REG_ID));
1674
+			$this->_reg_custom_questions_form->_construct_finalize(null, null);
1675 1675
 		}
1676 1676
 		return $this->_reg_custom_questions_form;
1677 1677
 	}
@@ -1684,17 +1684,17 @@  discard block
 block discarded – undo
1684 1684
 	 * @param bool $REG_ID
1685 1685
 	 * @return bool
1686 1686
 	 */
1687
-	private function _save_reg_custom_questions_form( $REG_ID = FALSE ) {
1687
+	private function _save_reg_custom_questions_form($REG_ID = FALSE) {
1688 1688
 
1689 1689
 		if ( ! $REG_ID) {
1690
-			EE_Error::add_error( __('An error occurred. No registration ID was received.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__ );
1690
+			EE_Error::add_error(__('An error occurred. No registration ID was received.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
1691 1691
 		}
1692
-		$form = $this->_get_reg_custom_questions_form( $REG_ID );
1693
-		$form->receive_form_submission( $this->_req_data );
1692
+		$form = $this->_get_reg_custom_questions_form($REG_ID);
1693
+		$form->receive_form_submission($this->_req_data);
1694 1694
 		$success = false;
1695
-		if( $form->is_valid() ) {
1696
-			foreach( $form->subforms() as $question_group_id => $question_group_form ) {
1697
-				foreach( $question_group_form->inputs() as $question_id => $input ) {
1695
+		if ($form->is_valid()) {
1696
+			foreach ($form->subforms() as $question_group_id => $question_group_form) {
1697
+				foreach ($question_group_form->inputs() as $question_id => $input) {
1698 1698
 					$where_conditions = array(
1699 1699
 							'QST_ID' => $question_id,
1700 1700
 							'REG_ID' => $REG_ID
@@ -1702,19 +1702,19 @@  discard block
 block discarded – undo
1702 1702
 					$possibly_new_values = array(
1703 1703
 							'ANS_value' => $input->normalized_value()
1704 1704
 						);
1705
-					$answer = EEM_Answer::instance()->get_one( array( $where_conditions ) );
1706
-					if( $answer instanceof EE_Answer ) {
1707
-						$success = $answer->save( $possibly_new_values );
1705
+					$answer = EEM_Answer::instance()->get_one(array($where_conditions));
1706
+					if ($answer instanceof EE_Answer) {
1707
+						$success = $answer->save($possibly_new_values);
1708 1708
 					} else {
1709 1709
 						//insert it then
1710
-						$cols_n_vals = array_merge( $where_conditions, $possibly_new_values );
1711
-						$answer = EE_Answer::new_instance( $cols_n_vals );
1710
+						$cols_n_vals = array_merge($where_conditions, $possibly_new_values);
1711
+						$answer = EE_Answer::new_instance($cols_n_vals);
1712 1712
 						$success = $answer->save();
1713 1713
 					}
1714 1714
 				}
1715 1715
 			}
1716 1716
 		} else {
1717
-			EE_Error::add_error( $form->get_validation_error_string(), __FILE__, __FUNCTION__, __LINE__ );
1717
+			EE_Error::add_error($form->get_validation_error_string(), __FILE__, __FUNCTION__, __LINE__);
1718 1718
 		}
1719 1719
 		return $success;
1720 1720
 	}
@@ -1732,30 +1732,30 @@  discard block
 block discarded – undo
1732 1732
 		$registrations = $REG->get_all(array(
1733 1733
 			array(
1734 1734
 				'TXN_ID'=>$this->_registration->transaction_ID(),
1735
-				'REG_ID'=>array('!=',$this->_registration->ID())
1735
+				'REG_ID'=>array('!=', $this->_registration->ID())
1736 1736
 			),
1737 1737
 			'force_join'=>array('Attendee')));
1738 1738
 
1739 1739
 		$this->_template_args['attendees'] = array();
1740 1740
 		$this->_template_args['attendee_notice'] = '';
1741 1741
 		EE_Registry::instance()->load_helper('Array');
1742
-		if ( empty( $registrations)  || ( is_array($registrations) &&  ! EEH_Array::get_one_item_from_array($registrations) ) ) {
1743
-			EE_Error::add_error( __('There are no records attached to this registration. Something may have gone wrong with the registration', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__ );
1742
+		if (empty($registrations) || (is_array($registrations) && ! EEH_Array::get_one_item_from_array($registrations))) {
1743
+			EE_Error::add_error(__('There are no records attached to this registration. Something may have gone wrong with the registration', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
1744 1744
 			$this->_template_args['attendee_notice'] = EE_Error::get_notices();
1745 1745
 		} else {
1746 1746
 
1747 1747
 			$att_nmbr = 1;
1748
-			foreach ( $registrations as $registration ) {
1748
+			foreach ($registrations as $registration) {
1749 1749
 				/* @var $registration EE_Registration */
1750 1750
 				$attendee = $registration->attendee() ? $registration->attendee() : EEM_Attendee::instance()->create_default_object();
1751
-				$this->_template_args['attendees'][ $att_nmbr ]['fname'] = $attendee->fname();//( isset( $registration->ATT_fname ) & ! empty( $registration->ATT_fname ) ) ? $registration->ATT_fname : '';
1752
-				$this->_template_args['attendees'][ $att_nmbr ]['lname'] = $attendee->lname();//( isset( $registration->ATT_lname ) & ! empty( $registration->ATT_lname ) ) ? $registration->ATT_lname : '';
1753
-				$this->_template_args['attendees'][ $att_nmbr ]['email'] = $attendee->email();//( isset( $registration->ATT_email ) & ! empty( $registration->ATT_email ) ) ? $registration->ATT_email : '';
1754
-				$this->_template_args['attendees'][ $att_nmbr ]['final_price'] = $registration->final_price();//( isset( $registration->REG_final_price ) & ! empty( $registration->REG_final_price ) ) ? $registration->REG_final_price : '';
1751
+				$this->_template_args['attendees'][$att_nmbr]['fname'] = $attendee->fname(); //( isset( $registration->ATT_fname ) & ! empty( $registration->ATT_fname ) ) ? $registration->ATT_fname : '';
1752
+				$this->_template_args['attendees'][$att_nmbr]['lname'] = $attendee->lname(); //( isset( $registration->ATT_lname ) & ! empty( $registration->ATT_lname ) ) ? $registration->ATT_lname : '';
1753
+				$this->_template_args['attendees'][$att_nmbr]['email'] = $attendee->email(); //( isset( $registration->ATT_email ) & ! empty( $registration->ATT_email ) ) ? $registration->ATT_email : '';
1754
+				$this->_template_args['attendees'][$att_nmbr]['final_price'] = $registration->final_price(); //( isset( $registration->REG_final_price ) & ! empty( $registration->REG_final_price ) ) ? $registration->REG_final_price : '';
1755 1755
 
1756
-				$this->_template_args['attendees'][ $att_nmbr ]['address'] = implode( ', ', $attendee->full_address_as_array() );
1756
+				$this->_template_args['attendees'][$att_nmbr]['address'] = implode(', ', $attendee->full_address_as_array());
1757 1757
 
1758
-				$this->_template_args['attendees'][ $att_nmbr ]['att_link'] = self::add_query_args_and_nonce( array( 'action'=>'edit_attendee', 'post'=>$attendee->ID() ), REG_ADMIN_URL );
1758
+				$this->_template_args['attendees'][$att_nmbr]['att_link'] = self::add_query_args_and_nonce(array('action'=>'edit_attendee', 'post'=>$attendee->ID()), REG_ADMIN_URL);
1759 1759
 
1760 1760
 				$att_nmbr++;
1761 1761
 			}
@@ -1767,8 +1767,8 @@  discard block
 block discarded – undo
1767 1767
 
1768 1768
 	//			$this->_template_args['registration_form_url'] = add_query_arg( array( 'action' => 'edit_registration', 'process' => 'attendees'  ), REG_ADMIN_URL );
1769 1769
 		}
1770
-		$template_path = REG_TEMPLATE_PATH . 'reg_admin_details_main_meta_box_attendees.template.php';
1771
-		echo EEH_Template::display_template( $template_path, $this->_template_args, TRUE );
1770
+		$template_path = REG_TEMPLATE_PATH.'reg_admin_details_main_meta_box_attendees.template.php';
1771
+		echo EEH_Template::display_template($template_path, $this->_template_args, TRUE);
1772 1772
 
1773 1773
 	}
1774 1774
 
@@ -1789,11 +1789,11 @@  discard block
 block discarded – undo
1789 1789
 		$attendee = $att_check instanceof EE_Attendee ? $att_check : EEM_Attendee::instance()->create_default_object();
1790 1790
 
1791 1791
 		//now let's determine if this is not the primary registration.  If it isn't then we set the primary_registration object for reference BUT ONLY if the Attendee object loaded is not the same as the primary registration object (that way we know if we need to show cereate button or not)
1792
-		if ( ! $this->_registration->is_primary_registrant() ) {
1792
+		if ( ! $this->_registration->is_primary_registrant()) {
1793 1793
 			$primary_registration = $this->_registration->get_primary_registration();
1794 1794
 			$primary_attendee = $primary_registration->attendee();
1795 1795
 
1796
-			if ( ! $primary_attendee instanceof EE_Attendee || $attendee->ID() !== $primary_attendee->ID() ) {
1796
+			if ( ! $primary_attendee instanceof EE_Attendee || $attendee->ID() !== $primary_attendee->ID()) {
1797 1797
 				//in here?  This means the displayed registration is not the primary registrant but ALREADY HAS its own custom attendee object so let's not worry about the primary reg.
1798 1798
 				$primary_registration = NULL;
1799 1799
 			}
@@ -1802,28 +1802,28 @@  discard block
 block discarded – undo
1802 1802
 		}
1803 1803
 
1804 1804
 		$this->_template_args['ATT_ID'] = $attendee->ID();
1805
-		$this->_template_args['fname'] = $attendee->fname();//$this->_registration->ATT_fname;
1806
-		$this->_template_args['lname'] = $attendee->lname();//$this->_registration->ATT_lname;
1807
-		$this->_template_args['email'] = $attendee->email();//$this->_registration->ATT_email;
1805
+		$this->_template_args['fname'] = $attendee->fname(); //$this->_registration->ATT_fname;
1806
+		$this->_template_args['lname'] = $attendee->lname(); //$this->_registration->ATT_lname;
1807
+		$this->_template_args['email'] = $attendee->email(); //$this->_registration->ATT_email;
1808 1808
 		$this->_template_args['phone'] = $attendee->phone();
1809 1809
 
1810
-		EE_Registry::instance()->load_helper( 'Formatter' );
1811
-		$this->_template_args[ 'formatted_address' ] = EEH_Address::format( $attendee );
1810
+		EE_Registry::instance()->load_helper('Formatter');
1811
+		$this->_template_args['formatted_address'] = EEH_Address::format($attendee);
1812 1812
 
1813 1813
 
1814 1814
 		//edit link
1815
-		$this->_template_args['att_edit_link'] = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'edit_attendee', 'post'=>$attendee->ID() ), REG_ADMIN_URL );
1816
-		$this->_template_args['att_edit_label'] = __('View/Edit Contact' );
1815
+		$this->_template_args['att_edit_link'] = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'edit_attendee', 'post'=>$attendee->ID()), REG_ADMIN_URL);
1816
+		$this->_template_args['att_edit_label'] = __('View/Edit Contact');
1817 1817
 
1818 1818
 		//create link
1819
-		$this->_template_args['create_link'] = $primary_registration instanceof EE_Registration ? EE_Admin_Page::add_query_args_and_nonce( array( 'action' => 'duplicate_attendee',  '_REG_ID' => $this->_registration->ID() ), REG_ADMIN_URL ): '';
1819
+		$this->_template_args['create_link'] = $primary_registration instanceof EE_Registration ? EE_Admin_Page::add_query_args_and_nonce(array('action' => 'duplicate_attendee', '_REG_ID' => $this->_registration->ID()), REG_ADMIN_URL) : '';
1820 1820
 		$this->_template_args['create_label'] = __('Create Contact', 'event_espresso');
1821 1821
 
1822 1822
 		$this->_template_args['att_check'] = $att_check;
1823 1823
 
1824 1824
 
1825
-		$template_path = REG_TEMPLATE_PATH . 'reg_admin_details_side_meta_box_registrant.template.php';
1826
-		echo EEH_Template::display_template( $template_path, $this->_template_args, TRUE );
1825
+		$template_path = REG_TEMPLATE_PATH.'reg_admin_details_side_meta_box_registrant.template.php';
1826
+		echo EEH_Template::display_template($template_path, $this->_template_args, TRUE);
1827 1827
 	}
1828 1828
 
1829 1829
 
@@ -1836,7 +1836,7 @@  discard block
 block discarded – undo
1836 1836
 	 * @access protected
1837 1837
 	 * @return void
1838 1838
 	 */
1839
-	protected function _trash_or_restore_registrations( $trash = TRUE ) {
1839
+	protected function _trash_or_restore_registrations($trash = TRUE) {
1840 1840
 		$REGM = EEM_Registration::instance();
1841 1841
 
1842 1842
 		$success = 1;
@@ -1846,26 +1846,26 @@  discard block
 block discarded – undo
1846 1846
 		$dtts = array();
1847 1847
 
1848 1848
 		//if empty _REG_ID then get out because there's nothing to do
1849
-		if ( empty( $this->_req_data['_REG_ID'] ) ) {
1849
+		if (empty($this->_req_data['_REG_ID'])) {
1850 1850
 			$msg = $trash ? __('In order to trash registrations you must select which ones you wish to trash by clicking the checkboxes.', 'event_espresso') : __('In order to restore registrations you must select which ones you wish to restore by clicking the checkboxes.', 'event_espresso');
1851
-			EE_Error::add_error( $msg, __FILE__, __LINE__, __FUNCTION__ );
1852
-			$this->_redirect_after_action(FALSE, '', '', array(), TRUE );
1851
+			EE_Error::add_error($msg, __FILE__, __LINE__, __FUNCTION__);
1852
+			$this->_redirect_after_action(FALSE, '', '', array(), TRUE);
1853 1853
 		}
1854 1854
 
1855 1855
 		//Checkboxes
1856
-		if (!empty($this->_req_data['_REG_ID']) && is_array($this->_req_data['_REG_ID'])) {
1856
+		if ( ! empty($this->_req_data['_REG_ID']) && is_array($this->_req_data['_REG_ID'])) {
1857 1857
 			// if array has more than one element than success message should be plural
1858
-			$success = count( $this->_req_data['_REG_ID'] ) > 1 ? 2 : 1;
1858
+			$success = count($this->_req_data['_REG_ID']) > 1 ? 2 : 1;
1859 1859
 			// cycle thru checkboxes
1860
-			while (list( $ind, $REG_ID ) = each($this->_req_data['_REG_ID'])) {
1860
+			while (list($ind, $REG_ID) = each($this->_req_data['_REG_ID'])) {
1861 1861
 
1862 1862
 				$REG = $REGM->get_one_by_ID($REG_ID);
1863 1863
 				$payment_count = $REG->get_first_related('Transaction')->count_related('Payment');
1864
-				if ( $payment_count > 0 ) {
1865
-					$name = $REG->attendee() instanceof EE_Attendee ? $REG->attendee()->full_name() : __( 'Unknown Attendee', 'event_espresso' );
1864
+				if ($payment_count > 0) {
1865
+					$name = $REG->attendee() instanceof EE_Attendee ? $REG->attendee()->full_name() : __('Unknown Attendee', 'event_espresso');
1866 1866
 					$error = 1;
1867 1867
 					$success = 0;
1868
-					EE_Error::add_error( sprintf( __('The registration for %s could not be trashed because it has payments attached to the related transaction.  If you wish to trash this registration you must first delete the payments on the related transaction.', 'event_espresso'), $name ), __FILE__, __FUNCTION__, __LINE__ );
1868
+					EE_Error::add_error(sprintf(__('The registration for %s could not be trashed because it has payments attached to the related transaction.  If you wish to trash this registration you must first delete the payments on the related transaction.', 'event_espresso'), $name), __FILE__, __FUNCTION__, __LINE__);
1869 1869
 					continue; //can't trash this registration because it has payments.
1870 1870
 				}
1871 1871
 				$ticket = $REG->get_first_related('Ticket');
@@ -1874,7 +1874,7 @@  discard block
 block discarded – undo
1874 1874
 				$dtts = array_merge($dtts, $dtt);
1875 1875
 
1876 1876
 				$updated = $trash ? $REG->delete() : $REG->restore();
1877
-				if ( !$updated ) {
1877
+				if ( ! $updated) {
1878 1878
 					$success = 0;
1879 1879
 				} else {
1880 1880
 					$success = 2;
@@ -1889,7 +1889,7 @@  discard block
 block discarded – undo
1889 1889
 			$tickets[$ticket->ID()] = $ticket;
1890 1890
 			$dtts = $ticket->get_many_related('Datetime');
1891 1891
 			$updated = $trash ? $REG->delete() : $REG->restore();
1892
-			if ( ! $updated ) {
1892
+			if ( ! $updated) {
1893 1893
 				$success = 0;
1894 1894
 			}
1895 1895
 
@@ -1899,10 +1899,10 @@  discard block
 block discarded – undo
1899 1899
 		EEM_Ticket::instance()->update_tickets_sold($tickets);
1900 1900
 		EEM_Datetime::instance()->update_sold($dtts);
1901 1901
 
1902
-		$what = $success > 1 ? __( 'Registrations', 'event_espresso' ) : __( 'Registration', 'event_espresso' );
1903
-		$action_desc = $trash ? __( 'moved to the trash', 'event_espresso' ) : __( 'restored', 'event_espresso' );
1902
+		$what = $success > 1 ? __('Registrations', 'event_espresso') : __('Registration', 'event_espresso');
1903
+		$action_desc = $trash ? __('moved to the trash', 'event_espresso') : __('restored', 'event_espresso');
1904 1904
 		$overwrite_msgs = $error ? TRUE : FALSE;
1905
-		$this->_redirect_after_action( $success, $what, $action_desc, array( 'action' => 'default' ), $overwrite_msgs );
1905
+		$this->_redirect_after_action($success, $what, $action_desc, array('action' => 'default'), $overwrite_msgs);
1906 1906
 	}
1907 1907
 
1908 1908
 
@@ -1926,16 +1926,16 @@  discard block
 block discarded – undo
1926 1926
 		$success = 1;
1927 1927
 
1928 1928
 		//Checkboxes
1929
-		if (!empty($this->_req_data['_REG_ID']) && is_array($this->_req_data['_REG_ID'])) {
1929
+		if ( ! empty($this->_req_data['_REG_ID']) && is_array($this->_req_data['_REG_ID'])) {
1930 1930
 			// if array has more than one element than success message should be plural
1931
-			$success = count( $this->_req_data['_REG_ID'] ) > 1 ? 2 : 1;
1931
+			$success = count($this->_req_data['_REG_ID']) > 1 ? 2 : 1;
1932 1932
 			// cycle thru checkboxes
1933
-			while (list( $ind, $REG_ID ) = each($this->_req_data['_REG_ID'])) {
1933
+			while (list($ind, $REG_ID) = each($this->_req_data['_REG_ID'])) {
1934 1934
 				$REG = $REG_MDL->get_one_by_ID($REG_ID);
1935
-				if ( ! $REG instanceof EE_Registration )
1935
+				if ( ! $REG instanceof EE_Registration)
1936 1936
 					continue;
1937 1937
 				$deleted = $this->_delete_registration($REG);
1938
-				if ( !$deleted ) {
1938
+				if ( ! $deleted) {
1939 1939
 					$success = 0;
1940 1940
 				}
1941 1941
 			}
@@ -1945,15 +1945,15 @@  discard block
 block discarded – undo
1945 1945
 			$REG_ID = $this->_req_data['_REG_ID'];
1946 1946
 			$REG = $REG_MDL->get_one_by_ID($REG_ID);
1947 1947
 			$deleted = $this->_delete_registration($REG);
1948
-			if ( ! $deleted ) {
1948
+			if ( ! $deleted) {
1949 1949
 				$success = 0;
1950 1950
 			}
1951 1951
 
1952 1952
 		}
1953 1953
 
1954
-		$what = $success > 1 ? __( 'Registrations', 'event_espresso' ) : __( 'Registration', 'event_espresso' );
1955
-		$action_desc = __( 'permanently deleted.', 'event_espresso' );
1956
-		$this->_redirect_after_action( $success, $what, $action_desc, array( 'action' => 'default' ), TRUE );
1954
+		$what = $success > 1 ? __('Registrations', 'event_espresso') : __('Registration', 'event_espresso');
1955
+		$action_desc = __('permanently deleted.', 'event_espresso');
1956
+		$this->_redirect_after_action($success, $what, $action_desc, array('action' => 'default'), TRUE);
1957 1957
 	}
1958 1958
 
1959 1959
 
@@ -1965,31 +1965,31 @@  discard block
 block discarded – undo
1965 1965
 	 * @param  EE_Registration $REG registration to be deleted permenantly
1966 1966
 	 * @return boolean              true = successful deletion, false = fail.
1967 1967
 	 */
1968
-	protected function _delete_registration( EE_Registration $REG ) {
1968
+	protected function _delete_registration(EE_Registration $REG) {
1969 1969
 		//first we start with the transaction... ultimately, we WILL not delete permanently if there are any related registrations on the transaction that are NOT trashed.
1970 1970
 		$TXN = $REG->get_first_related('Transaction');
1971 1971
 		$REGS = $TXN->get_many_related('Registration');
1972 1972
 
1973 1973
 		$all_trashed = TRUE;
1974
-		foreach ( $REGS as $registration ) {
1975
-			if ( ! $registration->get('REG_deleted') )
1974
+		foreach ($REGS as $registration) {
1975
+			if ( ! $registration->get('REG_deleted'))
1976 1976
 				$all_trashed = FALSE;
1977 1977
 		}
1978 1978
 
1979
-		if ( ! $all_trashed ) {
1980
-			EE_Error::add_error( __('Unable to permanently delete this registration. Before this registration can be permanently deleted, all registrations made in the same transaction must be trashed as well.  These registrations will be permanently deleted in the same action.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__ );
1979
+		if ( ! $all_trashed) {
1980
+			EE_Error::add_error(__('Unable to permanently delete this registration. Before this registration can be permanently deleted, all registrations made in the same transaction must be trashed as well.  These registrations will be permanently deleted in the same action.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
1981 1981
 			return false;
1982 1982
 		}
1983 1983
 
1984 1984
 		//k made it here so that means we can delete all the related transactions and their answers (but let's do them separately from THIS one).
1985
-		foreach ( $REGS as $registration ) {
1985
+		foreach ($REGS as $registration) {
1986 1986
 
1987 1987
 			//delete related answers
1988 1988
 			$registration->delete_related_permanently('Answer');
1989 1989
 
1990 1990
 			//remove relationship to EE_Attendee (but we ALWAYS leave the contact record intact)
1991 1991
 			$attendee = $registration->get_first_related('Attendee');
1992
-			if ( $attendee instanceof EE_Attendee ) {
1992
+			if ($attendee instanceof EE_Attendee) {
1993 1993
 				$registration->_remove_relation_to($attendee, 'Attendee');
1994 1994
 			}
1995 1995
 
@@ -1999,7 +1999,7 @@  discard block
 block discarded – undo
1999 1999
 			//now delete permanently the checkins related to this registration.
2000 2000
 			$registration->delete_related_permanently('Checkin');
2001 2001
 
2002
-			if ( $registration->ID() === $REG->ID() )
2002
+			if ($registration->ID() === $REG->ID())
2003 2003
 				continue; //we don't want to delete permanently the existing registration just yet.
2004 2004
 
2005 2005
 			//remove relation to transaction for these registrations if NOT the existing registrations
@@ -2032,35 +2032,35 @@  discard block
 block discarded – undo
2032 2032
 	 * @return void
2033 2033
 	 */
2034 2034
 	public function new_registration() {
2035
-		if ( ! $this->_set_reg_event() ) {
2036
-			throw new EE_Error(__('Unable to continue with registering because there is no Event ID in the request', 'event_espresso') );
2035
+		if ( ! $this->_set_reg_event()) {
2036
+			throw new EE_Error(__('Unable to continue with registering because there is no Event ID in the request', 'event_espresso'));
2037 2037
 		}
2038
-		EE_Registry::instance()->REQ->set_espresso_page( TRUE );
2038
+		EE_Registry::instance()->REQ->set_espresso_page(TRUE);
2039 2039
 		// gotta start with a clean slate if we're not coming here via ajax
2040 2040
 		if (
2041
-			! defined('DOING_AJAX' )
2042
-			&& ( ! isset( $this->_req_data['processing_registration'] ) || isset( $this->_req_data['step_error'] ) )
2041
+			! defined('DOING_AJAX')
2042
+			&& ( ! isset($this->_req_data['processing_registration']) || isset($this->_req_data['step_error']))
2043 2043
 		) {
2044
-			EE_Registry::instance()->SSN->clear_session( __CLASS__, __FUNCTION__ );
2044
+			EE_Registry::instance()->SSN->clear_session(__CLASS__, __FUNCTION__);
2045 2045
 		}
2046 2046
 
2047
-		$this->_template_args['event_name'] = '' ;
2047
+		$this->_template_args['event_name'] = '';
2048 2048
 		// event name
2049
-		if ( $this->_reg_event ) {
2049
+		if ($this->_reg_event) {
2050 2050
 			$this->_template_args['event_name'] = $this->_reg_event->name();
2051
-			$edit_event_url = self::add_query_args_and_nonce( array( 'action'=>'edit', 'post'=>$this->_reg_event->ID() ), EVENTS_ADMIN_URL );
2052
-			$edit_event_lnk = '<a href="'.$edit_event_url.'" title="' . esc_attr__( 'Edit ', 'event_espresso' ) . $this->_reg_event->name() . '">' . __( 'Edit Event', 'event_espresso' ) . '</a>';
2053
-			$this->_template_args['event_name'] .= ' <span class="admin-page-header-edit-lnk not-bold">' . $edit_event_lnk . '</span>' ;
2051
+			$edit_event_url = self::add_query_args_and_nonce(array('action'=>'edit', 'post'=>$this->_reg_event->ID()), EVENTS_ADMIN_URL);
2052
+			$edit_event_lnk = '<a href="'.$edit_event_url.'" title="'.esc_attr__('Edit ', 'event_espresso').$this->_reg_event->name().'">'.__('Edit Event', 'event_espresso').'</a>';
2053
+			$this->_template_args['event_name'] .= ' <span class="admin-page-header-edit-lnk not-bold">'.$edit_event_lnk.'</span>';
2054 2054
 		}
2055 2055
 
2056 2056
 		$this->_template_args['step_content'] = $this->_get_registration_step_content();
2057 2057
 
2058
-		if ( defined('DOING_AJAX' ) ) {
2058
+		if (defined('DOING_AJAX')) {
2059 2059
 			$this->_return_json();
2060 2060
 		}
2061 2061
 		// grab header
2062
-		$template_path = REG_TEMPLATE_PATH . 'reg_admin_register_new_attendee.template.php';
2063
-		$this->_template_args['admin_page_content'] = EEH_Template::display_template( $template_path, $this->_template_args, TRUE );
2062
+		$template_path = REG_TEMPLATE_PATH.'reg_admin_register_new_attendee.template.php';
2063
+		$this->_template_args['admin_page_content'] = EEH_Template::display_template($template_path, $this->_template_args, TRUE);
2064 2064
 
2065 2065
 		//$this->_set_publish_post_box_vars( NULL, FALSE, FALSE, NULL, FALSE );
2066 2066
 		// the details template wrapper
@@ -2077,7 +2077,7 @@  discard block
 block discarded – undo
2077 2077
 	 * @return string html
2078 2078
 	 */
2079 2079
 	protected function _get_registration_step_content() {
2080
-		if ( isset( $_COOKIE[ 'ee_registration_added' ] ) && $_COOKIE[ 'ee_registration_added' ] ) {
2080
+		if (isset($_COOKIE['ee_registration_added']) && $_COOKIE['ee_registration_added']) {
2081 2081
 			$warning_msg = sprintf(
2082 2082
 				__(
2083 2083
 					'%2$sWARNING!!!%3$s%1$sPlease do not use the back button to return to this page for the purpose of adding another registration.%1$sThis can result in lost and/or corrupted data.%1$sIf you wish to add another registration, then please click the%1$s%7$s"Add Another New Registration to Event"%8$s button%1$son the Transaction details page, after you are redirected.%1$s%1$s%4$s redirecting in %5$s seconds %6$s',
@@ -2093,7 +2093,7 @@  discard block
 block discarded – undo
2093 2093
 				'</b>'
2094 2094
 			);
2095 2095
 			return '
2096
-	<div id="ee-add-reg-back-button-dv"><p>' . $warning_msg . '</p></div>
2096
+	<div id="ee-add-reg-back-button-dv"><p>' . $warning_msg.'</p></div>
2097 2097
 	<script >
2098 2098
 		// WHOAH !!! it appears that someone is using the back button from the Transaction admin page
2099 2099
 		// after just adding a new registration... we gotta try to put a stop to that !!!
@@ -2128,16 +2128,16 @@  discard block
 block discarded – undo
2128 2128
 		$cart = EE_Registry::instance()->SSN->cart();
2129 2129
 		$step = ! $cart instanceof EE_Cart ? 'ticket' : 'questions';
2130 2130
 
2131
-		switch ( $step ) {
2131
+		switch ($step) {
2132 2132
 			case 'ticket' :
2133 2133
 				$hidden_fields['processing_registration']['value'] = 1;
2134 2134
 				$template_args['title'] = __('Step One: Select the Ticket for this registration', 'event_espresso');
2135
-				$template_args['content'] = EED_Ticket_Selector::instance()->display_ticket_selector( $this->_reg_event );
2135
+				$template_args['content'] = EED_Ticket_Selector::instance()->display_ticket_selector($this->_reg_event);
2136 2136
 				$template_args['step_button_text'] = __('Add Tickets and Continue to Registrant Details', 'event_espresso');
2137 2137
 				$template_args['show_notification_toggle'] = FALSE;
2138 2138
 				break;
2139 2139
 			case 'questions' :
2140
-				$hidden_fields[ 'processing_registration' ][ 'value' ] = 2;
2140
+				$hidden_fields['processing_registration']['value'] = 2;
2141 2141
 				$template_args['title'] = __('Step Two: Add Registrant Details for this Registration', 'event_espresso');
2142 2142
 				//in theory we should be able to run EED_SPCO at this point because the cart should have been setup properly by the first process_reg_step run.
2143 2143
 				$template_args['content'] = EED_Single_Page_Checkout::registration_checkout_for_admin();
@@ -2146,10 +2146,10 @@  discard block
 block discarded – undo
2146 2146
 				break;
2147 2147
 		}
2148 2148
 
2149
-		$this->_set_add_edit_form_tags( 'process_reg_step', $hidden_fields ); //we come back to the process_registration_step route.
2149
+		$this->_set_add_edit_form_tags('process_reg_step', $hidden_fields); //we come back to the process_registration_step route.
2150 2150
 
2151 2151
 		return EEH_Template::display_template(
2152
-			REG_TEMPLATE_PATH . 'reg_admin_register_new_attendee_step_content.template.php', $template_args, TRUE
2152
+			REG_TEMPLATE_PATH.'reg_admin_register_new_attendee_step_content.template.php', $template_args, TRUE
2153 2153
 		);
2154 2154
 	}
2155 2155
 
@@ -2164,11 +2164,11 @@  discard block
 block discarded – undo
2164 2164
 	*		@return boolean
2165 2165
 	*/
2166 2166
 	private function _set_reg_event() {
2167
-		if ( is_object( $this->_reg_event )) {
2167
+		if (is_object($this->_reg_event)) {
2168 2168
 			return TRUE;
2169 2169
 		}
2170
-		$EVT_ID = ( ! empty( $this->_req_data['event_id'] )) ? absint( $this->_req_data['event_id'] ) : FALSE;
2171
-		if ( ! $EVT_ID ) {
2170
+		$EVT_ID = ( ! empty($this->_req_data['event_id'])) ? absint($this->_req_data['event_id']) : FALSE;
2171
+		if ( ! $EVT_ID) {
2172 2172
 			return FALSE;
2173 2173
 		}
2174 2174
 
@@ -2189,82 +2189,82 @@  discard block
 block discarded – undo
2189 2189
 	public function process_reg_step() {
2190 2190
 		EE_System::do_not_cache();
2191 2191
 		$this->_set_reg_event();
2192
-		EE_Registry::instance()->REQ->set_espresso_page( TRUE );
2192
+		EE_Registry::instance()->REQ->set_espresso_page(TRUE);
2193 2193
 
2194 2194
 		//what step are we on?
2195 2195
 		$cart = EE_Registry::instance()->SSN->cart();
2196 2196
 		$step = ! $cart instanceof EE_Cart ? 'ticket' : 'questions';
2197 2197
 
2198 2198
 		//if doing ajax then we need to verify the nonce
2199
-		if ( defined( 'DOING_AJAX' ) ) {
2200
-			$nonce = isset( $this->_req_data[$this->_req_nonce] ) ? sanitize_text_field( $this->_req_data[$this->_req_nonce] ) : '';
2201
-			$this->_verify_nonce( $nonce, $this->_req_nonce );
2199
+		if (defined('DOING_AJAX')) {
2200
+			$nonce = isset($this->_req_data[$this->_req_nonce]) ? sanitize_text_field($this->_req_data[$this->_req_nonce]) : '';
2201
+			$this->_verify_nonce($nonce, $this->_req_nonce);
2202 2202
 		}
2203 2203
 
2204
-		switch ( $step ) {
2204
+		switch ($step) {
2205 2205
 
2206 2206
 			case 'ticket' :
2207 2207
 				//process ticket selection
2208 2208
 				$success = EED_Ticket_Selector::instance()->process_ticket_selections();
2209
-				if ( $success ) {
2210
-					EE_Error::add_success( __('Tickets Selected. Now complete the registration.'), 'event_espresso');
2209
+				if ($success) {
2210
+					EE_Error::add_success(__('Tickets Selected. Now complete the registration.'), 'event_espresso');
2211 2211
 				} else {
2212 2212
 					$query_args['step_error'] = $this->_req_data['step_error'] = TRUE;
2213 2213
 				}
2214
-				if ( defined('DOING_AJAX') ) {
2214
+				if (defined('DOING_AJAX')) {
2215 2215
 					$this->new_registration(); //display next step
2216 2216
 				} else {
2217 2217
 					$query_args['action'] = 'new_registration';
2218 2218
 					$query_args['processing_registration'] = 1;
2219 2219
 					$query_args['event_id'] = $this->_reg_event->ID();
2220
-					$this->_redirect_after_action( FALSE, '', '', $query_args, TRUE );
2220
+					$this->_redirect_after_action(FALSE, '', '', $query_args, TRUE);
2221 2221
 				}
2222 2222
 				break;
2223 2223
 
2224 2224
 			case 'questions' :
2225
-				if( ! isset( $this->_req_data[ 'txn_reg_status_change' ], $this->_req_data[ 'txn_reg_status_change' ][ 'send_notifications' ] ) ) {
2226
-					add_filter( 'FHEE__EED_Messages___maybe_registration__deliver_notifications', '__return_false', 15 );
2225
+				if ( ! isset($this->_req_data['txn_reg_status_change'], $this->_req_data['txn_reg_status_change']['send_notifications'])) {
2226
+					add_filter('FHEE__EED_Messages___maybe_registration__deliver_notifications', '__return_false', 15);
2227 2227
 				}
2228 2228
 				//process registration
2229 2229
 				$transaction = EED_Single_Page_Checkout::instance()->process_registration_from_admin();
2230
-				if ( $cart instanceof EE_Cart ) {
2230
+				if ($cart instanceof EE_Cart) {
2231 2231
 					$grand_total = $cart->get_cart_grand_total();
2232
-					if ( $grand_total instanceof EE_Line_Item ) {
2232
+					if ($grand_total instanceof EE_Line_Item) {
2233 2233
 						$grand_total->save_this_and_descendants_to_txn();
2234 2234
 					}
2235 2235
 				}
2236
-				if ( ! $transaction instanceof EE_Transaction ) {
2236
+				if ( ! $transaction instanceof EE_Transaction) {
2237 2237
 					$query_args = array(
2238 2238
 						'action' => 'new_registration',
2239 2239
 						'processing_registration' => 2,
2240 2240
 						'event_id' => $this->_reg_event->ID()
2241 2241
 					);
2242 2242
 
2243
-					if ( defined('DOING_AJAX' )) {
2243
+					if (defined('DOING_AJAX')) {
2244 2244
 						//display registration form again because there are errors (maybe validation?)
2245 2245
 						$this->new_registration();
2246 2246
 						return;
2247 2247
 					} else {
2248
-						$this->_redirect_after_action( FALSE, '', '', $query_args, TRUE );
2248
+						$this->_redirect_after_action(FALSE, '', '', $query_args, TRUE);
2249 2249
 						return;
2250 2250
 					}
2251 2251
 				}
2252 2252
 				/** @type EE_Transaction_Payments $transaction_payments */
2253
-				$transaction_payments = EE_Registry::instance()->load_class( 'Transaction_Payments' );
2253
+				$transaction_payments = EE_Registry::instance()->load_class('Transaction_Payments');
2254 2254
 				// maybe update status, and make sure to save transaction if not done already
2255
-				if ( ! $transaction_payments->update_transaction_status_based_on_total_paid( $transaction )) {
2255
+				if ( ! $transaction_payments->update_transaction_status_based_on_total_paid($transaction)) {
2256 2256
 					$transaction->save();
2257 2257
 				}
2258
-				EE_Registry::instance()->SSN->clear_session( __CLASS__, __FUNCTION__ );
2258
+				EE_Registry::instance()->SSN->clear_session(__CLASS__, __FUNCTION__);
2259 2259
 				$this->_req_data = array();
2260 2260
 				$query_args = array(
2261 2261
 					'action'        => 'redirect_to_txn',
2262 2262
 					'TXN_ID'        => $transaction->ID(),
2263 2263
 					'EVT_ID'        => $this->_reg_event->ID(),
2264
-					'event_name'    => urlencode( $this->_reg_event->name() ),
2264
+					'event_name'    => urlencode($this->_reg_event->name()),
2265 2265
 					'redirect_from' => 'new_registration'
2266 2266
 				);
2267
-				$this->_redirect_after_action( false, '', '', $query_args, true );
2267
+				$this->_redirect_after_action(false, '', '', $query_args, true);
2268 2268
 				break;
2269 2269
 		}
2270 2270
 
@@ -2281,21 +2281,21 @@  discard block
 block discarded – undo
2281 2281
 	 */
2282 2282
 	public function redirect_to_txn() {
2283 2283
 		EE_System::do_not_cache();
2284
-		EE_Registry::instance()->SSN->clear_session( __CLASS__, __FUNCTION__ );
2284
+		EE_Registry::instance()->SSN->clear_session(__CLASS__, __FUNCTION__);
2285 2285
 		$query_args = array(
2286 2286
 			'action' => 'view_transaction',
2287
-			'TXN_ID' => isset( $this->_req_data['TXN_ID'] ) ? absint( $this->_req_data[ 'TXN_ID' ] )  : 0,
2287
+			'TXN_ID' => isset($this->_req_data['TXN_ID']) ? absint($this->_req_data['TXN_ID']) : 0,
2288 2288
 			'page'   => 'espresso_transactions'
2289 2289
 		);
2290
-		if ( isset( $this->_req_data[ 'EVT_ID' ], $this->_req_data[ 'redirect_from' ] ) ) {
2291
-			$query_args['EVT_ID'] = $this->_req_data[ 'EVT_ID' ];
2292
-			$query_args['event_name'] = urlencode( $this->_req_data[ 'event_name' ] );
2293
-			$query_args['redirect_from'] = $this->_req_data[ 'redirect_from' ];
2290
+		if (isset($this->_req_data['EVT_ID'], $this->_req_data['redirect_from'])) {
2291
+			$query_args['EVT_ID'] = $this->_req_data['EVT_ID'];
2292
+			$query_args['event_name'] = urlencode($this->_req_data['event_name']);
2293
+			$query_args['redirect_from'] = $this->_req_data['redirect_from'];
2294 2294
 		}
2295 2295
 		EE_Error::add_success(
2296
-			__( 'Registration Created.  Please review the transaction and add any payments as necessary', 'event_espresso' )
2296
+			__('Registration Created.  Please review the transaction and add any payments as necessary', 'event_espresso')
2297 2297
 		);
2298
-		$this->_redirect_after_action( false, '', '', $query_args, true );
2298
+		$this->_redirect_after_action(false, '', '', $query_args, true);
2299 2299
 	}
2300 2300
 
2301 2301
 
@@ -2306,7 +2306,7 @@  discard block
 block discarded – undo
2306 2306
 	*		@return void
2307 2307
 	*/
2308 2308
 	protected function _attendee_contact_list_table() {
2309
-		do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' );
2309
+		do_action('AHEE_log', __FILE__, __FUNCTION__, '');
2310 2310
 		$this->_search_btn_label = __('Contacts', 'event_espresso');
2311 2311
 		$this->display_admin_list_table_page_with_no_sidebar();
2312 2312
 	}
@@ -2321,10 +2321,10 @@  discard block
 block discarded – undo
2321 2321
 	*		@access public
2322 2322
 	*		@return array
2323 2323
 	*/
2324
-	public function get_attendees( $per_page, $count = FALSE, $trash = FALSE ) {
2324
+	public function get_attendees($per_page, $count = FALSE, $trash = FALSE) {
2325 2325
 
2326
-		do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' );
2327
-		require_once( REG_ADMIN . 'EE_Attendee_Contact_List_Table.class.php' );
2326
+		do_action('AHEE_log', __FILE__, __FUNCTION__, '');
2327
+		require_once(REG_ADMIN.'EE_Attendee_Contact_List_Table.class.php');
2328 2328
 		$ATT_MDL = EEM_Attendee::instance();
2329 2329
 
2330 2330
 		$this->_req_data['orderby'] = ! empty($this->_req_data['orderby']) ? $this->_req_data['orderby'] : '';
@@ -2352,47 +2352,47 @@  discard block
 block discarded – undo
2352 2352
 				$orderby = 'ATT_lname';
2353 2353
 		}
2354 2354
 
2355
-		$sort = ( isset( $this->_req_data['order'] ) && ! empty( $this->_req_data['order'] )) ? $this->_req_data['order'] : 'ASC';
2355
+		$sort = (isset($this->_req_data['order']) && ! empty($this->_req_data['order'])) ? $this->_req_data['order'] : 'ASC';
2356 2356
 
2357
-		$current_page = isset( $this->_req_data['paged'] ) && !empty( $this->_req_data['paged'] ) ? $this->_req_data['paged'] : 1;
2358
-		$per_page = isset( $per_page ) && !empty( $per_page ) ? $per_page : 10;
2359
-		$per_page = isset( $this->_req_data['perpage'] ) && !empty( $this->_req_data['perpage'] ) ? $this->_req_data['perpage'] : $per_page;
2357
+		$current_page = isset($this->_req_data['paged']) && ! empty($this->_req_data['paged']) ? $this->_req_data['paged'] : 1;
2358
+		$per_page = isset($per_page) && ! empty($per_page) ? $per_page : 10;
2359
+		$per_page = isset($this->_req_data['perpage']) && ! empty($this->_req_data['perpage']) ? $this->_req_data['perpage'] : $per_page;
2360 2360
 
2361 2361
 		$_where = array();
2362 2362
 
2363
-		if ( isset( $this->_req_data['s'] ) ) {
2364
-			$sstr = '%' . $this->_req_data['s'] . '%';
2363
+		if (isset($this->_req_data['s'])) {
2364
+			$sstr = '%'.$this->_req_data['s'].'%';
2365 2365
 			$_where['OR'] = array(
2366
-				'Registration.Event.EVT_name' => array( 'LIKE', $sstr),
2367
-				'Registration.Event.EVT_desc' => array( 'LIKE', $sstr ),
2368
-				'Registration.Event.EVT_short_desc' => array( 'LIKE' , $sstr ),
2369
-				'ATT_fname' => array( 'LIKE', $sstr ),
2370
-				'ATT_lname' => array( 'LIKE', $sstr ),
2371
-				'ATT_short_bio' => array( 'LIKE', $sstr ),
2372
-				'ATT_email' => array('LIKE', $sstr ),
2373
-				'ATT_address' => array( 'LIKE', $sstr ),
2374
-				'ATT_address2' => array( 'LIKE', $sstr ),
2375
-				'ATT_city' => array( 'LIKE', $sstr ),
2376
-				'Country.CNT_name' => array( 'LIKE', $sstr ),
2377
-				'State.STA_name' => array('LIKE', $sstr ),
2378
-				'ATT_phone' => array( 'LIKE', $sstr ),
2379
-				'Registration.REG_final_price' => array( 'LIKE', $sstr ),
2380
-				'Registration.REG_code' => array( 'LIKE', $sstr ),
2381
-				'Registration.REG_count' => array( 'LIKE' , $sstr ),
2382
-				'Registration.REG_group_size' => array( 'LIKE' , $sstr )
2366
+				'Registration.Event.EVT_name' => array('LIKE', $sstr),
2367
+				'Registration.Event.EVT_desc' => array('LIKE', $sstr),
2368
+				'Registration.Event.EVT_short_desc' => array('LIKE', $sstr),
2369
+				'ATT_fname' => array('LIKE', $sstr),
2370
+				'ATT_lname' => array('LIKE', $sstr),
2371
+				'ATT_short_bio' => array('LIKE', $sstr),
2372
+				'ATT_email' => array('LIKE', $sstr),
2373
+				'ATT_address' => array('LIKE', $sstr),
2374
+				'ATT_address2' => array('LIKE', $sstr),
2375
+				'ATT_city' => array('LIKE', $sstr),
2376
+				'Country.CNT_name' => array('LIKE', $sstr),
2377
+				'State.STA_name' => array('LIKE', $sstr),
2378
+				'ATT_phone' => array('LIKE', $sstr),
2379
+				'Registration.REG_final_price' => array('LIKE', $sstr),
2380
+				'Registration.REG_code' => array('LIKE', $sstr),
2381
+				'Registration.REG_count' => array('LIKE', $sstr),
2382
+				'Registration.REG_group_size' => array('LIKE', $sstr)
2383 2383
 				);
2384 2384
 		}
2385 2385
 
2386 2386
 
2387
-		$offset = ($current_page-1)*$per_page;
2388
-		$limit = $count ? NULL : array( $offset, $per_page );
2387
+		$offset = ($current_page - 1) * $per_page;
2388
+		$limit = $count ? NULL : array($offset, $per_page);
2389 2389
 
2390
-		if ( $trash ) {
2391
-			$_where['status'] = array( '!=', 'publish' );
2392
-			$all_attendees = $count ? $ATT_MDL->count( array($_where,'order_by'=>array($orderby=>$sort), 'limit'=>$limit)): $ATT_MDL->get_all( array($_where,'order_by'=>array($orderby=>$sort), 'limit'=>$limit));
2390
+		if ($trash) {
2391
+			$_where['status'] = array('!=', 'publish');
2392
+			$all_attendees = $count ? $ATT_MDL->count(array($_where, 'order_by'=>array($orderby=>$sort), 'limit'=>$limit)) : $ATT_MDL->get_all(array($_where, 'order_by'=>array($orderby=>$sort), 'limit'=>$limit));
2393 2393
 		} else {
2394
-			$_where['status'] = array( 'IN', array( 'publish' ) );
2395
-			$all_attendees = $count ? $ATT_MDL->count( array($_where, 'order_by'=>array($orderby=>$sort),'limit'=>$limit)) : $ATT_MDL->get_all( array($_where, 'order_by'=>array($orderby=>$sort), 'limit'=>$limit) );
2394
+			$_where['status'] = array('IN', array('publish'));
2395
+			$all_attendees = $count ? $ATT_MDL->count(array($_where, 'order_by'=>array($orderby=>$sort), 'limit'=>$limit)) : $ATT_MDL->get_all(array($_where, 'order_by'=>array($orderby=>$sort), 'limit'=>$limit));
2396 2396
 		}
2397 2397
 
2398 2398
 		return $all_attendees;
@@ -2409,10 +2409,10 @@  discard block
 block discarded – undo
2409 2409
 	 */
2410 2410
 	protected function _resend_registration() {
2411 2411
 		$this->_process_resend_registration();
2412
-		$query_args = isset($this->_req_data['redirect_to'] ) ? array('action' => $this->_req_data['redirect_to'], '_REG_ID' => $this->_req_data['_REG_ID'] ) : array(
2412
+		$query_args = isset($this->_req_data['redirect_to']) ? array('action' => $this->_req_data['redirect_to'], '_REG_ID' => $this->_req_data['_REG_ID']) : array(
2413 2413
 			'action' => 'default'
2414 2414
 		);
2415
-		$this->_redirect_after_action(FALSE, '', '', $query_args, TRUE );
2415
+		$this->_redirect_after_action(FALSE, '', '', $query_args, TRUE);
2416 2416
 	}
2417 2417
 
2418 2418
 
@@ -2420,27 +2420,27 @@  discard block
 block discarded – undo
2420 2420
 
2421 2421
 
2422 2422
 
2423
-	public function _registrations_report(){
2424
-		if( ! defined( 'EE_USE_OLD_CSV_REPORT_CLASS' ) ) {
2425
-			wp_redirect( EE_Admin_Page::add_query_args_and_nonce(
2423
+	public function _registrations_report() {
2424
+		if ( ! defined('EE_USE_OLD_CSV_REPORT_CLASS')) {
2425
+			wp_redirect(EE_Admin_Page::add_query_args_and_nonce(
2426 2426
 				array(
2427 2427
 					'page' => 'espresso_batch',
2428 2428
 					'batch' => 'file',
2429
-					'EVT_ID' => isset( $this->_req_data[ 'EVT_ID'] ) ? $this->_req_data[ 'EVT_ID' ] : NULL,
2430
-					'job_handler' => urlencode( 'EventEspressoBatchRequest\JobHandlers\RegistrationsReport' ),
2431
-					'return_url' => urlencode( $this->_req_data[ 'return_url' ] ),
2432
-				)) );
2429
+					'EVT_ID' => isset($this->_req_data['EVT_ID']) ? $this->_req_data['EVT_ID'] : NULL,
2430
+					'job_handler' => urlencode('EventEspressoBatchRequest\JobHandlers\RegistrationsReport'),
2431
+					'return_url' => urlencode($this->_req_data['return_url']),
2432
+				)));
2433 2433
 		} else {
2434
-			EE_Registry::instance()->load_helper( 'File' );
2434
+			EE_Registry::instance()->load_helper('File');
2435 2435
 			$new_request_args = array(
2436 2436
 				'export' => 'report',
2437 2437
 				'action' => 'registrations_report_for_event',
2438
-				'EVT_ID' => isset( $this->_req_data[ 'EVT_ID'] ) ? $this->_req_data[ 'EVT_ID' ] : NULL,
2438
+				'EVT_ID' => isset($this->_req_data['EVT_ID']) ? $this->_req_data['EVT_ID'] : NULL,
2439 2439
 			);
2440 2440
 			$this->_req_data = array_merge($this->_req_data, $new_request_args);
2441 2441
 
2442
-			if ( is_readable(EE_CLASSES . 'EE_Export.class.php')) {
2443
-				require_once(EE_CLASSES . 'EE_Export.class.php');
2442
+			if (is_readable(EE_CLASSES.'EE_Export.class.php')) {
2443
+				require_once(EE_CLASSES.'EE_Export.class.php');
2444 2444
 				$EE_Export = EE_Export::instance($this->_req_data);
2445 2445
 				$EE_Export->export();
2446 2446
 			}
@@ -2449,28 +2449,28 @@  discard block
 block discarded – undo
2449 2449
 
2450 2450
 
2451 2451
 
2452
-	public function _contact_list_export(){
2453
-		EE_Registry::instance()->load_helper( 'File' );
2454
-		if ( is_readable(EE_CLASSES . 'EE_Export.class.php')) {
2455
-			require_once(EE_CLASSES . 'EE_Export.class.php');
2452
+	public function _contact_list_export() {
2453
+		EE_Registry::instance()->load_helper('File');
2454
+		if (is_readable(EE_CLASSES.'EE_Export.class.php')) {
2455
+			require_once(EE_CLASSES.'EE_Export.class.php');
2456 2456
 			$EE_Export = EE_Export::instance($this->_req_data);
2457 2457
 			$EE_Export->export_attendees();
2458 2458
 		}
2459 2459
 	}
2460 2460
 
2461
-	public function _contact_list_report(){
2462
-		if( ! defined( 'EE_USE_OLD_CSV_REPORT_CLASS' ) ) {
2463
-			wp_redirect( EE_Admin_Page::add_query_args_and_nonce(
2461
+	public function _contact_list_report() {
2462
+		if ( ! defined('EE_USE_OLD_CSV_REPORT_CLASS')) {
2463
+			wp_redirect(EE_Admin_Page::add_query_args_and_nonce(
2464 2464
 				array(
2465 2465
 					'page' => 'espresso_batch',
2466 2466
 					'batch' => 'file',
2467
-					'job_handler' => urlencode( 'EventEspressoBatchRequest\JobHandlers\AttendeesReport' ),
2468
-					'return_url' => urlencode( $this->_req_data[ 'return_url' ] ),
2469
-				)) );
2467
+					'job_handler' => urlencode('EventEspressoBatchRequest\JobHandlers\AttendeesReport'),
2468
+					'return_url' => urlencode($this->_req_data['return_url']),
2469
+				)));
2470 2470
 		} else {
2471
-			EE_Registry::instance()->load_helper( 'File' );
2472
-			if ( is_readable(EE_CLASSES . 'EE_Export.class.php')) {
2473
-				require_once(EE_CLASSES . 'EE_Export.class.php');
2471
+			EE_Registry::instance()->load_helper('File');
2472
+			if (is_readable(EE_CLASSES.'EE_Export.class.php')) {
2473
+				require_once(EE_CLASSES.'EE_Export.class.php');
2474 2474
 				$EE_Export = EE_Export::instance($this->_req_data);
2475 2475
 				$EE_Export->report_attendees();
2476 2476
 			}
@@ -2490,73 +2490,73 @@  discard block
 block discarded – undo
2490 2490
 	 * @return void
2491 2491
 	 */
2492 2492
 	protected function _duplicate_attendee() {
2493
-		$action = !empty( $this->_req_data['return'] ) ? $this->_req_data['return'] : 'default';
2493
+		$action = ! empty($this->_req_data['return']) ? $this->_req_data['return'] : 'default';
2494 2494
 		//verify we have necessary info
2495
-		if ( empty($this->_req_data['_REG_ID'] )  ) {
2496
-			EE_Error::add_error( __('Unable to create the contact for the registration because the required paramaters are not present (_REG_ID )', 'event_espresso'),  __FILE__, __LINE__, __FUNCTION__ );
2497
-			$query_args = array( 'action' => $action );
2495
+		if (empty($this->_req_data['_REG_ID'])) {
2496
+			EE_Error::add_error(__('Unable to create the contact for the registration because the required paramaters are not present (_REG_ID )', 'event_espresso'), __FILE__, __LINE__, __FUNCTION__);
2497
+			$query_args = array('action' => $action);
2498 2498
 			$this->_redirect_after_action('', '', '', $query_args, TRUE);
2499 2499
 		}
2500 2500
 
2501 2501
 		//okay necessary deets present... let's dupe the incoming attendee and attach to incoming registration.
2502
-		$registration = EEM_Registration::instance()->get_one_by_ID( $this->_req_data['_REG_ID'] );
2502
+		$registration = EEM_Registration::instance()->get_one_by_ID($this->_req_data['_REG_ID']);
2503 2503
 		$attendee = $registration->attendee();
2504 2504
 
2505 2505
 		//remove relation of existing attendee on registration
2506
-		$registration->_remove_relation_to($attendee, 'Attendee' );
2506
+		$registration->_remove_relation_to($attendee, 'Attendee');
2507 2507
 		//new attendee
2508 2508
 		$new_attendee = clone $attendee;
2509
-		$new_attendee->set( 'ATT_ID', 0 );
2509
+		$new_attendee->set('ATT_ID', 0);
2510 2510
 		$new_attendee->save();
2511 2511
 
2512 2512
 		//add new attendee to reg
2513
-		$registration->_add_relation_to( $new_attendee, 'Attendee');
2513
+		$registration->_add_relation_to($new_attendee, 'Attendee');
2514 2514
 
2515
-		EE_Error::add_success( __('New Contact record created.  Now make any edits you wish to make for this contact.', 'event_espresso') );
2515
+		EE_Error::add_success(__('New Contact record created.  Now make any edits you wish to make for this contact.', 'event_espresso'));
2516 2516
 
2517 2517
 		//redirect to edit page for attendee
2518
-		$query_args = array( 'post' => $new_attendee->ID(), 'action' => 'edit_attendee' );
2518
+		$query_args = array('post' => $new_attendee->ID(), 'action' => 'edit_attendee');
2519 2519
 
2520
-		$this->_redirect_after_action( '', '', '', $query_args, TRUE );
2520
+		$this->_redirect_after_action('', '', '', $query_args, TRUE);
2521 2521
 	}
2522 2522
 
2523 2523
 
2524 2524
 	//related to cpt routes
2525 2525
 	protected function _insert_update_cpt_item($post_id, $post) {
2526 2526
 		$success = true;
2527
-		$attendee = EEM_Attendee::instance()->get_one_by_ID( $post_id );
2527
+		$attendee = EEM_Attendee::instance()->get_one_by_ID($post_id);
2528 2528
 		//for attendee updates
2529
-		if ( $post->post_type = 'espresso_attendees' && !empty( $attendee ) ) {
2529
+		if ($post->post_type = 'espresso_attendees' && ! empty($attendee)) {
2530 2530
 			//note we should only be UPDATING attendees at this point.
2531 2531
 			$updated_fields = array(
2532 2532
 				'ATT_fname' => $this->_req_data['ATT_fname'],
2533 2533
 				'ATT_lname' => $this->_req_data['ATT_lname'],
2534
-				'ATT_full_name'=> $this->_req_data['ATT_fname'] . ' ' . $this->_req_data['ATT_lname'],
2534
+				'ATT_full_name'=> $this->_req_data['ATT_fname'].' '.$this->_req_data['ATT_lname'],
2535 2535
 				'ATT_address' => isset($this->_req_data['ATT_address']) ? $this->_req_data['ATT_address'] : '',
2536 2536
 				'ATT_address2' => isset($this->_req_data['ATT_address2']) ? $this->_req_data['ATT_address2'] : '',
2537
-				'ATT_city' => isset( $this->_req_data['ATT_city'] ) ? $this->_req_data['ATT_city'] : '',
2538
-				'STA_ID' => isset( $this->_req_data['STA_ID'] ) ? $this->_req_data['STA_ID'] : '',
2539
-				'CNT_ISO' => isset( $this->_req_data['CNT_ISO'] ) ? $this->_req_data['CNT_ISO'] : '',
2540
-				'ATT_zip' => isset( $this->_req_data['ATT_zip'] ) ? $this->_req_data['ATT_zip'] : '',
2541
-				'ATT_email' => isset( $this->_req_data['ATT_email'] ) ? $this->_req_data['ATT_email'] : '',
2542
-				'ATT_phone' => isset( $this->_req_data['ATT_phone'] ) ? $this->_req_data['ATT_phone'] : ''
2537
+				'ATT_city' => isset($this->_req_data['ATT_city']) ? $this->_req_data['ATT_city'] : '',
2538
+				'STA_ID' => isset($this->_req_data['STA_ID']) ? $this->_req_data['STA_ID'] : '',
2539
+				'CNT_ISO' => isset($this->_req_data['CNT_ISO']) ? $this->_req_data['CNT_ISO'] : '',
2540
+				'ATT_zip' => isset($this->_req_data['ATT_zip']) ? $this->_req_data['ATT_zip'] : '',
2541
+				'ATT_email' => isset($this->_req_data['ATT_email']) ? $this->_req_data['ATT_email'] : '',
2542
+				'ATT_phone' => isset($this->_req_data['ATT_phone']) ? $this->_req_data['ATT_phone'] : ''
2543 2543
 				);
2544
-			foreach ( $updated_fields as $field => $value ) {
2544
+			foreach ($updated_fields as $field => $value) {
2545 2545
 				$attendee->set($field, $value);
2546 2546
 			}
2547 2547
 
2548 2548
 			$success = $attendee->save();
2549 2549
 
2550
-			$attendee_update_callbacks = apply_filters( 'FHEE__Registrations_Admin_Page__insert_update_cpt_item__attendee_update', array() );
2551
-			foreach ( $attendee_update_callbacks as $a_callback ) {
2552
-				if ( FALSE === call_user_func_array( $a_callback, array($attendee, $this->_req_data ) ) ) {
2553
-					throw new EE_Error( sprintf( __('The %s callback given for the "FHEE__Registrations_Admin_Page__insert_update_cpt_item__attendee_update" filter is not a valid callback.  Please check the spelling.', 'event_espresso'), $a_callback ) );
2550
+			$attendee_update_callbacks = apply_filters('FHEE__Registrations_Admin_Page__insert_update_cpt_item__attendee_update', array());
2551
+			foreach ($attendee_update_callbacks as $a_callback) {
2552
+				if (FALSE === call_user_func_array($a_callback, array($attendee, $this->_req_data))) {
2553
+					throw new EE_Error(sprintf(__('The %s callback given for the "FHEE__Registrations_Admin_Page__insert_update_cpt_item__attendee_update" filter is not a valid callback.  Please check the spelling.', 'event_espresso'), $a_callback));
2554 2554
 				}
2555 2555
 			}
2556 2556
 		}
2557 2557
 
2558
-		if ( $success === FALSE )
2559
-			EE_Error::add_error(__('Something went wrong with updating the meta table data for the registration.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__ );
2558
+		if ($success === FALSE)
2559
+			EE_Error::add_error(__('Something went wrong with updating the meta table data for the registration.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
2560 2560
 
2561 2561
 	}
2562 2562
 
@@ -2576,17 +2576,17 @@  discard block
 block discarded – undo
2576 2576
 		remove_meta_box('postexcerpt', __('Excerpt'), 'post_excerpt_meta_box', $this->_cpt_routes[$this->_req_action], 'normal', 'core');
2577 2577
 		remove_meta_box('commentstatusdiv', $this->_cpt_routes[$this->_req_action], 'normal', 'core');
2578 2578
 
2579
-		if ( post_type_supports( 'espresso_attendees', 'excerpt') ) {
2580
-			add_meta_box('postexcerpt', __('Short Biography', 'event_espresso'), 'post_excerpt_meta_box', $this->_cpt_routes[$this->_req_action], 'normal' );
2579
+		if (post_type_supports('espresso_attendees', 'excerpt')) {
2580
+			add_meta_box('postexcerpt', __('Short Biography', 'event_espresso'), 'post_excerpt_meta_box', $this->_cpt_routes[$this->_req_action], 'normal');
2581 2581
 		}
2582 2582
 
2583
-		if ( post_type_supports( 'espresso_attendees', 'comments') ) {
2583
+		if (post_type_supports('espresso_attendees', 'comments')) {
2584 2584
 			add_meta_box('commentsdiv', __('Notes on the Contact', 'event_espresso'), 'post_comment_meta_box', $this->_cpt_routes[$this->_req_action], 'normal', 'core');
2585 2585
 		}
2586 2586
 
2587
-		add_meta_box('attendee_contact_info', __('Contact Info', 'event_espresso'), array( $this, 'attendee_contact_info'), $this->_cpt_routes[$this->_req_action], 'side', 'core' );
2588
-		add_meta_box('attendee_details_address', __('Address Details', 'event_espresso'), array($this, 'attendee_address_details'), $this->_cpt_routes[$this->_req_action], 'normal', 'core' );
2589
-		add_meta_box('attendee_registrations', __('Registrations for this Contact', 'event_espresso'), array( $this, 'attendee_registrations_meta_box'), $this->_cpt_routes[$this->_req_action], 'normal', 'high');
2587
+		add_meta_box('attendee_contact_info', __('Contact Info', 'event_espresso'), array($this, 'attendee_contact_info'), $this->_cpt_routes[$this->_req_action], 'side', 'core');
2588
+		add_meta_box('attendee_details_address', __('Address Details', 'event_espresso'), array($this, 'attendee_address_details'), $this->_cpt_routes[$this->_req_action], 'normal', 'core');
2589
+		add_meta_box('attendee_registrations', __('Registrations for this Contact', 'event_espresso'), array($this, 'attendee_registrations_meta_box'), $this->_cpt_routes[$this->_req_action], 'normal', 'high');
2590 2590
 	}
2591 2591
 
2592 2592
 
@@ -2595,10 +2595,10 @@  discard block
 block discarded – undo
2595 2595
 	 * @param  WP_Post $post wp post object
2596 2596
 	 * @return string        attendee contact info ( and form )
2597 2597
 	 */
2598
-	public function attendee_contact_info( $post ) {
2598
+	public function attendee_contact_info($post) {
2599 2599
 		//get attendee object ( should already have it )
2600 2600
 		$this->_template_args['attendee'] = $this->_cpt_model_obj;
2601
-		$template = REG_TEMPLATE_PATH . 'attendee_contact_info_metabox_content.template.php';
2601
+		$template = REG_TEMPLATE_PATH.'attendee_contact_info_metabox_content.template.php';
2602 2602
 		EEH_Template::display_template($template, $this->_template_args);
2603 2603
 	}
2604 2604
 
@@ -2614,12 +2614,12 @@  discard block
 block discarded – undo
2614 2614
 		$this->_template_args['attendee'] = $this->_cpt_model_obj;
2615 2615
 		$this->_template_args['state_html'] = EEH_Form_Fields::generate_form_input(
2616 2616
 				new EE_Question_Form_Input(
2617
-				EE_Question::new_instance( array(
2617
+				EE_Question::new_instance(array(
2618 2618
 					'QST_ID' => 0,
2619 2619
 					'QST_display_text' => __('State/Province', 'event_espresso'),
2620 2620
 					'QST_system' => 'admin-state'
2621 2621
 					)),
2622
-				EE_Answer::new_instance( array(
2622
+				EE_Answer::new_instance(array(
2623 2623
 					'ANS_ID' => 0,
2624 2624
 					'ANS_value' => $this->_cpt_model_obj->state_ID()
2625 2625
 					)),
@@ -2632,12 +2632,12 @@  discard block
 block discarded – undo
2632 2632
 			));
2633 2633
 		$this->_template_args['country_html'] = EEH_Form_Fields::generate_form_input(
2634 2634
 				new EE_Question_Form_Input(
2635
-				EE_Question::new_instance( array(
2635
+				EE_Question::new_instance(array(
2636 2636
 					'QST_ID' => 0,
2637 2637
 					'QST_display_text' => __('Country', 'event_espresso'),
2638 2638
 					'QST_system' => 'admin-country'
2639 2639
 					)),
2640
-				EE_Answer::new_instance( array(
2640
+				EE_Answer::new_instance(array(
2641 2641
 					'ANS_ID' => 0,
2642 2642
 					'ANS_value' => $this->_cpt_model_obj->country_ID()
2643 2643
 					)),
@@ -2648,8 +2648,8 @@  discard block
 block discarded – undo
2648 2648
 					'append_qstn_id' => FALSE
2649 2649
 					)
2650 2650
 				));
2651
-		$template = REG_TEMPLATE_PATH . 'attendee_address_details_metabox_content.template.php';
2652
-		EEH_Template::display_template($template, $this->_template_args );
2651
+		$template = REG_TEMPLATE_PATH.'attendee_address_details_metabox_content.template.php';
2652
+		EEH_Template::display_template($template, $this->_template_args);
2653 2653
 
2654 2654
 	}
2655 2655
 
@@ -2659,11 +2659,11 @@  discard block
 block discarded – undo
2659 2659
 	*		@access protected
2660 2660
 	*		@return void
2661 2661
 	*/
2662
-	public function attendee_registrations_meta_box( $post ) {
2662
+	public function attendee_registrations_meta_box($post) {
2663 2663
 
2664 2664
 		$this->_template_args['attendee'] = $this->_cpt_model_obj;
2665 2665
 		$this->_template_args['registrations'] = $this->_cpt_model_obj->get_many_related('Registration');
2666
-		$template = REG_TEMPLATE_PATH . 'attendee_registrations_main_meta_box.template.php';
2666
+		$template = REG_TEMPLATE_PATH.'attendee_registrations_main_meta_box.template.php';
2667 2667
 		EEH_Template::display_template($template, $this->_template_args);
2668 2668
 
2669 2669
 	}
@@ -2677,8 +2677,8 @@  discard block
 block discarded – undo
2677 2677
 	 * @return string        html for new form.
2678 2678
 	 */
2679 2679
 	public function after_title_form_fields($post) {
2680
-		if ( $post->post_type == 'espresso_attendees' ) {
2681
-			$template = REG_TEMPLATE_PATH . 'attendee_details_after_title_form_fields.template.php';
2680
+		if ($post->post_type == 'espresso_attendees') {
2681
+			$template = REG_TEMPLATE_PATH.'attendee_details_after_title_form_fields.template.php';
2682 2682
 			$template_args['attendee'] = $this->_cpt_model_obj;
2683 2683
 			EEH_Template::display_template($template, $template_args);
2684 2684
 		}
@@ -2695,21 +2695,21 @@  discard block
 block discarded – undo
2695 2695
 	*		@access protected
2696 2696
 	*		@return void
2697 2697
 	*/
2698
-	protected function _trash_or_restore_attendees( $trash = TRUE ) {
2698
+	protected function _trash_or_restore_attendees($trash = TRUE) {
2699 2699
 
2700
-		do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' );
2700
+		do_action('AHEE_log', __FILE__, __FUNCTION__, '');
2701 2701
 
2702 2702
 		$ATT_MDL = EEM_Attendee::instance();
2703 2703
 
2704 2704
 		$success = 1;
2705 2705
 		//Checkboxes
2706
-		if (!empty($this->_req_data['checkbox']) && is_array($this->_req_data['checkbox'])) {
2706
+		if ( ! empty($this->_req_data['checkbox']) && is_array($this->_req_data['checkbox'])) {
2707 2707
 			// if array has more than one element than success message should be plural
2708
-			$success = count( $this->_req_data['checkbox'] ) > 1 ? 2 : 1;
2708
+			$success = count($this->_req_data['checkbox']) > 1 ? 2 : 1;
2709 2709
 			// cycle thru checkboxes
2710
-			while (list( $ATT_ID, $value ) = each($this->_req_data['checkbox'])) {
2711
-				$updated = $trash ? $ATT_MDL->update_by_ID(array( 'status' => 'trash' ), $ATT_ID) : $ATT_MDL->update_by_ID( array('status' => 'publish' ), $ATT_ID);
2712
-				if ( !$updated ) {
2710
+			while (list($ATT_ID, $value) = each($this->_req_data['checkbox'])) {
2711
+				$updated = $trash ? $ATT_MDL->update_by_ID(array('status' => 'trash'), $ATT_ID) : $ATT_MDL->update_by_ID(array('status' => 'publish'), $ATT_ID);
2712
+				if ( ! $updated) {
2713 2713
 					$success = 0;
2714 2714
 				}
2715 2715
 			}
@@ -2718,18 +2718,18 @@  discard block
 block discarded – undo
2718 2718
 			// grab single id and delete
2719 2719
 			$ATT_ID = absint($this->_req_data['ATT_ID']);
2720 2720
 			//get attendee
2721
-			$att = $ATT_MDL->get_one_by_ID( $ATT_ID );
2721
+			$att = $ATT_MDL->get_one_by_ID($ATT_ID);
2722 2722
 			$updated = $trash ? $att->set_status('trash') : $att->set_status('publish');
2723 2723
 			$updated = $att->save();
2724
-			if ( ! $updated ) {
2724
+			if ( ! $updated) {
2725 2725
 				$success = 0;
2726 2726
 			}
2727 2727
 
2728 2728
 		}
2729 2729
 
2730
-		$what = $success > 1 ? __( 'Contacts', 'event_espresso' ) : __( 'Contact', 'event_espresso' );
2731
-		$action_desc = $trash ? __( 'moved to the trash', 'event_espresso' ) : __( 'restored', 'event_espresso' );
2732
-		$this->_redirect_after_action( $success, $what, $action_desc, array( 'action' => 'contact_list' ) );
2730
+		$what = $success > 1 ? __('Contacts', 'event_espresso') : __('Contact', 'event_espresso');
2731
+		$action_desc = $trash ? __('moved to the trash', 'event_espresso') : __('restored', 'event_espresso');
2732
+		$this->_redirect_after_action($success, $what, $action_desc, array('action' => 'contact_list'));
2733 2733
 
2734 2734
 	}
2735 2735
 
Please login to merge, or discard this patch.
core/db_classes/EE_Export.class.php 1 patch
Spacing   +170 added lines, -170 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1
-<?php if (!defined('EVENT_ESPRESSO_VERSION')) exit('No direct script access allowed');
2
-do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' );
1
+<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) exit('No direct script access allowed');
2
+do_action('AHEE_log', __FILE__, __FUNCTION__, '');
3 3
 /**
4 4
  * EE_Export class
5 5
  * 
@@ -39,11 +39,11 @@  discard block
 block discarded – undo
39 39
 	  * @access private
40 40
 	  * @param array $request_data
41 41
 	  */
42
- 	private function __construct( $request_data = array() ) {
42
+ 	private function __construct($request_data = array()) {
43 43
 		$this->_req_data = $request_data;
44
-		$this->today = date("Y-m-d",time());
45
-		require_once( EE_CLASSES . 'EE_CSV.class.php' );
46
-		$this->EE_CSV= EE_CSV::instance();
44
+		$this->today = date("Y-m-d", time());
45
+		require_once(EE_CLASSES.'EE_CSV.class.php');
46
+		$this->EE_CSV = EE_CSV::instance();
47 47
 	}
48 48
 
49 49
 
@@ -55,10 +55,10 @@  discard block
 block discarded – undo
55 55
 	  * @param array $request_data
56 56
 	  * @return \EE_Export
57 57
 	  */
58
-	public static function instance( $request_data = array() ) {
58
+	public static function instance($request_data = array()) {
59 59
 		// check if class object is instantiated
60
-		if ( self::$_instance === NULL  or ! is_object( self::$_instance ) or ! ( self::$_instance instanceof EE_Export )) {
61
-			self::$_instance = new self( $request_data );
60
+		if (self::$_instance === NULL or ! is_object(self::$_instance) or ! (self::$_instance instanceof EE_Export)) {
61
+			self::$_instance = new self($request_data);
62 62
 		}
63 63
 		return self::$_instance;
64 64
 	}
@@ -72,15 +72,15 @@  discard block
 block discarded – undo
72 72
 	public function export() {
73 73
 
74 74
 		// in case of bulk exports, the "actual" action will be in action2, but first check regular action for "export" keyword
75
-		if ( isset( $this->_req_data['action'] ) && strpos( $this->_req_data['action'], 'export' ) === FALSE ) {
75
+		if (isset($this->_req_data['action']) && strpos($this->_req_data['action'], 'export') === FALSE) {
76 76
 			// check if action2 has export action
77
-			if ( isset( $this->_req_data['action2'] ) && strpos( $this->_req_data['action2'], 'export' ) !== FALSE ) {
77
+			if (isset($this->_req_data['action2']) && strpos($this->_req_data['action2'], 'export') !== FALSE) {
78 78
 				// whoop! there it is!
79 79
 				$this->_req_data['action'] = $this->_req_data['action2'];
80 80
 			}
81 81
 		}
82 82
 
83
-		$this->_req_data['export'] = isset( $this->_req_data['export'] ) ? $this->_req_data['export'] : '';
83
+		$this->_req_data['export'] = isset($this->_req_data['export']) ? $this->_req_data['export'] : '';
84 84
 
85 85
 		switch ($this->_req_data['export']) {
86 86
 			case 'report':
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
 					break;
95 95
 
96 96
 					case 'registrations_report_for_event':
97
-						$this->report_registrations_for_event( $this->_req_data['EVT_ID'] );
97
+						$this->report_registrations_for_event($this->_req_data['EVT_ID']);
98 98
 					break;
99 99
 
100 100
 					case 'attendees':
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
 					break;
107 107
 
108 108
 					default:
109
-						EE_Error::add_error(__('An error occurred! The requested export report could not be found.','event_espresso'), __FILE__, __FUNCTION__, __LINE__ ) ;
109
+						EE_Error::add_error(__('An error occurred! The requested export report could not be found.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
110 110
 						return FALSE;
111 111
 					break;
112 112
 
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
 	 * Downloads a CSV file with all the columns, but no data. This should be used for importing
125 125
 	 * @return null kills execution
126 126
 	 */
127
-	function export_sample(){
127
+	function export_sample() {
128 128
 		$event = EEM_Event::instance()->get_one();
129 129
 		$this->_req_data['EVT_ID'] = $event->ID();
130 130
 		$this->export_all_event_data();
@@ -150,23 +150,23 @@  discard block
 block discarded – undo
150 150
 		$state_country_query_params = array();
151 151
 		$question_group_query_params = array();
152 152
 		$question_query_params = array();
153
-		if ( isset( $this->_req_data['EVT_ID'] )) {
153
+		if (isset($this->_req_data['EVT_ID'])) {
154 154
 			// do we have an array of IDs ?
155 155
 
156
-			if ( is_array( $this->_req_data['EVT_ID'] )) {
157
-				$EVT_IDs =  array_map( 'sanitize_text_field', $this->_req_data['EVT_ID'] );
158
-				$value_to_equal = array('IN',$EVT_IDs);
156
+			if (is_array($this->_req_data['EVT_ID'])) {
157
+				$EVT_IDs = array_map('sanitize_text_field', $this->_req_data['EVT_ID']);
158
+				$value_to_equal = array('IN', $EVT_IDs);
159 159
 				$filename = 'events';
160 160
 			} else {
161 161
 				// generate regular where = clause
162
-				$EVT_ID = absint( $this->_req_data['EVT_ID'] );
162
+				$EVT_ID = absint($this->_req_data['EVT_ID']);
163 163
 				$value_to_equal = $EVT_ID;
164 164
 				$event = EE_Registry::instance()->load_model('Event')->get_one_by_ID($EVT_ID);
165 165
 
166
-				$filename = 'event-' . ( $event instanceof EE_Event ? $event->slug() : __( 'unknown', 'event_espresso' ) );
166
+				$filename = 'event-'.($event instanceof EE_Event ? $event->slug() : __('unknown', 'event_espresso'));
167 167
 
168 168
 			}
169
-			$event_query_params[0]['EVT_ID'] =$value_to_equal;
169
+			$event_query_params[0]['EVT_ID'] = $value_to_equal;
170 170
 			$related_models_query_params[0]['Event.EVT_ID'] = $value_to_equal;
171 171
 			$related_through_reg_query_params[0]['Registration.EVT_ID'] = $value_to_equal;
172 172
 			$datetime_ticket_query_params[0]['Datetime.EVT_ID'] = $value_to_equal;
@@ -210,42 +210,42 @@  discard block
 block discarded – undo
210 210
 
211 211
 			);
212 212
 
213
-		$model_data = $this->_get_export_data_for_models( $models_to_export );
213
+		$model_data = $this->_get_export_data_for_models($models_to_export);
214 214
 
215
-		$filename = $this->generate_filename ( $filename );
215
+		$filename = $this->generate_filename($filename);
216 216
 
217
-		if ( ! $this->EE_CSV->export_multiple_model_data_to_csv( $filename, $model_data )) {
218
-			EE_Error::add_error(__("'An error occurred and the Event details could not be exported from the database.'", "event_espresso"), __FILE__, __FUNCTION__, __LINE__ );
217
+		if ( ! $this->EE_CSV->export_multiple_model_data_to_csv($filename, $model_data)) {
218
+			EE_Error::add_error(__("'An error occurred and the Event details could not be exported from the database.'", "event_espresso"), __FILE__, __FUNCTION__, __LINE__);
219 219
 		}
220 220
 	}
221 221
 
222
-	function report_attendees(){
222
+	function report_attendees() {
223 223
 		$attendee_rows = EEM_Attendee::instance()->get_all_wpdb_results( 
224 224
 			array( 
225
-				'force_join' => array( 'State', 'Country' ), 
225
+				'force_join' => array('State', 'Country'), 
226 226
 				'caps' => EEM_Base::caps_read_admin 
227 227
 			) 
228 228
 		);
229 229
 		$csv_data = array();
230
-		foreach( $attendee_rows as $attendee_row ){
230
+		foreach ($attendee_rows as $attendee_row) {
231 231
 			$csv_row = array();
232
-			foreach( EEM_Attendee::instance()->field_settings() as $field_name => $field_obj ){
233
-				if( $field_name == 'STA_ID' ){
234
-					$state_name_field = EEM_State::instance()->field_settings_for( 'STA_name' );
235
-					$csv_row[ __( 'State', 'event_espresso' ) ] = $attendee_row[ $state_name_field->get_qualified_column() ];
236
-				}elseif( $field_name == 'CNT_ISO' ){
237
-					$country_name_field = EEM_Country::instance()->field_settings_for( 'CNT_name' );
238
-					$csv_row[ __( 'Country', 'event_espresso' ) ] = $attendee_row[ $country_name_field->get_qualified_column() ];
239
-				}else{
240
-					$csv_row[ $field_obj->get_nicename() ] = $attendee_row[ $field_obj->get_qualified_column() ];
232
+			foreach (EEM_Attendee::instance()->field_settings() as $field_name => $field_obj) {
233
+				if ($field_name == 'STA_ID') {
234
+					$state_name_field = EEM_State::instance()->field_settings_for('STA_name');
235
+					$csv_row[__('State', 'event_espresso')] = $attendee_row[$state_name_field->get_qualified_column()];
236
+				}elseif ($field_name == 'CNT_ISO') {
237
+					$country_name_field = EEM_Country::instance()->field_settings_for('CNT_name');
238
+					$csv_row[__('Country', 'event_espresso')] = $attendee_row[$country_name_field->get_qualified_column()];
239
+				} else {
240
+					$csv_row[$field_obj->get_nicename()] = $attendee_row[$field_obj->get_qualified_column()];
241 241
 				}
242 242
 			}
243 243
 			$csv_data[] = $csv_row;
244 244
 		}
245 245
 
246
-		$filename = $this->generate_filename ( 'contact-list-report' );
246
+		$filename = $this->generate_filename('contact-list-report');
247 247
 
248
-		$handle = $this->EE_CSV->begin_sending_csv( $filename);
248
+		$handle = $this->EE_CSV->begin_sending_csv($filename);
249 249
 		$this->EE_CSV->write_data_array_to_csv($handle, $csv_data);
250 250
 		$this->EE_CSV->end_sending_csv($handle);
251 251
 	}
@@ -262,18 +262,18 @@  discard block
 block discarded – undo
262 262
 		$countries_that_have_an_attendee = EEM_Country::instance()->get_all(array(0=>array('Attendee.ATT_ID'=>array('IS NOT NULL'))));
263 263
 //		$states_to_export_query_params
264 264
 		$models_to_export = array(
265
-			'Country'=>array(array('CNT_ISO'=>array('IN',array_keys($countries_that_have_an_attendee)))),
266
-			'State'=>array(array('STA_ID'=>array('IN',array_keys($states_that_have_an_attendee)))),
265
+			'Country'=>array(array('CNT_ISO'=>array('IN', array_keys($countries_that_have_an_attendee)))),
266
+			'State'=>array(array('STA_ID'=>array('IN', array_keys($states_that_have_an_attendee)))),
267 267
 			'Attendee'=>array(),
268 268
 		);
269 269
 
270 270
 
271 271
 
272
-		$model_data = $this->_get_export_data_for_models( $models_to_export );
273
-		$filename = $this->generate_filename ( 'all-attendees' );
272
+		$model_data = $this->_get_export_data_for_models($models_to_export);
273
+		$filename = $this->generate_filename('all-attendees');
274 274
 
275
-		if ( ! $this->EE_CSV->export_multiple_model_data_to_csv( $filename, $model_data )) {
276
-			EE_Error::add_error(__('An error occurred and the Attendee data could not be exported from the database.','event_espresso'), __FILE__, __FUNCTION__, __LINE__ );
275
+		if ( ! $this->EE_CSV->export_multiple_model_data_to_csv($filename, $model_data)) {
276
+			EE_Error::add_error(__('An error occurred and the Attendee data could not be exported from the database.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
277 277
 		}
278 278
 	}
279 279
 
@@ -285,19 +285,19 @@  discard block
 block discarded – undo
285 285
 	 * @param boolean|string $pretty_schema true to display pretty, a string to use a specific "Schema", or false to NOT display pretty
286 286
 	 * @return string
287 287
 	 */
288
-	protected function _prepare_value_from_db_for_display( $model, $field_name,  $raw_db_value, $pretty_schema = true ) {
289
-		$field_obj = $model->field_settings_for( $field_name );
290
-		$value_on_model_obj = $field_obj->prepare_for_set_from_db( $raw_db_value );
291
-		if( $field_obj instanceof EE_Datetime_Field ) {
292
-			$field_obj->set_date_format( EE_CSV::instance()->get_date_format_for_csv( $field_obj->get_date_format( $pretty_schema ) ), $pretty_schema );
293
-			$field_obj->set_time_format( EE_CSV::instance()->get_time_format_for_csv( $field_obj->get_time_format( $pretty_schema ) ), $pretty_schema );
288
+	protected function _prepare_value_from_db_for_display($model, $field_name, $raw_db_value, $pretty_schema = true) {
289
+		$field_obj = $model->field_settings_for($field_name);
290
+		$value_on_model_obj = $field_obj->prepare_for_set_from_db($raw_db_value);
291
+		if ($field_obj instanceof EE_Datetime_Field) {
292
+			$field_obj->set_date_format(EE_CSV::instance()->get_date_format_for_csv($field_obj->get_date_format($pretty_schema)), $pretty_schema);
293
+			$field_obj->set_time_format(EE_CSV::instance()->get_time_format_for_csv($field_obj->get_time_format($pretty_schema)), $pretty_schema);
294 294
 		}
295
-		if( $pretty_schema === true){
296
-			return $field_obj->prepare_for_pretty_echoing( $value_on_model_obj );
297
-		}elseif( is_string( $pretty_schema ) ) {
298
-			return $field_obj->prepare_for_pretty_echoing($value_on_model_obj, $pretty_schema );
299
-		}else{
300
-			return $field_obj->prepare_for_get( $value_on_model_obj );
295
+		if ($pretty_schema === true) {
296
+			return $field_obj->prepare_for_pretty_echoing($value_on_model_obj);
297
+		}elseif (is_string($pretty_schema)) {
298
+			return $field_obj->prepare_for_pretty_echoing($value_on_model_obj, $pretty_schema);
299
+		} else {
300
+			return $field_obj->prepare_for_get($value_on_model_obj);
301 301
 		}
302 302
 	}
303 303
 
@@ -306,7 +306,7 @@  discard block
 block discarded – undo
306 306
 	 * and the questions associated with the registrations
307 307
 	 * @param int $event_id
308 308
 	 */
309
-	function report_registrations_for_event( $event_id = NULL ){
309
+	function report_registrations_for_event($event_id = NULL) {
310 310
 		$reg_fields_to_include = array(
311 311
 				'TXN_ID',
312 312
 				'ATT_ID',
@@ -338,126 +338,126 @@  discard block
 block discarded – undo
338 338
 				array(
339 339
 					'OR' => array(
340 340
 						//don't include registrations from failed or abandoned transactions...
341
-						'Transaction.STS_ID' => array( 'NOT IN', array( EEM_Transaction::failed_status_code, EEM_Transaction::abandoned_status_code ) ),
341
+						'Transaction.STS_ID' => array('NOT IN', array(EEM_Transaction::failed_status_code, EEM_Transaction::abandoned_status_code)),
342 342
 						//unless the registration is approved, in which case include it regardless of transaction status
343 343
 						'STS_ID' => EEM_Registration::status_id_approved
344 344
 						),
345
-					'Ticket.TKT_deleted' => array( 'IN', array( true, false ) )
345
+					'Ticket.TKT_deleted' => array('IN', array(true, false))
346 346
 					),
347
-				'order_by' => array('Transaction.TXN_ID'=>'asc','REG_count'=>'asc'),
348
-				'force_join' => array( 'Transaction', 'Ticket', 'Attendee' ),
347
+				'order_by' => array('Transaction.TXN_ID'=>'asc', 'REG_count'=>'asc'),
348
+				'force_join' => array('Transaction', 'Ticket', 'Attendee'),
349 349
 				'caps' => EEM_Base::caps_read_admin
350 350
 			),
351 351
 			$event_id
352 352
 		);
353
-		if( $event_id ){
354
-			$query_params[0]['EVT_ID'] =  $event_id;
355
-		}else{
356
-			$query_params[ 'force_join' ][] = 'Event';
353
+		if ($event_id) {
354
+			$query_params[0]['EVT_ID'] = $event_id;
355
+		} else {
356
+			$query_params['force_join'][] = 'Event';
357 357
 		}
358
-		$registration_rows = $reg_model->get_all_wpdb_results( $query_params );
358
+		$registration_rows = $reg_model->get_all_wpdb_results($query_params);
359 359
 		//get all questions which relate to someone in this group
360 360
 		$registration_ids = array();
361
-		foreach( $registration_rows as $reg_row ) {
362
-			$registration_ids[] = intval( $reg_row[ 'Registration.REG_ID'] );
361
+		foreach ($registration_rows as $reg_row) {
362
+			$registration_ids[] = intval($reg_row['Registration.REG_ID']);
363 363
 		}
364 364
 //		EEM_Question::instance()->show_next_x_db_queries();
365
-		$questions_for_these_regs_rows = EEM_Question::instance()->get_all_wpdb_results(array(array('Answer.REG_ID'=>array('IN',$registration_ids))));
366
-		foreach($registration_rows as $reg_row){
367
-			if ( is_array( $reg_row ) ) {
365
+		$questions_for_these_regs_rows = EEM_Question::instance()->get_all_wpdb_results(array(array('Answer.REG_ID'=>array('IN', $registration_ids))));
366
+		foreach ($registration_rows as $reg_row) {
367
+			if (is_array($reg_row)) {
368 368
 				$reg_csv_array = array();
369
-				if( ! $event_id ){
369
+				if ( ! $event_id) {
370 370
 					//get the event's name and Id
371
-					$reg_csv_array[ __( 'Event', 'event_espresso' ) ] = sprintf( __( '%1$s (%2$s)', 'event_espresso' ), $this->_prepare_value_from_db_for_display( EEM_Event::instance(), 'EVT_name', $reg_row[ 'Event_CPT.post_title'] ), $reg_row[ 'Event_CPT.ID' ] );
371
+					$reg_csv_array[__('Event', 'event_espresso')] = sprintf(__('%1$s (%2$s)', 'event_espresso'), $this->_prepare_value_from_db_for_display(EEM_Event::instance(), 'EVT_name', $reg_row['Event_CPT.post_title']), $reg_row['Event_CPT.ID']);
372 372
 				}
373
-				$is_primary_reg = $reg_row[ 'Registration.REG_count' ] == '1' ? true : false;
373
+				$is_primary_reg = $reg_row['Registration.REG_count'] == '1' ? true : false;
374 374
 				/*@var $reg_row EE_Registration */
375
-				foreach($reg_fields_to_include as $field_name){
375
+				foreach ($reg_fields_to_include as $field_name) {
376 376
 					$field = $reg_model->field_settings_for($field_name);
377
-					if($field_name == 'REG_final_price'){
378
-						$value = $this->_prepare_value_from_db_for_display( $reg_model, $field_name, $reg_row[ 'Registration.REG_final_price'], 'localized_float' );
379
-					}elseif( $field_name == 'REG_count' ){
380
-						$value = sprintf( __( '%s of %s', 'event_espresso' ), $this->_prepare_value_from_db_for_display( $reg_model, 'REG_count', $reg_row['Registration.REG_count'] ), $this->_prepare_value_from_db_for_display( $reg_model, 'REG_group_size', $reg_row['Registration.REG_group_size' ] ) );
381
-					}elseif( $field_name == 'REG_date' ) {
382
-						$value = $this->_prepare_value_from_db_for_display( $reg_model, $field_name, $reg_row[ 'Registration.REG_date'], 'no_html' );
383
-					}else{
384
-						$value = $this->_prepare_value_from_db_for_display( $reg_model, $field_name, $reg_row[ $field->get_qualified_column() ] );
377
+					if ($field_name == 'REG_final_price') {
378
+						$value = $this->_prepare_value_from_db_for_display($reg_model, $field_name, $reg_row['Registration.REG_final_price'], 'localized_float');
379
+					}elseif ($field_name == 'REG_count') {
380
+						$value = sprintf(__('%s of %s', 'event_espresso'), $this->_prepare_value_from_db_for_display($reg_model, 'REG_count', $reg_row['Registration.REG_count']), $this->_prepare_value_from_db_for_display($reg_model, 'REG_group_size', $reg_row['Registration.REG_group_size']));
381
+					}elseif ($field_name == 'REG_date') {
382
+						$value = $this->_prepare_value_from_db_for_display($reg_model, $field_name, $reg_row['Registration.REG_date'], 'no_html');
383
+					} else {
384
+						$value = $this->_prepare_value_from_db_for_display($reg_model, $field_name, $reg_row[$field->get_qualified_column()]);
385 385
 					}
386 386
 					$reg_csv_array[$this->_get_column_name_for_field($field)] = $value;
387
-					if($field_name == 'REG_final_price'){
387
+					if ($field_name == 'REG_final_price') {
388 388
 						//add a column named Currency after the final price
389 389
 						$reg_csv_array[__("Currency", "event_espresso")] = EE_Config::instance()->currency->code;
390 390
 					}
391 391
 				}
392 392
 				//get pretty status
393
-				$stati = EEM_Status::instance()->localized_status( array(
394
-					$reg_row[ 'Registration.STS_ID' ] => __( 'unknown', 'event_espresso' ),
395
-					$reg_row[ 'TransactionTable.STS_ID' ] => __( 'unknown', 'event_espresso' ) ),
393
+				$stati = EEM_Status::instance()->localized_status(array(
394
+					$reg_row['Registration.STS_ID'] => __('unknown', 'event_espresso'),
395
+					$reg_row['TransactionTable.STS_ID'] => __('unknown', 'event_espresso') ),
396 396
 						FALSE,
397
-						'sentence' );
398
-				$reg_csv_array[__("Registration Status", 'event_espresso')] = $stati[ $reg_row[ 'Registration.STS_ID' ] ];
397
+						'sentence');
398
+				$reg_csv_array[__("Registration Status", 'event_espresso')] = $stati[$reg_row['Registration.STS_ID']];
399 399
 				//get pretty trnasaction status
400
-				$reg_csv_array[__("Transaction Status", 'event_espresso')] = $stati[ $reg_row[ 'TransactionTable.STS_ID' ] ];
401
-				$reg_csv_array[ __( 'Transaction Amount Due', 'event_espresso' ) ] = $is_primary_reg ? $this->_prepare_value_from_db_for_display( EEM_Transaction::instance(), 'TXN_total', $reg_row[ 'TransactionTable.TXN_total' ], 'localized_float' ) : '0.00';
402
-				$reg_csv_array[ __( 'Amount Paid', 'event_espresso' )] = $is_primary_reg ? $this->_prepare_value_from_db_for_display( EEM_Transaction::instance(), 'TXN_paid', $reg_row[ 'TransactionTable.TXN_paid' ], 'localized_float' ) : '0.00';
400
+				$reg_csv_array[__("Transaction Status", 'event_espresso')] = $stati[$reg_row['TransactionTable.STS_ID']];
401
+				$reg_csv_array[__('Transaction Amount Due', 'event_espresso')] = $is_primary_reg ? $this->_prepare_value_from_db_for_display(EEM_Transaction::instance(), 'TXN_total', $reg_row['TransactionTable.TXN_total'], 'localized_float') : '0.00';
402
+				$reg_csv_array[__('Amount Paid', 'event_espresso')] = $is_primary_reg ? $this->_prepare_value_from_db_for_display(EEM_Transaction::instance(), 'TXN_paid', $reg_row['TransactionTable.TXN_paid'], 'localized_float') : '0.00';
403 403
 				$payment_methods = array();
404 404
 				$gateway_txn_ids_etc = array();
405 405
 				$payment_times = array();
406
-				if( $is_primary_reg && $reg_row[ 'TransactionTable.TXN_ID' ] ){
406
+				if ($is_primary_reg && $reg_row['TransactionTable.TXN_ID']) {
407 407
 					$payments_info = EEM_Payment::instance()->get_all_wpdb_results(
408 408
 							array(
409 409
 								array(
410
-									'TXN_ID' => $reg_row[ 'TransactionTable.TXN_ID' ],
410
+									'TXN_ID' => $reg_row['TransactionTable.TXN_ID'],
411 411
 									'STS_ID' => EEM_Payment::status_id_approved
412 412
 								),
413
-								'force_join' => array( 'Payment_Method' ),
413
+								'force_join' => array('Payment_Method'),
414 414
 
415 415
 							),
416 416
 							ARRAY_A,
417 417
 							'Payment_Method.PMD_admin_name as name, Payment.PAY_txn_id_chq_nmbr as gateway_txn_id, Payment.PAY_timestamp as payment_time' );
418 418
 
419
-					foreach( $payments_info as $payment_method_and_gateway_txn_id ){
420
-						$payment_methods[] = isset( $payment_method_and_gateway_txn_id[ 'name' ] ) ? $payment_method_and_gateway_txn_id[ 'name' ] : __( 'Unknown', 'event_espresso' );
421
-						$gateway_txn_ids_etc[] = isset( $payment_method_and_gateway_txn_id[ 'gateway_txn_id' ] ) ? $payment_method_and_gateway_txn_id[ 'gateway_txn_id' ] : '';
422
-						$payment_times[] = isset( $payment_method_and_gateway_txn_id[ 'payment_time' ] ) ? $payment_method_and_gateway_txn_id[ 'payment_time' ] : '';
419
+					foreach ($payments_info as $payment_method_and_gateway_txn_id) {
420
+						$payment_methods[] = isset($payment_method_and_gateway_txn_id['name']) ? $payment_method_and_gateway_txn_id['name'] : __('Unknown', 'event_espresso');
421
+						$gateway_txn_ids_etc[] = isset($payment_method_and_gateway_txn_id['gateway_txn_id']) ? $payment_method_and_gateway_txn_id['gateway_txn_id'] : '';
422
+						$payment_times[] = isset($payment_method_and_gateway_txn_id['payment_time']) ? $payment_method_and_gateway_txn_id['payment_time'] : '';
423 423
 					}
424 424
 
425 425
 				}
426
-				$reg_csv_array[ __( 'Payment Date(s)', 'event_espresso' ) ] = implode( ',', $payment_times );
427
-				$reg_csv_array[ __( 'Payment Method(s)', 'event_espresso' ) ] = implode( ",", $payment_methods );
428
-				$reg_csv_array[ __( 'Gateway Transaction ID(s)', 'event_espresso' )] = implode( ',', $gateway_txn_ids_etc );
426
+				$reg_csv_array[__('Payment Date(s)', 'event_espresso')] = implode(',', $payment_times);
427
+				$reg_csv_array[__('Payment Method(s)', 'event_espresso')] = implode(",", $payment_methods);
428
+				$reg_csv_array[__('Gateway Transaction ID(s)', 'event_espresso')] = implode(',', $gateway_txn_ids_etc);
429 429
 
430 430
 				//get whether or not the user has checked in
431
-				$reg_csv_array[__("Check-Ins", "event_espresso")] = $reg_model->count_related( $reg_row[ 'Registration.REG_ID'] , 'Checkin' );
431
+				$reg_csv_array[__("Check-Ins", "event_espresso")] = $reg_model->count_related($reg_row['Registration.REG_ID'], 'Checkin');
432 432
 				//get ticket of registration and its price
433 433
 				$ticket_model = EE_Registry::instance()->load_model('Ticket');
434
-				if( $reg_row[ 'Ticket.TKT_ID'] ) {
435
-					$ticket_name = $this->_prepare_value_from_db_for_display( $ticket_model, 'TKT_name', $reg_row[ 'Ticket.TKT_name' ] );
434
+				if ($reg_row['Ticket.TKT_ID']) {
435
+					$ticket_name = $this->_prepare_value_from_db_for_display($ticket_model, 'TKT_name', $reg_row['Ticket.TKT_name']);
436 436
 					$datetimes_strings = array();
437
-					foreach( EEM_Datetime::instance()->get_all_wpdb_results( array( array( 'Ticket.TKT_ID' => $reg_row[ 'Ticket.TKT_ID' ] ), 'order_by' => array( 'DTT_EVT_start' => 'ASC' ), 'default_where_conditions' => 'none' ) ) as $datetime){
438
-						$datetimes_strings[] = $this->_prepare_value_from_db_for_display( EEM_Datetime::instance(), 'DTT_EVT_start', $datetime[ 'Datetime.DTT_EVT_start'] );
437
+					foreach (EEM_Datetime::instance()->get_all_wpdb_results(array(array('Ticket.TKT_ID' => $reg_row['Ticket.TKT_ID']), 'order_by' => array('DTT_EVT_start' => 'ASC'), 'default_where_conditions' => 'none')) as $datetime) {
438
+						$datetimes_strings[] = $this->_prepare_value_from_db_for_display(EEM_Datetime::instance(), 'DTT_EVT_start', $datetime['Datetime.DTT_EVT_start']);
439 439
 					}
440 440
 
441 441
 				} else {
442
-					$ticket_name = __( 'Unknown', 'event_espresso' );
443
-					$datetimes_strings = array( __( 'Unknown', 'event_espresso' ) );
442
+					$ticket_name = __('Unknown', 'event_espresso');
443
+					$datetimes_strings = array(__('Unknown', 'event_espresso'));
444 444
 				}
445 445
 				$reg_csv_array[$ticket_model->field_settings_for('TKT_name')->get_nicename()] = $ticket_name;
446 446
 				$reg_csv_array[__("Datetimes of Ticket", "event_espresso")] = implode(", ", $datetimes_strings);
447 447
 				//get datetime(s) of registration
448 448
 
449 449
 				//add attendee columns
450
-				foreach($att_fields_to_include as $att_field_name){
450
+				foreach ($att_fields_to_include as $att_field_name) {
451 451
 					$field_obj = EEM_Attendee::instance()->field_settings_for($att_field_name);
452
-					if( $reg_row[ 'Attendee_CPT.ID' ]){
453
-						if($att_field_name == 'STA_ID'){
454
-							$value = EEM_State::instance()->get_var( array( array( 'STA_ID' => $reg_row[ 'Attendee_Meta.STA_ID' ] ) ), 'STA_name' );
455
-						}elseif($att_field_name == 'CNT_ISO'){
456
-							$value = EEM_Country::instance()->get_var( array( array( 'CNT_ISO' => $reg_row[ 'Attendee_Meta.CNT_ISO' ] ) ), 'CNT_name' );
457
-						}else{
458
-							$value = $this->_prepare_value_from_db_for_display( EEM_Attendee::instance(), $att_field_name, $reg_row[ $field_obj->get_qualified_column() ] );
452
+					if ($reg_row['Attendee_CPT.ID']) {
453
+						if ($att_field_name == 'STA_ID') {
454
+							$value = EEM_State::instance()->get_var(array(array('STA_ID' => $reg_row['Attendee_Meta.STA_ID'])), 'STA_name');
455
+						}elseif ($att_field_name == 'CNT_ISO') {
456
+							$value = EEM_Country::instance()->get_var(array(array('CNT_ISO' => $reg_row['Attendee_Meta.CNT_ISO'])), 'CNT_name');
457
+						} else {
458
+							$value = $this->_prepare_value_from_db_for_display(EEM_Attendee::instance(), $att_field_name, $reg_row[$field_obj->get_qualified_column()]);
459 459
 						}
460
-					}else{
460
+					} else {
461 461
 						$value = '';
462 462
 					}
463 463
 
@@ -465,56 +465,56 @@  discard block
 block discarded – undo
465 465
 				}
466 466
 
467 467
 				//make sure each registration has the same questions in the same order
468
-				foreach($questions_for_these_regs_rows as $question_row){
469
-					if( ! isset($reg_csv_array[$question_row[ 'Question.QST_admin_label']])){
470
-						$reg_csv_array[$question_row[ 'Question.QST_admin_label' ] ] = null;
468
+				foreach ($questions_for_these_regs_rows as $question_row) {
469
+					if ( ! isset($reg_csv_array[$question_row['Question.QST_admin_label']])) {
470
+						$reg_csv_array[$question_row['Question.QST_admin_label']] = null;
471 471
 					}
472 472
 				}
473 473
 				//now fill out the questions THEY answered
474
-				foreach( EEM_Answer::instance()->get_all_wpdb_results( array( array( 'REG_ID' => $reg_row[ 'Registration.REG_ID' ] ), 'force_join' => array( 'Question' ) ) ) as $answer_row){
474
+				foreach (EEM_Answer::instance()->get_all_wpdb_results(array(array('REG_ID' => $reg_row['Registration.REG_ID']), 'force_join' => array('Question'))) as $answer_row) {
475 475
 					/* @var $answer EE_Answer */
476
-					if( $answer_row[ 'Question.QST_ID' ] ){
477
-						$question_label = $this->_prepare_value_from_db_for_display( EEM_Question::instance(), 'QST_admin_label', $answer_row[ 'Question.QST_admin_label' ] );
478
-					}else{
479
-						$question_label = sprintf( __( 'Question $s', 'event_espresso' ), $answer_row[ 'Answer.QST_ID' ] );
476
+					if ($answer_row['Question.QST_ID']) {
477
+						$question_label = $this->_prepare_value_from_db_for_display(EEM_Question::instance(), 'QST_admin_label', $answer_row['Question.QST_admin_label']);
478
+					} else {
479
+						$question_label = sprintf(__('Question $s', 'event_espresso'), $answer_row['Answer.QST_ID']);
480 480
 					}
481
-                                        if( isset( $answer_row[ 'Question.QST_type'] ) && $answer_row[ 'Question.QST_type' ] == EEM_Question::QST_type_state ) {
482
-                                            $reg_csv_array[ $question_label ] = EEM_State::instance()->get_state_name_by_ID( $answer_row[ 'Answer.ANS_value' ] );
481
+                                        if (isset($answer_row['Question.QST_type']) && $answer_row['Question.QST_type'] == EEM_Question::QST_type_state) {
482
+                                            $reg_csv_array[$question_label] = EEM_State::instance()->get_state_name_by_ID($answer_row['Answer.ANS_value']);
483 483
                                         } else {
484
-                                            $reg_csv_array[ $question_label ] = $this->_prepare_value_from_db_for_display( EEM_Answer::instance(), 'ANS_value', $answer_row[ 'Answer.ANS_value' ] );
484
+                                            $reg_csv_array[$question_label] = $this->_prepare_value_from_db_for_display(EEM_Answer::instance(), 'ANS_value', $answer_row['Answer.ANS_value']);
485 485
                                         }
486 486
 				}
487
-				$registrations_csv_ready_array[] = apply_filters( 'FHEE__EE_Export__report_registrations__reg_csv_array', $reg_csv_array, $reg_row );
487
+				$registrations_csv_ready_array[] = apply_filters('FHEE__EE_Export__report_registrations__reg_csv_array', $reg_csv_array, $reg_row);
488 488
 			}
489 489
 		}
490 490
 
491 491
 		//if we couldn't export anything, we want to at least show the column headers
492
-		if(empty($registrations_csv_ready_array)){
492
+		if (empty($registrations_csv_ready_array)) {
493 493
 			$reg_csv_array = array();
494 494
 			$model_and_fields_to_include = array(
495 495
 				'Registration' => $reg_fields_to_include,
496 496
 				'Attendee' => $att_fields_to_include
497 497
 			);
498
-			foreach($model_and_fields_to_include as $model_name => $field_list){
498
+			foreach ($model_and_fields_to_include as $model_name => $field_list) {
499 499
 				$model = EE_Registry::instance()->load_model($model_name);
500
-				foreach($field_list as $field_name){
500
+				foreach ($field_list as $field_name) {
501 501
 					$field = $model->field_settings_for($field_name);
502
-					$reg_csv_array[$this->_get_column_name_for_field($field)] = null;//$registration->get($field->get_name());
502
+					$reg_csv_array[$this->_get_column_name_for_field($field)] = null; //$registration->get($field->get_name());
503 503
 				}
504 504
 			}
505 505
 			$registrations_csv_ready_array [] = $reg_csv_array;
506 506
 		}
507
-		if( $event_id ){
508
-			$event_slug =  EEM_Event::instance()->get_var( array( array( 'EVT_ID' => $event_id ) ), 'EVT_slug' );
509
-			if( ! $event_slug ) {
510
-				$event_slug = __( 'unknown', 'event_espresso' );
507
+		if ($event_id) {
508
+			$event_slug = EEM_Event::instance()->get_var(array(array('EVT_ID' => $event_id)), 'EVT_slug');
509
+			if ( ! $event_slug) {
510
+				$event_slug = __('unknown', 'event_espresso');
511 511
 			}
512
-		}else{
513
-			$event_slug = __( 'all', 'event_espresso' );
512
+		} else {
513
+			$event_slug = __('all', 'event_espresso');
514 514
 		}
515
-		$filename = sprintf( "registrations-for-%s", $event_slug );
515
+		$filename = sprintf("registrations-for-%s", $event_slug);
516 516
 
517
-		$handle = $this->EE_CSV->begin_sending_csv( $filename);
517
+		$handle = $this->EE_CSV->begin_sending_csv($filename);
518 518
 		$this->EE_CSV->write_data_array_to_csv($handle, $registrations_csv_ready_array);
519 519
 		$this->EE_CSV->end_sending_csv($handle);
520 520
 	}
@@ -524,7 +524,7 @@  discard block
 block discarded – undo
524 524
 	 * @param EE_Model_Field_Base $field
525 525
 	 * @return string
526 526
 	 */
527
-	protected function _get_column_name_for_field(EE_Model_Field_Base $field){
527
+	protected function _get_column_name_for_field(EE_Model_Field_Base $field) {
528 528
 		return $field->get_nicename()."[".$field->get_name()."]";
529 529
 	}
530 530
 
@@ -537,17 +537,17 @@  discard block
 block discarded – undo
537 537
 	function export_categories() {
538 538
 		// are any Event IDs set?
539 539
 		$query_params = array();
540
-		if ( isset( $this->_req_data['EVT_CAT_ID'] )) {
540
+		if (isset($this->_req_data['EVT_CAT_ID'])) {
541 541
 			// do we have an array of IDs ?
542
-			if ( is_array( $this->_req_data['EVT_CAT_ID'] )) {
542
+			if (is_array($this->_req_data['EVT_CAT_ID'])) {
543 543
 				// generate an "IN (CSV)" where clause
544
-				$EVT_CAT_IDs = array_map( 'sanitize_text_field', $this->_req_data['EVT_CAT_ID'] );
544
+				$EVT_CAT_IDs = array_map('sanitize_text_field', $this->_req_data['EVT_CAT_ID']);
545 545
 				$filename = 'event-categories';
546
-				$query_params[0]['term_taxonomy_id'] = array('IN',$EVT_CAT_IDs);
546
+				$query_params[0]['term_taxonomy_id'] = array('IN', $EVT_CAT_IDs);
547 547
 			} else {
548 548
 				// generate regular where = clause
549
-				$EVT_CAT_ID = absint( $this->_req_data['EVT_CAT_ID'] );
550
-				$filename = 'event-category#' . $EVT_CAT_ID;
549
+				$EVT_CAT_ID = absint($this->_req_data['EVT_CAT_ID']);
550
+				$filename = 'event-category#'.$EVT_CAT_ID;
551 551
 				$query_params[0]['term_taxonomy_id'] = $EVT_CAT_ID;
552 552
 			}
553 553
 		} else {
@@ -559,11 +559,11 @@  discard block
 block discarded – undo
559 559
 				'Term_Taxonomy' => $query_params
560 560
 			);
561 561
 
562
-		$table_data = $this->_get_export_data_for_models( $tables_to_export );
563
-		$filename = $this->generate_filename ( $filename );
562
+		$table_data = $this->_get_export_data_for_models($tables_to_export);
563
+		$filename = $this->generate_filename($filename);
564 564
 
565
-		if ( ! $this->EE_CSV->export_multiple_model_data_to_csv( $filename, $table_data )) {
566
-			EE_Error::add_error(__('An error occurred and the Category details could not be exported from the database.','event_espresso'), __FILE__, __FUNCTION__, __LINE__ );
565
+		if ( ! $this->EE_CSV->export_multiple_model_data_to_csv($filename, $table_data)) {
566
+			EE_Error::add_error(__('An error occurred and the Category details could not be exported from the database.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
567 567
 		}
568 568
 	}
569 569
 
@@ -574,13 +574,13 @@  discard block
 block discarded – undo
574 574
 	 *		  @param string - export_name
575 575
 	 *			@return string on success, FALSE on fail
576 576
 	 */
577
-	private function generate_filename ( $export_name = '' ) {
578
-		if ( $export_name != '' ) {
579
-			$filename = get_bloginfo('name') . '-' . $export_name;
580
-			$filename = sanitize_key( $filename ) . '-' . $this->today;
577
+	private function generate_filename($export_name = '') {
578
+		if ($export_name != '') {
579
+			$filename = get_bloginfo('name').'-'.$export_name;
580
+			$filename = sanitize_key($filename).'-'.$this->today;
581 581
 			return $filename;
582
-		}	 else {
583
-			EE_Error::add_error(__("No filename was provided", "event_espresso"), __FILE__, __FUNCTION__, __LINE__ );
582
+		} else {
583
+			EE_Error::add_error(__("No filename was provided", "event_espresso"), __FILE__, __FUNCTION__, __LINE__);
584 584
 		}
585 585
 		return false;
586 586
 	}
@@ -593,12 +593,12 @@  discard block
 block discarded – undo
593 593
 	 *	@param array $models_to_export keys are model names (eg 'Event', 'Attendee', etc.) and values are arrays of query params like on EEM_Base::get_all
594 594
 	 *	@return array on success, FALSE on fail
595 595
 	 */
596
-	private function _get_export_data_for_models( $models_to_export = array() ) {
596
+	private function _get_export_data_for_models($models_to_export = array()) {
597 597
 		$table_data = FALSE;
598
-		if ( is_array( $models_to_export ) ) {
599
-			foreach ( $models_to_export as $model_name => $query_params ) {
598
+		if (is_array($models_to_export)) {
599
+			foreach ($models_to_export as $model_name => $query_params) {
600 600
 				//check for a numerically-indexed array. in that case, $model_name is the value!!
601
-				if(is_int($model_name)){
601
+				if (is_int($model_name)) {
602 602
 					$model_name = $query_params;
603 603
 					$query_params = array();
604 604
 				}
@@ -606,17 +606,17 @@  discard block
 block discarded – undo
606 606
 				$model_objects = $model->get_all($query_params);
607 607
 
608 608
 				$table_data[$model_name] = array();
609
-				foreach($model_objects as $model_object){
609
+				foreach ($model_objects as $model_object) {
610 610
 					$model_data_array = array();
611 611
 					$fields = $model->field_settings();
612
-					foreach($fields as $field){
612
+					foreach ($fields as $field) {
613 613
 						$column_name = $field->get_nicename()."[".$field->get_name()."]";
614
-						if($field instanceof EE_Datetime_Field){
614
+						if ($field instanceof EE_Datetime_Field) {
615 615
 //							$field->set_date_format('Y-m-d');
616 616
 //							$field->set_time_format('H:i:s');
617
-							$model_data_array[$column_name] = $model_object->get_datetime($field->get_name(),'Y-m-d','H:i:s');
617
+							$model_data_array[$column_name] = $model_object->get_datetime($field->get_name(), 'Y-m-d', 'H:i:s');
618 618
 						}
619
-						else{
619
+						else {
620 620
 							$model_data_array[$column_name] = $model_object->get($field->get_name());
621 621
 						}
622 622
 					}
Please login to merge, or discard this patch.