Completed
Branch FET/11271/create-CapabilitiesA... (42e28d)
by
unknown
43:42 queued 28:57
created
public/Espresso_Arabica_2014/content-espresso_venues-thumbnail.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1,11 +1,11 @@  discard block
 block discarded – undo
1 1
 <?php //echo '<h1>' . __FILE__ . '</h1>'; ?>
2 2
 <?php global $post; ?>
3
-<?php do_action( 'AHEE__content_espresso_venues_template__before_featured_img', $post ); ?>	
3
+<?php do_action('AHEE__content_espresso_venues_template__before_featured_img', $post); ?>	
4 4
 <?php				
5
-if ( has_post_thumbnail( $post->ID )) :
6
-	if ( $img_ID = get_post_thumbnail_id( $post->ID )) :
7
-		if ( $featured_img = wp_get_attachment_image_src( $img_ID, 'large' )) :
8
-			$caption = esc_attr( get_post( get_post( $img_ID ))->post_excerpt );
5
+if (has_post_thumbnail($post->ID)) :
6
+	if ($img_ID = get_post_thumbnail_id($post->ID)) :
7
+		if ($featured_img = wp_get_attachment_image_src($img_ID, 'large')) :
8
+			$caption = esc_attr(get_post(get_post($img_ID))->post_excerpt);
9 9
 			$wrap_class .= ' has-img';
10 10
 			?>
11 11
 <div id="ee-venue-img-dv-<?php echo $post->ID; ?>" class="ee-venue-img-dv">
@@ -18,5 +18,5 @@  discard block
 block discarded – undo
18 18
 	endif;
19 19
 endif;
20 20
 ?>		
21
-<?php do_action( 'AHEE__content_espresso_venues_template__after_featured_img', $post );?>
21
+<?php do_action('AHEE__content_espresso_venues_template__after_featured_img', $post); ?>
22 22
 <!-- .venue-content -->
Please login to merge, or discard this patch.
public/Espresso_Arabica_2014/content-espresso_venues.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -11,41 +11,41 @@
 block discarded – undo
11 11
  */
12 12
 
13 13
 global $post;
14
-$wrap_class = has_excerpt( $post->ID ) ? ' has-excerpt' : '';
14
+$wrap_class = has_excerpt($post->ID) ? ' has-excerpt' : '';
15 15
 ?>
16
-<?php do_action( 'AHEE__content_espresso_venues_template__before_post', $post ); ?>
17
-<article id="post-<?php the_ID(); ?>" <?php post_class( 'espresso-venue-details entry-content ' . $wrap_class ); ?>>
16
+<?php do_action('AHEE__content_espresso_venues_template__before_post', $post); ?>
17
+<article id="post-<?php the_ID(); ?>" <?php post_class('espresso-venue-details entry-content '.$wrap_class); ?>>
18 18
 
19
-<?php if ( is_single() ) : ?>
19
+<?php if (is_single()) : ?>
20 20
 
21
-	<div id="espresso-venue-header-dv-<?php echo $post->ID;?>" class="espresso-venue-header-dv">
22
-		<?php espresso_get_template_part( 'content', 'espresso_venues-thumbnail' ); ?>
23
-		<?php espresso_get_template_part( 'content', 'espresso_venues-header' ); ?>
21
+	<div id="espresso-venue-header-dv-<?php echo $post->ID; ?>" class="espresso-venue-header-dv">
22
+		<?php espresso_get_template_part('content', 'espresso_venues-thumbnail'); ?>
23
+		<?php espresso_get_template_part('content', 'espresso_venues-header'); ?>
24 24
 	</div>
25 25
 
26 26
 	<div class="espresso-venue-wrapper-dv">
27
-		<?php espresso_get_template_part( 'content', 'espresso_venues-details' ); ?>
28
-		<?php espresso_get_template_part( 'content', 'espresso_venues-location' ); ?>
27
+		<?php espresso_get_template_part('content', 'espresso_venues-details'); ?>
28
+		<?php espresso_get_template_part('content', 'espresso_venues-location'); ?>
29 29
 		<footer class="venue-meta">
30
-			<?php do_action( 'AHEE__content_espresso_venues_template__footer_top', $post ); ?>
31
-			<?php do_action( 'AHEE__content_espresso_venues_template__footer_bottom', $post ); ?>
30
+			<?php do_action('AHEE__content_espresso_venues_template__footer_top', $post); ?>
31
+			<?php do_action('AHEE__content_espresso_venues_template__footer_bottom', $post); ?>
32 32
 		</footer>
33 33
 	</div>
34 34
 
35
-<?php elseif ( is_archive() ) : ?>
35
+<?php elseif (is_archive()) : ?>
36 36
 
37
-	<div id="espresso-venue-header-dv-<?php echo $post->ID;?>" class="espresso-venue-header-dv">
38
-		<?php espresso_get_template_part( 'content', 'espresso_venues-thumbnail' ); ?>
39
-		<?php espresso_get_template_part( 'content', 'espresso_venues-header' ); ?>
37
+	<div id="espresso-venue-header-dv-<?php echo $post->ID; ?>" class="espresso-venue-header-dv">
38
+		<?php espresso_get_template_part('content', 'espresso_venues-thumbnail'); ?>
39
+		<?php espresso_get_template_part('content', 'espresso_venues-header'); ?>
40 40
 	</div>
41 41
 
42 42
 	<div class="espresso-venue-wrapper-dv">
43
-		<?php espresso_get_template_part( 'content', 'espresso_venues-details' ); ?>
43
+		<?php espresso_get_template_part('content', 'espresso_venues-details'); ?>
44 44
 	</div>
45 45
 
46 46
 <?php endif; ?>
47 47
 
48 48
 </article>
49 49
 <!-- #post -->
50
-<?php do_action( 'AHEE__content_espresso_venues_template__after_post', $post );
50
+<?php do_action('AHEE__content_espresso_venues_template__after_post', $post);
51 51
 
Please login to merge, or discard this patch.
public/Espresso_Arabica_2014/loop-espresso_venues.php 2 patches
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -10,30 +10,30 @@
 block discarded – undo
10 10
  * @ version		4+
11 11
  */
12 12
 
13
-if ( have_posts() ) : ?>
13
+if (have_posts()) : ?>
14 14
 
15 15
 	<header class="page-header">
16 16
 		<h1 class="page-title">
17
-			<?php echo __( 'Event Venues', 'event_espresso' ); ?>
17
+			<?php echo __('Event Venues', 'event_espresso'); ?>
18 18
 		</h1>
19 19
 	</header><!-- .page-header -->
20 20
 	
21 21
 <?php 
22 22
 	// allow other stuff
23
-	do_action( 'AHEE__archive_espresso_venues_template__before_loop' ); 
23
+	do_action('AHEE__archive_espresso_venues_template__before_loop'); 
24 24
 	// Start the Loop.
25
-	while ( have_posts() ) : the_post();
25
+	while (have_posts()) : the_post();
26 26
 		// Include the post TYPE-specific template for the content.
27
-		espresso_get_template_part( 'content', 'espresso_venues' );
27
+		espresso_get_template_part('content', 'espresso_venues');
28 28
 	endwhile;
29 29
 	// Previous/next page navigation.
30 30
 	espresso_pagination();
31 31
 	// allow moar other stuff
32
-	do_action( 'AHEE__archive_espresso_venues_template__after_loop' ); 
32
+	do_action('AHEE__archive_espresso_venues_template__after_loop'); 
33 33
 
34 34
 
35 35
 else :
36 36
 	// If no content, include the "No posts found" template.
37
-	espresso_get_template_part( 'content', 'none' );
37
+	espresso_get_template_part('content', 'none');
38 38
 	
39 39
 endif;
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -32,8 +32,10 @@
 block discarded – undo
32 32
 	do_action( 'AHEE__archive_espresso_venues_template__after_loop' ); 
33 33
 
34 34
 
35
-else :
35
+else {
36
+	:
36 37
 	// If no content, include the "No posts found" template.
37 38
 	espresso_get_template_part( 'content', 'none' );
39
+}
38 40
 	
39 41
 endif;
Please login to merge, or discard this patch.
public/Espresso_Arabica_2014/single-espresso_venues.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -18,11 +18,11 @@  discard block
 block discarded – undo
18 18
 				<div id="espresso-venue-details-dv" class="" >				
19 19
 			<?php
20 20
 				// Start the Loop.
21
-				while ( have_posts() ) : the_post();
21
+				while (have_posts()) : the_post();
22 22
 					//  Include the post TYPE-specific template for the content.
23
-					espresso_get_template_part( 'content', 'espresso_venues' );
23
+					espresso_get_template_part('content', 'espresso_venues');
24 24
 					// If comments are open or we have at least one comment, load up the comment template.
25
-					if ( comments_open() || get_comments_number() ) {
25
+					if (comments_open() || get_comments_number()) {
26 26
 						comments_template();
27 27
 					}
28 28
 				endwhile;
@@ -34,6 +34,6 @@  discard block
 block discarded – undo
34 34
 	</div><!-- #primary -->
35 35
 
36 36
 <?php
37
-get_sidebar( 'content' );
37
+get_sidebar('content');
38 38
 get_sidebar();
39 39
 get_footer();
40 40
\ No newline at end of file
Please login to merge, or discard this patch.
espresso_event_attendees/EES_Espresso_Event_Attendees.shortcode.php 3 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 Attendees shortcode class
4 6
  *
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
 	 * @param       WP $WP
19 19
 	 * @return    void
20 20
 	 */
21
-	public function run( WP $WP ) {}
21
+	public function run(WP $WP) {}
22 22
 
23 23
 
24 24
 	/**
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
      * @return string
48 48
      * @throws \EE_Error
49 49
      */
50
-	public function process_shortcode( $attributes = array() ) {
50
+	public function process_shortcode($attributes = array()) {
51 51
         \EE_Error::doing_it_wrong(
52 52
             __METHOD__,
53 53
             __(
Please login to merge, or discard this patch.
Indentation   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -41,22 +41,22 @@
 block discarded – undo
41 41
 
42 42
 
43 43
 
44
-    /**
45
-     * @deprecated 4.9.27
46
-     * @param array $attributes
47
-     * @return string
48
-     * @throws \EE_Error
49
-     */
44
+	/**
45
+	 * @deprecated 4.9.27
46
+	 * @param array $attributes
47
+	 * @return string
48
+	 * @throws \EE_Error
49
+	 */
50 50
 	public function process_shortcode( $attributes = array() ) {
51
-        \EE_Error::doing_it_wrong(
52
-            __METHOD__,
53
-            __(
54
-                'Usage is deprecated. Please use \EventEspresso\core\domain\entities\shortcodes\EspressoEventAttendeesShortcode instead.',
55
-                'event_espresso'
56
-            ),
57
-            '4.9.27'
58
-        );
59
-        return '';
51
+		\EE_Error::doing_it_wrong(
52
+			__METHOD__,
53
+			__(
54
+				'Usage is deprecated. Please use \EventEspresso\core\domain\entities\shortcodes\EspressoEventAttendeesShortcode instead.',
55
+				'event_espresso'
56
+			),
57
+			'4.9.27'
58
+		);
59
+		return '';
60 60
 	}
61 61
 
62 62
 
Please login to merge, or discard this patch.
espresso_thank_you/templates/thank-you-page-payment-details.template.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -1,30 +1,30 @@  discard block
 block discarded – undo
1 1
 <h2 class="section-heading display-box-heading">
2 2
 	<?php _e('Payment Overview', 'event_espresso'); ?>
3 3
 </h2>
4
-<?php  do_action( 'AHEE__thank_you_page_payment_details_template__after_heading' ); ?>
4
+<?php  do_action('AHEE__thank_you_page_payment_details_template__after_heading'); ?>
5 5
 
6 6
 <div id="espresso-thank-you-page-payment-details-dv">
7
-<?php if ( ! empty( $payments )){	 ?>
7
+<?php if ( ! empty($payments)) {	 ?>
8 8
 	<table class="ee-table">
9 9
 		<thead>
10 10
 			<tr>
11 11
 				<th width="35%" class="jst-left">
12
-					<?php _e('Payment Date','event_espresso')?>
12
+					<?php _e('Payment Date', 'event_espresso')?>
13 13
 				</th>
14 14
 				<th width="17.5%" class="jst-left">
15
-					<?php _e('Type','event_espresso');?>
15
+					<?php _e('Type', 'event_espresso'); ?>
16 16
 				</th>
17 17
 				<th width="17.5%" class="jst-rght">
18
-					<?php _e('Amount','event_espresso');?>
18
+					<?php _e('Amount', 'event_espresso'); ?>
19 19
 				</th>
20 20
 				<th width="30%" class="jst-rght">
21
-					<?php _e('Status','event_espresso');?>
21
+					<?php _e('Status', 'event_espresso'); ?>
22 22
 				</th>
23 23
 			</tr>
24 24
 		</thead>
25 25
 		<tbody>
26 26
 		<?php
27
-			foreach ( $payments as $payment ) {
27
+			foreach ($payments as $payment) {
28 28
 				echo $payment;
29 29
 			}
30 30
 		?>
@@ -33,38 +33,38 @@  discard block
 block discarded – undo
33 33
 <?php
34 34
 	} else {
35 35
 
36
-		if ( $transaction->total() ){
36
+		if ($transaction->total()) {
37 37
 
38 38
 			echo apply_filters(
39 39
 				'FHEE__payment_overview_template__no_payments_made',
40
-				sprintf (
41
-					__('%sNo payments towards this transaction have been received.%s', 'event_espresso' ),
40
+				sprintf(
41
+					__('%sNo payments towards this transaction have been received.%s', 'event_espresso'),
42 42
 					'<p class="important-notice">',
43 43
 					'</p>'
44 44
 				)
45 45
 			);
46
-			do_action( 'AHEE__thank_you_page_payment_details_template__no_payments_made', $transaction );
46
+			do_action('AHEE__thank_you_page_payment_details_template__no_payments_made', $transaction);
47 47
 
48 48
 		} else {
49 49
 
50 50
 			echo apply_filters(
51 51
 				'FHEE__payment_overview_template__no_payment_required',
52
-				sprintf (
53
-					__('%sNo payment is required for this transaction.%s', 'event_espresso' ),
52
+				sprintf(
53
+					__('%sNo payment is required for this transaction.%s', 'event_espresso'),
54 54
 					'<p>',
55 55
 					'</p>'
56 56
 				)
57 57
 			);
58
-			do_action( 'AHEE__thank_you_page_payment_details_template__no_payment_required' );
58
+			do_action('AHEE__thank_you_page_payment_details_template__no_payment_required');
59 59
 
60 60
 		 }
61 61
 
62 62
 	}
63 63
 	echo $gateway_content;
64
-	do_action( 'AHEE__thank_you_page_payment_details_template__after_gateway_content', $gateway_content );
64
+	do_action('AHEE__thank_you_page_payment_details_template__after_gateway_content', $gateway_content);
65 65
 
66 66
 ?>
67 67
 
68 68
 	<br/>
69
-	<?php  do_action( 'AHEE__thank_you_page_payment_details_template__after_payment_details' ); ?>
69
+	<?php  do_action('AHEE__thank_you_page_payment_details_template__after_payment_details'); ?>
70 70
 
Please login to merge, or discard this patch.
templates/thank-you-page-transaction-details.template.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <h3><?php _e('Transaction Details', 'event_espresso'); ?></h3>
2
-<?php  do_action( 'AHEE__thank_you_page_transaction_details_template__after_heading' ); ?>
2
+<?php  do_action('AHEE__thank_you_page_transaction_details_template__after_heading'); ?>
3 3
 
4 4
 <div id="espresso-thank-you-page-transaction-details-dv">
5 5
 	<table class='ee-table'>
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
 					<label><?php _e('Total Cost: ', 'event_espresso'); ?></label>
10 10
 				</td>
11 11
 				<td>
12
-					<?php echo EEH_Template::format_currency( $transaction->total() ); ?>
12
+					<?php echo EEH_Template::format_currency($transaction->total()); ?>
13 13
 				</td>
14 14
 			</tr>
15 15
 			<tr>
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
 					<label><?php _e('Amount Owing: ', 'event_espresso'); ?></label>
18 18
 				</td>
19 19
 				<td class="<?php echo ($transaction->paid() == $transaction->total()) ? 'ee-transaction-paid' : 'ee-transaction-unpaid' ?>">
20
-					<?php echo EEH_Template::format_currency( $transaction->remaining() ); ?>
20
+					<?php echo EEH_Template::format_currency($transaction->remaining()); ?>
21 21
 				</td>
22 22
 			</tr>
23 23
 			<tr>
@@ -25,8 +25,8 @@  discard block
 block discarded – undo
25 25
 					<label><?php _e('Transaction Status: ', 'event_espresso'); ?></label>
26 26
 				</td>
27 27
 				<td>
28
-					<?php $transaction->e_pretty_status( TRUE );
29
-					if ( $show_try_pay_again_link && ! $transaction->is_completed() ) { ?>
28
+					<?php $transaction->e_pretty_status(TRUE);
29
+					if ($show_try_pay_again_link && ! $transaction->is_completed()) { ?>
30 30
 					 &nbsp; <span class="small-text"><a href='<?php echo $SPCO_payment_options_url?>'><?php _e('View Payment Options', 'event_espresso'); ?></a></span>
31 31
 					<?php } ?>
32 32
 				</td>
@@ -39,11 +39,11 @@  discard block
 block discarded – undo
39 39
 					<?php  echo $primary_registrant_name; ?>
40 40
 				</td>
41 41
 			</tr>
42
-            <?php  do_action( 'AHEE__thank_you_page_transaction_details_template__after_transaction_table_row', $transaction ); ?>
42
+            <?php  do_action('AHEE__thank_you_page_transaction_details_template__after_transaction_table_row', $transaction); ?>
43 43
 		</tbody>
44 44
 	</table>
45 45
 
46
-<?php if ( $show_try_pay_again_link && ! $transaction->is_completed() ) { ?>
46
+<?php if ($show_try_pay_again_link && ! $transaction->is_completed()) { ?>
47 47
 	<p class="small-text jst-rght">
48 48
 		<a href='<?php echo $SPCO_payment_options_url?>'><?php _e("Click here to view Payment Options", 'event_espresso'); ?></a>
49 49
 	</p>
@@ -52,6 +52,6 @@  discard block
 block discarded – undo
52 52
 
53 53
 <?php }?>
54 54
 
55
-    <?php  do_action( 'AHEE__thank_you_page_transaction_details_template__after_transaction_details' ); ?>
55
+    <?php  do_action('AHEE__thank_you_page_transaction_details_template__after_transaction_details'); ?>
56 56
 
57 57
 </div>
Please login to merge, or discard this patch.
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.
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,6 +1,8 @@  discard block
 block discarded – undo
1 1
 <?php use EventEspresso\widgets\EspressoWidget;
2 2
 
3
-if ( ! defined('EVENT_ESPRESSO_VERSION')) exit('No direct script access allowed');
3
+if ( ! defined('EVENT_ESPRESSO_VERSION')) {
4
+	exit('No direct script access allowed');
5
+}
4 6
 /**
5 7
  * Event Espresso
6 8
  *
@@ -356,7 +358,7 @@  discard block
 block discarded – undo
356 358
 									$single_time_format = apply_filters( 'FHEE__espresso_event_date_range__single_time_format', get_option( 'time_format' ));
357 359
 									if ( $date_range == TRUE ) {
358 360
 										echo espresso_event_date_range( $date_format, $time_format, $single_date_format, $single_time_format, $event->ID() );
359
-									}else{
361
+									} else{
360 362
 										echo espresso_list_of_event_dates( $event->ID(), $date_format, $time_format, FALSE, NULL, TRUE, TRUE, $date_limit );
361 363
 									}
362 364
 								}
Please login to merge, or discard this patch.
Spacing   +73 added lines, -73 removed lines patch added patch discarded remove patch
@@ -31,8 +31,8 @@  discard block
 block discarded – undo
31 31
 	 */
32 32
 	public function __construct() {
33 33
 		parent::__construct(
34
-			__( 'Event Espresso Upcoming Events', 'event_espresso' ),
35
-			 array( 'description' => __( 'A widget to display your upcoming events.', 'event_espresso' ))
34
+			__('Event Espresso Upcoming Events', 'event_espresso'),
35
+			 array('description' => __('A widget to display your upcoming events.', 'event_espresso'))
36 36
 		);
37 37
 	}
38 38
 
@@ -45,9 +45,9 @@  discard block
 block discarded – undo
45 45
 	 * @param array $instance Previously saved values from database.
46 46
 	 * @return string|void
47 47
 	 */
48
-	public function form( $instance ) {
48
+	public function form($instance) {
49 49
 
50
-		EE_Registry::instance()->load_class( 'Question_Option', array(), FALSE, FALSE, TRUE );
50
+		EE_Registry::instance()->load_class('Question_Option', array(), FALSE, FALSE, TRUE);
51 51
 		// Set up some default widget settings.
52 52
 		$defaults = array(
53 53
 			'title' => __('Upcoming Events', 'event_espresso'),
@@ -62,12 +62,12 @@  discard block
 block discarded – undo
62 62
 			'image_size' => 'medium'
63 63
 		);
64 64
 
65
-		$instance = wp_parse_args( (array) $instance, $defaults );
65
+		$instance = wp_parse_args((array) $instance, $defaults);
66 66
 		// don't add HTML labels for EE_Form_Fields generated inputs
67
-		add_filter( 'FHEE__EEH_Form_Fields__label_html', '__return_empty_string' );
67
+		add_filter('FHEE__EEH_Form_Fields__label_html', '__return_empty_string');
68 68
 		$yes_no_values = array(
69
-			EE_Question_Option::new_instance( array( 'QSO_value' => FALSE, 'QSO_desc' => __('No', 'event_espresso'))),
70
-			EE_Question_Option::new_instance( array( 'QSO_value' => TRUE, 'QSO_desc' => __('Yes', 'event_espresso')))
69
+			EE_Question_Option::new_instance(array('QSO_value' => FALSE, 'QSO_desc' => __('No', 'event_espresso'))),
70
+			EE_Question_Option::new_instance(array('QSO_value' => TRUE, 'QSO_desc' => __('Yes', 'event_espresso')))
71 71
 		);
72 72
 
73 73
 	?>
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
 			<label for="<?php echo $this->get_field_id('title'); ?>">
79 79
 				<?php _e('Title:', 'event_espresso'); ?>
80 80
 			</label>
81
-			<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" />
81
+			<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" />
82 82
 		</p>
83 83
 		<p>
84 84
 			<label for="<?php echo $this->get_field_id('category_name'); ?>">
@@ -87,16 +87,16 @@  discard block
 block discarded – undo
87 87
 			<?php
88 88
 			$event_categories = array();
89 89
 			/** @type EEM_Term $EEM_Term */
90
-			$EEM_Term = EE_Registry::instance()->load_model( 'Term' );
91
-			$categories = $EEM_Term->get_all_ee_categories( TRUE );
92
-			if ( $categories ) {
93
-				foreach ( $categories as $category ) {
94
-					if ( $category instanceof EE_Term ) {
95
-						$event_categories[] = EE_Question_Option::new_instance( array( 'QSO_value' => $category->get( 'slug' ), 'QSO_desc' => $category->get( 'name' )));
90
+			$EEM_Term = EE_Registry::instance()->load_model('Term');
91
+			$categories = $EEM_Term->get_all_ee_categories(TRUE);
92
+			if ($categories) {
93
+				foreach ($categories as $category) {
94
+					if ($category instanceof EE_Term) {
95
+						$event_categories[] = EE_Question_Option::new_instance(array('QSO_value' => $category->get('slug'), 'QSO_desc' => $category->get('name')));
96 96
 					}
97 97
 				}
98 98
 			}
99
-			array_unshift( $event_categories, EE_Question_Option::new_instance( array( 'QSO_value' => '', 'QSO_desc' => __(' - display all - ', 'event_espresso'))));
99
+			array_unshift($event_categories, EE_Question_Option::new_instance(array('QSO_value' => '', 'QSO_desc' => __(' - display all - ', 'event_espresso'))));
100 100
 			echo EEH_Form_Fields::select(
101 101
 				 __('Event Category:', 'event_espresso'),
102 102
 				$instance['category_name'],
@@ -133,16 +133,16 @@  discard block
 block discarded – undo
133 133
 			<?php
134 134
 			$image_sizes = array();
135 135
 			$sizes = get_intermediate_image_sizes();
136
-			if ( $sizes ) {
136
+			if ($sizes) {
137 137
 				// loop thru images and create option objects out of them
138
-				foreach ( $sizes as $image_size ) {
139
-					$image_size = trim( $image_size );
138
+				foreach ($sizes as $image_size) {
139
+					$image_size = trim($image_size);
140 140
 					// no big images plz
141
-					if ( ! in_array( $image_size, array( 'large', 'post-thumbnail' ))) {
142
-						$image_sizes[] = EE_Question_Option::new_instance( array( 'QSO_value' => $image_size, 'QSO_desc' => $image_size ));
141
+					if ( ! in_array($image_size, array('large', 'post-thumbnail'))) {
142
+						$image_sizes[] = EE_Question_Option::new_instance(array('QSO_value' => $image_size, 'QSO_desc' => $image_size));
143 143
 					}
144 144
 				}
145
-				$image_sizes[] = EE_Question_Option::new_instance( array( 'QSO_value' => 'none', 'QSO_desc' =>  __('don\'t show images', 'event_espresso') ));
145
+				$image_sizes[] = EE_Question_Option::new_instance(array('QSO_value' => 'none', 'QSO_desc' =>  __('don\'t show images', 'event_espresso')));
146 146
 			}
147 147
 			echo EEH_Form_Fields::select(
148 148
 				 __('Image Size:', 'event_espresso'),
@@ -200,7 +200,7 @@  discard block
 block discarded – undo
200 200
 			<label for="<?php echo $this->get_field_id('date_limit'); ?>">
201 201
 				<?php _e('Number of Dates to Display:', 'event_espresso'); ?>
202 202
 			</label>
203
-			<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" />
203
+			<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" />
204 204
 		</p>
205 205
 		<p>
206 206
 			<label for="<?php echo $this->get_field_id('date_range'); ?>">
@@ -232,9 +232,9 @@  discard block
 block discarded – undo
232 232
 	 *
233 233
 	 * @return array Updated safe values to be saved.
234 234
 	 */
235
-	public function update( $new_instance, $old_instance ) {
235
+	public function update($new_instance, $old_instance) {
236 236
 		$instance = $old_instance;
237
-		$instance['title'] = ! empty( $new_instance['title'] ) ? strip_tags( $new_instance['title'] ) : '';
237
+		$instance['title'] = ! empty($new_instance['title']) ? strip_tags($new_instance['title']) : '';
238 238
 		$instance['category_name'] = $new_instance['category_name'];
239 239
 		$instance['show_expired'] = $new_instance['show_expired'];
240 240
 		$instance['limit'] = $new_instance['limit'];
@@ -257,18 +257,18 @@  discard block
 block discarded – undo
257 257
 	 * @param array $args     Widget arguments.
258 258
 	 * @param array $instance Saved values from database.
259 259
 	 */
260
-	public function widget( $args, $instance ) {
260
+	public function widget($args, $instance) {
261 261
 
262 262
 		global $post;
263 263
 		// make sure there is some kinda post object
264
-		if ( $post instanceof WP_Post ) {
264
+		if ($post instanceof WP_Post) {
265 265
 			$before_widget = '';
266 266
 			$before_title = '';
267 267
 			$after_title = '';
268 268
 			$after_widget = '';
269 269
 			// but NOT an events archives page, cuz that would be like two event lists on the same page
270
-			$show_everywhere = isset( $instance['show_everywhere'] ) ? (bool) absint( $instance['show_everywhere'] ) : TRUE;
271
-			if ( $show_everywhere || ! ( $post->post_type == 'espresso_events' && is_archive() )) {
270
+			$show_everywhere = isset($instance['show_everywhere']) ? (bool) absint($instance['show_everywhere']) : TRUE;
271
+			if ($show_everywhere || ! ($post->post_type == 'espresso_events' && is_archive())) {
272 272
 				// let's use some of the event helper functions'
273 273
 				// make separate vars out of attributes
274 274
 
@@ -287,83 +287,83 @@  discard block
 block discarded – undo
287 287
 				// Before widget (defined by themes).
288 288
 				echo $before_widget;
289 289
 				// Display the widget title if one was input (before and after defined by themes).
290
-				if ( ! empty( $title )) {
291
-					echo $before_title . $title . $after_title;
290
+				if ( ! empty($title)) {
291
+					echo $before_title.$title.$after_title;
292 292
 				}
293 293
 				// grab widget settings
294
-				$category = isset( $instance['category_name'] ) && ! empty( $instance['category_name'] ) ? $instance['category_name'] : FALSE;
295
-				$show_expired = isset( $instance['show_expired'] ) ? (bool) absint( $instance['show_expired'] ) : FALSE;
296
-				$image_size = isset( $instance['image_size'] ) && ! empty( $instance['image_size'] ) ? $instance['image_size'] : 'medium';
297
-				$show_desc = isset( $instance['show_desc'] ) ? (bool) absint( $instance['show_desc'] ) : TRUE;
298
-				$show_dates = isset( $instance['show_dates'] ) ? (bool) absint( $instance['show_dates'] ) : TRUE;
299
-				$date_limit = isset( $instance['date_limit'] ) && ! empty( $instance['date_limit'] ) ? $instance['date_limit'] : NULL;
300
-				$date_range = isset( $instance['date_range'] ) && ! empty( $instance['date_range'] ) ? $instance['date_range'] : FALSE;
294
+				$category = isset($instance['category_name']) && ! empty($instance['category_name']) ? $instance['category_name'] : FALSE;
295
+				$show_expired = isset($instance['show_expired']) ? (bool) absint($instance['show_expired']) : FALSE;
296
+				$image_size = isset($instance['image_size']) && ! empty($instance['image_size']) ? $instance['image_size'] : 'medium';
297
+				$show_desc = isset($instance['show_desc']) ? (bool) absint($instance['show_desc']) : TRUE;
298
+				$show_dates = isset($instance['show_dates']) ? (bool) absint($instance['show_dates']) : TRUE;
299
+				$date_limit = isset($instance['date_limit']) && ! empty($instance['date_limit']) ? $instance['date_limit'] : NULL;
300
+				$date_range = isset($instance['date_range']) && ! empty($instance['date_range']) ? $instance['date_range'] : FALSE;
301 301
 				// start to build our where clause
302 302
 				$where = array(
303 303
 //					'Datetime.DTT_is_primary' => 1,
304
-					'status' => array( 'IN', array( 'publish', 'sold_out' ) )
304
+					'status' => array('IN', array('publish', 'sold_out'))
305 305
 				);
306 306
 				// add category
307
-				if ( $category ) {
307
+				if ($category) {
308 308
 					$where['Term_Taxonomy.taxonomy'] = 'espresso_event_categories';
309 309
 					$where['Term_Taxonomy.Term.slug'] = $category;
310 310
 				}
311 311
 				// if NOT expired then we want events that start today or in the future
312
-				if ( ! $show_expired ) {
313
-					$where['Datetime.DTT_EVT_end'] = array( '>=', EEM_Datetime::instance()->current_time_for_query( 'DTT_EVT_end' ) );
312
+				if ( ! $show_expired) {
313
+					$where['Datetime.DTT_EVT_end'] = array('>=', EEM_Datetime::instance()->current_time_for_query('DTT_EVT_end'));
314 314
 				}
315 315
 				// allow $where to be filtered
316
-				$where = apply_filters( 'FHEE__EEW_Upcoming_Events__widget__where', $where, $category, $show_expired );
316
+				$where = apply_filters('FHEE__EEW_Upcoming_Events__widget__where', $where, $category, $show_expired);
317 317
 				// run the query
318
-				$events = EE_Registry::instance()->load_model( 'Event' )->get_all( array(
318
+				$events = EE_Registry::instance()->load_model('Event')->get_all(array(
319 319
 					$where,
320
-					'limit' => $instance['limit'] > 0 ? '0,' . $instance['limit'] : '0,10',
320
+					'limit' => $instance['limit'] > 0 ? '0,'.$instance['limit'] : '0,10',
321 321
 					'order_by' => 'Datetime.DTT_EVT_start',
322 322
 					'order' => 'ASC',
323 323
 					'group_by' => 'EVT_ID'
324 324
 				));
325 325
 
326
-				if ( ! empty( $events )) {
326
+				if ( ! empty($events)) {
327 327
 					echo '<ul class="ee-upcoming-events-widget-ul">';
328
-					foreach ( $events as $event ) {
329
-						if ( $event instanceof EE_Event && ( !is_single() || $post->ID != $event->ID() ) ) {
328
+					foreach ($events as $event) {
329
+						if ($event instanceof EE_Event && ( ! is_single() || $post->ID != $event->ID())) {
330 330
 							//printr( $event, '$event  <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span>', 'auto' );
331
-							echo '<li id="ee-upcoming-events-widget-li-' . $event->ID() . '" class="ee-upcoming-events-widget-li">';
331
+							echo '<li id="ee-upcoming-events-widget-li-'.$event->ID().'" class="ee-upcoming-events-widget-li">';
332 332
 							// how big is the event name ?
333
-							$name_length = strlen( $event->name() );
334
-							switch( $name_length ) {
333
+							$name_length = strlen($event->name());
334
+							switch ($name_length) {
335 335
 								case $name_length > 70 :
336
-									$len_class =  ' three-line';
336
+									$len_class = ' three-line';
337 337
 									break;
338 338
 								case $name_length > 35 :
339
-									$len_class =  ' two-line';
339
+									$len_class = ' two-line';
340 340
 									break;
341 341
 								default :
342
-									$len_class =  ' one-line';
342
+									$len_class = ' one-line';
343 343
 							}
344
-							$event_url = apply_filters( 'FHEE_EEW_Upcoming_Events__widget__event_url', $event->get_permalink(), $event );
345
-							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>';
346
-							if ( post_password_required( $event->ID() ) ) {
347
-								$pswd_form = apply_filters( 'FHEE_EEW_Upcoming_Events__widget__password_form', get_the_password_form( $event->ID() ), $event );
344
+							$event_url = apply_filters('FHEE_EEW_Upcoming_Events__widget__event_url', $event->get_permalink(), $event);
345
+							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>';
346
+							if (post_password_required($event->ID())) {
347
+								$pswd_form = apply_filters('FHEE_EEW_Upcoming_Events__widget__password_form', get_the_password_form($event->ID()), $event);
348 348
 								echo $pswd_form;
349 349
 							} else {
350
-								if ( has_post_thumbnail( $event->ID() ) && $image_size != 'none' ) {
351
-									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>';
350
+								if (has_post_thumbnail($event->ID()) && $image_size != 'none') {
351
+									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 352
 								}
353
-								$desc = $event->short_description( 25 );
354
-								if ( $show_dates ) {
355
-									$date_format = apply_filters( 'FHEE__espresso_event_date_range__date_format', get_option( 'date_format' ));
356
-									$time_format = apply_filters( 'FHEE__espresso_event_date_range__time_format', get_option( 'time_format' ));
357
-									$single_date_format = apply_filters( 'FHEE__espresso_event_date_range__single_date_format', get_option( 'date_format' ));
358
-									$single_time_format = apply_filters( 'FHEE__espresso_event_date_range__single_time_format', get_option( 'time_format' ));
359
-									if ( $date_range == TRUE ) {
360
-										echo espresso_event_date_range( $date_format, $time_format, $single_date_format, $single_time_format, $event->ID() );
361
-									}else{
362
-										echo espresso_list_of_event_dates( $event->ID(), $date_format, $time_format, FALSE, NULL, TRUE, TRUE, $date_limit );
353
+								$desc = $event->short_description(25);
354
+								if ($show_dates) {
355
+									$date_format = apply_filters('FHEE__espresso_event_date_range__date_format', get_option('date_format'));
356
+									$time_format = apply_filters('FHEE__espresso_event_date_range__time_format', get_option('time_format'));
357
+									$single_date_format = apply_filters('FHEE__espresso_event_date_range__single_date_format', get_option('date_format'));
358
+									$single_time_format = apply_filters('FHEE__espresso_event_date_range__single_time_format', get_option('time_format'));
359
+									if ($date_range == TRUE) {
360
+										echo espresso_event_date_range($date_format, $time_format, $single_date_format, $single_time_format, $event->ID());
361
+									} else {
362
+										echo espresso_list_of_event_dates($event->ID(), $date_format, $time_format, FALSE, NULL, TRUE, TRUE, $date_limit);
363 363
 									}
364 364
 								}
365
-								if ( $show_desc && $desc ) {
366
-									echo '<p style="margin-top: .5em">' . $desc . '</p>';
365
+								if ($show_desc && $desc) {
366
+									echo '<p style="margin-top: .5em">'.$desc.'</p>';
367 367
 								}
368 368
 							}
369 369
 							echo '</li>';
@@ -387,7 +387,7 @@  discard block
 block discarded – undo
387 387
 	 * @return string
388 388
 	 */
389 389
 	public function make_the_title_a_link($title) {
390
-	    return '<a href="' . EEH_Event_View::event_archive_url() . '">' . $title . '</a>';
390
+	    return '<a href="'.EEH_Event_View::event_archive_url().'">'.$title.'</a>';
391 391
 	}
392 392
 
393 393
 }
Please login to merge, or discard this patch.
core/libraries/messages/EE_Messages_Processor.lib.php 3 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -410,7 +410,7 @@
 block discarded – undo
410 410
 	/**
411 411
 	 * This simply loops through all active messengers and takes care of setting up the
412 412
 	 * EE_Message_To_Generate objects.
413
-	 * @param $message_type
413
+	 * @param string $message_type
414 414
 	 * @param $data
415 415
 	 *
416 416
 	 * @return EE_Message_To_Generate[]
Please login to merge, or discard this patch.
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -560,10 +560,10 @@
 block discarded – undo
560 560
 
561 561
 		foreach ( $regs_to_send as $status_group ) {
562 562
 			foreach ( $status_group as $status_id => $registrations ) {
563
-			    $message_type = EEH_MSG_Template::convert_reg_status_to_message_type($status_id);
564
-			    if (! $message_type) {
565
-			        continue;
566
-                }
563
+				$message_type = EEH_MSG_Template::convert_reg_status_to_message_type($status_id);
564
+				if (! $message_type) {
565
+					continue;
566
+				}
567 567
 				$messages_to_generate = array_merge(
568 568
 					$messages_to_generate,
569 569
 					$this->setup_mtgs_for_all_active_messengers(
Please login to merge, or discard this patch.
Spacing   +108 added lines, -108 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
 	 *
36 36
 	 * @param EE_Message_Resource_Manager $message_resource_manager
37 37
 	 */
38
-	public function __construct( EE_Message_Resource_Manager $message_resource_manager ) {
38
+	public function __construct(EE_Message_Resource_Manager $message_resource_manager) {
39 39
 		$this->_message_resource_manager = $message_resource_manager;
40 40
 		$this->_init_queue_and_generator();
41 41
 	}
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
 	 * - $_generator = holds the messages generator
51 51
 	 */
52 52
 	protected function _init_queue_and_generator() {
53
-		$this->_generator = EE_Registry::factory( 'EE_Messages_Generator' );
53
+		$this->_generator = EE_Registry::factory('EE_Messages_Generator');
54 54
 		$this->_queue = $this->_generator->generation_queue();
55 55
 	}
56 56
 
@@ -75,31 +75,31 @@  discard block
 block discarded – undo
75 75
 	 * @param EE_Messages_Queue $queue_to_process
76 76
 	 * @return bool  true for success false for error.
77 77
 	 */
78
-	public function process_immediately_from_queue( EE_Messages_Queue $queue_to_process ) {
78
+	public function process_immediately_from_queue(EE_Messages_Queue $queue_to_process) {
79 79
 		$success = false;
80 80
 		$messages_to_send = array();
81 81
 		$messages_to_generate = array();
82 82
 		//loop through and setup the various messages from the queue so we know what is being processed
83 83
 		$queue_to_process->get_message_repository()->rewind();
84
-		foreach ( $queue_to_process->get_message_repository() as $message ) {
85
-			if ( $message->STS_ID() === EEM_Message::status_incomplete ) {
84
+		foreach ($queue_to_process->get_message_repository() as $message) {
85
+			if ($message->STS_ID() === EEM_Message::status_incomplete) {
86 86
 				$messages_to_generate[] = $message;
87 87
 				continue;
88 88
 			}
89 89
 
90
-			if ( in_array( $message->STS_ID(), EEM_Message::instance()->stati_indicating_to_send() ) ) {
90
+			if (in_array($message->STS_ID(), EEM_Message::instance()->stati_indicating_to_send())) {
91 91
 				$messages_to_send[] = $message;
92 92
 				continue;
93 93
 			}
94 94
 		}
95 95
 
96 96
 		//do generation/sends
97
-		if ( $messages_to_generate ) {
98
-			$success = $this->batch_generate_from_queue( $messages_to_generate, true );
97
+		if ($messages_to_generate) {
98
+			$success = $this->batch_generate_from_queue($messages_to_generate, true);
99 99
 		}
100 100
 
101
-		if ( $messages_to_send ) {
102
-			$sent = $this->batch_send_from_queue( $messages_to_send, true );
101
+		if ($messages_to_send) {
102
+			$sent = $this->batch_send_from_queue($messages_to_send, true);
103 103
 			//if there was messages to generate and it failed, then we override any success value for the sending process
104 104
 			//otherwise we just use the return from batch send.  The intent is that there is a simple response for success/fail.
105 105
 			//Either everything was successful or we consider it a fail.  To be clear, this is a limitation of doing
@@ -119,13 +119,13 @@  discard block
 block discarded – undo
119 119
 	 * @return bool|EE_Messages_Queue return false if nothing generated.  This returns a new EE_Message_Queue with
120 120
 	 *                                   generated messages.
121 121
 	 */
122
-	public function batch_generate_from_queue( $messages = array(), $clear_queue = false ) {
123
-		if ( $this->_build_queue_for_generation( $messages, $clear_queue ) ) {
122
+	public function batch_generate_from_queue($messages = array(), $clear_queue = false) {
123
+		if ($this->_build_queue_for_generation($messages, $clear_queue)) {
124 124
 			$new_queue = $this->_generator->generate();
125
-			if ( $new_queue instanceof EE_Messages_Queue ) {
125
+			if ($new_queue instanceof EE_Messages_Queue) {
126 126
 				//unlock queue
127 127
 				$this->_queue->unlock_queue();
128
-				$new_queue->initiate_request_by_priority( 'send' );
128
+				$new_queue->initiate_request_by_priority('send');
129 129
 				return $new_queue;
130 130
 			}
131 131
 		}
@@ -146,24 +146,24 @@  discard block
 block discarded – undo
146 146
 	 *
147 147
 	 * @return bool true means queue prepped, false means there was a lock so no generation please.
148 148
 	 */
149
-	protected function _build_queue_for_generation( $messages = array(), $clear_queue = false ) {
149
+	protected function _build_queue_for_generation($messages = array(), $clear_queue = false) {
150 150
 
151
-		if ( $clear_queue ) {
151
+		if ($clear_queue) {
152 152
 			$this->_init_queue_and_generator();
153 153
 		}
154 154
 
155
-		if ( $messages ) {
155
+		if ($messages) {
156 156
 			//if generation is locked then get out now because that means processing is already happening.
157
-			if ( $this->_queue->is_locked() ) {
157
+			if ($this->_queue->is_locked()) {
158 158
 				return false;
159 159
 			}
160 160
 
161 161
 			$this->_queue->lock_queue();
162
-			$messages = is_array( $messages ) ? $messages : array( $messages );
163
-			foreach ( $messages as $message ) {
164
-				if ( $message instanceof EE_Message ) {
162
+			$messages = is_array($messages) ? $messages : array($messages);
163
+			foreach ($messages as $message) {
164
+				if ($message instanceof EE_Message) {
165 165
 					$data = $message->all_extra_meta_array();
166
-					$this->_queue->add( $message, $data );
166
+					$this->_queue->add($message, $data);
167 167
 				}
168 168
 			}
169 169
 			return true;
@@ -181,22 +181,22 @@  discard block
 block discarded – undo
181 181
 	 *
182 182
 	 * @return bool true means queue prepped, false means there was a lock so no queue prepped.
183 183
 	 */
184
-	protected function _build_queue_for_sending( $messages, $clear_queue = false ) {
184
+	protected function _build_queue_for_sending($messages, $clear_queue = false) {
185 185
 		//if sending is locked then get out now because that means processing is already happening.
186
-		if ( $this->_queue->is_locked( EE_Messages_Queue::action_sending ) ) {
186
+		if ($this->_queue->is_locked(EE_Messages_Queue::action_sending)) {
187 187
 			return false;
188 188
 		}
189 189
 
190
-		$this->_queue->lock_queue( EE_Messages_Queue::action_sending );
190
+		$this->_queue->lock_queue(EE_Messages_Queue::action_sending);
191 191
 
192
-		if ( $clear_queue ) {
192
+		if ($clear_queue) {
193 193
 			$this->_init_queue_and_generator();
194 194
 		}
195 195
 
196
-		$messages = is_array( $messages ) ? $messages : array( $messages );
196
+		$messages = is_array($messages) ? $messages : array($messages);
197 197
 
198
-		foreach ( $messages as $message ) {
199
-			$this->_queue->add( $message );
198
+		foreach ($messages as $message) {
199
+			$this->_queue->add($message);
200 200
 		}
201 201
 		return true;
202 202
 	}
@@ -212,11 +212,11 @@  discard block
 block discarded – undo
212 212
 	 *
213 213
 	 * @return EE_Messages_Queue
214 214
 	 */
215
-	public function batch_send_from_queue( $messages = array(), $clear_queue = false ) {
215
+	public function batch_send_from_queue($messages = array(), $clear_queue = false) {
216 216
 
217
-		if ( $messages && $this->_build_queue_for_sending( $messages, $clear_queue ) ) {
217
+		if ($messages && $this->_build_queue_for_sending($messages, $clear_queue)) {
218 218
 			$this->_queue->execute();
219
-			$this->_queue->unlock_queue( EE_Messages_Queue::action_sending );
219
+			$this->_queue->unlock_queue(EE_Messages_Queue::action_sending);
220 220
 		} else {
221 221
 			//get messages to send and execute.
222 222
 			$this->_queue->get_to_send_batch_and_send();
@@ -239,10 +239,10 @@  discard block
 block discarded – undo
239 239
 	 * @param EE_Message_To_Generate[] $messages_to_generate
240 240
 	 * @return EE_Messages_Queue
241 241
 	 */
242
-	public function generate_and_return(  $messages_to_generate ) {
242
+	public function generate_and_return($messages_to_generate) {
243 243
 		$this->_init_queue_and_generator();
244
-		$this->_queue_for_generation_loop( $messages_to_generate );
245
-		return $this->_generator->generate( false );
244
+		$this->_queue_for_generation_loop($messages_to_generate);
245
+		return $this->_generator->generate(false);
246 246
 	}
247 247
 
248 248
 
@@ -253,8 +253,8 @@  discard block
 block discarded – undo
253 253
 	 * @param  bool     $persist    Indicate whether to instruct the generator to persist the generated queue (true) or not (false).
254 254
 	 * @return EE_Messages_Queue
255 255
 	 */
256
-	public function generate_queue( $persist = true ) {
257
-		return $this->_generator->generate( $persist );
256
+	public function generate_queue($persist = true) {
257
+		return $this->_generator->generate($persist);
258 258
 	}
259 259
 
260 260
 
@@ -267,9 +267,9 @@  discard block
 block discarded – undo
267 267
 	 * @param bool                   $test_send             Whether this item is for a test send or not.
268 268
 	 * @return  EE_Messages_Queue
269 269
 	 */
270
-	public function queue_for_generation( EE_Message_To_Generate $message_to_generate, $test_send = false ) {
271
-		if ( $message_to_generate->valid() ) {
272
-			$this->_generator->create_and_add_message_to_queue( $message_to_generate, $test_send );
270
+	public function queue_for_generation(EE_Message_To_Generate $message_to_generate, $test_send = false) {
271
+		if ($message_to_generate->valid()) {
272
+			$this->_generator->create_and_add_message_to_queue($message_to_generate, $test_send);
273 273
 		}
274 274
 	}
275 275
 
@@ -285,9 +285,9 @@  discard block
 block discarded – undo
285 285
 	 *
286 286
 	 * @param EE_Message_To_Generate[] $messages_to_generate
287 287
 	 */
288
-	public function batch_queue_for_generation_and_persist( $messages_to_generate ) {
288
+	public function batch_queue_for_generation_and_persist($messages_to_generate) {
289 289
 		$this->_init_queue_and_generator();
290
-		$this->_queue_for_generation_loop( $messages_to_generate );
290
+		$this->_queue_for_generation_loop($messages_to_generate);
291 291
 		$this->_queue->save();
292 292
 	}
293 293
 
@@ -303,9 +303,9 @@  discard block
 block discarded – undo
303 303
 	 *
304 304
 	 * @param EE_Message_To_Generate[]  $messages_to_generate
305 305
 	 */
306
-	public function batch_queue_for_generation_no_persist( $messages_to_generate ) {
306
+	public function batch_queue_for_generation_no_persist($messages_to_generate) {
307 307
 		$this->_init_queue_and_generator();
308
-		$this->_queue_for_generation_loop( $messages_to_generate );
308
+		$this->_queue_for_generation_loop($messages_to_generate);
309 309
 	}
310 310
 
311 311
 
@@ -317,15 +317,15 @@  discard block
 block discarded – undo
317 317
 	 *
318 318
 	 * @param EE_Message_To_Generate[] $messages_to_generate
319 319
 	 */
320
-	protected function _queue_for_generation_loop( $messages_to_generate ) {
320
+	protected function _queue_for_generation_loop($messages_to_generate) {
321 321
 		//make sure is in an array.
322
-		if ( ! is_array( $messages_to_generate ) ) {
323
-			$messages_to_generate = array( $messages_to_generate );
322
+		if ( ! is_array($messages_to_generate)) {
323
+			$messages_to_generate = array($messages_to_generate);
324 324
 		}
325 325
 
326
-		foreach ( $messages_to_generate as $message_to_generate ) {
327
-			if ( $message_to_generate instanceof EE_Message_To_Generate && $message_to_generate->valid() ) {
328
-				$this->queue_for_generation( $message_to_generate );
326
+		foreach ($messages_to_generate as $message_to_generate) {
327
+			if ($message_to_generate instanceof EE_Message_To_Generate && $message_to_generate->valid()) {
328
+				$this->queue_for_generation($message_to_generate);
329 329
 			}
330 330
 		}
331 331
 	}
@@ -340,10 +340,10 @@  discard block
 block discarded – undo
340 340
 	 * @param  EE_Message_To_Generate[]
341 341
 	 * @return EE_Messages_Queue
342 342
 	 */
343
-	public function generate_and_queue_for_sending( $messages_to_generate ) {
343
+	public function generate_and_queue_for_sending($messages_to_generate) {
344 344
 		$this->_init_queue_and_generator();
345
-		$this->_queue_for_generation_loop( $messages_to_generate );
346
-		return $this->_generator->generate( true );
345
+		$this->_queue_for_generation_loop($messages_to_generate);
346
+		return $this->_generator->generate(true);
347 347
 	}
348 348
 
349 349
 
@@ -357,10 +357,10 @@  discard block
 block discarded – undo
357 357
 	 * @param   bool                   $test_send                Whether this is a test send or not.
358 358
 	 * @return  EE_Messages_Queue | bool   false if unable to generate otherwise the generated queue.
359 359
 	 */
360
-	public function generate_for_preview( EE_Message_To_Generate $message_to_generate, $test_send = false ) {
361
-		if ( ! $message_to_generate->valid() ) {
360
+	public function generate_for_preview(EE_Message_To_Generate $message_to_generate, $test_send = false) {
361
+		if ( ! $message_to_generate->valid()) {
362 362
 			EE_Error::add_error(
363
-				__( 'Unable to generate preview because of invalid data', 'event_espresso' ),
363
+				__('Unable to generate preview because of invalid data', 'event_espresso'),
364 364
 				__FILE__,
365 365
 				__FUNCTION__,
366 366
 				__LINE__
@@ -368,14 +368,14 @@  discard block
 block discarded – undo
368 368
 			return false;
369 369
 		}
370 370
 		//just make sure preview is set on the $message_to_generate (in case client forgot)
371
-		$message_to_generate->set_preview( true );
371
+		$message_to_generate->set_preview(true);
372 372
 		$this->_init_queue_and_generator();
373
-		$this->queue_for_generation( $message_to_generate, $test_send );
374
-		$generated_queue = $this->_generator->generate( false );
375
-		if ( $generated_queue->execute( false ) ) {
373
+		$this->queue_for_generation($message_to_generate, $test_send);
374
+		$generated_queue = $this->_generator->generate(false);
375
+		if ($generated_queue->execute(false)) {
376 376
 			//the first queue item should be the preview
377 377
 			$generated_queue->get_message_repository()->rewind();
378
-			if ( ! $generated_queue->get_message_repository()->valid() ) {
378
+			if ( ! $generated_queue->get_message_repository()->valid()) {
379 379
 				return $generated_queue;
380 380
 			}
381 381
 			return $generated_queue;
@@ -392,15 +392,15 @@  discard block
 block discarded – undo
392 392
 	 * @param EE_Message_To_Generate $message_to_generate
393 393
 	 * @return bool true or false for success.
394 394
 	 */
395
-	public function queue_for_sending( EE_Message_To_Generate $message_to_generate ) {
396
-		if ( ! $message_to_generate->valid() ) {
395
+	public function queue_for_sending(EE_Message_To_Generate $message_to_generate) {
396
+		if ( ! $message_to_generate->valid()) {
397 397
 			return false;
398 398
 		}
399 399
 		$this->_init_queue_and_generator();
400 400
 		$message = $message_to_generate->get_EE_Message();
401
-		$this->_queue->add( $message );
402
-		if ( $message->send_now() ) {
403
-			$this->_queue->execute( false );
401
+		$this->_queue->add($message);
402
+		if ($message->send_now()) {
403
+			$this->_queue->execute(false);
404 404
 		} else {
405 405
 			$this->_queue->save();
406 406
 		}
@@ -413,12 +413,12 @@  discard block
 block discarded – undo
413 413
 	 * @param EE_Message_To_Generate $message_to_generate
414 414
 	 * @return EE_Messages_Queue | null
415 415
 	 */
416
-	public function generate_and_send_now( EE_Message_To_Generate $message_to_generate ) {
417
-		if ( ! $message_to_generate->valid() ) {
416
+	public function generate_and_send_now(EE_Message_To_Generate $message_to_generate) {
417
+		if ( ! $message_to_generate->valid()) {
418 418
 			return null;
419 419
 		}
420 420
 		// is there supposed to be a sending messenger for this message?
421
-		if ( $message_to_generate instanceof EEI_Has_Sending_Messenger ) {
421
+		if ($message_to_generate instanceof EEI_Has_Sending_Messenger) {
422 422
 			// make sure it's valid, but if it's not,
423 423
 			// then set the value of $sending_messenger to an EE_Error object
424 424
 			// so that downstream code can easily see that things went wrong.
@@ -434,14 +434,14 @@  discard block
 block discarded – undo
434 434
 			$sending_messenger = null;
435 435
 		}
436 436
 
437
-		if ( $message_to_generate->get_EE_Message()->STS_ID() === EEM_Message::status_idle ) {
437
+		if ($message_to_generate->get_EE_Message()->STS_ID() === EEM_Message::status_idle) {
438 438
 			$this->_init_queue_and_generator();
439
-			$this->_queue->add( $message_to_generate->get_EE_Message() );
440
-			$this->_queue->execute( false, $sending_messenger );
439
+			$this->_queue->add($message_to_generate->get_EE_Message());
440
+			$this->_queue->execute(false, $sending_messenger);
441 441
 			return $this->_queue;
442
-		} elseif ( $message_to_generate->get_EE_Message()->STS_ID() === EEM_Message::status_incomplete ) {
443
-			$generated_queue = $this->generate_and_return( array( $message_to_generate ) );
444
-			$generated_queue->execute( false, $sending_messenger );
442
+		} elseif ($message_to_generate->get_EE_Message()->STS_ID() === EEM_Message::status_incomplete) {
443
+			$generated_queue = $this->generate_and_return(array($message_to_generate));
444
+			$generated_queue->execute(false, $sending_messenger);
445 445
 			return $generated_queue;
446 446
 		}
447 447
 		return null;
@@ -458,13 +458,13 @@  discard block
 block discarded – undo
458 458
 	 * @param mixed  $data   The data being used for generation.
459 459
 	 * @param bool   $persist   Whether to persist the queued messages to the db or not.
460 460
 	 */
461
-	public function generate_for_all_active_messengers( $message_type, $data, $persist = true ) {
462
-		$messages_to_generate = $this->setup_mtgs_for_all_active_messengers( $message_type, $data );
463
-		if ( $persist ) {
464
-			$this->batch_queue_for_generation_and_persist( $messages_to_generate );
461
+	public function generate_for_all_active_messengers($message_type, $data, $persist = true) {
462
+		$messages_to_generate = $this->setup_mtgs_for_all_active_messengers($message_type, $data);
463
+		if ($persist) {
464
+			$this->batch_queue_for_generation_and_persist($messages_to_generate);
465 465
 			$this->_queue->initiate_request_by_priority();
466 466
 		} else {
467
-			$this->batch_queue_for_generation_no_persist( $messages_to_generate );
467
+			$this->batch_queue_for_generation_no_persist($messages_to_generate);
468 468
 		}
469 469
 	}
470 470
 
@@ -479,11 +479,11 @@  discard block
 block discarded – undo
479 479
 	 *
480 480
 	 * @return EE_Message_To_Generate[]
481 481
 	 */
482
-	public function setup_mtgs_for_all_active_messengers( $message_type, $data ) {
482
+	public function setup_mtgs_for_all_active_messengers($message_type, $data) {
483 483
 		$messages_to_generate = array();
484
-		foreach ( $this->_message_resource_manager->active_messengers() as $messenger_slug => $messenger_object  ) {
485
-			$message_to_generate = new EE_Message_To_Generate( $messenger_slug, $message_type, $data );
486
-			if ( $message_to_generate->valid() ) {
484
+		foreach ($this->_message_resource_manager->active_messengers() as $messenger_slug => $messenger_object) {
485
+			$message_to_generate = new EE_Message_To_Generate($messenger_slug, $message_type, $data);
486
+			if ($message_to_generate->valid()) {
487 487
 				$messages_to_generate[] = $message_to_generate;
488 488
 			}
489 489
 		}
@@ -498,29 +498,29 @@  discard block
 block discarded – undo
498 498
 	 * and send.
499 499
 	 * @param array $message_ids
500 500
 	 */
501
-	public function setup_messages_from_ids_and_send( $message_ids ) {
501
+	public function setup_messages_from_ids_and_send($message_ids) {
502 502
 		$this->_init_queue_and_generator();
503
-		$messages = EEM_Message::instance()->get_all( array(
503
+		$messages = EEM_Message::instance()->get_all(array(
504 504
 			array(
505
-				'MSG_ID' => array( 'IN', $message_ids ),
505
+				'MSG_ID' => array('IN', $message_ids),
506 506
 				'STS_ID' => array(
507 507
 					'IN',
508 508
 					array_merge(
509 509
 						EEM_Message::instance()->stati_indicating_sent(),
510
-						array( EEM_Message::status_retry )
510
+						array(EEM_Message::status_retry)
511 511
 					),
512 512
 				),
513 513
 			),
514 514
 		));
515 515
 		//set the Messages to resend.
516
-		foreach ( $messages as $message ) {
517
-			if ( $message instanceof EE_Message ) {
518
-				$message->set_STS_ID( EEM_Message::status_resend );
519
-				$this->_queue->add( $message );
516
+		foreach ($messages as $message) {
517
+			if ($message instanceof EE_Message) {
518
+				$message->set_STS_ID(EEM_Message::status_resend);
519
+				$this->_queue->add($message);
520 520
 			}
521 521
 		}
522 522
 
523
-		$this->_queue->initiate_request_by_priority( 'send' );
523
+		$this->_queue->initiate_request_by_priority('send');
524 524
 	}
525 525
 
526 526
 
@@ -534,23 +534,23 @@  discard block
 block discarded – undo
534 534
 	 *
535 535
 	 * @return EE_Message_To_Generate[]
536 536
 	 */
537
-	public function setup_messages_to_generate_from_registration_ids_in_request( $registration_ids_key = '_REG_ID' ) {
538
-		EE_Registry::instance()->load_core( 'Request_Handler' );
539
-		EE_Registry::instance()->load_helper( 'MSG_Template' );
537
+	public function setup_messages_to_generate_from_registration_ids_in_request($registration_ids_key = '_REG_ID') {
538
+		EE_Registry::instance()->load_core('Request_Handler');
539
+		EE_Registry::instance()->load_helper('MSG_Template');
540 540
 		$regs_to_send = array();
541
-		$regIDs = EE_Registry::instance()->REQ->get( $registration_ids_key );
542
-		if ( empty( $regIDs ) ) {
543
-			EE_Error::add_error( __('Something went wrong because we\'re missing the registration ID', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__ );
541
+		$regIDs = EE_Registry::instance()->REQ->get($registration_ids_key);
542
+		if (empty($regIDs)) {
543
+			EE_Error::add_error(__('Something went wrong because we\'re missing the registration ID', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
544 544
 			return false;
545 545
 		}
546 546
 
547 547
 		//make sure is an array
548
-		$regIDs = is_array( $regIDs ) ? $regIDs : array( $regIDs );
548
+		$regIDs = is_array($regIDs) ? $regIDs : array($regIDs);
549 549
 
550
-		foreach( $regIDs as $regID ) {
551
-			$reg = EEM_Registration::instance()->get_one_by_ID( $regID );
552
-			if ( ! $reg instanceof EE_Registration ) {
553
-				EE_Error::add_error( sprintf( __('Unable to retrieve a registration object for the given reg id (%s)', 'event_espresso'), $regID ) );
550
+		foreach ($regIDs as $regID) {
551
+			$reg = EEM_Registration::instance()->get_one_by_ID($regID);
552
+			if ( ! $reg instanceof EE_Registration) {
553
+				EE_Error::add_error(sprintf(__('Unable to retrieve a registration object for the given reg id (%s)', 'event_espresso'), $regID));
554 554
 				return false;
555 555
 			}
556 556
 			$regs_to_send[$reg->transaction_ID()][$reg->status_ID()][] = $reg;
@@ -558,17 +558,17 @@  discard block
 block discarded – undo
558 558
 
559 559
 		$messages_to_generate = array();
560 560
 
561
-		foreach ( $regs_to_send as $status_group ) {
562
-			foreach ( $status_group as $status_id => $registrations ) {
561
+		foreach ($regs_to_send as $status_group) {
562
+			foreach ($status_group as $status_id => $registrations) {
563 563
 			    $message_type = EEH_MSG_Template::convert_reg_status_to_message_type($status_id);
564
-			    if (! $message_type) {
564
+			    if ( ! $message_type) {
565 565
 			        continue;
566 566
                 }
567 567
 				$messages_to_generate = array_merge(
568 568
 					$messages_to_generate,
569 569
 					$this->setup_mtgs_for_all_active_messengers(
570 570
 						$message_type,
571
-						array( $registrations, $status_id )
571
+						array($registrations, $status_id)
572 572
 					)
573 573
 				);
574 574
 			}
Please login to merge, or discard this patch.