Completed
Branch BUG-8698-ticket-sellouts (195489)
by
unknown
134:14 queued 117:34
created
templates/txn_admin_details_main_meta_box_txn_details.template.php 1 patch
Spacing   +117 added lines, -117 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@  discard block
 block discarded – undo
1 1
 <div id="admin-primary-mbox-dv" class="admin-primary-mbox-dv">
2 2
 
3 3
 	<h3 class="admin-primary-mbox-h4 hdr-has-icon">
4
-		<span class="dashicons dashicons-cart"></span><?php _e( 'Transaction Items', 'event_espresso' );?>
4
+		<span class="dashicons dashicons-cart"></span><?php _e('Transaction Items', 'event_espresso'); ?>
5 5
 	</h3>
6 6
 
7 7
 	<div class="admin-primary-mbox-tbl-wrap">
@@ -10,27 +10,27 @@  discard block
 block discarded – undo
10 10
 	</div>
11 11
 
12 12
 	<a id="display-additional-transaction-session-info" class="display-the-hidden smaller-text" rel="additional-transaction-session-info">
13
-		<span class="dashicons dashicons-plus-alt"></span><?php _e( 'view additional transaction session details', 'event_espresso' );?>
13
+		<span class="dashicons dashicons-plus-alt"></span><?php _e('view additional transaction session details', 'event_espresso'); ?>
14 14
 	</a>
15 15
 
16 16
 	<div id="additional-transaction-session-info-dv" class="hidden">
17 17
 
18 18
 		<a id="hide-additional-transaction-session-info" class="hide-the-displayed hidden smaller-text" rel="additional-transaction-session-info">
19
-			<span class="dashicons dashicons-dismiss"></span><?php _e( 'hide additional transaction session details', 'event_espresso' );?>
19
+			<span class="dashicons dashicons-dismiss"></span><?php _e('hide additional transaction session details', 'event_espresso'); ?>
20 20
 		</a>
21 21
 	<br class="clear"/>
22 22
 
23
-		<h3 class="admin-primary-mbox-h4"><?php _e( 'Transaction Session Details', 'event_espresso' );?></h3>
23
+		<h3 class="admin-primary-mbox-h4"><?php _e('Transaction Session Details', 'event_espresso'); ?></h3>
24 24
 
25 25
 		<table id="admin-primary-mbox-txn-extra-session-info-tbl" class="form-table skinny-rows">
26 26
 			<tbody>
27
-			<?php foreach ( $txn_details as $key => $txn_detail ) : ?>
27
+			<?php foreach ($txn_details as $key => $txn_detail) : ?>
28 28
 				<tr>
29 29
 					<th>
30
-						<label for="<?php echo $key;?>"><?php echo $txn_detail['label'];?></label>
30
+						<label for="<?php echo $key; ?>"><?php echo $txn_detail['label']; ?></label>
31 31
 					</th>
32 32
 					<td>
33
-						<?php echo $txn_detail['value'];?>
33
+						<?php echo $txn_detail['value']; ?>
34 34
 					</td>
35 35
 				</tr>
36 36
 			<?php endforeach; // $txn_details?>
@@ -40,10 +40,10 @@  discard block
 block discarded – undo
40 40
 	<br class="clear"/>
41 41
 
42 42
 
43
-	<?php if ( $attendee instanceof EE_Attendee && ( $grand_raw_total > 0 || $TXN_status != 'TCM' || ! empty( $payments ) ) ) : ?>
43
+	<?php if ($attendee instanceof EE_Attendee && ($grand_raw_total > 0 || $TXN_status != 'TCM' || ! empty($payments))) : ?>
44 44
 
45 45
 	<h3 class="admin-primary-mbox-h4 hdr-has-icon">
46
-		<span class="ee-icon ee-icon-cash"></span><?php _e( 'Payment Details', 'event_espresso' );?>
46
+		<span class="ee-icon ee-icon-cash"></span><?php _e('Payment Details', 'event_espresso'); ?>
47 47
 	</h3>
48 48
 
49 49
 	<div class="admin-primary-mbox-tbl-wrap">
@@ -52,79 +52,79 @@  discard block
 block discarded – undo
52 52
 				<tr>
53 53
 					<th></th>
54 54
 					<th class="jst-cntr"></th>
55
-					<th class="jst-cntr"><?php _e( 'ID', 'event_espresso' );?></th>
56
-					<th class="jst-left"><?php _e( 'Date', 'event_espresso' );?></th>
57
-					<th class="jst-cntr"><?php _e( 'Source', 'event_espresso' );?></th>
58
-					<th class="jst-left"><?php _e( 'Method', 'event_espresso' );?></th>
59
-					<th class="jst-left"><?php _e( 'Gateway Response', 'event_espresso' );?></th>
60
-					<th class="jst-left"><?php _e( 'TXN&nbsp;ID / CHQ&nbsp;#', 'event_espresso' );?></th>
61
-					<th class="jst-left"><?php _e( 'P.O. / S.O.&nbsp;#', 'event_espresso' );?></th>
62
-					<th class="jst-left"><?php _e( 'Notes / Extra&nbsp;Accounting', 'event_espresso' );?></th>
63
-					<!--<th class="jst-left"><?php _e( 'Details', 'event_espresso' );?></th>-->
64
-					<th class="jst-cntr"><?php _e( 'Amount', 'event_espresso' );?></th>
55
+					<th class="jst-cntr"><?php _e('ID', 'event_espresso'); ?></th>
56
+					<th class="jst-left"><?php _e('Date', 'event_espresso'); ?></th>
57
+					<th class="jst-cntr"><?php _e('Source', 'event_espresso'); ?></th>
58
+					<th class="jst-left"><?php _e('Method', 'event_espresso'); ?></th>
59
+					<th class="jst-left"><?php _e('Gateway Response', 'event_espresso'); ?></th>
60
+					<th class="jst-left"><?php _e('TXN&nbsp;ID / CHQ&nbsp;#', 'event_espresso'); ?></th>
61
+					<th class="jst-left"><?php _e('P.O. / S.O.&nbsp;#', 'event_espresso'); ?></th>
62
+					<th class="jst-left"><?php _e('Notes / Extra&nbsp;Accounting', 'event_espresso'); ?></th>
63
+					<!--<th class="jst-left"><?php _e('Details', 'event_espresso'); ?></th>-->
64
+					<th class="jst-cntr"><?php _e('Amount', 'event_espresso'); ?></th>
65 65
 				</tr>
66 66
 			</thead>
67 67
 			<tbody>
68
-		<?php if ( $payments ) : ?>
68
+		<?php if ($payments) : ?>
69 69
 			<?php $payment_total = 0; ?>
70
-			<?php foreach ( $payments as $PAY_ID => $payment ) :
71
-				$existing_reg_payment_json = isset( $existing_reg_payments[ $PAY_ID ] )
72
-					? wp_json_encode( $existing_reg_payments[ $PAY_ID ] )
70
+			<?php foreach ($payments as $PAY_ID => $payment) :
71
+				$existing_reg_payment_json = isset($existing_reg_payments[$PAY_ID])
72
+					? wp_json_encode($existing_reg_payments[$PAY_ID])
73 73
 					: '{}';
74 74
 				?>
75
-				<tr id="txn-admin-payment-tr-<?php echo $PAY_ID;?>">
75
+				<tr id="txn-admin-payment-tr-<?php echo $PAY_ID; ?>">
76 76
 					<td>
77 77
 						<span id="payment-status-<?php echo $PAY_ID; ?>" class="ee-status-strip-td ee-status-strip pymt-status-<?php echo $payment->STS_ID(); ?>"></span>
78
-						<div id="payment-STS_ID-<?php echo $PAY_ID;?>" class="hidden"><?php echo $payment->STS_ID();?></div>
79
-						<div id="reg-payments-<?php echo $PAY_ID;?>" class="hidden"><?php echo $existing_reg_payment_json; ?></div>
78
+						<div id="payment-STS_ID-<?php echo $PAY_ID; ?>" class="hidden"><?php echo $payment->STS_ID(); ?></div>
79
+						<div id="reg-payments-<?php echo $PAY_ID; ?>" class="hidden"><?php echo $existing_reg_payment_json; ?></div>
80 80
 					</td>
81 81
 					<td class=" jst-cntr">
82 82
 						<ul class="txn-overview-actions-ul">
83 83
 							<li>
84
-								<a class="txn-admin-payment-action-edit-lnk" title="<?php esc_attr_e( 'Edit Payment', 'event_espresso' );?>" data-payment-id="<?php echo $PAY_ID;?>">
84
+								<a class="txn-admin-payment-action-edit-lnk" title="<?php esc_attr_e('Edit Payment', 'event_espresso'); ?>" data-payment-id="<?php echo $PAY_ID; ?>">
85 85
 									<div class="dashicons dashicons-edit" style="margin: 0;"></div>
86 86
 								</a>
87 87
 							</li>
88 88
 							<li>
89
-								<a class="txn-admin-payment-action-delete-lnk" title="<?php esc_attr_e( 'Delete Payment', 'event_espresso' );?>" data-payment-id="<?php echo $PAY_ID;?>">
89
+								<a class="txn-admin-payment-action-delete-lnk" title="<?php esc_attr_e('Delete Payment', 'event_espresso'); ?>" data-payment-id="<?php echo $PAY_ID; ?>">
90 90
 									<div class="dashicons dashicons-trash" style="margin: 0;"></div>
91 91
 								</a>
92 92
 							</li>
93 93
 						</ul>
94 94
 					</td>
95 95
 					<td class=" jst-rght">
96
-						<div id="payment-id-<?php echo $PAY_ID;?>"><?php echo $PAY_ID;?></div>
96
+						<div id="payment-id-<?php echo $PAY_ID; ?>"><?php echo $PAY_ID; ?></div>
97 97
 					</td>
98 98
 					<td class=" jst-left">
99
-						<div id="payment-date-<?php echo $PAY_ID;?>" class="payment-date-dv"><?php echo $payment->timestamp('Y-m-d', 'g:i a');?></div>
99
+						<div id="payment-date-<?php echo $PAY_ID; ?>" class="payment-date-dv"><?php echo $payment->timestamp('Y-m-d', 'g:i a'); ?></div>
100 100
 					</td>
101 101
 					<td class=" jst-cntr">
102
-						<div id="payment-method-<?php echo $PAY_ID;?>">
103
-							<?php echo $payment->source();?>
102
+						<div id="payment-method-<?php echo $PAY_ID; ?>">
103
+							<?php echo $payment->source(); ?>
104 104
 						</div>
105 105
 					</td>
106 106
 					<td class=" jst-left">
107
-						<div id="payment-gateway-<?php echo $PAY_ID;?>">
108
-							<?php echo $payment->payment_method() ?  $payment->payment_method()->admin_name() : __("Unknown", 'event_espresso');?>
107
+						<div id="payment-gateway-<?php echo $PAY_ID; ?>">
108
+							<?php echo $payment->payment_method() ? $payment->payment_method()->admin_name() : __("Unknown", 'event_espresso'); ?>
109 109
 						</div>
110
-						<div id="payment-gateway-id-<?php echo $PAY_ID;?>" class="hidden"><?php echo $payment->payment_method() ? $payment->payment_method()->ID() : 0;?></div>
110
+						<div id="payment-gateway-id-<?php echo $PAY_ID; ?>" class="hidden"><?php echo $payment->payment_method() ? $payment->payment_method()->ID() : 0; ?></div>
111 111
 					</td>
112 112
 					<td class=" jst-left">
113
-						<div id="payment-response-<?php echo $PAY_ID;?>"><?php echo $payment->gateway_response();?></div>
113
+						<div id="payment-response-<?php echo $PAY_ID; ?>"><?php echo $payment->gateway_response(); ?></div>
114 114
 					</td>
115 115
 					<td class=" jst-left">
116
-						<div id="payment-txn-id-chq-nmbr-<?php echo $PAY_ID;?>"><?php echo $payment->txn_id_chq_nmbr();?></div>
116
+						<div id="payment-txn-id-chq-nmbr-<?php echo $PAY_ID; ?>"><?php echo $payment->txn_id_chq_nmbr(); ?></div>
117 117
 					</td>
118 118
 					<td class=" jst-left">
119
-						<div id="payment-po-nmbr-<?php echo $PAY_ID;?>"><?php echo $payment->po_number();?></div>
119
+						<div id="payment-po-nmbr-<?php echo $PAY_ID; ?>"><?php echo $payment->po_number(); ?></div>
120 120
 					</td>
121 121
 					<td class=" jst-left">
122
-						<div id="payment-accntng-<?php echo $PAY_ID;?>"><?php echo $payment->extra_accntng();?></div>
122
+						<div id="payment-accntng-<?php echo $PAY_ID; ?>"><?php echo $payment->extra_accntng(); ?></div>
123 123
 					</td>
124 124
 					<td class=" jst-rght">
125
-						<?php $payment_class = $payment->amount() > 0 ? 'txn-admin-payment-status-' . $payment->STS_ID() : 'txn-admin-payment-status-PDC'; ?>
126
-						<span class="<?php echo $payment_class;?>">
127
-							<div id="payment-amount-<?php echo $PAY_ID;?>" style="display:inline;"><?php echo EEH_Template::format_currency($payment->amount(), FALSE, FALSE ); ?></div>
125
+						<?php $payment_class = $payment->amount() > 0 ? 'txn-admin-payment-status-'.$payment->STS_ID() : 'txn-admin-payment-status-PDC'; ?>
126
+						<span class="<?php echo $payment_class; ?>">
127
+							<div id="payment-amount-<?php echo $PAY_ID; ?>" style="display:inline;"><?php echo EEH_Template::format_currency($payment->amount(), FALSE, FALSE); ?></div>
128 128
 						</span>
129 129
 					</td>
130 130
 				</tr>
@@ -134,25 +134,25 @@  discard block
 block discarded – undo
134 134
 			<?php endforeach; // $payment?>
135 135
 			<?php
136 136
 				$pay_totals_class = $payment_total > $grand_raw_total ? ' important-notice' : '';
137
-				$overpaid = $payment_total > $grand_raw_total ? '<span id="overpaid">' . __( 'This transaction has been overpaid ! ', 'event_espresso' ) . '</span>' : '';
137
+				$overpaid = $payment_total > $grand_raw_total ? '<span id="overpaid">'.__('This transaction has been overpaid ! ', 'event_espresso').'</span>' : '';
138 138
 			?>
139 139
 				<tr id="txn-admin-no-payments-tr" class="admin-primary-mbox-total-tr hidden">
140 140
 					<td class=" jst-rght" colspan="11">
141
-						<span class="important-notice"><?php _e( 'No payments have been applied to this transaction yet. Click "Apply Payment" below to make a payment.', 'event_espresso' ); ?></span>
141
+						<span class="important-notice"><?php _e('No payments have been applied to this transaction yet. Click "Apply Payment" below to make a payment.', 'event_espresso'); ?></span>
142 142
 					</td>
143 143
 				</tr>
144
-				<tr id="txn-admin-payments-total-tr" class="admin-primary-mbox-total-tr<?php echo $pay_totals_class;?>">
145
-					<th class=" jst-rght" colspan="10"><span id="payments-total-spn"><?php echo $overpaid . sprintf( __( 'Payments Total %s', 'event_espresso' ), '(' . EE_Registry::instance()->CFG->currency->code . ')' );?></span></th>
146
-					<th class=" jst-rght"><span id="txn-admin-payment-total"><?php echo EEH_Template::format_currency($payment_total, FALSE, FALSE);?></span></th>
144
+				<tr id="txn-admin-payments-total-tr" class="admin-primary-mbox-total-tr<?php echo $pay_totals_class; ?>">
145
+					<th class=" jst-rght" colspan="10"><span id="payments-total-spn"><?php echo $overpaid.sprintf(__('Payments Total %s', 'event_espresso'), '('.EE_Registry::instance()->CFG->currency->code.')'); ?></span></th>
146
+					<th class=" jst-rght"><span id="txn-admin-payment-total"><?php echo EEH_Template::format_currency($payment_total, FALSE, FALSE); ?></span></th>
147 147
 				</tr>
148 148
 		<?php else : ?>
149 149
 				<tr id="txn-admin-no-payments-tr" class="admin-primary-mbox-total-tr">
150 150
 					<td class=" jst-rght" colspan="11">
151
-						<span class="important-notice"><?php _e( 'No payments have been applied to this transaction yet. Click "Apply Payment" below to make a payment.', 'event_espresso' ); ?></span>
151
+						<span class="important-notice"><?php _e('No payments have been applied to this transaction yet. Click "Apply Payment" below to make a payment.', 'event_espresso'); ?></span>
152 152
 					</td>
153 153
 				</tr>
154 154
 				<tr id="txn-admin-payments-total-tr" class="admin-primary-mbox-total-tr hidden">
155
-					<th class=" jst-rght" colspan="10"><span id="payments-total-spn"><?php echo __( 'Payments Total', 'event_espresso' );?></span></th>
155
+					<th class=" jst-rght" colspan="10"><span id="payments-total-spn"><?php echo __('Payments Total', 'event_espresso'); ?></span></th>
156 156
 					<th class=" jst-rght"><span id="txn-admin-payment-total"></span></th>
157 157
 				</tr>
158 158
 		<?php endif; // $payments?>
@@ -165,12 +165,12 @@  discard block
 block discarded – undo
165 165
 					<td class=" jst-cntr">
166 166
 						<ul class="txn-overview-actions-ul">
167 167
 							<li>
168
-								<a class="txn-admin-payment-action-edit-lnk" title="<?php esc_attr_e( 'Edit Payment', 'event_espresso' );?>" data-payment-id="PAY_ID">
168
+								<a class="txn-admin-payment-action-edit-lnk" title="<?php esc_attr_e('Edit Payment', 'event_espresso'); ?>" data-payment-id="PAY_ID">
169 169
 									<div class="dashicons dashicons-edit" style="margin: 0;"></div>
170 170
 								</a>
171 171
 							</li>
172 172
 							<li>
173
-								<a class="txn-admin-payment-action-delete-lnk" title="<?php esc_attr_e( 'Delete Payment', 'event_espresso' );?>" data-payment-id="PAY_ID">
173
+								<a class="txn-admin-payment-action-delete-lnk" title="<?php esc_attr_e('Delete Payment', 'event_espresso'); ?>" data-payment-id="PAY_ID">
174 174
 									<div class="dashicons dashicons-trash" style="margin: 0;"></div>
175 175
 								</a>
176 176
 							</li>
@@ -217,12 +217,12 @@  discard block
 block discarded – undo
217 217
 	<ul id="txn-admin-payment-options-ul">
218 218
 		<li>
219 219
 			<a id="display-txn-admin-apply-payment" class="button-primary no-icon no-hide" rel="txn-admin-apply-payment" > <!--display-the-hidden -->
220
-				<?php _e( 'Apply Payment', 'event_espresso' );?>
220
+				<?php _e('Apply Payment', 'event_espresso'); ?>
221 221
 			</a>
222 222
 		</li>
223 223
 		<li>
224 224
 			<a id="display-txn-admin-apply-refund" class="button-secondary no-icon no-hide" rel="txn-admin-apply-refund" >  <!--display-the-hidden -->
225
-				<?php _e( 'Apply Refund', 'event_espresso' );?>
225
+				<?php _e('Apply Refund', 'event_espresso'); ?>
226 226
 			</a>
227 227
 		</li>
228 228
 	</ul>
@@ -232,14 +232,14 @@  discard block
 block discarded – undo
232 232
 
233 233
 		<h2 id="admin-modal-dialog-apply-payment-h2" class="admin-modal-dialog-h2 hdr-has-icon" style="display:none;">
234 234
 			<div class="ee-icon ee-icon-cash-add float-left"></div>
235
-			<?php echo __( 'Apply a Payment to Transaction #', 'event_espresso' ) . $txn_nmbr['value'];?>
235
+			<?php echo __('Apply a Payment to Transaction #', 'event_espresso').$txn_nmbr['value']; ?>
236 236
 		</h2>
237 237
 
238 238
 		<h2 id="admin-modal-dialog-edit-payment-h2" class="admin-modal-dialog-h2 hdr-has-icon" style="display:none;">
239 239
 			<div class="ee-icon ee-icon-cash-edit float-left"></div>
240 240
 			<?php
241 241
 			echo sprintf(
242
-				__( 'Edit Payment #%s for Transaction #%s', 'event_espresso' ),
242
+				__('Edit Payment #%s for Transaction #%s', 'event_espresso'),
243 243
 				'<span></span>',
244 244
 				$txn_nmbr['value']
245 245
 			);
@@ -250,7 +250,7 @@  discard block
 block discarded – undo
250 250
 			<div class="ee-icon ee-icon-cash-edit float-left"></div>
251 251
 			<?php
252 252
 			echo sprintf(
253
-				__( 'Edit Refund #%s for Transaction #%s', 'event_espresso' ),
253
+				__('Edit Refund #%s for Transaction #%s', 'event_espresso'),
254 254
 				'<span></span>',
255 255
 				$txn_nmbr['value']
256 256
 			);
@@ -259,14 +259,14 @@  discard block
 block discarded – undo
259 259
 
260 260
 		<h2 id="admin-modal-dialog-apply-refund-h2" class="admin-modal-dialog-h2 hdr-has-icon" style="display:none;">
261 261
 			<div class="ee-icon ee-icon-cash-remove float-left"></div>
262
-			<?php echo __( 'Apply a Refund to Transaction #', 'event_espresso' ) . $txn_nmbr['value'];?>
262
+			<?php echo __('Apply a Refund to Transaction #', 'event_espresso').$txn_nmbr['value']; ?>
263 263
 		</h2>
264 264
 
265 265
 		<form name="txn-admin-apply-payment-frm" id="txn-admin-apply-payment-frm" action="<?php echo $apply_payment_form_url; ?>">
266 266
 			<div class="admin-modal-dialog-wrap">
267 267
 				<div class="admin-modal-dialog-inner">
268 268
 
269
-					<input  type="hidden" name="espresso_apply_payment_nonce" id="espresso_apply_payment_nonce" value="<?php echo wp_create_nonce( 'espresso_apply_payment_nonce' );?>"/>
269
+					<input  type="hidden" name="espresso_apply_payment_nonce" id="espresso_apply_payment_nonce" value="<?php echo wp_create_nonce('espresso_apply_payment_nonce'); ?>"/>
270 270
 					<input  type="hidden" name="espresso_ajax" id="espresso-ajax" value="0"/>
271 271
 					<input  type="hidden" name="noheader" id="txn-admin-noheader-inp" value="0"/>
272 272
 					<input  type="hidden" name="txn_admin_payment[PAY_ID]" id="txn-admin-payment-payment-id-inp" class="txn-admin-apply-payment-inp" value="0"/>
@@ -274,108 +274,108 @@  discard block
 block discarded – undo
274 274
 					<input  type="hidden" name="txn_admin_payment[type]" id="txn-admin-payment-type-inp" value="1"/>
275 275
 					<input  type="hidden" name="txn_admin_payment[details]" id="txn-admin-payment-details-inp" value=""/>
276 276
 					<input  type="hidden" name="txn_admin_delete_payment_form_url" id="txn-admin-delete-payment-form-url-inp" value="<?php echo $delete_payment_form_url; ?>"/>
277
-					<input  type="hidden" name="txn_admin_todays_date" id="txn-admin-todays-date-inp" value="<?php echo date( 'Y-m-d h:i a', current_time( 'timestamp' )); ?>"/>
277
+					<input  type="hidden" name="txn_admin_todays_date" id="txn-admin-todays-date-inp" value="<?php echo date('Y-m-d h:i a', current_time('timestamp')); ?>"/>
278 278
 
279 279
 					<div class="txn-admin-apply-payment-date-dv admin-modal-dialog-row">
280
-						<div class="validation-notice-dv"><?php _e( 'The following is  a required field', 'event_espresso' );?></div>
281
-						<label for="txn-admin-payment-date-inp" class=""><?php _e( 'Payment Date', 'event_espresso' );?></label>
282
-						<input name="[date]txn_admin_payment" id="txn-admin-payment-date-inp" class="txn-admin-apply-payment-inp required" type="text" value="<?php echo date( 'Y-m-d g:i a', current_time( 'timestamp' )); ?>"/>
283
-						<p class="description"><?php _e( 'The date the payment was actually made on', 'event_espresso' );?></p>
280
+						<div class="validation-notice-dv"><?php _e('The following is  a required field', 'event_espresso'); ?></div>
281
+						<label for="txn-admin-payment-date-inp" class=""><?php _e('Payment Date', 'event_espresso'); ?></label>
282
+						<input name="[date]txn_admin_payment" id="txn-admin-payment-date-inp" class="txn-admin-apply-payment-inp required" type="text" value="<?php echo date('Y-m-d g:i a', current_time('timestamp')); ?>"/>
283
+						<p class="description"><?php _e('The date the payment was actually made on', 'event_espresso'); ?></p>
284 284
 					</div>
285 285
 
286 286
 					<div class="txn-admin-apply-payment-amount-dv admin-modal-dialog-row">
287
-						<div class="validation-notice-dv"><?php _e( 'The following is  a required field', 'event_espresso' );?></div>
288
-						<label for="txn-admin-payment-amount-inp" class=""><?php _e( 'Amount', 'event_espresso' );?></label>
287
+						<div class="validation-notice-dv"><?php _e('The following is  a required field', 'event_espresso'); ?></div>
288
+						<label for="txn-admin-payment-amount-inp" class=""><?php _e('Amount', 'event_espresso'); ?></label>
289 289
 						<input name="txn_admin_payment[amount]" id="txn-admin-payment-amount-inp" class="txn-admin-apply-payment-inp required" type="text" value=""/>
290
-						<p class="description"><?php _e( 'The amount of the payment', 'event_espresso' );?></p>
290
+						<p class="description"><?php _e('The amount of the payment', 'event_espresso'); ?></p>
291 291
 					</div>
292 292
 
293 293
 					<div class="txn-admin-apply-payment-method-dv admin-modal-dialog-row">
294
-						<div class="validation-notice-dv"><?php _e( 'The following is  a required field', 'event_espresso' );?></div>
295
-						<label for="txn-admin-payment-method-inp" class=""><?php _e( 'Method of Payment', 'event_espresso' );?></label>
294
+						<div class="validation-notice-dv"><?php _e('The following is  a required field', 'event_espresso'); ?></div>
295
+						<label for="txn-admin-payment-method-inp" class=""><?php _e('Method of Payment', 'event_espresso'); ?></label>
296 296
 						<select name="txn_admin_payment[PMD_ID]" id="txn-admin-payment-method-slct" class="txn-admin-apply-payment-slct required" type="text" >
297
-						<?php foreach ( $payment_methods as $method ) : ?>
297
+						<?php foreach ($payment_methods as $method) : ?>
298 298
 							<?php $selected = $method->slug() == 'cash' ? ' selected="selected"' : ''; ?>
299
-							<option id="payment-method-opt-<?php echo $method->slug(); ?>" value="<?php echo $method->ID(); ?>"<?php echo $selected; ?>><?php echo sanitize_key( $method->admin_desc() ) ? substr( $method->admin_desc(), 0, 128) : $method->admin_name() ; ?>&nbsp;&nbsp;</option>
299
+							<option id="payment-method-opt-<?php echo $method->slug(); ?>" value="<?php echo $method->ID(); ?>"<?php echo $selected; ?>><?php echo sanitize_key($method->admin_desc()) ? substr($method->admin_desc(), 0, 128) : $method->admin_name(); ?>&nbsp;&nbsp;</option>
300 300
 						<?php endforeach; ?>
301 301
 						</select>
302
-						<p class="description"><?php _e( 'Whether the payment was made via PayPal, Credit Card, Cheque, or Cash', 'event_espresso' );?></p>
302
+						<p class="description"><?php _e('Whether the payment was made via PayPal, Credit Card, Cheque, or Cash', 'event_espresso'); ?></p>
303 303
 					</div>
304 304
 
305 305
 					<div class="mop-PP mop-CC mop-CHQ mop">
306 306
 						<div class="txn-admin-apply-payment-gw-txn-id-dv admin-modal-dialog-row">
307
-							<label for="txn-admin-payment-txn-id-inp" class=""><?php _e( 'TXN ID / CHQ #', 'event_espresso' );?></label>
307
+							<label for="txn-admin-payment-txn-id-inp" class=""><?php _e('TXN ID / CHQ #', 'event_espresso'); ?></label>
308 308
 							<input name="txn_admin_payment[txn_id_chq_nmbr]" id="txn-admin-payment-txn-id-chq-nmbr-inp" class="txn-admin-apply-payment-inp" type="text" maxlength="100"/>
309
-							<p class="description"><?php _e( 'The Transaction ID sent back from the payment gateway, or the Cheque #', 'event_espresso' );?></p>
309
+							<p class="description"><?php _e('The Transaction ID sent back from the payment gateway, or the Cheque #', 'event_espresso'); ?></p>
310 310
 						</div>
311 311
 					</div>
312 312
 
313 313
 					<div class="mop-CC mop" style="display:none">
314 314
 						<div class="txn-admin-apply-payment-response-dv admin-modal-dialog-row">
315
-							<label for="txn-admin-payment-gateway-response-inp" class=""><?php _e( 'Gateway Response', 'event_espresso' );?></label>
315
+							<label for="txn-admin-payment-gateway-response-inp" class=""><?php _e('Gateway Response', 'event_espresso'); ?></label>
316 316
 							<input name="txn_admin_payment[gateway_response]" id="txn-admin-payment-gateway-response-inp" class="txn-admin-apply-payment-inp" type="text"/>
317
-							<p class="description"><?php _e( 'The gateway response string (optional)', 'event_espresso' );?></p>
317
+							<p class="description"><?php _e('The gateway response string (optional)', 'event_espresso'); ?></p>
318 318
 						</div>
319 319
 					</div>
320 320
 
321 321
 					<div class="mop-PP mop-CC mop">
322 322
 						<div class="txn-admin-apply-payment-status-dv admin-modal-dialog-row">
323
-							<label for="txn-admin-payment-status-inp" class=""><?php _e( 'Payment Status', 'event_espresso' );?></label>
323
+							<label for="txn-admin-payment-status-inp" class=""><?php _e('Payment Status', 'event_espresso'); ?></label>
324 324
 							<select name="txn_admin_payment[status]" id="txn-admin-payment-status-slct" class="txn-admin-apply-payment-slct" type="text" >
325
-							<?php foreach ( $payment_status as $STS_ID => $STS_code ) : ?>
325
+							<?php foreach ($payment_status as $STS_ID => $STS_code) : ?>
326 326
 								<?php $selected = $STS_ID == 'PAP' ? ' selected="selected"' : ''; ?>
327 327
 								<option id="payment-status-opt-<?php echo $STS_ID; ?>" value="<?php echo $STS_ID; ?>"<?php echo $selected; ?>><?php echo $STS_code; ?>&nbsp;&nbsp;</option>
328 328
 							<?php endforeach; ?>
329 329
 							</select>
330
-							<p class="description"><?php _e( 'Whether the payment was approved, cancelled, declined or failed after submission to the gateway', 'event_espresso' );?></p>
330
+							<p class="description"><?php _e('Whether the payment was approved, cancelled, declined or failed after submission to the gateway', 'event_espresso'); ?></p>
331 331
 						</div>
332 332
 					</div>
333 333
 
334 334
 					<div class="txn-admin-apply-payment-po-nmbr-dv admin-modal-dialog-row">
335
-						<label for="txn-admin-payment-po-nmbr-inp" class=""><?php _e( 'P.O. / S.O. #', 'event_espresso' );?></label>
335
+						<label for="txn-admin-payment-po-nmbr-inp" class=""><?php _e('P.O. / S.O. #', 'event_espresso'); ?></label>
336 336
 						<input name="txn_admin_payment[po_number]" id="txn-admin-payment-po-nmbr-inp" class="txn-admin-apply-payment-inp" type="text" maxlength="100"/>
337
-						<p class="description"><?php _e( 'The Purchase or Sales Order Number if any (optional)', 'event_espresso' );?></p>
337
+						<p class="description"><?php _e('The Purchase or Sales Order Number if any (optional)', 'event_espresso'); ?></p>
338 338
 					</div>
339 339
 
340 340
 					<div class="txn-admin-apply-payment-accounting-dv admin-modal-dialog-row">
341
-						<label for="txn-admin-payment-accounting-inp" class="last"><?php _e( 'Notes / Extra Accounting', 'event_espresso' );?></label>
341
+						<label for="txn-admin-payment-accounting-inp" class="last"><?php _e('Notes / Extra Accounting', 'event_espresso'); ?></label>
342 342
 						<input name="txn_admin_payment[accounting]" id="txn-admin-payment-accounting-inp" class="txn-admin-apply-payment-inp" type="text" value="<?php echo $REG_code; ?>" maxlength="100"/>		<input type="hidden" id="txn-admin-reg-code-inp" value="<?php echo $REG_code; ?>"/>
343
-						<p class="description"><?php _e( 'An extra field you may use for accounting purposes or simple notes. Defaults to the primary registrant\'s registration code.', 'event_espresso' );?></p>
343
+						<p class="description"><?php _e('An extra field you may use for accounting purposes or simple notes. Defaults to the primary registrant\'s registration code.', 'event_espresso'); ?></p>
344 344
 					</div>
345 345
 
346 346
 					<div class="txn-admin-apply-payment-registrations-dv admin-modal-dialog-row">
347
-						<label for="txn-admin-payment-registrations-inp" class="last"><?php _e( 'Registrations to Apply Payment to:', 'event_espresso' ); ?></label>
347
+						<label for="txn-admin-payment-registrations-inp" class="last"><?php _e('Registrations to Apply Payment to:', 'event_espresso'); ?></label>
348 348
 						<label class="txn-admin-apply-payment-to-registrations-lbl">
349 349
 							<input type="radio" value="1" id="txn-admin-apply-payment-to-all-registrations-inp" name="txn_admin_payment[apply_to_all_registrations]"  checked="checked"/>
350
-							<?php _e( 'ALL Registrations', 'event_espresso' ); ?>
350
+							<?php _e('ALL Registrations', 'event_espresso'); ?>
351 351
 						</label>
352 352
 						<label class="txn-admin-apply-payment-to-registrations-lbl">
353 353
 							<input type="radio" value="0" id="txn-admin-apply-payment-to-some-registrations-inp" name="txn_admin_payment[apply_to_all_registrations]" />
354
-							<?php _e( 'Just the following Registrations', 'event_espresso' ); ?>
354
+							<?php _e('Just the following Registrations', 'event_espresso'); ?>
355 355
 						</label>
356 356
 						<?php echo $registrations_to_apply_payment_to; ?>
357 357
 					</div>
358 358
 
359 359
 					<div class="txn-admin-payment-reg-status-dv admin-modal-dialog-row">
360
-						<label for="txn-admin-payment-reg-status-inp" class="last"><?php _e( 'Change Registration Status?', 'event_espresso' );?></label>
360
+						<label for="txn-admin-payment-reg-status-inp" class="last"><?php _e('Change Registration Status?', 'event_espresso'); ?></label>
361 361
 						<?php echo $status_change_select; ?>
362
-						<p class="description"><?php _e( 'If you wish to change the status for the registrations selected above, then select which status from this dropdown.', 'event_espresso' ); ?></p>
362
+						<p class="description"><?php _e('If you wish to change the status for the registrations selected above, then select which status from this dropdown.', 'event_espresso'); ?></p>
363 363
 						<br/>
364 364
 					</div>
365 365
 
366 366
 					<div class="txn-admin-apply-payment-send-notifications-dv admin-modal-dialog-row">
367 367
 
368
-						<label for="txn-admin-payment-send-notifications-inp" class="last"><?php _e( 'Send Related Messages?', 'event_espresso' );?></label>
368
+						<label for="txn-admin-payment-send-notifications-inp" class="last"><?php _e('Send Related Messages?', 'event_espresso'); ?></label>
369 369
 						<label class="txn-admin-payment-send-notifications-lbl">
370 370
 							<input type="checkbox" value="1" name="txn_payments[send_notifications]" checked="checked" aria-checked="true" style="vertical-align: middle;">
371
-							<?php _e( 'Payment Messages?', 'event_espresso' ); ?>
371
+							<?php _e('Payment Messages?', 'event_espresso'); ?>
372 372
 						</label>
373 373
 						<label class="txn-admin-payment-send-notifications-lbl">
374 374
 							<input type="checkbox" value="1" name="txn_reg_status_change[send_notifications]" style="vertical-align: middle;">
375
-							<?php _e( 'Registration Messages?', 'event_espresso' ); ?>
375
+							<?php _e('Registration Messages?', 'event_espresso'); ?>
376 376
 						</label>
377 377
 						<br class="clear-float"/>
378
-						<p class="description"><?php printf( __('By default %1$sa payment message is sent to the primary registrant%2$s after submitting this form.%3$sHowever, if you check the "Registration Messages" box, the system will also send any related messages matching the status of the registrations to %1$seach registration for this transaction%2$s.', 'event_espresso'), '<strong>', '</strong>', '<br />' ); ?></p>
378
+						<p class="description"><?php printf(__('By default %1$sa payment message is sent to the primary registrant%2$s after submitting this form.%3$sHowever, if you check the "Registration Messages" box, the system will also send any related messages matching the status of the registrations to %1$seach registration for this transaction%2$s.', 'event_espresso'), '<strong>', '</strong>', '<br />'); ?></p>
379 379
 						<label></label>
380 380
 					</div>
381 381
 					<div class="clear"></div>
@@ -386,27 +386,27 @@  discard block
 block discarded – undo
386 386
 			<ul id="admin-modal-dialog-options-ul">
387 387
 				<li>
388 388
 					<a id="txn-admin-modal-dialog-apply-payment-lnk" class="button-primary no-icon" style="display:none;" >
389
-						<?php _e( 'Apply Payment', 'event_espresso' );?>
389
+						<?php _e('Apply Payment', 'event_espresso'); ?>
390 390
 					</a>
391 391
 				</li>
392 392
 				<li>
393 393
 					<a id="txn-admin-modal-dialog-edit-payment-lnk" class="button-primary no-icon" style="display:none;" >
394
-						<?php _e( 'Save Payment Details', 'event_espresso' );?>
394
+						<?php _e('Save Payment Details', 'event_espresso'); ?>
395 395
 					</a>
396 396
 				</li>
397 397
 				<li>
398 398
 					<a id="txn-admin-modal-dialog-edit-refund-lnk" class="button-primary no-icon" style="display:none;" >
399
-						<?php _e( 'Save Refund Details', 'event_espresso' );?>
399
+						<?php _e('Save Refund Details', 'event_espresso'); ?>
400 400
 					</a>
401 401
 				</li>
402 402
 				<li>
403 403
 					<a id="txn-admin-modal-dialog-apply-refund-lnk" class="button-primary no-icon" style="display:none;" >
404
-						<?php _e( 'Apply Refund', 'event_espresso' );?>
404
+						<?php _e('Apply Refund', 'event_espresso'); ?>
405 405
 					</a>
406 406
 				</li>
407 407
 				<li>
408 408
 					<a id="txn-admin-modal-dialog-cancel-lnk" class="button-secondary no-icon" >
409
-						<?php _e( 'Cancel', 'event_espresso' );?>
409
+						<?php _e('Cancel', 'event_espresso'); ?>
410 410
 					</a>
411 411
 				</li>
412 412
 				<li>
@@ -423,29 +423,29 @@  discard block
 block discarded – undo
423 423
 
424 424
 		<h2 id="admin-modal-dialog-delete-payment-h2" class="admin-modal-dialog-h2 hdr-has-icon" style="display:none;">
425 425
 			<span class="ee-icon ee-icon-cash-add"></span>
426
-			<?php echo __( 'Delete Payment/Refund for Transaction #', 'event_espresso' ) . $txn_nmbr['value'];?>
426
+			<?php echo __('Delete Payment/Refund for Transaction #', 'event_espresso').$txn_nmbr['value']; ?>
427 427
 		</h2>
428 428
 
429 429
 		<form name="txn-admin-delete-payment-frm" id="txn-admin-delete-payment-frm" action="<?php echo $delete_payment_url; ?>">
430 430
 			<div class="admin-modal-dialog-wrap">
431 431
 				<div class="admin-modal-dialog-inner">
432 432
 
433
-					<input  type="hidden" name="espresso_delete_payment_nonce" id="espresso_delete_payment_nonce" value="<?php echo wp_create_nonce( 'espresso_delete_payment_nonce' );?>"/>
433
+					<input  type="hidden" name="espresso_delete_payment_nonce" id="espresso_delete_payment_nonce" value="<?php echo wp_create_nonce('espresso_delete_payment_nonce'); ?>"/>
434 434
 					<input  type="hidden" name="delete_espresso_ajax" id="delete-espresso-ajax" value="0"/>
435 435
 					<input  type="hidden" name="delete_noheader" id="delete-txn-admin-noheader-inp" value="0"/>
436 436
 					<input  type="hidden" name="delete_txn_admin_payment[PAY_ID]" id="delete-txn-admin-payment-payment-id-inp" class="txn-admin-apply-payment-inp" value="0"/>
437 437
 					<input  type="hidden" name="delete_txn_admin_payment[TXN_ID]" id="delete-txn-admin-payment-txn-id-inp" value="<?php echo $txn_nmbr['value']; ?>"/>
438 438
 
439 439
 					<div class="txn-admin-apply-payment-accounting-dv admin-modal-dialog-row">
440
-						<label for="delete-txn-admin-payment-reg-status-inp" class="last"><?php _e( 'Change Registration Status?', 'event_espresso' );?></label>
440
+						<label for="delete-txn-admin-payment-reg-status-inp" class="last"><?php _e('Change Registration Status?', 'event_espresso'); ?></label>
441 441
 						<?php echo $delete_status_change_select; ?>
442
-						<p class="description"><?php printf( __('If you wish to change the status of all the registrations associated with this transaction after deleting this payment/refund, then select which status from this dropdown. %sNote: ALL registrations associated with this transaction will be updated to this new status.%s', 'event_espresso'), '<strong>', '</strong>' ); ?></p>
442
+						<p class="description"><?php printf(__('If you wish to change the status of all the registrations associated with this transaction after deleting this payment/refund, then select which status from this dropdown. %sNote: ALL registrations associated with this transaction will be updated to this new status.%s', 'event_espresso'), '<strong>', '</strong>'); ?></p>
443 443
 					</div>
444 444
 
445 445
 					<div class="ee-attention txn-admin-apply-payment-accounting-dv admin-modal-dialog-row">
446
-						<label for="delete-txn-admin-payment-accounting-inp" class="last"><?php _e( 'Send Related Messages?', 'event_espresso' );?></label>
446
+						<label for="delete-txn-admin-payment-accounting-inp" class="last"><?php _e('Send Related Messages?', 'event_espresso'); ?></label>
447 447
 						<input type="checkbox" value="1" name="delete_txn_reg_status_change[send_notifications]">
448
-						<p class="description"><?php _e( 'If you check this box, the system will send any related registration messages matching the status of the registrations to each registration for this transaction. No Payment notifications are sent when deleting a payment.', 'event_espresso' );?></p>
448
+						<p class="description"><?php _e('If you check this box, the system will send any related registration messages matching the status of the registrations to each registration for this transaction. No Payment notifications are sent when deleting a payment.', 'event_espresso'); ?></p>
449 449
 					</div>
450 450
 					<div class="clear"></div>
451 451
 
@@ -455,12 +455,12 @@  discard block
 block discarded – undo
455 455
 			<ul id="del-admin-modal-dialog-options-ul">
456 456
 				<li>
457 457
 					<a id="txn-admin-modal-dialog-delete-lnk" class="button-primary no-icon" style="display:none;" >
458
-						<?php _e( 'Delete', 'event_espresso' );?>
458
+						<?php _e('Delete', 'event_espresso'); ?>
459 459
 					</a>
460 460
 				</li>
461 461
 				<li>
462 462
 					<a id="del-txn-admin-modal-dialog-cancel-lnk" class="button-secondary no-icon" >
463
-						<?php _e( 'Cancel', 'event_espresso' );?>
463
+						<?php _e('Cancel', 'event_espresso'); ?>
464 464
 					</a>
465 465
 				</li>
466 466
 				<li>
@@ -476,30 +476,30 @@  discard block
 block discarded – undo
476 476
 	<?php endif; // $grand_raw_total > 0?>
477 477
 
478 478
 	<?php
479
-	if ( WP_DEBUG ) {
480
-		$delivered_messages = get_option( 'EED_Messages__payment', array() );
481
-		if ( isset( $delivered_messages[ $TXN_ID ] )) {
479
+	if (WP_DEBUG) {
480
+		$delivered_messages = get_option('EED_Messages__payment', array());
481
+		if (isset($delivered_messages[$TXN_ID])) {
482 482
 			?>
483
-			<h4 class="admin-primary-mbox-h4 hdr-has-icon"><span class="dashicons dashicons-email-alt"></span><?php _e( 'Messages Sent to Primary Registrant', 'event_espresso' );?></h4>
483
+			<h4 class="admin-primary-mbox-h4 hdr-has-icon"><span class="dashicons dashicons-email-alt"></span><?php _e('Messages Sent to Primary Registrant', 'event_espresso'); ?></h4>
484 484
 
485 485
 			<div class="admin-primary-mbox-tbl-wrap">
486 486
 				<table class="admin-primary-mbox-tbl">
487 487
 					<thead>
488 488
 						<tr>
489
-							<th class="jst-left"><?php _e( 'Date & Time', 'event_espresso' );?></th>
490
-							<th class="jst-left"><?php _e( 'Message Type', 'event_espresso' );?></th>
491
-							<th class="jst-left"><?php _e( 'Payment Status Upon Sending', 'event_espresso' );?></th>
492
-							<th class="jst-left"><?php _e( 'TXN Status Upon Sending', 'event_espresso' );?></th>
489
+							<th class="jst-left"><?php _e('Date & Time', 'event_espresso'); ?></th>
490
+							<th class="jst-left"><?php _e('Message Type', 'event_espresso'); ?></th>
491
+							<th class="jst-left"><?php _e('Payment Status Upon Sending', 'event_espresso'); ?></th>
492
+							<th class="jst-left"><?php _e('TXN Status Upon Sending', 'event_espresso'); ?></th>
493 493
 						</tr>
494 494
 					</thead>
495 495
 					<tbody>
496
-						<?php foreach ( $delivered_messages[ $TXN_ID ] as $timestamp => $delivered_message ) :
496
+						<?php foreach ($delivered_messages[$TXN_ID] as $timestamp => $delivered_message) :
497 497
 							?>
498 498
 							<tr>
499
-								<td class="jst-left"><?php echo gmdate( get_option('date_format') . ' ' . get_option('time_format'), ( $timestamp + ( get_option( 'gmt_offset' ) * HOUR_IN_SECONDS ) ) );?></td>
500
-								<td class="jst-left"><?php echo isset( $delivered_message['message_type'] ) ? $delivered_message['message_type'] : '';?></td>
501
-								<td class="jst-left"><?php echo isset( $delivered_message['pay_status'] ) ? $delivered_message['pay_status'] : '';?></td>
502
-								<td class="jst-left"><?php echo isset( $delivered_message['txn_status'] ) ? $delivered_message['txn_status'] : '';?></td>
499
+								<td class="jst-left"><?php echo gmdate(get_option('date_format').' '.get_option('time_format'), ($timestamp + (get_option('gmt_offset') * HOUR_IN_SECONDS))); ?></td>
500
+								<td class="jst-left"><?php echo isset($delivered_message['message_type']) ? $delivered_message['message_type'] : ''; ?></td>
501
+								<td class="jst-left"><?php echo isset($delivered_message['pay_status']) ? $delivered_message['pay_status'] : ''; ?></td>
502
+								<td class="jst-left"><?php echo isset($delivered_message['txn_status']) ? $delivered_message['txn_status'] : ''; ?></td>
503 503
 							</tr>
504 504
 						<?php endforeach; // $delivered_messages?>
505 505
 					</tbody>
Please login to merge, or discard this patch.
core/EE_Front_Controller.core.php 1 patch
Spacing   +122 added lines, -122 removed lines patch added patch discarded remove patch
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
 	 */
62 62
 	public static function instance() {
63 63
 		// check if class object is instantiated, and instantiated properly
64
-		if ( self::$_instance === NULL  or ! is_object( self::$_instance ) or ! ( self::$_instance instanceof  EE_Front_Controller )) {
64
+		if (self::$_instance === NULL or ! is_object(self::$_instance) or ! (self::$_instance instanceof  EE_Front_Controller)) {
65 65
 			self::$_instance = new self();
66 66
 		}
67 67
 		return self::$_instance;
@@ -79,37 +79,37 @@  discard block
 block discarded – undo
79 79
 	 */
80 80
 	private function __construct() {
81 81
 		// make sure template tags are loaded immediately so that themes don't break
82
-		add_action( 'AHEE__EE_System__core_loaded_and_ready', array( $this, 'load_espresso_template_tags' ), 10 );
82
+		add_action('AHEE__EE_System__core_loaded_and_ready', array($this, 'load_espresso_template_tags'), 10);
83 83
 		// determine how to integrate WP_Query with the EE models
84
-		add_action( 'AHEE__EE_System__initialize', array( $this, 'employ_CPT_Strategy' ));
84
+		add_action('AHEE__EE_System__initialize', array($this, 'employ_CPT_Strategy'));
85 85
 		// load other resources and begin to actually run shortcodes and modules
86
-		add_action( 'wp_loaded', array( $this, 'wp_loaded' ), 5 );
86
+		add_action('wp_loaded', array($this, 'wp_loaded'), 5);
87 87
 		// analyse the incoming WP request
88
-		add_action( 'parse_request', array( $this, 'get_request' ), 1, 1 );
88
+		add_action('parse_request', array($this, 'get_request'), 1, 1);
89 89
 		// process any content shortcodes
90
-		add_action( 'parse_request', array( $this, '_initialize_shortcodes' ), 5 );
90
+		add_action('parse_request', array($this, '_initialize_shortcodes'), 5);
91 91
 		// process request with module factory
92
-		add_action( 'pre_get_posts', array( $this, 'pre_get_posts' ), 10, 1 );
92
+		add_action('pre_get_posts', array($this, 'pre_get_posts'), 10, 1);
93 93
 		// before headers sent
94
-		add_action( 'wp', array( $this, 'wp' ), 5 );
94
+		add_action('wp', array($this, 'wp'), 5);
95 95
 		// load css and js
96
-		add_action('wp_enqueue_scripts', array( $this, 'wp_enqueue_scripts' ), 1 );
96
+		add_action('wp_enqueue_scripts', array($this, 'wp_enqueue_scripts'), 1);
97 97
 		// header
98
-		add_action('wp_head', array( $this, 'header_meta_tag' ), 5 );
99
-		add_filter( 'template_include', array( $this, 'template_include' ), 1 );
98
+		add_action('wp_head', array($this, 'header_meta_tag'), 5);
99
+		add_filter('template_include', array($this, 'template_include'), 1);
100 100
 		// display errors
101
-		add_action('loop_start', array( $this, 'display_errors' ), 2 );
101
+		add_action('loop_start', array($this, 'display_errors'), 2);
102 102
 		// the content
103
-		add_filter( 'the_content', array( $this, 'the_content' ), 5, 1 );
103
+		add_filter('the_content', array($this, 'the_content'), 5, 1);
104 104
 		//exclude our private cpt comments
105
-		add_filter( 'comments_clauses', array( $this, 'filter_wp_comments'), 10, 1 );
105
+		add_filter('comments_clauses', array($this, 'filter_wp_comments'), 10, 1);
106 106
 		//make sure any ajax requests will respect the url schema when requests are made against admin-ajax.php (http:// or https://)
107
-		add_filter( 'admin_url', array( $this, 'maybe_force_admin_ajax_ssl' ), 200, 1 );
107
+		add_filter('admin_url', array($this, 'maybe_force_admin_ajax_ssl'), 200, 1);
108 108
 		// action hook EE
109
-		do_action( 'AHEE__EE_Front_Controller__construct__done',$this );
109
+		do_action('AHEE__EE_Front_Controller__construct__done', $this);
110 110
 		// for checking that browser cookies are enabled
111
-		if ( apply_filters( 'FHEE__EE_Front_Controller____construct__set_test_cookie', true )) {
112
-			setcookie( 'ee_cookie_test', uniqid(), time() + 24 * HOUR_IN_SECONDS, '/' );
111
+		if (apply_filters('FHEE__EE_Front_Controller____construct__set_test_cookie', true)) {
112
+			setcookie('ee_cookie_test', uniqid(), time() + 24 * HOUR_IN_SECONDS, '/');
113 113
 		}
114 114
 	}
115 115
 
@@ -129,8 +129,8 @@  discard block
 block discarded – undo
129 129
 	 * 	@return void
130 130
 	 */
131 131
 	public function load_espresso_template_tags() {
132
-		if ( is_readable( EE_PUBLIC . 'template_tags.php' )) {
133
-			require_once( EE_PUBLIC . 'template_tags.php' );
132
+		if (is_readable(EE_PUBLIC.'template_tags.php')) {
133
+			require_once(EE_PUBLIC.'template_tags.php');
134 134
 		}
135 135
 	}
136 136
 
@@ -145,12 +145,12 @@  discard block
 block discarded – undo
145 145
 	 * @param  array $clauses array of comment clauses setup by WP_Comment_Query
146 146
 	 * @return array array of comment clauses with modifications.
147 147
 	 */
148
-	public function filter_wp_comments( $clauses ) {
148
+	public function filter_wp_comments($clauses) {
149 149
 		global $wpdb;
150
-		if ( strpos( $clauses['join'], $wpdb->posts ) !== FALSE ) {
150
+		if (strpos($clauses['join'], $wpdb->posts) !== FALSE) {
151 151
 			$cpts = EE_Register_CPTs::get_private_CPTs();
152
-			foreach ( $cpts as $cpt => $details ) {
153
-				$clauses['where'] .= $wpdb->prepare( " AND $wpdb->posts.post_type != %s", $cpt );
152
+			foreach ($cpts as $cpt => $details) {
153
+				$clauses['where'] .= $wpdb->prepare(" AND $wpdb->posts.post_type != %s", $cpt);
154 154
 			}
155 155
 		}
156 156
 		return $clauses;
@@ -167,8 +167,8 @@  discard block
 block discarded – undo
167 167
 	 *  @return 	void
168 168
 	 */
169 169
 	public function employ_CPT_Strategy() {
170
-		if ( apply_filters( 'FHEE__EE_Front_Controller__employ_CPT_Strategy',true) ){
171
-			EE_Registry::instance()->load_core( 'CPT_Strategy' );
170
+		if (apply_filters('FHEE__EE_Front_Controller__employ_CPT_Strategy', true)) {
171
+			EE_Registry::instance()->load_core('CPT_Strategy');
172 172
 		}
173 173
 	}
174 174
 
@@ -180,9 +180,9 @@  discard block
 block discarded – undo
180 180
 	 * @param  string $url    incoming url
181 181
 	 * @return string         final assembled url
182 182
 	 */
183
-	public function maybe_force_admin_ajax_ssl( $url ) {
184
-		if ( is_ssl() && preg_match( '/admin-ajax.php/', $url )) {
185
-			$url = str_replace( 'http://', 'https://', $url );
183
+	public function maybe_force_admin_ajax_ssl($url) {
184
+		if (is_ssl() && preg_match('/admin-ajax.php/', $url)) {
185
+			$url = str_replace('http://', 'https://', $url);
186 186
 		}
187 187
 		return $url;
188 188
 	}
@@ -219,12 +219,12 @@  discard block
 block discarded – undo
219 219
 	 * @param WP $WP
220 220
 	 * @return void
221 221
 	 */
222
-	public function get_request( WP $WP ) {
223
-		do_action( 'AHEE__EE_Front_Controller__get_request__start' );
222
+	public function get_request(WP $WP) {
223
+		do_action('AHEE__EE_Front_Controller__get_request__start');
224 224
 		/** @var EE_Request_Handler $Request_Handler */
225
-		$Request_Handler = EE_Registry::instance()->load_core( 'Request_Handler' );
226
-		$Request_Handler->parse_request( $WP );
227
-		do_action( 'AHEE__EE_Front_Controller__get_request__complete' );
225
+		$Request_Handler = EE_Registry::instance()->load_core('Request_Handler');
226
+		$Request_Handler->parse_request($WP);
227
+		do_action('AHEE__EE_Front_Controller__get_request__complete');
228 228
 	}
229 229
 
230 230
 
@@ -236,22 +236,22 @@  discard block
 block discarded – undo
236 236
 	 * @param WP $WP
237 237
 	 * @return    void
238 238
 	 */
239
-	public function _initialize_shortcodes( WP $WP ) {
240
-		do_action( 'AHEE__EE_Front_Controller__initialize_shortcodes__begin', $WP, $this );
239
+	public function _initialize_shortcodes(WP $WP) {
240
+		do_action('AHEE__EE_Front_Controller__initialize_shortcodes__begin', $WP, $this);
241 241
 		// grab post_name from request
242
-		$current_post = apply_filters( 'FHEE__EE_Front_Controller__initialize_shortcodes__current_post_name', EE_Registry::instance()->REQ->get( 'post_name' ));
242
+		$current_post = apply_filters('FHEE__EE_Front_Controller__initialize_shortcodes__current_post_name', EE_Registry::instance()->REQ->get('post_name'));
243 243
 		// if it's not set, then check if frontpage is blog
244
-		if ( empty( $current_post ) && get_option( 'show_on_front' ) == 'posts' ) {
244
+		if (empty($current_post) && get_option('show_on_front') == 'posts') {
245 245
 			// yup.. this is the posts page, prepare to load all shortcode modules
246 246
 			$current_post = 'posts';
247
-		} else if ( empty( $current_post ) && get_option( 'show_on_front' ) == 'page' ) {
247
+		} else if (empty($current_post) && get_option('show_on_front') == 'page') {
248 248
 			// some other page is set as the homepage
249
-			$page_on_front = get_option( 'page_on_front' );
250
-			if ( $page_on_front ) {
249
+			$page_on_front = get_option('page_on_front');
250
+			if ($page_on_front) {
251 251
 				// k now we need to find the post_name for this page
252 252
 				global $wpdb;
253 253
 				$SQL = "SELECT post_name from $wpdb->posts WHERE post_type='page' AND post_status='publish' AND ID=%d";
254
-				$page_on_front = $wpdb->get_var( $wpdb->prepare( $SQL, $page_on_front ));
254
+				$page_on_front = $wpdb->get_var($wpdb->prepare($SQL, $page_on_front));
255 255
 				// set the current post slug to what it actually is
256 256
 				$current_post = $page_on_front ? $page_on_front : $current_post;
257 257
 			}
@@ -259,58 +259,58 @@  discard block
 block discarded – undo
259 259
 		// where are posts being displayed ?
260 260
 		$page_for_posts = EE_Config::get_page_for_posts();
261 261
 		// in case $current_post is hierarchical like: /parent-page/current-page
262
-		$current_post = basename( $current_post );
262
+		$current_post = basename($current_post);
263 263
 		// are we on a category page?
264
-		$term_exists = is_array( term_exists( $current_post, 'category' )) || array_key_exists( 'category_name', $WP->query_vars );
264
+		$term_exists = is_array(term_exists($current_post, 'category')) || array_key_exists('category_name', $WP->query_vars);
265 265
 		// make sure shortcodes are set
266
-		if ( isset( EE_Registry::instance()->CFG->core->post_shortcodes )) {
266
+		if (isset(EE_Registry::instance()->CFG->core->post_shortcodes)) {
267 267
 			// d( EE_Registry::instance()->CFG->core->post_shortcodes );
268 268
 			// cycle thru all posts with shortcodes set
269
-			foreach ( EE_Registry::instance()->CFG->core->post_shortcodes as $post_name => $post_shortcodes ) {
269
+			foreach (EE_Registry::instance()->CFG->core->post_shortcodes as $post_name => $post_shortcodes) {
270 270
 				// filter shortcodes so
271
-				$post_shortcodes = apply_filters( 'FHEE__Front_Controller__initialize_shortcodes__post_shortcodes', $post_shortcodes );
271
+				$post_shortcodes = apply_filters('FHEE__Front_Controller__initialize_shortcodes__post_shortcodes', $post_shortcodes);
272 272
 				// now cycle thru shortcodes
273
-				foreach ( $post_shortcodes as $shortcode_class => $post_id ) {
273
+				foreach ($post_shortcodes as $shortcode_class => $post_id) {
274 274
 					// are we on this page, or on the blog page, or an EE CPT category page ?
275
-					if ( $current_post == $post_name || $term_exists ) {
275
+					if ($current_post == $post_name || $term_exists) {
276 276
 						// verify shortcode is in list of registered shortcodes
277
-						if ( ! isset( EE_Registry::instance()->shortcodes->{$shortcode_class} )) {
278
-							if ( $current_post != $page_for_posts && current_user_can( 'edit_post', $post_id )) {
279
-								$msg = sprintf( __( 'The [%s] shortcode has not been properly registered or the corresponding addon/module is not active for some reason. Either fix/remove the shortcode from the post, or activate the addon/module the shortcode is associated with.', 'event_espresso' ), $shortcode_class );
280
-								EE_Error::add_error( $msg, __FILE__, __FUNCTION__, __LINE__ );
281
-								add_filter( 'FHEE_run_EE_the_content', '__return_true' );
277
+						if ( ! isset(EE_Registry::instance()->shortcodes->{$shortcode_class} )) {
278
+							if ($current_post != $page_for_posts && current_user_can('edit_post', $post_id)) {
279
+								$msg = sprintf(__('The [%s] shortcode has not been properly registered or the corresponding addon/module is not active for some reason. Either fix/remove the shortcode from the post, or activate the addon/module the shortcode is associated with.', 'event_espresso'), $shortcode_class);
280
+								EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
281
+								add_filter('FHEE_run_EE_the_content', '__return_true');
282 282
 							}
283
-							add_shortcode( $shortcode_class, array( 'EES_Shortcode', 'invalid_shortcode_processor' ));
283
+							add_shortcode($shortcode_class, array('EES_Shortcode', 'invalid_shortcode_processor'));
284 284
 							continue;
285 285
 						}
286 286
 						// is this : a shortcodes set exclusively for this post, or for the home page, or a category, or a taxonomy ?
287
-						if ( isset( EE_Registry::instance()->CFG->core->post_shortcodes[ $current_post ] ) || $term_exists || $current_post == $page_for_posts ) {
287
+						if (isset(EE_Registry::instance()->CFG->core->post_shortcodes[$current_post]) || $term_exists || $current_post == $page_for_posts) {
288 288
 							// let's pause to reflect on this...
289
-							$sc_reflector = new ReflectionClass( 'EES_' . $shortcode_class );
289
+							$sc_reflector = new ReflectionClass('EES_'.$shortcode_class);
290 290
 							// ensure that class is actually a shortcode
291
-							if ( ! $sc_reflector->isSubclassOf( 'EES_Shortcode' ) && defined( 'WP_DEBUG' ) && WP_DEBUG === TRUE ) {
292
-								$msg = sprintf( __( 'The requested %s shortcode is not of the class "EES_Shortcode". Please check your files.', 'event_espresso' ), $shortcode_class );
293
-								EE_Error::add_error( $msg, __FILE__, __FUNCTION__, __LINE__ );
294
-								add_filter( 'FHEE_run_EE_the_content', '__return_true' );
291
+							if ( ! $sc_reflector->isSubclassOf('EES_Shortcode') && defined('WP_DEBUG') && WP_DEBUG === TRUE) {
292
+								$msg = sprintf(__('The requested %s shortcode is not of the class "EES_Shortcode". Please check your files.', 'event_espresso'), $shortcode_class);
293
+								EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
294
+								add_filter('FHEE_run_EE_the_content', '__return_true');
295 295
 								continue;
296 296
 							}
297 297
 							// and pass the request object to the run method
298 298
 							EE_Registry::instance()->shortcodes->{$shortcode_class} = $sc_reflector->newInstance();
299 299
 							// fire the shortcode class's run method, so that it can activate resources
300
-							EE_Registry::instance()->shortcodes->{$shortcode_class}->run( $WP );
300
+							EE_Registry::instance()->shortcodes->{$shortcode_class}->run($WP);
301 301
 						}
302 302
 					// if this is NOT the "Posts page" and we have a valid entry for the "Posts page" in our tracked post_shortcodes array
303
-					} else if ( $post_name != $page_for_posts && isset( EE_Registry::instance()->CFG->core->post_shortcodes[ $page_for_posts ] )) {
303
+					} else if ($post_name != $page_for_posts && isset(EE_Registry::instance()->CFG->core->post_shortcodes[$page_for_posts])) {
304 304
 						// and the shortcode is not being tracked for this page
305
-						if ( ! isset( EE_Registry::instance()->CFG->core->post_shortcodes[ $page_for_posts ][ $shortcode_class ] )) {
305
+						if ( ! isset(EE_Registry::instance()->CFG->core->post_shortcodes[$page_for_posts][$shortcode_class])) {
306 306
 							// then remove the "fallback" shortcode processor
307
-							remove_shortcode( $shortcode_class );
307
+							remove_shortcode($shortcode_class);
308 308
 						}
309 309
 					}
310 310
 				}
311 311
 			}
312 312
 		}
313
-		do_action( 'AHEE__EE_Front_Controller__initialize_shortcodes__end', $this );
313
+		do_action('AHEE__EE_Front_Controller__initialize_shortcodes__end', $this);
314 314
 	}
315 315
 
316 316
 
@@ -322,20 +322,20 @@  discard block
 block discarded – undo
322 322
 	 * @param   WP_Query    $WP_Query
323 323
 	 * @return    void
324 324
 	 */
325
-	public function pre_get_posts( $WP_Query ) {
325
+	public function pre_get_posts($WP_Query) {
326 326
 		// only load Module_Request_Router if this is the main query
327
-		if ( $WP_Query->is_main_query() ) {
327
+		if ($WP_Query->is_main_query()) {
328 328
 			// load module request router
329
-			$Module_Request_Router = EE_Registry::instance()->load_core( 'Module_Request_Router' );
329
+			$Module_Request_Router = EE_Registry::instance()->load_core('Module_Request_Router');
330 330
 			// verify object
331
-			if ( $Module_Request_Router instanceof EE_Module_Request_Router ) {
331
+			if ($Module_Request_Router instanceof EE_Module_Request_Router) {
332 332
 				// cycle thru module routes
333
-				while ( $route = $Module_Request_Router->get_route( $WP_Query )) {
333
+				while ($route = $Module_Request_Router->get_route($WP_Query)) {
334 334
 					// determine module and method for route
335
-					$module = $Module_Request_Router->resolve_route( $route[0], $route[1] );
336
-					if( $module instanceof EED_Module ) {
335
+					$module = $Module_Request_Router->resolve_route($route[0], $route[1]);
336
+					if ($module instanceof EED_Module) {
337 337
 						// get registered view for route
338
-						$this->_template_path = $Module_Request_Router->get_view( $route );
338
+						$this->_template_path = $Module_Request_Router->get_view($route);
339 339
 						// grab module name
340 340
 						$module_name = $module->module_name();
341 341
 						// map the module to the module objects
@@ -362,7 +362,7 @@  discard block
 block discarded – undo
362 362
 	 *  @return 	void
363 363
 	 */
364 364
 	public function wp() {
365
-		EE_Registry::instance()->load_helper( 'Template' );
365
+		EE_Registry::instance()->load_helper('Template');
366 366
 	}
367 367
 
368 368
 
@@ -380,30 +380,30 @@  discard block
 block discarded – undo
380 380
 	public function wp_enqueue_scripts() {
381 381
 
382 382
 		// css is turned ON by default, but prior to the wp_enqueue_scripts hook, can be turned OFF  via:  add_filter( 'FHEE_load_css', '__return_false' );
383
-		if ( apply_filters( 'FHEE_load_css', TRUE ) ) {
383
+		if (apply_filters('FHEE_load_css', TRUE)) {
384 384
 
385 385
 			EE_Registry::instance()->CFG->template_settings->enable_default_style = TRUE;
386 386
 			//Load the ThemeRoller styles if enabled
387
-			if ( isset( EE_Registry::instance()->CFG->template_settings->enable_default_style ) && EE_Registry::instance()->CFG->template_settings->enable_default_style ) {
387
+			if (isset(EE_Registry::instance()->CFG->template_settings->enable_default_style) && EE_Registry::instance()->CFG->template_settings->enable_default_style) {
388 388
 
389 389
 				//Load custom style sheet if available
390
-				if ( isset( EE_Registry::instance()->CFG->template_settings->custom_style_sheet )) {
391
-					wp_register_style('espresso_custom_css', EVENT_ESPRESSO_UPLOAD_URL . 'css/' . EE_Registry::instance()->CFG->template_settings->custom_style_sheet, EVENT_ESPRESSO_VERSION );
390
+				if (isset(EE_Registry::instance()->CFG->template_settings->custom_style_sheet)) {
391
+					wp_register_style('espresso_custom_css', EVENT_ESPRESSO_UPLOAD_URL.'css/'.EE_Registry::instance()->CFG->template_settings->custom_style_sheet, EVENT_ESPRESSO_VERSION);
392 392
 					wp_enqueue_style('espresso_custom_css');
393 393
 				}
394 394
 
395
-				EE_Registry::instance()->load_helper( 'File' );
396
-				if ( is_readable( EVENT_ESPRESSO_UPLOAD_DIR . 'css/style.css' )) {
397
-					wp_register_style( 'espresso_default', EVENT_ESPRESSO_UPLOAD_DIR . 'css/espresso_default.css', array( 'dashicons' ), EVENT_ESPRESSO_VERSION );
395
+				EE_Registry::instance()->load_helper('File');
396
+				if (is_readable(EVENT_ESPRESSO_UPLOAD_DIR.'css/style.css')) {
397
+					wp_register_style('espresso_default', EVENT_ESPRESSO_UPLOAD_DIR.'css/espresso_default.css', array('dashicons'), EVENT_ESPRESSO_VERSION);
398 398
 				} else {
399
-					wp_register_style( 'espresso_default', EE_GLOBAL_ASSETS_URL . 'css/espresso_default.css', array( 'dashicons' ), EVENT_ESPRESSO_VERSION );
399
+					wp_register_style('espresso_default', EE_GLOBAL_ASSETS_URL.'css/espresso_default.css', array('dashicons'), EVENT_ESPRESSO_VERSION);
400 400
 				}
401 401
 				wp_enqueue_style('espresso_default');
402 402
 
403
-				if ( is_readable( get_stylesheet_directory() . EE_Config::get_current_theme() . DS . 'style.css' )) {
404
-					wp_register_style( 'espresso_style', get_stylesheet_directory_uri() . EE_Config::get_current_theme() . DS . 'style.css', array( 'dashicons', 'espresso_default' ) );
403
+				if (is_readable(get_stylesheet_directory().EE_Config::get_current_theme().DS.'style.css')) {
404
+					wp_register_style('espresso_style', get_stylesheet_directory_uri().EE_Config::get_current_theme().DS.'style.css', array('dashicons', 'espresso_default'));
405 405
 				} else {
406
-					wp_register_style( 'espresso_style', EE_TEMPLATES_URL . EE_Config::get_current_theme() . DS . 'style.css', array( 'dashicons', 'espresso_default' ) );
406
+					wp_register_style('espresso_style', EE_TEMPLATES_URL.EE_Config::get_current_theme().DS.'style.css', array('dashicons', 'espresso_default'));
407 407
 				}
408 408
 
409 409
 			}
@@ -411,29 +411,29 @@  discard block
 block discarded – undo
411 411
 		}
412 412
 
413 413
 		// js is turned ON by default, but prior to the wp_enqueue_scripts hook, can be turned OFF  via:  add_filter( 'FHEE_load_js', '__return_false' );
414
-		if ( apply_filters( 'FHEE_load_js', TRUE ) ) {
414
+		if (apply_filters('FHEE_load_js', TRUE)) {
415 415
 
416
-			wp_enqueue_script( 'jquery' );
416
+			wp_enqueue_script('jquery');
417 417
 			//let's make sure that all required scripts have been setup
418
-			if ( function_exists( 'wp_script_is' )) {
419
-				if ( ! wp_script_is( 'jquery' )) {
418
+			if (function_exists('wp_script_is')) {
419
+				if ( ! wp_script_is('jquery')) {
420 420
 					$msg = sprintf(
421
-						__( '%sJquery is not loaded!%sEvent Espresso is unable to load Jquery due to a conflict with your theme or another plugin.', 'event_espresso' ),
421
+						__('%sJquery is not loaded!%sEvent Espresso is unable to load Jquery due to a conflict with your theme or another plugin.', 'event_espresso'),
422 422
 						'<em><br />',
423 423
 						'</em>'
424 424
 					);
425
-					EE_Error::add_error( $msg, __FILE__, __FUNCTION__, __LINE__ );
425
+					EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
426 426
 				}
427 427
 			}
428 428
 			// load core js
429
-			wp_register_script( 'espresso_core', EE_GLOBAL_ASSETS_URL . 'scripts/espresso_core.js', array('jquery'), EVENT_ESPRESSO_VERSION, TRUE );
430
-			wp_enqueue_script( 'espresso_core' );
431
-			wp_localize_script( 'espresso_core', 'eei18n', EE_Registry::$i18n_js_strings );
429
+			wp_register_script('espresso_core', EE_GLOBAL_ASSETS_URL.'scripts/espresso_core.js', array('jquery'), EVENT_ESPRESSO_VERSION, TRUE);
430
+			wp_enqueue_script('espresso_core');
431
+			wp_localize_script('espresso_core', 'eei18n', EE_Registry::$i18n_js_strings);
432 432
 
433 433
 		}
434 434
 
435 435
 		//qtip is turned OFF by default, but prior to the wp_enqueue_scripts hook, can be turned back on again via: add_filter('FHEE_load_qtip', '__return_true' );
436
-		if ( apply_filters( 'FHEE_load_qtip', FALSE ) ) {
436
+		if (apply_filters('FHEE_load_qtip', FALSE)) {
437 437
 			EE_Registry::instance()->load_helper('Qtip_Loader');
438 438
 			EEH_Qtip_Loader::instance()->register_and_enqueue();
439 439
 		}
@@ -441,11 +441,11 @@  discard block
 block discarded – undo
441 441
 
442 442
 		//accounting.js library
443 443
 		// @link http://josscrowcroft.github.io/accounting.js/
444
-		if ( apply_filters( 'FHEE_load_accounting_js', FALSE ) ) {
445
-			$acct_js = EE_THIRD_PARTY_URL . 'accounting/accounting.js';
446
-			wp_register_script( 'ee-accounting', EE_GLOBAL_ASSETS_URL . 'scripts/ee-accounting-config.js', array('ee-accounting-core'), EVENT_ESPRESSO_VERSION, TRUE );
447
-			wp_register_script( 'ee-accounting-core', $acct_js, array('underscore'), '0.3.2', TRUE );
448
-			wp_enqueue_script( 'ee-accounting' );
444
+		if (apply_filters('FHEE_load_accounting_js', FALSE)) {
445
+			$acct_js = EE_THIRD_PARTY_URL.'accounting/accounting.js';
446
+			wp_register_script('ee-accounting', EE_GLOBAL_ASSETS_URL.'scripts/ee-accounting-config.js', array('ee-accounting-core'), EVENT_ESPRESSO_VERSION, TRUE);
447
+			wp_register_script('ee-accounting-core', $acct_js, array('underscore'), '0.3.2', TRUE);
448
+			wp_enqueue_script('ee-accounting');
449 449
 
450 450
 			$currency_config = array(
451 451
 				'currency' => array(
@@ -468,21 +468,21 @@  discard block
 block discarded – undo
468 468
 			wp_localize_script('ee-accounting', 'EE_ACCOUNTING_CFG', $currency_config);
469 469
 		}
470 470
 
471
-		if ( ! function_exists( 'wp_head' )) {
471
+		if ( ! function_exists('wp_head')) {
472 472
 			$msg = sprintf(
473
-				__( '%sMissing wp_head() function.%sThe WordPress function wp_head() seems to be missing in your theme. Please contact the theme developer to make sure this is fixed before using Event Espresso.', 'event_espresso' ),
473
+				__('%sMissing wp_head() function.%sThe WordPress function wp_head() seems to be missing in your theme. Please contact the theme developer to make sure this is fixed before using Event Espresso.', 'event_espresso'),
474 474
 				'<em><br />',
475 475
 				'</em>'
476 476
 			);
477
-			EE_Error::add_error( $msg, __FILE__, __FUNCTION__, __LINE__ );
477
+			EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
478 478
 		}
479
-		if ( ! function_exists( 'wp_footer' )) {
479
+		if ( ! function_exists('wp_footer')) {
480 480
 			$msg = sprintf(
481
-				__( '%sMissing wp_footer() function.%sThe WordPress function wp_footer() seems to be missing in your theme. Please contact the theme developer to make sure this is fixed before using Event Espresso.', 'event_espresso' ),
481
+				__('%sMissing wp_footer() function.%sThe WordPress function wp_footer() seems to be missing in your theme. Please contact the theme developer to make sure this is fixed before using Event Espresso.', 'event_espresso'),
482 482
 				'<em><br />',
483 483
 				'</em>'
484 484
 			);
485
-			EE_Error::add_error( $msg, __FILE__, __FUNCTION__, __LINE__ );
485
+			EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
486 486
 		}
487 487
 
488 488
 	}
@@ -496,7 +496,7 @@  discard block
 block discarded – undo
496 496
 	 *  @return 	void
497 497
 	 */
498 498
 	public function header_meta_tag() {
499
-		print( apply_filters("FHEE__EE_Front_Controller__header_meta_tag","<meta name='generator' content='Event Espresso Version " . EVENT_ESPRESSO_VERSION . "' />"));
499
+		print(apply_filters("FHEE__EE_Front_Controller__header_meta_tag", "<meta name='generator' content='Event Espresso Version ".EVENT_ESPRESSO_VERSION."' />"));
500 500
 	}
501 501
 
502 502
 
@@ -510,9 +510,9 @@  discard block
 block discarded – undo
510 510
 	 * @param   $the_content
511 511
 	 * @return    string
512 512
 	 */
513
-	public function the_content( $the_content ) {
513
+	public function the_content($the_content) {
514 514
 		// nothing gets loaded at this point unless other systems turn this hookpoint on by using:  add_filter( 'FHEE_run_EE_the_content', '__return_true' );
515
-		if ( apply_filters( 'FHEE_run_EE_the_content', FALSE ) ) {
515
+		if (apply_filters('FHEE_run_EE_the_content', FALSE)) {
516 516
 		}
517 517
 		return $the_content;
518 518
 	}
@@ -537,9 +537,9 @@  discard block
 block discarded – undo
537 537
 	 */
538 538
 	public function display_errors() {
539 539
 		static $shown_already = FALSE;
540
-		do_action( 'AHEE__EE_Front_Controller__display_errors__begin' );
540
+		do_action('AHEE__EE_Front_Controller__display_errors__begin');
541 541
 		if (
542
-			apply_filters( 'FHEE__EE_Front_Controller__display_errors', TRUE )
542
+			apply_filters('FHEE__EE_Front_Controller__display_errors', TRUE)
543 543
 			&& ! $shown_already
544 544
 			&& is_main_query()
545 545
 			&& ! is_feed()
@@ -548,10 +548,10 @@  discard block
 block discarded – undo
548 548
 		) {
549 549
 			echo EE_Error::get_notices();
550 550
 			$shown_already = TRUE;
551
-			EE_Registry::instance()->load_helper( 'Template' );
552
-			EEH_Template::display_template( EE_TEMPLATES . 'espresso-ajax-notices.template.php' );
551
+			EE_Registry::instance()->load_helper('Template');
552
+			EEH_Template::display_template(EE_TEMPLATES.'espresso-ajax-notices.template.php');
553 553
 		}
554
-		do_action( 'AHEE__EE_Front_Controller__display_errors__end' );
554
+		do_action('AHEE__EE_Front_Controller__display_errors__end');
555 555
 	}
556 556
 
557 557
 
@@ -566,12 +566,12 @@  discard block
 block discarded – undo
566 566
 	 * @param   string $template_include_path
567 567
 	 * @return    string
568 568
 	 */
569
-	public function template_include( $template_include_path = NULL ) {
570
-		if ( EE_Registry::instance()->REQ->is_espresso_page() ) {
571
-			$this->_template_path = ! empty( $this->_template_path ) ? basename( $this->_template_path ) : basename( $template_include_path );
572
-			$template_path = EEH_Template::locate_template( $this->_template_path, array(), false );
573
-			$this->_template_path = ! empty( $template_path ) ? $template_path : $template_include_path;
574
-			$this->_template = basename( $this->_template_path );
569
+	public function template_include($template_include_path = NULL) {
570
+		if (EE_Registry::instance()->REQ->is_espresso_page()) {
571
+			$this->_template_path = ! empty($this->_template_path) ? basename($this->_template_path) : basename($template_include_path);
572
+			$template_path = EEH_Template::locate_template($this->_template_path, array(), false);
573
+			$this->_template_path = ! empty($template_path) ? $template_path : $template_include_path;
574
+			$this->_template = basename($this->_template_path);
575 575
 			return $this->_template_path;
576 576
 		}
577 577
 		return $template_include_path;
@@ -586,7 +586,7 @@  discard block
 block discarded – undo
586 586
 	 * @param bool $with_path
587 587
 	 * @return    string
588 588
 	 */
589
-	public function get_selected_template( $with_path = FALSE ) {
589
+	public function get_selected_template($with_path = FALSE) {
590 590
 		return $with_path ? $this->_template_path : $this->_template;
591 591
 	}
592 592
 
Please login to merge, or discard this patch.
core/EE_Load_Espresso_Core.core.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
 	 * @param 	EE_Response $response
51 51
 	 * @return 	EE_Response
52 52
 	 */
53
-	public function handle_request( EE_Request $request, EE_Response $response ) {
53
+	public function handle_request(EE_Request $request, EE_Response $response) {
54 54
 		$this->request = $request;
55 55
 		$this->response = $response;
56 56
 		// central repository for classes
@@ -58,15 +58,15 @@  discard block
 block discarded – undo
58 58
 		// workarounds for PHP < 5.3
59 59
 		$this->_load_class_tools();
60 60
 		// PSR4 Autoloaders
61
-		EE_Registry::instance()->load_core( 'EE_Psr4AutoloaderInit' );
61
+		EE_Registry::instance()->load_core('EE_Psr4AutoloaderInit');
62 62
 		// deprecated functions
63
-		espresso_load_required( 'EE_Deprecated', EE_CORE . 'EE_Deprecated.core.php' );
63
+		espresso_load_required('EE_Deprecated', EE_CORE.'EE_Deprecated.core.php');
64 64
 		// load interfaces
65
-		espresso_load_required( 'EEI_Payment_Method_Interfaces', EE_LIBRARIES . 'payment_methods' . DS . 'EEI_Payment_Method_Interfaces.php' );
65
+		espresso_load_required('EEI_Payment_Method_Interfaces', EE_LIBRARIES.'payment_methods'.DS.'EEI_Payment_Method_Interfaces.php');
66 66
 		//// WP cron jobs
67
-		EE_Registry::instance()->load_core( 'Cron_Tasks' );
68
-		EE_Registry::instance()->load_core( 'Request_Handler' );
69
-		EE_Registry::instance()->load_core( 'EE_System' );
67
+		EE_Registry::instance()->load_core('Cron_Tasks');
68
+		EE_Registry::instance()->load_core('Request_Handler');
69
+		EE_Registry::instance()->load_core('EE_System');
70 70
 
71 71
 		return $this->response;
72 72
 	}
@@ -80,12 +80,12 @@  discard block
 block discarded – undo
80 80
 	 * 	@return void
81 81
 	 */
82 82
 	private function _load_registry() {
83
-		if ( is_readable( EE_CORE . 'EE_Registry.core.php' )) {
84
-			require_once( EE_CORE . 'EE_Registry.core.php' );
83
+		if (is_readable(EE_CORE.'EE_Registry.core.php')) {
84
+			require_once(EE_CORE.'EE_Registry.core.php');
85 85
 		} else {
86
-			$msg = __( 'The EE_Registry core class could not be loaded.', 'event_espresso' );
87
-			EE_Error::add_error( $msg, __FILE__, __FUNCTION__, __LINE__ );
88
-			wp_die( EE_Error::get_notices() );
86
+			$msg = __('The EE_Registry core class could not be loaded.', 'event_espresso');
87
+			EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
88
+			wp_die(EE_Error::get_notices());
89 89
 		}
90 90
 	}
91 91
 
@@ -97,11 +97,11 @@  discard block
 block discarded – undo
97 97
 	 * 	@return void
98 98
 	 */
99 99
 	private function _load_class_tools() {
100
-		if ( is_readable( EE_HELPERS . 'EEH_Class_Tools.helper.php' )) {
101
-			require_once( EE_HELPERS . 'EEH_Class_Tools.helper.php' );
100
+		if (is_readable(EE_HELPERS.'EEH_Class_Tools.helper.php')) {
101
+			require_once(EE_HELPERS.'EEH_Class_Tools.helper.php');
102 102
 		} else {
103
-			$msg = __( 'The EEH_Class_Tools helper could not be loaded.', 'event_espresso' );
104
-			EE_Error::add_error( $msg, __FILE__, __FUNCTION__, __LINE__ );
103
+			$msg = __('The EEH_Class_Tools helper could not be loaded.', 'event_espresso');
104
+			EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
105 105
 		}
106 106
 	}
107 107
 
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
 	 * @param \EE_Request $request
117 117
 	 * @param \EE_Response $response
118 118
 	 */
119
-	public function handle_response( EE_Request $request, EE_Response $response ) {
119
+	public function handle_response(EE_Request $request, EE_Response $response) {
120 120
 		//EEH_Debug_Tools::printr( $request, '$request', __FILE__, __LINE__ );
121 121
 		//EEH_Debug_Tools::printr( $response, '$response', __FILE__, __LINE__ );
122 122
 		//die();
Please login to merge, or discard this patch.
core/business/EE_Transaction_Payments.class.php 1 patch
Spacing   +56 added lines, -56 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php if ( ! defined('EVENT_ESPRESSO_VERSION')) { exit('No direct script access allowed'); }
2
-EE_Registry::instance()->load_class( 'Processor_Base' );
2
+EE_Registry::instance()->load_class('Processor_Base');
3 3
 
4 4
 /**
5 5
  * Class EE_Transaction_Payments
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
 	 */
45 45
 	public static function instance() {
46 46
 		// check if class object is instantiated
47
-		if ( ! self::$_instance instanceof EE_Transaction_Payments ) {
47
+		if ( ! self::$_instance instanceof EE_Transaction_Payments) {
48 48
 			self::$_instance = new self();
49 49
 		}
50 50
 		return self::$_instance;
@@ -72,9 +72,9 @@  discard block
 block discarded – undo
72 72
 	/**
73 73
 	 * @param string $old_txn_status
74 74
 	 */
75
-	public function set_old_txn_status( $old_txn_status ) {
75
+	public function set_old_txn_status($old_txn_status) {
76 76
 		// only set the first time
77
-		if ( $this->_old_txn_status === null ) {
77
+		if ($this->_old_txn_status === null) {
78 78
 			$this->_old_txn_status = $old_txn_status;
79 79
 		}
80 80
 	}
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
 	/**
94 94
 	 * @param string $new_txn_status
95 95
 	 */
96
-	public function set_new_txn_status( $new_txn_status ) {
96
+	public function set_new_txn_status($new_txn_status) {
97 97
 		$this->_new_txn_status = $new_txn_status;
98 98
 	}
99 99
 
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
 	 * @return bool
106 106
 	 */
107 107
 	public function txn_status_updated() {
108
-		return $this->_new_txn_status !== $this->_old_txn_status && $this->_old_txn_status !== null  ? true : false;
108
+		return $this->_new_txn_status !== $this->_old_txn_status && $this->_old_txn_status !== null ? true : false;
109 109
 	}
110 110
 
111 111
 
@@ -124,22 +124,22 @@  discard block
 block discarded – undo
124 124
 	 * @param 	boolean $update_txn  	whether to save the TXN
125 125
 	 * @return 	boolean 	 	whether the TXN was saved
126 126
 	 */
127
-	public function calculate_total_payments_and_update_status( EE_Transaction $transaction, $update_txn = true ){
127
+	public function calculate_total_payments_and_update_status(EE_Transaction $transaction, $update_txn = true) {
128 128
 		// verify transaction
129
-		if ( ! $transaction instanceof EE_Transaction ) {
130
-			EE_Error::add_error( __( 'Please provide a valid EE_Transaction object.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__ );
129
+		if ( ! $transaction instanceof EE_Transaction) {
130
+			EE_Error::add_error(__('Please provide a valid EE_Transaction object.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
131 131
 			return false;
132 132
 		}
133 133
 		// set incoming TXN_Status
134
-		$this->set_old_txn_status( $transaction->status_ID() );
134
+		$this->set_old_txn_status($transaction->status_ID());
135 135
 		// calculate total paid
136
-		$total_paid = $this->recalculate_total_payments_for_transaction( $transaction );
136
+		$total_paid = $this->recalculate_total_payments_for_transaction($transaction);
137 137
 		// if total paid has changed
138
-		if ( $total_paid != $transaction->paid() ) {
139
-			$transaction->set_paid( $total_paid );
138
+		if ($total_paid != $transaction->paid()) {
139
+			$transaction->set_paid($total_paid);
140 140
 			// maybe update status, and make sure to save transaction if not done already
141
-			if ( ! $this->update_transaction_status_based_on_total_paid( $transaction, $update_txn )) {
142
-				if ( $update_txn ) {
141
+			if ( ! $this->update_transaction_status_based_on_total_paid($transaction, $update_txn)) {
142
+				if ($update_txn) {
143 143
 					return $transaction->save() ? true : false;
144 144
 				}
145 145
 			} else {
@@ -160,18 +160,18 @@  discard block
 block discarded – undo
160 160
 	 *		@param	string $payment_status, one of EEM_Payment's statuses, like 'PAP' (Approved). By default, searches for approved payments
161 161
 	 *		@return 		mixed		float on success, false on fail
162 162
 	 */
163
-	public function recalculate_total_payments_for_transaction( EE_Transaction $transaction, $payment_status = EEM_Payment::status_id_approved ) {
163
+	public function recalculate_total_payments_for_transaction(EE_Transaction $transaction, $payment_status = EEM_Payment::status_id_approved) {
164 164
 		// verify transaction
165
-		if ( ! $transaction instanceof EE_Transaction ) {
166
-			EE_Error::add_error( __( 'Please provide a valid EE_Transaction object.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__ );
165
+		if ( ! $transaction instanceof EE_Transaction) {
166
+			EE_Error::add_error(__('Please provide a valid EE_Transaction object.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
167 167
 			return false;
168 168
 		}
169 169
 		// ensure Payment model is loaded
170
-		EE_Registry::instance()->load_model( 'Payment' );
170
+		EE_Registry::instance()->load_model('Payment');
171 171
 		// calls EEM_Base::sum()
172 172
 		return EEM_Payment::instance()->sum(
173 173
 			// query params
174
-			array( array( 'TXN_ID' => $transaction->ID(), 'STS_ID' => $payment_status )),
174
+			array(array('TXN_ID' => $transaction->ID(), 'STS_ID' => $payment_status)),
175 175
 			// field to sum
176 176
 			'PAY_amount'
177 177
 		);
@@ -187,37 +187,37 @@  discard block
 block discarded – undo
187 187
 	 * @return 	boolean 	 	whether the TXN was saved
188 188
 	 * @throws \EE_Error
189 189
 	 */
190
-	public function update_transaction_status_based_on_total_paid( EE_Transaction $transaction, $update_txn = TRUE ) {
190
+	public function update_transaction_status_based_on_total_paid(EE_Transaction $transaction, $update_txn = TRUE) {
191 191
 		// verify transaction
192
-		if ( ! $transaction instanceof EE_Transaction ) {
192
+		if ( ! $transaction instanceof EE_Transaction) {
193 193
 			EE_Error::add_error(
194
-				__( 'Please provide a valid EE_Transaction object.', 'event_espresso' ),
194
+				__('Please provide a valid EE_Transaction object.', 'event_espresso'),
195 195
 				__FILE__, __FUNCTION__, __LINE__
196 196
 			);
197 197
 			return FALSE;
198 198
 		}
199
-		EE_Registry::instance()->load_helper( 'Money' );
199
+		EE_Registry::instance()->load_helper('Money');
200 200
 		// set incoming TXN_Status
201
-		$this->set_old_txn_status( $transaction->status_ID() );
201
+		$this->set_old_txn_status($transaction->status_ID());
202 202
 		// set transaction status based on comparison of TXN_paid vs TXN_total
203
-		if ( EEH_Money::compare_floats( $transaction->paid(), $transaction->total(), '>' ) ){
203
+		if (EEH_Money::compare_floats($transaction->paid(), $transaction->total(), '>')) {
204 204
 			$new_txn_status = EEM_Transaction::overpaid_status_code;
205
-		} else if ( EEH_Money::compare_floats( $transaction->paid(), $transaction->total() ) ) {
205
+		} else if (EEH_Money::compare_floats($transaction->paid(), $transaction->total())) {
206 206
 			$new_txn_status = EEM_Transaction::complete_status_code;
207
-		} else if ( EEH_Money::compare_floats( $transaction->paid(), $transaction->total(), '<' ) ) {
207
+		} else if (EEH_Money::compare_floats($transaction->paid(), $transaction->total(), '<')) {
208 208
 			$new_txn_status = EEM_Transaction::incomplete_status_code;
209 209
 		} else {
210 210
 			EE_Error::add_error(
211
-				__( 'The total paid calculation for this transaction is inaccurate.', 'event_espresso' ),
211
+				__('The total paid calculation for this transaction is inaccurate.', 'event_espresso'),
212 212
 				__FILE__, __FUNCTION__, __LINE__
213 213
 			);
214 214
 			return FALSE;
215 215
 		}
216
-		if ( $new_txn_status !== $transaction->status_ID() ) {
216
+		if ($new_txn_status !== $transaction->status_ID()) {
217 217
 			// set incoming TXN_Status
218
-			$this->set_new_txn_status( $new_txn_status );
219
-			$transaction->set_status( $new_txn_status );
220
-			if ( $update_txn ) {
218
+			$this->set_new_txn_status($new_txn_status);
219
+			$transaction->set_status($new_txn_status);
220
+			if ($update_txn) {
221 221
 				return $transaction->save() ? TRUE : FALSE;
222 222
 			}
223 223
 		}
@@ -236,17 +236,17 @@  discard block
 block discarded – undo
236 236
 	 * @param EE_Payment $payment
237 237
 	 * @return boolean
238 238
 	 */
239
-	public function delete_payment_and_update_transaction( EE_Payment $payment ) {
239
+	public function delete_payment_and_update_transaction(EE_Payment $payment) {
240 240
 		// verify payment
241
-		if ( ! $payment instanceof EE_Payment ) {
242
-			EE_Error::add_error( __( 'A valid Payment object was not received.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__ );
241
+		if ( ! $payment instanceof EE_Payment) {
242
+			EE_Error::add_error(__('A valid Payment object was not received.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
243 243
 			return false;
244 244
 		}
245
-		if ( ! $this->delete_registration_payments_and_update_registrations( $payment ) ) {
245
+		if ( ! $this->delete_registration_payments_and_update_registrations($payment)) {
246 246
 			return false;
247 247
 		}
248
-		if ( ! $payment->delete() ) {
249
-			EE_Error::add_error( __( 'The payment could not be deleted.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__ );
248
+		if ( ! $payment->delete()) {
249
+			EE_Error::add_error(__('The payment could not be deleted.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
250 250
 			return false;
251 251
 		}
252 252
 
@@ -257,14 +257,14 @@  discard block
 block discarded – undo
257 257
 			|| $transaction->status_ID() === EEM_Transaction::failed_status_code
258 258
 			|| $payment->amount() === 0
259 259
 		) {
260
-			EE_Error::add_success( __( 'The Payment was successfully deleted.', 'event_espresso' ) );
260
+			EE_Error::add_success(__('The Payment was successfully deleted.', 'event_espresso'));
261 261
 			return true;
262 262
 		}
263 263
 
264 264
 
265 265
 		//if this fails, that just means that the transaction didn't get its status changed and/or updated.
266 266
 		//however the payment was still deleted.
267
-		if ( ! $this->calculate_total_payments_and_update_status( $transaction ) ) {
267
+		if ( ! $this->calculate_total_payments_and_update_status($transaction)) {
268 268
 
269 269
 			EE_Error::add_attention(
270 270
 				__(
@@ -298,28 +298,28 @@  discard block
 block discarded – undo
298 298
 	 * @return bool
299 299
 	 * @throws \EE_Error
300 300
 	 */
301
-	public function delete_registration_payments_and_update_registrations( EE_Payment $payment, $reg_payment_query_params = array() ) {
301
+	public function delete_registration_payments_and_update_registrations(EE_Payment $payment, $reg_payment_query_params = array()) {
302 302
 		$save_payment = false;
303
-		$reg_payment_query_params = ! empty( $reg_payment_query_params ) ? $reg_payment_query_params : array( array( 'PAY_ID' => $payment->ID() ) );
304
-		$registration_payments = EEM_Registration_Payment::instance()->get_all( $reg_payment_query_params );
305
-		if ( ! empty( $registration_payments )) {
306
-			foreach ( $registration_payments as $registration_payment ) {
307
-				if ( $registration_payment instanceof EE_Registration_Payment ) {
303
+		$reg_payment_query_params = ! empty($reg_payment_query_params) ? $reg_payment_query_params : array(array('PAY_ID' => $payment->ID()));
304
+		$registration_payments = EEM_Registration_Payment::instance()->get_all($reg_payment_query_params);
305
+		if ( ! empty($registration_payments)) {
306
+			foreach ($registration_payments as $registration_payment) {
307
+				if ($registration_payment instanceof EE_Registration_Payment) {
308 308
 					$amount_paid = $registration_payment->amount();
309 309
 					$registration = $registration_payment->registration();
310
-					if ( $registration instanceof EE_Registration ) {
311
-						$registration->set_paid( $registration->paid() - $amount_paid );
312
-						if ( $registration->save() ) {
313
-							if ( $registration_payment->delete() ) {
314
-								$registration->_remove_relation_to( $payment, 'Payment' );
315
-								$payment->_remove_relation_to( $registration, 'Registration' );
310
+					if ($registration instanceof EE_Registration) {
311
+						$registration->set_paid($registration->paid() - $amount_paid);
312
+						if ($registration->save()) {
313
+							if ($registration_payment->delete()) {
314
+								$registration->_remove_relation_to($payment, 'Payment');
315
+								$payment->_remove_relation_to($registration, 'Registration');
316 316
 							}
317 317
 							$save_payment = true;
318 318
 						}
319 319
 					} else {
320 320
 						EE_Error::add_error(
321 321
 							sprintf(
322
-								__( 'An invalid Registration object was associated with Registration Payment ID# %1$d.', 'event_espresso' ),
322
+								__('An invalid Registration object was associated with Registration Payment ID# %1$d.', 'event_espresso'),
323 323
 								$registration_payment->ID()
324 324
 							),
325 325
 							__FILE__, __FUNCTION__, __LINE__
@@ -329,7 +329,7 @@  discard block
 block discarded – undo
329 329
 				} else {
330 330
 					EE_Error::add_error(
331 331
 						sprintf(
332
-							__( 'An invalid Registration Payment object was associated with payment ID# %1$d.', 'event_espresso' ),
332
+							__('An invalid Registration Payment object was associated with payment ID# %1$d.', 'event_espresso'),
333 333
 							$payment->ID()
334 334
 						),
335 335
 						__FILE__, __FUNCTION__, __LINE__
@@ -338,7 +338,7 @@  discard block
 block discarded – undo
338 338
 				}
339 339
 			}
340 340
 		}
341
-		if ( $save_payment ) {
341
+		if ($save_payment) {
342 342
 			$payment->save();
343 343
 		}
344 344
 		return true;
Please login to merge, or discard this patch.
core/db_classes/EE_Attendee.class.php 1 patch
Spacing   +97 added lines, -97 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1
-<?php if ( !defined( 'EVENT_ESPRESSO_VERSION' ) ) {
2
-	exit( 'No direct script access allowed' );
1
+<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) {
2
+	exit('No direct script access allowed');
3 3
 }
4 4
 /**
5 5
  * Event Espresso
@@ -33,20 +33,20 @@  discard block
 block discarded – undo
33 33
 	 * @param string $timezone
34 34
 	 * @param array $date_formats
35 35
 	 */
36
-	protected function __construct( $fieldValues = NULL, $bydb = FALSE, $timezone = NULL, $date_formats = array() ) {
37
-		if ( !isset( $fieldValues[ 'ATT_full_name' ] ) ) {
38
-			$fname = isset( $fieldValues[ 'ATT_fname' ] ) ? $fieldValues[ 'ATT_fname' ] . ' ' : '';
39
-			$lname = isset( $fieldValues[ 'ATT_lname' ] ) ? $fieldValues[ 'ATT_lname' ] : '';
40
-			$fieldValues[ 'ATT_full_name' ] = $fname . $lname;
36
+	protected function __construct($fieldValues = NULL, $bydb = FALSE, $timezone = NULL, $date_formats = array()) {
37
+		if ( ! isset($fieldValues['ATT_full_name'])) {
38
+			$fname = isset($fieldValues['ATT_fname']) ? $fieldValues['ATT_fname'].' ' : '';
39
+			$lname = isset($fieldValues['ATT_lname']) ? $fieldValues['ATT_lname'] : '';
40
+			$fieldValues['ATT_full_name'] = $fname.$lname;
41 41
 		}
42
-		if ( !isset( $fieldValues[ 'ATT_slug' ] ) ) {
42
+		if ( ! isset($fieldValues['ATT_slug'])) {
43 43
 			//			$fieldValues['ATT_slug'] = sanitize_key(wp_generate_password(20));
44
-			$fieldValues[ 'ATT_slug' ] = sanitize_title( $fieldValues[ 'ATT_full_name' ] );
44
+			$fieldValues['ATT_slug'] = sanitize_title($fieldValues['ATT_full_name']);
45 45
 		}
46
-		if ( !isset( $fieldValues[ 'ATT_short_bio' ] ) && isset( $fieldValues[ 'ATT_bio' ] ) ) {
47
-			$fieldValues[ 'ATT_short_bio' ] = substr( $fieldValues[ 'ATT_bio' ], 0, 50 );
46
+		if ( ! isset($fieldValues['ATT_short_bio']) && isset($fieldValues['ATT_bio'])) {
47
+			$fieldValues['ATT_short_bio'] = substr($fieldValues['ATT_bio'], 0, 50);
48 48
 		}
49
-		parent::__construct( $fieldValues, $bydb, $timezone, $date_formats );
49
+		parent::__construct($fieldValues, $bydb, $timezone, $date_formats);
50 50
 	}
51 51
 
52 52
 
@@ -60,9 +60,9 @@  discard block
 block discarded – undo
60 60
 	 *                             		    date_format and the second value is the time format
61 61
 	 * @return EE_Attendee
62 62
 	 */
63
-	public static function new_instance( $props_n_values = array(), $timezone = null, $date_formats = array() ) {
64
-		$has_object = parent::_check_for_object( $props_n_values, __CLASS__, $timezone, $date_formats );
65
-		return $has_object ? $has_object : new self( $props_n_values, false, $timezone, $date_formats );
63
+	public static function new_instance($props_n_values = array(), $timezone = null, $date_formats = array()) {
64
+		$has_object = parent::_check_for_object($props_n_values, __CLASS__, $timezone, $date_formats);
65
+		return $has_object ? $has_object : new self($props_n_values, false, $timezone, $date_formats);
66 66
 	}
67 67
 
68 68
 
@@ -73,8 +73,8 @@  discard block
 block discarded – undo
73 73
 	 *                          		the website will be used.
74 74
 	 * @return EE_Attendee
75 75
 	 */
76
-	public static function new_instance_from_db( $props_n_values = array(), $timezone = null ) {
77
-		return new self( $props_n_values, TRUE, $timezone );
76
+	public static function new_instance_from_db($props_n_values = array(), $timezone = null) {
77
+		return new self($props_n_values, TRUE, $timezone);
78 78
 	}
79 79
 
80 80
 
@@ -85,8 +85,8 @@  discard block
 block discarded – undo
85 85
 	 * @access        public
86 86
 	 * @param string $fname
87 87
 	 */
88
-	public function set_fname( $fname = '' ) {
89
-		$this->set( 'ATT_fname', $fname );
88
+	public function set_fname($fname = '') {
89
+		$this->set('ATT_fname', $fname);
90 90
 	}
91 91
 
92 92
 
@@ -97,8 +97,8 @@  discard block
 block discarded – undo
97 97
 	 * @access        public
98 98
 	 * @param string $lname
99 99
 	 */
100
-	public function set_lname( $lname = '' ) {
101
-		$this->set( 'ATT_lname', $lname );
100
+	public function set_lname($lname = '') {
101
+		$this->set('ATT_lname', $lname);
102 102
 	}
103 103
 
104 104
 
@@ -109,8 +109,8 @@  discard block
 block discarded – undo
109 109
 	 * @access        public
110 110
 	 * @param string $address
111 111
 	 */
112
-	public function set_address( $address = '' ) {
113
-		$this->set( 'ATT_address', $address );
112
+	public function set_address($address = '') {
113
+		$this->set('ATT_address', $address);
114 114
 	}
115 115
 
116 116
 
@@ -121,8 +121,8 @@  discard block
 block discarded – undo
121 121
 	 * @access        public
122 122
 	 * @param        string $address2
123 123
 	 */
124
-	public function set_address2( $address2 = '' ) {
125
-		$this->set( 'ATT_address2', $address2 );
124
+	public function set_address2($address2 = '') {
125
+		$this->set('ATT_address2', $address2);
126 126
 	}
127 127
 
128 128
 
@@ -133,8 +133,8 @@  discard block
 block discarded – undo
133 133
 	 * @access        public
134 134
 	 * @param        string $city
135 135
 	 */
136
-	public function set_city( $city = '' ) {
137
-		$this->set( 'ATT_city', $city );
136
+	public function set_city($city = '') {
137
+		$this->set('ATT_city', $city);
138 138
 	}
139 139
 
140 140
 
@@ -145,8 +145,8 @@  discard block
 block discarded – undo
145 145
 	 * @access        public
146 146
 	 * @param        int $STA_ID
147 147
 	 */
148
-	public function set_state( $STA_ID = 0 ) {
149
-		$this->set( 'STA_ID', $STA_ID );
148
+	public function set_state($STA_ID = 0) {
149
+		$this->set('STA_ID', $STA_ID);
150 150
 	}
151 151
 
152 152
 
@@ -157,8 +157,8 @@  discard block
 block discarded – undo
157 157
 	 * @access        public
158 158
 	 * @param        string $CNT_ISO
159 159
 	 */
160
-	public function set_country( $CNT_ISO = '' ) {
161
-		$this->set( 'CNT_ISO', $CNT_ISO );
160
+	public function set_country($CNT_ISO = '') {
161
+		$this->set('CNT_ISO', $CNT_ISO);
162 162
 	}
163 163
 
164 164
 
@@ -169,8 +169,8 @@  discard block
 block discarded – undo
169 169
 	 * @access        public
170 170
 	 * @param        string $zip
171 171
 	 */
172
-	public function set_zip( $zip = '' ) {
173
-		$this->set( 'ATT_zip', $zip );
172
+	public function set_zip($zip = '') {
173
+		$this->set('ATT_zip', $zip);
174 174
 	}
175 175
 
176 176
 
@@ -181,8 +181,8 @@  discard block
 block discarded – undo
181 181
 	 * @access        public
182 182
 	 * @param        string $email
183 183
 	 */
184
-	public function set_email( $email = '' ) {
185
-		$this->set( 'ATT_email', $email );
184
+	public function set_email($email = '') {
185
+		$this->set('ATT_email', $email);
186 186
 	}
187 187
 
188 188
 
@@ -193,8 +193,8 @@  discard block
 block discarded – undo
193 193
 	 * @access        public
194 194
 	 * @param        string $phone
195 195
 	 */
196
-	public function set_phone( $phone = '' ) {
197
-		$this->set( 'ATT_phone', $phone );
196
+	public function set_phone($phone = '') {
197
+		$this->set('ATT_phone', $phone);
198 198
 	}
199 199
 
200 200
 
@@ -205,8 +205,8 @@  discard block
 block discarded – undo
205 205
 	 * @access        public
206 206
 	 * @param        bool $ATT_deleted
207 207
 	 */
208
-	public function set_deleted( $ATT_deleted = FALSE ) {
209
-		$this->set( 'ATT_deleted', $ATT_deleted );
208
+	public function set_deleted($ATT_deleted = FALSE) {
209
+		$this->set('ATT_deleted', $ATT_deleted);
210 210
 	}
211 211
 
212 212
 
@@ -219,7 +219,7 @@  discard block
 block discarded – undo
219 219
 	 * @return int
220 220
 	 */
221 221
 	public function wp_user() {
222
-		return $this->get( 'ATT_author' );
222
+		return $this->get('ATT_author');
223 223
 	}
224 224
 
225 225
 
@@ -230,7 +230,7 @@  discard block
 block discarded – undo
230 230
 	 * @return string
231 231
 	 */
232 232
 	public function fname() {
233
-		return $this->get( 'ATT_fname' );
233
+		return $this->get('ATT_fname');
234 234
 	}
235 235
 
236 236
 
@@ -250,9 +250,9 @@  discard block
 block discarded – undo
250 250
 	 * @param bool $apply_html_entities
251 251
 	 * @return string
252 252
 	 */
253
-	public function full_name( $apply_html_entities = FALSE ) {
254
-		$full_name = $this->fname() . ' ' . $this->lname();
255
-		return $apply_html_entities ? htmlentities( $full_name, ENT_QUOTES, 'UTF-8' ) : $full_name;
253
+	public function full_name($apply_html_entities = FALSE) {
254
+		$full_name = $this->fname().' '.$this->lname();
255
+		return $apply_html_entities ? htmlentities($full_name, ENT_QUOTES, 'UTF-8') : $full_name;
256 256
 	}
257 257
 
258 258
 
@@ -263,7 +263,7 @@  discard block
 block discarded – undo
263 263
 	 * @return string
264 264
 	 */
265 265
 	public function lname() {
266
-		return $this->get( 'ATT_lname' );
266
+		return $this->get('ATT_lname');
267 267
 	}
268 268
 
269 269
 
@@ -277,26 +277,26 @@  discard block
 block discarded – undo
277 277
 	 */
278 278
 	public function full_address_as_array() {
279 279
 		$full_address_array = array();
280
-		$initial_address_fields = array( 'ATT_address', 'ATT_address2', 'ATT_city', );
281
-		foreach ( $initial_address_fields as $address_field_name ) {
282
-			$address_fields_value = $this->get( $address_field_name );
283
-			if ( !empty( $address_fields_value ) ) {
284
-				$full_address_array[ ] = $address_fields_value;
280
+		$initial_address_fields = array('ATT_address', 'ATT_address2', 'ATT_city',);
281
+		foreach ($initial_address_fields as $address_field_name) {
282
+			$address_fields_value = $this->get($address_field_name);
283
+			if ( ! empty($address_fields_value)) {
284
+				$full_address_array[] = $address_fields_value;
285 285
 			}
286 286
 		}
287 287
 		//now handle state and country
288 288
 		$state_obj = $this->state_obj();
289
-		if ( !empty( $state_obj ) ) {
290
-			$full_address_array[ ] = $state_obj->name();
289
+		if ( ! empty($state_obj)) {
290
+			$full_address_array[] = $state_obj->name();
291 291
 		}
292 292
 		$country_obj = $this->country_obj();
293
-		if ( !empty( $country_obj ) ) {
294
-			$full_address_array[ ] = $country_obj->name();
293
+		if ( ! empty($country_obj)) {
294
+			$full_address_array[] = $country_obj->name();
295 295
 		}
296 296
 		//lastly get the xip
297 297
 		$zip_value = $this->zip();
298
-		if ( !empty( $zip_value ) ) {
299
-			$full_address_array[ ] = $zip_value;
298
+		if ( ! empty($zip_value)) {
299
+			$full_address_array[] = $zip_value;
300 300
 		}
301 301
 		return $full_address_array;
302 302
 	}
@@ -308,7 +308,7 @@  discard block
 block discarded – undo
308 308
 	 * @return string
309 309
 	 */
310 310
 	public function address() {
311
-		return $this->get( 'ATT_address' );
311
+		return $this->get('ATT_address');
312 312
 	}
313 313
 
314 314
 
@@ -318,7 +318,7 @@  discard block
 block discarded – undo
318 318
 	 * @return string
319 319
 	 */
320 320
 	public function address2() {
321
-		return $this->get( 'ATT_address2' );
321
+		return $this->get('ATT_address2');
322 322
 	}
323 323
 
324 324
 
@@ -328,7 +328,7 @@  discard block
 block discarded – undo
328 328
 	 * @return string
329 329
 	 */
330 330
 	public function city() {
331
-		return $this->get( 'ATT_city' );
331
+		return $this->get('ATT_city');
332 332
 	}
333 333
 
334 334
 
@@ -338,7 +338,7 @@  discard block
 block discarded – undo
338 338
 	 * @return string
339 339
 	 */
340 340
 	public function state_ID() {
341
-		return $this->get( 'STA_ID' );
341
+		return $this->get('STA_ID');
342 342
 	}
343 343
 
344 344
 
@@ -347,7 +347,7 @@  discard block
 block discarded – undo
347 347
 	 * @return string
348 348
 	 */
349 349
 	public function state_abbrev() {
350
-		return $this->state_obj() instanceof EE_State ? $this->state_obj()->abbrev() : __( 'Unknown', 'event_espresso' );
350
+		return $this->state_obj() instanceof EE_State ? $this->state_obj()->abbrev() : __('Unknown', 'event_espresso');
351 351
 	}
352 352
 
353 353
 
@@ -357,18 +357,18 @@  discard block
 block discarded – undo
357 357
 	 * @return EE_State
358 358
 	 */
359 359
 	public function state_obj() {
360
-		return $this->get_first_related( 'State' );
360
+		return $this->get_first_related('State');
361 361
 	}
362 362
 
363 363
 	/**
364 364
 	 * Returns the state's name, otherwise 'Unknown'
365 365
 	 * @return string
366 366
 	 */
367
-	public function state_name(){
368
-		if( $this->state_obj() ){
367
+	public function state_name() {
368
+		if ($this->state_obj()) {
369 369
 			return $this->state_obj()->name();
370
-		}else{
371
-			return __( 'Unknown', 'event_espresso' );
370
+		} else {
371
+			return __('Unknown', 'event_espresso');
372 372
 		}
373 373
 	}
374 374
 
@@ -381,7 +381,7 @@  discard block
 block discarded – undo
381 381
 	 * @return string
382 382
 	 */
383 383
 	public function state() {
384
-		if ( apply_filters( 'FHEE__EEI_Address__state__use_abbreviation', true, $this->state_obj() ) ) {
384
+		if (apply_filters('FHEE__EEI_Address__state__use_abbreviation', true, $this->state_obj())) {
385 385
 			return $this->state_abbrev();
386 386
 		} else {
387 387
 			return $this->state_name();
@@ -395,7 +395,7 @@  discard block
 block discarded – undo
395 395
 	 * @return string
396 396
 	 */
397 397
 	public function country_ID() {
398
-		return $this->get( 'CNT_ISO' );
398
+		return $this->get('CNT_ISO');
399 399
 	}
400 400
 
401 401
 
@@ -405,18 +405,18 @@  discard block
 block discarded – undo
405 405
 	 * @return EE_Country
406 406
 	 */
407 407
 	public function country_obj() {
408
-		return $this->get_first_related( 'Country' );
408
+		return $this->get_first_related('Country');
409 409
 	}
410 410
 
411 411
 	/**
412 412
 	 * Returns the country's name if known, otherwise 'Unknown'
413 413
 	 * @return string
414 414
 	 */
415
-	public function country_name(){
416
-		if( $this->country_obj() ){
415
+	public function country_name() {
416
+		if ($this->country_obj()) {
417 417
 			return $this->country_obj()->name();
418
-		}else{
419
-			return __( 'Unknown', 'event_espresso' );
418
+		} else {
419
+			return __('Unknown', 'event_espresso');
420 420
 		}
421 421
 	}
422 422
 
@@ -429,7 +429,7 @@  discard block
 block discarded – undo
429 429
 	 * @return string
430 430
 	 */
431 431
 	public function country() {
432
-		if ( apply_filters( 'FHEE__EEI_Address__country__use_abbreviation', true, $this->country_obj() ) ) {
432
+		if (apply_filters('FHEE__EEI_Address__country__use_abbreviation', true, $this->country_obj())) {
433 433
 			return $this->country_ID();
434 434
 		} else {
435 435
 			return $this->country_name();
@@ -443,7 +443,7 @@  discard block
 block discarded – undo
443 443
 	 * @return string
444 444
 	 */
445 445
 	public function zip() {
446
-		return $this->get( 'ATT_zip' );
446
+		return $this->get('ATT_zip');
447 447
 	}
448 448
 
449 449
 
@@ -453,7 +453,7 @@  discard block
 block discarded – undo
453 453
 	 * @return string
454 454
 	 */
455 455
 	public function email() {
456
-		return $this->get( 'ATT_email' );
456
+		return $this->get('ATT_email');
457 457
 	}
458 458
 
459 459
 
@@ -463,7 +463,7 @@  discard block
 block discarded – undo
463 463
 	 * @return string
464 464
 	 */
465 465
 	public function phone() {
466
-		return $this->get( 'ATT_phone' );
466
+		return $this->get('ATT_phone');
467 467
 	}
468 468
 
469 469
 
@@ -473,7 +473,7 @@  discard block
 block discarded – undo
473 473
 	 * @return        bool
474 474
 	 */
475 475
 	public function deleted() {
476
-		return $this->get( 'ATT_deleted' );
476
+		return $this->get('ATT_deleted');
477 477
 	}
478 478
 
479 479
 
@@ -483,8 +483,8 @@  discard block
 block discarded – undo
483 483
 	 * @param array $query_params
484 484
 	 * @return EE_Registration[]
485 485
 	 */
486
-	public function get_registrations( $query_params = array() ) {
487
-		return $this->get_many_related( 'Registration', $query_params );
486
+	public function get_registrations($query_params = array()) {
487
+		return $this->get_many_related('Registration', $query_params);
488 488
 	}
489 489
 
490 490
 
@@ -494,7 +494,7 @@  discard block
 block discarded – undo
494 494
 	 * @return EE_Registration
495 495
 	 */
496 496
 	public function get_most_recent_registration() {
497
-		return $this->get_first_related( 'Registration', array( 'order_by' => array( 'REG_date' => 'DESC' ) ) ); //null, 'REG_date', 'DESC', '=', 'OBJECT_K');
497
+		return $this->get_first_related('Registration', array('order_by' => array('REG_date' => 'DESC'))); //null, 'REG_date', 'DESC', '=', 'OBJECT_K');
498 498
 	}
499 499
 
500 500
 
@@ -504,8 +504,8 @@  discard block
 block discarded – undo
504 504
 	 * @param int $event_id
505 505
 	 * @return EE_Registration
506 506
 	 */
507
-	public function get_most_recent_registration_for_event( $event_id ) {
508
-		return $this->get_first_related( 'Registration', array(array( 'EVT_ID' => $event_id ), 'order_by' => array('REG_date' => 'DESC')));//, '=', 'OBJECT_K' );
507
+	public function get_most_recent_registration_for_event($event_id) {
508
+		return $this->get_first_related('Registration', array(array('EVT_ID' => $event_id), 'order_by' => array('REG_date' => 'DESC'))); //, '=', 'OBJECT_K' );
509 509
 	}
510 510
 
511 511
 
@@ -515,7 +515,7 @@  discard block
 block discarded – undo
515 515
 	 * @return array
516 516
 	 */
517 517
 	public function events() {
518
-		return $this->get_many_related( 'Event' );
518
+		return $this->get_many_related('Event');
519 519
 	}
520 520
 
521 521
 	/**
@@ -524,17 +524,17 @@  discard block
 block discarded – undo
524 524
 	 * @param EE_Payment_Method $payment_method the _gateway_name property on the gateway class
525 525
 	 * @return EE_Form_Section_Proper
526 526
 	 */
527
-	public function billing_info_for_payment_method($payment_method){
527
+	public function billing_info_for_payment_method($payment_method) {
528 528
 		$pm_type = $payment_method->type_obj();
529
-		if( ! $pm_type instanceof EE_PMT_Base ){
529
+		if ( ! $pm_type instanceof EE_PMT_Base) {
530 530
 			return NULL;
531 531
 		}
532
-		$billing_info =  $this->get_post_meta( $this->get_billing_info_postmeta_name( $payment_method ), true );
533
-		if ( ! $billing_info){
532
+		$billing_info = $this->get_post_meta($this->get_billing_info_postmeta_name($payment_method), true);
533
+		if ( ! $billing_info) {
534 534
 			return NULL;
535 535
 		}
536 536
 		$billing_form = $pm_type->billing_form();
537
-		$billing_form->receive_form_submission( array( $billing_form->name() => $billing_info ), FALSE );
537
+		$billing_form->receive_form_submission(array($billing_form->name() => $billing_info), FALSE);
538 538
 		return $billing_form;
539 539
 	}
540 540
 
@@ -544,10 +544,10 @@  discard block
 block discarded – undo
544 544
 	 * @param EE_Payment_Method $payment_method
545 545
 	 * @return string
546 546
 	 */
547
-	public function get_billing_info_postmeta_name($payment_method){
548
-		if( $payment_method->type_obj() instanceof EE_PMT_Base ){
549
-			return 'billing_info_' . $payment_method->type_obj()->system_name();
550
-		}else{
547
+	public function get_billing_info_postmeta_name($payment_method) {
548
+		if ($payment_method->type_obj() instanceof EE_PMT_Base) {
549
+			return 'billing_info_'.$payment_method->type_obj()->system_name();
550
+		} else {
551 551
 			return NULL;
552 552
 		}
553 553
 	}
@@ -558,13 +558,13 @@  discard block
 block discarded – undo
558 558
 	 * @param EE_Payment_Method $payment_method
559 559
 	 * @return boolean
560 560
 	 */
561
-	public function save_and_clean_billing_info_for_payment_method($billing_form, $payment_method){
562
-		if( ! $billing_form instanceof EE_Billing_Attendee_Info_Form ){
563
-			EE_Error::add_error( __( 'Cannot save billing info because there is none.', 'event_espresso' ) );
561
+	public function save_and_clean_billing_info_for_payment_method($billing_form, $payment_method) {
562
+		if ( ! $billing_form instanceof EE_Billing_Attendee_Info_Form) {
563
+			EE_Error::add_error(__('Cannot save billing info because there is none.', 'event_espresso'));
564 564
 			return false;
565 565
 		}
566 566
 		$billing_form->clean_sensitive_data();
567
-		return update_post_meta($this->ID(), $this->get_billing_info_postmeta_name( $payment_method ), $billing_form->input_values( true ) );
567
+		return update_post_meta($this->ID(), $this->get_billing_info_postmeta_name($payment_method), $billing_form->input_values(true));
568 568
 	}
569 569
 
570 570
 }
Please login to merge, or discard this patch.
core/db_classes/EE_Change_Log.class.php 1 patch
Spacing   +15 added lines, -15 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
 /**
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
  *
26 26
  * ------------------------------------------------------------------------
27 27
  */
28
-class EE_Change_Log extends EE_Base_Class{
28
+class EE_Change_Log extends EE_Base_Class {
29 29
 
30 30
 	/**
31 31
 	 *
@@ -36,9 +36,9 @@  discard block
 block discarded – undo
36 36
 	 *                             		    date_format and the second value is the time format
37 37
 	 * @return EE_Attendee
38 38
 	 */
39
-	public static function new_instance( $props_n_values = array(), $timezone = null, $date_formats = array() ) {
40
-		$has_object = parent::_check_for_object( $props_n_values, __CLASS__, $timezone, $date_formats );
41
-		return $has_object ? $has_object : new self( $props_n_values, false, $timezone, $date_formats );
39
+	public static function new_instance($props_n_values = array(), $timezone = null, $date_formats = array()) {
40
+		$has_object = parent::_check_for_object($props_n_values, __CLASS__, $timezone, $date_formats);
41
+		return $has_object ? $has_object : new self($props_n_values, false, $timezone, $date_formats);
42 42
 	}
43 43
 
44 44
 
@@ -49,8 +49,8 @@  discard block
 block discarded – undo
49 49
 	 *                          		the website will be used.
50 50
 	 * @return EE_Attendee
51 51
 	 */
52
-	public static function new_instance_from_db( $props_n_values = array(), $timezone = null ) {
53
-		return new self( $props_n_values, TRUE, $timezone );
52
+	public static function new_instance_from_db($props_n_values = array(), $timezone = null) {
53
+		return new self($props_n_values, TRUE, $timezone);
54 54
 	}
55 55
 	/**
56 56
 	 * Gets message
@@ -147,12 +147,12 @@  discard block
 block discarded – undo
147 147
 	 * Gets the model object attached to this log
148 148
 	 * @return EE_Base_Class
149 149
 	 */
150
-	function object(){
150
+	function object() {
151 151
 		$model_name_of_related_obj = $this->OBJ_type();
152 152
 		$is_model_name = EE_Registry::instance()->is_model_name($model_name_of_related_obj);
153
-		if( ! $is_model_name ){
153
+		if ( ! $is_model_name) {
154 154
 			return null;
155
-		}else{
155
+		} else {
156 156
 			return $this->get_first_related($model_name_of_related_obj);
157 157
 		}
158 158
 	}
@@ -165,17 +165,17 @@  discard block
 block discarded – undo
165 165
 	 * @param boolean $save
166 166
 	 * @return boolean if $save=true, NULL is $save=false
167 167
 	 */
168
-	function set_object($object, $save = TRUE ) {
169
-		if($object instanceof EE_Base_Class){
168
+	function set_object($object, $save = TRUE) {
169
+		if ($object instanceof EE_Base_Class) {
170 170
 			$this->set_OBJ_type($object->get_model()->get_this_model_name());
171 171
 			$this->set_OBJ_ID($object->ID());
172
-		}else{
172
+		} else {
173 173
 			$this->set_OBJ_type(NULL);
174 174
 			$this->set_OBJ_ID(NULL);
175 175
 		}
176
-		if($save){
176
+		if ($save) {
177 177
 			return $this->save();
178
-		}else{
178
+		} else {
179 179
 			return NULL;
180 180
 		}
181 181
 	}
Please login to merge, or discard this patch.
core/db_classes/EE_Checkin.class.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1
-<?php if (!defined('EVENT_ESPRESSO_VERSION')) exit('No direct script access allowed');
2
-do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' );
1
+<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) exit('No direct script access allowed');
2
+do_action('AHEE_log', __FILE__, __FUNCTION__, '');
3 3
 /**
4 4
  * Event Espresso
5 5
  *
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
  * @subpackage		includes/classes/EE_Checkin.class.php
24 24
  * @author				Darren Ethier
25 25
  */
26
-class EE_Checkin extends EE_Base_Class{
26
+class EE_Checkin extends EE_Base_Class {
27 27
 
28 28
 	/**
29 29
 	 *
@@ -34,9 +34,9 @@  discard block
 block discarded – undo
34 34
 	 *                             		    date_format and the second value is the time format
35 35
 	 * @return EE_Checkin
36 36
 	 */
37
-	public static function new_instance( $props_n_values = array(), $timezone = null, $date_formats = array() ) {
38
-		$has_object = parent::_check_for_object( $props_n_values, __CLASS__, $timezone, $date_formats );
39
-		return $has_object ? $has_object : new self( $props_n_values, false, $timezone, $date_formats );
37
+	public static function new_instance($props_n_values = array(), $timezone = null, $date_formats = array()) {
38
+		$has_object = parent::_check_for_object($props_n_values, __CLASS__, $timezone, $date_formats);
39
+		return $has_object ? $has_object : new self($props_n_values, false, $timezone, $date_formats);
40 40
 	}
41 41
 
42 42
 
@@ -47,8 +47,8 @@  discard block
 block discarded – undo
47 47
 	 *                          		the website will be used.
48 48
 	 * @return EE_Checkin
49 49
 	 */
50
-	public static function new_instance_from_db( $props_n_values = array(), $timezone = null ) {
51
-		return new self( $props_n_values, TRUE, $timezone );
50
+	public static function new_instance_from_db($props_n_values = array(), $timezone = null) {
51
+		return new self($props_n_values, TRUE, $timezone);
52 52
 	}
53 53
 
54 54
 
Please login to merge, or discard this patch.
core/db_classes/EE_Currency.class.php 1 patch
Spacing   +9 added lines, -9 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
 /**
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
  *
26 26
  * ------------------------------------------------------------------------
27 27
  */
28
-class EE_Currency extends EE_Base_Class{
28
+class EE_Currency extends EE_Base_Class {
29 29
 
30 30
 		/** Currency COde @var CUR_code*/ protected $_CUR_code = NULL;
31 31
 		/** Currency Name Singular @var CUR_single*/ protected $_CUR_single = NULL;
@@ -43,9 +43,9 @@  discard block
 block discarded – undo
43 43
 	 *                             		    date_format and the second value is the time format
44 44
 	 * @return EE_Attendee
45 45
 	 */
46
-	public static function new_instance( $props_n_values = array(), $timezone = null, $date_formats = array() ) {
47
-		$has_object = parent::_check_for_object( $props_n_values, __CLASS__, $timezone, $date_formats );
48
-		return $has_object ? $has_object : new self( $props_n_values, false, $timezone, $date_formats );
46
+	public static function new_instance($props_n_values = array(), $timezone = null, $date_formats = array()) {
47
+		$has_object = parent::_check_for_object($props_n_values, __CLASS__, $timezone, $date_formats);
48
+		return $has_object ? $has_object : new self($props_n_values, false, $timezone, $date_formats);
49 49
 	}
50 50
 
51 51
 
@@ -56,8 +56,8 @@  discard block
 block discarded – undo
56 56
 	 *                          		the website will be used.
57 57
 	 * @return EE_Attendee
58 58
 	 */
59
-	public static function new_instance_from_db( $props_n_values = array(), $timezone = null ) {
60
-		return new self( $props_n_values, TRUE, $timezone );
59
+	public static function new_instance_from_db($props_n_values = array(), $timezone = null) {
60
+		return new self($props_n_values, TRUE, $timezone);
61 61
 	}
62 62
 	/**
63 63
 	 * Gets code
@@ -159,8 +159,8 @@  discard block
 block discarded – undo
159 159
 	 * Gets a prettier name
160 160
 	 * @return string
161 161
 	 */
162
-	function name(){
163
-		return sprintf(__("%s (%s)", "event_espresso"),$this->code(),$this->plural_name());
162
+	function name() {
163
+		return sprintf(__("%s (%s)", "event_espresso"), $this->code(), $this->plural_name());
164 164
 	}
165 165
 
166 166
 }
Please login to merge, or discard this patch.
core/db_classes/EE_Currency_Payment_Method.class.php 1 patch
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
 /**
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
  *
27 27
  * ------------------------------------------------------------------------
28 28
  */
29
-class EE_Currency_Payment_Method extends EE_Base_Class{
29
+class EE_Currency_Payment_Method extends EE_Base_Class {
30 30
 
31 31
 	/** Currency to Payment Method Link ID @var CPM_ID*/
32 32
 	protected $_CPM_ID = NULL;
@@ -48,9 +48,9 @@  discard block
 block discarded – undo
48 48
 	 *                             		    date_format and the second value is the time format
49 49
 	 * @return EE_Attendee
50 50
 	 */
51
-	public static function new_instance( $props_n_values = array(), $timezone = null, $date_formats = array() ) {
52
-		$has_object = parent::_check_for_object( $props_n_values, __CLASS__, $timezone, $date_formats );
53
-		return $has_object ? $has_object : new self( $props_n_values, false, $timezone, $date_formats );
51
+	public static function new_instance($props_n_values = array(), $timezone = null, $date_formats = array()) {
52
+		$has_object = parent::_check_for_object($props_n_values, __CLASS__, $timezone, $date_formats);
53
+		return $has_object ? $has_object : new self($props_n_values, false, $timezone, $date_formats);
54 54
 	}
55 55
 
56 56
 
@@ -61,8 +61,8 @@  discard block
 block discarded – undo
61 61
 	 *                          		the website will be used.
62 62
 	 * @return EE_Attendee
63 63
 	 */
64
-	public static function new_instance_from_db( $props_n_values = array(), $timezone = null ) {
65
-		return new self( $props_n_values, TRUE, $timezone );
64
+	public static function new_instance_from_db($props_n_values = array(), $timezone = null) {
65
+		return new self($props_n_values, TRUE, $timezone);
66 66
 	}
67 67
 
68 68
 }
Please login to merge, or discard this patch.