Completed
Branch FET-5580-registration-cancella... (d3ffee)
by
unknown
1266:34 queued 1253:32
created
email/EE_Messages_Email_Not_Approved_Registration_Validator.class.php 2 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-if (!defined('EVENT_ESPRESSO_VERSION') )
3
+if ( ! defined('EVENT_ESPRESSO_VERSION'))
4 4
 	exit('NO direct script access allowed');
5 5
 
6 6
 /**
@@ -30,11 +30,11 @@  discard block
 block discarded – undo
30 30
 class EE_Messages_Email_Registration_Validator extends EE_Messages_Validator {
31 31
 
32 32
 
33
-	public function __construct( $fields, $context ) {
33
+	public function __construct($fields, $context) {
34 34
 		$this->_m_name = 'email';
35 35
 		$this->_mt_name = 'registration';
36 36
 
37
-		parent::__construct( $fields, $context );
37
+		parent::__construct($fields, $context);
38 38
 	}
39 39
 
40 40
 	/**
@@ -47,9 +47,9 @@  discard block
 block discarded – undo
47 47
 			'shortcodes' => array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'event_author', 'primary_registration_details', 'primary_registration_list', 'recipient_details', 'recipient_list'),
48 48
 			'required' => array('[EVENT_LIST]')
49 49
 			);
50
-		$this->_MSGR->set_validator_config( $new_config );
50
+		$this->_MSGR->set_validator_config($new_config);
51 51
 
52
-		if ( $this->_context != 'admin' )
52
+		if ($this->_context != 'admin')
53 53
 			$this->_valid_shortcodes_modifier[$this->_context]['event_list'] = array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'event_author', 'primary_registration_details', 'primary_registration_list', 'recipient_details', 'recipient_list');
54 54
 
55 55
 		$this->_specific_shortcode_excludes['content'] = array('[DISPLAY_PDF_URL]', '[DISPLAY_PDF_BUTTON]');
Please login to merge, or discard this patch.
Braces   +5 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,7 +1,8 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-if (!defined('EVENT_ESPRESSO_VERSION') )
3
+if (!defined('EVENT_ESPRESSO_VERSION') ) {
4 4
 	exit('NO direct script access allowed');
5
+}
5 6
 
6 7
 /**
7 8
  * Event Espresso
@@ -49,8 +50,9 @@  discard block
 block discarded – undo
49 50
 			);
50 51
 		$this->_MSGR->set_validator_config( $new_config );
51 52
 
52
-		if ( $this->_context != 'admin' )
53
-			$this->_valid_shortcodes_modifier[$this->_context]['event_list'] = array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'event_author', 'primary_registration_details', 'primary_registration_list', 'recipient_details', 'recipient_list');
53
+		if ( $this->_context != 'admin' ) {
54
+					$this->_valid_shortcodes_modifier[$this->_context]['event_list'] = array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'event_author', 'primary_registration_details', 'primary_registration_list', 'recipient_details', 'recipient_list');
55
+		}
54 56
 
55 57
 		$this->_specific_shortcode_excludes['content'] = array('[DISPLAY_PDF_URL]', '[DISPLAY_PDF_BUTTON]');
56 58
 	}
Please login to merge, or discard this patch.
validators/email/EE_Messages_Email_Payment_Refund_Validator.class.php 2 patches
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-if (!defined('EVENT_ESPRESSO_VERSION') )
3
+if ( ! defined('EVENT_ESPRESSO_VERSION'))
4 4
 	exit('NO direct script access allowed');
5 5
 
6 6
 /**
@@ -30,11 +30,11 @@  discard block
 block discarded – undo
30 30
 class EE_Messages_Email_Payment_Validator extends EE_Messages_Validator {
31 31
 
32 32
 
33
-	public function __construct( $fields, $context ) {
33
+	public function __construct($fields, $context) {
34 34
 		$this->_m_name = 'email';
35 35
 		$this->_mt_name = 'payment';
36 36
 
37
-		parent::__construct( $fields, $context );
37
+		parent::__construct($fields, $context);
38 38
 	}
39 39
 
40 40
 	/**
@@ -45,17 +45,17 @@  discard block
 block discarded – undo
45 45
 
46 46
 		//modify just event_list
47 47
 		$new_config['event_list'] = array(
48
-			'shortcodes' => array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization','recipient_details', 'recipient_list', 'event_author', 'primary_registration_details', 'primary_registration_list')
48
+			'shortcodes' => array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'recipient_details', 'recipient_list', 'event_author', 'primary_registration_details', 'primary_registration_list')
49 49
 			);
50 50
 		$new_config['ticket_list'] = array(
51 51
 			'shortcodes' => array('event_list', 'attendee_list', 'ticket', 'datetime_list', 'recipient_details', 'transaction')
52 52
 			);
53 53
 		$new_config['content'] = array(
54
-			'shortcodes' => array('event_list','attendee_list', 'ticket_list', 'organization', 'recipient_details', 'recipient_list', 'transaction', 'primary_registration_details', 'primary_registration_list', 'messenger')
54
+			'shortcodes' => array('event_list', 'attendee_list', 'ticket_list', 'organization', 'recipient_details', 'recipient_list', 'transaction', 'primary_registration_details', 'primary_registration_list', 'messenger')
55 55
 			);
56
-		$this->_MSGR->set_validator_config( $new_config );
56
+		$this->_MSGR->set_validator_config($new_config);
57 57
 
58
-		if ( $this->_context != 'admin' )
58
+		if ($this->_context != 'admin')
59 59
 			$this->_valid_shortcodes_modifier[$this->_context]['event_list'] = array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'event_author', 'primary_registration_details', 'primary_registration_list', 'recipient_details', 'recipient_list');
60 60
 
61 61
 		$this->_specific_shortcode_excludes['content'] = array('[DISPLAY_PDF_URL]', '[DISPLAY_PDF_BUTTON]');
Please login to merge, or discard this patch.
Braces   +5 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,7 +1,8 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-if (!defined('EVENT_ESPRESSO_VERSION') )
3
+if (!defined('EVENT_ESPRESSO_VERSION') ) {
4 4
 	exit('NO direct script access allowed');
5
+}
5 6
 
6 7
 /**
7 8
  * Event Espresso
@@ -49,8 +50,9 @@  discard block
 block discarded – undo
49 50
 			);
50 51
 		$this->_MSGR->set_validator_config( $new_config );
51 52
 
52
-		if ( $this->_context != 'admin' )
53
-			$this->_valid_shortcodes_modifier[$this->_context]['event_list'] = array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'event_author', 'primary_registration_details', 'primary_registration_list', 'recipient_details', 'recipient_list');
53
+		if ( $this->_context != 'admin' ) {
54
+					$this->_valid_shortcodes_modifier[$this->_context]['event_list'] = array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'event_author', 'primary_registration_details', 'primary_registration_list', 'recipient_details', 'recipient_list');
55
+		}
54 56
 
55 57
 		$this->_specific_shortcode_excludes['content'] = array('[DISPLAY_PDF_URL]', '[DISPLAY_PDF_BUTTON]');
56 58
 	}
Please login to merge, or discard this patch.
validators/email/EE_Messages_Email_Pending_Approval_Validator.class.php 2 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-if (!defined('EVENT_ESPRESSO_VERSION') )
3
+if ( ! defined('EVENT_ESPRESSO_VERSION'))
4 4
 	exit('NO direct script access allowed');
5 5
 
6 6
 /**
@@ -30,11 +30,11 @@  discard block
 block discarded – undo
30 30
 class EE_Messages_Email_Registration_Validator extends EE_Messages_Validator {
31 31
 
32 32
 
33
-	public function __construct( $fields, $context ) {
33
+	public function __construct($fields, $context) {
34 34
 		$this->_m_name = 'email';
35 35
 		$this->_mt_name = 'registration';
36 36
 
37
-		parent::__construct( $fields, $context );
37
+		parent::__construct($fields, $context);
38 38
 	}
39 39
 
40 40
 	/**
@@ -47,9 +47,9 @@  discard block
 block discarded – undo
47 47
 			'shortcodes' => array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'event_author', 'primary_registration_details', 'primary_registration_list', 'recipient_details', 'recipient_list'),
48 48
 			'required' => array('[EVENT_LIST]')
49 49
 			);
50
-		$this->_MSGR->set_validator_config( $new_config );
50
+		$this->_MSGR->set_validator_config($new_config);
51 51
 
52
-		if ( $this->_context != 'admin' )
52
+		if ($this->_context != 'admin')
53 53
 			$this->_valid_shortcodes_modifier[$this->_context]['event_list'] = array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'event_author', 'primary_registration_details', 'primary_registration_list', 'recipient_details', 'recipient_list');
54 54
 
55 55
 		$this->_specific_shortcode_excludes['content'] = array('[DISPLAY_PDF_URL]', '[DISPLAY_PDF_BUTTON]');
Please login to merge, or discard this patch.
Braces   +5 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,7 +1,8 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-if (!defined('EVENT_ESPRESSO_VERSION') )
3
+if (!defined('EVENT_ESPRESSO_VERSION') ) {
4 4
 	exit('NO direct script access allowed');
5
+}
5 6
 
6 7
 /**
7 8
  * Event Espresso
@@ -49,8 +50,9 @@  discard block
 block discarded – undo
49 50
 			);
50 51
 		$this->_MSGR->set_validator_config( $new_config );
51 52
 
52
-		if ( $this->_context != 'admin' )
53
-			$this->_valid_shortcodes_modifier[$this->_context]['event_list'] = array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'event_author', 'primary_registration_details', 'primary_registration_list', 'recipient_details', 'recipient_list');
53
+		if ( $this->_context != 'admin' ) {
54
+					$this->_valid_shortcodes_modifier[$this->_context]['event_list'] = array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'event_author', 'primary_registration_details', 'primary_registration_list', 'recipient_details', 'recipient_list');
55
+		}
54 56
 
55 57
 		$this->_specific_shortcode_excludes['content'] = array('[DISPLAY_PDF_URL]', '[DISPLAY_PDF_BUTTON]');
56 58
 	}
Please login to merge, or discard this patch.
validators/email/EE_Messages_Email_Registration_Summary_Validator.class.php 2 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-if (!defined('EVENT_ESPRESSO_VERSION') )
3
+if ( ! defined('EVENT_ESPRESSO_VERSION'))
4 4
 	exit('NO direct script access allowed');
5 5
 
6 6
 /**
@@ -30,11 +30,11 @@  discard block
 block discarded – undo
30 30
 class EE_Messages_Email_Registration_Validator extends EE_Messages_Validator {
31 31
 
32 32
 
33
-	public function __construct( $fields, $context ) {
33
+	public function __construct($fields, $context) {
34 34
 		$this->_m_name = 'email';
35 35
 		$this->_mt_name = 'registration';
36 36
 
37
-		parent::__construct( $fields, $context );
37
+		parent::__construct($fields, $context);
38 38
 	}
39 39
 
40 40
 	/**
@@ -47,9 +47,9 @@  discard block
 block discarded – undo
47 47
 			'shortcodes' => array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'event_author', 'primary_registration_details', 'primary_registration_list', 'recipient_details', 'recipient_list'),
48 48
 			'required' => array('[EVENT_LIST]')
49 49
 			);
50
-		$this->_MSGR->set_validator_config( $new_config );
50
+		$this->_MSGR->set_validator_config($new_config);
51 51
 
52
-		if ( $this->_context != 'admin' )
52
+		if ($this->_context != 'admin')
53 53
 			$this->_valid_shortcodes_modifier[$this->_context]['event_list'] = array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'event_author', 'primary_registration_details', 'primary_registration_list', 'recipient_details', 'recipient_list');
54 54
 
55 55
 		$this->_specific_shortcode_excludes['content'] = array('[DISPLAY_PDF_URL]', '[DISPLAY_PDF_BUTTON]');
Please login to merge, or discard this patch.
Braces   +5 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,7 +1,8 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-if (!defined('EVENT_ESPRESSO_VERSION') )
3
+if (!defined('EVENT_ESPRESSO_VERSION') ) {
4 4
 	exit('NO direct script access allowed');
5
+}
5 6
 
6 7
 /**
7 8
  * Event Espresso
@@ -49,8 +50,9 @@  discard block
 block discarded – undo
49 50
 			);
50 51
 		$this->_MSGR->set_validator_config( $new_config );
51 52
 
52
-		if ( $this->_context != 'admin' )
53
-			$this->_valid_shortcodes_modifier[$this->_context]['event_list'] = array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'event_author', 'primary_registration_details', 'primary_registration_list', 'recipient_details', 'recipient_list');
53
+		if ( $this->_context != 'admin' ) {
54
+					$this->_valid_shortcodes_modifier[$this->_context]['event_list'] = array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'event_author', 'primary_registration_details', 'primary_registration_list', 'recipient_details', 'recipient_list');
55
+		}
54 56
 
55 57
 		$this->_specific_shortcode_excludes['content'] = array('[DISPLAY_PDF_URL]', '[DISPLAY_PDF_BUTTON]');
56 58
 	}
Please login to merge, or discard this patch.
messages/validators/html/EE_Messages_Html_Invoice_Validator.class.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@  discard block
 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
 /**
@@ -24,11 +24,11 @@  discard block
 block discarded – undo
24 24
  */
25 25
 class EE_Messages_Html_Receipt_Validator extends EE_Messages_Validator {
26 26
 
27
-	public function __construct( $fields, $context ) {
27
+	public function __construct($fields, $context) {
28 28
 		$this->_m_name = 'html';
29 29
 		$this->_mt_name = 'receipt';
30 30
 
31
-		parent::__construct( $fields, $context );
31
+		parent::__construct($fields, $context);
32 32
 	}
33 33
 
34 34
 	/**
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.
core/libraries/shortcodes/EE_Datetime_Shortcodes.lib.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   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-if (!defined('EVENT_ESPRESSO_VERSION') )
3
+if ( ! defined('EVENT_ESPRESSO_VERSION'))
4 4
 	exit('NO direct script access allowed');
5 5
 
6 6
 /**
@@ -61,13 +61,13 @@  discard block
 block discarded – undo
61 61
 	 * @param string $shortcode
62 62
 	 * @return string
63 63
 	 */
64
-	protected function _parser( $shortcode ) {
64
+	protected function _parser($shortcode) {
65 65
 
66
-		if ( ! $this->_data instanceof EE_Datetime ) {
66
+		if ( ! $this->_data instanceof EE_Datetime) {
67 67
 			return ''; //get out cause we can only parse with the datetime object.
68 68
 		}
69 69
 
70
-		switch ( $shortcode ) {
70
+		switch ($shortcode) {
71 71
 
72 72
 			case '[DATETIME_START]' :
73 73
 				return $this->_data->get_i18n_datetime('DTT_EVT_start');
@@ -81,27 +81,27 @@  discard block
 block discarded – undo
81 81
 				return $this->_data->get_timezone();
82 82
 				break;
83 83
 			case '[DATE_START]' :
84
-				return $this->_data->get_i18n_datetime( 'DTT_EVT_start', get_option( 'date_format' ) );
84
+				return $this->_data->get_i18n_datetime('DTT_EVT_start', get_option('date_format'));
85 85
 				break;
86 86
 			case '[DATE_END]' :
87
-				return $this->_data->get_i18n_datetime( 'DTT_EVT_end', get_option( 'date_format' ) );
87
+				return $this->_data->get_i18n_datetime('DTT_EVT_end', get_option('date_format'));
88 88
 				break;
89 89
 			case '[TIME_START]' :
90
-				return $this->_data->get_i18n_datetime( 'DTT_EVT_start', get_option( 'time_format' ) );
90
+				return $this->_data->get_i18n_datetime('DTT_EVT_start', get_option('time_format'));
91 91
 				break;
92 92
 			case '[TIME_END]' :
93
-				return $this->_data->get_i18n_datetime( 'DTT_EVT_end', get_option( 'time_format' ) );
93
+				return $this->_data->get_i18n_datetime('DTT_EVT_end', get_option('time_format'));
94 94
 				break;
95 95
 		}
96 96
 
97
-		if ( strpos( $shortcode, '[ICAL_LINK_*') !== FALSE  ) {
98
-			$attrs = $this->_get_shortcode_attrs( $shortcode );
97
+		if (strpos($shortcode, '[ICAL_LINK_*') !== FALSE) {
98
+			$attrs = $this->_get_shortcode_attrs($shortcode);
99 99
 			
100
-			$link_text = empty( $attrs['link_text'] ) ?  __( 'Add to iCal Calendar', 'event_espresso' ) : $attrs['link_text'];
100
+			$link_text = empty($attrs['link_text']) ? __('Add to iCal Calendar', 'event_espresso') : $attrs['link_text'];
101 101
 			
102
-			$URL = add_query_arg( array( 'ee' => 'download_ics_file', 'ics_id' => $this->_data->ID() ), site_url() );
102
+			$URL = add_query_arg(array('ee' => 'download_ics_file', 'ics_id' => $this->_data->ID()), site_url());
103 103
 		
104
-			return '<a class="ee-ical" href="' . $URL . '">' . $link_text . '</a>';
104
+			return '<a class="ee-ical" href="'.$URL.'">'.$link_text.'</a>';
105 105
 			
106 106
 		}
107 107
 
Please login to merge, or discard this patch.
modules/event_single/EED_Event_Single.module.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   +73 added lines, -73 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
 	 * @return EED_Event_Single
36 36
 	 */
37 37
 	public static function instance() {
38
-		return parent::get_instance( __CLASS__ );
38
+		return parent::get_instance(__CLASS__);
39 39
 	}
40 40
 
41 41
 
@@ -47,9 +47,9 @@  discard block
 block discarded – undo
47 47
 	 *  @return 	void
48 48
 	 */
49 49
 	public static function set_hooks() {
50
-		add_filter( 'FHEE_run_EE_wp', '__return_true' );
51
-		add_action( 'wp_loaded', array( 'EED_Event_Single', 'set_definitions' ), 2 );
52
-		EE_Config::register_route( __( 'event', 'event_espresso' ), 'Event_Single', 'run' );
50
+		add_filter('FHEE_run_EE_wp', '__return_true');
51
+		add_action('wp_loaded', array('EED_Event_Single', 'set_definitions'), 2);
52
+		EE_Config::register_route(__('event', 'event_espresso'), 'Event_Single', 'run');
53 53
 	}
54 54
 
55 55
 	/**
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
 	 *  @return 	void
60 60
 	 */
61 61
 	public static function set_hooks_admin() {
62
-		add_action( 'wp_loaded', array( 'EED_Event_Single', 'set_definitions' ), 2 );
62
+		add_action('wp_loaded', array('EED_Event_Single', 'set_definitions'), 2);
63 63
 	}
64 64
 
65 65
 
@@ -73,8 +73,8 @@  discard block
 block discarded – undo
73 73
 	 * @return void
74 74
 	 */
75 75
 	public static function set_definitions() {
76
-		define( 'EVENT_SINGLE_ASSETS_URL', plugin_dir_url( __FILE__ ) . 'assets' . DS );
77
-		define( 'EVENT_SINGLE_TEMPLATES_PATH', plugin_dir_path( __FILE__ ) . 'templates' . DS );
76
+		define('EVENT_SINGLE_ASSETS_URL', plugin_dir_url(__FILE__).'assets'.DS);
77
+		define('EVENT_SINGLE_TEMPLATES_PATH', plugin_dir_path(__FILE__).'templates'.DS);
78 78
 	}
79 79
 
80 80
 
@@ -84,10 +84,10 @@  discard block
 block discarded – undo
84 84
 	 *
85 85
 	 * @void
86 86
 	 */
87
-	protected function set_config(){
88
-		$this->set_config_section( 'template_settings' );
89
-		$this->set_config_class( 'EE_Event_Single_Config' );
90
-		$this->set_config_name( 'EED_Event_Single' );
87
+	protected function set_config() {
88
+		$this->set_config_section('template_settings');
89
+		$this->set_config_class('EE_Event_Single_Config');
90
+		$this->set_config_name('EED_Event_Single');
91 91
 	}
92 92
 
93 93
 
@@ -100,35 +100,35 @@  discard block
 block discarded – undo
100 100
 	 * @param \EE_Event_Single_Config $config
101 101
 	 * @return \EE_Template_Part_Manager
102 102
 	 */
103
-	public function initialize_template_parts( EE_Event_Single_Config $config = null ) {
103
+	public function initialize_template_parts(EE_Event_Single_Config $config = null) {
104 104
 		$config = $config instanceof EE_Event_Single_Config ? $config : $this->config();
105 105
 		EEH_Autoloader::instance()->register_template_part_autoloaders();
106 106
 		$template_parts = new EE_Template_Part_Manager();
107 107
 		$template_parts->add_template_part(
108 108
 			'tickets',
109
-			__( 'Ticket Selector', 'event_espresso' ),
109
+			__('Ticket Selector', 'event_espresso'),
110 110
 			'content-espresso_events-tickets.php',
111 111
 			$config->display_order_tickets
112 112
 		);
113 113
 		$template_parts->add_template_part(
114 114
 			'datetimes',
115
-			__( 'Dates and Times', 'event_espresso' ),
115
+			__('Dates and Times', 'event_espresso'),
116 116
 			'content-espresso_events-datetimes.php',
117 117
 			$config->display_order_datetimes
118 118
 		);
119 119
 		$template_parts->add_template_part(
120 120
 			'event',
121
-			__( 'Event Description', 'event_espresso' ),
121
+			__('Event Description', 'event_espresso'),
122 122
 			'content-espresso_events-details.php',
123 123
 			$config->display_order_event
124 124
 		);
125 125
 		$template_parts->add_template_part(
126 126
 			'venue',
127
-			__( 'Venue Information', 'event_espresso' ),
127
+			__('Venue Information', 'event_espresso'),
128 128
 			'content-espresso_events-venues.php',
129 129
 			$config->display_order_venue
130 130
 		);
131
-		do_action( 'AHEE__EED_Event_Single__initialize_template_parts', $template_parts );
131
+		do_action('AHEE__EED_Event_Single__initialize_template_parts', $template_parts);
132 132
 		return $template_parts;
133 133
 	}
134 134
 
@@ -142,15 +142,15 @@  discard block
 block discarded – undo
142 142
 	 * @param WP $WP
143 143
 	 * @return    void
144 144
 	 */
145
-	public function run( $WP ) {
145
+	public function run($WP) {
146 146
 		// ensure valid EE_Events_Single_Config() object exists
147 147
 		$this->set_config();
148 148
 		// check what template is loaded
149
-		add_filter( 'template_include',  array( $this, 'template_include' ), 999, 1 );
150
-		add_filter( 'FHEE__EED_Ticket_Selector__load_tckt_slctr_assets', '__return_true' );
149
+		add_filter('template_include', array($this, 'template_include'), 999, 1);
150
+		add_filter('FHEE__EED_Ticket_Selector__load_tckt_slctr_assets', '__return_true');
151 151
 		// load css
152
-		add_action('wp_enqueue_scripts', array( $this, 'wp_enqueue_scripts' ), 10 );
153
-		EE_Registry::instance()->load_helper( 'Venue_View' );
152
+		add_action('wp_enqueue_scripts', array($this, 'wp_enqueue_scripts'), 10);
153
+		EE_Registry::instance()->load_helper('Venue_View');
154 154
 	}
155 155
 
156 156
 
@@ -162,25 +162,25 @@  discard block
 block discarded – undo
162 162
 	 * @param 	string $template
163 163
 	 * @return 	string
164 164
 	 */
165
-	public function template_include( $template ) {
165
+	public function template_include($template) {
166 166
 		global $post;
167 167
 		/** @type EE_Event_Single_Config $config */
168 168
 		$config = $this->config();
169
-		if ( $config->display_status_banner_single ) {
170
-			add_filter( 'the_title', array( 'EED_Event_Single', 'the_title' ), 100, 2 );
169
+		if ($config->display_status_banner_single) {
170
+			add_filter('the_title', array('EED_Event_Single', 'the_title'), 100, 2);
171 171
 		}
172 172
 		// not a custom template?
173 173
 		if (
174 174
 			EE_Front_Controller::instance()->get_selected_template() != 'single-espresso_events.php'
175
-			&& ! post_password_required( $post )
175
+			&& ! post_password_required($post)
176 176
 		) {
177 177
 			EEH_Template::load_espresso_theme_functions();
178 178
 			// then add extra event data via hooks
179
-			add_action( 'loop_start', array( 'EED_Event_Single', 'loop_start' ));
180
-			add_filter( 'the_content', array( 'EED_Event_Single', 'event_details' ), 100 );
181
-			add_action( 'loop_end', array( 'EED_Event_Single', 'loop_end' ));
179
+			add_action('loop_start', array('EED_Event_Single', 'loop_start'));
180
+			add_filter('the_content', array('EED_Event_Single', 'event_details'), 100);
181
+			add_action('loop_end', array('EED_Event_Single', 'loop_end'));
182 182
 			// don't display entry meta because the existing theme will take car of that
183
-			add_filter( 'FHEE__content_espresso_events_details_template__display_entry_meta', '__return_false' );
183
+			add_filter('FHEE__content_espresso_events_details_template__display_entry_meta', '__return_false');
184 184
 		}
185 185
 		return $template;
186 186
 	}
@@ -194,9 +194,9 @@  discard block
 block discarded – undo
194 194
 	 * @param 	array $wp_query_array an array containing the WP_Query object
195 195
 	 * @return 	void
196 196
 	 */
197
-	public static function loop_start( $wp_query_array ) {
197
+	public static function loop_start($wp_query_array) {
198 198
 		global $post;
199
-		do_action( 'AHEE_event_details_before_post', $post, $wp_query_array );
199
+		do_action('AHEE_event_details_before_post', $post, $wp_query_array);
200 200
 	}
201 201
 
202 202
 
@@ -209,9 +209,9 @@  discard block
 block discarded – undo
209 209
 	 * @param 	int 	$id
210 210
 	 * @return 	string
211 211
 	 */
212
-	public static function the_title( $title = '', $id = 0 ) {
212
+	public static function the_title($title = '', $id = 0) {
213 213
 		global $post;
214
-		return in_the_loop() && $post->ID == $id ? espresso_event_status_banner( $post->ID ) . $title :  $title;
214
+		return in_the_loop() && $post->ID == $id ? espresso_event_status_banner($post->ID).$title : $title;
215 215
 	}
216 216
 
217 217
 
@@ -222,7 +222,7 @@  discard block
 block discarded – undo
222 222
 	 * @param 	string 	$content
223 223
 	 * @return 	string
224 224
 	 */
225
-	public static function event_details( $content ) {
225
+	public static function event_details($content) {
226 226
 		global $post;
227 227
 		static $current_post_ID = 0;
228 228
 		if (
@@ -236,15 +236,15 @@  discard block
 block discarded – undo
236 236
 			// We want to allow those plugins to still do their thing and have access to our content, but depending on
237 237
 			// how your event content is being displayed (shortcode, CPT route, etc), this filter can get applied twice,
238 238
 			// so the following allows this filter to be applied multiple times, but only once for real
239
-			$current_post_ID = did_action( 'loop_start' ) ? $post->ID : 0;
240
-			if ( EE_Registry::instance()->CFG->template_settings->EED_Event_Single->use_sortable_display_order ) {
239
+			$current_post_ID = did_action('loop_start') ? $post->ID : 0;
240
+			if (EE_Registry::instance()->CFG->template_settings->EED_Event_Single->use_sortable_display_order) {
241 241
 				// we need to first remove this callback from being applied to the_content()
242 242
 				// (otherwise it will recurse and blow up the interweb)
243
-				remove_filter( 'the_content', array( 'EED_Event_Single', 'event_details' ), 100 );
243
+				remove_filter('the_content', array('EED_Event_Single', 'event_details'), 100);
244 244
 				EED_Event_Single::instance()->template_parts = EED_Event_Single::instance()->initialize_template_parts();
245
-				$content = EEH_Template::locate_template( 'content-espresso_events-details.php' );
246
-				$content = EED_Event_Single::instance()->template_parts->apply_template_part_filters( $content );
247
-				add_filter( 'the_content', array( 'EED_Event_Single', 'event_details' ), 100 );
245
+				$content = EEH_Template::locate_template('content-espresso_events-details.php');
246
+				$content = EED_Event_Single::instance()->template_parts->apply_template_part_filters($content);
247
+				add_filter('the_content', array('EED_Event_Single', 'event_details'), 100);
248 248
 			} else {
249 249
 				$content = EED_Event_Single::use_filterable_display_order();
250 250
 			}
@@ -265,19 +265,19 @@  discard block
 block discarded – undo
265 265
 		// it uses the_content() for displaying the $post->post_content
266 266
 		// so in order to load a template that uses the_content() from within a callback being used to filter the_content(),
267 267
 		// we need to first remove this callback from being applied to the_content() (otherwise it will recurse and blow up the interweb)
268
-		remove_filter( 'the_content', array( 'EED_Event_Single', 'event_details' ), 100 );
268
+		remove_filter('the_content', array('EED_Event_Single', 'event_details'), 100);
269 269
 		//now add additional content
270
-		add_filter( 'the_content', array( 'EED_Event_Single', 'event_datetimes' ), 110, 1 );
271
-		add_filter( 'the_content', array( 'EED_Event_Single', 'event_tickets' ), 120, 1 );
272
-		add_filter( 'the_content', array( 'EED_Event_Single', 'event_venues' ), 130, 1 );
273
-		do_action( 'AHEE__EED_Event_Single__use_filterable_display_order__after_add_filters' );
270
+		add_filter('the_content', array('EED_Event_Single', 'event_datetimes'), 110, 1);
271
+		add_filter('the_content', array('EED_Event_Single', 'event_tickets'), 120, 1);
272
+		add_filter('the_content', array('EED_Event_Single', 'event_venues'), 130, 1);
273
+		do_action('AHEE__EED_Event_Single__use_filterable_display_order__after_add_filters');
274 274
 		// now load our template
275
-		$content = EEH_Template::locate_template( 'content-espresso_events-details.php' );
275
+		$content = EEH_Template::locate_template('content-espresso_events-details.php');
276 276
 		//now add our filter back in, plus some others
277
-		add_filter( 'the_content', array( 'EED_Event_Single', 'event_details' ), 100 );
278
-		remove_filter( 'the_content', array( 'EED_Event_Single', 'event_datetimes' ), 110 );
279
-		remove_filter( 'the_content', array( 'EED_Event_Single', 'event_tickets' ), 120 );
280
-		remove_filter( 'the_content', array( 'EED_Event_Single', 'event_venues' ), 130 );
277
+		add_filter('the_content', array('EED_Event_Single', 'event_details'), 100);
278
+		remove_filter('the_content', array('EED_Event_Single', 'event_datetimes'), 110);
279
+		remove_filter('the_content', array('EED_Event_Single', 'event_tickets'), 120);
280
+		remove_filter('the_content', array('EED_Event_Single', 'event_venues'), 130);
281 281
 		// we're not returning the $content directly because the template we are loading uses the_content (or the_excerpt)
282 282
 		return $content;
283 283
 	}
@@ -291,8 +291,8 @@  discard block
 block discarded – undo
291 291
 	 * @param        string $content
292 292
 	 * @return        string
293 293
 	 */
294
-	public static function event_datetimes( $content ) {
295
-		return EEH_Template::locate_template( 'content-espresso_events-datetimes.php' ) . $content;
294
+	public static function event_datetimes($content) {
295
+		return EEH_Template::locate_template('content-espresso_events-datetimes.php').$content;
296 296
 	}
297 297
 
298 298
 
@@ -304,8 +304,8 @@  discard block
 block discarded – undo
304 304
 	 * @param        string $content
305 305
 	 * @return        string
306 306
 	 */
307
-	public static function event_tickets( $content ) {
308
-		return EEH_Template::locate_template( 'content-espresso_events-tickets.php' ) . $content;
307
+	public static function event_tickets($content) {
308
+		return EEH_Template::locate_template('content-espresso_events-tickets.php').$content;
309 309
 	}
310 310
 
311 311
 
@@ -317,8 +317,8 @@  discard block
 block discarded – undo
317 317
 	 * @param 	string $content
318 318
 	 * @return 	string
319 319
 	 */
320
-	public static function event_venue( $content ) {
321
-		return EED_Event_Single::event_venues( $content );
320
+	public static function event_venue($content) {
321
+		return EED_Event_Single::event_venues($content);
322 322
 	}
323 323
 
324 324
 
@@ -330,8 +330,8 @@  discard block
 block discarded – undo
330 330
 	 * @param        string $content
331 331
 	 * @return        string
332 332
 	 */
333
-	public static function event_venues( $content ) {
334
-		return $content . EEH_Template::locate_template( 'content-espresso_events-venues.php' );
333
+	public static function event_venues($content) {
334
+		return $content.EEH_Template::locate_template('content-espresso_events-venues.php');
335 335
 	}
336 336
 
337 337
 
@@ -343,9 +343,9 @@  discard block
 block discarded – undo
343 343
 	 * 	@param		array 	$wp_query_array an array containing the WP_Query object
344 344
 	 *  	@return 		void
345 345
 	 */
346
-	public static function loop_end( $wp_query_array ) {
346
+	public static function loop_end($wp_query_array) {
347 347
 		global $post;
348
-		do_action( 'AHEE_event_details_after_post', $post, $wp_query_array );
348
+		do_action('AHEE_event_details_after_post', $post, $wp_query_array);
349 349
 	}
350 350
 
351 351
 
@@ -358,18 +358,18 @@  discard block
 block discarded – undo
358 358
 	 */
359 359
 	public function wp_enqueue_scripts() {
360 360
 		// get some style
361
-		if ( apply_filters( 'FHEE_enable_default_espresso_css', TRUE ) && apply_filters( 'FHEE__EED_Event_Single__wp_enqueue_scripts__enable_css', TRUE )) {
362
-			EE_Registry::instance()->load_helper( 'File' );
361
+		if (apply_filters('FHEE_enable_default_espresso_css', TRUE) && apply_filters('FHEE__EED_Event_Single__wp_enqueue_scripts__enable_css', TRUE)) {
362
+			EE_Registry::instance()->load_helper('File');
363 363
 			// first check uploads folder
364
-			if ( is_readable( get_stylesheet_directory() . $this->theme . DS . 'style.css' )) {
365
-				wp_register_style( $this->theme, get_stylesheet_directory_uri() . $this->theme . DS . 'style.css', array( 'dashicons', 'espresso_default' ));
364
+			if (is_readable(get_stylesheet_directory().$this->theme.DS.'style.css')) {
365
+				wp_register_style($this->theme, get_stylesheet_directory_uri().$this->theme.DS.'style.css', array('dashicons', 'espresso_default'));
366 366
 			} else {
367
-				wp_register_style( $this->theme, EE_TEMPLATES_URL . $this->theme . DS . 'style.css', array( 'dashicons', 'espresso_default' ));
367
+				wp_register_style($this->theme, EE_TEMPLATES_URL.$this->theme.DS.'style.css', array('dashicons', 'espresso_default'));
368 368
 			}
369
-			wp_enqueue_script( $this->theme );
370
-			if ( EE_Registry::instance()->CFG->map_settings->use_google_maps ) {
371
-				EE_Registry::instance()->load_helper( 'Maps' );
372
-				add_action('wp_enqueue_scripts', array( 'EEH_Maps', 'espresso_google_map_js' ), 11 );
369
+			wp_enqueue_script($this->theme);
370
+			if (EE_Registry::instance()->CFG->map_settings->use_google_maps) {
371
+				EE_Registry::instance()->load_helper('Maps');
372
+				add_action('wp_enqueue_scripts', array('EEH_Maps', 'espresso_google_map_js'), 11);
373 373
 			}
374 374
 		}
375 375
 	}
@@ -388,12 +388,12 @@  discard block
 block discarded – undo
388 388
 	 *  @return 	bool
389 389
 	 */
390 390
 	public static function display_venue() {
391
-		EE_Registry::instance()->load_helper( 'Venue_View' );
391
+		EE_Registry::instance()->load_helper('Venue_View');
392 392
 		/** @type EE_Event_Single_Config $config */
393 393
 		$config = EED_Event_Single::instance()->config();
394
-		$display_venue= isset( $config->display_venue ) ? $config->display_venue : TRUE;
394
+		$display_venue = isset($config->display_venue) ? $config->display_venue : TRUE;
395 395
 		$venue_name = EEH_Venue_View::venue_name();
396
-		return $display_venue && ! empty( $venue_name ) ? TRUE : FALSE;
396
+		return $display_venue && ! empty($venue_name) ? TRUE : FALSE;
397 397
 	}
398 398
 
399 399
 
Please login to merge, or discard this patch.
modules/ical/EED_Ical.module.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 Espresso
4 6
  *
Please login to merge, or discard this patch.
Spacing   +70 added lines, -70 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
 	 * @return EED_Ical
33 33
 	 */
34 34
 	public static function instance() {
35
-		return parent::get_instance( __CLASS__ );
35
+		return parent::get_instance(__CLASS__);
36 36
 	}
37 37
 
38 38
 
@@ -45,9 +45,9 @@  discard block
 block discarded – undo
45 45
 	 */
46 46
 	public static function set_hooks() {
47 47
 		// create download buttons
48
-		add_filter( 'FHEE__espresso_list_of_event_dates__datetime_html', array( 'EED_Ical', 'generate_add_to_iCal_button' ), 10, 2 );
48
+		add_filter('FHEE__espresso_list_of_event_dates__datetime_html', array('EED_Ical', 'generate_add_to_iCal_button'), 10, 2);
49 49
 		 // process ics download request
50
-		EE_Config::register_route( 'download_ics_file', 'EED_Ical', 'download_ics_file' );
50
+		EE_Config::register_route('download_ics_file', 'EED_Ical', 'download_ics_file');
51 51
 	}
52 52
 
53 53
 
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
 	 * @param    WP $WP
71 71
 	 * @return    void
72 72
 	 */
73
-	public function run( $WP ) {}
73
+	public function run($WP) {}
74 74
 
75 75
 
76 76
 
@@ -82,30 +82,30 @@  discard block
 block discarded – undo
82 82
 	 * @param $datetime
83 83
 	 * @return    string
84 84
 	 */
85
-	public static function generate_add_to_iCal_button( $html, $datetime ) {
85
+	public static function generate_add_to_iCal_button($html, $datetime) {
86 86
 		// first verify a proper datetime object has been received
87
-		if ( $datetime instanceof EE_Datetime ) {
87
+		if ($datetime instanceof EE_Datetime) {
88 88
 			// set whether a link or submit button is shown
89
-			$iCal_type = apply_filters( 'FHEE__EED_Ical__generate_add_to_iCal_button__iCal_type', 'submit' );
89
+			$iCal_type = apply_filters('FHEE__EED_Ical__generate_add_to_iCal_button__iCal_type', 'submit');
90 90
 			// generate a link to the route we registered in set_hooks()
91
-			$URL = add_query_arg( array( 'ee' => 'download_ics_file', 'ics_id' => $datetime->ID() ), site_url() );
91
+			$URL = add_query_arg(array('ee' => 'download_ics_file', 'ics_id' => $datetime->ID()), site_url());
92 92
 			// what type ?
93
-			switch ( $iCal_type ) {
93
+			switch ($iCal_type) {
94 94
 				// submit buttons appear as buttons and are very compatible with a theme's style
95 95
 				case 'submit' :
96
-					$html .= '<form id="download-iCal-frm-' . $datetime->ID() . '" class="download-iCal-frm" action="' . $URL . '" method="post" >';
97
-					$html .= '<input type="submit" class="ee-ical-sbmt" value="&#xf145;" title="' . __( 'Add to iCal Calendar', 'event_espresso' ) . '"/>';
96
+					$html .= '<form id="download-iCal-frm-'.$datetime->ID().'" class="download-iCal-frm" action="'.$URL.'" method="post" >';
97
+					$html .= '<input type="submit" class="ee-ical-sbmt" value="&#xf145;" title="'.__('Add to iCal Calendar', 'event_espresso').'"/>';
98 98
 					$html .= '</form>';
99 99
 					break;
100 100
 				// buttons are just links that have been styled to appear as buttons, but may not be blend with a theme as well as submit buttons
101 101
 				case 'button' :
102
-					$html .= '<a class="ee-ical-btn small ee-button ee-roundish" href="' . $URL . '" title="' . __( 'Add to iCal Calendar', 'event_espresso' ) . '">';
102
+					$html .= '<a class="ee-ical-btn small ee-button ee-roundish" href="'.$URL.'" title="'.__('Add to iCal Calendar', 'event_espresso').'">';
103 103
 					$html .= ' <span class="dashicons dashicons-calendar"></span>';
104 104
 					$html .= '</a>';
105 105
 					break;
106 106
 				// links are just links that use the calendar dashicon
107 107
 				case 'icon' :
108
-					$html .= '<a class="ee-ical-lnk" href="' . $URL . '" title="' . __( 'Add to iCal Calendar', 'event_espresso' ) . '">';
108
+					$html .= '<a class="ee-ical-lnk" href="'.$URL.'" title="'.__('Add to iCal Calendar', 'event_espresso').'">';
109 109
 					$html .= ' <span class="dashicons dashicons-calendar"></span>';
110 110
 					$html .= '</a>';
111 111
 					break;
@@ -123,73 +123,73 @@  discard block
 block discarded – undo
123 123
 	 *  @return 	void
124 124
 	 */
125 125
 	public static function download_ics_file() {
126
-		if ( EE_Registry::instance()->REQ->is_set( 'ics_id' )) {
127
-			$DTT_ID = absint( EE_Registry::instance()->REQ->get( 'ics_id' ));
128
-			$datetime = EE_Registry::instance()->load_model( 'Datetime' )->get_one_by_ID( $DTT_ID );
129
-			if ( $datetime instanceof EE_Datetime ) {
126
+		if (EE_Registry::instance()->REQ->is_set('ics_id')) {
127
+			$DTT_ID = absint(EE_Registry::instance()->REQ->get('ics_id'));
128
+			$datetime = EE_Registry::instance()->load_model('Datetime')->get_one_by_ID($DTT_ID);
129
+			if ($datetime instanceof EE_Datetime) {
130 130
 				// get related event, venues, and event categories
131 131
 				$event = $datetime->event();
132 132
 				// get related category Term object and it's name
133 133
 				$category = $event->first_event_category();
134
-				if ( $category instanceof EE_Term ) {
134
+				if ($category instanceof EE_Term) {
135 135
 					$category = $category->name();
136 136
 				}
137 137
 				$location = '';
138 138
 				// get first related venue and convert to CSV string
139
-				$venue = $event->venues(array( 'limit'=>1 ));
140
-				if ( is_array( $venue ) && ! empty( $venue )) {
141
-					$venue = array_shift( $venue );
142
-					if ( $venue instanceof EE_Venue ) {
143
-						 EE_Registry::instance()->load_helper( 'Venue_View' );
144
-						$location = espresso_venue_raw_address( 'inline', $venue->ID(), FALSE );
139
+				$venue = $event->venues(array('limit'=>1));
140
+				if (is_array($venue) && ! empty($venue)) {
141
+					$venue = array_shift($venue);
142
+					if ($venue instanceof EE_Venue) {
143
+						 EE_Registry::instance()->load_helper('Venue_View');
144
+						$location = espresso_venue_raw_address('inline', $venue->ID(), FALSE);
145 145
 					}
146 146
 				}
147 147
 				// set variables, escape strings, convert timestamps to ics format, etc
148
-				$filename = $event->slug() . '-' . $datetime->start_date( 'Y-m-d' ) . '.ics';
149
-				$organizer = EED_Ical::_escape_ICal_data( EE_Registry::instance()->CFG->organization->name );
150
-				$UID = EED_Ical::_escape_ICal_data( md5( $event->name() . $event->ID() . $datetime->ID() ));
151
-				$org_email = EED_Ical::_escape_ICal_data( $datetime->ID() );
152
-				$timestamp = date( EED_Ical::iCal_datetime_format );
153
-				$location = EED_Ical::_escape_ICal_data( $location );
154
-				$summary = EED_Ical::_escape_ICal_data( $event->name() );
155
-				$description = EED_Ical::_escape_ICal_description( wp_strip_all_tags( $event->description() ));
148
+				$filename = $event->slug().'-'.$datetime->start_date('Y-m-d').'.ics';
149
+				$organizer = EED_Ical::_escape_ICal_data(EE_Registry::instance()->CFG->organization->name);
150
+				$UID = EED_Ical::_escape_ICal_data(md5($event->name().$event->ID().$datetime->ID()));
151
+				$org_email = EED_Ical::_escape_ICal_data($datetime->ID());
152
+				$timestamp = date(EED_Ical::iCal_datetime_format);
153
+				$location = EED_Ical::_escape_ICal_data($location);
154
+				$summary = EED_Ical::_escape_ICal_data($event->name());
155
+				$description = EED_Ical::_escape_ICal_description(wp_strip_all_tags($event->description()));
156 156
 				$status = $datetime->get_active_status();
157 157
 				$status = $status == EE_Datetime::cancelled ? 'Cancelled' : 'Confirmed';
158
-				$status = EED_Ical::_escape_ICal_data( $status );
159
-				$categories = EED_Ical::_escape_ICal_data( $category );
160
-				$url = EED_Ical::_escape_ICal_data( get_permalink( $event->ID() ));
161
-				$dtt_start = EED_Ical::_escape_ICal_data( date( EED_Ical::iCal_datetime_format, $datetime->start() ));
162
-				$dtt_end = EED_Ical::_escape_ICal_data( date( EED_Ical::iCal_datetime_format, $datetime->end() ));
158
+				$status = EED_Ical::_escape_ICal_data($status);
159
+				$categories = EED_Ical::_escape_ICal_data($category);
160
+				$url = EED_Ical::_escape_ICal_data(get_permalink($event->ID()));
161
+				$dtt_start = EED_Ical::_escape_ICal_data(date(EED_Ical::iCal_datetime_format, $datetime->start()));
162
+				$dtt_end = EED_Ical::_escape_ICal_data(date(EED_Ical::iCal_datetime_format, $datetime->end()));
163 163
 				// set headers
164
-				header( 'Content-type: text/calendar; charset=utf-8' );
165
-				header( 'Content-Disposition: attachment; filename="' . $filename . '"' );
166
-				header( 'Cache-Control: private, max-age=0, must-revalidate' );
167
-				header( 'Pragma: public' );
168
-				header( 'Content-Type: application/octet-stream' );
169
-				header( 'Content-Type: application/force-download' );
170
-				header( 'Cache-Control: no-cache, must-revalidate' );
171
-				header( 'Content-Transfer-Encoding: binary' );
172
-				header( 'Expires: Sat, 26 Jul 1997 05:00:00 GMT' ); // past date
173
-				ini_set( 'zlib.output_compression', '0' );
164
+				header('Content-type: text/calendar; charset=utf-8');
165
+				header('Content-Disposition: attachment; filename="'.$filename.'"');
166
+				header('Cache-Control: private, max-age=0, must-revalidate');
167
+				header('Pragma: public');
168
+				header('Content-Type: application/octet-stream');
169
+				header('Content-Type: application/force-download');
170
+				header('Cache-Control: no-cache, must-revalidate');
171
+				header('Content-Transfer-Encoding: binary');
172
+				header('Expires: Sat, 26 Jul 1997 05:00:00 GMT'); // past date
173
+				ini_set('zlib.output_compression', '0');
174 174
 				// echo the output
175
-				echo "BEGIN:VCALENDAR" . PHP_EOL;
176
-				echo "VERSION:2.0" . PHP_EOL;
177
-				echo "PRODID:-//{$organizer}//NONSGML PDA Calendar Version 1.0//EN" . PHP_EOL;
178
-				echo "CALSCALE:GREGORIAN" . PHP_EOL;
179
-				echo "BEGIN:VEVENT" . PHP_EOL;
180
-				echo "UID:{$UID}" . PHP_EOL;
181
-				echo "ORGANIZER:MAILTO:{$org_email}" . PHP_EOL;
182
-				echo "DTSTAMP:{$timestamp}" . PHP_EOL;
183
-				echo "LOCATION:{$location}" . PHP_EOL;
184
-				echo "SUMMARY:{$summary}" . PHP_EOL;
185
-				echo "DESCRIPTION:{$description}" . PHP_EOL;
186
-				echo "STATUS:{$status}" . PHP_EOL;
187
-				echo "CATEGORIES:{$categories}" . PHP_EOL;
188
-				echo "URL;VALUE=URI:{$url}" . PHP_EOL;
189
-				echo "DTSTART:{$dtt_start}" . PHP_EOL;
190
-				echo "DTEND:{$dtt_end}" . PHP_EOL;
191
-				echo "END:VEVENT" . PHP_EOL;
192
-				echo "END:VCALENDAR" . PHP_EOL;
175
+				echo "BEGIN:VCALENDAR".PHP_EOL;
176
+				echo "VERSION:2.0".PHP_EOL;
177
+				echo "PRODID:-//{$organizer}//NONSGML PDA Calendar Version 1.0//EN".PHP_EOL;
178
+				echo "CALSCALE:GREGORIAN".PHP_EOL;
179
+				echo "BEGIN:VEVENT".PHP_EOL;
180
+				echo "UID:{$UID}".PHP_EOL;
181
+				echo "ORGANIZER:MAILTO:{$org_email}".PHP_EOL;
182
+				echo "DTSTAMP:{$timestamp}".PHP_EOL;
183
+				echo "LOCATION:{$location}".PHP_EOL;
184
+				echo "SUMMARY:{$summary}".PHP_EOL;
185
+				echo "DESCRIPTION:{$description}".PHP_EOL;
186
+				echo "STATUS:{$status}".PHP_EOL;
187
+				echo "CATEGORIES:{$categories}".PHP_EOL;
188
+				echo "URL;VALUE=URI:{$url}".PHP_EOL;
189
+				echo "DTSTART:{$dtt_start}".PHP_EOL;
190
+				echo "DTEND:{$dtt_end}".PHP_EOL;
191
+				echo "END:VEVENT".PHP_EOL;
192
+				echo "END:VCALENDAR".PHP_EOL;
193 193
 			}
194 194
 		}
195 195
 		die();
@@ -204,8 +204,8 @@  discard block
 block discarded – undo
204 204
 	 *  	@param	string $string
205 205
 	 *  	@return	string
206 206
 	 */
207
-	private static function _escape_ICal_data( $string = '' ) {
208
-		return preg_replace( '/([\,;])/', '\\\$1', $string );
207
+	private static function _escape_ICal_data($string = '') {
208
+		return preg_replace('/([\,;])/', '\\\$1', $string);
209 209
 	}
210 210
 
211 211
 	/**
@@ -215,13 +215,13 @@  discard block
 block discarded – undo
215 215
 	 *  	@param	string $description
216 216
 	 *  	@return	string
217 217
 	 */
218
-	private static function _escape_ICal_description( $description = '' ) {
218
+	private static function _escape_ICal_description($description = '') {
219 219
 			
220 220
 			//Escape spcial chars within the decription
221
-			$description = EED_Ical::_escape_ICal_data( $description );
221
+			$description = EED_Ical::_escape_ICal_data($description);
222 222
 
223 223
 		    //Remove line breaks and output in iCal format
224
-		    $description = str_replace( array( "\r\n", "\n"), '\n', $description );
224
+		    $description = str_replace(array("\r\n", "\n"), '\n', $description);
225 225
 
226 226
 		return $description;
227 227
 	}
Please login to merge, or discard this patch.
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -220,8 +220,8 @@
 block discarded – undo
220 220
 			//Escape spcial chars within the decription
221 221
 			$description = EED_Ical::_escape_ICal_data( $description );
222 222
 
223
-		    //Remove line breaks and output in iCal format
224
-		    $description = str_replace( array( "\r\n", "\n"), '\n', $description );
223
+			//Remove line breaks and output in iCal format
224
+			$description = str_replace( array( "\r\n", "\n"), '\n', $description );
225 225
 
226 226
 		return $description;
227 227
 	}
Please login to merge, or discard this patch.
modules/single_page_checkout/EED_Single_Page_Checkout.module.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 Espresso
4 6
  *
Please login to merge, or discard this patch.
Doc Comments   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -280,7 +280,7 @@  discard block
 block discarded – undo
280 280
 	 *    process_registration_from_admin
281 281
 	 *
282 282
 	 * @access    public
283
-	 * @return    int
283
+	 * @return    EE_Transaction
284 284
 	 */
285 285
 	public static function process_registration_from_admin() {
286 286
 		EED_Single_Page_Checkout::load_reg_steps();
@@ -608,7 +608,7 @@  discard block
 block discarded – undo
608 608
 	 * _get_transaction_and_cart_for_previous_visit
609 609
 	 *
610 610
 	 * @access private
611
-	 * 	@return mixed EE_Transaction|NULL
611
+	 * 	@return EE_Transaction|null EE_Transaction|NULL
612 612
 	 */
613 613
 	private function _get_transaction_and_cart_for_previous_visit() {
614 614
 		/** @var $TXN_model EEM_Transaction */
@@ -677,7 +677,7 @@  discard block
 block discarded – undo
677 677
 	 * 	generates a new EE_Transaction object and adds it to the $_transaction property.
678 678
 	 *
679 679
 	 * 	@access private
680
-	 * 	@return mixed EE_Transaction|NULL
680
+	 * 	@return EE_Transaction|null EE_Transaction|NULL
681 681
 	 */
682 682
 	private function _initialize_transaction() {
683 683
 		try {
Please login to merge, or discard this patch.
Spacing   +273 added lines, -273 removed lines patch added patch discarded remove patch
@@ -38,8 +38,8 @@  discard block
 block discarded – undo
38 38
 	 * @return EED_Single_Page_Checkout
39 39
 	 */
40 40
 	public static function instance() {
41
-		add_filter( 'EED_Single_Page_Checkout__SPCO_active', '__return_true' );
42
-		return parent::get_instance( __CLASS__ );
41
+		add_filter('EED_Single_Page_Checkout__SPCO_active', '__return_true');
42
+		return parent::get_instance(__CLASS__);
43 43
 	}
44 44
 
45 45
 
@@ -84,22 +84,22 @@  discard block
 block discarded – undo
84 84
 	 */
85 85
 	public static function set_hooks_admin() {
86 86
 		EED_Single_Page_Checkout::set_definitions();
87
-		if ( defined( 'DOING_AJAX' )) {
87
+		if (defined('DOING_AJAX')) {
88 88
 			// going to start an output buffer in case anything gets accidentally output that might disrupt our JSON response
89 89
 			ob_start();
90 90
 			EED_Single_Page_Checkout::load_request_handler();
91 91
 			EED_Single_Page_Checkout::load_reg_steps();
92 92
 		} else {
93 93
 			// hook into the top of pre_get_posts to set the reg step routing, which gives other modules or plugins a chance to modify the reg steps, but just before the routes get called
94
-			add_action( 'pre_get_posts', array( 'EED_Single_Page_Checkout', 'load_reg_steps' ), 1 );
94
+			add_action('pre_get_posts', array('EED_Single_Page_Checkout', 'load_reg_steps'), 1);
95 95
 		}
96 96
 		// set ajax hooks
97
-		add_action( 'wp_ajax_process_reg_step', array( 'EED_Single_Page_Checkout', 'process_reg_step' ));
98
-		add_action( 'wp_ajax_nopriv_process_reg_step', array( 'EED_Single_Page_Checkout', 'process_reg_step' ));
99
-		add_action( 'wp_ajax_display_spco_reg_step', array( 'EED_Single_Page_Checkout', 'display_reg_step' ));
100
-		add_action( 'wp_ajax_nopriv_display_spco_reg_step', array( 'EED_Single_Page_Checkout', 'display_reg_step' ));
101
-		add_action( 'wp_ajax_update_reg_step', array( 'EED_Single_Page_Checkout', 'update_reg_step' ));
102
-		add_action( 'wp_ajax_nopriv_update_reg_step', array( 'EED_Single_Page_Checkout', 'update_reg_step' ));
97
+		add_action('wp_ajax_process_reg_step', array('EED_Single_Page_Checkout', 'process_reg_step'));
98
+		add_action('wp_ajax_nopriv_process_reg_step', array('EED_Single_Page_Checkout', 'process_reg_step'));
99
+		add_action('wp_ajax_display_spco_reg_step', array('EED_Single_Page_Checkout', 'display_reg_step'));
100
+		add_action('wp_ajax_nopriv_display_spco_reg_step', array('EED_Single_Page_Checkout', 'display_reg_step'));
101
+		add_action('wp_ajax_update_reg_step', array('EED_Single_Page_Checkout', 'update_reg_step'));
102
+		add_action('wp_ajax_nopriv_update_reg_step', array('EED_Single_Page_Checkout', 'update_reg_step'));
103 103
 	}
104 104
 
105 105
 
@@ -108,8 +108,8 @@  discard block
 block discarded – undo
108 108
 	 * 	process ajax request
109 109
 	 * @param string $ajax_action
110 110
 	 */
111
-	public static function process_ajax_request( $ajax_action ) {
112
-		EE_Registry::instance()->REQ->set( 'action', $ajax_action );
111
+	public static function process_ajax_request($ajax_action) {
112
+		EE_Registry::instance()->REQ->set('action', $ajax_action);
113 113
 		EED_Single_Page_Checkout::instance()->_initialize();
114 114
 	}
115 115
 
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
 	 * 	ajax display registration step
120 120
 	 */
121 121
 	public static function display_reg_step() {
122
-		EED_Single_Page_Checkout::process_ajax_request( 'display_spco_reg_step' );
122
+		EED_Single_Page_Checkout::process_ajax_request('display_spco_reg_step');
123 123
 	}
124 124
 
125 125
 
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
 	 * 	ajax process registration step
129 129
 	 */
130 130
 	public static function process_reg_step() {
131
-		EED_Single_Page_Checkout::process_ajax_request( 'process_reg_step' );
131
+		EED_Single_Page_Checkout::process_ajax_request('process_reg_step');
132 132
 	}
133 133
 
134 134
 
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
 	 * 	ajax process registration step
138 138
 	 */
139 139
 	public static function update_reg_step() {
140
-		EED_Single_Page_Checkout::process_ajax_request( 'update_reg_step' );
140
+		EED_Single_Page_Checkout::process_ajax_request('update_reg_step');
141 141
 	}
142 142
 
143 143
 
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
 	 * @return void
150 150
 	 */
151 151
 	public static function update_checkout() {
152
-		EED_Single_Page_Checkout::process_ajax_request( 'update_checkout' );
152
+		EED_Single_Page_Checkout::process_ajax_request('update_checkout');
153 153
 	}
154 154
 
155 155
 
@@ -162,8 +162,8 @@  discard block
 block discarded – undo
162 162
 	 */
163 163
 	public static function load_request_handler() {
164 164
 		// load core Request_Handler class
165
-		if ( ! isset( EE_Registry::instance()->REQ )) {
166
-			EE_Registry::instance()->load_core( 'Request_Handler' );
165
+		if ( ! isset(EE_Registry::instance()->REQ)) {
166
+			EE_Registry::instance()->load_core('Request_Handler');
167 167
 		}
168 168
 	}
169 169
 
@@ -176,14 +176,14 @@  discard block
 block discarded – undo
176 176
 	 *  @return 	void
177 177
 	 */
178 178
 	public static function set_definitions() {
179
-		define( 'SPCO_BASE_PATH', rtrim( str_replace( array( '\\', '/' ), DS, plugin_dir_path( __FILE__ )), DS ) . DS );
180
-		define( 'SPCO_CSS_URL', plugin_dir_url( __FILE__ ) . 'css' . DS );
181
-		define( 'SPCO_IMG_URL', plugin_dir_url( __FILE__ ) . 'img' . DS );
182
-		define( 'SPCO_JS_URL', plugin_dir_url( __FILE__ ) . 'js' . DS );
183
-		define( 'SPCO_INC_PATH', SPCO_BASE_PATH . 'inc' . DS );
184
-		define( 'SPCO_REG_STEPS_PATH', SPCO_BASE_PATH . 'reg_steps' . DS );
185
-		define( 'SPCO_TEMPLATES_PATH', SPCO_BASE_PATH . 'templates' . DS );
186
-		EEH_Autoloader::register_autoloaders_for_each_file_in_folder( SPCO_BASE_PATH, TRUE );
179
+		define('SPCO_BASE_PATH', rtrim(str_replace(array('\\', '/'), DS, plugin_dir_path(__FILE__)), DS).DS);
180
+		define('SPCO_CSS_URL', plugin_dir_url(__FILE__).'css'.DS);
181
+		define('SPCO_IMG_URL', plugin_dir_url(__FILE__).'img'.DS);
182
+		define('SPCO_JS_URL', plugin_dir_url(__FILE__).'js'.DS);
183
+		define('SPCO_INC_PATH', SPCO_BASE_PATH.'inc'.DS);
184
+		define('SPCO_REG_STEPS_PATH', SPCO_BASE_PATH.'reg_steps'.DS);
185
+		define('SPCO_TEMPLATES_PATH', SPCO_BASE_PATH.'templates'.DS);
186
+		EEH_Autoloader::register_autoloaders_for_each_file_in_folder(SPCO_BASE_PATH, TRUE);
187 187
 	}
188 188
 
189 189
 
@@ -198,31 +198,31 @@  discard block
 block discarded – undo
198 198
 	 */
199 199
 	public static function load_reg_steps() {
200 200
 		static $reg_steps_loaded = FALSE;
201
-		if ( $reg_steps_loaded ) {
201
+		if ($reg_steps_loaded) {
202 202
 			return;
203 203
 		}
204 204
 		// load EE_SPCO_Reg_Step base class
205 205
 //		EE_Registry::instance()->load_file( SPCO_INC_PATH, 'EE_SPCO_Reg_Step', 'class'  );
206 206
 		// filter list of reg_steps
207
-		$reg_steps_to_load = apply_filters( 'AHEE__SPCO__load_reg_steps__reg_steps_to_load', EED_Single_Page_Checkout::get_reg_steps() );
207
+		$reg_steps_to_load = apply_filters('AHEE__SPCO__load_reg_steps__reg_steps_to_load', EED_Single_Page_Checkout::get_reg_steps());
208 208
 		// sort by key (order)
209
-		ksort( $reg_steps_to_load );
209
+		ksort($reg_steps_to_load);
210 210
 		// loop through folders
211
-		foreach ( $reg_steps_to_load as $order => $reg_step ) {
211
+		foreach ($reg_steps_to_load as $order => $reg_step) {
212 212
 			// we need a
213
-			if ( isset( $reg_step['file_path'], $reg_step['class_name'], $reg_step['slug'] )) {
213
+			if (isset($reg_step['file_path'], $reg_step['class_name'], $reg_step['slug'])) {
214 214
 				// copy over to the reg_steps_array
215
-				EED_Single_Page_Checkout::$_reg_steps_array[ $order ] = $reg_step;
215
+				EED_Single_Page_Checkout::$_reg_steps_array[$order] = $reg_step;
216 216
 				// register custom key route for each reg step ( ie: step=>"slug" - this is the entire reason we load the reg steps array now )
217
-				EE_Config::register_route( $reg_step['slug'], 'EED_Single_Page_Checkout', 'run', 'step' );
217
+				EE_Config::register_route($reg_step['slug'], 'EED_Single_Page_Checkout', 'run', 'step');
218 218
 				// add AJAX or other hooks
219
-				if ( isset( $reg_step['has_hooks'] ) && $reg_step['has_hooks'] ) {
219
+				if (isset($reg_step['has_hooks']) && $reg_step['has_hooks']) {
220 220
 					// setup autoloaders if necessary
221
-					if ( ! class_exists( $reg_step['class_name'] )) {
222
-						EEH_Autoloader::register_autoloaders_for_each_file_in_folder( $reg_step['file_path'], TRUE );
221
+					if ( ! class_exists($reg_step['class_name'])) {
222
+						EEH_Autoloader::register_autoloaders_for_each_file_in_folder($reg_step['file_path'], TRUE);
223 223
 					}
224
-					if ( is_callable( $reg_step['class_name'], 'set_hooks' )) {
225
-						call_user_func( array( $reg_step['class_name'], 'set_hooks' ));
224
+					if (is_callable($reg_step['class_name'], 'set_hooks')) {
225
+						call_user_func(array($reg_step['class_name'], 'set_hooks'));
226 226
 					}
227 227
 				}
228 228
 			}
@@ -241,28 +241,28 @@  discard block
 block discarded – undo
241 241
 	 */
242 242
 	public static function get_reg_steps() {
243 243
 		$reg_steps = EE_Registry::instance()->CFG->registration->reg_steps;
244
-		if ( empty( $reg_steps )) {
244
+		if (empty($reg_steps)) {
245 245
 			$reg_steps = array(
246 246
 				10 => array(
247
-					'file_path' => SPCO_REG_STEPS_PATH . 'attendee_information',
247
+					'file_path' => SPCO_REG_STEPS_PATH.'attendee_information',
248 248
 					'class_name' => 'EE_SPCO_Reg_Step_Attendee_Information',
249 249
 					'slug' => 'attendee_information',
250 250
 					'has_hooks' => FALSE
251 251
 				),
252 252
 				20 => array(
253
-					'file_path' => SPCO_REG_STEPS_PATH . 'registration_confirmation',
253
+					'file_path' => SPCO_REG_STEPS_PATH.'registration_confirmation',
254 254
 					'class_name' => 'EE_SPCO_Reg_Step_Registration_Confirmation',
255 255
 					'slug' => 'registration_confirmation',
256 256
 					'has_hooks' => FALSE
257 257
 				),
258 258
 				30 => array(
259
-					'file_path' => SPCO_REG_STEPS_PATH . 'payment_options',
259
+					'file_path' => SPCO_REG_STEPS_PATH.'payment_options',
260 260
 					'class_name' => 'EE_SPCO_Reg_Step_Payment_Options',
261 261
 					'slug' => 'payment_options',
262 262
 					'has_hooks' => TRUE
263 263
 				),
264 264
 				999 => array(
265
-					'file_path' => SPCO_REG_STEPS_PATH . 'finalize_registration',
265
+					'file_path' => SPCO_REG_STEPS_PATH.'finalize_registration',
266 266
 					'class_name' => 'EE_SPCO_Reg_Step_Finalize_Registration',
267 267
 					'slug' => 'finalize_registration',
268 268
 					'has_hooks' => FALSE
@@ -282,9 +282,9 @@  discard block
 block discarded – undo
282 282
 	 */
283 283
 	public static function registration_checkout_for_admin() {
284 284
 		EED_Single_Page_Checkout::load_reg_steps();
285
-		EE_Registry::instance()->REQ->set( 'step', 'attendee_information' );
286
-		EE_Registry::instance()->REQ->set( 'action', 'display_spco_reg_step' );
287
-		EE_Registry::instance()->REQ->set( 'process_form_submission', false );
285
+		EE_Registry::instance()->REQ->set('step', 'attendee_information');
286
+		EE_Registry::instance()->REQ->set('action', 'display_spco_reg_step');
287
+		EE_Registry::instance()->REQ->set('process_form_submission', false);
288 288
 		EED_Single_Page_Checkout::instance()->_initialize();
289 289
 		EED_Single_Page_Checkout::instance()->_display_spco_reg_form();
290 290
 		return EE_Registry::instance()->REQ->get_output();
@@ -300,14 +300,14 @@  discard block
 block discarded – undo
300 300
 	 */
301 301
 	public static function process_registration_from_admin() {
302 302
 		EED_Single_Page_Checkout::load_reg_steps();
303
-		EE_Registry::instance()->REQ->set( 'step', 'attendee_information' );
304
-		EE_Registry::instance()->REQ->set( 'action', 'process_reg_step' );
305
-		EE_Registry::instance()->REQ->set( 'process_form_submission', true );
303
+		EE_Registry::instance()->REQ->set('step', 'attendee_information');
304
+		EE_Registry::instance()->REQ->set('action', 'process_reg_step');
305
+		EE_Registry::instance()->REQ->set('process_form_submission', true);
306 306
 		EED_Single_Page_Checkout::instance()->_initialize();
307
-		if ( EED_Single_Page_Checkout::instance()->checkout->current_step->completed() ) {
308
-			$final_reg_step = end( EED_Single_Page_Checkout::instance()->checkout->reg_steps );
309
-			if ( $final_reg_step instanceof EE_SPCO_Reg_Step_Finalize_Registration ) {
310
-				if ( $final_reg_step->process_reg_step() ) {
307
+		if (EED_Single_Page_Checkout::instance()->checkout->current_step->completed()) {
308
+			$final_reg_step = end(EED_Single_Page_Checkout::instance()->checkout->reg_steps);
309
+			if ($final_reg_step instanceof EE_SPCO_Reg_Step_Finalize_Registration) {
310
+				if ($final_reg_step->process_reg_step()) {
311 311
 					return EED_Single_Page_Checkout::instance()->checkout->transaction;
312 312
 				}
313 313
 			}
@@ -324,8 +324,8 @@  discard block
 block discarded – undo
324 324
 	 * @param WP_Query $WP_Query
325 325
 	 * @return    void
326 326
 	 */
327
-	public function run( $WP_Query ) {
328
-		if ( $WP_Query instanceof WP_Query && $WP_Query->is_main_query() && apply_filters( 'FHEE__EED_Single_Page_Checkout__run', true )) {
327
+	public function run($WP_Query) {
328
+		if ($WP_Query instanceof WP_Query && $WP_Query->is_main_query() && apply_filters('FHEE__EED_Single_Page_Checkout__run', true)) {
329 329
 			$this->_initialize();
330 330
 		}
331 331
 	}
@@ -340,8 +340,8 @@  discard block
 block discarded – undo
340 340
 	 * @param WP_Query $WP_Query
341 341
 	 * @return    void
342 342
 	 */
343
-	public static function init( $WP_Query ) {
344
-		EED_Single_Page_Checkout::instance()->run( $WP_Query );
343
+	public static function init($WP_Query) {
344
+		EED_Single_Page_Checkout::instance()->run($WP_Query);
345 345
 	}
346 346
 
347 347
 
@@ -355,32 +355,32 @@  discard block
 block discarded – undo
355 355
 	 */
356 356
 	private function _initialize() {
357 357
 		// ensure SPCO doesn't run twice
358
-		if ( EED_Single_Page_Checkout::$_initialized ) {
358
+		if (EED_Single_Page_Checkout::$_initialized) {
359 359
 			return;
360 360
 		}
361 361
 		// setup the EE_Checkout object
362 362
 		$this->checkout = $this->_initialize_checkout();
363 363
 		// filter checkout
364
-		$this->checkout = apply_filters( 'FHEE__EED_Single_Page_Checkout___initialize__checkout', $this->checkout );
364
+		$this->checkout = apply_filters('FHEE__EED_Single_Page_Checkout___initialize__checkout', $this->checkout);
365 365
 		// get the $_GET
366 366
 		$this->_get_request_vars();
367 367
 		// filter continue_reg
368
-		$this->checkout->continue_reg = apply_filters( 'FHEE__EED_Single_Page_Checkout__init___continue_reg', TRUE, $this->checkout );
368
+		$this->checkout->continue_reg = apply_filters('FHEE__EED_Single_Page_Checkout__init___continue_reg', TRUE, $this->checkout);
369 369
 		// load the reg steps array
370
-		if ( ! $this->_load_and_instantiate_reg_steps() ) {
370
+		if ( ! $this->_load_and_instantiate_reg_steps()) {
371 371
 			EED_Single_Page_Checkout::$_initialized = true;
372 372
 			return;
373 373
 		}
374 374
 		// set the current step
375
-		$this->checkout->set_current_step( $this->checkout->step );
375
+		$this->checkout->set_current_step($this->checkout->step);
376 376
 		// and the next step
377 377
 		$this->checkout->set_next_step();
378 378
 		// was there already a valid transaction in the checkout from the session ?
379
-		if ( ! $this->checkout->transaction instanceof EE_Transaction ) {
379
+		if ( ! $this->checkout->transaction instanceof EE_Transaction) {
380 380
 			// get transaction from db or session
381 381
 			$this->checkout->transaction = $this->checkout->reg_url_link && ! is_admin() ? $this->_get_transaction_and_cart_for_previous_visit() : $this->_get_cart_for_current_session_and_setup_new_transaction();
382
-			if ( ! $this->checkout->transaction instanceof EE_Transaction ) {
383
-				EE_Error::add_error( __( 'Your Registration and Transaction information could not be retrieved from the db.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__);
382
+			if ( ! $this->checkout->transaction instanceof EE_Transaction) {
383
+				EE_Error::add_error(__('Your Registration and Transaction information could not be retrieved from the db.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
384 384
 				// add some style and make it dance
385 385
 				$this->checkout->transaction = EE_Transaction::new_instance();
386 386
 				$this->add_styles_and_scripts();
@@ -388,10 +388,10 @@  discard block
 block discarded – undo
388 388
 				return;
389 389
 			}
390 390
 			// and the registrations for the transaction
391
-			$this->_get_registrations( $this->checkout->transaction );
391
+			$this->_get_registrations($this->checkout->transaction);
392 392
 		}
393 393
 		// verify that everything has been setup correctly
394
-		if ( ! $this->_final_verifications() ) {
394
+		if ( ! $this->_final_verifications()) {
395 395
 			EED_Single_Page_Checkout::$_initialized = true;
396 396
 			return;
397 397
 		}
@@ -416,9 +416,9 @@  discard block
 block discarded – undo
416 416
 		// set no cache headers and constants
417 417
 		EE_System::do_not_cache();
418 418
 		// add anchor
419
-		add_action( 'loop_start', array( $this, 'set_checkout_anchor' ), 1 );
419
+		add_action('loop_start', array($this, 'set_checkout_anchor'), 1);
420 420
 		// remove transaction lock
421
-		add_action( 'shutdown', array( $this, 'unlock_transaction' ), 1 );
421
+		add_action('shutdown', array($this, 'unlock_transaction'), 1);
422 422
 	}
423 423
 
424 424
 
@@ -435,20 +435,20 @@  discard block
 block discarded – undo
435 435
 		// look in session for existing checkout
436 436
 		$checkout = EE_Registry::instance()->SSN->checkout();
437 437
 		// verify
438
-		if ( ! $checkout instanceof EE_Checkout ) {
438
+		if ( ! $checkout instanceof EE_Checkout) {
439 439
 			// instantiate EE_Checkout object for handling the properties of the current checkout process
440
-			$checkout = EE_Registry::instance()->load_file( SPCO_INC_PATH, 'EE_Checkout', 'class', array(), FALSE  );
440
+			$checkout = EE_Registry::instance()->load_file(SPCO_INC_PATH, 'EE_Checkout', 'class', array(), FALSE);
441 441
 			// verify again
442
-			if ( ! $checkout instanceof EE_Checkout ) {
443
-				throw new EE_Error( __( 'The EE_Checkout class could not be loaded.', 'event_espresso' ) );
442
+			if ( ! $checkout instanceof EE_Checkout) {
443
+				throw new EE_Error(__('The EE_Checkout class could not be loaded.', 'event_espresso'));
444 444
 			}
445 445
 		} else {
446
-			if ( $checkout->current_step->is_final_step() && $checkout->exit_spco() === true )  {
447
-				wp_safe_redirect( $checkout->redirect_url );
446
+			if ($checkout->current_step->is_final_step() && $checkout->exit_spco() === true) {
447
+				wp_safe_redirect($checkout->redirect_url);
448 448
 				exit();
449 449
 			}
450 450
 		}
451
-		$checkout = apply_filters( 'FHEE__EED_Single_Page_Checkout___initialize_checkout__checkout', $checkout );
451
+		$checkout = apply_filters('FHEE__EED_Single_Page_Checkout___initialize_checkout__checkout', $checkout);
452 452
 		// reset anything that needs a clean slate for each request
453 453
 		$checkout->reset_for_current_request();
454 454
 		return $checkout;
@@ -466,22 +466,22 @@  discard block
 block discarded – undo
466 466
 		// load classes
467 467
 		EED_Single_Page_Checkout::load_request_handler();
468 468
 		//make sure this request is marked as belonging to EE
469
-		EE_Registry::instance()->REQ->set_espresso_page( TRUE );
469
+		EE_Registry::instance()->REQ->set_espresso_page(TRUE);
470 470
 		// which step is being requested ?
471
-		$this->checkout->step = EE_Registry::instance()->REQ->get( 'step', $this->_get_first_step() );
471
+		$this->checkout->step = EE_Registry::instance()->REQ->get('step', $this->_get_first_step());
472 472
 		// which step is being edited ?
473
-		$this->checkout->edit_step = EE_Registry::instance()->REQ->get( 'edit_step', '' );
473
+		$this->checkout->edit_step = EE_Registry::instance()->REQ->get('edit_step', '');
474 474
 		// and what we're doing on the current step
475
-		$this->checkout->action = EE_Registry::instance()->REQ->get( 'action', 'display_spco_reg_step' );
475
+		$this->checkout->action = EE_Registry::instance()->REQ->get('action', 'display_spco_reg_step');
476 476
 		// returning to edit ?
477
-		$this->checkout->reg_url_link = EE_Registry::instance()->REQ->get( 'e_reg_url_link', '' );
477
+		$this->checkout->reg_url_link = EE_Registry::instance()->REQ->get('e_reg_url_link', '');
478 478
 		// or some other kind of revisit ?
479
-		$this->checkout->revisit = EE_Registry::instance()->REQ->get( 'revisit', FALSE );
479
+		$this->checkout->revisit = EE_Registry::instance()->REQ->get('revisit', FALSE);
480 480
 		// and whether or not to generate a reg form for this request
481
-		$this->checkout->generate_reg_form = EE_Registry::instance()->REQ->get( 'generate_reg_form', TRUE ); 		// TRUE 	FALSE
481
+		$this->checkout->generate_reg_form = EE_Registry::instance()->REQ->get('generate_reg_form', TRUE); // TRUE 	FALSE
482 482
 		// and whether or not to process a reg form submission for this request
483
-		$this->checkout->process_form_submission = EE_Registry::instance()->REQ->get( 'process_form_submission', FALSE ); 		// TRUE 	FALSE
484
-		$this->checkout->process_form_submission = $this->checkout->action !== 'display_spco_reg_step' ? $this->checkout->process_form_submission : FALSE; 		// TRUE 	FALSE
483
+		$this->checkout->process_form_submission = EE_Registry::instance()->REQ->get('process_form_submission', FALSE); // TRUE 	FALSE
484
+		$this->checkout->process_form_submission = $this->checkout->action !== 'display_spco_reg_step' ? $this->checkout->process_form_submission : FALSE; // TRUE 	FALSE
485 485
 		//$this->_display_request_vars();
486 486
 	}
487 487
 
@@ -494,17 +494,17 @@  discard block
 block discarded – undo
494 494
 	 * @return    void
495 495
 	 */
496 496
 	protected function _display_request_vars() {
497
-		if ( ! WP_DEBUG ) {
497
+		if ( ! WP_DEBUG) {
498 498
 			return;
499 499
 		}
500
-		EEH_Debug_Tools::printr( $_REQUEST, '$_REQUEST', __FILE__, __LINE__ );
501
-		EEH_Debug_Tools::printr( $this->checkout->step, '$this->checkout->step', __FILE__, __LINE__ );
502
-		EEH_Debug_Tools::printr( $this->checkout->edit_step, '$this->checkout->edit_step', __FILE__, __LINE__ );
503
-		EEH_Debug_Tools::printr( $this->checkout->action, '$this->checkout->action', __FILE__, __LINE__ );
504
-		EEH_Debug_Tools::printr( $this->checkout->reg_url_link, '$this->checkout->reg_url_link', __FILE__, __LINE__ );
505
-		EEH_Debug_Tools::printr( $this->checkout->revisit, '$this->checkout->revisit', __FILE__, __LINE__ );
506
-		EEH_Debug_Tools::printr( $this->checkout->generate_reg_form, '$this->checkout->generate_reg_form', __FILE__, __LINE__ );
507
-		EEH_Debug_Tools::printr( $this->checkout->process_form_submission, '$this->checkout->process_form_submission', __FILE__, __LINE__ );
500
+		EEH_Debug_Tools::printr($_REQUEST, '$_REQUEST', __FILE__, __LINE__);
501
+		EEH_Debug_Tools::printr($this->checkout->step, '$this->checkout->step', __FILE__, __LINE__);
502
+		EEH_Debug_Tools::printr($this->checkout->edit_step, '$this->checkout->edit_step', __FILE__, __LINE__);
503
+		EEH_Debug_Tools::printr($this->checkout->action, '$this->checkout->action', __FILE__, __LINE__);
504
+		EEH_Debug_Tools::printr($this->checkout->reg_url_link, '$this->checkout->reg_url_link', __FILE__, __LINE__);
505
+		EEH_Debug_Tools::printr($this->checkout->revisit, '$this->checkout->revisit', __FILE__, __LINE__);
506
+		EEH_Debug_Tools::printr($this->checkout->generate_reg_form, '$this->checkout->generate_reg_form', __FILE__, __LINE__);
507
+		EEH_Debug_Tools::printr($this->checkout->process_form_submission, '$this->checkout->process_form_submission', __FILE__, __LINE__);
508 508
 	}
509 509
 
510 510
 
@@ -518,8 +518,8 @@  discard block
 block discarded – undo
518 518
 	 * @return    array
519 519
 	 */
520 520
 	private function _get_first_step() {
521
-		$first_step = reset( EED_Single_Page_Checkout::$_reg_steps_array );
522
-		return isset( $first_step['slug'] ) ? $first_step['slug'] : 'attendee_information';
521
+		$first_step = reset(EED_Single_Page_Checkout::$_reg_steps_array);
522
+		return isset($first_step['slug']) ? $first_step['slug'] : 'attendee_information';
523 523
 	}
524 524
 
525 525
 
@@ -535,37 +535,37 @@  discard block
 block discarded – undo
535 535
 	private function _load_and_instantiate_reg_steps() {
536 536
 		// have reg_steps already been instantiated ?
537 537
 		if (
538
-			empty( $this->checkout->reg_steps ) ||
539
-			apply_filters( 'FHEE__Single_Page_Checkout__load_reg_steps__reload_reg_steps', false, $this->checkout )
538
+			empty($this->checkout->reg_steps) ||
539
+			apply_filters('FHEE__Single_Page_Checkout__load_reg_steps__reload_reg_steps', false, $this->checkout)
540 540
 		) {
541 541
 			// if not, then loop through raw reg steps array
542
-			foreach ( EED_Single_Page_Checkout::$_reg_steps_array as $order => $reg_step ) {
543
-				if ( ! $this->_load_and_instantiate_reg_step( $reg_step, $order )) {
542
+			foreach (EED_Single_Page_Checkout::$_reg_steps_array as $order => $reg_step) {
543
+				if ( ! $this->_load_and_instantiate_reg_step($reg_step, $order)) {
544 544
 					return false;
545 545
 				}
546 546
 			}
547 547
 			EE_Registry::instance()->CFG->registration->skip_reg_confirmation = TRUE;
548 548
 			EE_Registry::instance()->CFG->registration->reg_confirmation_last = TRUE;
549 549
 			// skip the registration_confirmation page ?
550
-			if ( EE_Registry::instance()->CFG->registration->skip_reg_confirmation ) {
550
+			if (EE_Registry::instance()->CFG->registration->skip_reg_confirmation) {
551 551
 				// just remove it from the reg steps array
552
-				$this->checkout->remove_reg_step( 'registration_confirmation', false );
553
-			} else if ( EE_Registry::instance()->CFG->registration->reg_confirmation_last && isset( 	$this->checkout->reg_steps['registration_confirmation'] )) {
552
+				$this->checkout->remove_reg_step('registration_confirmation', false);
553
+			} else if (EE_Registry::instance()->CFG->registration->reg_confirmation_last && isset($this->checkout->reg_steps['registration_confirmation'])) {
554 554
 				// set the order to something big like 100
555
-				$this->checkout->set_reg_step_order( 'registration_confirmation', 100 );
555
+				$this->checkout->set_reg_step_order('registration_confirmation', 100);
556 556
 			}
557 557
 			// filter the array for good luck
558
-			$this->checkout->reg_steps = apply_filters( 'FHEE__Single_Page_Checkout__load_reg_steps__reg_steps', $this->checkout->reg_steps );
558
+			$this->checkout->reg_steps = apply_filters('FHEE__Single_Page_Checkout__load_reg_steps__reg_steps', $this->checkout->reg_steps);
559 559
 			// finally re-sort based on the reg step class order properties
560 560
 			$this->checkout->sort_reg_steps();
561 561
 		} else {
562
-			foreach ( $this->checkout->reg_steps as $reg_step ) {
562
+			foreach ($this->checkout->reg_steps as $reg_step) {
563 563
 				// set all current step stati to FALSE
564
-				$reg_step->set_is_current_step( FALSE );
564
+				$reg_step->set_is_current_step(FALSE);
565 565
 			}
566 566
 		}
567
-		if ( empty( $this->checkout->reg_steps )) {
568
-			EE_Error::add_error( __( 'No Reg Steps were loaded..', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__);
567
+		if (empty($this->checkout->reg_steps)) {
568
+			EE_Error::add_error(__('No Reg Steps were loaded..', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
569 569
 			return false;
570 570
 		}
571 571
 			// make reg step details available to JS
@@ -583,34 +583,34 @@  discard block
 block discarded – undo
583 583
 	 * @param int   $order
584 584
 	 * @return bool
585 585
 	 */
586
-	private function _load_and_instantiate_reg_step( $reg_step = array(), $order = 0 ) {
586
+	private function _load_and_instantiate_reg_step($reg_step = array(), $order = 0) {
587 587
 
588 588
 		// we need a file_path, class_name, and slug to add a reg step
589
-		if ( isset( $reg_step['file_path'], $reg_step['class_name'], $reg_step['slug'] )) {
589
+		if (isset($reg_step['file_path'], $reg_step['class_name'], $reg_step['slug'])) {
590 590
 			// if editing a specific step, but this is NOT that step... (and it's not the 'finalize_registration' step)
591
-			if ( $this->checkout->reg_url_link && $this->checkout->step !== $reg_step['slug'] && $reg_step['slug'] !== 'finalize_registration' ) {
591
+			if ($this->checkout->reg_url_link && $this->checkout->step !== $reg_step['slug'] && $reg_step['slug'] !== 'finalize_registration') {
592 592
 				return true;
593 593
 			}
594 594
 			// instantiate step class using file path and class name
595
-			$reg_step_obj = EE_Registry::instance()->load_file( $reg_step['file_path'], $reg_step['class_name'], 'class', $this->checkout, FALSE  );
595
+			$reg_step_obj = EE_Registry::instance()->load_file($reg_step['file_path'], $reg_step['class_name'], 'class', $this->checkout, FALSE);
596 596
 			// did we gets the goods ?
597
-			if ( $reg_step_obj instanceof EE_SPCO_Reg_Step ) {
597
+			if ($reg_step_obj instanceof EE_SPCO_Reg_Step) {
598 598
 				// set reg step order based on config
599
-				$reg_step_obj->set_order( $order );
599
+				$reg_step_obj->set_order($order);
600 600
 				// add instantiated reg step object to the master reg steps array
601
-				$this->checkout->add_reg_step( $reg_step_obj );
601
+				$this->checkout->add_reg_step($reg_step_obj);
602 602
 			} else {
603
-				EE_Error::add_error( __( 'The current step could not be set.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__ );
603
+				EE_Error::add_error(__('The current step could not be set.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
604 604
 				return false;
605 605
 			}
606 606
 		} else {
607
-			if ( WP_DEBUG ) {
607
+			if (WP_DEBUG) {
608 608
 				EE_Error::add_error(
609 609
 					sprintf(
610
-						__( 'A registration step could not be loaded. One or more of the following data points is invalid:%4$s%5$sFile Path: %1$s%6$s%5$sClass Name: %2$s%6$s%5$sSlug: %3$s%6$s%7$s', 'event_espresso' ),
611
-						isset( $reg_step['file_path'] ) ? $reg_step['file_path'] : '',
612
-						isset( $reg_step['class_name'] ) ? $reg_step['class_name'] : '',
613
-						isset( $reg_step['slug'] ) ? $reg_step['slug'] : '',
610
+						__('A registration step could not be loaded. One or more of the following data points is invalid:%4$s%5$sFile Path: %1$s%6$s%5$sClass Name: %2$s%6$s%5$sSlug: %3$s%6$s%7$s', 'event_espresso'),
611
+						isset($reg_step['file_path']) ? $reg_step['file_path'] : '',
612
+						isset($reg_step['class_name']) ? $reg_step['class_name'] : '',
613
+						isset($reg_step['slug']) ? $reg_step['slug'] : '',
614 614
 						'<ul>',
615 615
 						'<li>',
616 616
 						'</li>',
@@ -634,16 +634,16 @@  discard block
 block discarded – undo
634 634
 	 */
635 635
 	private function _get_transaction_and_cart_for_previous_visit() {
636 636
 		/** @var $TXN_model EEM_Transaction */
637
-		$TXN_model = EE_Registry::instance()->load_model( 'Transaction' );
637
+		$TXN_model = EE_Registry::instance()->load_model('Transaction');
638 638
 		// because the reg_url_link is present in the request, this is a return visit to SPCO, so we'll get the transaction data from the db
639
-		$transaction = $TXN_model->get_transaction_from_reg_url_link( $this->checkout->reg_url_link );
639
+		$transaction = $TXN_model->get_transaction_from_reg_url_link($this->checkout->reg_url_link);
640 640
 		// verify transaction
641
-		if ( $transaction instanceof EE_Transaction ) {
641
+		if ($transaction instanceof EE_Transaction) {
642 642
 			// and get the cart that was used for that transaction
643
-			$this->checkout->cart = $this->_get_cart_for_transaction( $transaction );
643
+			$this->checkout->cart = $this->_get_cart_for_transaction($transaction);
644 644
 			return $transaction;
645 645
 		} else {
646
-			EE_Error::add_error( __( 'Your Registration and Transaction information could not be retrieved from the db.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__);
646
+			EE_Error::add_error(__('Your Registration and Transaction information could not be retrieved from the db.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
647 647
 			return NULL;
648 648
 		}
649 649
 	}
@@ -657,11 +657,11 @@  discard block
 block discarded – undo
657 657
 	 * @param EE_Transaction $transaction
658 658
 	 * @return EE_Cart
659 659
 	 */
660
-	private function _get_cart_for_transaction( $transaction ) {
661
-		$cart = $transaction instanceof EE_Transaction ? EE_Cart::get_cart_from_txn( $transaction ) : NULL;
660
+	private function _get_cart_for_transaction($transaction) {
661
+		$cart = $transaction instanceof EE_Transaction ? EE_Cart::get_cart_from_txn($transaction) : NULL;
662 662
 		// verify cart
663
-		if ( ! $cart instanceof EE_Cart ) {
664
-			$cart = EE_Registry::instance()->load_core( 'Cart' );
663
+		if ( ! $cart instanceof EE_Cart) {
664
+			$cart = EE_Registry::instance()->load_core('Cart');
665 665
 		}
666 666
 		return $cart;
667 667
 	}
@@ -676,8 +676,8 @@  discard block
 block discarded – undo
676 676
 	 * @param EE_Transaction $transaction
677 677
 	 * 	@return EE_Cart
678 678
 	 */
679
-	public function get_cart_for_transaction( EE_Transaction $transaction ) {
680
-		return EE_Cart::get_cart_from_txn( $transaction );
679
+	public function get_cart_for_transaction(EE_Transaction $transaction) {
680
+		return EE_Cart::get_cart_from_txn($transaction);
681 681
 	}
682 682
 
683 683
 
@@ -692,17 +692,17 @@  discard block
 block discarded – undo
692 692
 	private function _get_cart_for_current_session_and_setup_new_transaction() {
693 693
 		//  if there's no transaction, then this is the FIRST visit to SPCO
694 694
 		// so load up the cart ( passing nothing for the TXN because it doesn't exist yet )
695
-		$this->checkout->cart = $this->_get_cart_for_transaction( NULL );
695
+		$this->checkout->cart = $this->_get_cart_for_transaction(NULL);
696 696
 		// and then create a new transaction
697 697
 		$transaction = $this->_initialize_transaction();
698 698
 		// verify transaction
699
-		if ( $transaction instanceof EE_Transaction ) {
699
+		if ($transaction instanceof EE_Transaction) {
700 700
 			// save it so that we have an ID for other objects to use
701 701
 			$transaction->save();
702 702
 			// and save TXN data to the cart
703
-			$this->checkout->cart->get_grand_total()->save_this_and_descendants_to_txn( $transaction->ID() );
703
+			$this->checkout->cart->get_grand_total()->save_this_and_descendants_to_txn($transaction->ID());
704 704
 		} else {
705
-			EE_Error::add_error( __( 'A Valid Transaction could not be initialized.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__ );
705
+			EE_Error::add_error(__('A Valid Transaction could not be initialized.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
706 706
 		}
707 707
 		return $transaction;
708 708
 	}
@@ -722,15 +722,15 @@  discard block
 block discarded – undo
722 722
 			// grab the cart grand total
723 723
 			$cart_total = $this->checkout->cart->get_cart_grand_total();
724 724
 			// create new TXN
725
-			return EE_Transaction::new_instance( array(
725
+			return EE_Transaction::new_instance(array(
726 726
 				'TXN_timestamp' 	=> time(),
727 727
 				'TXN_reg_steps' 		=> $this->checkout->initialize_txn_reg_steps_array(),
728 728
 				'TXN_total' 				=> $cart_total > 0 ? $cart_total : 0,
729 729
 				'TXN_paid' 				=> 0,
730 730
 				'STS_ID' 					=> EEM_Transaction::failed_status_code,
731 731
 			));
732
-		} catch( Exception $e ) {
733
-			EE_Error::add_error( $e->getMessage(), __FILE__, __FUNCTION__, __LINE__);
732
+		} catch (Exception $e) {
733
+			EE_Error::add_error($e->getMessage(), __FILE__, __FUNCTION__, __LINE__);
734 734
 		}
735 735
 		return NULL;
736 736
 	}
@@ -744,34 +744,34 @@  discard block
 block discarded – undo
744 744
 	 * @param EE_Transaction $transaction
745 745
 	 * @return EE_Cart
746 746
 	 */
747
-	private function _get_registrations( EE_Transaction $transaction ) {
747
+	private function _get_registrations(EE_Transaction $transaction) {
748 748
 		// first step: grab the registrants  { : o
749
-		$registrations = $transaction->registrations( $this->checkout->reg_cache_where_params, true );
749
+		$registrations = $transaction->registrations($this->checkout->reg_cache_where_params, true);
750 750
 		// verify registrations have been set
751
-		if ( empty( $registrations )) {
751
+		if (empty($registrations)) {
752 752
 			// if no cached registrations, then check the db
753
-			$registrations = $transaction->registrations( $this->checkout->reg_cache_where_params, false );
753
+			$registrations = $transaction->registrations($this->checkout->reg_cache_where_params, false);
754 754
 			// still nothing ? well as long as this isn't a revisit
755
-			if ( empty( $registrations ) && ! $this->checkout->revisit ) {
755
+			if (empty($registrations) && ! $this->checkout->revisit) {
756 756
 				// generate new registrations from scratch
757
-				$registrations = $this->_initialize_registrations( $transaction );
757
+				$registrations = $this->_initialize_registrations($transaction);
758 758
 			}
759 759
 		}
760 760
 		// sort by their original registration order
761
-		usort( $registrations, array( 'EED_Single_Page_Checkout', 'sort_registrations_by_REG_count' ));
761
+		usort($registrations, array('EED_Single_Page_Checkout', 'sort_registrations_by_REG_count'));
762 762
 		// then loop thru the array
763
-		foreach ( $registrations as $registration ) {
763
+		foreach ($registrations as $registration) {
764 764
 			// verify each registration
765
-			if ( $registration instanceof EE_Registration ) {
765
+			if ($registration instanceof EE_Registration) {
766 766
 				// we display all attendee info for the primary registrant
767
-				if ( $this->checkout->reg_url_link == $registration->reg_url_link() && $registration->is_primary_registrant() ) {
767
+				if ($this->checkout->reg_url_link == $registration->reg_url_link() && $registration->is_primary_registrant()) {
768 768
 					$this->checkout->primary_revisit = TRUE;
769 769
 					break;
770
-				} else if ( $this->checkout->revisit && $this->checkout->reg_url_link != $registration->reg_url_link() ) {
770
+				} else if ($this->checkout->revisit && $this->checkout->reg_url_link != $registration->reg_url_link()) {
771 771
 					// but hide info if it doesn't belong to you
772
-					$transaction->clear_cache( 'Registration', $registration->ID() );
772
+					$transaction->clear_cache('Registration', $registration->ID());
773 773
 				}
774
-				$this->checkout->set_reg_status_updated( $registration->ID(), false );
774
+				$this->checkout->set_reg_status_updated($registration->ID(), false);
775 775
 			}
776 776
 		}
777 777
 	}
@@ -785,17 +785,17 @@  discard block
 block discarded – undo
785 785
 	 * @param EE_Transaction $transaction
786 786
 	 * @return    array
787 787
 	 */
788
-	private function _initialize_registrations( EE_Transaction $transaction ) {
788
+	private function _initialize_registrations(EE_Transaction $transaction) {
789 789
 		$att_nmbr = 0;
790 790
 		$registrations = array();
791
-		if ( $transaction instanceof EE_Transaction ) {
791
+		if ($transaction instanceof EE_Transaction) {
792 792
 			/** @type EE_Registration_Processor $registration_processor */
793
-			$registration_processor = EE_Registry::instance()->load_class( 'Registration_Processor' );
793
+			$registration_processor = EE_Registry::instance()->load_class('Registration_Processor');
794 794
 			$this->checkout->total_ticket_count = $this->checkout->cart->all_ticket_quantity_count();
795 795
 			// now let's add the cart items to the $transaction
796
-			foreach ( $this->checkout->cart->get_tickets() as $line_item ) {
796
+			foreach ($this->checkout->cart->get_tickets() as $line_item) {
797 797
 				//do the following for each ticket of this type they selected
798
-				for ( $x = 1; $x <= $line_item->quantity(); $x++ ) {
798
+				for ($x = 1; $x <= $line_item->quantity(); $x++) {
799 799
 					$att_nmbr++;
800 800
 					$registration = $registration_processor->generate_ONE_registration_from_line_item(
801 801
 						$line_item,
@@ -803,12 +803,12 @@  discard block
 block discarded – undo
803 803
 						$att_nmbr,
804 804
 						$this->checkout->total_ticket_count
805 805
 					);
806
-					if ( $registration instanceof EE_Registration ) {
807
-						$registrations[ $registration->ID() ] = $registration;
806
+					if ($registration instanceof EE_Registration) {
807
+						$registrations[$registration->ID()] = $registration;
808 808
 					}
809 809
 				}
810 810
 			}
811
-			$registration_processor->fix_reg_final_price_rounding_issue( $transaction );
811
+			$registration_processor->fix_reg_final_price_rounding_issue($transaction);
812 812
 		}
813 813
 		return $registrations;
814 814
 	}
@@ -823,12 +823,12 @@  discard block
 block discarded – undo
823 823
 	 * @param EE_Registration $reg_B
824 824
 	 * @return array()
825 825
 	 */
826
-	public static function sort_registrations_by_REG_count( EE_Registration $reg_A, EE_Registration $reg_B ) {
826
+	public static function sort_registrations_by_REG_count(EE_Registration $reg_A, EE_Registration $reg_B) {
827 827
 		// this shouldn't ever happen within the same TXN, but oh well
828
-		if ( $reg_A->count() == $reg_B->count() ) {
828
+		if ($reg_A->count() == $reg_B->count()) {
829 829
 			return 0;
830 830
 		}
831
-		return ( $reg_A->count() > $reg_B->count() ) ? 1 : -1;
831
+		return ($reg_A->count() > $reg_B->count()) ? 1 : -1;
832 832
 	}
833 833
 
834 834
 
@@ -843,35 +843,35 @@  discard block
 block discarded – undo
843 843
 	 */
844 844
 	private function _final_verifications() {
845 845
 		// filter checkout
846
-		$this->checkout = apply_filters( 'FHEE__EED_Single_Page_Checkout___final_verifications__checkout', $this->checkout );
846
+		$this->checkout = apply_filters('FHEE__EED_Single_Page_Checkout___final_verifications__checkout', $this->checkout);
847 847
 		//verify that current step is still set correctly
848
-		if ( ! $this->checkout->current_step instanceof EE_SPCO_Reg_Step ) {
849
-			EE_Error::add_error( __( 'We\'re sorry but the registration process can not proceed because one or more registration steps were not setup correctly. Please refresh the page and try again or contact support.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__ );
848
+		if ( ! $this->checkout->current_step instanceof EE_SPCO_Reg_Step) {
849
+			EE_Error::add_error(__('We\'re sorry but the registration process can not proceed because one or more registration steps were not setup correctly. Please refresh the page and try again or contact support.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
850 850
 			return false;
851 851
 		}
852 852
 		// if returning to SPCO, then verify that primary registrant is set
853
-		if ( ! empty( $this->checkout->reg_url_link )) {
853
+		if ( ! empty($this->checkout->reg_url_link)) {
854 854
 			$valid_registrant = $this->checkout->transaction->primary_registration();
855
-			if ( ! $valid_registrant instanceof EE_Registration ) {
856
-				EE_Error::add_error( __( 'We\'re sorry but there appears to be an error with the "reg_url_link" or the primary registrant for this transaction. Please refresh the page and try again or contact support.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__ );
855
+			if ( ! $valid_registrant instanceof EE_Registration) {
856
+				EE_Error::add_error(__('We\'re sorry but there appears to be an error with the "reg_url_link" or the primary registrant for this transaction. Please refresh the page and try again or contact support.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
857 857
 				return false;
858 858
 			}
859 859
 			$valid_registrant = null;
860
-			foreach ( $this->checkout->transaction->registrations( $this->checkout->reg_cache_where_params ) as $registration ) {
861
-				if ( $registration instanceof EE_Registration ) {
862
-					if ( $registration->reg_url_link() == $this->checkout->reg_url_link ) {
860
+			foreach ($this->checkout->transaction->registrations($this->checkout->reg_cache_where_params) as $registration) {
861
+				if ($registration instanceof EE_Registration) {
862
+					if ($registration->reg_url_link() == $this->checkout->reg_url_link) {
863 863
 						$valid_registrant = $registration;
864 864
 					}
865 865
 				}
866 866
 			}
867
-			if ( ! $valid_registrant instanceof EE_Registration ) {
868
-				EE_Error::add_error( __( 'We\'re sorry but there appears to be an error with the "reg_url_link" or the transaction itself. Please refresh the page and try again or contact support.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__ );
867
+			if ( ! $valid_registrant instanceof EE_Registration) {
868
+				EE_Error::add_error(__('We\'re sorry but there appears to be an error with the "reg_url_link" or the transaction itself. Please refresh the page and try again or contact support.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
869 869
 				return false;
870 870
 			}
871 871
 		}
872 872
 		// now that things have been kinda sufficiently verified,
873 873
 		// let's add the checkout to the session so that's available other systems
874
-		EE_Registry::instance()->SSN->set_checkout( $this->checkout );
874
+		EE_Registry::instance()->SSN->set_checkout($this->checkout);
875 875
 		return true;
876 876
 	}
877 877
 
@@ -887,28 +887,28 @@  discard block
 block discarded – undo
887 887
 	 * @access    private
888 888
 	 * @param bool $reinitializing
889 889
 	 */
890
-	private function _initialize_reg_steps( $reinitializing = false ) {
891
-		$this->checkout->set_reg_step_initiated( $this->checkout->current_step );
890
+	private function _initialize_reg_steps($reinitializing = false) {
891
+		$this->checkout->set_reg_step_initiated($this->checkout->current_step);
892 892
 		// loop thru all steps to call their individual "initialize" methods and set i18n strings for JS
893
-		foreach ( $this->checkout->reg_steps as $reg_step ) {
894
-			if ( ! $reg_step->initialize_reg_step() ) {
893
+		foreach ($this->checkout->reg_steps as $reg_step) {
894
+			if ( ! $reg_step->initialize_reg_step()) {
895 895
 				// if not initialized then maybe this step is being removed...
896
-				if ( $reg_step->is_current_step() && ! $reinitializing ) {
896
+				if ($reg_step->is_current_step() && ! $reinitializing) {
897 897
 					// if it was the current step, then we need to start over here
898
-					$this->_initialize_reg_steps( true );
898
+					$this->_initialize_reg_steps(true);
899 899
 					return;
900 900
 				}
901 901
 				continue;
902 902
 			}
903 903
 			// i18n
904 904
 			$reg_step->translate_js_strings();
905
-			if ( $reg_step->is_current_step() ) {
905
+			if ($reg_step->is_current_step()) {
906 906
 				// the text that appears on the reg step form submit button
907 907
 				$reg_step->set_submit_button_text();
908 908
 			}
909 909
 		}
910 910
 		// dynamically creates hook point like: AHEE__Single_Page_Checkout___initialize_reg_step__attendee_information
911
-		do_action( "AHEE__Single_Page_Checkout___initialize_reg_step__{$this->checkout->current_step->slug()}", $this->checkout->current_step );
911
+		do_action("AHEE__Single_Page_Checkout___initialize_reg_step__{$this->checkout->current_step->slug()}", $this->checkout->current_step);
912 912
 	}
913 913
 
914 914
 
@@ -921,39 +921,39 @@  discard block
 block discarded – undo
921 921
 	 */
922 922
 	private function _check_form_submission() {
923 923
 		//does this request require the reg form to be generated ?
924
-		if ( $this->checkout->generate_reg_form ) {
924
+		if ($this->checkout->generate_reg_form) {
925 925
 			// ever heard that song by Blue Rodeo ?
926 926
 			try {
927 927
 				$this->checkout->current_step->reg_form = $this->checkout->current_step->generate_reg_form();
928 928
 				// if not displaying a form, then check for form submission
929
-				if ( $this->checkout->process_form_submission && $this->checkout->current_step->reg_form->was_submitted() ) {
929
+				if ($this->checkout->process_form_submission && $this->checkout->current_step->reg_form->was_submitted()) {
930 930
 					// clear out any old data in case this step is being run again
931
-					$this->checkout->current_step->set_valid_data( array() );
931
+					$this->checkout->current_step->set_valid_data(array());
932 932
 					// capture submitted form data
933 933
 					$this->checkout->current_step->reg_form->receive_form_submission(
934
-						apply_filters( 'FHEE__Single_Page_Checkout___check_form_submission__request_params', EE_Registry::instance()->REQ->params(), $this->checkout )
934
+						apply_filters('FHEE__Single_Page_Checkout___check_form_submission__request_params', EE_Registry::instance()->REQ->params(), $this->checkout)
935 935
 					);
936 936
 					// validate submitted form data
937
-					if ( ! $this->checkout->current_step->reg_form->is_valid() || ! $this->checkout->continue_reg ) {
937
+					if ( ! $this->checkout->current_step->reg_form->is_valid() || ! $this->checkout->continue_reg) {
938 938
 						// thou shall not pass !!!
939 939
 						$this->checkout->continue_reg = FALSE;
940 940
 						// any form validation errors?
941
-						if ( $this->checkout->current_step->reg_form->submission_error_message() != '' ) {
941
+						if ($this->checkout->current_step->reg_form->submission_error_message() != '') {
942 942
 							$submission_error_messages = array();
943 943
 							// bad, bad, bad registrant
944
-							foreach( $this->checkout->current_step->reg_form->get_validation_errors_accumulated() as $validation_error ){
945
-								if ( $validation_error instanceof EE_Validation_Error ) {
946
-									$submission_error_messages[] = sprintf( __( '%s : %s', 'event_espresso' ), $validation_error->get_form_section()->html_label_text(), $validation_error->getMessage() );
944
+							foreach ($this->checkout->current_step->reg_form->get_validation_errors_accumulated() as $validation_error) {
945
+								if ($validation_error instanceof EE_Validation_Error) {
946
+									$submission_error_messages[] = sprintf(__('%s : %s', 'event_espresso'), $validation_error->get_form_section()->html_label_text(), $validation_error->getMessage());
947 947
 								}
948 948
 							}
949
-							EE_Error::add_error( join( '<br />', $submission_error_messages ), __FILE__, __FUNCTION__, __LINE__ );
949
+							EE_Error::add_error(join('<br />', $submission_error_messages), __FILE__, __FUNCTION__, __LINE__);
950 950
 						}
951 951
 						// well not really... what will happen is we'll just get redirected back to redo the current step
952 952
 						$this->go_to_next_step();
953 953
 						return;
954 954
 					}
955 955
 				}
956
-			} catch( EE_Error $e ) {
956
+			} catch (EE_Error $e) {
957 957
 				$e->get_error();
958 958
 			}
959 959
 		}
@@ -969,38 +969,38 @@  discard block
 block discarded – undo
969 969
 	 */
970 970
 	private function _process_form_action() {
971 971
 		// what cha wanna do?
972
-		switch( $this->checkout->action ) {
972
+		switch ($this->checkout->action) {
973 973
 			// AJAX next step reg form
974 974
 			case 'display_spco_reg_step' :
975 975
 				$this->checkout->redirect = FALSE;
976
-				if ( EE_Registry::instance()->REQ->ajax ) {
977
-					$this->checkout->json_response->set_reg_step_html( $this->checkout->current_step->display_reg_form() );
976
+				if (EE_Registry::instance()->REQ->ajax) {
977
+					$this->checkout->json_response->set_reg_step_html($this->checkout->current_step->display_reg_form());
978 978
 				}
979 979
 				break;
980 980
 
981 981
 			default :
982 982
 				// meh... do one of those other steps first
983
-				if ( ! empty( $this->checkout->action ) && is_callable( array( $this->checkout->current_step, $this->checkout->action ))) {
983
+				if ( ! empty($this->checkout->action) && is_callable(array($this->checkout->current_step, $this->checkout->action))) {
984 984
 					// dynamically creates hook point like: AHEE__Single_Page_Checkout__before_attendee_information__process_reg_step
985
-					do_action( "AHEE__Single_Page_Checkout__before_{$this->checkout->current_step->slug()}__{$this->checkout->action}", $this->checkout->current_step );
985
+					do_action("AHEE__Single_Page_Checkout__before_{$this->checkout->current_step->slug()}__{$this->checkout->action}", $this->checkout->current_step);
986 986
 					// call action on current step
987
-					if ( call_user_func( array( $this->checkout->current_step, $this->checkout->action )) ) {
987
+					if (call_user_func(array($this->checkout->current_step, $this->checkout->action))) {
988 988
 						// good registrant, you get to proceed
989
-						if ( $this->checkout->current_step->success_message() != '' ) {
990
-							if ( apply_filters( 'FHEE__Single_Page_Checkout___process_form_action__display_success', false ) ) {
991
-								EE_Error::add_success( $this->checkout->current_step->success_message() . '<br />' . $this->checkout->next_step->_instructions() );
989
+						if ($this->checkout->current_step->success_message() != '') {
990
+							if (apply_filters('FHEE__Single_Page_Checkout___process_form_action__display_success', false)) {
991
+								EE_Error::add_success($this->checkout->current_step->success_message().'<br />'.$this->checkout->next_step->_instructions());
992 992
 							}
993 993
 						}
994 994
 						// pack it up, pack it in...
995 995
 						$this->_setup_redirect();
996 996
 					}
997 997
 					// dynamically creates hook point like: AHEE__Single_Page_Checkout__after_payment_options__process_reg_step
998
-					do_action( "AHEE__Single_Page_Checkout__after_{$this->checkout->current_step->slug()}__{$this->checkout->action}", $this->checkout->current_step );
998
+					do_action("AHEE__Single_Page_Checkout__after_{$this->checkout->current_step->slug()}__{$this->checkout->action}", $this->checkout->current_step);
999 999
 
1000 1000
 				} else {
1001 1001
 					EE_Error::add_error(
1002 1002
 						sprintf(
1003
-							__( 'The requested form action "%s" does not exist for the current "%s" registration step.', 'event_espresso' ),
1003
+							__('The requested form action "%s" does not exist for the current "%s" registration step.', 'event_espresso'),
1004 1004
 							$this->checkout->action,
1005 1005
 							$this->checkout->current_step->name()
1006 1006
 						),
@@ -1026,10 +1026,10 @@  discard block
 block discarded – undo
1026 1026
 	public function add_styles_and_scripts() {
1027 1027
 		// i18n
1028 1028
 		$this->translate_js_strings();
1029
-		if ( $this->checkout->admin_request ) {
1030
-			add_action('admin_enqueue_scripts', array($this, 'enqueue_styles_and_scripts'), 10 );
1029
+		if ($this->checkout->admin_request) {
1030
+			add_action('admin_enqueue_scripts', array($this, 'enqueue_styles_and_scripts'), 10);
1031 1031
 		} else {
1032
-			add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_styles_and_scripts' ), 10 );
1032
+			add_action('wp_enqueue_scripts', array($this, 'enqueue_styles_and_scripts'), 10);
1033 1033
 		}
1034 1034
 	}
1035 1035
 
@@ -1045,42 +1045,42 @@  discard block
 block discarded – undo
1045 1045
 		EE_Registry::$i18n_js_strings['revisit'] = $this->checkout->revisit;
1046 1046
 		EE_Registry::$i18n_js_strings['e_reg_url_link'] = $this->checkout->reg_url_link;
1047 1047
 		EE_Registry::$i18n_js_strings['server_error'] = __('An unknown error occurred on the server while attempting to process your request. Please refresh the page and try again or contact support.', 'event_espresso');
1048
-		EE_Registry::$i18n_js_strings['invalid_json_response'] = __( 'An invalid response was returned from the server while attempting to process your request. Please refresh the page and try again or contact support.', 'event_espresso' );
1049
-		EE_Registry::$i18n_js_strings['validation_error'] = __( 'There appears to be a problem with the form validation configuration! Please check the admin settings or contact support.', 'event_espresso' );
1050
-		EE_Registry::$i18n_js_strings['invalid_payment_method'] = __( 'There appears to be a problem with the payment method configuration! Please refresh the page and try again or contact support.', 'event_espresso' );
1048
+		EE_Registry::$i18n_js_strings['invalid_json_response'] = __('An invalid response was returned from the server while attempting to process your request. Please refresh the page and try again or contact support.', 'event_espresso');
1049
+		EE_Registry::$i18n_js_strings['validation_error'] = __('There appears to be a problem with the form validation configuration! Please check the admin settings or contact support.', 'event_espresso');
1050
+		EE_Registry::$i18n_js_strings['invalid_payment_method'] = __('There appears to be a problem with the payment method configuration! Please refresh the page and try again or contact support.', 'event_espresso');
1051 1051
 		EE_Registry::$i18n_js_strings['reg_step_error'] = __('This registration step could not be completed. Please refresh the page and try again.', 'event_espresso');
1052 1052
 		EE_Registry::$i18n_js_strings['invalid_coupon'] = __('We\'re sorry but that coupon code does not appear to be valid. If this is incorrect, please contact the site administrator.', 'event_espresso');
1053
-		EE_Registry::$i18n_js_strings['process_registration'] = sprintf( __( 'Please wait while we process your registration.%sDo not refresh the page or navigate away while this is happening.%sThank you for your patience.', 'event_espresso' ), '<br/>', '<br/>' );
1054
-		EE_Registry::$i18n_js_strings['language'] = get_bloginfo( 'language' );
1053
+		EE_Registry::$i18n_js_strings['process_registration'] = sprintf(__('Please wait while we process your registration.%sDo not refresh the page or navigate away while this is happening.%sThank you for your patience.', 'event_espresso'), '<br/>', '<br/>');
1054
+		EE_Registry::$i18n_js_strings['language'] = get_bloginfo('language');
1055 1055
 		EE_Registry::$i18n_js_strings['EESID'] = EE_Registry::instance()->SSN->id();
1056 1056
 		EE_Registry::$i18n_js_strings['currency'] = EE_Registry::instance()->CFG->currency;
1057 1057
 		EE_Registry::$i18n_js_strings['datepicker_yearRange'] = '-150:+20';
1058
-		EE_Registry::$i18n_js_strings['timer_years'] = __( 'years', 'event_espresso' );
1059
-		EE_Registry::$i18n_js_strings['timer_months'] = __( 'months', 'event_espresso' );
1060
-		EE_Registry::$i18n_js_strings['timer_weeks'] = __( 'weeks', 'event_espresso' );
1061
-		EE_Registry::$i18n_js_strings['timer_days'] = __( 'days', 'event_espresso' );
1062
-		EE_Registry::$i18n_js_strings['timer_hours'] = __( 'hours', 'event_espresso' );
1063
-		EE_Registry::$i18n_js_strings['timer_minutes'] = __( 'minutes', 'event_espresso' );
1064
-		EE_Registry::$i18n_js_strings['timer_seconds'] = __( 'seconds', 'event_espresso' );
1065
-		EE_Registry::$i18n_js_strings['timer_year'] = __( 'year', 'event_espresso' );
1066
-		EE_Registry::$i18n_js_strings['timer_month'] = __( 'month', 'event_espresso' );
1067
-		EE_Registry::$i18n_js_strings['timer_week'] = __( 'week', 'event_espresso' );
1068
-		EE_Registry::$i18n_js_strings['timer_day'] = __( 'day', 'event_espresso' );
1069
-		EE_Registry::$i18n_js_strings['timer_hour'] = __( 'hour', 'event_espresso' );
1070
-		EE_Registry::$i18n_js_strings['timer_minute'] = __( 'minute', 'event_espresso' );
1071
-		EE_Registry::$i18n_js_strings['timer_second'] = __( 'second', 'event_espresso' );
1058
+		EE_Registry::$i18n_js_strings['timer_years'] = __('years', 'event_espresso');
1059
+		EE_Registry::$i18n_js_strings['timer_months'] = __('months', 'event_espresso');
1060
+		EE_Registry::$i18n_js_strings['timer_weeks'] = __('weeks', 'event_espresso');
1061
+		EE_Registry::$i18n_js_strings['timer_days'] = __('days', 'event_espresso');
1062
+		EE_Registry::$i18n_js_strings['timer_hours'] = __('hours', 'event_espresso');
1063
+		EE_Registry::$i18n_js_strings['timer_minutes'] = __('minutes', 'event_espresso');
1064
+		EE_Registry::$i18n_js_strings['timer_seconds'] = __('seconds', 'event_espresso');
1065
+		EE_Registry::$i18n_js_strings['timer_year'] = __('year', 'event_espresso');
1066
+		EE_Registry::$i18n_js_strings['timer_month'] = __('month', 'event_espresso');
1067
+		EE_Registry::$i18n_js_strings['timer_week'] = __('week', 'event_espresso');
1068
+		EE_Registry::$i18n_js_strings['timer_day'] = __('day', 'event_espresso');
1069
+		EE_Registry::$i18n_js_strings['timer_hour'] = __('hour', 'event_espresso');
1070
+		EE_Registry::$i18n_js_strings['timer_minute'] = __('minute', 'event_espresso');
1071
+		EE_Registry::$i18n_js_strings['timer_second'] = __('second', 'event_espresso');
1072 1072
 		EE_Registry::$i18n_js_strings['registration_expiration_notice'] = sprintf(
1073
-			__( '%1$sWe\'re sorry, but your registration time has expired.%2$s%3$s%4$sIf you still wish to complete your registration, please return to the %5$sEvent List%6$sEvent List%7$s and reselect your tickets if available. Please except our apologies for any inconvenience this may have caused.%8$s', 'event_espresso' ),
1073
+			__('%1$sWe\'re sorry, but your registration time has expired.%2$s%3$s%4$sIf you still wish to complete your registration, please return to the %5$sEvent List%6$sEvent List%7$s and reselect your tickets if available. Please except our apologies for any inconvenience this may have caused.%8$s', 'event_espresso'),
1074 1074
 			'<h4 class="important-notice">',
1075 1075
 			'</h4>',
1076 1076
 			'<br />',
1077 1077
 			'<p>',
1078
-			'<a href="'. get_post_type_archive_link( 'espresso_events' ) . '" title="',
1078
+			'<a href="'.get_post_type_archive_link('espresso_events').'" title="',
1079 1079
 			'">',
1080 1080
 			'</a>',
1081 1081
 			'</p>'
1082 1082
 		);
1083
-		EE_Registry::$i18n_js_strings[ 'ajax_submit' ] = apply_filters( 'FHEE__Single_Page_Checkout__translate_js_strings__ajax_submit', true );
1083
+		EE_Registry::$i18n_js_strings['ajax_submit'] = apply_filters('FHEE__Single_Page_Checkout__translate_js_strings__ajax_submit', true);
1084 1084
 	}
1085 1085
 
1086 1086
 
@@ -1093,25 +1093,25 @@  discard block
 block discarded – undo
1093 1093
 	 */
1094 1094
 	public function enqueue_styles_and_scripts() {
1095 1095
 		// load css
1096
-		wp_register_style( 'single_page_checkout', SPCO_CSS_URL . 'single_page_checkout.css', array(), EVENT_ESPRESSO_VERSION );
1097
-		wp_enqueue_style( 'single_page_checkout' );
1096
+		wp_register_style('single_page_checkout', SPCO_CSS_URL.'single_page_checkout.css', array(), EVENT_ESPRESSO_VERSION);
1097
+		wp_enqueue_style('single_page_checkout');
1098 1098
 		// load JS
1099
-		wp_register_script( 'jquery_plugin', EE_THIRD_PARTY_URL . 'jquery	.plugin.min.js', array( 'jquery' ), '1.0.1', TRUE );
1100
-		wp_register_script( 'jquery_countdown', EE_THIRD_PARTY_URL . 'jquery	.countdown.min.js', array( 'jquery_plugin' ), '2.0.2', TRUE );
1101
-		wp_register_script( 'single_page_checkout', SPCO_JS_URL . 'single_page_checkout.js', array( 'espresso_core', 'underscore', 'ee_form_section_validation', 'jquery_countdown' ), EVENT_ESPRESSO_VERSION, TRUE );
1102
-		wp_enqueue_script( 'single_page_checkout' );
1099
+		wp_register_script('jquery_plugin', EE_THIRD_PARTY_URL.'jquery	.plugin.min.js', array('jquery'), '1.0.1', TRUE);
1100
+		wp_register_script('jquery_countdown', EE_THIRD_PARTY_URL.'jquery	.countdown.min.js', array('jquery_plugin'), '2.0.2', TRUE);
1101
+		wp_register_script('single_page_checkout', SPCO_JS_URL.'single_page_checkout.js', array('espresso_core', 'underscore', 'ee_form_section_validation', 'jquery_countdown'), EVENT_ESPRESSO_VERSION, TRUE);
1102
+		wp_enqueue_script('single_page_checkout');
1103 1103
 
1104 1104
 		/**
1105 1105
 		 * global action hook for enqueueing styles and scripts with
1106 1106
 		 * spco calls.
1107 1107
 		 */
1108
-		do_action( 'AHEE__EED_Single_Page_Checkout__enqueue_styles_and_scripts', $this );
1108
+		do_action('AHEE__EED_Single_Page_Checkout__enqueue_styles_and_scripts', $this);
1109 1109
 
1110 1110
 		/**
1111 1111
 		 * dynamic action hook for enqueueing styles and scripts with spco calls.
1112 1112
 		 * The hook will end up being something like AHEE__EED_Single_Page_Checkout__enqueue_styles_and_scripts__attendee_information
1113 1113
 		 */
1114
-		do_action( 'AHEE__EED_Single_Page_Checkout__enqueue_styles_and_scripts__' . $this->checkout->current_step->slug(), $this );
1114
+		do_action('AHEE__EED_Single_Page_Checkout__enqueue_styles_and_scripts__'.$this->checkout->current_step->slug(), $this);
1115 1115
 
1116 1116
 		// add css and JS for current step
1117 1117
 		$this->checkout->current_step->enqueue_styles_and_scripts();
@@ -1127,20 +1127,20 @@  discard block
 block discarded – undo
1127 1127
 	 */
1128 1128
 	private function _display_spco_reg_form() {
1129 1129
 		// if registering via the admin, just display the reg form for the current step
1130
-		if ( $this->checkout->admin_request ) {
1131
-			EE_Registry::instance()->REQ->add_output( $this->checkout->current_step->display_reg_form() );
1130
+		if ($this->checkout->admin_request) {
1131
+			EE_Registry::instance()->REQ->add_output($this->checkout->current_step->display_reg_form());
1132 1132
 		} else {
1133 1133
 			// add powered by EE msg
1134
-			add_action( 'AHEE__SPCO__reg_form_footer', array( 'EED_Single_Page_Checkout', 'display_registration_footer' ));
1134
+			add_action('AHEE__SPCO__reg_form_footer', array('EED_Single_Page_Checkout', 'display_registration_footer'));
1135 1135
 
1136
-			$empty_cart = count( $this->checkout->transaction->registrations( $this->checkout->reg_cache_where_params ) ) < 1 ? true : false;
1136
+			$empty_cart = count($this->checkout->transaction->registrations($this->checkout->reg_cache_where_params)) < 1 ? true : false;
1137 1137
 			$cookies_not_set_msg = '';
1138
-			if ( $empty_cart ) {
1139
-				if ( ! isset( $_COOKIE[ 'ee_cookie_test' ] ) ) {
1138
+			if ($empty_cart) {
1139
+				if ( ! isset($_COOKIE['ee_cookie_test'])) {
1140 1140
 					$cookies_not_set_msg = apply_filters(
1141 1141
 						'FHEE__Single_Page_Checkout__display_spco_reg_form__cookies_not_set_msg',
1142 1142
 						sprintf(
1143
-							__( '%1$s%3$sIt appears your browser is not currently set to accept Cookies%4$s%5$sIn order to register for events, you need to enable cookies.%7$sIf you require assistance, then click the following link to learn how to %8$senable cookies%9$s%6$s%2$s', 'event_espresso' ),
1143
+							__('%1$s%3$sIt appears your browser is not currently set to accept Cookies%4$s%5$sIn order to register for events, you need to enable cookies.%7$sIf you require assistance, then click the following link to learn how to %8$senable cookies%9$s%6$s%2$s', 'event_espresso'),
1144 1144
 							'<div class="ee-attention">',
1145 1145
 							'</div>',
1146 1146
 							'<h6 class="important-notice">',
@@ -1161,7 +1161,7 @@  discard block
 block discarded – undo
1161 1161
 					'layout_strategy' =>
1162 1162
 						new EE_Template_Layout(
1163 1163
 							array(
1164
-								'layout_template_file' 			=> SPCO_TEMPLATES_PATH . 'registration_page_wrapper.template.php',
1164
+								'layout_template_file' 			=> SPCO_TEMPLATES_PATH.'registration_page_wrapper.template.php',
1165 1165
 								'template_args' => array(
1166 1166
 									'empty_cart' 		=> $empty_cart,
1167 1167
 									'revisit' 				=> $this->checkout->revisit,
@@ -1170,8 +1170,8 @@  discard block
 block discarded – undo
1170 1170
 									'empty_msg' 		=> apply_filters(
1171 1171
 										'FHEE__Single_Page_Checkout__display_spco_reg_form__empty_msg',
1172 1172
 										sprintf(
1173
-											__( 'You need to %1$sReturn to Events list%2$sselect at least one event%3$s before you can proceed with the registration process.', 'event_espresso' ),
1174
-											'<a href="' . get_post_type_archive_link( 'espresso_events' ) . '" title="',
1173
+											__('You need to %1$sReturn to Events list%2$sselect at least one event%3$s before you can proceed with the registration process.', 'event_espresso'),
1174
+											'<a href="'.get_post_type_archive_link('espresso_events').'" title="',
1175 1175
 											'">',
1176 1176
 											'</a>'
1177 1177
 										)
@@ -1179,14 +1179,14 @@  discard block
 block discarded – undo
1179 1179
 									'cookies_not_set_msg' 		=> $cookies_not_set_msg,
1180 1180
 									'registration_time_limit' 	=> $this->checkout->get_registration_time_limit(),
1181 1181
 									'session_expiration' 			=>
1182
-										gmdate( 'M d, Y H:i:s', EE_Registry::instance()->SSN->expiration() + ( get_option( 'gmt_offset' ) * HOUR_IN_SECONDS ) )
1182
+										gmdate('M d, Y H:i:s', EE_Registry::instance()->SSN->expiration() + (get_option('gmt_offset') * HOUR_IN_SECONDS))
1183 1183
 							)
1184 1184
 						)
1185 1185
 					)
1186 1186
 				)
1187 1187
 			);
1188 1188
 			// load template and add to output sent that gets filtered into the_content()
1189
-			EE_Registry::instance()->REQ->add_output( $this->checkout->registration_form->get_html_and_js() );
1189
+			EE_Registry::instance()->REQ->add_output($this->checkout->registration_form->get_html_and_js());
1190 1190
 		}
1191 1191
 	}
1192 1192
 
@@ -1200,8 +1200,8 @@  discard block
 block discarded – undo
1200 1200
 	 * @internal  param string $label
1201 1201
 	 * @return        string
1202 1202
 	 */
1203
-	public function add_extra_finalize_registration_inputs( $next_step ) {
1204
-		if ( $next_step == 'finalize_registration' ) {
1203
+	public function add_extra_finalize_registration_inputs($next_step) {
1204
+		if ($next_step == 'finalize_registration') {
1205 1205
 			echo '<div id="spco-extra-finalize_registration-inputs-dv"></div>';
1206 1206
 		}
1207 1207
 	}
@@ -1215,18 +1215,18 @@  discard block
 block discarded – undo
1215 1215
 	 *  @return 	string
1216 1216
 	 */
1217 1217
 	public static function display_registration_footer() {
1218
-		if ( apply_filters( 'FHEE__EE_Front__Controller__show_reg_footer', EE_Registry::instance()->CFG->admin->show_reg_footer ) ) {
1219
-			EE_Registry::instance()->CFG->admin->affiliate_id = ! empty( EE_Registry::instance()->CFG->admin->affiliate_id ) ? EE_Registry::instance()->CFG->admin->affiliate_id : 'default';
1220
-			$url = add_query_arg( array( 'ap_id' => EE_Registry::instance()->CFG->admin->affiliate_id ), 'http://eventespresso.com/' );
1221
-			$url = apply_filters( 'FHEE__EE_Front_Controller__registration_footer__url', $url );
1218
+		if (apply_filters('FHEE__EE_Front__Controller__show_reg_footer', EE_Registry::instance()->CFG->admin->show_reg_footer)) {
1219
+			EE_Registry::instance()->CFG->admin->affiliate_id = ! empty(EE_Registry::instance()->CFG->admin->affiliate_id) ? EE_Registry::instance()->CFG->admin->affiliate_id : 'default';
1220
+			$url = add_query_arg(array('ap_id' => EE_Registry::instance()->CFG->admin->affiliate_id), 'http://eventespresso.com/');
1221
+			$url = apply_filters('FHEE__EE_Front_Controller__registration_footer__url', $url);
1222 1222
 			echo apply_filters(
1223 1223
 				'FHEE__EE_Front_Controller__display_registration_footer',
1224 1224
 				sprintf(
1225
-					__( '%1$sEvent Registration Powered by Event Espresso%2$sEvent Registration and Ticketing%3$s Powered by %4$sEvent Espresso - Event Registration and Management System for WordPress%5$sEvent Espresso%6$s', 'event_espresso' ),
1226
-					'<div id="espresso-registration-footer-dv"><a href="' . $url . '" title="',
1225
+					__('%1$sEvent Registration Powered by Event Espresso%2$sEvent Registration and Ticketing%3$s Powered by %4$sEvent Espresso - Event Registration and Management System for WordPress%5$sEvent Espresso%6$s', 'event_espresso'),
1226
+					'<div id="espresso-registration-footer-dv"><a href="'.$url.'" title="',
1227 1227
 					'" target="_blank">',
1228 1228
 					'</a>',
1229
-					'<a href="' . $url . '" title="',
1229
+					'<a href="'.$url.'" title="',
1230 1230
 					'" target="_blank">',
1231 1231
 					'</a></div>'
1232 1232
 				)
@@ -1257,12 +1257,12 @@  discard block
 block discarded – undo
1257 1257
 	 * @return 	array
1258 1258
 	 */
1259 1259
 	private function _setup_redirect() {
1260
-		if ( $this->checkout->continue_reg && $this->checkout->next_step instanceof EE_SPCO_Reg_Step ) {
1260
+		if ($this->checkout->continue_reg && $this->checkout->next_step instanceof EE_SPCO_Reg_Step) {
1261 1261
 			$this->checkout->redirect = TRUE;
1262
-			if ( empty( $this->checkout->redirect_url )) {
1262
+			if (empty($this->checkout->redirect_url)) {
1263 1263
 				$this->checkout->redirect_url = $this->checkout->next_step->reg_step_url();
1264 1264
 			}
1265
-			$this->checkout->redirect_url = apply_filters( 'FHEE__EED_Single_Page_Checkout___setup_redirect__checkout_redirect_url', $this->checkout->redirect_url, $this->checkout );
1265
+			$this->checkout->redirect_url = apply_filters('FHEE__EED_Single_Page_Checkout___setup_redirect__checkout_redirect_url', $this->checkout->redirect_url, $this->checkout);
1266 1266
 		}
1267 1267
 	}
1268 1268
 
@@ -1275,12 +1275,12 @@  discard block
 block discarded – undo
1275 1275
 	 * @return void
1276 1276
 	 */
1277 1277
 	public function go_to_next_step() {
1278
-		if ( EE_Registry::instance()->REQ->ajax ) {
1278
+		if (EE_Registry::instance()->REQ->ajax) {
1279 1279
 			// capture contents of output buffer we started earlier in the request, and insert into JSON response
1280
-			$this->checkout->json_response->set_unexpected_errors( ob_get_clean() );
1280
+			$this->checkout->json_response->set_unexpected_errors(ob_get_clean());
1281 1281
 		}
1282 1282
 		// just return for these conditions
1283
-		if ( $this->checkout->admin_request || $this->checkout->action == 'redirect_form' || $this->checkout->action == 'update_checkout' ) {
1283
+		if ($this->checkout->admin_request || $this->checkout->action == 'redirect_form' || $this->checkout->action == 'update_checkout') {
1284 1284
 			return;
1285 1285
 		}
1286 1286
 		// AJAX response
@@ -1301,7 +1301,7 @@  discard block
 block discarded – undo
1301 1301
 	 */
1302 1302
 	protected function _handle_json_response() {
1303 1303
 		// if this is an ajax request
1304
-		if ( EE_Registry::instance()->REQ->ajax ) {
1304
+		if (EE_Registry::instance()->REQ->ajax) {
1305 1305
 			// DEBUG LOG
1306 1306
 			//$this->checkout->log(
1307 1307
 			//	__CLASS__, __FUNCTION__, __LINE__,
@@ -1311,10 +1311,10 @@  discard block
 block discarded – undo
1311 1311
 			//		'continue_reg'               => $this->checkout->continue_reg,
1312 1312
 			//	)
1313 1313
 			//);
1314
-			$this->checkout->json_response->set_registration_time_limit( $this->checkout->get_registration_time_limit() );
1315
-			$this->checkout->json_response->set_payment_amount( $this->checkout->amount_owing );
1314
+			$this->checkout->json_response->set_registration_time_limit($this->checkout->get_registration_time_limit());
1315
+			$this->checkout->json_response->set_payment_amount($this->checkout->amount_owing);
1316 1316
 			// just send the ajax (
1317
-			$json_response = apply_filters( 'FHEE__EE_Single_Page_Checkout__JSON_response', $this->checkout->json_response );
1317
+			$json_response = apply_filters('FHEE__EE_Single_Page_Checkout__JSON_response', $this->checkout->json_response);
1318 1318
 			$this->unlock_transaction();
1319 1319
 			echo $json_response;
1320 1320
 			exit();
@@ -1331,9 +1331,9 @@  discard block
 block discarded – undo
1331 1331
 	 */
1332 1332
 	protected function _handle_html_redirects() {
1333 1333
 		// going somewhere ?
1334
-		if ( $this->checkout->redirect && ! empty( $this->checkout->redirect_url ) ) {
1334
+		if ($this->checkout->redirect && ! empty($this->checkout->redirect_url)) {
1335 1335
 			// store notices in a transient
1336
-			EE_Error::get_notices( false, true, true );
1336
+			EE_Error::get_notices(false, true, true);
1337 1337
 			$this->unlock_transaction();
1338 1338
 			// DEBUG LOG
1339 1339
 			//$this->checkout->log(
@@ -1344,7 +1344,7 @@  discard block
 block discarded – undo
1344 1344
 			//		'headers_list'    => headers_list(),
1345 1345
 			//	)
1346 1346
 			//);
1347
-			wp_safe_redirect( $this->checkout->redirect_url );
1347
+			wp_safe_redirect($this->checkout->redirect_url);
1348 1348
 			exit();
1349 1349
 		}
1350 1350
 	}
Please login to merge, or discard this patch.