Completed
Branch BUG-9680-compress-dompdf-files... (43e183)
by
unknown
63:41 queued 52:16
created
core/libraries/shortcodes/EE_Event_Meta_Shortcodes.lib.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
 /**
@@ -51,19 +51,19 @@  discard block
 block discarded – undo
51 51
 	 * @param  mixed (array|object) $data      incoming data object/array
52 52
 	 * @return string            parsed code.
53 53
 	 */
54
-	public function parser( $shortcode, $data, $extra_data = array() ) {
54
+	public function parser($shortcode, $data, $extra_data = array()) {
55 55
 		
56 56
 		//all shortcodes will be checked in the post_meta table (assuming the shortcode matches the post_meta key);
57
-		if ( empty( $this->_data['ID'] ) )
57
+		if (empty($this->_data['ID']))
58 58
 			return ''; //need the event id to do anything!
59 59
 
60 60
 		$meta = get_post_meta($this->_data['ID'], $shortcode, true);
61 61
 
62
-		return !empty( $meta ) ? $meta : '';
62
+		return ! empty($meta) ? $meta : '';
63 63
 	}
64 64
 
65 65
 
66
-	protected function _parser( $shortcode ) {}
66
+	protected function _parser($shortcode) {}
67 67
 
68 68
 
69 69
 } //end EE_Event_Meta_Shortcodes class
70 70
\ No newline at end of file
Please login to merge, or discard this patch.
Braces   +6 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
@@ -54,8 +55,10 @@  discard block
 block discarded – undo
54 55
 	public function parser( $shortcode, $data, $extra_data = array() ) {
55 56
 		
56 57
 		//all shortcodes will be checked in the post_meta table (assuming the shortcode matches the post_meta key);
57
-		if ( empty( $this->_data['ID'] ) )
58
-			return ''; //need the event id to do anything!
58
+		if ( empty( $this->_data['ID'] ) ) {
59
+					return '';
60
+		}
61
+		//need the event id to do anything!
59 62
 
60 63
 		$meta = get_post_meta($this->_data['ID'], $shortcode, true);
61 64
 
Please login to merge, or discard this patch.
core/libraries/shortcodes/EE_Line_Item_Shortcodes.lib.php 2 patches
Spacing   +11 added lines, -11 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
 /**
@@ -34,23 +34,23 @@  discard block
 block discarded – undo
34 34
 			'[LINE_ITEM_NAME]' => __('Outputs the line item name.', 'event_espresso'),
35 35
 			'[LINE_ITEM_DESCRIPTION]' => __('Outputs a the description for the line item.', 'event_espresso'),
36 36
 			'[LINE_ITEM_QUANTITY]' => __('Outputs the quantity for this line item.', 'event_espresso'),
37
-			'[LINE_ITEM_AMOUNT]' => __('This will either output the unit price for a line item if its not a percent, or the percent of the line item (if it is percent).', 'event_espresso' ),
37
+			'[LINE_ITEM_AMOUNT]' => __('This will either output the unit price for a line item if its not a percent, or the percent of the line item (if it is percent).', 'event_espresso'),
38 38
 			'[LINE_ITEM_TOTAL]' => __('This outputs the line item total.', 'event_espresso'),
39
-			'[LINE_ITEM_TAXABLE_*]' => __('This attribute type shortcode allows users to indicate what to output if a line item is taxable or not.  One can use the key "symbol=" with the shortcode to indicate what they\'d like to represent a taxable line item.  So doing something like <code>[LINE_ITEM_TAXABLE_* symbol="*"]</code> means that when the line item is parsed, if it\'s taxable the "*" symbol will be returned.  The default symbol if no attribute is included is the "*" symbol.', 'event_espresso' )
39
+			'[LINE_ITEM_TAXABLE_*]' => __('This attribute type shortcode allows users to indicate what to output if a line item is taxable or not.  One can use the key "symbol=" with the shortcode to indicate what they\'d like to represent a taxable line item.  So doing something like <code>[LINE_ITEM_TAXABLE_* symbol="*"]</code> means that when the line item is parsed, if it\'s taxable the "*" symbol will be returned.  The default symbol if no attribute is included is the "*" symbol.', 'event_espresso')
40 40
 			);
41 41
 	}
42 42
 
43 43
 
44 44
 
45
-	protected function _parser( $shortcode ) {
45
+	protected function _parser($shortcode) {
46 46
 		//ensure that the incoming object IS a line item.  If it isn't then bail early.
47
-		if ( ! $this->_data instanceof EE_Line_Item ) {
47
+		if ( ! $this->_data instanceof EE_Line_Item) {
48 48
 			return '';
49 49
 		}
50 50
 
51 51
 		$line_item = $this->_data;
52 52
 
53
-		switch ( $shortcode ) {
53
+		switch ($shortcode) {
54 54
 			case '[LINE_ITEM_NAME]' :
55 55
 				return $line_item->name();
56 56
 				break;
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
 				break;
65 65
 
66 66
 			case '[LINE_ITEM_AMOUNT]' :
67
-				return $line_item->is_percent() ? $line_item->percent() . '%' : $line_item->unit_price_no_code();
67
+				return $line_item->is_percent() ? $line_item->percent().'%' : $line_item->unit_price_no_code();
68 68
 				break;
69 69
 
70 70
 			case '[LINE_ITEM_TOTAL]' :
@@ -72,10 +72,10 @@  discard block
 block discarded – undo
72 72
 				break;
73 73
 		}
74 74
 
75
-		if ( strpos( $shortcode, '[LINE_ITEM_TAXABLE_*' ) !== FALSE ) {
76
-			$attrs = $this->_get_shortcode_attrs( $shortcode );
77
-			if ( $line_item->is_taxable() ) {
78
-				return !empty( $attrs['symbol'] ) ? $attrs['symbol'] : '*';
75
+		if (strpos($shortcode, '[LINE_ITEM_TAXABLE_*') !== FALSE) {
76
+			$attrs = $this->_get_shortcode_attrs($shortcode);
77
+			if ($line_item->is_taxable()) {
78
+				return ! empty($attrs['symbol']) ? $attrs['symbol'] : '*';
79 79
 			}
80 80
 		}
81 81
 
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_Messenger_Shortcodes.lib.php 2 patches
Braces   +6 added lines, -3 removed lines patch added patch discarded remove patch
@@ -6,7 +6,9 @@  discard block
 block discarded – undo
6 6
  * @package Event Espresso
7 7
  * @subpackage shortcodes library
8 8
  */
9
-if ( ! defined('EVENT_ESPRESSO_VERSION')) exit('No direct script access allowed');
9
+if ( ! defined('EVENT_ESPRESSO_VERSION')) {
10
+	exit('No direct script access allowed');
11
+}
10 12
 /**
11 13
  * EE_Messenger_Shortcodes
12 14
  *
@@ -69,8 +71,9 @@  discard block
 block discarded – undo
69 71
 		$recipient = ! $recipient instanceof EE_Messages_Addressee && is_array($this->_data) && isset( $this->_data['data'] ) && $this->_data['data'] instanceof EE_Messages_Addressee ? $this->_data['data'] : $recipient;
70 72
 		$recipient = ! $recipient instanceof EE_Messages_Addressee && !empty( $this->_extra_data['data'] ) && $this->_extra_data['data'] instanceof EE_Messages_Addressee ? $this->_extra_data['data'] : $recipient;
71 73
 
72
-		if ( ! $recipient instanceof EE_Messages_Addressee )
73
-			return '';
74
+		if ( ! $recipient instanceof EE_Messages_Addressee ) {
75
+					return '';
76
+		}
74 77
 
75 78
 		switch ( $shortcode ) {
76 79
 			case '[DISPLAY_HTML_URL]' :
Please login to merge, or discard this patch.
Spacing   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -41,22 +41,22 @@  discard block
 block discarded – undo
41 41
 		$this->label = __('Messenger Shortcodes', 'event_espresso');
42 42
 		$this->description = __('All shortcodes that are messenger specific.', 'event_espresso');
43 43
 		/** @type EE_Message_Resource_Manager $message_resource_manager */
44
-		$message_resource_manager = EE_Registry::instance()->load_lib( 'Message_Resource_Manager' );
44
+		$message_resource_manager = EE_Registry::instance()->load_lib('Message_Resource_Manager');
45 45
 		//add messages about what happens  when the messenger is active.
46 46
 		$this->_active_messengers = $message_resource_manager->active_messengers();
47 47
 
48
-		$this->_shortcodes['[DISPLAY_HTML_URL]'] =__('This will return a link to view the template in a browser if the html messenger is active.', 'event_espresso');
49
-		$this->_shortcodes['[DISPLAY_PDF_URL]'] = __('This will return a link to generate a pdf for the template if the pdf messenger is active.', 'event_espresso' );
48
+		$this->_shortcodes['[DISPLAY_HTML_URL]'] = __('This will return a link to view the template in a browser if the html messenger is active.', 'event_espresso');
49
+		$this->_shortcodes['[DISPLAY_PDF_URL]'] = __('This will return a link to generate a pdf for the template if the pdf messenger is active.', 'event_espresso');
50 50
 		$this->_shortcodes['[DISPLAY_PDF_BUTTON]'] = __('This will return html for a download pdf button trigger if the pdf messenger is active.', 'event_espresso');
51 51
 
52 52
 		//show error message about buttons/urls not working as expected if messenger deactivated.
53
-		if ( is_admin() && isset( $_REQUEST['action'] ) && $_REQUEST['action'] == 'update_message_template' ) {
54
-			if ( ! isset( $this->_active_messengers['pdf'] ) ) {
55
-				EE_Error::add_attention( __('Be aware that the pdf messenger is inactive.  This means that any pdf related shortcodes will parse to an empty string.', 'event_espresso' ) );
53
+		if (is_admin() && isset($_REQUEST['action']) && $_REQUEST['action'] == 'update_message_template') {
54
+			if ( ! isset($this->_active_messengers['pdf'])) {
55
+				EE_Error::add_attention(__('Be aware that the pdf messenger is inactive.  This means that any pdf related shortcodes will parse to an empty string.', 'event_espresso'));
56 56
 			}
57 57
 
58
-			if ( !isset( $this->_active_messengers['html'] ) ) {
59
-				EE_Error::add_attention( __('Be aware that the html messenger is inactive. This means that any html related shortcodes will parse to an empty string.', 'event_espresso' ) );
58
+			if ( ! isset($this->_active_messengers['html'])) {
59
+				EE_Error::add_attention(__('Be aware that the html messenger is inactive. This means that any html related shortcodes will parse to an empty string.', 'event_espresso'));
60 60
 			}
61 61
 		}
62 62
 
@@ -64,24 +64,24 @@  discard block
 block discarded – undo
64 64
 
65 65
 
66 66
 
67
-	protected function _parser( $shortcode ) {
67
+	protected function _parser($shortcode) {
68 68
 		//make sure we end up with a copy of the EE_Messages_Addressee object
69 69
 		$recipient = $this->_data instanceof EE_Messages_Addressee ? $this->_data : NULL;
70
-		$recipient = ! $recipient instanceof EE_Messages_Addressee && is_array($this->_data) && isset( $this->_data['data'] ) && $this->_data['data'] instanceof EE_Messages_Addressee ? $this->_data['data'] : $recipient;
71
-		$recipient = ! $recipient instanceof EE_Messages_Addressee && !empty( $this->_extra_data['data'] ) && $this->_extra_data['data'] instanceof EE_Messages_Addressee ? $this->_extra_data['data'] : $recipient;
70
+		$recipient = ! $recipient instanceof EE_Messages_Addressee && is_array($this->_data) && isset($this->_data['data']) && $this->_data['data'] instanceof EE_Messages_Addressee ? $this->_data['data'] : $recipient;
71
+		$recipient = ! $recipient instanceof EE_Messages_Addressee && ! empty($this->_extra_data['data']) && $this->_extra_data['data'] instanceof EE_Messages_Addressee ? $this->_extra_data['data'] : $recipient;
72 72
 
73
-		if ( ! $recipient instanceof EE_Messages_Addressee )
73
+		if ( ! $recipient instanceof EE_Messages_Addressee)
74 74
 			return '';
75 75
 
76
-		switch ( $shortcode ) {
76
+		switch ($shortcode) {
77 77
 			case '[DISPLAY_HTML_URL]' :
78
-				return  isset( $this->_active_messengers['html'] ) ? $this->_get_url( $recipient, 'html' ) : '';
78
+				return  isset($this->_active_messengers['html']) ? $this->_get_url($recipient, 'html') : '';
79 79
 				break;
80 80
 			case '[DISPLAY_PDF_URL]' :
81
-				return  isset( $this->_active_messengers['pdf'] ) ? $this->_get_url( $recipient, 'pdf' ) : '';
81
+				return  isset($this->_active_messengers['pdf']) ? $this->_get_url($recipient, 'pdf') : '';
82 82
 				break;
83 83
 			case '[DISPLAY_PDF_BUTTON]' :
84
-				return  isset( $this->_active_messengers['pdf'] ) ? $this->_get_button( $recipient, 'pdf' ) : '';
84
+				return  isset($this->_active_messengers['pdf']) ? $this->_get_button($recipient, 'pdf') : '';
85 85
 				break;
86 86
 		}
87 87
 		return '';
@@ -99,11 +99,11 @@  discard block
 block discarded – undo
99 99
 	 *
100 100
 	 * @return string                Generated html
101 101
 	 */
102
-	private function _get_button( EE_Messages_Addressee $recipient, $sending_messenger ) {
103
-		$download_text = $sending_messenger == 'pdf' ? __('Download PDF', 'event_espresso') : __('Show HTML', 'event_espresso' );
102
+	private function _get_button(EE_Messages_Addressee $recipient, $sending_messenger) {
103
+		$download_text = $sending_messenger == 'pdf' ? __('Download PDF', 'event_espresso') : __('Show HTML', 'event_espresso');
104 104
 		$content = '
105
-<form method="post" action="' . $this->_get_url( $recipient, $sending_messenger ) . '" >
106
-	<input class="print_button" type="submit" value="' . $download_text . '" />
105
+<form method="post" action="' . $this->_get_url($recipient, $sending_messenger).'" >
106
+	<input class="print_button" type="submit" value="' . $download_text.'" />
107 107
 </form>
108 108
 		';
109 109
 		return $content;
@@ -122,18 +122,18 @@  discard block
 block discarded – undo
122 122
 	 * @return string The generated url for displaying the link.
123 123
 	 * @throws EE_Error
124 124
 	 */
125
-	private function _get_url( EE_Messages_Addressee $recipient, $sending_messenger ) {
125
+	private function _get_url(EE_Messages_Addressee $recipient, $sending_messenger) {
126 126
 
127 127
 		$reg = $recipient->reg_obj;
128 128
 		$reg = ! $reg instanceof EE_Registration ? $recipient->primary_reg_obj : $reg;
129 129
 
130 130
 
131
-		if ( $this->_message_type instanceof EE_message_type && $this->_message instanceof EE_Message ) {
132
-			EE_Registry::instance()->load_helper( 'MSG_Template' );
131
+		if ($this->_message_type instanceof EE_message_type && $this->_message instanceof EE_Message) {
132
+			EE_Registry::instance()->load_helper('MSG_Template');
133 133
 			try {
134
-				return EEH_MSG_Template::get_url_trigger( $this->_message_type, $this->_message, $reg, $sending_messenger );
135
-			} catch( EE_Error $e ) {
136
-				if ( WP_DEBUG ) {
134
+				return EEH_MSG_Template::get_url_trigger($this->_message_type, $this->_message, $reg, $sending_messenger);
135
+			} catch (EE_Error $e) {
136
+				if (WP_DEBUG) {
137 137
 					$e->get_error();
138 138
 				}
139 139
 			}
Please login to merge, or discard this patch.
core/libraries/shortcodes/EE_Payment_Shortcodes.lib.php 2 patches
Spacing   +9 added lines, -9 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
 /**
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
 			'[PAYMENT_TIMESTAMP]' => __('Outputs the date of the payment (using the default date format).', 'event_espresso'),
35 35
 			'[PAYMENT_METHOD]' => __('Outputs a the payment method.', 'event_espresso'),
36 36
 			'[PAYMENT_AMOUNT]' => __('Outputs the payment amount (with currency symbol).', 'event_espresso'),
37
-			'[PAYMENT_GATEWAY]' => __('Outputs the gateway used for the payment.', 'event_espresso' ),
37
+			'[PAYMENT_GATEWAY]' => __('Outputs the gateway used for the payment.', 'event_espresso'),
38 38
 			'[PAYMENT_GATEWAY_RESPONSE]' => __('Outputs the payment gateway response.', 'event_espresso'),
39 39
 			'[PAYMENT_GATEWAY_TXN_ID]' => __('This will either be the gateway transaction ID, or the manual ID added with payment applied via the admin.', 'event_espresso'),
40 40
 			'[PAYMENT_PO_NUMBER]' => __('Purchase Order number (if present)', 'event_espresso'),
@@ -46,15 +46,15 @@  discard block
 block discarded – undo
46 46
 
47 47
 
48 48
 
49
-	protected function _parser( $shortcode ) {
49
+	protected function _parser($shortcode) {
50 50
 		//ensure that the incoming object is an EE_Payment object.  If it isn't then bail early.
51
-		if ( ! $this->_data instanceof EE_Payment ) {
51
+		if ( ! $this->_data instanceof EE_Payment) {
52 52
 			return '';
53 53
 		}
54 54
 
55 55
 		$payment = $this->_data;
56 56
 
57
-		switch ( $shortcode ) {
57
+		switch ($shortcode) {
58 58
 			case '[PAYMENT_TIMESTAMP]' :
59 59
 				return $payment->timestamp();
60 60
 				break;
@@ -70,10 +70,10 @@  discard block
 block discarded – undo
70 70
 
71 71
 			case '[PAYMENT_GATEWAY]' :
72 72
 				//previously teh column 'PMD_ID' was more-or-less 'PAY_gateway'
73
-				if( $payment->payment_method() instanceof EE_Payment_Method ){
73
+				if ($payment->payment_method() instanceof EE_Payment_Method) {
74 74
 					return $payment->payment_method()->name();
75
-				}else{
76
-					return __( 'Unknown', 'event_espresso' );
75
+				} else {
76
+					return __('Unknown', 'event_espresso');
77 77
 				}
78 78
 				break;
79 79
 
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
 				break;
99 99
 
100 100
 			case '[PAYMENT_STATUS_WITH_ICONS]' :
101
-				return $payment->pretty_status( TRUE );
101
+				return $payment->pretty_status(TRUE);
102 102
 				break;
103 103
 
104 104
 			default :
Please login to merge, or discard this patch.
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -6,8 +6,9 @@  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 13
 /**
13 14
  *
@@ -72,7 +73,7 @@  discard block
 block discarded – undo
72 73
 				//previously teh column 'PMD_ID' was more-or-less 'PAY_gateway'
73 74
 				if( $payment->payment_method() instanceof EE_Payment_Method ){
74 75
 					return $payment->payment_method()->name();
75
-				}else{
76
+				} else{
76 77
 					return __( 'Unknown', 'event_espresso' );
77 78
 				}
78 79
 				break;
Please login to merge, or discard this patch.
libraries/shortcodes/EE_Primary_Registration_Details_Shortcodes.lib.php 2 patches
Spacing   +18 added lines, -18 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
 /**
@@ -45,32 +45,32 @@  discard block
 block discarded – undo
45 45
 			'[PRIMARY_REGISTRANT_ADDRESS2]' => __('Whatever was in the address 2 field for the primary registrant for the transaction.', 'event_espresso'),
46 46
 			'[PRIMARY_REGISTRANT_CITY]' => __('The city for the primary registrant for the transaction.', 'event_espresso'),
47 47
 			'[PRIMARY_REGISTRANT_ZIP_PC]' => __('The ZIP (or Postal) Code for the primary registrant for the transaction.', 'event_espresso'),
48
-			'[PRIMARY_REGISTRANT_ADDRESS_STATE]' => __('The state/province for the primary registrant for the transaction.', 'event_espresso' ),
48
+			'[PRIMARY_REGISTRANT_ADDRESS_STATE]' => __('The state/province for the primary registrant for the transaction.', 'event_espresso'),
49 49
 			'[PRIMARY_REGISTRANT_COUNTRY]' => __('The country for the primary registrant for the transaction.', 'event_espresso'),
50 50
 			'[PRIMARY_REGISTRANT_REGISTRATION_DATE]' => __('The date the registration occured for the primary registration.', 'event_espresso'),
51 51
 			'[PRIMARY_REGISTRANT_FRONTEND_EDIT_REG_LINK]' => __('Generates a link for the given registration to edit this registration details on the frontend.', 'event_espresso'),
52
-			'[PRIMARY_REGISTRANT_ANSWER_*]' => __('This is a special dynamic shortcode.  After the "*", add the exact text of an existing question, and if there is an answer for that question for this primary registrant, then it will be output in place of this shortcode.', 'event_espresso' )
52
+			'[PRIMARY_REGISTRANT_ANSWER_*]' => __('This is a special dynamic shortcode.  After the "*", add the exact text of an existing question, and if there is an answer for that question for this primary registrant, then it will be output in place of this shortcode.', 'event_espresso')
53 53
 			);
54 54
 	}
55 55
 
56 56
 
57 57
 
58
-	protected function _parser( $shortcode ) {
58
+	protected function _parser($shortcode) {
59 59
 		//make sure we end up with a copy of the EE_Messages_Addressee object
60 60
 		$primary_registration = $this->_data instanceof EE_Messages_Addressee ? $this->_data : NULL;
61
-		$primary_registration = ! $primary_registration instanceof EE_Messages_Addressee && is_array($this->_data) && isset( $this->_data['data'] ) && $this->_data['data'] instanceof EE_Messages_Addressee ? $this->_data['data'] : $primary_registration;
62
-		$primary_registration = ! $primary_registration instanceof EE_Messages_Addressee && !empty( $this->_extra_data['data'] ) && $this->_extra_data['data'] instanceof EE_Messages_Addressee ? $this->_extra_data['data'] : $primary_registration;
61
+		$primary_registration = ! $primary_registration instanceof EE_Messages_Addressee && is_array($this->_data) && isset($this->_data['data']) && $this->_data['data'] instanceof EE_Messages_Addressee ? $this->_data['data'] : $primary_registration;
62
+		$primary_registration = ! $primary_registration instanceof EE_Messages_Addressee && ! empty($this->_extra_data['data']) && $this->_extra_data['data'] instanceof EE_Messages_Addressee ? $this->_extra_data['data'] : $primary_registration;
63 63
 
64
-		if ( ! $primary_registration instanceof EE_Messages_Addressee )
64
+		if ( ! $primary_registration instanceof EE_Messages_Addressee)
65 65
 			return '';
66 66
 
67 67
 		$attendee = $primary_registration->primary_att_obj;
68 68
 		$primary_reg = $primary_registration->primary_reg_obj;
69 69
 
70
-		if ( ! $attendee instanceof EE_Attendee || ! $primary_reg instanceof EE_Registration )
70
+		if ( ! $attendee instanceof EE_Attendee || ! $primary_reg instanceof EE_Registration)
71 71
 			return '';
72 72
 
73
-		switch ( $shortcode ) {
73
+		switch ($shortcode) {
74 74
 			case '[PRIMARY_REGISTRANT_FNAME]' :
75 75
 				return $attendee->fname();
76 76
 				break;
@@ -118,9 +118,9 @@  discard block
 block discarded – undo
118 118
 				break;
119 119
 
120 120
 			case '[PRIMARY_REGISTRANT_REGISTRATION_DATE]' :
121
-				if ( ! $primary_registration->primary_reg_obj instanceof EE_Registration )
121
+				if ( ! $primary_registration->primary_reg_obj instanceof EE_Registration)
122 122
 					return '';
123
-				return $primary_registration->primary_reg_obj->get_i18n_datetime( 'REG_date', get_option( 'date_format' ) );
123
+				return $primary_registration->primary_reg_obj->get_i18n_datetime('REG_date', get_option('date_format'));
124 124
 				break;
125 125
 
126 126
 			case '[PRIMARY_REGISTRANT_FRONTEND_EDIT_REG_LINK]' :
@@ -128,19 +128,19 @@  discard block
 block discarded – undo
128 128
 				break;
129 129
 		}
130 130
 
131
-		if ( strpos( $shortcode, '[PRIMARY_REGISTRANT_ANSWER_*' ) !== false ) {
132
-			$shortcode = str_replace( '[PRIMARY_REGISTRANT_ANSWER_*', '', $shortcode );
133
-			$shortcode = trim( str_replace( ']', '', $shortcode ) );
131
+		if (strpos($shortcode, '[PRIMARY_REGISTRANT_ANSWER_*') !== false) {
132
+			$shortcode = str_replace('[PRIMARY_REGISTRANT_ANSWER_*', '', $shortcode);
133
+			$shortcode = trim(str_replace(']', '', $shortcode));
134 134
 
135 135
 
136 136
 			//now let's figure out what question has this text
137
-			if ( empty( $primary_registration->questions ) ) {
137
+			if (empty($primary_registration->questions)) {
138 138
 				return '';
139 139
 			}
140 140
 
141
-			foreach ( $primary_registration->questions as $ansid => $question ) {
142
-				if ( $question->get('QST_display_text') == $shortcode && isset( $primary_registration->registrations[$primary_reg->ID()]['ans_objs'][$ansid] ) ) {
143
-					return $primary_registration->registrations[$primary_reg->ID()]['ans_objs'][$ansid]->get_pretty( 'ANS_value', 'no_wpautop' );
141
+			foreach ($primary_registration->questions as $ansid => $question) {
142
+				if ($question->get('QST_display_text') == $shortcode && isset($primary_registration->registrations[$primary_reg->ID()]['ans_objs'][$ansid])) {
143
+					return $primary_registration->registrations[$primary_reg->ID()]['ans_objs'][$ansid]->get_pretty('ANS_value', 'no_wpautop');
144 144
 				}
145 145
 			}
146 146
 		}
Please login to merge, or discard this patch.
Braces   +11 added lines, -7 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
@@ -61,14 +62,16 @@  discard block
 block discarded – undo
61 62
 		$primary_registration = ! $primary_registration instanceof EE_Messages_Addressee && is_array($this->_data) && isset( $this->_data['data'] ) && $this->_data['data'] instanceof EE_Messages_Addressee ? $this->_data['data'] : $primary_registration;
62 63
 		$primary_registration = ! $primary_registration instanceof EE_Messages_Addressee && !empty( $this->_extra_data['data'] ) && $this->_extra_data['data'] instanceof EE_Messages_Addressee ? $this->_extra_data['data'] : $primary_registration;
63 64
 
64
-		if ( ! $primary_registration instanceof EE_Messages_Addressee )
65
-			return '';
65
+		if ( ! $primary_registration instanceof EE_Messages_Addressee ) {
66
+					return '';
67
+		}
66 68
 
67 69
 		$attendee = $primary_registration->primary_att_obj;
68 70
 		$primary_reg = $primary_registration->primary_reg_obj;
69 71
 
70
-		if ( ! $attendee instanceof EE_Attendee || ! $primary_reg instanceof EE_Registration )
71
-			return '';
72
+		if ( ! $attendee instanceof EE_Attendee || ! $primary_reg instanceof EE_Registration ) {
73
+					return '';
74
+		}
72 75
 
73 76
 		switch ( $shortcode ) {
74 77
 			case '[PRIMARY_REGISTRANT_FNAME]' :
@@ -118,8 +121,9 @@  discard block
 block discarded – undo
118 121
 				break;
119 122
 
120 123
 			case '[PRIMARY_REGISTRANT_REGISTRATION_DATE]' :
121
-				if ( ! $primary_registration->primary_reg_obj instanceof EE_Registration )
122
-					return '';
124
+				if ( ! $primary_registration->primary_reg_obj instanceof EE_Registration ) {
125
+									return '';
126
+				}
123 127
 				return $primary_registration->primary_reg_obj->get_i18n_datetime( 'REG_date', get_option( 'date_format' ) );
124 128
 				break;
125 129
 
Please login to merge, or discard this patch.
core/libraries/shortcodes/EE_Recipient_Details_Shortcodes.lib.php 2 patches
Braces   +14 added lines, -9 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
@@ -65,12 +66,14 @@  discard block
 block discarded – undo
65 66
 		$this->_recipient = ! $this->_recipient instanceof EE_Messages_Addressee && is_array($this->_data) && isset( $this->_data['data'] ) && $this->_data['data'] instanceof EE_Messages_Addressee ? $this->_data['data'] : $this->_recipient;
66 67
 		$this->_recipient = ! $this->_recipient instanceof EE_Messages_Addressee && !empty( $this->_extra_data['data'] ) && $this->_extra_data['data'] instanceof EE_Messages_Addressee ? $this->_extra_data['data'] : $this->_recipient;
67 68
 
68
-		if ( ! $this->_recipient instanceof EE_Messages_Addressee )
69
-			return '';
69
+		if ( ! $this->_recipient instanceof EE_Messages_Addressee ) {
70
+					return '';
71
+		}
70 72
 
71 73
 		$attendee = $this->_recipient->att_obj;
72
-		if ( ! $attendee instanceof EE_Attendee )
73
-			return '';
74
+		if ( ! $attendee instanceof EE_Attendee ) {
75
+					return '';
76
+		}
74 77
 
75 78
 		$this->_registrations_for_recipient = isset( $this->_recipient->attendees[ $attendee->ID() ]['reg_objs'] ) ? $this->_recipient->attendees[ $attendee->ID() ]['reg_objs'] : array();
76 79
 
@@ -88,14 +91,16 @@  discard block
 block discarded – undo
88 91
 				break;
89 92
 
90 93
 			case '[RECIPIENT_REGISTRATION_CODE]' :
91
-				if ( ! $this->_recipient->reg_obj instanceof EE_Registration )
92
-					return '';
94
+				if ( ! $this->_recipient->reg_obj instanceof EE_Registration ) {
95
+									return '';
96
+				}
93 97
 				return $this->_get_reg_code();
94 98
 				break;
95 99
 
96 100
 			case '[RECIPIENT_EDIT_REGISTRATION_LINK]' :
97
-				if ( ! $this->_recipient->reg_obj instanceof EE_Registration )
98
-					return '';
101
+				if ( ! $this->_recipient->reg_obj instanceof EE_Registration ) {
102
+									return '';
103
+				}
99 104
 				return $this->_recipient->reg_obj->edit_attendee_information_url();
100 105
 				break;
101 106
 
Please login to merge, or discard this patch.
Spacing   +33 added lines, -33 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
 /**
@@ -50,31 +50,31 @@  discard block
 block discarded – undo
50 50
 			'[RECIPIENT_ADDRESS2]' => __('Whatever was in the address 2 field for the recipient of the message.', 'event_espresso'),
51 51
 			'[RECIPIENT_CITY]' => __('The city for the recipient of the message.', 'event_espresso'),
52 52
 			'[RECIPIENT_ZIP_PC]' => __('The ZIP (or Postal) Code for the recipient of the message.', 'event_espresso'),
53
-			'[RECIPIENT_ADDRESS_STATE]' => __('The state/province for the recipient of the message.', 'event_espresso' ),
53
+			'[RECIPIENT_ADDRESS_STATE]' => __('The state/province for the recipient of the message.', 'event_espresso'),
54 54
 			'[RECIPIENT_COUNTRY]' => __('The country for the recipient of the message.', 'event_espresso'),
55
-			'[RECIPIENT_ANSWER_*]' => __('This is a special dynamic shortcode.  After the "*", add the exact text of an existing question, and if there is an answer for that question for this recipient, then it will be output in place of this shortcode.', 'event_espresso' )
55
+			'[RECIPIENT_ANSWER_*]' => __('This is a special dynamic shortcode.  After the "*", add the exact text of an existing question, and if there is an answer for that question for this recipient, then it will be output in place of this shortcode.', 'event_espresso')
56 56
 			);
57 57
 	}
58 58
 
59 59
 
60 60
 
61
-	protected function _parser( $shortcode ) {
61
+	protected function _parser($shortcode) {
62 62
 
63 63
 		//make sure we end up with a copy of the EE_Messages_Addressee object
64 64
 		$this->_recipient = $this->_data instanceof EE_Messages_Addressee ? $this->_data : NULL;
65
-		$this->_recipient = ! $this->_recipient instanceof EE_Messages_Addressee && is_array($this->_data) && isset( $this->_data['data'] ) && $this->_data['data'] instanceof EE_Messages_Addressee ? $this->_data['data'] : $this->_recipient;
66
-		$this->_recipient = ! $this->_recipient instanceof EE_Messages_Addressee && !empty( $this->_extra_data['data'] ) && $this->_extra_data['data'] instanceof EE_Messages_Addressee ? $this->_extra_data['data'] : $this->_recipient;
65
+		$this->_recipient = ! $this->_recipient instanceof EE_Messages_Addressee && is_array($this->_data) && isset($this->_data['data']) && $this->_data['data'] instanceof EE_Messages_Addressee ? $this->_data['data'] : $this->_recipient;
66
+		$this->_recipient = ! $this->_recipient instanceof EE_Messages_Addressee && ! empty($this->_extra_data['data']) && $this->_extra_data['data'] instanceof EE_Messages_Addressee ? $this->_extra_data['data'] : $this->_recipient;
67 67
 
68
-		if ( ! $this->_recipient instanceof EE_Messages_Addressee )
68
+		if ( ! $this->_recipient instanceof EE_Messages_Addressee)
69 69
 			return '';
70 70
 
71 71
 		$attendee = $this->_recipient->att_obj;
72
-		if ( ! $attendee instanceof EE_Attendee )
72
+		if ( ! $attendee instanceof EE_Attendee)
73 73
 			return '';
74 74
 
75
-		$this->_registrations_for_recipient = isset( $this->_recipient->attendees[ $attendee->ID() ]['reg_objs'] ) ? $this->_recipient->attendees[ $attendee->ID() ]['reg_objs'] : array();
75
+		$this->_registrations_for_recipient = isset($this->_recipient->attendees[$attendee->ID()]['reg_objs']) ? $this->_recipient->attendees[$attendee->ID()]['reg_objs'] : array();
76 76
 
77
-		switch ( $shortcode ) {
77
+		switch ($shortcode) {
78 78
 			case '[RECIPIENT_FNAME]' :
79 79
 				return $attendee->fname();
80 80
 				break;
@@ -88,13 +88,13 @@  discard block
 block discarded – undo
88 88
 				break;
89 89
 
90 90
 			case '[RECIPIENT_REGISTRATION_CODE]' :
91
-				if ( ! $this->_recipient->reg_obj instanceof EE_Registration )
91
+				if ( ! $this->_recipient->reg_obj instanceof EE_Registration)
92 92
 					return '';
93 93
 				return $this->_get_reg_code();
94 94
 				break;
95 95
 
96 96
 			case '[RECIPIENT_EDIT_REGISTRATION_LINK]' :
97
-				if ( ! $this->_recipient->reg_obj instanceof EE_Registration )
97
+				if ( ! $this->_recipient->reg_obj instanceof EE_Registration)
98 98
 					return '';
99 99
 				return $this->_recipient->reg_obj->edit_attendee_information_url();
100 100
 				break;
@@ -130,19 +130,19 @@  discard block
 block discarded – undo
130 130
 				break;
131 131
 		}
132 132
 
133
-		if ( strpos( $shortcode, '[RECIPIENT_ANSWER_*' ) !== false ) {
134
-			$shortcode = str_replace( '[RECIPIENT_ANSWER_*', '', $shortcode );
135
-			$shortcode = trim( str_replace( ']', '', $shortcode ) );
133
+		if (strpos($shortcode, '[RECIPIENT_ANSWER_*') !== false) {
134
+			$shortcode = str_replace('[RECIPIENT_ANSWER_*', '', $shortcode);
135
+			$shortcode = trim(str_replace(']', '', $shortcode));
136 136
 
137 137
 
138 138
 			//now let's figure out what question has this text
139
-			if ( empty( $this->_recipient->questions ) || ! $this->_recipient->reg_obj instanceof EE_Registration ) {
139
+			if (empty($this->_recipient->questions) || ! $this->_recipient->reg_obj instanceof EE_Registration) {
140 140
 				return '';
141 141
 			}
142 142
 
143
-			foreach ( $this->_recipient->questions as $ansid => $question ) {
144
-				if ( $question instanceof EE_Question && $question->display_text() == $shortcode && isset( $this->_recipient->registrations[$this->_recipient->reg_obj->ID()]['ans_objs'][$ansid] ) ) {
145
-					return $this->_recipient->registrations[$this->_recipient->reg_obj->ID()]['ans_objs'][$ansid]->get_pretty( 'ANS_value', 'no_wpautop' );
143
+			foreach ($this->_recipient->questions as $ansid => $question) {
144
+				if ($question instanceof EE_Question && $question->display_text() == $shortcode && isset($this->_recipient->registrations[$this->_recipient->reg_obj->ID()]['ans_objs'][$ansid])) {
145
+					return $this->_recipient->registrations[$this->_recipient->reg_obj->ID()]['ans_objs'][$ansid]->get_pretty('ANS_value', 'no_wpautop');
146 146
 				}
147 147
 			}
148 148
 		}
@@ -173,53 +173,53 @@  discard block
 block discarded – undo
173 173
 	protected function _get_reg_code() {
174 174
 
175 175
 		//if only one related registration for the recipient then just return that reg code.
176
-		if ( count( $this->_registrations_for_recipient ) <= 1 )  {
176
+		if (count($this->_registrations_for_recipient) <= 1) {
177 177
 			return $this->_recipient->reg_obj->reg_code();
178 178
 		}
179 179
 
180 180
 		//k more than one registration so let's see if we can get specific to context
181 181
 		//are we parsing event_list?
182
-		if ( $this->_data instanceof EE_Event ) {
182
+		if ($this->_data instanceof EE_Event) {
183 183
 			$reg_code = array();
184 184
 			//loop through registrations for recipient and see if there is a match for this event
185
-			foreach ( $this->_registrations_for_recipient as $reg ) {
186
-				if ( $reg instanceof EE_Registration && $reg->event_ID() == $this->_data->ID() ) {
185
+			foreach ($this->_registrations_for_recipient as $reg) {
186
+				if ($reg instanceof EE_Registration && $reg->event_ID() == $this->_data->ID()) {
187 187
 					$reg_code[] = $reg->reg_code();
188 188
 				}
189 189
 			}
190
-			return implode( ', ', $reg_code );
190
+			return implode(', ', $reg_code);
191 191
 		}
192 192
 
193 193
 		//are we parsing ticket list?
194
-		if ( $this->_data instanceof EE_Ticket ) {
194
+		if ($this->_data instanceof EE_Ticket) {
195 195
 			$reg_code = array();
196 196
 			//loop through each registration for recipient and see if there is a match for this ticket
197
-			foreach ( $this->_registrations_for_recipient as $reg ) {
198
-				if ( $reg instanceof EE_Registration && $reg->ticket_ID() == $this->_data->ID() ) {
197
+			foreach ($this->_registrations_for_recipient as $reg) {
198
+				if ($reg instanceof EE_Registration && $reg->ticket_ID() == $this->_data->ID()) {
199 199
 					$reg_code = $reg->reg_code();
200 200
 				}
201 201
 			}
202
-			return implode( ', ', $reg_code );
202
+			return implode(', ', $reg_code);
203 203
 		}
204 204
 
205 205
 		//do we have a specific reg_obj?  Let's use it
206
-		if ( $this->_data instanceof EE_Messages_Addressee && $this->_data->reg_obj instanceof EE_Registration ) {
206
+		if ($this->_data instanceof EE_Messages_Addressee && $this->_data->reg_obj instanceof EE_Registration) {
207 207
 			return $this->_data->reg_obj->reg_code();
208 208
 		}
209 209
 
210 210
 		//do we have a specific reg_obj?  Let's use it
211
-		if ( $this->_data instanceof EE_Messages_Addressee && $this->_data->reg_obj instanceof EE_Registration ) {
211
+		if ($this->_data instanceof EE_Messages_Addressee && $this->_data->reg_obj instanceof EE_Registration) {
212 212
 			return $this->_data->reg_obj->reg_code();
213 213
 		}
214 214
 
215 215
 		//not able to determine the single reg code so let's return a comma delimited list of reg codes.
216 216
 		$reg_code = array();
217
-		foreach ( $this->_registrations_for_recipient as $reg ) {
218
-			if ( $reg instanceof EE_Registration ) {
217
+		foreach ($this->_registrations_for_recipient as $reg) {
218
+			if ($reg instanceof EE_Registration) {
219 219
 				$reg_code[] = $reg->reg_code();
220 220
 			}
221 221
 		}
222
-		return implode(', ', $reg_code );
222
+		return implode(', ', $reg_code);
223 223
 	}
224 224
 
225 225
 
Please login to merge, or discard this patch.
core/libraries/shortcodes/EE_Ticket_Shortcodes.lib.php 2 patches
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
@@ -80,8 +81,9 @@  discard block
 block discarded – undo
80 81
 
81 82
 
82 83
 		//If there is no event object by now then get out.
83
-		if ( ! $this->_ticket instanceof EE_Ticket )
84
-			return '';
84
+		if ( ! $this->_ticket instanceof EE_Ticket ) {
85
+					return '';
86
+		}
85 87
 
86 88
 		switch ( $shortcode ) {
87 89
 
Please login to merge, or discard this patch.
Spacing   +18 added lines, -18 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
 /**
@@ -50,38 +50,38 @@  discard block
 block discarded – undo
50 50
 			'[TICKET_PRICE]' => __('The price of the ticket', 'event_espresso'),
51 51
 			'[TICKET_PRICE_WITH_TAXES]' => __('The price of the ticket including any taxes that might be on the ticket', 'event_espresso'),
52 52
 			'[TKT_QTY_PURCHASED]' => __('The total quantity of the current ticket in the list that has been purchased in this transaction', 'event_espresso'),
53
-			'[TKT_USES_*]' => __( 'This attribute based shortcode parses to show the number of uses the ticket has.  The optional "schema" attribute can be used to indicate what schema is used when the uses is infinite.  Options are:', 'event_espresso' ) .
54
-				'<p><ul>' .
55
-				'<li><strong>symbol</strong>:' . __('This returns the &infin; symbol.', 'event_espresso') . '</li>' .
56
-				'<li><strong>text</strong>:' . __('This returns the word, "Unlimited". This is also the default if the "schema" attribute is not used.', 'event_espresso' ) . '</li>' .
57
-				'<li><strong>{custom}</strong>:' . __('You can put anything you want as a string instead and that will be used.  So you could have the world "any" and whenever uses for a ticket is infinity, this shortcode will parse to "any".', 'event_espresso' ) . '</li>' .
53
+			'[TKT_USES_*]' => __('This attribute based shortcode parses to show the number of uses the ticket has.  The optional "schema" attribute can be used to indicate what schema is used when the uses is infinite.  Options are:', 'event_espresso').
54
+				'<p><ul>'.
55
+				'<li><strong>symbol</strong>:'.__('This returns the &infin; symbol.', 'event_espresso').'</li>'.
56
+				'<li><strong>text</strong>:'.__('This returns the word, "Unlimited". This is also the default if the "schema" attribute is not used.', 'event_espresso').'</li>'.
57
+				'<li><strong>{custom}</strong>:'.__('You can put anything you want as a string instead and that will be used.  So you could have the world "any" and whenever uses for a ticket is infinity, this shortcode will parse to "any".', 'event_espresso').'</li>'.
58 58
 				'</ul></p>'
59 59
 			);
60 60
 	}
61 61
 
62 62
 
63
-	protected function _parser( $shortcode ) {
63
+	protected function _parser($shortcode) {
64 64
 
65 65
 		$this->_ticket = $this->_data instanceof EE_Ticket ? $this->_data : null;
66 66
 
67 67
 		$aee = $this->_data instanceof EE_Messages_Addressee ? $this->_data : null;
68
-		$aee = ! $aee instanceof EE_Messages_Addressee && is_array( $this->_extra_data ) && isset( $this->_extra_data['data'] ) && $this->_extra_data['data'] instanceof EE_Messages_Addressee ? $this->_extra_data['data'] : $aee;
68
+		$aee = ! $aee instanceof EE_Messages_Addressee && is_array($this->_extra_data) && isset($this->_extra_data['data']) && $this->_extra_data['data'] instanceof EE_Messages_Addressee ? $this->_extra_data['data'] : $aee;
69 69
 
70 70
 
71 71
 		//possible EE_Line_Item may be incoming data
72
-		$this->_ticket = empty( $this->_ticket ) && $this->_data instanceof EE_Line_Item && $aee instanceof EE_Messages_Addressee && ! empty( $aee->line_items_with_children[$this->_data->ID()]['EE_Ticket'] ) && $aee->line_items_with_children[$this->_data->ID()]['EE_Ticket'] instanceof EE_Ticket ? $aee->line_items_with_children[$this->_data->ID()]['EE_Ticket'] : $this->_ticket;
72
+		$this->_ticket = empty($this->_ticket) && $this->_data instanceof EE_Line_Item && $aee instanceof EE_Messages_Addressee && ! empty($aee->line_items_with_children[$this->_data->ID()]['EE_Ticket']) && $aee->line_items_with_children[$this->_data->ID()]['EE_Ticket'] instanceof EE_Ticket ? $aee->line_items_with_children[$this->_data->ID()]['EE_Ticket'] : $this->_ticket;
73 73
 
74 74
 		//if still no ticket, then let's see if there is a reg_obj.  If there IS, then we'll try and grab the ticket from the reg_obj instead.
75
-		if ( empty( $this->_ticket ) ) {
75
+		if (empty($this->_ticket)) {
76 76
 			$this->_ticket = $aee instanceof EE_Messages_Addressee && $aee->reg_obj instanceof EE_Registration ? $aee->reg_obj->ticket() : NULL;
77 77
 		}
78 78
 
79 79
 
80 80
 		//If there is no event object by now then get out.
81
-		if ( ! $this->_ticket instanceof EE_Ticket )
81
+		if ( ! $this->_ticket instanceof EE_Ticket)
82 82
 			return '';
83 83
 
84
-		switch ( $shortcode ) {
84
+		switch ($shortcode) {
85 85
 
86 86
 			case '[TICKET_ID]' :
87 87
 				return $this->_ticket->ID();
@@ -96,11 +96,11 @@  discard block
 block discarded – undo
96 96
 				break;
97 97
 
98 98
 			case '[TICKET_PRICE]' :
99
-				return EEH_Template::format_currency( $this->_ticket->get('TKT_price') );
99
+				return EEH_Template::format_currency($this->_ticket->get('TKT_price'));
100 100
 				break;
101 101
 
102 102
 			case '[TICKET_PRICE_WITH_TAXES]' :
103
-				return EEH_Template::format_currency( $this->_ticket->get_ticket_total_with_taxes() );
103
+				return EEH_Template::format_currency($this->_ticket->get_ticket_total_with_taxes());
104 104
 				break;
105 105
 
106 106
 			case '[TKT_QTY_PURCHASED]' :
@@ -108,10 +108,10 @@  discard block
 block discarded – undo
108 108
 				break;
109 109
 		}
110 110
 
111
-		if ( strpos( $shortcode, '[TKT_USES_*') !== FALSE  ) {
112
-			$attrs = $this->_get_shortcode_attrs( $shortcode );
113
-			$schema = empty( $attrs['schema'] ) ? null : $attrs['schema'];
114
-			return $this->_ticket->get_pretty( 'TKT_uses', $schema );
111
+		if (strpos($shortcode, '[TKT_USES_*') !== FALSE) {
112
+			$attrs = $this->_get_shortcode_attrs($shortcode);
113
+			$schema = empty($attrs['schema']) ? null : $attrs['schema'];
114
+			return $this->_ticket->get_pretty('TKT_uses', $schema);
115 115
 		}
116 116
 		return '';
117 117
 
Please login to merge, or discard this patch.
modules/add_new_state/EED_Add_New_State.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
  *
4 6
  * EED_Add_New_State class
Please login to merge, or discard this patch.
Spacing   +164 added lines, -164 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
 	 * @return EED_Add_New_State
17 17
 	 */
18 18
 	public static function instance() {
19
-		return parent::get_instance( __CLASS__ );
19
+		return parent::get_instance(__CLASS__);
20 20
 	}
21 21
 
22 22
 
@@ -27,16 +27,16 @@  discard block
 block discarded – undo
27 27
 	 *  	@return 		void
28 28
 	 */
29 29
 	public static function set_hooks() {
30
-		add_action( 'wp_loaded', array( 'EED_Add_New_State', 'set_definitions' ), 2 );
31
-		add_action( 'wp_enqueue_scripts', array( 'EED_Add_New_State', 'translate_js_strings' ), 0 );
32
-		add_action( 'wp_enqueue_scripts', array( 'EED_Add_New_State', 'wp_enqueue_scripts' ), 10 );
33
-		add_filter( 'FHEE__EE_SPCO_Reg_Step_Attendee_Information___question_group_reg_form__question_group_reg_form', array( 'EED_Add_New_State', 'display_add_new_state_micro_form' ), 1, 1 );
34
-		add_filter( 'FHEE__EE_SPCO_Reg_Step_Payment_Options___get_billing_form_for_payment_method__billing_form', array( 'EED_Add_New_State', 'display_add_new_state_micro_form' ), 1, 1 );
35
-		add_filter( 'FHEE__EE_Single_Page_Checkout__process_attendee_information__valid_data_line_item', array( 'EED_Add_New_State', 'unset_new_state_request_params' ), 10, 1 );
36
-		add_filter( 'FHEE__EE_SPCO_Reg_Step_Attendee_Information___generate_question_input__state_options', array( 'EED_Add_New_State', 'inject_new_reg_state_into_options' ), 10, 5 );
37
-		add_filter( 'FHEE__EE_SPCO_Reg_Step_Attendee_Information___generate_question_input__country_options', array( 'EED_Add_New_State', 'inject_new_reg_country_into_options' ), 10, 5 );
38
-		add_filter( 'FHEE__EE_State_Select_Input____construct__state_options', array( 'EED_Add_New_State', 'state_options' ), 10, 1 );
39
-		add_filter( 'FHEE__EE_Country_Select_Input____construct__country_options', array( 'EED_Add_New_State', 'country_options' ), 10, 1 );
30
+		add_action('wp_loaded', array('EED_Add_New_State', 'set_definitions'), 2);
31
+		add_action('wp_enqueue_scripts', array('EED_Add_New_State', 'translate_js_strings'), 0);
32
+		add_action('wp_enqueue_scripts', array('EED_Add_New_State', 'wp_enqueue_scripts'), 10);
33
+		add_filter('FHEE__EE_SPCO_Reg_Step_Attendee_Information___question_group_reg_form__question_group_reg_form', array('EED_Add_New_State', 'display_add_new_state_micro_form'), 1, 1);
34
+		add_filter('FHEE__EE_SPCO_Reg_Step_Payment_Options___get_billing_form_for_payment_method__billing_form', array('EED_Add_New_State', 'display_add_new_state_micro_form'), 1, 1);
35
+		add_filter('FHEE__EE_Single_Page_Checkout__process_attendee_information__valid_data_line_item', array('EED_Add_New_State', 'unset_new_state_request_params'), 10, 1);
36
+		add_filter('FHEE__EE_SPCO_Reg_Step_Attendee_Information___generate_question_input__state_options', array('EED_Add_New_State', 'inject_new_reg_state_into_options'), 10, 5);
37
+		add_filter('FHEE__EE_SPCO_Reg_Step_Attendee_Information___generate_question_input__country_options', array('EED_Add_New_State', 'inject_new_reg_country_into_options'), 10, 5);
38
+		add_filter('FHEE__EE_State_Select_Input____construct__state_options', array('EED_Add_New_State', 'state_options'), 10, 1);
39
+		add_filter('FHEE__EE_Country_Select_Input____construct__country_options', array('EED_Add_New_State', 'country_options'), 10, 1);
40 40
 	}
41 41
 
42 42
 	/**
@@ -46,20 +46,20 @@  discard block
 block discarded – undo
46 46
 	 *  	@return 		void
47 47
 	 */
48 48
 	public static function set_hooks_admin() {
49
-		add_action( 'wp_loaded', array( 'EED_Add_New_State', 'set_definitions' ), 2 );
50
-		add_filter( 'FHEE__EE_SPCO_Reg_Step_Attendee_Information___question_group_reg_form__question_group_reg_form', array( 'EED_Add_New_State', 'display_add_new_state_micro_form' ), 1, 1 );
51
-		add_filter( 'FHEE__EE_SPCO_Reg_Step_Payment_Options___get_billing_form_for_payment_method__billing_form', array( 'EED_Add_New_State', 'display_add_new_state_micro_form' ), 1, 1 );
52
-		add_action( 'wp_ajax_espresso_add_new_state', array( 'EED_Add_New_State', 'add_new_state' ));
53
-		add_action( 'wp_ajax_nopriv_espresso_add_new_state', array( 'EED_Add_New_State', 'add_new_state' ));
54
-		add_filter( 'FHEE__EE_Single_Page_Checkout__process_attendee_information__valid_data_line_item', array( 'EED_Add_New_State', 'unset_new_state_request_params' ), 10, 1 );
55
-		add_action( 'AHEE__General_Settings_Admin_Page__update_country_settings__state_saved', array( 'EED_Add_New_State', 'update_country_settings' ), 10, 3 );
56
-		add_action( 'AHEE__General_Settings_Admin_Page__delete_state__state_deleted', array( 'EED_Add_New_State', 'update_country_settings' ), 10, 3 );
57
-		add_filter( 'FHEE__EE_State_Select_Input____construct__state_options', array( 'EED_Add_New_State', 'state_options' ), 10, 1 );
58
-		add_filter( 'FHEE__EE_Country_Select_Input____construct__country_options', array( 'EED_Add_New_State', 'country_options' ), 10, 1 );
49
+		add_action('wp_loaded', array('EED_Add_New_State', 'set_definitions'), 2);
50
+		add_filter('FHEE__EE_SPCO_Reg_Step_Attendee_Information___question_group_reg_form__question_group_reg_form', array('EED_Add_New_State', 'display_add_new_state_micro_form'), 1, 1);
51
+		add_filter('FHEE__EE_SPCO_Reg_Step_Payment_Options___get_billing_form_for_payment_method__billing_form', array('EED_Add_New_State', 'display_add_new_state_micro_form'), 1, 1);
52
+		add_action('wp_ajax_espresso_add_new_state', array('EED_Add_New_State', 'add_new_state'));
53
+		add_action('wp_ajax_nopriv_espresso_add_new_state', array('EED_Add_New_State', 'add_new_state'));
54
+		add_filter('FHEE__EE_Single_Page_Checkout__process_attendee_information__valid_data_line_item', array('EED_Add_New_State', 'unset_new_state_request_params'), 10, 1);
55
+		add_action('AHEE__General_Settings_Admin_Page__update_country_settings__state_saved', array('EED_Add_New_State', 'update_country_settings'), 10, 3);
56
+		add_action('AHEE__General_Settings_Admin_Page__delete_state__state_deleted', array('EED_Add_New_State', 'update_country_settings'), 10, 3);
57
+		add_filter('FHEE__EE_State_Select_Input____construct__state_options', array('EED_Add_New_State', 'state_options'), 10, 1);
58
+		add_filter('FHEE__EE_Country_Select_Input____construct__country_options', array('EED_Add_New_State', 'country_options'), 10, 1);
59 59
 		//add_filter( 'FHEE__Single_Page_Checkout___check_form_submission__request_params', array( 'EED_Add_New_State', 'filter_checkout_request_params' ), 10, 1 );
60
-		add_filter( 'FHEE__EE_Form_Section_Proper__receive_form_submission__request_data', array( 'EED_Add_New_State', 'filter_checkout_request_params' ), 10, 1 );
61
-		add_filter( 'FHEE__EE_SPCO_Reg_Step_Attendee_Information___generate_question_input__state_options', array( 'EED_Add_New_State', 'inject_new_reg_state_into_options' ), 10, 5 );
62
-		add_filter( 'FHEE__EE_SPCO_Reg_Step_Attendee_Information___generate_question_input__country_options', array( 'EED_Add_New_State', 'inject_new_reg_country_into_options' ), 10, 5 );
60
+		add_filter('FHEE__EE_Form_Section_Proper__receive_form_submission__request_data', array('EED_Add_New_State', 'filter_checkout_request_params'), 10, 1);
61
+		add_filter('FHEE__EE_SPCO_Reg_Step_Attendee_Information___generate_question_input__state_options', array('EED_Add_New_State', 'inject_new_reg_state_into_options'), 10, 5);
62
+		add_filter('FHEE__EE_SPCO_Reg_Step_Attendee_Information___generate_question_input__country_options', array('EED_Add_New_State', 'inject_new_reg_country_into_options'), 10, 5);
63 63
 	}
64 64
 
65 65
 
@@ -71,8 +71,8 @@  discard block
 block discarded – undo
71 71
 	 *  	@return 		void
72 72
 	 */
73 73
 	public static function set_definitions() {
74
-		define( 'ANS_ASSETS_URL', plugin_dir_url( __FILE__ ) . 'assets' . DS );
75
-		define( 'ANS_TEMPLATES_PATH', str_replace( '\\', DS, plugin_dir_path( __FILE__ )) . 'templates' . DS );
74
+		define('ANS_ASSETS_URL', plugin_dir_url(__FILE__).'assets'.DS);
75
+		define('ANS_TEMPLATES_PATH', str_replace('\\', DS, plugin_dir_path(__FILE__)).'templates'.DS);
76 76
 	}
77 77
 
78 78
 
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
 	 * @param \WP $WP
85 85
 	 * @return        void
86 86
 	 */
87
-	public function run( $WP ) {
87
+	public function run($WP) {
88 88
 	}
89 89
 
90 90
 
@@ -112,9 +112,9 @@  discard block
 block discarded – undo
112 112
 	 * 	@return 		void
113 113
 	 */
114 114
 	public static function wp_enqueue_scripts() {
115
-		if ( apply_filters( 'EED_Single_Page_Checkout__SPCO_active', false ) ) {
116
-			wp_register_script( 'add_new_state', ANS_ASSETS_URL . 'add_new_state.js', array( 'espresso_core', 'single_page_checkout' ), EVENT_ESPRESSO_VERSION, true );
117
-			wp_enqueue_script( 'add_new_state' );
115
+		if (apply_filters('EED_Single_Page_Checkout__SPCO_active', false)) {
116
+			wp_register_script('add_new_state', ANS_ASSETS_URL.'add_new_state.js', array('espresso_core', 'single_page_checkout'), EVENT_ESPRESSO_VERSION, true);
117
+			wp_enqueue_script('add_new_state');
118 118
 		}
119 119
 	}
120 120
 
@@ -128,28 +128,28 @@  discard block
 block discarded – undo
128 128
 	 * @return 	string
129 129
 	 */
130 130
 //	public static function display_add_new_state_micro_form( $html, EE_Form_Input_With_Options_Base $input ){
131
-	public static function display_add_new_state_micro_form( EE_Form_Section_Proper $question_group_reg_form ){
131
+	public static function display_add_new_state_micro_form(EE_Form_Section_Proper $question_group_reg_form) {
132 132
 		// only add the 'new_state_micro_form' when displaying reg forms,
133 133
 		// not during processing since we process the 'new_state_micro_form' in it's own AJAX request
134
-		$action = EE_Registry::instance()->REQ->get( 'action', '' );
135
-		if ( $action === 'process_reg_step' || $action === 'update_reg_step' ) {
134
+		$action = EE_Registry::instance()->REQ->get('action', '');
135
+		if ($action === 'process_reg_step' || $action === 'update_reg_step') {
136 136
 			return $question_group_reg_form;
137 137
 		}
138 138
 		// is the "state" question in this form section?
139
-		$input = $question_group_reg_form->get_subsection( 'state' );
139
+		$input = $question_group_reg_form->get_subsection('state');
140 140
 		// we're only doing this for state select inputs
141
-		if ( $input instanceof EE_State_Select_Input ) {
141
+		if ($input instanceof EE_State_Select_Input) {
142 142
 			// grab any set values from the request
143
-			$country_name = str_replace( 'state', 'nsmf_new_state_country', $input->html_name() );
144
-			$state_name = str_replace( 'state', 'nsmf_new_state_name', $input->html_name() );
145
-			$abbrv_name = str_replace( 'state', 'nsmf_new_state_abbrv', $input->html_name() );
146
-			$new_state_submit_id = str_replace( 'state', 'new_state', $input->html_id() );
143
+			$country_name = str_replace('state', 'nsmf_new_state_country', $input->html_name());
144
+			$state_name = str_replace('state', 'nsmf_new_state_name', $input->html_name());
145
+			$abbrv_name = str_replace('state', 'nsmf_new_state_abbrv', $input->html_name());
146
+			$new_state_submit_id = str_replace('state', 'new_state', $input->html_id());
147 147
 			$country_options = array();
148 148
 			$countries = EEM_Country::instance()->get_all_countries();
149
-			if ( ! empty( $countries )) {
150
-				foreach( $countries as $country ){
151
-					if ( $country instanceof EE_Country ) {
152
-						$country_options[ $country->ID() ] = $country->name();
149
+			if ( ! empty($countries)) {
150
+				foreach ($countries as $country) {
151
+					if ($country instanceof EE_Country) {
152
+						$country_options[$country->ID()] = $country->name();
153 153
 					}
154 154
 				}
155 155
 			}
@@ -162,8 +162,8 @@  discard block
 block discarded – undo
162 162
 						// add hidden input to indicate that a new state is being added
163 163
 						'add_new_state' 	=> new EE_Hidden_Input(
164 164
 							array(
165
-								'html_name' 	=> str_replace( 'state', 'nsmf_add_new_state', $input->html_name() ),
166
-								'html_id' 			=> str_replace( 'state', 'nsmf_add_new_state', $input->html_id() ),
165
+								'html_name' 	=> str_replace('state', 'nsmf_add_new_state', $input->html_name()),
166
+								'html_id' 			=> str_replace('state', 'nsmf_add_new_state', $input->html_id()),
167 167
 								'default'			=> 0
168 168
 							)
169 169
 						),
@@ -175,10 +175,10 @@  discard block
 block discarded – undo
175 175
 									'',
176 176
 									__('click here to add a new state/province', 'event_espresso'),
177 177
 									'',
178
-									'display-' . $input->html_id(),
178
+									'display-'.$input->html_id(),
179 179
 									'ee-form-add-new-state-lnk display-the-hidden smaller-text hide-if-no-js',
180 180
 									'',
181
-									'data-target="' . $input->html_id() . '"'
181
+									'data-target="'.$input->html_id().'"'
182 182
 								)
183 183
 							)
184 184
 						),
@@ -186,13 +186,13 @@  discard block
 block discarded – undo
186 186
 						'add_new_state_micro_form' =>new EE_Form_Section_HTML(
187 187
 							apply_filters(
188 188
 								'FHEE__EED_Add_New_State__display_add_new_state_micro_form__add_new_state_micro_form',
189
-								EEH_HTML::div( '', $input->html_id() . '-dv', 'ee-form-add-new-state-dv', 'display: none;' ) .
190
-								EEH_HTML::h6( __('If your State/Province does not appear in the list above, you can easily add it by doing the following:', 'event_espresso')) .
191
-								EEH_HTML::ul() .
192
-								EEH_HTML::li( __('first select the Country that your State/Province belongs to', 'event_espresso') ) .
193
-								EEH_HTML::li( __('enter the name of your State/Province', 'event_espresso') ) .
194
-								EEH_HTML::li( __('enter a two to six letter abbreviation for the name of your State/Province', 'event_espresso') ) .
195
-								EEH_HTML::li( __('click the ADD button', 'event_espresso') ) .
189
+								EEH_HTML::div('', $input->html_id().'-dv', 'ee-form-add-new-state-dv', 'display: none;').
190
+								EEH_HTML::h6(__('If your State/Province does not appear in the list above, you can easily add it by doing the following:', 'event_espresso')).
191
+								EEH_HTML::ul().
192
+								EEH_HTML::li(__('first select the Country that your State/Province belongs to', 'event_espresso')).
193
+								EEH_HTML::li(__('enter the name of your State/Province', 'event_espresso')).
194
+								EEH_HTML::li(__('enter a two to six letter abbreviation for the name of your State/Province', 'event_espresso')).
195
+								EEH_HTML::li(__('click the ADD button', 'event_espresso')).
196 196
 								EEH_HTML::ulx()
197 197
 							)
198 198
 						),
@@ -201,10 +201,10 @@  discard block
 block discarded – undo
201 201
 							$country_options,
202 202
 							array(
203 203
 								'html_name' 			=> $country_name,
204
-								'html_id' 					=> str_replace( 'state', 'nsmf_new_state_country', $input->html_id() ),
205
-								'html_class' 			=> $input->html_class() . ' new-state-country',
204
+								'html_id' 					=> str_replace('state', 'nsmf_new_state_country', $input->html_id()),
205
+								'html_class' 			=> $input->html_class().' new-state-country',
206 206
 								'html_label_text'		=> __('New State/Province Country', 'event_espresso'),
207
-								'default'					=> EE_Registry::instance()->REQ->get( $country_name, '' ),
207
+								'default'					=> EE_Registry::instance()->REQ->get($country_name, ''),
208 208
 								'required' 				=> false
209 209
 							)
210 210
 						),
@@ -212,23 +212,23 @@  discard block
 block discarded – undo
212 212
 						'new_state_name' => new EE_Text_Input(
213 213
 							array(
214 214
 								'html_name' 			=> $state_name,
215
-								'html_id' 					=> str_replace( 'state', 'nsmf_new_state_name', $input->html_id() ),
216
-								'html_class' 			=> $input->html_class() . ' new-state-state',
215
+								'html_id' 					=> str_replace('state', 'nsmf_new_state_name', $input->html_id()),
216
+								'html_class' 			=> $input->html_class().' new-state-state',
217 217
 								'html_label_text'		=> __('New State/Province Name', 'event_espresso'),
218
-								'default'					=> EE_Registry::instance()->REQ->get( $state_name, '' ),
218
+								'default'					=> EE_Registry::instance()->REQ->get($state_name, ''),
219 219
 								'required' 				=> false
220 220
 							)
221 221
 						),
222
-						'spacer' => new EE_Form_Section_HTML( EEH_HTML::br() ),
222
+						'spacer' => new EE_Form_Section_HTML(EEH_HTML::br()),
223 223
 						// NEW STATE NAME
224 224
 						'new_state_abbrv' => new EE_Text_Input(
225 225
 							array(
226 226
 								'html_name' 					=> $abbrv_name,
227
-								'html_id' 							=> str_replace( 'state', 'nsmf_new_state_abbrv', $input->html_id() ),
228
-								'html_class' 					=> $input->html_class() . ' new-state-abbrv',
227
+								'html_id' 							=> str_replace('state', 'nsmf_new_state_abbrv', $input->html_id()),
228
+								'html_class' 					=> $input->html_class().' new-state-abbrv',
229 229
 								'html_label_text'				=> __('New State/Province Abbreviation', 'event_espresso'),
230 230
 								'html_other_attributes'	=> 'size="24"',
231
-								'default'							=> EE_Registry::instance()->REQ->get( $abbrv_name, '' ),
231
+								'default'							=> EE_Registry::instance()->REQ->get($abbrv_name, ''),
232 232
 								'required' 						=> false
233 233
 							)
234 234
 						),
@@ -236,15 +236,15 @@  discard block
 block discarded – undo
236 236
 						'add_new_state_submit_button' => new EE_Form_Section_HTML(
237 237
 							apply_filters(
238 238
 								'FHEE__EED_Add_New_State__display_add_new_state_micro_form__add_new_state_submit_button',
239
-								EEH_HTML::nbsp(3) .
239
+								EEH_HTML::nbsp(3).
240 240
 								EEH_HTML::link(
241 241
 									'',
242 242
 									__('ADD', 'event_espresso'),
243 243
 									'',
244
-									'submit-' . $new_state_submit_id,
244
+									'submit-'.$new_state_submit_id,
245 245
 									'ee-form-add-new-state-submit button button-secondary',
246 246
 									'',
247
-									'data-target="' . $new_state_submit_id . '"'
247
+									'data-target="'.$new_state_submit_id.'"'
248 248
 								)
249 249
 							)
250 250
 						),
@@ -252,18 +252,18 @@  discard block
 block discarded – undo
252 252
 						'add_new_state_extra' => new EE_Form_Section_HTML(
253 253
 							apply_filters(
254 254
 								'FHEE__EED_Add_New_State__display_add_new_state_micro_form__add_new_state_extra',
255
-								EEH_HTML::br(2) .
256
-								EEH_HTML::div( '', '', 'small-text' ) .
257
-								EEH_HTML::strong( __('Don\'t know your State/Province Abbreviation?', 'event_espresso') ) .
258
-								EEH_HTML::br() .
255
+								EEH_HTML::br(2).
256
+								EEH_HTML::div('', '', 'small-text').
257
+								EEH_HTML::strong(__('Don\'t know your State/Province Abbreviation?', 'event_espresso')).
258
+								EEH_HTML::br().
259 259
 								sprintf(
260 260
 									__('You can look here: %s, for a list of Countries and links to their State/Province Abbreviations ("Subdivisions assigned codes" column).', 'event_espresso'),
261
-									EEH_HTML::link( 'http://en.wikipedia.org/wiki/ISO_3166-2', 'http://en.wikipedia.org/wiki/ISO_3166-2', '', '', 'ee-form-add-new-state-wiki-lnk' )
262
-								) .
263
-								EEH_HTML::divx() .
264
-								EEH_HTML::br() .
265
-								EEH_HTML::link( '', __('cancel new state/province', 'event_espresso'), '', 'hide-' . $input->html_id(), 'ee-form-cancel-new-state-lnk smaller-text', '', 'data-target="' . $input->html_id() . '"' ) .
266
-								EEH_HTML::divx() .
261
+									EEH_HTML::link('http://en.wikipedia.org/wiki/ISO_3166-2', 'http://en.wikipedia.org/wiki/ISO_3166-2', '', '', 'ee-form-add-new-state-wiki-lnk')
262
+								).
263
+								EEH_HTML::divx().
264
+								EEH_HTML::br().
265
+								EEH_HTML::link('', __('cancel new state/province', 'event_espresso'), '', 'hide-'.$input->html_id(), 'ee-form-cancel-new-state-lnk smaller-text', '', 'data-target="'.$input->html_id().'"').
266
+								EEH_HTML::divx().
267 267
 								EEH_HTML::br()
268 268
 							)
269 269
 						)
@@ -271,7 +271,7 @@  discard block
 block discarded – undo
271 271
 					)
272 272
 				)
273 273
 			);
274
-			$question_group_reg_form->add_subsections( array( 'new_state_micro_form' => $new_state_micro_form ), 'state', false );
274
+			$question_group_reg_form->add_subsections(array('new_state_micro_form' => $new_state_micro_form), 'state', false);
275 275
 		}
276 276
 		return $question_group_reg_form;
277 277
 	}
@@ -289,50 +289,50 @@  discard block
 block discarded – undo
289 289
 	public static function add_new_state() {
290 290
 		$REQ = EE_Registry::instance()->load_core('Request_Handler');
291 291
 		if (
292
-			$REQ->is_set( 'nsmf_add_new_state' )
293
-			&& $REQ->get( 'nsmf_add_new_state' ) == 1
292
+			$REQ->is_set('nsmf_add_new_state')
293
+			&& $REQ->get('nsmf_add_new_state') == 1
294 294
 		) {
295 295
 			EE_Registry::instance()->load_model('State');
296 296
 			// grab country ISO code, new state name, and new state abbreviation
297
-			$state_country = $REQ->is_set( 'nsmf_new_state_country' )
298
-				? sanitize_text_field( $REQ->get( 'nsmf_new_state_country' ) )
297
+			$state_country = $REQ->is_set('nsmf_new_state_country')
298
+				? sanitize_text_field($REQ->get('nsmf_new_state_country'))
299 299
 				: false;
300
-			$state_name = $REQ->is_set( 'nsmf_new_state_name' )
301
-				? sanitize_text_field( $REQ->get( 'nsmf_new_state_name' ) )
300
+			$state_name = $REQ->is_set('nsmf_new_state_name')
301
+				? sanitize_text_field($REQ->get('nsmf_new_state_name'))
302 302
 				: false;
303
-			$state_abbr = $REQ->is_set( 'nsmf_new_state_abbrv' )
304
-				? sanitize_text_field( $REQ->get( 'nsmf_new_state_abbrv' ) )
303
+			$state_abbr = $REQ->is_set('nsmf_new_state_abbrv')
304
+				? sanitize_text_field($REQ->get('nsmf_new_state_abbrv'))
305 305
 				: false;
306 306
 //echo '<h4>$state_country : ' . $state_country . '  <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span></h4>';
307 307
 //echo '<h4>$state_name : ' . $state_name . '  <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span></h4>';
308 308
 //echo '<h4>$state_abbr : ' . $state_abbr . '  <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span></h4>';
309 309
 
310
-			if ( $state_country && $state_name && $state_abbr ) {
311
-				$new_state = EED_Add_New_State::save_new_state_to_db( array(
312
-					'CNT_ISO'=> strtoupper( $state_country ),
313
-					'STA_abbrev' => strtoupper( $state_abbr ),
314
-					'STA_name' => ucwords( $state_name ),
310
+			if ($state_country && $state_name && $state_abbr) {
311
+				$new_state = EED_Add_New_State::save_new_state_to_db(array(
312
+					'CNT_ISO'=> strtoupper($state_country),
313
+					'STA_abbrev' => strtoupper($state_abbr),
314
+					'STA_name' => ucwords($state_name),
315 315
 					'STA_active' => FALSE
316 316
 				));
317 317
 
318
-				if ( $new_state instanceof EE_State ) {
318
+				if ($new_state instanceof EE_State) {
319 319
 					// clean house
320
-					EE_Registry::instance()->REQ->un_set( 'nsmf_add_new_state' );
321
-					EE_Registry::instance()->REQ->un_set( 'nsmf_new_state_country' );
322
-					EE_Registry::instance()->REQ->un_set( 'nsmf_new_state_name' );
323
-					EE_Registry::instance()->REQ->un_set( 'nsmf_new_state_abbrv' );
320
+					EE_Registry::instance()->REQ->un_set('nsmf_add_new_state');
321
+					EE_Registry::instance()->REQ->un_set('nsmf_new_state_country');
322
+					EE_Registry::instance()->REQ->un_set('nsmf_new_state_name');
323
+					EE_Registry::instance()->REQ->un_set('nsmf_new_state_abbrv');
324 324
 
325 325
 					// get any existing new states
326 326
 					$new_states = EE_Registry::instance()->SSN->get_session_data(
327 327
 						'nsmf_new_states'
328 328
 					);
329
-					$new_states[ $new_state->ID() ] = $new_state;
329
+					$new_states[$new_state->ID()] = $new_state;
330 330
 					EE_Registry::instance()->SSN->set_session_data(
331
-						array( 'nsmf_new_states' => $new_states )
331
+						array('nsmf_new_states' => $new_states)
332 332
 					);
333 333
 
334
-					if ( EE_Registry::instance()->REQ->ajax ) {
335
-						echo json_encode( array(
334
+					if (EE_Registry::instance()->REQ->ajax) {
335
+						echo json_encode(array(
336 336
 							'success' => TRUE,
337 337
 							'id' => $new_state->ID(),
338 338
 							'name' => $new_state->name(),
@@ -347,12 +347,12 @@  discard block
 block discarded – undo
347 347
 				}
348 348
 
349 349
 			} else {
350
-				$error = __( 'A new State/Province could not be added because invalid or missing data was received.', 'event_espresso' );
351
-				if ( EE_Registry::instance()->REQ->ajax ) {
352
-					echo json_encode( array( 'error' => $error ));
350
+				$error = __('A new State/Province could not be added because invalid or missing data was received.', 'event_espresso');
351
+				if (EE_Registry::instance()->REQ->ajax) {
352
+					echo json_encode(array('error' => $error));
353 353
 					exit();
354 354
 				} else {
355
-					EE_Error::add_error( $error, __FILE__, __FUNCTION__, __LINE__ );
355
+					EE_Error::add_error($error, __FILE__, __FUNCTION__, __LINE__);
356 356
 				}
357 357
 			}
358 358
 		}
@@ -370,11 +370,11 @@  discard block
 block discarded – undo
370 370
 	 * @param array $request_params
371 371
 	 * @return array
372 372
 	 */
373
-	public static function filter_checkout_request_params ( $request_params ) {
374
-		foreach ( $request_params as $form_section ) {
375
-			if ( is_array( $form_section )) {
376
-				EED_Add_New_State::unset_new_state_request_params( $form_section );
377
-				EED_Add_New_State::filter_checkout_request_params( $form_section );
373
+	public static function filter_checkout_request_params($request_params) {
374
+		foreach ($request_params as $form_section) {
375
+			if (is_array($form_section)) {
376
+				EED_Add_New_State::unset_new_state_request_params($form_section);
377
+				EED_Add_New_State::filter_checkout_request_params($form_section);
378 378
 			}
379 379
 		}
380 380
 		return $request_params;
@@ -389,12 +389,12 @@  discard block
 block discarded – undo
389 389
 	 * @param array $request_params
390 390
 	 * @return        boolean
391 391
 	 */
392
-	public static function unset_new_state_request_params ( $request_params ) {
393
-		unset( $request_params[ 'new_state_micro_form' ] );
394
-		unset( $request_params[ 'new_state_micro_add_new_state' ] );
395
-		unset( $request_params[ 'new_state_micro_new_state_country' ] );
396
-		unset( $request_params[ 'new_state_micro_new_state_name' ] );
397
-		unset( $request_params[ 'new_state_micro_new_state_abbrv' ] );
392
+	public static function unset_new_state_request_params($request_params) {
393
+		unset($request_params['new_state_micro_form']);
394
+		unset($request_params['new_state_micro_add_new_state']);
395
+		unset($request_params['new_state_micro_new_state_country']);
396
+		unset($request_params['new_state_micro_new_state_name']);
397
+		unset($request_params['new_state_micro_new_state_abbrv']);
398 398
 		return $request_params;
399 399
 	}
400 400
 
@@ -407,25 +407,25 @@  discard block
 block discarded – undo
407 407
 	 * @param array $props_n_values
408 408
 	 * @return        boolean
409 409
 	 */
410
-	public static function save_new_state_to_db ( $props_n_values = array() ) {
410
+	public static function save_new_state_to_db($props_n_values = array()) {
411 411
 //		EEH_Debug_Tools::printr( $props_n_values, '$props_n_values  <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span>', 'auto' );
412
-		$existing_state = EEM_State::instance()->get_all( array( $props_n_values, 'limit' => 1 ));
413
-		if ( ! empty( $existing_state )) {
414
-			return array_pop( $existing_state );
412
+		$existing_state = EEM_State::instance()->get_all(array($props_n_values, 'limit' => 1));
413
+		if ( ! empty($existing_state)) {
414
+			return array_pop($existing_state);
415 415
 		}
416
-		$new_state = EE_State::new_instance( $props_n_values );
417
-		if ( $new_state instanceof EE_State ) {
416
+		$new_state = EE_State::new_instance($props_n_values);
417
+		if ($new_state instanceof EE_State) {
418 418
 			// if not non-ajax admin
419
-			$new_state_key = 'new-state-added-' . $new_state->country_iso() . '-' . $new_state->abbrev();
419
+			$new_state_key = 'new-state-added-'.$new_state->country_iso().'-'.$new_state->abbrev();
420 420
 			$new_state_notice = sprintf(
421
-					__( 'A new State named "%1$s (%2$s)" was dynamically added from an Event Espresso form for the Country of "%3$s".%5$sTo verify, edit, and/or delete this new State, please go to the %4$s and update the States / Provinces section.%5$sCheck "Yes" to have this new State added to dropdown select lists in forms.', 'event_espresso' ),
422
-					'<b>' . $new_state->name() . '</b>',
423
-					'<b>' . $new_state->abbrev() . '</b>',
424
-					'<b>' . $new_state->country()->name() . '</b>',
425
-					'<a href="' . add_query_arg( array( 'page' => 'espresso_general_settings', 'action' => 'country_settings', 'country' => $new_state->country_iso() ), admin_url( 'admin.php' )) . '">' . __( 'Event Espresso - General Settings > Countries Tab', 'event_espresso' ) . '</a>',
421
+					__('A new State named "%1$s (%2$s)" was dynamically added from an Event Espresso form for the Country of "%3$s".%5$sTo verify, edit, and/or delete this new State, please go to the %4$s and update the States / Provinces section.%5$sCheck "Yes" to have this new State added to dropdown select lists in forms.', 'event_espresso'),
422
+					'<b>'.$new_state->name().'</b>',
423
+					'<b>'.$new_state->abbrev().'</b>',
424
+					'<b>'.$new_state->country()->name().'</b>',
425
+					'<a href="'.add_query_arg(array('page' => 'espresso_general_settings', 'action' => 'country_settings', 'country' => $new_state->country_iso()), admin_url('admin.php')).'">'.__('Event Espresso - General Settings > Countries Tab', 'event_espresso').'</a>',
426 426
 					'<br />'
427 427
 			);
428
-			EE_Error::add_persistent_admin_notice( $new_state_key, $new_state_notice );
428
+			EE_Error::add_persistent_admin_notice($new_state_key, $new_state_notice);
429 429
 			$new_state->save();
430 430
 			EEM_State::instance()->reset_cached_states();
431 431
 			return $new_state;
@@ -444,22 +444,22 @@  discard block
 block discarded – undo
444 444
 	 * @param array  $cols_n_values
445 445
 	 * @return        boolean
446 446
 	 */
447
-	public static function update_country_settings( $CNT_ISO = '', $STA_ID = '', $cols_n_values = array() ) {
448
-		$CNT_ISO = ! empty( $CNT_ISO ) ? $CNT_ISO : FALSE;
449
-		if ( ! $CNT_ISO ) {
450
-			EE_Error::add_error( __( 'An invalid or missing Country ISO Code was received.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__ );
447
+	public static function update_country_settings($CNT_ISO = '', $STA_ID = '', $cols_n_values = array()) {
448
+		$CNT_ISO = ! empty($CNT_ISO) ? $CNT_ISO : FALSE;
449
+		if ( ! $CNT_ISO) {
450
+			EE_Error::add_error(__('An invalid or missing Country ISO Code was received.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
451 451
 		}
452
-		$STA_abbrev = is_array( $cols_n_values ) && isset( $cols_n_values['STA_abbrev'] ) ? $cols_n_values['STA_abbrev'] : FALSE;
453
-		if (  ! $STA_abbrev && ! empty( $STA_ID )) {
454
-			$state = EEM_State::instance()->get_one_by_ID( $STA_ID );
455
-			if ( $state instanceof EE_State ) {
452
+		$STA_abbrev = is_array($cols_n_values) && isset($cols_n_values['STA_abbrev']) ? $cols_n_values['STA_abbrev'] : FALSE;
453
+		if ( ! $STA_abbrev && ! empty($STA_ID)) {
454
+			$state = EEM_State::instance()->get_one_by_ID($STA_ID);
455
+			if ($state instanceof EE_State) {
456 456
 				$STA_abbrev = $state->abbrev();
457 457
 			}
458 458
 		}
459
-		if ( ! $STA_abbrev ) {
460
-			EE_Error::add_error( __( 'An invalid or missing State Abbreviation was received.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__ );
459
+		if ( ! $STA_abbrev) {
460
+			EE_Error::add_error(__('An invalid or missing State Abbreviation was received.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
461 461
 		}
462
-		EE_Error::dismiss_persistent_admin_notice( $CNT_ISO . '-' . $STA_abbrev, TRUE, TRUE );
462
+		EE_Error::dismiss_persistent_admin_notice($CNT_ISO.'-'.$STA_abbrev, TRUE, TRUE);
463 463
 	}
464 464
 
465 465
 
@@ -475,19 +475,19 @@  discard block
 block discarded – undo
475 475
 	 * @param $answer
476 476
 	 * @return bool
477 477
 	 */
478
-	public static function inject_new_reg_state_into_options( $state_options = array(), EE_SPCO_Reg_Step_Attendee_Information $reg_step, EE_Registration $registration, EE_Question $question, $answer ) {
479
-		if ( $answer instanceof EE_Answer  && $question instanceof EE_Question && $question->type() === EEM_Question::QST_type_state ) {
478
+	public static function inject_new_reg_state_into_options($state_options = array(), EE_SPCO_Reg_Step_Attendee_Information $reg_step, EE_Registration $registration, EE_Question $question, $answer) {
479
+		if ($answer instanceof EE_Answer && $question instanceof EE_Question && $question->type() === EEM_Question::QST_type_state) {
480 480
 			$STA_ID = $answer->value();
481
-			if ( ! empty( $STA_ID ) ) {
482
-				$state = EEM_State::instance()->get_one_by_ID( $STA_ID );
483
-				if ( $state instanceof EE_State ) {
481
+			if ( ! empty($STA_ID)) {
482
+				$state = EEM_State::instance()->get_one_by_ID($STA_ID);
483
+				if ($state instanceof EE_State) {
484 484
 					$country = $state->country();
485
-					if ( $country instanceof EE_Country ) {
486
-						if ( ! isset( $state_options[ $country->name() ] )) {
487
-							$state_options[ $country->name() ] = array();
485
+					if ($country instanceof EE_Country) {
486
+						if ( ! isset($state_options[$country->name()])) {
487
+							$state_options[$country->name()] = array();
488 488
 						}
489
-						if ( ! isset( $state_options[ $country->name() ][ $STA_ID ] )) {
490
-							$state_options[ $country->name() ][ $STA_ID ] = $state->name();
489
+						if ( ! isset($state_options[$country->name()][$STA_ID])) {
490
+							$state_options[$country->name()][$STA_ID] = $state->name();
491 491
 						}
492 492
 					}
493 493
 				}
@@ -509,14 +509,14 @@  discard block
 block discarded – undo
509 509
 	 * @param $answer
510 510
 	 * @return bool
511 511
 	 */
512
-	public static function inject_new_reg_country_into_options( $country_options = array(), EE_SPCO_Reg_Step_Attendee_Information $reg_step, EE_Registration $registration, EE_Question $question, $answer ) {
513
-		if ( $answer instanceof EE_Answer && $question instanceof EE_Question && $question->type() === EEM_Question::QST_type_country ) {
512
+	public static function inject_new_reg_country_into_options($country_options = array(), EE_SPCO_Reg_Step_Attendee_Information $reg_step, EE_Registration $registration, EE_Question $question, $answer) {
513
+		if ($answer instanceof EE_Answer && $question instanceof EE_Question && $question->type() === EEM_Question::QST_type_country) {
514 514
 			$CNT_ISO = $answer->value();
515
-			if ( ! empty( $CNT_ISO ) ) {
516
-				$country = EEM_Country::instance()->get_one_by_ID( $CNT_ISO );
517
-				if ( $country instanceof EE_Country ) {
518
-					if ( ! isset( $country_options[ $CNT_ISO ] ) ) {
519
-						$country_options[ $CNT_ISO ] = $country->name();
515
+			if ( ! empty($CNT_ISO)) {
516
+				$country = EEM_Country::instance()->get_one_by_ID($CNT_ISO);
517
+				if ($country instanceof EE_Country) {
518
+					if ( ! isset($country_options[$CNT_ISO])) {
519
+						$country_options[$CNT_ISO] = $country->name();
520 520
 					}
521 521
 				}
522 522
 			}
@@ -533,14 +533,14 @@  discard block
 block discarded – undo
533 533
 	 * @param EE_State[]  $state_options
534 534
 	 * @return        boolean
535 535
 	 */
536
-	public static function state_options( $state_options = array() ) {
536
+	public static function state_options($state_options = array()) {
537 537
 		$new_states = EED_Add_New_State::_get_new_states();
538
-		foreach ( $new_states as $new_state ) {
538
+		foreach ($new_states as $new_state) {
539 539
 			if (
540 540
 				$new_state instanceof EE_State
541 541
 				&& $new_state->country() instanceof EE_Country
542 542
 			) {
543
-				$state_options[ $new_state->country()->name() ][ $new_state->ID() ] = $new_state->name();
543
+				$state_options[$new_state->country()->name()][$new_state->ID()] = $new_state->name();
544 544
 			}
545 545
 		}
546 546
 		return $state_options;
@@ -556,12 +556,12 @@  discard block
 block discarded – undo
556 556
 	 */
557 557
 	protected static function _get_new_states() {
558 558
 		$new_states = array();
559
-		if ( EE_Registry::instance()->SSN instanceof EE_Session ) {
559
+		if (EE_Registry::instance()->SSN instanceof EE_Session) {
560 560
 			$new_states = EE_Registry::instance()->SSN->get_session_data(
561 561
 				'nsmf_new_states'
562 562
 			);
563 563
 		}
564
-		return is_array( $new_states ) ? $new_states : array();
564
+		return is_array($new_states) ? $new_states : array();
565 565
 	}
566 566
 
567 567
 
@@ -573,14 +573,14 @@  discard block
 block discarded – undo
573 573
 	 * @param EE_Country[]  $country_options
574 574
 	 * @return        boolean
575 575
 	 */
576
-	public static function country_options( $country_options = array() ) {
576
+	public static function country_options($country_options = array()) {
577 577
 		$new_states = EED_Add_New_State::_get_new_states();
578
-		foreach ( $new_states as $new_state ) {
578
+		foreach ($new_states as $new_state) {
579 579
 			if (
580 580
 				$new_state instanceof EE_State
581 581
 				&& $new_state->country() instanceof EE_Country
582 582
 			) {
583
-				$country_options[ $new_state->country()->ID() ] = $new_state->country()->name();
583
+				$country_options[$new_state->country()->ID()] = $new_state->country()->name();
584 584
 			}
585 585
 		}
586 586
 		return $country_options;
Please login to merge, or discard this patch.
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -448,7 +448,7 @@  discard block
 block discarded – undo
448 448
 	 * @param string $CNT_ISO
449 449
 	 * @param string $STA_ID
450 450
 	 * @param array  $cols_n_values
451
-	 * @return        boolean
451
+	 * @return        boolean|null
452 452
 	 */
453 453
 	public static function update_country_settings( $CNT_ISO = '', $STA_ID = '', $cols_n_values = array() ) {
454 454
 		$CNT_ISO = ! empty( $CNT_ISO ) ? $CNT_ISO : FALSE;
@@ -537,7 +537,7 @@  discard block
 block discarded – undo
537 537
 	 *
538 538
 	 * @access        public
539 539
 	 * @param EE_State[]  $state_options
540
-	 * @return        boolean
540
+	 * @return        EE_State[]
541 541
 	 */
542 542
 	public static function state_options( $state_options = array() ) {
543 543
 		$new_states = EED_Add_New_State::_get_new_states();
Please login to merge, or discard this patch.
modules/csv/EED_Csv.module.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
 	 * @return EED_Csv
30 30
 	 */
31 31
 	public static function instance() {
32
-		return parent::get_instance( __CLASS__ );
32
+		return parent::get_instance(__CLASS__);
33 33
 	}
34 34
 
35 35
 
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
 	 *  @access 	public
61 61
 	 *  @return 	void
62 62
 	 */
63
-	public function run( $WP ) {
63
+	public function run($WP) {
64 64
 //		add_filter( 'FHEE_load_ee_config', '__return_true' );
65 65
 //		add_filter( 'FHEE_run_EE_wp', '__return_true' );
66 66
 //		add_filter( 'FHEE_load_EE_Session', '__return_true' );
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
 	 *  @return 	void
80 80
 	 */
81 81
 	public function export() {
82
-		$Export = EE_Registry::instance()->load_class( 'Export' );
82
+		$Export = EE_Registry::instance()->load_class('Export');
83 83
 		$Export->export();
84 84
 	}
85 85
 
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
 	 *  @return 	void
94 94
 	 */
95 95
 	public function import() {
96
-		$Import = EE_Registry::instance()->load_class( 'Import' );
96
+		$Import = EE_Registry::instance()->load_class('Import');
97 97
 		$Import->import();
98 98
 	}
99 99
 
Please login to merge, or discard this patch.
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.