Completed
Branch BUG-9871-email-validation (715abb)
by
unknown
241:08 queued 227:15
created
widgets/upcoming_events/EEW_Upcoming_Events.widget.php 3 patches
Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -192,14 +192,14 @@  discard block
 block discarded – undo
192 192
 		        <?php _e('Show on all Pages:', 'event_espresso'); ?>
193 193
 			</label>
194 194
 	 	    <?php
195
-	 	    echo EEH_Form_Fields::select(
196
-	 	        __('Show on all Pages:', 'event_espresso'),
197
-	 	        $instance['show_everywhere'],
198
-	 	        $yes_no_values,
199
-	 	        $this->get_field_name('show_everywhere'),
200
-	 	        $this->get_field_id('show_everywhere')
201
-	 	    );
202
-	 	    ?>
195
+	 		echo EEH_Form_Fields::select(
196
+	 			__('Show on all Pages:', 'event_espresso'),
197
+	 			$instance['show_everywhere'],
198
+	 			$yes_no_values,
199
+	 			$this->get_field_name('show_everywhere'),
200
+	 			$this->get_field_id('show_everywhere')
201
+	 		);
202
+	 		?>
203 203
 	 	</p>
204 204
 		<p>
205 205
 			<label for="<?php echo $this->get_field_id('date_limit'); ?>">
@@ -282,13 +282,13 @@  discard block
 block discarded – undo
282 282
 				extract($args);
283 283
 
284 284
 				// add function to make the title a link
285
-	            add_filter('widget_title', array($this, 'make_the_title_a_link'), 15);
285
+				add_filter('widget_title', array($this, 'make_the_title_a_link'), 15);
286 286
 
287 287
 				// filter the title
288 288
 				$title = apply_filters('widget_title', $instance['title']);
289 289
 
290 290
 				// remove the function from the filter, so it does not affect other widgets
291
-	            remove_filter('widget_title', array($this, 'make_the_title_a_link'), 15);
291
+				remove_filter('widget_title', array($this, 'make_the_title_a_link'), 15);
292 292
 
293 293
 				// Before widget (defined by themes).
294 294
 				echo $before_widget;
@@ -385,7 +385,7 @@  discard block
 block discarded – undo
385 385
 	 * @return string
386 386
 	 */
387 387
 	public function make_the_title_a_link($title) {
388
-	    return '<a href="' . EEH_Event_View::event_archive_url() . '">' . $title . '</a>';
388
+		return '<a href="' . EEH_Event_View::event_archive_url() . '">' . $title . '</a>';
389 389
 	}
390 390
 
391 391
 }
Please login to merge, or discard this patch.
Spacing   +71 added lines, -71 removed lines patch added patch discarded remove patch
@@ -30,8 +30,8 @@  discard block
 block discarded – undo
30 30
 	function __construct() {
31 31
 		parent::__construct(
32 32
 			'ee-upcoming-events-widget',
33
-			__( 'Event Espresso Upcoming Events', 'event_espresso' ),
34
-			 array( 'description' => __( 'A widget to display your upcoming events.', 'event_espresso' )),
33
+			__('Event Espresso Upcoming Events', 'event_espresso'),
34
+			 array('description' => __('A widget to display your upcoming events.', 'event_espresso')),
35 35
 			array(
36 36
 				'width' => 300,
37 37
 				'height' => 350,
@@ -49,9 +49,9 @@  discard block
 block discarded – undo
49 49
 	 * @param array $instance Previously saved values from database.
50 50
 	 * @return string|void
51 51
 	 */
52
-	public function form( $instance ) {
52
+	public function form($instance) {
53 53
 
54
-		EE_Registry::instance()->load_class( 'Question_Option', array(), FALSE, FALSE, TRUE );
54
+		EE_Registry::instance()->load_class('Question_Option', array(), FALSE, FALSE, TRUE);
55 55
 		// Set up some default widget settings.
56 56
 		$defaults = array(
57 57
 			'title' => __('Upcoming Events', 'event_espresso'),
@@ -66,12 +66,12 @@  discard block
 block discarded – undo
66 66
 			'image_size' => 'medium'
67 67
 		);
68 68
 
69
-		$instance = wp_parse_args( (array) $instance, $defaults );
69
+		$instance = wp_parse_args((array) $instance, $defaults);
70 70
 		// don't add HTML labels for EE_Form_Fields generated inputs
71
-		add_filter( 'FHEE__EEH_Form_Fields__label_html', '__return_empty_string' );
71
+		add_filter('FHEE__EEH_Form_Fields__label_html', '__return_empty_string');
72 72
 		$yes_no_values = array(
73
-			EE_Question_Option::new_instance( array( 'QSO_value' => FALSE, 'QSO_desc' => __('No', 'event_espresso'))),
74
-			EE_Question_Option::new_instance( array( 'QSO_value' => TRUE, 'QSO_desc' => __('Yes', 'event_espresso')))
73
+			EE_Question_Option::new_instance(array('QSO_value' => FALSE, 'QSO_desc' => __('No', 'event_espresso'))),
74
+			EE_Question_Option::new_instance(array('QSO_value' => TRUE, 'QSO_desc' => __('Yes', 'event_espresso')))
75 75
 		);
76 76
 
77 77
 	?>
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
 			<label for="<?php echo $this->get_field_id('title'); ?>">
83 83
 				<?php _e('Title:', 'event_espresso'); ?>
84 84
 			</label>
85
-			<input id="<?php echo $this->get_field_id('title'); ?>" class="widefat" name="<?php echo $this->get_field_name('title'); ?>" value="<?php echo esc_attr( $instance['title'] ); ?>" type="text" />
85
+			<input id="<?php echo $this->get_field_id('title'); ?>" class="widefat" name="<?php echo $this->get_field_name('title'); ?>" value="<?php echo esc_attr($instance['title']); ?>" type="text" />
86 86
 		</p>
87 87
 		<p>
88 88
 			<label for="<?php echo $this->get_field_id('category_name'); ?>">
@@ -91,16 +91,16 @@  discard block
 block discarded – undo
91 91
 			<?php
92 92
 			$event_categories = array();
93 93
 			/** @type EEM_Term $EEM_Term */
94
-			$EEM_Term = EE_Registry::instance()->load_model( 'Term' );
95
-			$categories = $EEM_Term->get_all_ee_categories( TRUE );
96
-			if ( $categories ) {
97
-				foreach ( $categories as $category ) {
98
-					if ( $category instanceof EE_Term ) {
99
-						$event_categories[] = EE_Question_Option::new_instance( array( 'QSO_value' => $category->get( 'slug' ), 'QSO_desc' => $category->get( 'name' )));
94
+			$EEM_Term = EE_Registry::instance()->load_model('Term');
95
+			$categories = $EEM_Term->get_all_ee_categories(TRUE);
96
+			if ($categories) {
97
+				foreach ($categories as $category) {
98
+					if ($category instanceof EE_Term) {
99
+						$event_categories[] = EE_Question_Option::new_instance(array('QSO_value' => $category->get('slug'), 'QSO_desc' => $category->get('name')));
100 100
 					}
101 101
 				}
102 102
 			}
103
-			array_unshift( $event_categories, EE_Question_Option::new_instance( array( 'QSO_value' => '', 'QSO_desc' => __(' - display all - ', 'event_espresso'))));
103
+			array_unshift($event_categories, EE_Question_Option::new_instance(array('QSO_value' => '', 'QSO_desc' => __(' - display all - ', 'event_espresso'))));
104 104
 			echo EEH_Form_Fields::select(
105 105
 				 __('Event Category:', 'event_espresso'),
106 106
 				$instance['category_name'],
@@ -137,16 +137,16 @@  discard block
 block discarded – undo
137 137
 			<?php
138 138
 			$image_sizes = array();
139 139
 			$sizes = get_intermediate_image_sizes();
140
-			if ( $sizes ) {
140
+			if ($sizes) {
141 141
 				// loop thru images and create option objects out of them
142
-				foreach ( $sizes as $image_size ) {
143
-					$image_size = trim( $image_size );
142
+				foreach ($sizes as $image_size) {
143
+					$image_size = trim($image_size);
144 144
 					// no big images plz
145
-					if ( ! in_array( $image_size, array( 'large', 'post-thumbnail' ))) {
146
-						$image_sizes[] = EE_Question_Option::new_instance( array( 'QSO_value' => $image_size, 'QSO_desc' => $image_size ));
145
+					if ( ! in_array($image_size, array('large', 'post-thumbnail'))) {
146
+						$image_sizes[] = EE_Question_Option::new_instance(array('QSO_value' => $image_size, 'QSO_desc' => $image_size));
147 147
 					}
148 148
 				}
149
-				$image_sizes[] = EE_Question_Option::new_instance( array( 'QSO_value' => 'none', 'QSO_desc' =>  __('don\'t show images', 'event_espresso') ));
149
+				$image_sizes[] = EE_Question_Option::new_instance(array('QSO_value' => 'none', 'QSO_desc' =>  __('don\'t show images', 'event_espresso')));
150 150
 			}
151 151
 			echo EEH_Form_Fields::select(
152 152
 				 __('Image Size:', 'event_espresso'),
@@ -204,7 +204,7 @@  discard block
 block discarded – undo
204 204
 			<label for="<?php echo $this->get_field_id('date_limit'); ?>">
205 205
 				<?php _e('Number of Dates to Display:', 'event_espresso'); ?>
206 206
 			</label>
207
-			<input id="<?php echo $this->get_field_id('date_limit'); ?>" name="<?php echo $this->get_field_name('date_limit'); ?>" value="<?php echo esc_attr( $instance['date_limit'] ); ?>" size="3" type="text" />
207
+			<input id="<?php echo $this->get_field_id('date_limit'); ?>" name="<?php echo $this->get_field_name('date_limit'); ?>" value="<?php echo esc_attr($instance['date_limit']); ?>" size="3" type="text" />
208 208
 		</p>
209 209
 		<p>
210 210
 			<label for="<?php echo $this->get_field_id('date_range'); ?>">
@@ -236,9 +236,9 @@  discard block
 block discarded – undo
236 236
 	 *
237 237
 	 * @return array Updated safe values to be saved.
238 238
 	 */
239
-	public function update( $new_instance, $old_instance ) {
239
+	public function update($new_instance, $old_instance) {
240 240
 		$instance = $old_instance;
241
-		$instance['title'] = ! empty( $new_instance['title'] ) ? strip_tags( $new_instance['title'] ) : '';
241
+		$instance['title'] = ! empty($new_instance['title']) ? strip_tags($new_instance['title']) : '';
242 242
 		$instance['category_name'] = $new_instance['category_name'];
243 243
 		$instance['show_expired'] = $new_instance['show_expired'];
244 244
 		$instance['limit'] = $new_instance['limit'];
@@ -261,18 +261,18 @@  discard block
 block discarded – undo
261 261
 	 * @param array $args     Widget arguments.
262 262
 	 * @param array $instance Saved values from database.
263 263
 	 */
264
-	public function widget( $args, $instance ) {
264
+	public function widget($args, $instance) {
265 265
 
266 266
 		global $post;
267 267
 		// make sure there is some kinda post object
268
-		if ( $post instanceof WP_Post ) {
268
+		if ($post instanceof WP_Post) {
269 269
 			$before_widget = '';
270 270
 			$before_title = '';
271 271
 			$after_title = '';
272 272
 			$after_widget = '';
273 273
 			// but NOT an events archives page, cuz that would be like two event lists on the same page
274
-			$show_everywhere = isset( $instance['show_everywhere'] ) ? (bool) absint( $instance['show_everywhere'] ) : TRUE;
275
-			if ( $show_everywhere || ! ( $post->post_type == 'espresso_events' && is_archive() )) {
274
+			$show_everywhere = isset($instance['show_everywhere']) ? (bool) absint($instance['show_everywhere']) : TRUE;
275
+			if ($show_everywhere || ! ($post->post_type == 'espresso_events' && is_archive())) {
276 276
 				// let's use some of the event helper functions'
277 277
 				// make separate vars out of attributes
278 278
 
@@ -291,81 +291,81 @@  discard block
 block discarded – undo
291 291
 				// Before widget (defined by themes).
292 292
 				echo $before_widget;
293 293
 				// Display the widget title if one was input (before and after defined by themes).
294
-				if ( ! empty( $title )) {
295
-					echo $before_title . $title . $after_title;
294
+				if ( ! empty($title)) {
295
+					echo $before_title.$title.$after_title;
296 296
 				}
297 297
 				// grab widget settings
298
-				$category = isset( $instance['category_name'] ) && ! empty( $instance['category_name'] ) ? $instance['category_name'] : FALSE;
299
-				$show_expired = isset( $instance['show_expired'] ) ? (bool) absint( $instance['show_expired'] ) : FALSE;
300
-				$image_size = isset( $instance['image_size'] ) && ! empty( $instance['image_size'] ) ? $instance['image_size'] : 'medium';
301
-				$show_desc = isset( $instance['show_desc'] ) ? (bool) absint( $instance['show_desc'] ) : TRUE;
302
-				$show_dates = isset( $instance['show_dates'] ) ? (bool) absint( $instance['show_dates'] ) : TRUE;
303
-				$date_limit = isset( $instance['date_limit'] ) && ! empty( $instance['date_limit'] ) ? $instance['date_limit'] : NULL;
304
-				$date_range = isset( $instance['date_range'] ) && ! empty( $instance['date_range'] ) ? $instance['date_range'] : FALSE;
298
+				$category = isset($instance['category_name']) && ! empty($instance['category_name']) ? $instance['category_name'] : FALSE;
299
+				$show_expired = isset($instance['show_expired']) ? (bool) absint($instance['show_expired']) : FALSE;
300
+				$image_size = isset($instance['image_size']) && ! empty($instance['image_size']) ? $instance['image_size'] : 'medium';
301
+				$show_desc = isset($instance['show_desc']) ? (bool) absint($instance['show_desc']) : TRUE;
302
+				$show_dates = isset($instance['show_dates']) ? (bool) absint($instance['show_dates']) : TRUE;
303
+				$date_limit = isset($instance['date_limit']) && ! empty($instance['date_limit']) ? $instance['date_limit'] : NULL;
304
+				$date_range = isset($instance['date_range']) && ! empty($instance['date_range']) ? $instance['date_range'] : FALSE;
305 305
 				// start to build our where clause
306 306
 				$where = array(
307 307
 //					'Datetime.DTT_is_primary' => 1,
308 308
 					'status' => 'publish'
309 309
 				);
310 310
 				// add category
311
-				if ( $category ) {
311
+				if ($category) {
312 312
 					$where['Term_Taxonomy.taxonomy'] = 'espresso_event_categories';
313 313
 					$where['Term_Taxonomy.Term.slug'] = $category;
314 314
 				}
315 315
 				// if NOT expired then we want events that start today or in the future
316
-				if ( ! $show_expired ) {
317
-					$where['Datetime.DTT_EVT_end'] = array( '>=', EEM_Datetime::instance()->current_time_for_query( 'DTT_EVT_end' ) );
316
+				if ( ! $show_expired) {
317
+					$where['Datetime.DTT_EVT_end'] = array('>=', EEM_Datetime::instance()->current_time_for_query('DTT_EVT_end'));
318 318
 				}
319 319
 				// run the query
320
-				$events = EE_Registry::instance()->load_model( 'Event' )->get_all( array(
320
+				$events = EE_Registry::instance()->load_model('Event')->get_all(array(
321 321
 					$where,
322
-					'limit' => $instance['limit'] > 0 ? '0,' . $instance['limit'] : '0,10',
322
+					'limit' => $instance['limit'] > 0 ? '0,'.$instance['limit'] : '0,10',
323 323
 					'order_by' => 'Datetime.DTT_EVT_start',
324 324
 					'order' => 'ASC',
325 325
 					'group_by' => 'EVT_ID'
326 326
 				));
327 327
 
328
-				if ( ! empty( $events )) {
328
+				if ( ! empty($events)) {
329 329
 					echo '<ul class="ee-upcoming-events-widget-ul">';
330
-					foreach ( $events as $event ) {
331
-						if ( $event instanceof EE_Event && ( !is_single() || $post->ID != $event->ID() ) ) {
330
+					foreach ($events as $event) {
331
+						if ($event instanceof EE_Event && ( ! is_single() || $post->ID != $event->ID())) {
332 332
 							//printr( $event, '$event  <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span>', 'auto' );
333
-							echo '<li id="ee-upcoming-events-widget-li-' . $event->ID() . '" class="ee-upcoming-events-widget-li">';
333
+							echo '<li id="ee-upcoming-events-widget-li-'.$event->ID().'" class="ee-upcoming-events-widget-li">';
334 334
 							// how big is the event name ?
335
-							$name_length = strlen( $event->name() );
336
-							switch( $name_length ) {
335
+							$name_length = strlen($event->name());
336
+							switch ($name_length) {
337 337
 								case $name_length > 70 :
338
-									$len_class =  ' three-line';
338
+									$len_class = ' three-line';
339 339
 									break;
340 340
 								case $name_length > 35 :
341
-									$len_class =  ' two-line';
341
+									$len_class = ' two-line';
342 342
 									break;
343 343
 								default :
344
-									$len_class =  ' one-line';
344
+									$len_class = ' one-line';
345 345
 							}
346
-							$event_url = apply_filters( 'FHEE_EEW_Upcoming_Events__widget__event_url', $event->get_permalink(), $event );
347
-							echo '<h5 class="ee-upcoming-events-widget-title-h5"><a class="ee-widget-event-name-a' . $len_class . '" href="' . $event_url . '">' . $event->name() . '</a></h5>';
348
-							if ( post_password_required( $event->ID() ) ) {
349
-								$pswd_form = apply_filters( 'FHEE_EEW_Upcoming_Events__widget__password_form', get_the_password_form( $event->ID() ), $event );
346
+							$event_url = apply_filters('FHEE_EEW_Upcoming_Events__widget__event_url', $event->get_permalink(), $event);
347
+							echo '<h5 class="ee-upcoming-events-widget-title-h5"><a class="ee-widget-event-name-a'.$len_class.'" href="'.$event_url.'">'.$event->name().'</a></h5>';
348
+							if (post_password_required($event->ID())) {
349
+								$pswd_form = apply_filters('FHEE_EEW_Upcoming_Events__widget__password_form', get_the_password_form($event->ID()), $event);
350 350
 								echo $pswd_form;
351 351
 							} else {
352
-								if ( has_post_thumbnail( $event->ID() ) && $image_size != 'none' ) {
353
-									echo '<div class="ee-upcoming-events-widget-img-dv"><a class="ee-upcoming-events-widget-img" href="' . $event_url . '">' . get_the_post_thumbnail( $event->ID(), $image_size ) . '</a></div>';
352
+								if (has_post_thumbnail($event->ID()) && $image_size != 'none') {
353
+									echo '<div class="ee-upcoming-events-widget-img-dv"><a class="ee-upcoming-events-widget-img" href="'.$event_url.'">'.get_the_post_thumbnail($event->ID(), $image_size).'</a></div>';
354 354
 								}
355
-								$desc = $event->short_description( 25 );
356
-								if ( $show_dates ) {
357
-									$date_format = apply_filters( 'FHEE__espresso_event_date_range__date_format', get_option( 'date_format' ));
358
-									$time_format = apply_filters( 'FHEE__espresso_event_date_range__time_format', get_option( 'time_format' ));
359
-									$single_date_format = apply_filters( 'FHEE__espresso_event_date_range__single_date_format', get_option( 'date_format' ));
360
-									$single_time_format = apply_filters( 'FHEE__espresso_event_date_range__single_time_format', get_option( 'time_format' ));
361
-									if ( $date_range == TRUE ) {
362
-										echo espresso_event_date_range( $date_format, $time_format, $single_date_format, $single_time_format, $event->ID() );
363
-									}else{
364
-										echo espresso_list_of_event_dates( $event->ID(), $date_format, $time_format, FALSE, NULL, TRUE, TRUE, $date_limit );
355
+								$desc = $event->short_description(25);
356
+								if ($show_dates) {
357
+									$date_format = apply_filters('FHEE__espresso_event_date_range__date_format', get_option('date_format'));
358
+									$time_format = apply_filters('FHEE__espresso_event_date_range__time_format', get_option('time_format'));
359
+									$single_date_format = apply_filters('FHEE__espresso_event_date_range__single_date_format', get_option('date_format'));
360
+									$single_time_format = apply_filters('FHEE__espresso_event_date_range__single_time_format', get_option('time_format'));
361
+									if ($date_range == TRUE) {
362
+										echo espresso_event_date_range($date_format, $time_format, $single_date_format, $single_time_format, $event->ID());
363
+									} else {
364
+										echo espresso_list_of_event_dates($event->ID(), $date_format, $time_format, FALSE, NULL, TRUE, TRUE, $date_limit);
365 365
 									}
366 366
 								}
367
-								if ( $show_desc && $desc ) {
368
-									echo '<p style="margin-top: .5em">' . $desc . '</p>';
367
+								if ($show_desc && $desc) {
368
+									echo '<p style="margin-top: .5em">'.$desc.'</p>';
369 369
 								}
370 370
 							}
371 371
 							echo '</li>';
@@ -389,7 +389,7 @@  discard block
 block discarded – undo
389 389
 	 * @return string
390 390
 	 */
391 391
 	public function make_the_title_a_link($title) {
392
-	    return '<a href="' . EEH_Event_View::event_archive_url() . '">' . $title . '</a>';
392
+	    return '<a href="'.EEH_Event_View::event_archive_url().'">'.$title.'</a>';
393 393
 	}
394 394
 
395 395
 }
Please login to merge, or discard this patch.
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,4 +1,6 @@  discard block
 block discarded – undo
1
-<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) exit('No direct script access allowed');
1
+<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) {
2
+	exit('No direct script access allowed');
3
+}
2 4
 /**
3 5
  * Event Espresso
4 6
  *
@@ -360,7 +362,7 @@  discard block
 block discarded – undo
360 362
 									$single_time_format = apply_filters( 'FHEE__espresso_event_date_range__single_time_format', get_option( 'time_format' ));
361 363
 									if ( $date_range == TRUE ) {
362 364
 										echo espresso_event_date_range( $date_format, $time_format, $single_date_format, $single_time_format, $event->ID() );
363
-									}else{
365
+									} else{
364 366
 										echo espresso_list_of_event_dates( $event->ID(), $date_format, $time_format, FALSE, NULL, TRUE, TRUE, $date_limit );
365 367
 									}
366 368
 								}
Please login to merge, or discard this patch.
core/helpers/EEH_Event_Query.helper.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -229,7 +229,7 @@
 block discarded – undo
229 229
 	 *
230 230
 	 * @access    public
231 231
 	 * @param string $event_list_css
232
-	 * @return    array
232
+	 * @return    string
233 233
 	 */
234 234
 	public function event_list_css( $event_list_css = '' ) {
235 235
 		$event_list_css .=  ! empty( $event_list_css ) ? ' ' : '';
Please login to merge, or discard this patch.
Spacing   +118 added lines, -118 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1
-<?php if ( ! defined( 'EVENT_ESPRESSO_VERSION' ) ) {
2
-	exit( 'No direct script access allowed' );
1
+<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) {
2
+	exit('No direct script access allowed');
3 3
 }
4 4
 /**
5 5
  * Event Espresso
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
 	 */
86 86
 	public static function add_query_filters() {
87 87
 		//add query filters
88
-		add_action( 'pre_get_posts', array( 'EEH_Event_Query', 'filter_query_parts' ), 10, 1 );
88
+		add_action('pre_get_posts', array('EEH_Event_Query', 'filter_query_parts'), 10, 1);
89 89
 	}
90 90
 
91 91
 
@@ -97,8 +97,8 @@  discard block
 block discarded – undo
97 97
 	 * @param \WP_Query $WP_Query
98 98
 	 * @return bool
99 99
 	 */
100
-	public static function apply_query_filters( WP_Query $WP_Query ) {
101
-		return ( isset( $WP_Query->query, $WP_Query->query['post_type'] ) && $WP_Query->query['post_type'] == 'espresso_events' ) ||  apply_filters( 'FHEE__EEH_Event_Query__apply_query_filters', false ) ? true : false;
100
+	public static function apply_query_filters(WP_Query $WP_Query) {
101
+		return (isset($WP_Query->query, $WP_Query->query['post_type']) && $WP_Query->query['post_type'] == 'espresso_events') || apply_filters('FHEE__EEH_Event_Query__apply_query_filters', false) ? true : false;
102 102
 	}
103 103
 
104 104
 
@@ -108,15 +108,15 @@  discard block
 block discarded – undo
108 108
 	 * @access    public
109 109
 	 * @param \WP_Query $WP_Query
110 110
 	 */
111
-	public static function filter_query_parts( WP_Query $WP_Query ) {
111
+	public static function filter_query_parts(WP_Query $WP_Query) {
112 112
 		//ONLY add our filters if this isn't the main wp_query, because if this is the main wp_query we already have our cpt strategies take care of adding things in.
113
-		if ( $WP_Query instanceof WP_Query && ! $WP_Query->is_main_query() ) {
113
+		if ($WP_Query instanceof WP_Query && ! $WP_Query->is_main_query()) {
114 114
 			// build event list query
115
-			add_filter( 'posts_fields', array( 'EEH_Event_Query', 'posts_fields' ), 10, 2 );
116
-			add_filter( 'posts_join', array( 'EEH_Event_Query', 'posts_join' ), 10, 2 );
117
-			add_filter( 'posts_where', array( 'EEH_Event_Query', 'posts_where' ), 10, 2 );
118
-			add_filter( 'posts_orderby', array( 'EEH_Event_Query', 'posts_orderby' ), 10, 2 );
119
-			add_filter( 'posts_clauses_request', array( 'EEH_Event_Query', 'posts_clauses' ), 10, 2 );
115
+			add_filter('posts_fields', array('EEH_Event_Query', 'posts_fields'), 10, 2);
116
+			add_filter('posts_join', array('EEH_Event_Query', 'posts_join'), 10, 2);
117
+			add_filter('posts_where', array('EEH_Event_Query', 'posts_where'), 10, 2);
118
+			add_filter('posts_orderby', array('EEH_Event_Query', 'posts_orderby'), 10, 2);
119
+			add_filter('posts_clauses_request', array('EEH_Event_Query', 'posts_clauses'), 10, 2);
120 120
 		}
121 121
 	}
122 122
 
@@ -131,13 +131,13 @@  discard block
 block discarded – undo
131 131
 	 * @param string $orderby
132 132
 	 * @param string $sort
133 133
 	 */
134
-	public static function set_query_params( $month = '', $category = '', $show_expired = FALSE, $orderby = 'start_date', $sort = 'ASC' ) {
134
+	public static function set_query_params($month = '', $category = '', $show_expired = FALSE, $orderby = 'start_date', $sort = 'ASC') {
135 135
 		self::$_query_params = array();
136
-		EEH_Event_Query::$_event_query_month = EEH_Event_Query::_display_month( $month );
137
-		EEH_Event_Query::$_event_query_category = EEH_Event_Query::_event_category_slug( $category );
138
-		EEH_Event_Query::$_event_query_show_expired = EEH_Event_Query::_show_expired( $show_expired );
139
-		EEH_Event_Query::$_event_query_orderby = EEH_Event_Query::_orderby( $orderby );
140
-		EEH_Event_Query::$_event_query_sort = EEH_Event_Query::_sort( $sort );
136
+		EEH_Event_Query::$_event_query_month = EEH_Event_Query::_display_month($month);
137
+		EEH_Event_Query::$_event_query_category = EEH_Event_Query::_event_category_slug($category);
138
+		EEH_Event_Query::$_event_query_show_expired = EEH_Event_Query::_show_expired($show_expired);
139
+		EEH_Event_Query::$_event_query_orderby = EEH_Event_Query::_orderby($orderby);
140
+		EEH_Event_Query::$_event_query_sort = EEH_Event_Query::_sort($sort);
141 141
 	}
142 142
 
143 143
 
@@ -149,8 +149,8 @@  discard block
 block discarded – undo
149 149
 	 * @param string $month
150 150
 	 * @return    string
151 151
 	 */
152
-	private static function _display_month( $month = '' ) {
153
-		return EE_Registry::instance()->REQ->is_set( 'event_query_month' ) ? sanitize_text_field( EE_Registry::instance()->REQ->get( 'event_query_month' ) ) : $month;
152
+	private static function _display_month($month = '') {
153
+		return EE_Registry::instance()->REQ->is_set('event_query_month') ? sanitize_text_field(EE_Registry::instance()->REQ->get('event_query_month')) : $month;
154 154
 	}
155 155
 
156 156
 
@@ -162,8 +162,8 @@  discard block
 block discarded – undo
162 162
 	 * @param string $category
163 163
 	 * @return    string
164 164
 	 */
165
-	private static function _event_category_slug( $category = '' ) {
166
-		return EE_Registry::instance()->REQ->is_set( 'event_query_category' ) ? sanitize_text_field( EE_Registry::instance()->REQ->get( 'event_query_category' ) ) : $category;
165
+	private static function _event_category_slug($category = '') {
166
+		return EE_Registry::instance()->REQ->is_set('event_query_category') ? sanitize_text_field(EE_Registry::instance()->REQ->get('event_query_category')) : $category;
167 167
 	}
168 168
 
169 169
 
@@ -175,10 +175,10 @@  discard block
 block discarded – undo
175 175
 	 * @param bool $show_expired
176 176
 	 * @return    boolean
177 177
 	 */
178
-	private static function _show_expired( $show_expired = FALSE ) {
178
+	private static function _show_expired($show_expired = FALSE) {
179 179
 		// override default expired option if set via filter
180
-		$_event_query_show_expired =EE_Registry::instance()->REQ->is_set( 'event_query_show_expired' ) ? EE_Registry::instance()->REQ->get( 'event_query_show_expired' ) : $show_expired;
181
-		return filter_var( $_event_query_show_expired, FILTER_VALIDATE_BOOLEAN );
180
+		$_event_query_show_expired = EE_Registry::instance()->REQ->is_set('event_query_show_expired') ? EE_Registry::instance()->REQ->get('event_query_show_expired') : $show_expired;
181
+		return filter_var($_event_query_show_expired, FILTER_VALIDATE_BOOLEAN);
182 182
 	}
183 183
 
184 184
 
@@ -190,10 +190,10 @@  discard block
 block discarded – undo
190 190
 	 * @param    string $orderby
191 191
 	 * @return    array
192 192
 	 */
193
-	private static function _orderby( $orderby = 'start_date' ) {
194
-		$event_query_orderby = EE_Registry::instance()->REQ->is_set( 'event_query_orderby' ) ? sanitize_text_field( EE_Registry::instance()->REQ->get( 'event_query_orderby' ) ) : $orderby;
195
-		$event_query_orderby = is_array( $event_query_orderby ) ? $event_query_orderby : explode( ',', $event_query_orderby );
196
-		$event_query_orderby = array_map( 'trim', $event_query_orderby );
193
+	private static function _orderby($orderby = 'start_date') {
194
+		$event_query_orderby = EE_Registry::instance()->REQ->is_set('event_query_orderby') ? sanitize_text_field(EE_Registry::instance()->REQ->get('event_query_orderby')) : $orderby;
195
+		$event_query_orderby = is_array($event_query_orderby) ? $event_query_orderby : explode(',', $event_query_orderby);
196
+		$event_query_orderby = array_map('trim', $event_query_orderby);
197 197
 		return $event_query_orderby;
198 198
 	}
199 199
 
@@ -206,9 +206,9 @@  discard block
 block discarded – undo
206 206
 	 * @param string $sort
207 207
 	 * @return    array
208 208
 	 */
209
-	private static function _sort( $sort = 'ASC' ) {
210
-		$sort = EE_Registry::instance()->REQ->is_set( 'event_query_sort' ) ? sanitize_text_field( EE_Registry::instance()->REQ->get( 'event_query_sort' ) ) : $sort;
211
-		return in_array( $sort, array( 'ASC', 'asc', 'DESC', 'desc' )) ? strtoupper( $sort ) : 'ASC';
209
+	private static function _sort($sort = 'ASC') {
210
+		$sort = EE_Registry::instance()->REQ->is_set('event_query_sort') ? sanitize_text_field(EE_Registry::instance()->REQ->get('event_query_sort')) : $sort;
211
+		return in_array($sort, array('ASC', 'asc', 'DESC', 'desc')) ? strtoupper($sort) : 'ASC';
212 212
 	}
213 213
 
214 214
 
@@ -221,10 +221,10 @@  discard block
 block discarded – undo
221 221
 	 *
222 222
 	 * @return array   array of clauses
223 223
 	 */
224
-	public static function posts_clauses( $clauses, WP_Query $wp_query ) {
225
-		if ( EEH_Event_Query::apply_query_filters( $wp_query ) ) {
224
+	public static function posts_clauses($clauses, WP_Query $wp_query) {
225
+		if (EEH_Event_Query::apply_query_filters($wp_query)) {
226 226
 			global $wpdb;
227
-			$clauses['groupby'] = $wpdb->posts . '.ID ';
227
+			$clauses['groupby'] = $wpdb->posts.'.ID ';
228 228
 		}
229 229
 		return $clauses;
230 230
 	}
@@ -239,10 +239,10 @@  discard block
 block discarded – undo
239 239
 	 * @param WP_Query $wp_query
240 240
 	 * @return    string
241 241
 	 */
242
-	public static function posts_fields( $SQL, WP_Query $wp_query ) {
243
-		if ( EEH_Event_Query::apply_query_filters( $wp_query ) ) {
242
+	public static function posts_fields($SQL, WP_Query $wp_query) {
243
+		if (EEH_Event_Query::apply_query_filters($wp_query)) {
244 244
 			// adds something like ", wp_esp_datetime.* " to WP Query SELECT statement
245
-			$SQL .= EEH_Event_Query::posts_fields_sql_for_orderby( EEH_Event_Query::$_event_query_orderby );
245
+			$SQL .= EEH_Event_Query::posts_fields_sql_for_orderby(EEH_Event_Query::$_event_query_orderby);
246 246
 		}
247 247
 		return $SQL;
248 248
 	}
@@ -257,29 +257,29 @@  discard block
 block discarded – undo
257 257
 	 * @internal  param bool|string $mixed $join_terms pass TRUE or term string, doesn't really matter since this value doesn't really get used for anything yet
258 258
 	 * @return    string
259 259
 	 */
260
-	public static function posts_fields_sql_for_orderby( $orderby_params = array() ) {
261
-		$SQL = ', MIN( ' . EEM_Datetime::instance()->table() . '.DTT_EVT_start ) as event_start_date ' ;
262
-		foreach( (array)$orderby_params as $orderby ) {
263
-			switch ( $orderby ) {
260
+	public static function posts_fields_sql_for_orderby($orderby_params = array()) {
261
+		$SQL = ', MIN( '.EEM_Datetime::instance()->table().'.DTT_EVT_start ) as event_start_date ';
262
+		foreach ((array) $orderby_params as $orderby) {
263
+			switch ($orderby) {
264 264
 
265 265
 				case 'ticket_start' :
266
-					$SQL .= ', ' . EEM_Ticket::instance()->table() . '.TKT_start_date' ;
266
+					$SQL .= ', '.EEM_Ticket::instance()->table().'.TKT_start_date';
267 267
 					break;
268 268
 
269 269
 				case 'ticket_end' :
270
-					$SQL .= ', ' . EEM_Ticket::instance()->table() . '.TKT_end_date' ;
270
+					$SQL .= ', '.EEM_Ticket::instance()->table().'.TKT_end_date';
271 271
 					break;
272 272
 
273 273
 				case 'venue_title' :
274
-					$SQL .= ', Venue.post_title AS venue_title' ;
274
+					$SQL .= ', Venue.post_title AS venue_title';
275 275
 					break;
276 276
 
277 277
 				case 'city' :
278
-					$SQL .= ', ' . EEM_Venue::instance()->second_table() . '.VNU_city' ;
278
+					$SQL .= ', '.EEM_Venue::instance()->second_table().'.VNU_city';
279 279
 					break;
280 280
 
281 281
 				case 'state' :
282
-					$SQL .= ', ' . EEM_State::instance()->table() . '.STA_name' ;
282
+					$SQL .= ', '.EEM_State::instance()->table().'.STA_name';
283 283
 					break;
284 284
 
285 285
 			}
@@ -297,12 +297,12 @@  discard block
 block discarded – undo
297 297
 	 * @param WP_Query $wp_query
298 298
 	 * @return    string
299 299
 	 */
300
-	public static function posts_join( $SQL = '', WP_Query $wp_query ) {
301
-		if ( EEH_Event_Query::apply_query_filters( $wp_query ) ) {
300
+	public static function posts_join($SQL = '', WP_Query $wp_query) {
301
+		if (EEH_Event_Query::apply_query_filters($wp_query)) {
302 302
 			// Category
303
-			$SQL = EEH_Event_Query::posts_join_sql_for_show_expired( $SQL, EEH_Event_Query::$_event_query_show_expired );
304
-			$SQL = EEH_Event_Query::posts_join_sql_for_terms( $SQL, EEH_Event_Query::$_event_query_category );
305
-			$SQL = EEH_Event_Query::posts_join_for_orderby( $SQL, EEH_Event_Query::$_event_query_orderby );
303
+			$SQL = EEH_Event_Query::posts_join_sql_for_show_expired($SQL, EEH_Event_Query::$_event_query_show_expired);
304
+			$SQL = EEH_Event_Query::posts_join_sql_for_terms($SQL, EEH_Event_Query::$_event_query_category);
305
+			$SQL = EEH_Event_Query::posts_join_for_orderby($SQL, EEH_Event_Query::$_event_query_orderby);
306 306
 		}
307 307
 		return $SQL;
308 308
 	}
@@ -317,11 +317,11 @@  discard block
 block discarded – undo
317 317
 	 * @param    boolean $show_expired if TRUE, then displayed past events
318 318
 	 * @return string
319 319
 	 */
320
-	public static function posts_join_sql_for_show_expired( $SQL = '', $show_expired = FALSE ) {
321
-		if ( ! $show_expired ) {
322
-			$join = EEM_Event::instance()->table() . '.ID = ' . EEM_Datetime::instance()->table() . '.' . EEM_Event::instance()->primary_key_name();
323
-			if ( strpos( $SQL, $join ) === FALSE ) {
324
-				$SQL .= ' INNER JOIN ' . EEM_Datetime::instance()->table() . ' ON ( ' . $join . ' ) ';
320
+	public static function posts_join_sql_for_show_expired($SQL = '', $show_expired = FALSE) {
321
+		if ( ! $show_expired) {
322
+			$join = EEM_Event::instance()->table().'.ID = '.EEM_Datetime::instance()->table().'.'.EEM_Event::instance()->primary_key_name();
323
+			if (strpos($SQL, $join) === FALSE) {
324
+				$SQL .= ' INNER JOIN '.EEM_Datetime::instance()->table().' ON ( '.$join.' ) ';
325 325
 			}
326 326
 		}
327 327
 		return $SQL;
@@ -337,8 +337,8 @@  discard block
 block discarded – undo
337 337
 	 * @param 	string $join_terms pass TRUE or term string, doesn't really matter since this value doesn't really get used for anything yet
338 338
 	 * @return 	string
339 339
 	 */
340
-	public static function posts_join_sql_for_terms( $SQL = '', $join_terms = '' ) {
341
-		if ( ! empty( $join_terms ) ) {
340
+	public static function posts_join_sql_for_terms($SQL = '', $join_terms = '') {
341
+		if ( ! empty($join_terms)) {
342 342
 			global $wpdb;
343 343
 			$SQL .= " LEFT JOIN $wpdb->term_relationships ON ($wpdb->posts.ID = $wpdb->term_relationships.object_id)";
344 344
 			$SQL .= " LEFT JOIN $wpdb->term_taxonomy ON ($wpdb->term_relationships.term_taxonomy_id = $wpdb->term_taxonomy.term_taxonomy_id)";
@@ -358,25 +358,25 @@  discard block
 block discarded – undo
358 358
 	 * @param 	array $orderby_params
359 359
 	 * @return 	string
360 360
 	 */
361
-	public static function posts_join_for_orderby( $SQL = '', $orderby_params = array() ) {
362
-		foreach ( (array)$orderby_params as $orderby ) {
363
-			switch ( $orderby ) {
361
+	public static function posts_join_for_orderby($SQL = '', $orderby_params = array()) {
362
+		foreach ((array) $orderby_params as $orderby) {
363
+			switch ($orderby) {
364 364
 				case 'ticket_start' :
365 365
 				case 'ticket_end' :
366
-					$SQL .= EEH_Event_Query::_posts_join_for_datetime( $SQL, EEM_Datetime_Ticket::instance()->table() . '.' . EEM_Datetime::instance()->primary_key_name() );
367
-					$SQL .= ' LEFT JOIN ' . EEM_Ticket::instance()->table() . ' ON (' . EEM_Datetime_Ticket::instance()->table() . '.' . EEM_Ticket::instance()->primary_key_name() . ' = ' . EEM_Ticket::instance()->table() . '.' . EEM_Ticket::instance()->primary_key_name() . ' )';
366
+					$SQL .= EEH_Event_Query::_posts_join_for_datetime($SQL, EEM_Datetime_Ticket::instance()->table().'.'.EEM_Datetime::instance()->primary_key_name());
367
+					$SQL .= ' LEFT JOIN '.EEM_Ticket::instance()->table().' ON ('.EEM_Datetime_Ticket::instance()->table().'.'.EEM_Ticket::instance()->primary_key_name().' = '.EEM_Ticket::instance()->table().'.'.EEM_Ticket::instance()->primary_key_name().' )';
368 368
 					break;
369 369
 				case 'venue_title' :
370 370
 				case 'city' :
371
-					$SQL .= EEH_Event_Query::_posts_join_for_event_venue( $SQL );
371
+					$SQL .= EEH_Event_Query::_posts_join_for_event_venue($SQL);
372 372
 					break;
373 373
 				case 'state' :
374
-					$SQL .= EEH_Event_Query::_posts_join_for_event_venue( $SQL );
375
-					$SQL .= EEH_Event_Query::_posts_join_for_venue_state( $SQL );
374
+					$SQL .= EEH_Event_Query::_posts_join_for_event_venue($SQL);
375
+					$SQL .= EEH_Event_Query::_posts_join_for_venue_state($SQL);
376 376
 					break;
377 377
 				case 'start_date' :
378 378
 				default :
379
-					$SQL .= EEH_Event_Query::_posts_join_for_datetime( $SQL, EEM_Event::instance()->table() . '.ID' );
379
+					$SQL .= EEH_Event_Query::_posts_join_for_datetime($SQL, EEM_Event::instance()->table().'.ID');
380 380
 					break;
381 381
 
382 382
 			}
@@ -394,11 +394,11 @@  discard block
 block discarded – undo
394 394
 	 * @param string $join
395 395
 	 * @return string
396 396
 	 */
397
-	protected static function _posts_join_for_datetime( $SQL = '', $join = '' ) {
398
-		if ( ! empty( $join )) {
399
-			$join .= ' = ' . EEM_Datetime::instance()->table() . '.' . EEM_Event::instance()->primary_key_name();
400
-			if ( strpos( $SQL, $join ) === FALSE ) {
401
-				return ' INNER JOIN ' . EEM_Datetime::instance()->table() . ' ON ( ' . $join . ' )';
397
+	protected static function _posts_join_for_datetime($SQL = '', $join = '') {
398
+		if ( ! empty($join)) {
399
+			$join .= ' = '.EEM_Datetime::instance()->table().'.'.EEM_Event::instance()->primary_key_name();
400
+			if (strpos($SQL, $join) === FALSE) {
401
+				return ' INNER JOIN '.EEM_Datetime::instance()->table().' ON ( '.$join.' )';
402 402
 			}
403 403
 		}
404 404
 		return '';
@@ -413,13 +413,13 @@  discard block
 block discarded – undo
413 413
 	 * @param string $SQL
414 414
 	 * @return string
415 415
 	 */
416
-	protected static function _posts_join_for_event_venue( $SQL = '' ) {
416
+	protected static function _posts_join_for_event_venue($SQL = '') {
417 417
 		// Event Venue table name
418 418
 		$event_venue_table = EEM_Event_Venue::instance()->table();
419 419
 		// generate conditions for:  Event <=> Event Venue  JOIN clause
420
-		$event_to_event_venue_join = EEM_Event::instance()->table() . '.ID = ' . $event_venue_table . '.' . EEM_Event::instance()->primary_key_name();
420
+		$event_to_event_venue_join = EEM_Event::instance()->table().'.ID = '.$event_venue_table.'.'.EEM_Event::instance()->primary_key_name();
421 421
 		// don't add joins if they have already been added
422
-		if ( strpos( $SQL, $event_to_event_venue_join ) === FALSE ) {
422
+		if (strpos($SQL, $event_to_event_venue_join) === FALSE) {
423 423
 			// Venue table name
424 424
 			$venue_table = EEM_Venue::instance()->table();
425 425
 			// Venue table pk
@@ -432,10 +432,10 @@  discard block
 block discarded – undo
432 432
 			$venue_SQL .= " LEFT JOIN $venue_table as Venue ON ( $event_venue_table.$venue_table_pk = Venue.ID )";
433 433
 			// generate JOIN clause for: Venue <=> Venue Meta
434 434
 			$venue_SQL .= " LEFT JOIN $venue_meta_table ON ( Venue.ID = $venue_meta_table.$venue_table_pk )";
435
-			unset( $event_venue_table, $event_to_event_venue_join, $venue_table, $venue_table_pk, $venue_meta_table );
435
+			unset($event_venue_table, $event_to_event_venue_join, $venue_table, $venue_table_pk, $venue_meta_table);
436 436
 			return $venue_SQL;
437 437
 		}
438
-		unset( $event_venue_table, $event_to_event_venue_join );
438
+		unset($event_venue_table, $event_to_event_venue_join);
439 439
 		return '';
440 440
 	}
441 441
 
@@ -448,7 +448,7 @@  discard block
 block discarded – undo
448 448
 	 * @param string $SQL
449 449
 	 * @return string
450 450
 	 */
451
-	protected static function _posts_join_for_venue_state( $SQL = '' ) {
451
+	protected static function _posts_join_for_venue_state($SQL = '') {
452 452
 		// Venue Meta table name
453 453
 		$venue_meta_table = EEM_Venue::instance()->second_table();
454 454
 		// State table name
@@ -456,16 +456,16 @@  discard block
 block discarded – undo
456 456
 		// State table pk
457 457
 		$state_table_pk = EEM_State::instance()->primary_key_name();
458 458
 		// verify vars
459
-		if ( $venue_meta_table && $state_table && $state_table_pk ) {
459
+		if ($venue_meta_table && $state_table && $state_table_pk) {
460 460
 			// like: wp_esp_venue_meta.STA_ID = wp_esp_state.STA_ID
461 461
 			$join = "$venue_meta_table.$state_table_pk = $state_table.$state_table_pk";
462 462
 			// don't add join if it has already been added
463
-			if ( strpos( $SQL, $join ) === FALSE ) {
464
-				unset( $state_table_pk, $venue_meta_table, $venue_table_pk );
463
+			if (strpos($SQL, $join) === FALSE) {
464
+				unset($state_table_pk, $venue_meta_table, $venue_table_pk);
465 465
 				return " LEFT JOIN $state_table ON ( $join )";
466 466
 			}
467 467
 		}
468
-		unset( $join, $state_table, $state_table_pk, $venue_meta_table, $venue_table_pk );
468
+		unset($join, $state_table, $state_table_pk, $venue_meta_table, $venue_table_pk);
469 469
 		return '';
470 470
 	}
471 471
 
@@ -479,14 +479,14 @@  discard block
 block discarded – undo
479 479
 	 * @param WP_Query $wp_query
480 480
 	 * @return    string
481 481
 	 */
482
-	public static function posts_where( $SQL = '', WP_Query $wp_query ) {
483
-		if ( EEH_Event_Query::apply_query_filters( $wp_query ) ) {
482
+	public static function posts_where($SQL = '', WP_Query $wp_query) {
483
+		if (EEH_Event_Query::apply_query_filters($wp_query)) {
484 484
 			// Show Expired ?
485
-			$SQL .= EEH_Event_Query::posts_where_sql_for_show_expired( EEH_Event_Query::$_event_query_show_expired  );
485
+			$SQL .= EEH_Event_Query::posts_where_sql_for_show_expired(EEH_Event_Query::$_event_query_show_expired);
486 486
 			// Category
487
-			$SQL .= EEH_Event_Query::posts_where_sql_for_event_category_slug( EEH_Event_Query::$_event_query_category  );
487
+			$SQL .= EEH_Event_Query::posts_where_sql_for_event_category_slug(EEH_Event_Query::$_event_query_category);
488 488
 			// Start Date
489
-			$SQL .= EEH_Event_Query::posts_where_sql_for_event_list_month( EEH_Event_Query::$_event_query_month );
489
+			$SQL .= EEH_Event_Query::posts_where_sql_for_event_list_month(EEH_Event_Query::$_event_query_month);
490 490
 		}
491 491
 		return $SQL;
492 492
 	}
@@ -500,8 +500,8 @@  discard block
 block discarded – undo
500 500
 	 * @param    boolean $show_expired if TRUE, then displayed past events
501 501
 	 * @return    string
502 502
 	 */
503
-	public static function posts_where_sql_for_show_expired( $show_expired = FALSE ) {
504
-		return ! $show_expired ? ' AND ' . EEM_Datetime::instance()->table() . '.DTT_EVT_end > "' . current_time( 'mysql', TRUE ) . '" ' : '';
503
+	public static function posts_where_sql_for_show_expired($show_expired = FALSE) {
504
+		return ! $show_expired ? ' AND '.EEM_Datetime::instance()->table().'.DTT_EVT_end > "'.current_time('mysql', TRUE).'" ' : '';
505 505
 	}
506 506
 
507 507
 
@@ -513,9 +513,9 @@  discard block
 block discarded – undo
513 513
 	 * @param    boolean $event_category_slug
514 514
 	 * @return    string
515 515
 	 */
516
-	public static function posts_where_sql_for_event_category_slug( $event_category_slug = NULL ) {
516
+	public static function posts_where_sql_for_event_category_slug($event_category_slug = NULL) {
517 517
 		global $wpdb;
518
-		return ! empty( $event_category_slug ) ? ' AND ' . $wpdb->terms . '.slug = "' . $event_category_slug . '" ' : '';
518
+		return ! empty($event_category_slug) ? ' AND '.$wpdb->terms.'.slug = "'.$event_category_slug.'" ' : '';
519 519
 	}
520 520
 
521 521
 
@@ -527,13 +527,13 @@  discard block
 block discarded – undo
527 527
 	 * @param    boolean $month
528 528
 	 * @return    string
529 529
 	 */
530
-	public static function posts_where_sql_for_event_list_month( $month = NULL ) {
530
+	public static function posts_where_sql_for_event_list_month($month = NULL) {
531 531
 		$SQL = '';
532
-		if ( ! empty( $month ) ) {
532
+		if ( ! empty($month)) {
533 533
 			// event start date is LESS than the end of the month ( so nothing that doesn't start until next month )
534
-			$SQL = ' AND ' . EEM_Datetime::instance()->table() . '.DTT_EVT_start <= "' . gmdate( 'Y-m-t 23:59:59', strtotime( $month ) ) . '"';
534
+			$SQL = ' AND '.EEM_Datetime::instance()->table().'.DTT_EVT_start <= "'.gmdate('Y-m-t 23:59:59', strtotime($month)).'"';
535 535
 			// event end date is GREATER than the start of the month ( so nothing that ended before this month )
536
-			$SQL .= ' AND ' . EEM_Datetime::instance()->table() . '.DTT_EVT_end >= "' . gmdate( 'Y-m-01 0:0:00', strtotime( $month ) ) . '" ';
536
+			$SQL .= ' AND '.EEM_Datetime::instance()->table().'.DTT_EVT_end >= "'.gmdate('Y-m-01 0:0:00', strtotime($month)).'" ';
537 537
 		}
538 538
 		return $SQL;
539 539
 	}
@@ -548,9 +548,9 @@  discard block
 block discarded – undo
548 548
 	 * @param WP_Query $wp_query
549 549
 	 * @return    string
550 550
 	 */
551
-	public static function posts_orderby( $SQL = '', WP_Query $wp_query ) {
552
-		if ( EEH_Event_Query::apply_query_filters( $wp_query ) ) {
553
-			$SQL = EEH_Event_Query::posts_orderby_sql( EEH_Event_Query::$_event_query_orderby, EEH_Event_Query::$_event_query_sort );
551
+	public static function posts_orderby($SQL = '', WP_Query $wp_query) {
552
+		if (EEH_Event_Query::apply_query_filters($wp_query)) {
553
+			$SQL = EEH_Event_Query::posts_orderby_sql(EEH_Event_Query::$_event_query_orderby, EEH_Event_Query::$_event_query_sort);
554 554
 		}
555 555
 		return $SQL;
556 556
 	}
@@ -581,63 +581,63 @@  discard block
 block discarded – undo
581 581
 	 * @param string     $sort
582 582
 	 * @return string
583 583
 	 */
584
-	public static function posts_orderby_sql( $orderby_params = array(), $sort = 'ASC' ) {
584
+	public static function posts_orderby_sql($orderby_params = array(), $sort = 'ASC') {
585 585
 		global $wpdb;
586 586
 		$SQL = '';
587 587
 		$counter = 0;
588 588
 		//make sure 'orderby' is set in query params
589
-		if ( ! isset( self::$_query_params['orderby'] )) {
589
+		if ( ! isset(self::$_query_params['orderby'])) {
590 590
 			self::$_query_params['orderby'] = array();
591 591
 		}
592 592
 		// loop thru $orderby_params (type cast as array)
593
-		foreach ( (array)$orderby_params as $orderby ) {
593
+		foreach ((array) $orderby_params as $orderby) {
594 594
 			// check if we have already added this param
595
-			if ( isset( self::$_query_params['orderby'][ $orderby ] )) {
595
+			if (isset(self::$_query_params['orderby'][$orderby])) {
596 596
 				// if so then remove from the $orderby_params so that the count() method below is accurate
597
-				unset( $orderby_params[ $orderby ] );
597
+				unset($orderby_params[$orderby]);
598 598
 				// then bump ahead to the next param
599 599
 				continue;
600 600
 			}
601 601
 			// this will ad a comma depending on whether this is the first or last param
602
-			$glue = $counter == 0 || $counter == count( $orderby_params ) ? ' ' : ', ';
602
+			$glue = $counter == 0 || $counter == count($orderby_params) ? ' ' : ', ';
603 603
 			// ok what's we dealing with?
604
-			switch ( $orderby ) {
604
+			switch ($orderby) {
605 605
 				case 'id' :
606 606
 				case 'ID' :
607
-					$SQL .= $glue . $wpdb->posts . '.ID ' . $sort;
607
+					$SQL .= $glue.$wpdb->posts.'.ID '.$sort;
608 608
 					break;
609 609
 				case 'end_date' :
610
-					$SQL .= $glue . EEM_Datetime::instance()->table() . '.DTT_EVT_end ' . $sort;
610
+					$SQL .= $glue.EEM_Datetime::instance()->table().'.DTT_EVT_end '.$sort;
611 611
 					break;
612 612
 				case 'event_name' :
613
-					$SQL .= $glue . $wpdb->posts . '.post_title ' . $sort;
613
+					$SQL .= $glue.$wpdb->posts.'.post_title '.$sort;
614 614
 					break;
615 615
 				case 'category_slug' :
616
-					$SQL .= $glue . $wpdb->terms . '.slug ' . $sort;
616
+					$SQL .= $glue.$wpdb->terms.'.slug '.$sort;
617 617
 					break;
618 618
 				case 'ticket_start' :
619
-					$SQL .= $glue . EEM_Ticket::instance()->table() . '.TKT_start_date ' . $sort;
619
+					$SQL .= $glue.EEM_Ticket::instance()->table().'.TKT_start_date '.$sort;
620 620
 					break;
621 621
 				case 'ticket_end' :
622
-					$SQL .= $glue . EEM_Ticket::instance()->table() . '.TKT_end_date ' . $sort;
622
+					$SQL .= $glue.EEM_Ticket::instance()->table().'.TKT_end_date '.$sort;
623 623
 					break;
624 624
 				case 'venue_title' :
625
-					$SQL .= $glue . 'venue_title ' . $sort;
625
+					$SQL .= $glue.'venue_title '.$sort;
626 626
 					break;
627 627
 				case 'city' :
628
-					$SQL .= $glue . EEM_Venue::instance()->second_table() . '.VNU_city ' . $sort;
628
+					$SQL .= $glue.EEM_Venue::instance()->second_table().'.VNU_city '.$sort;
629 629
 					break;
630 630
 				case 'state' :
631
-					$SQL .= $glue . EEM_State::instance()->table() . '.STA_name ' . $sort;
631
+					$SQL .= $glue.EEM_State::instance()->table().'.STA_name '.$sort;
632 632
 					break;
633 633
 				case 'start_date' :
634 634
 				default :
635
-					$SQL .= $glue . ' event_start_date ' . $sort;
635
+					$SQL .= $glue.' event_start_date '.$sort;
636 636
 					break;
637 637
 			}
638 638
 			// add to array of orderby params that have been added
639
-			self::$_query_params['orderby'][ $orderby ] = TRUE;
640
-			$counter ++;
639
+			self::$_query_params['orderby'][$orderby] = TRUE;
640
+			$counter++;
641 641
 		}
642 642
 		return $SQL;
643 643
 	}
Please login to merge, or discard this patch.
admin_pages/events/Event_Categories_Admin_List_Table.class.php 2 patches
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -6,8 +6,9 @@
 block discarded – undo
6 6
  * @package Event Espresso
7 7
  * @subpackage messages
8 8
  */
9
-if (!defined('EVENT_ESPRESSO_VERSION') )
9
+if (!defined('EVENT_ESPRESSO_VERSION') ) {
10 10
 	exit('NO direct script access allowed');
11
+}
11 12
 
12 13
 /**
13 14
  *
Please login to merge, or discard this patch.
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if (!defined('EVENT_ESPRESSO_VERSION') )
2
+if ( ! defined('EVENT_ESPRESSO_VERSION'))
3 3
 	exit('NO direct script access allowed');
4 4
 
5 5
 /**
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
 
32 32
 class Event_Categories_Admin_List_Table extends EE_Admin_List_Table {
33 33
 
34
-	public function __construct( $admin_page ) {
34
+	public function __construct($admin_page) {
35 35
 		parent::__construct($admin_page);
36 36
 	}
37 37
 
@@ -39,8 +39,8 @@  discard block
 block discarded – undo
39 39
 
40 40
 
41 41
 	protected function _setup_data() {
42
-		$this->_data = $this->_admin_page->get_categories( $this->_per_page, $this->_current_page);
43
-		$this->_all_data_count = EEM_Term_Taxonomy::instance()->count( array( array( 'taxonomy' => 'espresso_event_categories' ) ) );
42
+		$this->_data = $this->_admin_page->get_categories($this->_per_page, $this->_current_page);
43
+		$this->_all_data_count = EEM_Term_Taxonomy::instance()->count(array(array('taxonomy' => 'espresso_event_categories')));
44 44
 	}
45 45
 
46 46
 
@@ -49,8 +49,8 @@  discard block
 block discarded – undo
49 49
 
50 50
 	protected function _set_properties() {
51 51
 		$this->_wp_list_args = array(
52
-			'singular' => __('event category', 'event_espresso' ),
53
-			'plural' => __('event categories', 'event_espresso' ),
52
+			'singular' => __('event category', 'event_espresso'),
53
+			'plural' => __('event categories', 'event_espresso'),
54 54
 			'ajax' => TRUE, //for now,
55 55
 			'screen' => $this->_admin_page->get_current_screen()->id
56 56
 			);
@@ -64,9 +64,9 @@  discard block
 block discarded – undo
64 64
 			);
65 65
 
66 66
 		$this->_sortable_columns = array(
67
-			'id' => array( 'Term.term_id' => true ),
68
-			'name' => array( 'Term.slug' => false ),
69
-			'count' => array( 'term_count' => false )
67
+			'id' => array('Term.term_id' => true),
68
+			'name' => array('Term.slug' => false),
69
+			'count' => array('term_count' => false)
70 70
 			);
71 71
 
72 72
 		$this->_primary_column = 'id';
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
 
99 99
 
100 100
 	public function column_cb($item) {
101
-		return sprintf( '<input type="checkbox" name="EVT_CAT_ID[]" value="%s" />', $item->get('term_id') );
101
+		return sprintf('<input type="checkbox" name="EVT_CAT_ID[]" value="%s" />', $item->get('term_id'));
102 102
 	}
103 103
 
104 104
 
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
 
108 108
 	public function column_id($item) {
109 109
 		$content = $item->get('term_id');
110
-		$content .= '  <span class="show-on-mobile-view-only">' . $item->get_first_related('Term')->get('name') . '</span>';
110
+		$content .= '  <span class="show-on-mobile-view-only">'.$item->get_first_related('Term')->get('name').'</span>';
111 111
 		return $content;
112 112
 	}
113 113
 
@@ -127,17 +127,17 @@  discard block
 block discarded – undo
127 127
 			'EVT_CAT_ID' => $item->get('term_id')
128 128
 		);
129 129
 
130
-		$edit_link = EE_Admin_Page::add_query_args_and_nonce( $edit_query_args, EVENTS_ADMIN_URL );
131
-		$delete_link = EE_Admin_Page::add_query_args_and_nonce( $delete_query_args, EVENTS_ADMIN_URL );
130
+		$edit_link = EE_Admin_Page::add_query_args_and_nonce($edit_query_args, EVENTS_ADMIN_URL);
131
+		$delete_link = EE_Admin_Page::add_query_args_and_nonce($delete_query_args, EVENTS_ADMIN_URL);
132 132
 
133 133
 		$actions = array(
134
-			'edit' => '<a href="' . $edit_link . '" title="' . esc_attr__('Edit Category', 'event_espresso') . '">' . __('Edit', 'event_espresso') . '</a>'
134
+			'edit' => '<a href="'.$edit_link.'" title="'.esc_attr__('Edit Category', 'event_espresso').'">'.__('Edit', 'event_espresso').'</a>'
135 135
 			);
136 136
 
137 137
 
138
-		$actions['delete'] = '<a href="' . $delete_link . '" title="' . esc_attr__('Delete Category', 'event_espresso') . '">' . __('Delete', 'event_espresso') . '</a>';
138
+		$actions['delete'] = '<a href="'.$delete_link.'" title="'.esc_attr__('Delete Category', 'event_espresso').'">'.__('Delete', 'event_espresso').'</a>';
139 139
 
140
-		$content = '<strong><a class="row-title" href="' . $edit_link . '">' . $item->get_first_related('Term')->get('name') . '</a></strong>';
140
+		$content = '<strong><a class="row-title" href="'.$edit_link.'">'.$item->get_first_related('Term')->get('name').'</a></strong>';
141 141
 		$content .= $this->row_actions($actions);
142 142
 		return $content;
143 143
 	}
@@ -146,20 +146,20 @@  discard block
 block discarded – undo
146 146
 
147 147
 
148 148
 	public function column_shortcode($item) {
149
-		$content = '[ESPRESSO_EVENTS category_slug=' . $item->get_first_related('Term')->get('slug') . ']';
149
+		$content = '[ESPRESSO_EVENTS category_slug='.$item->get_first_related('Term')->get('slug').']';
150 150
 		return $content;
151 151
 	}
152 152
 
153 153
 
154 154
 
155 155
 
156
-	public function column_count( $item ) {
156
+	public function column_count($item) {
157 157
 		$e_args = array(
158 158
 			'action' => 'default',
159 159
 			'EVT_CAT' => $item->get_first_related('Term')->ID()
160 160
 			);
161
-		$e_link = EE_Admin_Page::add_query_args_and_nonce( $e_args, EVENTS_ADMIN_URL );
162
-		$content = '<a href="' . $e_link . '">' . $item->get('term_count') . '</a>';
161
+		$e_link = EE_Admin_Page::add_query_args_and_nonce($e_args, EVENTS_ADMIN_URL);
162
+		$content = '<a href="'.$e_link.'">'.$item->get('term_count').'</a>';
163 163
 		return $content;
164 164
 	}
165 165
 }
Please login to merge, or discard this patch.
admin_pages/events/help_tours/Event_Edit_Help_Tour.class.php 3 patches
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -123,14 +123,14 @@  discard block
 block discarded – undo
123 123
 					'tipLocation' => 'left'
124 124
 					)
125 125
 				),
126
-            110 => array(
126
+			110 => array(
127 127
 				'id' => 'espresso_event_editor_event_options',
128 128
 				'content' => $this->_event_registration_options_stop(),
129 129
 				'options' => array(
130 130
 					'tipLocation' => 'left'
131 131
 					)
132 132
 				),
133
-            120 => array(
133
+			120 => array(
134 134
 				'id' => 'submitpost',
135 135
 				'content' => $this->_publish_event_stop(),
136 136
 				'options' => array(
@@ -196,7 +196,7 @@  discard block
 block discarded – undo
196 196
 		return '<p>' . __('Set a feature image for your event here.', 'event_espresso') . '</p>';
197 197
 	}
198 198
     
199
-    protected function _publish_event_stop() {
199
+	protected function _publish_event_stop() {
200 200
 		return '<p>' . __('Easily control the state of your event. The main states are Published, Pending Review, and Draft. Additional states are Cancelled, Postponed, and Sold Out.', 'event_espresso') . '</p>';
201 201
 	}
202 202
 	
Please login to merge, or discard this patch.
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if (!defined('EVENT_ESPRESSO_VERSION') )
2
+if ( ! defined('EVENT_ESPRESSO_VERSION'))
3 3
 	exit('NO direct script access allowed');
4 4
 
5 5
 /**
@@ -143,8 +143,8 @@  discard block
 block discarded – undo
143 143
 
144 144
 
145 145
 	protected function _start() {
146
-		$content = '<h3>' . __('Event Editor', 'event_espresso') . '</h3>';
147
-		$content .= '<p>' . __('This tour of the Event Editor will provide an overview of the different areas of the screen to help you understand what they are used for. Let\'s get started on setting up your first event with Event Espresso!', 'event_espresso') . '</p>';
146
+		$content = '<h3>'.__('Event Editor', 'event_espresso').'</h3>';
147
+		$content .= '<p>'.__('This tour of the Event Editor will provide an overview of the different areas of the screen to help you understand what they are used for. Let\'s get started on setting up your first event with Event Espresso!', 'event_espresso').'</p>';
148 148
 		return $content;
149 149
 	}
150 150
 
@@ -153,51 +153,51 @@  discard block
 block discarded – undo
153 153
 	}
154 154
 
155 155
 	protected function _event_description_stop() {
156
-		return '<p>' . __('The rich text editor can be used to add information about your event. Images and links can also be added along with your text.', 'event_espresso') . '</p>';
156
+		return '<p>'.__('The rich text editor can be used to add information about your event. Images and links can also be added along with your text.', 'event_espresso').'</p>';
157 157
 	}
158 158
 
159 159
 	protected function _event_venues_caf() {
160
-		return '<p>' . __('In this section, you can select the venue that is hosting your event.', 'event_espresso') . '</p>';
160
+		return '<p>'.__('In this section, you can select the venue that is hosting your event.', 'event_espresso').'</p>';
161 161
 	}
162 162
 
163 163
 	protected function _event_venues_stop() {
164
-		return '<p>' . __('In this section, you can enter information about the venue that is hosting your event.', 'event_espresso') . '</p>';
164
+		return '<p>'.__('In this section, you can enter information about the venue that is hosting your event.', 'event_espresso').'</p>';
165 165
 	}
166 166
 
167 167
 	protected function _event_pricing_stop() {
168
-		return '<p>' . __('Use the Event Datetime & Ticket section to enter details about when the event is happening and what tickets you want to offer for access to the event.', 'event_espresso') . '</p>';
168
+		return '<p>'.__('Use the Event Datetime & Ticket section to enter details about when the event is happening and what tickets you want to offer for access to the event.', 'event_espresso').'</p>';
169 169
 	}
170 170
 
171 171
 	protected function _event_pricing_caf() {
172
-		return '<p>' . __('Use the Event Datetimes & Ticket section to enter details about when the event is happening and what tickets you want to offer for access to the event.', 'event_espresso') . '</p>';
172
+		return '<p>'.__('Use the Event Datetimes & Ticket section to enter details about when the event is happening and what tickets you want to offer for access to the event.', 'event_espresso').'</p>';
173 173
 	}
174 174
 	
175 175
 	protected function _event_registration_options_stop() {
176
-		return '<p>' . __('Setup custom options for your event registration.', 'event_espresso') . '</p>';
176
+		return '<p>'.__('Setup custom options for your event registration.', 'event_espresso').'</p>';
177 177
 	}
178 178
 	
179 179
 	protected function _event_post_tag_stop() {
180
-		return '<p>' . __('Quickly add tags to your event.', 'event_espresso') . '</p>';
180
+		return '<p>'.__('Quickly add tags to your event.', 'event_espresso').'</p>';
181 181
 	}
182 182
 
183 183
 	protected function _event_categories_stop() {
184
-		return '<p>' . __('Events can also be categorized if you wish.', 'event_espresso') . '</p>';
184
+		return '<p>'.__('Events can also be categorized if you wish.', 'event_espresso').'</p>';
185 185
 	}
186 186
 
187 187
 	protected function _primary_question_stop_caf() {
188
-		return '<p>' . __('Use the questions group to request information from your primary registrant.', 'event_espresso') . '</p>';
188
+		return '<p>'.__('Use the questions group to request information from your primary registrant.', 'event_espresso').'</p>';
189 189
 	}
190 190
 
191 191
 	protected function _additional_questions_stop_caf() {
192
-		return '<p>' . __('Use the questions group to request information from your additional registrant.', 'event_espresso') . '</p>';
192
+		return '<p>'.__('Use the questions group to request information from your additional registrant.', 'event_espresso').'</p>';
193 193
 	}
194 194
 	
195 195
 	protected function _featured_image_stop() {
196
-		return '<p>' . __('Set a feature image for your event here.', 'event_espresso') . '</p>';
196
+		return '<p>'.__('Set a feature image for your event here.', 'event_espresso').'</p>';
197 197
 	}
198 198
     
199 199
     protected function _publish_event_stop() {
200
-		return '<p>' . __('Easily control the state of your event. The main states are Published, Pending Review, and Draft. Additional states are Cancelled, Postponed, and Sold Out.', 'event_espresso') . '</p>';
200
+		return '<p>'.__('Easily control the state of your event. The main states are Published, Pending Review, and Draft. Additional states are Cancelled, Postponed, and Sold Out.', 'event_espresso').'</p>';
201 201
 	}
202 202
 	
203 203
 }
204 204
\ No newline at end of file
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -6,8 +6,9 @@
 block discarded – undo
6 6
  * @package Event Espresso
7 7
  * @subpackage messages
8 8
  */
9
-if (!defined('EVENT_ESPRESSO_VERSION') )
9
+if (!defined('EVENT_ESPRESSO_VERSION') ) {
10 10
 	exit('NO direct script access allowed');
11
+}
11 12
 
12 13
 /**
13 14
  *
Please login to merge, or discard this patch.
admin_pages/maintenance/Maintenance_Admin_Page_Init.core.php 2 patches
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -6,8 +6,9 @@
 block discarded – undo
6 6
  * @package Event Espresso
7 7
  * @subpackage messages
8 8
  */
9
-if (!defined('EVENT_ESPRESSO_VERSION') )
9
+if (!defined('EVENT_ESPRESSO_VERSION') ) {
10 10
 	exit('NO direct script access allowed');
11
+}
11 12
 
12 13
 /**
13 14
  *
Please login to merge, or discard this patch.
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if (!defined('EVENT_ESPRESSO_VERSION') )
2
+if ( ! defined('EVENT_ESPRESSO_VERSION'))
3 3
 	exit('NO direct script access allowed');
4 4
 
5 5
 /**
@@ -34,14 +34,14 @@  discard block
 block discarded – undo
34 34
 
35 35
 	public function __construct() {
36 36
 		//define some page related constants
37
-		define( 'EE_MAINTENANCE_LABEL', __('Maintenance', 'event_espresso'));
38
-		define( 'EE_MAINTENANCE_PG_SLUG', 'espresso_maintenance_settings' );
39
-		define( 'EE_MAINTENANCE_ADMIN_URL', admin_url( 'admin.php?page=' . EE_MAINTENANCE_PG_SLUG ));
40
-		define( 'EE_MAINTENANCE_ADMIN', EE_ADMIN_PAGES . 'maintenance' . DS );
41
-		define( 'EE_MAINTENANCE_TEMPLATE_PATH', EE_MAINTENANCE_ADMIN . 'templates' . DS );
42
-		define( 'EE_MAINTENANCE_ASSETS_URL', EE_ADMIN_PAGES_URL . 'maintenance/assets/' );
37
+		define('EE_MAINTENANCE_LABEL', __('Maintenance', 'event_espresso'));
38
+		define('EE_MAINTENANCE_PG_SLUG', 'espresso_maintenance_settings');
39
+		define('EE_MAINTENANCE_ADMIN_URL', admin_url('admin.php?page='.EE_MAINTENANCE_PG_SLUG));
40
+		define('EE_MAINTENANCE_ADMIN', EE_ADMIN_PAGES.'maintenance'.DS);
41
+		define('EE_MAINTENANCE_TEMPLATE_PATH', EE_MAINTENANCE_ADMIN.'templates'.DS);
42
+		define('EE_MAINTENANCE_ASSETS_URL', EE_ADMIN_PAGES_URL.'maintenance/assets/');
43 43
 		//check that if we're in maintenance mode that we tell the admin that
44
-		add_action('admin_notices',array($this,'check_maintenance_mode'));
44
+		add_action('admin_notices', array($this, 'check_maintenance_mode'));
45 45
 		parent::__construct();
46 46
 	}
47 47
 
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
 	protected function _set_menu_map() {
53 53
 		$menu_map = $this->_menu_map();
54 54
 
55
-		$this->_menu_map = EE_Maintenance_Mode::instance()->level() == EE_Maintenance_Mode::level_2_complete_maintenance ? new EE_Admin_Page_Main_Menu( $menu_map) : new EE_Admin_Page_Sub_Menu( $menu_map );
55
+		$this->_menu_map = EE_Maintenance_Mode::instance()->level() == EE_Maintenance_Mode::level_2_complete_maintenance ? new EE_Admin_Page_Main_Menu($menu_map) : new EE_Admin_Page_Sub_Menu($menu_map);
56 56
 	}
57 57
 
58 58
 	protected function _menu_map() {
@@ -67,10 +67,10 @@  discard block
 block discarded – undo
67 67
 			'maintenance_mode_parent' => EE_MAINTENANCE_PG_SLUG,
68 68
 			'admin_init_page' => $this
69 69
 		);
70
-		if( EE_Maintenance_Mode::instance()->level() == EE_Maintenance_Mode::level_2_complete_maintenance ){
71
-			$map['menu_group']='main';
70
+		if (EE_Maintenance_Mode::instance()->level() == EE_Maintenance_Mode::level_2_complete_maintenance) {
71
+			$map['menu_group'] = 'main';
72 72
 			$map['subtitle'] = EE_MAINTENANCE_LABEL;
73
-			$map['menu_label'] = __( 'Event Espresso', 'event_espresso' );
73
+			$map['menu_label'] = __('Event Espresso', 'event_espresso');
74 74
 		}
75 75
 		return $map;
76 76
 	}
@@ -78,26 +78,26 @@  discard block
 block discarded – undo
78 78
 	/**
79 79
 	 * Checks if we're in maintenance mode, and if so we notify the admin adn tell them how to take the site OUT of maintenance mode
80 80
 	 */
81
-	public function check_maintenance_mode(){
81
+	public function check_maintenance_mode() {
82 82
 		$notice = '';
83 83
 		$maintenance_page_url = '';
84
-		if(EE_Maintenance_Mode::instance()->level()){
84
+		if (EE_Maintenance_Mode::instance()->level()) {
85 85
 			$maintenance_page_url = EE_Admin_Page::add_query_args_and_nonce(array(), EE_MAINTENANCE_ADMIN_URL);
86
-			switch(EE_Maintenance_Mode::instance()->level()){
86
+			switch (EE_Maintenance_Mode::instance()->level()) {
87 87
 				case EE_Maintenance_Mode::level_1_frontend_only_maintenance:
88 88
 					$notice = '<div class="update-nag">
89
-						' . sprintf(__("Event Espresso is in Frontend-Only MAINTENANCE MODE. This means the front-end (ie, non-wp-admin pages) is disabled for ALL users except site admins. Visit the %s Maintenance Page %s to disable maintenance mode.", "event_espresso"),"<a href='$maintenance_page_url'>","</a>").
89
+						' . sprintf(__("Event Espresso is in Frontend-Only MAINTENANCE MODE. This means the front-end (ie, non-wp-admin pages) is disabled for ALL users except site admins. Visit the %s Maintenance Page %s to disable maintenance mode.", "event_espresso"), "<a href='$maintenance_page_url'>", "</a>").
90 90
 					'</div>';
91 91
 					break;
92 92
 				case EE_Maintenance_Mode::level_2_complete_maintenance:
93
-						$notice =  '<div class="error">
93
+						$notice = '<div class="error">
94 94
 						<p>'. sprintf(__("As part of the process for updating Event Espresso, your database also
95
-needs to be updated. Event Espresso is in COMPLETE MAINTENANCE MODE (both WordPress admin pages and front-end event registration pages are disabled) until you run the database update script. %s Visit the Maintenance Page to get started,%s it only takes a moment.", "event_espresso"),"<a href='$maintenance_page_url'>","</a>").
95
+needs to be updated. Event Espresso is in COMPLETE MAINTENANCE MODE (both WordPress admin pages and front-end event registration pages are disabled) until you run the database update script. %s Visit the Maintenance Page to get started,%s it only takes a moment.", "event_espresso"), "<a href='$maintenance_page_url'>", "</a>").
96 96
 					'</div>';
97 97
 					break;
98 98
 			}
99 99
 		}
100
-		echo  apply_filters( 'FHEE__Maintenance_Admin_Page_Init__check_maintenance_mode__notice', $notice, $maintenance_page_url );
100
+		echo  apply_filters('FHEE__Maintenance_Admin_Page_Init__check_maintenance_mode__notice', $notice, $maintenance_page_url);
101 101
 	}
102 102
 
103 103
 } //end class Payments_Admin_Page_Init
Please login to merge, or discard this patch.
admin_pages/messages/templates/ee_msg_m_settings_content.template.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -5,7 +5,7 @@
 block discarded – undo
5 5
 	<div class"mt-settings">
6 6
 		<form method="POST" action="" class="mt-settings-form<?php echo $show_form; ?>">
7 7
 			<?php echo $template_form_fields; ?>
8
-			<?php foreach ( $hidden_fields as $name => $field ) {
8
+			<?php foreach ($hidden_fields as $name => $field) {
9 9
 				echo $field['field'];
10 10
 			} ?> 
11 11
 			<input type="submit" value="<?php _e('Submit', 'event_espresso'); ?>" class="button-secondary mt-settings-submit no-drag" />
Please login to merge, or discard this patch.
admin_pages/registrations/EE_Attendee_Contact_List_Table.class.php 2 patches
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,4 +1,6 @@
 block discarded – undo
1
-<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) exit('No direct script access allowed');
1
+<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) {
2
+	exit('No direct script access allowed');
3
+}
2 4
 /**
3 5
  * Event Espresso
4 6
  *
Please login to merge, or discard this patch.
Spacing   +36 added lines, -36 removed lines patch added patch discarded remove patch
@@ -4,7 +4,7 @@  discard block
 block discarded – undo
4 4
 class EE_Attendee_Contact_List_Table extends EE_Admin_List_Table {
5 5
 
6 6
 
7
-	public function __construct( $admin_page ) {
7
+	public function __construct($admin_page) {
8 8
 		parent::__construct($admin_page);
9 9
 	}
10 10
 
@@ -12,8 +12,8 @@  discard block
 block discarded – undo
12 12
 
13 13
 
14 14
 	protected function _setup_data() {
15
-		$this->_data = $this->_view != 'trash' ? $this->_admin_page->get_attendees( $this->_per_page ) : $this->_admin_page->get_attendees( $this->_per_page, FALSE, TRUE );
16
-		$this->_all_data_count = $this->_view != 'trash' ? $this->_admin_page->get_attendees( $this->_per_page, TRUE ) : $this->_admin_page->get_attendees( $this->_per_page,TRUE, TRUE );
15
+		$this->_data = $this->_view != 'trash' ? $this->_admin_page->get_attendees($this->_per_page) : $this->_admin_page->get_attendees($this->_per_page, FALSE, TRUE);
16
+		$this->_all_data_count = $this->_view != 'trash' ? $this->_admin_page->get_attendees($this->_per_page, TRUE) : $this->_admin_page->get_attendees($this->_per_page, TRUE, TRUE);
17 17
 	}
18 18
 
19 19
 
@@ -41,13 +41,13 @@  discard block
 block discarded – undo
41 41
 			);
42 42
 
43 43
 		$this->_sortable_columns = array(
44
-			'ATT_ID' => array( 'ATT_ID' => FALSE ),
45
-			'ATT_lname' => array( 'ATT_lname' => TRUE ), //true means its already sorted
46
-			'ATT_fname' => array( 'ATT_fname' => FALSE ),
47
-			'ATT_email' => array( 'ATT_email' => FALSE ),
48
-			'ATT_city' => array( 'ATT_city' => FALSE ),
49
-			'STA_ID' => array( 'STA_ID' => FALSE ),
50
-			'CNT_ISO' => array( 'CNT_ISO' => FALSE )
44
+			'ATT_ID' => array('ATT_ID' => FALSE),
45
+			'ATT_lname' => array('ATT_lname' => TRUE), //true means its already sorted
46
+			'ATT_fname' => array('ATT_fname' => FALSE),
47
+			'ATT_email' => array('ATT_email' => FALSE),
48
+			'ATT_city' => array('ATT_city' => FALSE),
49
+			'STA_ID' => array('STA_ID' => FALSE),
50
+			'CNT_ISO' => array('CNT_ISO' => FALSE)
51 51
 		);
52 52
 
53 53
 		$this->_hidden_columns = array();
@@ -64,9 +64,9 @@  discard block
 block discarded – undo
64 64
 
65 65
 
66 66
 	protected function _add_view_counts() {
67
-		$this->_views['in_use']['count'] = $this->_admin_page->get_attendees( $this->_per_page, TRUE );
68
-		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_delete_contacts', 'espresso_registrations_delete_registration' ) ) {
69
-			$this->_views['trash']['count'] = $this->_admin_page->get_attendees( $this->_per_page,TRUE, TRUE );
67
+		$this->_views['in_use']['count'] = $this->_admin_page->get_attendees($this->_per_page, TRUE);
68
+		if (EE_Registry::instance()->CAP->current_user_can('ee_delete_contacts', 'espresso_registrations_delete_registration')) {
69
+			$this->_views['trash']['count'] = $this->_admin_page->get_attendees($this->_per_page, TRUE, TRUE);
70 70
 		}
71 71
 	}
72 72
 
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
 
90 90
 
91 91
 	function column_cb($item) {
92
-		return sprintf( '<input type="checkbox" name="checkbox[%1$s]" value="%1$s" />', /* $1%s */ $item->ID() );
92
+		return sprintf('<input type="checkbox" name="checkbox[%1$s]" value="%1$s" />', /* $1%s */ $item->ID());
93 93
 	}
94 94
 
95 95
 
@@ -97,9 +97,9 @@  discard block
 block discarded – undo
97 97
 
98 98
 
99 99
 	function column_ATT_ID($item) {
100
-		$content =  $item->ID();
100
+		$content = $item->ID();
101 101
 		$attendee_name = $item instanceof EE_Attendee ? $item->full_name() : '';
102
-		$content .= '  <span class="show-on-mobile-view-only">' . $attendee_name . '</span>';
102
+		$content .= '  <span class="show-on-mobile-view-only">'.$attendee_name.'</span>';
103 103
 		return $content;
104 104
 	}
105 105
 
@@ -110,8 +110,8 @@  discard block
 block discarded – undo
110 110
 	function column_ATT_lname($item) {
111 111
 
112 112
 		// edit attendee link
113
-		$edit_lnk_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'edit_attendee', 'post'=>$item->ID() ), REG_ADMIN_URL );
114
-		$name_link = EE_Registry::instance()->CAP->current_user_can( 'ee_edit_contacts', 'espresso_registrations_edit_attendee' ) ?  '<a href="'.$edit_lnk_url.'" title="' . esc_attr__( 'Edit Contact', 'event_espresso' ) . '">' . $item->lname() . '</a>' : $item->lname();
113
+		$edit_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'edit_attendee', 'post'=>$item->ID()), REG_ADMIN_URL);
114
+		$name_link = EE_Registry::instance()->CAP->current_user_can('ee_edit_contacts', 'espresso_registrations_edit_attendee') ? '<a href="'.$edit_lnk_url.'" title="'.esc_attr__('Edit Contact', 'event_espresso').'">'.$item->lname().'</a>' : $item->lname();
115 115
 		return $name_link;
116 116
 
117 117
 	}
@@ -124,30 +124,30 @@  discard block
 block discarded – undo
124 124
 		//Build row actions
125 125
 		$actions = array();
126 126
 		// edit attendee link
127
-		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_edit_contacts', 'espresso_registrations_edit_attendee' ) ) {
128
-			$edit_lnk_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'edit_attendee', 'post'=>$item->ID() ), REG_ADMIN_URL );
129
-			$actions['edit'] = '<a href="'.$edit_lnk_url.'" title="' . esc_attr__( 'Edit Contact', 'event_espresso' ) . '">' . __( 'Edit', 'event_espresso' ) . '</a>';
127
+		if (EE_Registry::instance()->CAP->current_user_can('ee_edit_contacts', 'espresso_registrations_edit_attendee')) {
128
+			$edit_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'edit_attendee', 'post'=>$item->ID()), REG_ADMIN_URL);
129
+			$actions['edit'] = '<a href="'.$edit_lnk_url.'" title="'.esc_attr__('Edit Contact', 'event_espresso').'">'.__('Edit', 'event_espresso').'</a>';
130 130
 		}
131 131
 
132
-		if ( $this->_view == 'in_use' ) {
132
+		if ($this->_view == 'in_use') {
133 133
 			// trash attendee link
134
-			if ( EE_Registry::instance()->CAP->current_user_can( 'ee_delete_contacts', 'espresso_registrations_trash_attendees' ) ) {
135
-				$trash_lnk_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'trash_attendees', 'ATT_ID'=>$item->ID() ), REG_ADMIN_URL );
136
-				$actions['trash'] = '<a href="'.$trash_lnk_url.'" title="' . esc_attr__( 'Move Contact to Trash', 'event_espresso' ) . '">' . __( 'Trash', 'event_espresso' ) . '</a>';
134
+			if (EE_Registry::instance()->CAP->current_user_can('ee_delete_contacts', 'espresso_registrations_trash_attendees')) {
135
+				$trash_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'trash_attendees', 'ATT_ID'=>$item->ID()), REG_ADMIN_URL);
136
+				$actions['trash'] = '<a href="'.$trash_lnk_url.'" title="'.esc_attr__('Move Contact to Trash', 'event_espresso').'">'.__('Trash', 'event_espresso').'</a>';
137 137
 			}
138 138
 		} else {
139
-			if ( EE_Registry::instance()->CAP->current_user_can( 'ee_delete_contacts', 'espresso_registrations_restore_attendees' ) ) {
139
+			if (EE_Registry::instance()->CAP->current_user_can('ee_delete_contacts', 'espresso_registrations_restore_attendees')) {
140 140
 				// restore attendee link
141
-				$restore_lnk_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'restore_attendees', 'ATT_ID'=>$item->ID() ), REG_ADMIN_URL );
142
-				$actions['restore'] = '<a href="'.$restore_lnk_url.'" title="' . esc_attr__( 'Restore Contact', 'event_espresso' ) . '">' . __( 'Restore', 'event_espresso' ) . '</a>';
141
+				$restore_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'restore_attendees', 'ATT_ID'=>$item->ID()), REG_ADMIN_URL);
142
+				$actions['restore'] = '<a href="'.$restore_lnk_url.'" title="'.esc_attr__('Restore Contact', 'event_espresso').'">'.__('Restore', 'event_espresso').'</a>';
143 143
 			}
144 144
 		}
145 145
 
146
-		$edit_lnk_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'edit_attendee', 'post'=>$item->ID() ), REG_ADMIN_URL );
147
-		$name_link = EE_Registry::instance()->CAP->current_user_can( 'ee_edit_contacts', 'espresso_registrations_edit_attendee' ) ?  '<a href="'.$edit_lnk_url.'" title="' . esc_attr__( 'Edit Contact', 'event_espresso' ) . '">' . $item->fname() . '</a>' : $item->fname();
146
+		$edit_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'edit_attendee', 'post'=>$item->ID()), REG_ADMIN_URL);
147
+		$name_link = EE_Registry::instance()->CAP->current_user_can('ee_edit_contacts', 'espresso_registrations_edit_attendee') ? '<a href="'.$edit_lnk_url.'" title="'.esc_attr__('Edit Contact', 'event_espresso').'">'.$item->fname().'</a>' : $item->fname();
148 148
 
149 149
 		//Return the name contents
150
-		return sprintf('%1$s %2$s', $name_link, $this->row_actions($actions) );
150
+		return sprintf('%1$s %2$s', $name_link, $this->row_actions($actions));
151 151
 	}
152 152
 
153 153
 
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
 
156 156
 
157 157
 	function column_ATT_email($item) {
158
-		return '<a href="mailto:' . $item->email() . '">' . $item->email() . '</a>';
158
+		return '<a href="mailto:'.$item->email().'">'.$item->email().'</a>';
159 159
 	}
160 160
 
161 161
 
@@ -175,8 +175,8 @@  discard block
 block discarded – undo
175 175
 
176 176
 	function column_STA_ID($item) {
177 177
 		$states = EEM_State::instance()->get_all_states();
178
-		$state = isset( $states[ $item->state_ID() ] ) ? $states[ $item->state_ID() ]->get( 'STA_name' ) : $item->state_ID();
179
-		return ! is_numeric( $state ) ? $state : '';
178
+		$state = isset($states[$item->state_ID()]) ? $states[$item->state_ID()]->get('STA_name') : $item->state_ID();
179
+		return ! is_numeric($state) ? $state : '';
180 180
 	}
181 181
 
182 182
 
@@ -184,8 +184,8 @@  discard block
 block discarded – undo
184 184
 	function column_CNT_ISO($item) {
185 185
 		$countries = EEM_Country::instance()->get_all_countries();
186 186
 		//EEH_Debug_Tools::printr( $countries, '$countries  <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span>', 'auto' );
187
-		$country = isset( $countries[ $item->country_ID() ] ) ? $countries[ $item->country_ID() ]->get( 'CNT_name' ) : $item->country_ID();
188
-		return ! is_numeric( $country ) ? $country : '';
187
+		$country = isset($countries[$item->country_ID()]) ? $countries[$item->country_ID()]->get('CNT_name') : $item->country_ID();
188
+		return ! is_numeric($country) ? $country : '';
189 189
 	}
190 190
 
191 191
 
Please login to merge, or discard this patch.
admin_pages/registrations/EE_Registrations_List_Table.class.php 4 patches
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,4 +1,6 @@  discard block
 block discarded – undo
1
-<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) exit('No direct script access allowed');
1
+<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) {
2
+	exit('No direct script access allowed');
3
+}
2 4
 /**
3 5
  * EEH_URL helper
4 6
  * Helper class for URL-related PHP functions
@@ -62,7 +64,7 @@  discard block
 block discarded – undo
62 64
 				isset($results['response']['code']) &&
63 65
 				$results['response']['code'] == '200'){
64 66
 			return true;
65
-		}else{
67
+		} else{
66 68
 			return false;
67 69
 		}
68 70
 	}
Please login to merge, or discard this patch.
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -93,7 +93,7 @@
 block discarded – undo
93 93
 	 *
94 94
 	 * @abstract
95 95
 	 * @access protected
96
-	 * @return array
96
+	 * @return string[]
97 97
 	 */
98 98
 	protected function _get_table_filters() {
99 99
 		$filters = array();
Please login to merge, or discard this patch.
Indentation   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -370,18 +370,18 @@  discard block
 block discarded – undo
370 370
 	 * @return string
371 371
 	 * @throws \EE_Error
372 372
 	 */
373
-    public function column_cb($item){
373
+	public function column_cb($item){
374 374
 	/** checkbox/lock **/
375 375
 	$transaction = $item->get_first_related( 'Transaction' );
376 376
 	$payment_count = $transaction instanceof EE_Transaction ? $transaction->count_related( 'Payment' ) : 0;
377
-	    return $payment_count > 0
378
-		    ? sprintf( '<input type="checkbox" name="_REG_ID[]" value="%1$s" />', $item->ID() )
379
-		      . '<span class="ee-lock-icon"></span>'
380
-		    : sprintf(
381
-			    '<input type="checkbox" name="_REG_ID[]" value="%1$s" />',
382
-			    $item->ID()
383
-		    );
384
-    }
377
+		return $payment_count > 0
378
+			? sprintf( '<input type="checkbox" name="_REG_ID[]" value="%1$s" />', $item->ID() )
379
+			  . '<span class="ee-lock-icon"></span>'
380
+			: sprintf(
381
+				'<input type="checkbox" name="_REG_ID[]" value="%1$s" />',
382
+				$item->ID()
383
+			);
384
+	}
385 385
 
386 386
 
387 387
 
@@ -417,7 +417,7 @@  discard block
 block discarded – undo
417 417
 	 */
418 418
 	public function column__REG_date(EE_Registration $item){
419 419
 		$this->_set_related_details($item);
420
-       		 //Build row actions
420
+	   		 //Build row actions
421 421
 		$view_lnk_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'view_transaction', 'TXN_ID'=> $this->_transaction_details['id'] ), TXN_ADMIN_URL );
422 422
 		$view_link = EE_Registry::instance()->CAP->current_user_can('ee_read_transaction', 'espresso_transactions_view_transaction') ? '<a class="ee-status-color-' . $this->_transaction_details['status'] . '" href="'.$view_lnk_url.'" title="' . esc_attr( $this->_transaction_details['title_attr'] ) . '">' . $item->get_i18n_datetime( 'REG_date' ) . '</a>' : $item->get_i18n_datetime( 'REG_date' );
423 423
 		$view_link .= '<br><span class="ee-status-text-small">' . EEH_Template::pretty_status( $this->_transaction_details['status'], false, 'sentence' ) . '</span>';
@@ -471,7 +471,7 @@  discard block
 block discarded – undo
471 471
 		} else {
472 472
 			return __( 'There is no ticket on this registration', 'event_espresso' );
473 473
 		}
474
-    }
474
+	}
475 475
 
476 476
 
477 477
 
@@ -494,14 +494,14 @@  discard block
 block discarded – undo
494 494
 		$t = $item->get_first_related('Transaction');
495 495
 		$payment_count = $t instanceof EE_Transaction ? $t->count_related('Payment') : 0;
496 496
 
497
-	    //append group count to name
498
-	    $link .= '&nbsp;' . sprintf(__( '(%1$s / %2$s)', 'event_espresso' ), $item->count(), $item->group_size());
497
+		//append group count to name
498
+		$link .= '&nbsp;' . sprintf(__( '(%1$s / %2$s)', 'event_espresso' ), $item->count(), $item->group_size());
499 499
 
500
-	    //append reg_code
501
-	    $link .= '<br>' . sprintf( __( 'Reg Code: %s', 'event_espresso' ), $item->get('REG_code') );
500
+		//append reg_code
501
+		$link .= '<br>' . sprintf( __( 'Reg Code: %s', 'event_espresso' ), $item->get('REG_code') );
502 502
 
503
-	    //reg status text for accessibility
504
-	    $link .= '<br><span class="ee-status-text-small">' . EEH_Template::pretty_status( $item->status_ID(), false, 'sentence' ) . '</span>';
503
+		//reg status text for accessibility
504
+		$link .= '<br><span class="ee-status-text-small">' . EEH_Template::pretty_status( $item->status_ID(), false, 'sentence' ) . '</span>';
505 505
 
506 506
 		//trash/restore/delete actions
507 507
 		$actions = array();
@@ -731,14 +731,14 @@  discard block
 block discarded – undo
731 731
 		//message list table link (filtered by REG_ID
732 732
 		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_read_messages', 'view_filtered_messages' ) ) {
733 733
 			$filtered_messages_link = '<li>'
734
-			                          . EEH_MSG_Template::get_message_action_link(
734
+									  . EEH_MSG_Template::get_message_action_link(
735 735
 											'see_notifications_for',
736 736
 											null,
737 737
 											array(
738 738
 												'_REG_ID' => $item->ID()
739 739
 												)
740 740
 											)
741
-			                          . '</li>';
741
+									  . '</li>';
742 742
 		}
743 743
 
744 744
 		return $this->_action_string( $view_lnk . $edit_lnk . $resend_reg_lnk . $view_txn_lnk . $dl_invoice_lnk . $filtered_messages_link, $item, 'ul', 'reg-overview-actions-ul' );
Please login to merge, or discard this patch.
Spacing   +166 added lines, -166 removed lines patch added patch discarded remove patch
@@ -54,13 +54,13 @@  discard block
 block discarded – undo
54 54
 	/**
55 55
 	 * @param \Registrations_Admin_Page $admin_page
56 56
 	 */
57
-	public function __construct( Registrations_Admin_Page $admin_page ){
58
-		if ( ! empty( $_GET['event_id'] ) ) {
57
+	public function __construct(Registrations_Admin_Page $admin_page) {
58
+		if ( ! empty($_GET['event_id'])) {
59 59
 			$extra_query_args = array();
60
-			foreach ( $admin_page->get_views() as $key => $view_details ) {
61
-				$extra_query_args[$view_details['slug']] = array( 'event_id' => $_GET['event_id'] );
60
+			foreach ($admin_page->get_views() as $key => $view_details) {
61
+				$extra_query_args[$view_details['slug']] = array('event_id' => $_GET['event_id']);
62 62
 			}
63
-			$this->_views = $admin_page->get_list_table_view_RLs( $extra_query_args );
63
+			$this->_views = $admin_page->get_list_table_view_RLs($extra_query_args);
64 64
 		}
65 65
 		parent::__construct($admin_page);
66 66
 		$this->_status = $this->_admin_page->get_registration_status_array();
@@ -75,8 +75,8 @@  discard block
 block discarded – undo
75 75
 	 * @return void
76 76
 	 */
77 77
 	protected function _setup_data() {
78
-		$this->_data = $this->_admin_page->get_registrations( $this->_per_page );
79
-		$this->_all_data_count = $this->_admin_page->get_registrations( $this->_per_page, TRUE, FALSE, FALSE );
78
+		$this->_data = $this->_admin_page->get_registrations($this->_per_page);
79
+		$this->_all_data_count = $this->_admin_page->get_registrations($this->_per_page, TRUE, FALSE, FALSE);
80 80
 	}
81 81
 
82 82
 
@@ -93,30 +93,30 @@  discard block
 block discarded – undo
93 93
 			'ajax' => TRUE,
94 94
 			'screen' => $this->_admin_page->get_current_screen()->id
95 95
 			);
96
-		$ID_column_name = __( 'ID', 'event_espresso' );
96
+		$ID_column_name = __('ID', 'event_espresso');
97 97
 		$ID_column_name .= ' : <span class="show-on-mobile-view-only" style="float:none">';
98
-		$ID_column_name .= __( 'Registrant Name', 'event_espresso' );
98
+		$ID_column_name .= __('Registrant Name', 'event_espresso');
99 99
 		$ID_column_name .= '</span> ';
100
-		if ( isset( $_GET['event_id'] )) {
100
+		if (isset($_GET['event_id'])) {
101 101
 			$this->_columns = array(
102 102
 				'cb' => '<input type="checkbox" />', //Render a checkbox instead of text
103 103
 				'_REG_ID' => $ID_column_name,
104
-				'ATT_fname' => __( 'Name', 'event_espresso' ),
104
+				'ATT_fname' => __('Name', 'event_espresso'),
105 105
 				'ATT_email' =>  __('Email', 'event_espresso'),
106
-				'_REG_date' => __( 'Reg Date', 'event_espresso' ),
107
-				'PRC_amount' => __( 'TKT Price', 'event_espresso' ),
108
-				'_REG_final_price' => __( 'Final Price', 'event_espresso' ),
109
-				'TXN_total' => __( 'Total Txn', 'event_espresso' ),
106
+				'_REG_date' => __('Reg Date', 'event_espresso'),
107
+				'PRC_amount' => __('TKT Price', 'event_espresso'),
108
+				'_REG_final_price' => __('Final Price', 'event_espresso'),
109
+				'TXN_total' => __('Total Txn', 'event_espresso'),
110 110
 				'TXN_paid' => __('Paid', 'event_espresso'),
111
-				'actions' => __( 'Actions', 'event_espresso' )
111
+				'actions' => __('Actions', 'event_espresso')
112 112
 				);
113 113
 			$this->_bottom_buttons = array(
114 114
 					'report'=> array(
115 115
 					'route' => 'registrations_report',
116 116
 					'extra_request' =>
117 117
 						array(
118
-							'EVT_ID'=> isset( $this->_req_data['event_id'] ) ? $this->_req_data['event_id'] : null,
119
-							'return_url' => urlencode( "//{$_SERVER['HTTP_HOST']}{$_SERVER['REQUEST_URI']}" )
118
+							'EVT_ID'=> isset($this->_req_data['event_id']) ? $this->_req_data['event_id'] : null,
119
+							'return_url' => urlencode("//{$_SERVER['HTTP_HOST']}{$_SERVER['REQUEST_URI']}")
120 120
 						)
121 121
 				),
122 122
 			);
@@ -124,19 +124,19 @@  discard block
 block discarded – undo
124 124
 			$this->_columns = array(
125 125
 				'cb' => '<input type="checkbox" />', //Render a checkbox instead of text
126 126
 				'_REG_ID' => $ID_column_name,
127
-				'ATT_fname' => __( 'Name', 'event_espresso' ),
128
-				'_REG_date' => __( 'TXN Date', 'event_espresso' ),
129
-				'event_name' => __( 'Event', 'event_espresso' ),
130
-				'DTT_EVT_start' => __( 'Event Date', 'event_espresso' ),
131
-				'_REG_final_price' => __( 'Price', 'event_espresso' ),
132
-				'_REG_paid' => __( 'Paid', 'event_espresso' ),
133
-				'actions' => __( 'Actions', 'event_espresso' )
127
+				'ATT_fname' => __('Name', 'event_espresso'),
128
+				'_REG_date' => __('TXN Date', 'event_espresso'),
129
+				'event_name' => __('Event', 'event_espresso'),
130
+				'DTT_EVT_start' => __('Event Date', 'event_espresso'),
131
+				'_REG_final_price' => __('Price', 'event_espresso'),
132
+				'_REG_paid' => __('Paid', 'event_espresso'),
133
+				'actions' => __('Actions', 'event_espresso')
134 134
 			);
135 135
 			$this->_bottom_buttons = array(
136 136
 				'report_all'=> array(
137 137
 				'route' => 'registrations_report',
138 138
 				'extra_request' => array(
139
-					'return_url' => urlencode( "//{$_SERVER['HTTP_HOST']}{$_SERVER['REQUEST_URI']}" ) )
139
+					'return_url' => urlencode("//{$_SERVER['HTTP_HOST']}{$_SERVER['REQUEST_URI']}") )
140 140
 				),
141 141
 			);
142 142
 		}
@@ -144,11 +144,11 @@  discard block
 block discarded – undo
144 144
 		$this->_primary_column = '_REG_ID';
145 145
 
146 146
 		$this->_sortable_columns = array(
147
-			'_REG_date' => array( '_REG_date' => TRUE ),   //true means its already sorted
148
-			'ATT_fname' => array( 'ATT_fname' => FALSE ),
149
-			'event_name' => array( 'event_name' => FALSE ),
150
-			'DTT_EVT_start'	=> array( 'DTT_EVT_start' => FALSE ),
151
-			'_REG_ID' => array( '_REG_ID' => FALSE ),
147
+			'_REG_date' => array('_REG_date' => TRUE), //true means its already sorted
148
+			'ATT_fname' => array('ATT_fname' => FALSE),
149
+			'event_name' => array('event_name' => FALSE),
150
+			'DTT_EVT_start'	=> array('DTT_EVT_start' => FALSE),
151
+			'_REG_ID' => array('_REG_ID' => FALSE),
152 152
 		);
153 153
 
154 154
 		$this->_hidden_columns = array();
@@ -162,11 +162,11 @@  discard block
 block discarded – undo
162 162
 	 * @param  EE_Registration $item the current item
163 163
 	 * @return string
164 164
 	 */
165
-	protected function _get_row_class( $item ) {
166
-		$class = parent::_get_row_class( $item );
165
+	protected function _get_row_class($item) {
166
+		$class = parent::_get_row_class($item);
167 167
 		//add status class
168
-		$class .= ' ee-status-strip reg-status-' . $item->status_ID();
169
-		if ( $this->_has_checkbox_column ) {
168
+		$class .= ' ee-status-strip reg-status-'.$item->status_ID();
169
+		if ($this->_has_checkbox_column) {
170 170
 			$class .= ' has-checkbox-column';
171 171
 		}
172 172
 		return $class;
@@ -180,9 +180,9 @@  discard block
 block discarded – undo
180 180
 	 * @param EE_Registration $registration
181 181
 	 * @throws \EE_Error
182 182
 	 */
183
-	protected function _set_related_details( EE_Registration $registration ) {
183
+	protected function _set_related_details(EE_Registration $registration) {
184 184
 
185
-		$transaction = $registration->get_first_related( 'Transaction' );
185
+		$transaction = $registration->get_first_related('Transaction');
186 186
 		$status = $transaction instanceof EE_Transaction
187 187
 			? $transaction->status_ID()
188 188
 			: EEM_Transaction::failed_status_code;
@@ -191,8 +191,8 @@  discard block
 block discarded – undo
191 191
 			'status' => $status,
192 192
 			'id' => $transaction instanceof EE_Transaction ? $transaction->ID() : 0,
193 193
 			'title_attr' => sprintf(
194
-				__( 'View Transaction Details (%s)', 'event_espresso' ),
195
-				EEH_Template::pretty_status( $status, false, 'sentence' )
194
+				__('View Transaction Details (%s)', 'event_espresso'),
195
+				EEH_Template::pretty_status($status, false, 'sentence')
196 196
 			)
197 197
 		);
198 198
 
@@ -203,8 +203,8 @@  discard block
 block discarded – undo
203 203
 			'status' => $status,
204 204
 			'id' => $event instanceof EE_Event ? $event->ID() : 0,
205 205
 			'title_attr' => sprintf(
206
-				__( 'Edit Event (%s)', 'event_espresso' ),
207
-				EEH_Template::pretty_status( $status, false, 'sentence' )
206
+				__('Edit Event (%s)', 'event_espresso'),
207
+				EEH_Template::pretty_status($status, false, 'sentence')
208 208
 			)
209 209
 		);
210 210
 	}
@@ -221,30 +221,30 @@  discard block
 block discarded – undo
221 221
 
222 222
 		//todo we're currently using old functions here. We need to move things into the Events_Admin_Page() class as methods.
223 223
 
224
-		$cur_date = isset( $this->_req_data['month_range'] ) ? $this->_req_data['month_range'] : '';
225
-		$cur_category = isset( $this->_req_data['EVT_CAT'] ) ? $this->_req_data['EVT_CAT'] : -1;
226
-		$reg_status = isset( $this->_req_data['_reg_status'] ) ? $this->_req_data['_reg_status'] : '';
224
+		$cur_date = isset($this->_req_data['month_range']) ? $this->_req_data['month_range'] : '';
225
+		$cur_category = isset($this->_req_data['EVT_CAT']) ? $this->_req_data['EVT_CAT'] : -1;
226
+		$reg_status = isset($this->_req_data['_reg_status']) ? $this->_req_data['_reg_status'] : '';
227 227
 
228
-		$filters[] = EEH_Form_Fields::generate_registration_months_dropdown( $cur_date, $reg_status, $cur_category );
229
-		$filters[] = EEH_Form_Fields::generate_event_category_dropdown( $cur_category );
228
+		$filters[] = EEH_Form_Fields::generate_registration_months_dropdown($cur_date, $reg_status, $cur_category);
229
+		$filters[] = EEH_Form_Fields::generate_event_category_dropdown($cur_category);
230 230
 
231 231
 		$status = array();
232
-		$status[] = array( 'id' => 0, 'text' => __('Select Status', 'event_espresso') );
233
-		foreach ( $this->_status as $key => $value ) {
234
-			$status[] = array( 'id' => $key, 'text' => $value );
232
+		$status[] = array('id' => 0, 'text' => __('Select Status', 'event_espresso'));
233
+		foreach ($this->_status as $key => $value) {
234
+			$status[] = array('id' => $key, 'text' => $value);
235 235
 		}
236
-		if ( $this->_view !== 'incomplete' ) {
236
+		if ($this->_view !== 'incomplete') {
237 237
 			$filters[] = EEH_Form_Fields::select_input(
238 238
 				'_reg_status',
239 239
 				$status,
240
-				isset( $this->_req_data['_reg_status'] )
241
-					? strtoupper( sanitize_key( $this->_req_data['_reg_status'] ))
240
+				isset($this->_req_data['_reg_status'])
241
+					? strtoupper(sanitize_key($this->_req_data['_reg_status']))
242 242
 					: ''
243 243
 			);
244 244
 		}
245 245
 
246
-		if ( isset( $this->_req_data['event_id'] ) ) {
247
-			$filters[] = EEH_Form_Fields::hidden_input( 'event_id',  $this->_req_data['event_id'], 'reg_event_id' );
246
+		if (isset($this->_req_data['event_id'])) {
247
+			$filters[] = EEH_Form_Fields::hidden_input('event_id', $this->_req_data['event_id'], 'reg_event_id');
248 248
 		}
249 249
 
250 250
 		return $filters;
@@ -263,9 +263,9 @@  discard block
 block discarded – undo
263 263
 		$this->_views['all']['count'] = $this->_total_registrations();
264 264
 		$this->_views['month']['count'] = $this->_total_registrations_this_month();
265 265
 		$this->_views['today']['count'] = $this->_total_registrations_today();
266
-		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_delete_registrations', 'espresso_registrations_trash_registrations' ) ) {
267
-			$this->_views['incomplete']['count'] = $this->_total_registrations( 'incomplete' );
268
-			$this->_views['trash']['count'] = $this->_total_registrations( 'trash' );
266
+		if (EE_Registry::instance()->CAP->current_user_can('ee_delete_registrations', 'espresso_registrations_trash_registrations')) {
267
+			$this->_views['incomplete']['count'] = $this->_total_registrations('incomplete');
268
+			$this->_views['trash']['count'] = $this->_total_registrations('trash');
269 269
 		}
270 270
 	}
271 271
 
@@ -279,23 +279,23 @@  discard block
 block discarded – undo
279 279
 	 * @return int
280 280
 	 * @throws \EE_Error
281 281
 	 */
282
-	protected function _total_registrations( $view = '' ){
282
+	protected function _total_registrations($view = '') {
283 283
 		$_where = array();
284
-		$EVT_ID = isset( $this->_req_data['event_id'] ) ? absint( $this->_req_data['event_id'] ) : FALSE;
285
-		if( $EVT_ID ) {
284
+		$EVT_ID = isset($this->_req_data['event_id']) ? absint($this->_req_data['event_id']) : FALSE;
285
+		if ($EVT_ID) {
286 286
 			$_where['EVT_ID'] = $EVT_ID;
287 287
 		}
288
-		switch ( $view ) {
288
+		switch ($view) {
289 289
 			case 'trash' :
290
-				return EEM_Registration::instance()->count_deleted( array( $_where ));
290
+				return EEM_Registration::instance()->count_deleted(array($_where));
291 291
 				break;
292 292
 			case 'incomplete' :
293 293
 				$_where['STS_ID'] = EEM_Registration::status_id_incomplete;
294 294
 				break;
295 295
 			default :
296
-				$_where['STS_ID'] = array( '!=', EEM_Registration::status_id_incomplete );
296
+				$_where['STS_ID'] = array('!=', EEM_Registration::status_id_incomplete);
297 297
 		}
298
-		return EEM_Registration::instance()->count( array( $_where ));
298
+		return EEM_Registration::instance()->count(array($_where));
299 299
 	}
300 300
 
301 301
 
@@ -307,32 +307,32 @@  discard block
 block discarded – undo
307 307
 	 * @return int
308 308
 	 * @throws \EE_Error
309 309
 	 */
310
-	protected function _total_registrations_this_month(){
311
-		$EVT_ID = isset( $this->_req_data['event_id'] ) ? absint( $this->_req_data['event_id'] ) : FALSE;
312
-		$_where = $EVT_ID ? array( 'EVT_ID' => $EVT_ID ) : array();
310
+	protected function _total_registrations_this_month() {
311
+		$EVT_ID = isset($this->_req_data['event_id']) ? absint($this->_req_data['event_id']) : FALSE;
312
+		$_where = $EVT_ID ? array('EVT_ID' => $EVT_ID) : array();
313 313
 		$this_year_r = date('Y', current_time('timestamp'));
314 314
 		$time_start = ' 00:00:00';
315 315
 		$time_end = ' 23:59:59';
316 316
 		$this_month_r = date('m', current_time('timestamp'));
317
-		$days_this_month = date( 't', current_time('timestamp') );
317
+		$days_this_month = date('t', current_time('timestamp'));
318 318
 		//setup date query.
319 319
 		$beginning_string = EEM_Registration::instance()->convert_datetime_for_query(
320 320
 			'REG_date',
321
-			$this_year_r . '-' . $this_month_r . '-01' . ' ' . $time_start,
321
+			$this_year_r.'-'.$this_month_r.'-01'.' '.$time_start,
322 322
 			'Y-m-d H:i:s'
323 323
 		);
324 324
 		$end_string = EEM_Registration::instance()->convert_datetime_for_query(
325 325
 			'REG_date',
326
-			$this_year_r . '-' . $this_month_r . '-' . $days_this_month . ' ' . $time_end,
326
+			$this_year_r.'-'.$this_month_r.'-'.$days_this_month.' '.$time_end,
327 327
 			'Y-m-d H:i:s'
328 328
 		);
329
-		$_where['REG_date']= array('BETWEEN',
329
+		$_where['REG_date'] = array('BETWEEN',
330 330
 			array(
331 331
 				$beginning_string,
332 332
 				$end_string
333 333
 		));
334
-		$_where['STS_ID'] = array( '!=', EEM_Registration::status_id_incomplete );
335
-		return EEM_Registration::instance()->count(array( $_where ) );
334
+		$_where['STS_ID'] = array('!=', EEM_Registration::status_id_incomplete);
335
+		return EEM_Registration::instance()->count(array($_where));
336 336
 	}
337 337
 
338 338
 
@@ -344,20 +344,20 @@  discard block
 block discarded – undo
344 344
 	 * @return int
345 345
 	 * @throws \EE_Error
346 346
 	 */
347
-	protected function _total_registrations_today(){
347
+	protected function _total_registrations_today() {
348 348
 
349
-		$EVT_ID = isset( $this->_req_data['event_id'] ) ? absint( $this->_req_data['event_id'] ) : FALSE;
350
-		$_where = $EVT_ID ? array( 'EVT_ID' => $EVT_ID ) : array();
349
+		$EVT_ID = isset($this->_req_data['event_id']) ? absint($this->_req_data['event_id']) : FALSE;
350
+		$_where = $EVT_ID ? array('EVT_ID' => $EVT_ID) : array();
351 351
 		$current_date = date('Y-m-d', current_time('timestamp'));
352 352
 		$time_start = ' 00:00:00';
353 353
 		$time_end = ' 23:59:59';
354
-		$_where['REG_date']= array('BETWEEN',
354
+		$_where['REG_date'] = array('BETWEEN',
355 355
 			array(
356
-				EEM_Registration::instance()->convert_datetime_for_query( 'REG_date', $current_date . $time_start, 'Y-m-d H:i:s' ),
357
-				EEM_Registration::instance()->convert_datetime_for_query( 'REG_date', $current_date . $time_end, 'Y-m-d H:i:s' )
356
+				EEM_Registration::instance()->convert_datetime_for_query('REG_date', $current_date.$time_start, 'Y-m-d H:i:s'),
357
+				EEM_Registration::instance()->convert_datetime_for_query('REG_date', $current_date.$time_end, 'Y-m-d H:i:s')
358 358
 		));
359
-		$_where['STS_ID'] = array( '!=', EEM_Registration::status_id_incomplete );
360
-		return EEM_Registration::instance()->count(array( $_where ) );
359
+		$_where['STS_ID'] = array('!=', EEM_Registration::status_id_incomplete);
360
+		return EEM_Registration::instance()->count(array($_where));
361 361
 	}
362 362
 
363 363
 
@@ -370,12 +370,12 @@  discard block
 block discarded – undo
370 370
 	 * @return string
371 371
 	 * @throws \EE_Error
372 372
 	 */
373
-    public function column_cb($item){
373
+    public function column_cb($item) {
374 374
 	/** checkbox/lock **/
375
-	$transaction = $item->get_first_related( 'Transaction' );
376
-	$payment_count = $transaction instanceof EE_Transaction ? $transaction->count_related( 'Payment' ) : 0;
375
+	$transaction = $item->get_first_related('Transaction');
376
+	$payment_count = $transaction instanceof EE_Transaction ? $transaction->count_related('Payment') : 0;
377 377
 	    return $payment_count > 0
378
-		    ? sprintf( '<input type="checkbox" name="_REG_ID[]" value="%1$s" />', $item->ID() )
378
+		    ? sprintf('<input type="checkbox" name="_REG_ID[]" value="%1$s" />', $item->ID())
379 379
 		      . '<span class="ee-lock-icon"></span>'
380 380
 		    : sprintf(
381 381
 			    '<input type="checkbox" name="_REG_ID[]" value="%1$s" />',
@@ -393,14 +393,14 @@  discard block
 block discarded – undo
393 393
 	 * @return string
394 394
 	 * @throws \EE_Error
395 395
 	 */
396
-	public function column__REG_ID(EE_Registration $item){
396
+	public function column__REG_ID(EE_Registration $item) {
397 397
 		$attendee = $item->attendee();
398 398
 		$content = $item->ID();
399 399
 		$content .= '<div class="show-on-mobile-view-only">';
400 400
 		$content .= '<br>';
401 401
 		$content .= $attendee instanceof EE_Attendee ? $attendee->full_name() : '';
402
-		$content .= '&nbsp;' . sprintf(__( '(%1$s / %2$s)', 'event_espresso' ), $item->count(), $item->group_size());
403
-		$content .= '<br>' . sprintf( __( 'Reg Code: %s', 'event_espresso' ), $item->get('REG_code') );
402
+		$content .= '&nbsp;'.sprintf(__('(%1$s / %2$s)', 'event_espresso'), $item->count(), $item->group_size());
403
+		$content .= '<br>'.sprintf(__('Reg Code: %s', 'event_espresso'), $item->get('REG_code'));
404 404
 		$content .= '</div>';
405 405
 		return $content;
406 406
 	}
@@ -415,12 +415,12 @@  discard block
 block discarded – undo
415 415
 	 * @return string
416 416
 	 * @throws \EE_Error
417 417
 	 */
418
-	public function column__REG_date(EE_Registration $item){
418
+	public function column__REG_date(EE_Registration $item) {
419 419
 		$this->_set_related_details($item);
420 420
        		 //Build row actions
421
-		$view_lnk_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'view_transaction', 'TXN_ID'=> $this->_transaction_details['id'] ), TXN_ADMIN_URL );
422
-		$view_link = EE_Registry::instance()->CAP->current_user_can('ee_read_transaction', 'espresso_transactions_view_transaction') ? '<a class="ee-status-color-' . $this->_transaction_details['status'] . '" href="'.$view_lnk_url.'" title="' . esc_attr( $this->_transaction_details['title_attr'] ) . '">' . $item->get_i18n_datetime( 'REG_date' ) . '</a>' : $item->get_i18n_datetime( 'REG_date' );
423
-		$view_link .= '<br><span class="ee-status-text-small">' . EEH_Template::pretty_status( $this->_transaction_details['status'], false, 'sentence' ) . '</span>';
421
+		$view_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'view_transaction', 'TXN_ID'=> $this->_transaction_details['id']), TXN_ADMIN_URL);
422
+		$view_link = EE_Registry::instance()->CAP->current_user_can('ee_read_transaction', 'espresso_transactions_view_transaction') ? '<a class="ee-status-color-'.$this->_transaction_details['status'].'" href="'.$view_lnk_url.'" title="'.esc_attr($this->_transaction_details['title_attr']).'">'.$item->get_i18n_datetime('REG_date').'</a>' : $item->get_i18n_datetime('REG_date');
423
+		$view_link .= '<br><span class="ee-status-text-small">'.EEH_Template::pretty_status($this->_transaction_details['status'], false, 'sentence').'</span>';
424 424
 		return $view_link;
425 425
 	}
426 426
 
@@ -434,18 +434,18 @@  discard block
 block discarded – undo
434 434
 	 * @return string
435 435
 	 * @throws \EE_Error
436 436
 	 */
437
-	public function column_event_name(EE_Registration $item){
438
-		$this->_set_related_details( $item );
437
+	public function column_event_name(EE_Registration $item) {
438
+		$this->_set_related_details($item);
439 439
 		// page=espresso_events&action=edit_event&EVT_ID=2&edit_event_nonce=cf3a7e5b62
440
-		$edit_event_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'edit', 'post'=>$item->event_ID() ), EVENTS_ADMIN_URL );
440
+		$edit_event_url = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'edit', 'post'=>$item->event_ID()), EVENTS_ADMIN_URL);
441 441
 		$event_name = $item->event_name();
442 442
 		$event_name = $event_name ? $event_name : __("No Associated Event", 'event_espresso');
443
-		$edit_event = EE_Registry::instance()->CAP->current_user_can('ee_edit_event', 'edit_event', $item->event_ID() ) ? '<a class="ee-status-color-' . $this->_event_details['status'] . '" href="' . $edit_event_url . '" title="' . esc_attr( $this->_event_details['title_attr'] ) .'">' .  wp_trim_words( $event_name, 30, '...' ) . '</a>' : wp_trim_words( $event_name, 30, '...' ) ;
443
+		$edit_event = EE_Registry::instance()->CAP->current_user_can('ee_edit_event', 'edit_event', $item->event_ID()) ? '<a class="ee-status-color-'.$this->_event_details['status'].'" href="'.$edit_event_url.'" title="'.esc_attr($this->_event_details['title_attr']).'">'.wp_trim_words($event_name, 30, '...').'</a>' : wp_trim_words($event_name, 30, '...');
444 444
 
445
-		$edit_event_url = EE_Admin_Page::add_query_args_and_nonce( array( 'event_id'=>$item->event_ID() ), REG_ADMIN_URL );
446
-		$actions['event_filter'] = '<a href="' . $edit_event_url . '" title="' . sprintf( esc_attr__( 'Filter this list to only show registrations for %s', 'event_espresso' ), $event_name ) .'">' .  __( 'View Registrations', 'event_espresso' ) . '</a>';
445
+		$edit_event_url = EE_Admin_Page::add_query_args_and_nonce(array('event_id'=>$item->event_ID()), REG_ADMIN_URL);
446
+		$actions['event_filter'] = '<a href="'.$edit_event_url.'" title="'.sprintf(esc_attr__('Filter this list to only show registrations for %s', 'event_espresso'), $event_name).'">'.__('View Registrations', 'event_espresso').'</a>';
447 447
 
448
-		return sprintf('%1$s %2$s', $edit_event, $this->row_actions($actions) );
448
+		return sprintf('%1$s %2$s', $edit_event, $this->row_actions($actions));
449 449
 	}
450 450
 
451 451
 
@@ -458,18 +458,18 @@  discard block
 block discarded – undo
458 458
 	 * @return string
459 459
 	 * @throws \EE_Error
460 460
 	 */
461
-   	public function column_DTT_EVT_start(EE_Registration $item){
461
+   	public function column_DTT_EVT_start(EE_Registration $item) {
462 462
 		$datetime_strings = array();
463
-		$ticket = $item->ticket( TRUE );
464
-		if ( $ticket instanceof EE_Ticket ) {
463
+		$ticket = $item->ticket(TRUE);
464
+		if ($ticket instanceof EE_Ticket) {
465 465
 			$remove_defaults = array('default_where_conditions' => 'none');
466 466
 			$datetimes = $ticket->datetimes($remove_defaults);
467
-			foreach($datetimes as $datetime){
468
-				$datetime_strings[] = $datetime->get_i18n_datetime( 'DTT_EVT_start' );
467
+			foreach ($datetimes as $datetime) {
468
+				$datetime_strings[] = $datetime->get_i18n_datetime('DTT_EVT_start');
469 469
 			}
470
-			return implode("<br />",$datetime_strings);
470
+			return implode("<br />", $datetime_strings);
471 471
 		} else {
472
-			return __( 'There is no ticket on this registration', 'event_espresso' );
472
+			return __('There is no ticket on this registration', 'event_espresso');
473 473
 		}
474 474
     }
475 475
 
@@ -483,45 +483,45 @@  discard block
 block discarded – undo
483 483
 	 * @return string
484 484
 	 * @throws \EE_Error
485 485
 	 */
486
-   	public function column_ATT_fname(EE_Registration $item){
486
+   	public function column_ATT_fname(EE_Registration $item) {
487 487
    		$attendee = $item->attendee();
488 488
 
489
-		$edit_lnk_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'view_registration', '_REG_ID'=>$item->ID() ), REG_ADMIN_URL );
489
+		$edit_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'view_registration', '_REG_ID'=>$item->ID()), REG_ADMIN_URL);
490 490
 		$attendee_name = $attendee instanceof EE_Attendee ? $attendee->full_name() : '';
491
-		$link = EE_Registry::instance()->CAP->current_user_can('ee_read_registration', 'espresso_registrations_view_registration', $item->ID() ) ? '<a href="'.$edit_lnk_url.'" title="' . esc_attr__( 'View Registration Details', 'event_espresso' ) . '">' . $attendee_name . '</a>' : $attendee_name;
491
+		$link = EE_Registry::instance()->CAP->current_user_can('ee_read_registration', 'espresso_registrations_view_registration', $item->ID()) ? '<a href="'.$edit_lnk_url.'" title="'.esc_attr__('View Registration Details', 'event_espresso').'">'.$attendee_name.'</a>' : $attendee_name;
492 492
 		$link .= $item->count() === 1 ? '&nbsp;<sup><div class="dashicons dashicons-star-filled lt-blue-icon ee-icon-size-8"></div></sup>' : '';
493 493
 
494 494
 		$t = $item->get_first_related('Transaction');
495 495
 		$payment_count = $t instanceof EE_Transaction ? $t->count_related('Payment') : 0;
496 496
 
497 497
 	    //append group count to name
498
-	    $link .= '&nbsp;' . sprintf(__( '(%1$s / %2$s)', 'event_espresso' ), $item->count(), $item->group_size());
498
+	    $link .= '&nbsp;'.sprintf(__('(%1$s / %2$s)', 'event_espresso'), $item->count(), $item->group_size());
499 499
 
500 500
 	    //append reg_code
501
-	    $link .= '<br>' . sprintf( __( 'Reg Code: %s', 'event_espresso' ), $item->get('REG_code') );
501
+	    $link .= '<br>'.sprintf(__('Reg Code: %s', 'event_espresso'), $item->get('REG_code'));
502 502
 
503 503
 	    //reg status text for accessibility
504
-	    $link .= '<br><span class="ee-status-text-small">' . EEH_Template::pretty_status( $item->status_ID(), false, 'sentence' ) . '</span>';
504
+	    $link .= '<br><span class="ee-status-text-small">'.EEH_Template::pretty_status($item->status_ID(), false, 'sentence').'</span>';
505 505
 
506 506
 		//trash/restore/delete actions
507 507
 		$actions = array();
508
-		if ( $this->_view !== 'trash' && $payment_count === 0 && EE_Registry::instance()->CAP->current_user_can( 'ee_delete_registration', 'espresso_registrations_trash_registrations', $item->ID() ) ) {
509
-			$trash_lnk_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'trash_registrations', '_REG_ID'=>$item->ID() ), REG_ADMIN_URL );
510
-			$actions['trash'] = '<a href="'.$trash_lnk_url.'" title="' . esc_attr__( 'Trash Registration', 'event_espresso' ) . '">' . __( 'Trash', 'event_espresso' ) . '</a>';
511
-		} elseif ( $this->_view === 'trash' ) {
508
+		if ($this->_view !== 'trash' && $payment_count === 0 && EE_Registry::instance()->CAP->current_user_can('ee_delete_registration', 'espresso_registrations_trash_registrations', $item->ID())) {
509
+			$trash_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'trash_registrations', '_REG_ID'=>$item->ID()), REG_ADMIN_URL);
510
+			$actions['trash'] = '<a href="'.$trash_lnk_url.'" title="'.esc_attr__('Trash Registration', 'event_espresso').'">'.__('Trash', 'event_espresso').'</a>';
511
+		} elseif ($this->_view === 'trash') {
512 512
 			// restore registration link
513
-			if ( EE_Registry::instance()->CAP->current_user_can( 'ee_delete_registration', 'espresso_registrations_restore_registrations', $item->ID() ) ) {
514
-				$restore_lnk_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'restore_registrations', '_REG_ID'=>$item->ID() ), REG_ADMIN_URL );
515
-				$actions['restore'] = '<a href="'.$restore_lnk_url.'" title="' . esc_attr__( 'Restore Registration', 'event_espresso' ) . '">' . __( 'Restore', 'event_espresso' ) . '</a>';
513
+			if (EE_Registry::instance()->CAP->current_user_can('ee_delete_registration', 'espresso_registrations_restore_registrations', $item->ID())) {
514
+				$restore_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'restore_registrations', '_REG_ID'=>$item->ID()), REG_ADMIN_URL);
515
+				$actions['restore'] = '<a href="'.$restore_lnk_url.'" title="'.esc_attr__('Restore Registration', 'event_espresso').'">'.__('Restore', 'event_espresso').'</a>';
516 516
 			}
517
-			if ( EE_Registry::instance()->CAP->current_user_can( 'ee_delete_registration', 'espresso_registrations_ee_delete_registrations', $item->ID() ) ) {
518
-				$delete_lnk_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'delete_registrations', '_REG_ID'=>$item->ID() ), REG_ADMIN_URL );
517
+			if (EE_Registry::instance()->CAP->current_user_can('ee_delete_registration', 'espresso_registrations_ee_delete_registrations', $item->ID())) {
518
+				$delete_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'delete_registrations', '_REG_ID'=>$item->ID()), REG_ADMIN_URL);
519 519
 
520
-				$actions['delete'] = '<a href="'.$delete_lnk_url.'" title="' . esc_attr__( 'Delete Registration Permanently', 'event_espresso' ). '">' . __( 'Delete', 'event_espresso' ) . '</a>';
520
+				$actions['delete'] = '<a href="'.$delete_lnk_url.'" title="'.esc_attr__('Delete Registration Permanently', 'event_espresso').'">'.__('Delete', 'event_espresso').'</a>';
521 521
 			}
522 522
 		}
523 523
 
524
-		return sprintf('%1$s %2$s', $link, $this->row_actions($actions) );
524
+		return sprintf('%1$s %2$s', $link, $this->row_actions($actions));
525 525
 	}
526 526
 
527 527
 
@@ -534,7 +534,7 @@  discard block
 block discarded – undo
534 534
 	 * @return string
535 535
 	 * @throws \EE_Error
536 536
 	 */
537
-	public function column_ATT_email( EE_Registration $item ) {
537
+	public function column_ATT_email(EE_Registration $item) {
538 538
 		$attendee = $item->get_first_related('Attendee');
539 539
 		return ! $attendee instanceof EE_Attendee ? __('No attached contact record.', 'event_espresso') : $attendee->email();
540 540
 	}
@@ -548,8 +548,8 @@  discard block
 block discarded – undo
548 548
 	 * @param \EE_Registration $item
549 549
 	 * @return string
550 550
 	 */
551
-	public function column__REG_count(EE_Registration $item){
552
-		return  sprintf(__( '%1$s / %2$s', 'event_espresso' ), $item->count(), $item->group_size());
551
+	public function column__REG_count(EE_Registration $item) {
552
+		return  sprintf(__('%1$s / %2$s', 'event_espresso'), $item->count(), $item->group_size());
553 553
 	}
554 554
 
555 555
 
@@ -561,16 +561,16 @@  discard block
 block discarded – undo
561 561
 	 * @param \EE_Registration $item
562 562
 	 * @return string
563 563
 	 */
564
-	public function column_PRC_amount(EE_Registration $item){
564
+	public function column_PRC_amount(EE_Registration $item) {
565 565
 		$ticket = $item->ticket();
566 566
 
567
-		$content = isset( $_GET['event_id'] ) && $ticket instanceof EE_Ticket ? '<span class="TKT_name">' . $ticket->name() . '</span><br />' : '';
567
+		$content = isset($_GET['event_id']) && $ticket instanceof EE_Ticket ? '<span class="TKT_name">'.$ticket->name().'</span><br />' : '';
568 568
 
569
-		if ( $item->final_price() > 0 ) {
570
-			$content .= '<span class="reg-pad-rght">' . $item->pretty_final_price() . '</span>';
569
+		if ($item->final_price() > 0) {
570
+			$content .= '<span class="reg-pad-rght">'.$item->pretty_final_price().'</span>';
571 571
 		} else {
572 572
 			// free event
573
-			$content .= '<span class="reg-overview-free-event-spn reg-pad-rght">' . __( 'free', 'event_espresso' ) . '</span>';
573
+			$content .= '<span class="reg-overview-free-event-spn reg-pad-rght">'.__('free', 'event_espresso').'</span>';
574 574
 		}
575 575
 
576 576
 		return $content;
@@ -586,11 +586,11 @@  discard block
 block discarded – undo
586 586
 	 * @param \EE_Registration $item
587 587
 	 * @return string
588 588
 	 */
589
-	public function column__REG_final_price(EE_Registration $item){
589
+	public function column__REG_final_price(EE_Registration $item) {
590 590
 		$ticket = $item->ticket();
591
-		$content = isset( $_GET['event_id'] ) || ! $ticket instanceof EE_Ticket ? '' : '<span class="TKT_name">' . $ticket->name() . '</span><br />';
591
+		$content = isset($_GET['event_id']) || ! $ticket instanceof EE_Ticket ? '' : '<span class="TKT_name">'.$ticket->name().'</span><br />';
592 592
 
593
-		$content .= '<span class="reg-pad-rght">' .  $item->pretty_final_price() . '</span>';
593
+		$content .= '<span class="reg-pad-rght">'.$item->pretty_final_price().'</span>';
594 594
 		return $content;
595 595
 
596 596
 	}
@@ -604,13 +604,13 @@  discard block
 block discarded – undo
604 604
 	 * @param \EE_Registration $item
605 605
 	 * @return string
606 606
 	 */
607
-	public function column__REG_paid(EE_Registration $item){
607
+	public function column__REG_paid(EE_Registration $item) {
608 608
 		$payment_method = $item->payment_method();
609
-		$payment_method_name = $payment_method instanceof EE_Payment_Method ? $payment_method->admin_name() : __( 'Unknown', 'event_espresso' );
609
+		$payment_method_name = $payment_method instanceof EE_Payment_Method ? $payment_method->admin_name() : __('Unknown', 'event_espresso');
610 610
 
611
-		$content = '<span class="reg-pad-rght">' .  $item->pretty_paid() . '</span>';
612
-		if ( $item->paid() > 0 ) {
613
-			$content .= '<br><span class="ee-status-text-small">' . sprintf( __( '...via %s', 'event_espresso' ), $payment_method_name ) . '</span>';
611
+		$content = '<span class="reg-pad-rght">'.$item->pretty_paid().'</span>';
612
+		if ($item->paid() > 0) {
613
+			$content .= '<br><span class="ee-status-text-small">'.sprintf(__('...via %s', 'event_espresso'), $payment_method_name).'</span>';
614 614
 		}
615 615
 		return $content;
616 616
 	}
@@ -625,11 +625,11 @@  discard block
 block discarded – undo
625 625
 	 * @return string
626 626
 	 * @throws \EE_Error
627 627
 	 */
628
-	public function column_TXN_total(EE_Registration $item){
629
-		if($item->transaction()){
630
-			$view_txn_lnk_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'view_transaction', 'TXN_ID'=>$item->transaction_ID() ), TXN_ADMIN_URL );
631
-			return EE_Registry::instance()->CAP->current_user_can( 'ee_read_transaction', 'espresso_transactions_view_transaction', $item->transaction_ID() ) ? '<span class="reg-pad-rght"><a class="status-'. $item->transaction()->status_ID() .'" href="'.$view_txn_lnk_url.'"  title="' . esc_attr__( 'View Transaction', 'event_espresso' ) . '">'  . $item->transaction()->pretty_total() . '</a></span>' : '<span class="reg-pad-rght">' . $item->transaction()->pretty_total() . '</span>';
632
-		}else{
628
+	public function column_TXN_total(EE_Registration $item) {
629
+		if ($item->transaction()) {
630
+			$view_txn_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'view_transaction', 'TXN_ID'=>$item->transaction_ID()), TXN_ADMIN_URL);
631
+			return EE_Registry::instance()->CAP->current_user_can('ee_read_transaction', 'espresso_transactions_view_transaction', $item->transaction_ID()) ? '<span class="reg-pad-rght"><a class="status-'.$item->transaction()->status_ID().'" href="'.$view_txn_lnk_url.'"  title="'.esc_attr__('View Transaction', 'event_espresso').'">'.$item->transaction()->pretty_total().'</a></span>' : '<span class="reg-pad-rght">'.$item->transaction()->pretty_total().'</span>';
632
+		} else {
633 633
 			return __("None", "event_espresso");
634 634
 		}
635 635
 	}
@@ -644,15 +644,15 @@  discard block
 block discarded – undo
644 644
 	 * @return string
645 645
 	 * @throws \EE_Error
646 646
 	 */
647
-	public function column_TXN_paid(EE_Registration $item){
647
+	public function column_TXN_paid(EE_Registration $item) {
648 648
 
649
-		if ( $item->count() === 1 ) {
649
+		if ($item->count() === 1) {
650 650
 			$transaction = $item->transaction() ? $item->transaction() : EE_Transaction::new_instance();
651
-			if ( $transaction->paid() >= $transaction->total() ) {
651
+			if ($transaction->paid() >= $transaction->total()) {
652 652
 				return '<span class="reg-pad-rght"><div class="dashicons dashicons-yes green-icon"></div></span>';
653 653
 			} else {
654
-				$view_txn_lnk_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'view_transaction', 'TXN_ID'=>$item->transaction_ID() ), TXN_ADMIN_URL );
655
-				return EE_Registry::instance()->CAP->current_user_can('ee_read_transaction', 'espresso_transactions_view_transaction', $item->transaction_ID() ) ? '<span class="reg-pad-rght"><a class="status-'. $transaction->status_ID() .'" href="'.$view_txn_lnk_url.'"  title="' . esc_attr__( 'View Transaction', 'event_espresso' ) . '">' . $item->transaction()->pretty_paid() . '</a><span>' : '<span class="reg-pad-rght">' . $item->transaction()->pretty_paid() . '</span>';
654
+				$view_txn_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'view_transaction', 'TXN_ID'=>$item->transaction_ID()), TXN_ADMIN_URL);
655
+				return EE_Registry::instance()->CAP->current_user_can('ee_read_transaction', 'espresso_transactions_view_transaction', $item->transaction_ID()) ? '<span class="reg-pad-rght"><a class="status-'.$transaction->status_ID().'" href="'.$view_txn_lnk_url.'"  title="'.esc_attr__('View Transaction', 'event_espresso').'">'.$item->transaction()->pretty_paid().'</a><span>' : '<span class="reg-pad-rght">'.$item->transaction()->pretty_paid().'</span>';
656 656
 			}
657 657
 		}
658 658
 
@@ -672,44 +672,44 @@  discard block
 block discarded – undo
672 672
 	 */
673 673
 	public function column_actions(EE_Registration $item) {
674 674
 		$attendee = $item->attendee();
675
-		$this->_set_related_details( $item );
675
+		$this->_set_related_details($item);
676 676
 
677 677
 		//Build row actions
678
-		$view_lnk_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'view_registration', '_REG_ID'=>$item->ID() ), REG_ADMIN_URL );
679
-		$edit_lnk_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'edit_attendee', 'post'=>$item->attendee_ID() ), REG_ADMIN_URL );
678
+		$view_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'view_registration', '_REG_ID'=>$item->ID()), REG_ADMIN_URL);
679
+		$edit_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'edit_attendee', 'post'=>$item->attendee_ID()), REG_ADMIN_URL);
680 680
 
681 681
 		// page=attendees&event_admin_reports=resend_email&registration_id=43653465634&event_id=2&form_action=resend_email
682 682
 		//$resend_reg_lnk_url_params = array( 'action'=>'resend_registration', '_REG_ID'=>$item->REG_ID );
683
-		$resend_reg_lnk_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'resend_registration', '_REG_ID'=>$item->ID() ), REG_ADMIN_URL, true );
683
+		$resend_reg_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'resend_registration', '_REG_ID'=>$item->ID()), REG_ADMIN_URL, true);
684 684
 
685 685
 
686 686
 		//Build row actions
687
-		$view_lnk = EE_Registry::instance()->CAP->current_user_can('ee_read_registration', 'espresso_registrations_view_registration', $item->ID() ) ? '
687
+		$view_lnk = EE_Registry::instance()->CAP->current_user_can('ee_read_registration', 'espresso_registrations_view_registration', $item->ID()) ? '
688 688
 			<li>
689
-			<a href="'.$view_lnk_url.'" title="' . esc_attr__( 'View Registration Details', 'event_espresso' ) . '" class="tiny-text">
689
+			<a href="'.$view_lnk_url.'" title="'.esc_attr__('View Registration Details', 'event_espresso').'" class="tiny-text">
690 690
 				<div class="dashicons dashicons-clipboard"></div>
691 691
 			</a>
692 692
 			</li>' : '';
693 693
 
694
-		$edit_lnk = EE_Registry::instance()->CAP->current_user_can('ee_edit_contacts', 'espresso_registrations_edit_attendee' ) &&  $attendee instanceof EE_Attendee ?'
694
+		$edit_lnk = EE_Registry::instance()->CAP->current_user_can('ee_edit_contacts', 'espresso_registrations_edit_attendee') && $attendee instanceof EE_Attendee ? '
695 695
 			<li>
696
-			<a href="'.$edit_lnk_url.'" title="' . esc_attr__( 'Edit Contact Details', 'event_espresso' ) . '" class="tiny-text">
696
+			<a href="'.$edit_lnk_url.'" title="'.esc_attr__('Edit Contact Details', 'event_espresso').'" class="tiny-text">
697 697
 				<div class="ee-icon ee-icon-user-edit ee-icon-size-16"></div>
698 698
 			</a>
699 699
 			</li>' : '';
700 700
 
701
-		 $resend_reg_lnk = $attendee instanceof EE_Attendee && EE_Registry::instance()->CAP->current_user_can( 'ee_send_message', 'espresso_registrations_resend_registration', $item->ID() ) ? '
701
+		 $resend_reg_lnk = $attendee instanceof EE_Attendee && EE_Registry::instance()->CAP->current_user_can('ee_send_message', 'espresso_registrations_resend_registration', $item->ID()) ? '
702 702
 			<li>
703
-			<a href="'.$resend_reg_lnk_url.'" title="' . esc_attr__( 'Resend Registration Details', 'event_espresso' ) . '" class="tiny-text">
703
+			<a href="'.$resend_reg_lnk_url.'" title="'.esc_attr__('Resend Registration Details', 'event_espresso').'" class="tiny-text">
704 704
 				<div class="dashicons dashicons-email-alt"></div>
705 705
 			</a>
706 706
 			</li>' : '';
707 707
 
708 708
 		// page=transactions&action=view_transaction&txn=256&_wpnonce=6414da4dbb
709
-		$view_txn_lnk_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'view_transaction', 'TXN_ID'=>$this->_transaction_details['id'] ), TXN_ADMIN_URL );
710
-		$view_txn_lnk = EE_Registry::instance()->CAP->current_user_can( 'ee_read_transaction', 'espresso_transactions_view_transaction', $this->_transaction_details['id'] ) ? '
709
+		$view_txn_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'view_transaction', 'TXN_ID'=>$this->_transaction_details['id']), TXN_ADMIN_URL);
710
+		$view_txn_lnk = EE_Registry::instance()->CAP->current_user_can('ee_read_transaction', 'espresso_transactions_view_transaction', $this->_transaction_details['id']) ? '
711 711
 			<li>
712
-			<a class="ee-status-color-' . $this->_transaction_details['status'] . ' tiny-text" href="'.$view_txn_lnk_url.'"  title="' . $this->_transaction_details['title_attr'] . '">
712
+			<a class="ee-status-color-' . $this->_transaction_details['status'].' tiny-text" href="'.$view_txn_lnk_url.'"  title="'.$this->_transaction_details['title_attr'].'">
713 713
 				<div class="dashicons dashicons-cart"></div>
714 714
 			</a>
715 715
 			</li>' : '';
@@ -718,10 +718,10 @@  discard block
 block discarded – undo
718 718
 		$dl_invoice_lnk = '';
719 719
 		$dl_invoice_lnk_url = $item->invoice_url();
720 720
 		//only show invoice link if message type is active.
721
-		if ( $attendee instanceof EE_Attendee && $item->is_primary_registrant() && EEH_MSG_Template::is_mt_active( 'invoice' ) ) {
721
+		if ($attendee instanceof EE_Attendee && $item->is_primary_registrant() && EEH_MSG_Template::is_mt_active('invoice')) {
722 722
 			$dl_invoice_lnk = '
723 723
 		<li>
724
-			<a title="' . esc_attr__( 'View Transaction Invoice', 'event_espresso' ) . '" target="_blank" href="'.$dl_invoice_lnk_url.'" class="tiny-text">
724
+			<a title="' . esc_attr__('View Transaction Invoice', 'event_espresso').'" target="_blank" href="'.$dl_invoice_lnk_url.'" class="tiny-text">
725 725
 				<span class="dashicons dashicons-media-spreadsheet ee-icon-size-18"></span>
726 726
 			</a>
727 727
 		</li>';
@@ -729,7 +729,7 @@  discard block
 block discarded – undo
729 729
 
730 730
 		$filtered_messages_link = '';
731 731
 		//message list table link (filtered by REG_ID
732
-		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_read_global_messages', 'view_filtered_messages' ) ) {
732
+		if (EE_Registry::instance()->CAP->current_user_can('ee_read_global_messages', 'view_filtered_messages')) {
733 733
 			$filtered_messages_link = '<li>'
734 734
 			                          . EEH_MSG_Template::get_message_action_link(
735 735
 											'see_notifications_for',
@@ -741,7 +741,7 @@  discard block
 block discarded – undo
741 741
 			                          . '</li>';
742 742
 		}
743 743
 
744
-		return $this->_action_string( $view_lnk . $edit_lnk . $resend_reg_lnk . $view_txn_lnk . $dl_invoice_lnk . $filtered_messages_link, $item, 'ul', 'reg-overview-actions-ul' );
744
+		return $this->_action_string($view_lnk.$edit_lnk.$resend_reg_lnk.$view_txn_lnk.$dl_invoice_lnk.$filtered_messages_link, $item, 'ul', 'reg-overview-actions-ul');
745 745
 	}
746 746
 
747 747
 }
Please login to merge, or discard this patch.
templates/attendee_address_details_metabox_content.template.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@
 block discarded – undo
1 1
 <?php
2
-EEH_Template_Validator::verify_instanceof( $attendee, '$attendee', 'EE_Attendee');
2
+EEH_Template_Validator::verify_instanceof($attendee, '$attendee', 'EE_Attendee');
3 3
 /**
4 4
  * @var $attendee - instance of EE_Attendee
5 5
  */
Please login to merge, or discard this patch.