Completed
Branch FET-9046-messages-queue (bdca24)
by
unknown
547:25 queued 529:16
created
admin_pages/general_settings/General_Settings_Admin_Page.core.php 4 patches
Doc Comments   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -545,7 +545,7 @@  discard block
 block discarded – undo
545 545
 	 *
546 546
 	 * 		@access 	public
547 547
 	 * 		@param 	string 		$CNT_ISO
548
-	 * 		@return 		mixed		string | array
548
+	 * 		@return 		string|null		string | array
549 549
 	 */
550 550
 	public function display_country_settings( $CNT_ISO = '' ) {
551 551
 
@@ -708,7 +708,7 @@  discard block
 block discarded – undo
708 708
 	 * 		delete_state
709 709
 	 *
710 710
 	 * 		@access 	public
711
-	 * 		@return 		boolean | void
711
+	 * 		@return 		false|null | void
712 712
 	 */
713 713
 	public function delete_state() {
714 714
 		$CNT_ISO = isset( $this->_req_data['CNT_ISO'] ) ? strtoupper( sanitize_text_field( $this->_req_data['CNT_ISO'] )) : FALSE;
@@ -938,10 +938,10 @@  discard block
 block discarded – undo
938 938
 	/**
939 939
 	 * generates a dropdown of all parent pages - copied from WP core
940 940
 	 *
941
-	 * @param unknown_type $default
942
-	 * @param unknown_type $parent
943
-	 * @param unknown_type $level
944
-	 * @return unknown
941
+	 * @param integer $default
942
+	 * @param integer $parent
943
+	 * @param integer $level
944
+	 * @return null|false
945 945
 	 */
946 946
 	public static function page_settings_dropdown( $default = 0, $parent = 0, $level = 0 ) {
947 947
 		global $wpdb;
Please login to merge, or discard this patch.
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -154,7 +154,7 @@  discard block
 block discarded – undo
154 154
 					'order' => 50
155 155
 					),
156 156
 				'metaboxes' => array_merge( $this->_default_espresso_metaboxes, array( '_publish_post_box' ) ),
157
-               			'help_tabs' => array(
157
+			   			'help_tabs' => array(
158 158
 					'general_settings_critical_pages_help_tab' => array(
159 159
 						'title' => __('Critical Pages', 'event_espresso'),
160 160
 						'filename' => 'general_settings_critical_pages'
@@ -168,7 +168,7 @@  discard block
 block discarded – undo
168 168
 					'label' => __('Your Organization', 'event_espresso'),
169 169
 					'order' => 20
170 170
 				),
171
-                			'help_tabs' => array(
171
+							'help_tabs' => array(
172 172
 					'general_settings_your_organization_help_tab' => array(
173 173
 						'title' => __('Your Organization', 'event_espresso'),
174 174
 						'filename' => 'general_settings_your_organization'
@@ -184,7 +184,7 @@  discard block
 block discarded – undo
184 184
 					'order' => 60
185 185
 					),
186 186
 				'metaboxes' => array_merge( $this->_default_espresso_metaboxes, array( '_publish_post_box' ) ),
187
-                			'help_tabs' => array(
187
+							'help_tabs' => array(
188 188
 					'general_settings_admin_options_help_tab' => array(
189 189
 						'title' => __('Admin Options', 'event_espresso'),
190 190
 						'filename' => 'general_settings_admin_options'
@@ -198,7 +198,7 @@  discard block
 block discarded – undo
198 198
 					'label' => __('Countries', 'event_espresso'),
199 199
 					'order' => 70
200 200
 					),
201
-                'help_tabs' => array(
201
+				'help_tabs' => array(
202 202
 					'general_settings_countries_help_tab' => array(
203 203
 						'title' => __('Countries', 'event_espresso'),
204 204
 						'filename' => 'general_settings_countries'
Please login to merge, or discard this patch.
Braces   +10 added lines, -7 removed lines patch added patch discarded remove patch
@@ -1,6 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if (!defined('EVENT_ESPRESSO_VERSION') )
2
+if (!defined('EVENT_ESPRESSO_VERSION') ) {
3 3
 	exit('NO direct script access allowed');
4
+}
4 5
 
5 6
 /**
6 7
  * Event Espresso
@@ -419,8 +420,9 @@  discard block
 block discarded – undo
419 420
 	}
420 421
 
421 422
 	protected function _update_your_organization_settings() {
422
-		if ( is_main_site() )
423
-			EE_Registry::instance()->NET_CFG->core->site_license_key = isset( $this->_req_data['site_license_key'] ) ? sanitize_text_field( $this->_req_data['site_license_key'] ) : EE_Registry::instance()->NET_CFG->core->site_license_key;
423
+		if ( is_main_site() ) {
424
+					EE_Registry::instance()->NET_CFG->core->site_license_key = isset( $this->_req_data['site_license_key'] ) ? sanitize_text_field( $this->_req_data['site_license_key'] ) : EE_Registry::instance()->NET_CFG->core->site_license_key;
425
+		}
424 426
 		EE_Registry::instance()->CFG->organization->name = isset( $this->_req_data['organization_name'] ) ? sanitize_text_field( $this->_req_data['organization_name'] ) : EE_Registry::instance()->CFG->organization->name;
425 427
 		EE_Registry::instance()->CFG->organization->address_1 = isset( $this->_req_data['organization_address_1'] ) ? sanitize_text_field( $this->_req_data['organization_address_1'] ) : EE_Registry::instance()->CFG->organization->address_1;
426 428
 		EE_Registry::instance()->CFG->organization->address_2 = isset( $this->_req_data['organization_address_2'] ) ? sanitize_text_field( $this->_req_data['organization_address_2'] ) : EE_Registry::instance()->CFG->organization->address_2;
@@ -950,10 +952,11 @@  discard block
 block discarded – undo
950 952
 		if ( $items ) {
951 953
 			foreach ( $items as $item ) {
952 954
 				$pad = str_repeat( '&nbsp;', $level * 3 );
953
-				if ( $item->ID == $default)
954
-					$current = ' selected="selected"';
955
-				else
956
-					$current = '';
955
+				if ( $item->ID == $default) {
956
+									$current = ' selected="selected"';
957
+				} else {
958
+									$current = '';
959
+				}
957 960
 
958 961
 				echo "\n\t<option class='level-$level' value='$item->ID'$current>$pad " . esc_html($item->post_title) . "</option>";
959 962
 				parent_dropdown( $default, $item->ID, $level +1 );
Please login to merge, or discard this patch.
Spacing   +285 added lines, -286 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if (!defined('EVENT_ESPRESSO_VERSION') )
2
+if ( ! defined('EVENT_ESPRESSO_VERSION'))
3 3
 	exit('NO direct script access allowed');
4 4
 
5 5
 /**
@@ -40,8 +40,8 @@  discard block
 block discarded – undo
40 40
 
41 41
 
42 42
 
43
-	public function __construct( $routing = TRUE ) {
44
-		parent::__construct( $routing );
43
+	public function __construct($routing = TRUE) {
44
+		parent::__construct($routing);
45 45
 	}
46 46
 
47 47
 
@@ -57,10 +57,10 @@  discard block
 block discarded – undo
57 57
 
58 58
 
59 59
 	protected function _ajax_hooks() {
60
-		add_action('wp_ajax_espresso_display_country_settings', array( $this, 'display_country_settings'));
61
-		add_action('wp_ajax_espresso_display_country_states', array( $this, 'display_country_states'));
62
-		add_action('wp_ajax_espresso_delete_state', array( $this, 'delete_state'), 10, 3 );
63
-		add_action('wp_ajax_espresso_add_new_state', array( $this, 'add_new_state'));
60
+		add_action('wp_ajax_espresso_display_country_settings', array($this, 'display_country_settings'));
61
+		add_action('wp_ajax_espresso_display_country_states', array($this, 'display_country_states'));
62
+		add_action('wp_ajax_espresso_delete_state', array($this, 'delete_state'), 10, 3);
63
+		add_action('wp_ajax_espresso_add_new_state', array($this, 'add_new_state'));
64 64
 	}
65 65
 
66 66
 
@@ -153,14 +153,14 @@  discard block
 block discarded – undo
153 153
 					'label' => __('Critical Pages', 'event_espresso'),
154 154
 					'order' => 50
155 155
 					),
156
-				'metaboxes' => array_merge( $this->_default_espresso_metaboxes, array( '_publish_post_box' ) ),
156
+				'metaboxes' => array_merge($this->_default_espresso_metaboxes, array('_publish_post_box')),
157 157
                			'help_tabs' => array(
158 158
 					'general_settings_critical_pages_help_tab' => array(
159 159
 						'title' => __('Critical Pages', 'event_espresso'),
160 160
 						'filename' => 'general_settings_critical_pages'
161 161
 						)
162 162
 					),
163
-				'help_tour' => array( 'Critical_Pages_Help_Tour' ),
163
+				'help_tour' => array('Critical_Pages_Help_Tour'),
164 164
 				'require_nonce' => FALSE
165 165
 				),
166 166
 			'default' => array(
@@ -174,8 +174,8 @@  discard block
 block discarded – undo
174 174
 						'filename' => 'general_settings_your_organization'
175 175
 						)
176 176
 					),
177
-				'help_tour' => array( 'Your_Organization_Help_Tour' ),
178
-				'metaboxes' => array_merge( $this->_default_espresso_metaboxes, array( '_publish_post_box' ) ),
177
+				'help_tour' => array('Your_Organization_Help_Tour'),
178
+				'metaboxes' => array_merge($this->_default_espresso_metaboxes, array('_publish_post_box')),
179 179
 				'require_nonce' => FALSE
180 180
 				),
181 181
 			'admin_option_settings' => array(
@@ -183,14 +183,14 @@  discard block
 block discarded – undo
183 183
 					'label' => __('Admin Options', 'event_espresso'),
184 184
 					'order' => 60
185 185
 					),
186
-				'metaboxes' => array_merge( $this->_default_espresso_metaboxes, array( '_publish_post_box' ) ),
186
+				'metaboxes' => array_merge($this->_default_espresso_metaboxes, array('_publish_post_box')),
187 187
                 			'help_tabs' => array(
188 188
 					'general_settings_admin_options_help_tab' => array(
189 189
 						'title' => __('Admin Options', 'event_espresso'),
190 190
 						'filename' => 'general_settings_admin_options'
191 191
 						)
192 192
 					),
193
-				'help_tour' => array( 'Admin_Options_Help_Tour' ),
193
+				'help_tour' => array('Admin_Options_Help_Tour'),
194 194
 				'require_nonce' => FALSE
195 195
 				),
196 196
 			'country_settings' => array(
@@ -204,7 +204,7 @@  discard block
 block discarded – undo
204 204
 						'filename' => 'general_settings_countries'
205 205
 						)
206 206
 					),
207
-				'help_tour' => array( 'Countries_Help_Tour' ),
207
+				'help_tour' => array('Countries_Help_Tour'),
208 208
 				'require_nonce' => FALSE
209 209
 				)
210 210
 			);
@@ -222,11 +222,11 @@  discard block
 block discarded – undo
222 222
 	}
223 223
 
224 224
 	public function admin_init() {
225
-		EE_Registry::$i18n_js_strings[ 'invalid_server_response' ] = __( 'An error occurred! Your request may have been processed, but a valid response from the server was not received. Please refresh the page and try again.', 'event_espresso' );
226
-		EE_Registry::$i18n_js_strings[ 'error_occurred' ] = __( 'An error occurred! Please refresh the page and try again.', 'event_espresso' );
227
-		EE_Registry::$i18n_js_strings[ 'confirm_delete_state' ] = __( 'Are you sure you want to delete this State / Province?', 'event_espresso' );
228
-		$protocol = isset( $_SERVER[ 'HTTPS' ] ) ? 'https://' : 'http://';
229
-		EE_Registry::$i18n_js_strings[ 'ajax_url' ] = admin_url( 'admin-ajax.php?page=espresso_general_settings', $protocol );
225
+		EE_Registry::$i18n_js_strings['invalid_server_response'] = __('An error occurred! Your request may have been processed, but a valid response from the server was not received. Please refresh the page and try again.', 'event_espresso');
226
+		EE_Registry::$i18n_js_strings['error_occurred'] = __('An error occurred! Please refresh the page and try again.', 'event_espresso');
227
+		EE_Registry::$i18n_js_strings['confirm_delete_state'] = __('Are you sure you want to delete this State / Province?', 'event_espresso');
228
+		$protocol = isset($_SERVER['HTTPS']) ? 'https://' : 'http://';
229
+		EE_Registry::$i18n_js_strings['ajax_url'] = admin_url('admin-ajax.php?page=espresso_general_settings', $protocol);
230 230
 	}
231 231
 
232 232
 	public function admin_notices() {}
@@ -239,21 +239,21 @@  discard block
 block discarded – undo
239 239
 		//scripts
240 240
 		wp_enqueue_script('media-upload');
241 241
 		wp_enqueue_script('thickbox');
242
-		wp_register_script( 'organization_settings', GEN_SET_ASSETS_URL . 'your_organization_settings.js', array( 'jquery','media-upload','thickbox' ), EVENT_ESPRESSO_VERSION, TRUE );
243
-		wp_register_style( 'organization-css', GEN_SET_ASSETS_URL . 'organization.css', array(), EVENT_ESPRESSO_VERSION );
244
-		wp_enqueue_script( 'organization_settings' );
245
-		wp_enqueue_style( 'organization-css' );
246
-		$confirm_image_delete = array( 'text' => __('Do you really want to delete this image? Please remember to save your settings to complete the removal.', 'event_espresso'));
247
-		wp_localize_script( 'organization_settings', 'confirm_image_delete', $confirm_image_delete );
242
+		wp_register_script('organization_settings', GEN_SET_ASSETS_URL.'your_organization_settings.js', array('jquery', 'media-upload', 'thickbox'), EVENT_ESPRESSO_VERSION, TRUE);
243
+		wp_register_style('organization-css', GEN_SET_ASSETS_URL.'organization.css', array(), EVENT_ESPRESSO_VERSION);
244
+		wp_enqueue_script('organization_settings');
245
+		wp_enqueue_style('organization-css');
246
+		$confirm_image_delete = array('text' => __('Do you really want to delete this image? Please remember to save your settings to complete the removal.', 'event_espresso'));
247
+		wp_localize_script('organization_settings', 'confirm_image_delete', $confirm_image_delete);
248 248
 
249 249
 	}
250 250
 
251 251
 	public function load_scripts_styles_country_settings() {
252 252
 		//scripts
253
-		wp_register_script( 'gen_settings_countries', GEN_SET_ASSETS_URL . 'gen_settings_countries.js', array( 'ee_admin_js' ), EVENT_ESPRESSO_VERSION, TRUE );
254
-		wp_register_style( 'organization-css', GEN_SET_ASSETS_URL . 'organization.css', array(), EVENT_ESPRESSO_VERSION );
255
-		wp_enqueue_script( 'gen_settings_countries' );
256
-		wp_enqueue_style( 'organization-css' );
253
+		wp_register_script('gen_settings_countries', GEN_SET_ASSETS_URL.'gen_settings_countries.js', array('ee_admin_js'), EVENT_ESPRESSO_VERSION, TRUE);
254
+		wp_register_style('organization-css', GEN_SET_ASSETS_URL.'organization.css', array(), EVENT_ESPRESSO_VERSION);
255
+		wp_enqueue_script('gen_settings_countries');
256
+		wp_enqueue_style('organization-css');
257 257
 
258 258
 	}
259 259
 
@@ -265,37 +265,37 @@  discard block
 block discarded – undo
265 265
 
266 266
 		// Check to make sure all of the main pages are setup properly,
267 267
 		// if not create the default pages and display an admin notice
268
-		EE_Registry::instance()->load_helper( 'Activation' );
268
+		EE_Registry::instance()->load_helper('Activation');
269 269
 		EEH_Activation::verify_default_pages_exist();
270 270
 
271 271
 		$this->_transient_garbage_collection();
272 272
 		$this->_template_args['values'] = $this->_yes_no_values;
273 273
 
274
-		$this->_template_args['reg_page_id'] = isset(EE_Registry::instance()->CFG->core->reg_page_id ) ?EE_Registry::instance()->CFG->core->reg_page_id : NULL;
275
-		$this->_template_args['reg_page_obj'] = isset(EE_Registry::instance()->CFG->core->reg_page_id ) ? get_page(EE_Registry::instance()->CFG->core->reg_page_id ) : FALSE;
274
+		$this->_template_args['reg_page_id'] = isset(EE_Registry::instance()->CFG->core->reg_page_id) ? EE_Registry::instance()->CFG->core->reg_page_id : NULL;
275
+		$this->_template_args['reg_page_obj'] = isset(EE_Registry::instance()->CFG->core->reg_page_id) ? get_page(EE_Registry::instance()->CFG->core->reg_page_id) : FALSE;
276 276
 
277
-		$this->_template_args['txn_page_id'] = isset(EE_Registry::instance()->CFG->core->txn_page_id) ?EE_Registry::instance()->CFG->core->txn_page_id : NULL;
278
-		$this->_template_args['txn_page_obj'] = isset(EE_Registry::instance()->CFG->core->txn_page_id ) ? get_page(EE_Registry::instance()->CFG->core->txn_page_id ) : FALSE;
277
+		$this->_template_args['txn_page_id'] = isset(EE_Registry::instance()->CFG->core->txn_page_id) ? EE_Registry::instance()->CFG->core->txn_page_id : NULL;
278
+		$this->_template_args['txn_page_obj'] = isset(EE_Registry::instance()->CFG->core->txn_page_id) ? get_page(EE_Registry::instance()->CFG->core->txn_page_id) : FALSE;
279 279
 
280
-		$this->_template_args['thank_you_page_id'] = isset(EE_Registry::instance()->CFG->core->thank_you_page_id ) ?EE_Registry::instance()->CFG->core->thank_you_page_id : NULL;
281
-		$this->_template_args['thank_you_page_obj'] = isset(EE_Registry::instance()->CFG->core->thank_you_page_id ) ? get_page(EE_Registry::instance()->CFG->core->thank_you_page_id ) : FALSE;
280
+		$this->_template_args['thank_you_page_id'] = isset(EE_Registry::instance()->CFG->core->thank_you_page_id) ? EE_Registry::instance()->CFG->core->thank_you_page_id : NULL;
281
+		$this->_template_args['thank_you_page_obj'] = isset(EE_Registry::instance()->CFG->core->thank_you_page_id) ? get_page(EE_Registry::instance()->CFG->core->thank_you_page_id) : FALSE;
282 282
 
283
-		$this->_template_args['cancel_page_id'] = isset(EE_Registry::instance()->CFG->core->cancel_page_id ) ?EE_Registry::instance()->CFG->core->cancel_page_id : NULL;
284
-		$this->_template_args['cancel_page_obj'] = isset(EE_Registry::instance()->CFG->core->cancel_page_id ) ? get_page(EE_Registry::instance()->CFG->core->cancel_page_id ) : FALSE;
283
+		$this->_template_args['cancel_page_id'] = isset(EE_Registry::instance()->CFG->core->cancel_page_id) ? EE_Registry::instance()->CFG->core->cancel_page_id : NULL;
284
+		$this->_template_args['cancel_page_obj'] = isset(EE_Registry::instance()->CFG->core->cancel_page_id) ? get_page(EE_Registry::instance()->CFG->core->cancel_page_id) : FALSE;
285 285
 
286
-		$this->_set_add_edit_form_tags( 'update_espresso_page_settings' );
287
-		$this->_set_publish_post_box_vars( NULL, FALSE, FALSE, NULL, FALSE );
288
-		$this->_template_args['admin_page_content'] = EEH_Template::display_template( GEN_SET_TEMPLATE_PATH . 'espresso_page_settings.template.php', $this->_template_args, TRUE );
286
+		$this->_set_add_edit_form_tags('update_espresso_page_settings');
287
+		$this->_set_publish_post_box_vars(NULL, FALSE, FALSE, NULL, FALSE);
288
+		$this->_template_args['admin_page_content'] = EEH_Template::display_template(GEN_SET_TEMPLATE_PATH.'espresso_page_settings.template.php', $this->_template_args, TRUE);
289 289
 		$this->display_admin_page_with_sidebar();
290 290
 
291 291
 	}
292 292
 
293 293
 	protected function _update_espresso_page_settings() {
294 294
 		// capture incoming request data
295
-		$reg_page_id = isset( $this->_req_data['reg_page_id'] ) ? absint( $this->_req_data['reg_page_id'] ) : EE_Registry::instance()->CFG->core->reg_page_id;
296
-		$txn_page_id = isset( $this->_req_data['txn_page_id'] ) ? absint( $this->_req_data['txn_page_id'] ) : EE_Registry::instance()->CFG->core->txn_page_id;
297
-		$thank_you_page_id = isset( $this->_req_data['thank_you_page_id'] ) ? absint( $this->_req_data['thank_you_page_id'] ) : EE_Registry::instance()->CFG->core->thank_you_page_id;
298
-		$cancel_page_id = isset( $this->_req_data['cancel_page_id'] ) ? absint( $this->_req_data['cancel_page_id'] ) : EE_Registry::instance()->CFG->core->cancel_page_id;
295
+		$reg_page_id = isset($this->_req_data['reg_page_id']) ? absint($this->_req_data['reg_page_id']) : EE_Registry::instance()->CFG->core->reg_page_id;
296
+		$txn_page_id = isset($this->_req_data['txn_page_id']) ? absint($this->_req_data['txn_page_id']) : EE_Registry::instance()->CFG->core->txn_page_id;
297
+		$thank_you_page_id = isset($this->_req_data['thank_you_page_id']) ? absint($this->_req_data['thank_you_page_id']) : EE_Registry::instance()->CFG->core->thank_you_page_id;
298
+		$cancel_page_id = isset($this->_req_data['cancel_page_id']) ? absint($this->_req_data['cancel_page_id']) : EE_Registry::instance()->CFG->core->cancel_page_id;
299 299
 		// pack critical_pages into an array
300 300
 		$critical_pages = array(
301 301
 			'reg_page_id' 				=> $reg_page_id,
@@ -303,17 +303,17 @@  discard block
 block discarded – undo
303 303
 			'thank_you_page_id' 	=> $thank_you_page_id,
304 304
 			'cancel_page_id' 		=> $cancel_page_id
305 305
 		);
306
-		foreach ( $critical_pages as $critical_page_name => $critical_page_id ) {
306
+		foreach ($critical_pages as $critical_page_name => $critical_page_id) {
307 307
 			// has the page changed ?
308
-			if ( EE_Registry::instance()->CFG->core->$critical_page_name != $critical_page_id ) {
308
+			if (EE_Registry::instance()->CFG->core->$critical_page_name != $critical_page_id) {
309 309
 				// grab post object for old page
310
-				$post = get_post( EE_Registry::instance()->CFG->core->$critical_page_name );
310
+				$post = get_post(EE_Registry::instance()->CFG->core->$critical_page_name);
311 311
 				// update post shortcodes for old page
312
-				EE_Admin::parse_post_content_on_save( $critical_page_id, $post );
312
+				EE_Admin::parse_post_content_on_save($critical_page_id, $post);
313 313
 				// grab post object for new page
314
-				$post = get_post( $critical_page_id );
314
+				$post = get_post($critical_page_id);
315 315
 				// update post shortcodes for new page
316
-				EE_Admin::parse_post_content_on_save( $critical_page_id, $post );
316
+				EE_Admin::parse_post_content_on_save($critical_page_id, $post);
317 317
 			}
318 318
 		}
319 319
 		// set page IDs
@@ -322,14 +322,14 @@  discard block
 block discarded – undo
322 322
 		EE_Registry::instance()->CFG->core->thank_you_page_id = $thank_you_page_id;
323 323
 		EE_Registry::instance()->CFG->core->cancel_page_id = $cancel_page_id;
324 324
 
325
-		EE_Registry::instance()->CFG->core = apply_filters( 'FHEE__General_Settings_Admin_Page___update_espresso_page_settings__CFG_core', EE_Registry::instance()->CFG->core, $this->_req_data );
325
+		EE_Registry::instance()->CFG->core = apply_filters('FHEE__General_Settings_Admin_Page___update_espresso_page_settings__CFG_core', EE_Registry::instance()->CFG->core, $this->_req_data);
326 326
 
327 327
 		$what = __('Critical Pages & Shortcodes', 'event_espresso');
328
-		$success = $this->_update_espresso_configuration( $what, EE_Registry::instance()->CFG->core, __FILE__, __FUNCTION__, __LINE__ );
328
+		$success = $this->_update_espresso_configuration($what, EE_Registry::instance()->CFG->core, __FILE__, __FUNCTION__, __LINE__);
329 329
 		$query_args = array(
330 330
 			'action' => 'critical_pages'
331 331
 			);
332
-		$this->_redirect_after_action( FALSE, '', '', $query_args, TRUE );
332
+		$this->_redirect_after_action(FALSE, '', '', $query_args, TRUE);
333 333
 
334 334
 	}
335 335
 
@@ -344,35 +344,35 @@  discard block
 block discarded – undo
344 344
 
345 345
 	protected function _your_organization_settings() {
346 346
 
347
-		$this->_template_args['site_license_key'] = isset( EE_Registry::instance()->NET_CFG->core->site_license_key ) ? EE_Registry::instance()->NET_CFG->core->get_pretty( 'site_license_key' ) : '';
348
-		$this->_template_args['organization_name'] = isset( EE_Registry::instance()->CFG->organization->name ) ? EE_Registry::instance()->CFG->organization->get_pretty( 'name' ) : '';
349
-		$this->_template_args['organization_address_1'] = isset( EE_Registry::instance()->CFG->organization->address_1 ) ? EE_Registry::instance()->CFG->organization->get_pretty( 'address_1' ) : '';
350
-		$this->_template_args['organization_address_2'] = isset( EE_Registry::instance()->CFG->organization->address_2 ) ? EE_Registry::instance()->CFG->organization->get_pretty( 'address_2' ) : '';
351
-		$this->_template_args['organization_city'] = isset( EE_Registry::instance()->CFG->organization->city ) ? EE_Registry::instance()->CFG->organization->get_pretty( 'city' ) : '';
352
-		$this->_template_args['organization_zip'] = isset( EE_Registry::instance()->CFG->organization->zip ) ? EE_Registry::instance()->CFG->organization->get_pretty( 'zip' ) : '';
353
-		$this->_template_args['organization_email'] = isset( EE_Registry::instance()->CFG->organization->email ) ? EE_Registry::instance()->CFG->organization->get_pretty( 'email' ) : '';
354
-		$this->_template_args['organization_phone'] = isset( EE_Registry::instance()->CFG->organization->phone ) ? EE_Registry::instance()->CFG->organization->get_pretty( 'phone' ) : '';
355
-		$this->_template_args['organization_vat'] = isset( EE_Registry::instance()->CFG->organization->vat ) ? EE_Registry::instance()->CFG->organization->get_pretty( 'vat' ) : '';
356
-		$this->_template_args['currency_sign'] = isset( EE_Registry::instance()->CFG->currency->sign ) ? EE_Registry::instance()->CFG->currency->get_pretty( 'sign' ) : '$';
357
-		$this->_template_args['organization_logo_url'] = isset( EE_Registry::instance()->CFG->organization->logo_url ) ? EE_Registry::instance()->CFG->organization->get_pretty( 'logo_url' ) : FALSE;
358
-		$this->_template_args['organization_facebook'] = isset( EE_Registry::instance()->CFG->organization->facebook ) ? EE_Registry::instance()->CFG->organization->get_pretty( 'facebook' ) : '';
359
-		$this->_template_args['organization_twitter'] = isset( EE_Registry::instance()->CFG->organization->twitter ) ? EE_Registry::instance()->CFG->organization->get_pretty( 'twitter' ) : '';
360
-		$this->_template_args['organization_linkedin'] = isset( EE_Registry::instance()->CFG->organization->linkedin ) ? EE_Registry::instance()->CFG->organization->get_pretty( 'linkedin' ) : '';
361
-		$this->_template_args['organization_pinterest'] = isset( EE_Registry::instance()->CFG->organization->pinterest ) ? EE_Registry::instance()->CFG->organization->get_pretty( 'pinterest' ) : '';
362
-		$this->_template_args['organization_google'] = isset( EE_Registry::instance()->CFG->organization->google ) ? EE_Registry::instance()->CFG->organization->get_pretty( 'google' ) : '';
363
-		$this->_template_args['organization_instagram'] = isset( EE_Registry::instance()->CFG->organization->instagram ) ? EE_Registry::instance()->CFG->organization->get_pretty( 'instagram' ) : '';
347
+		$this->_template_args['site_license_key'] = isset(EE_Registry::instance()->NET_CFG->core->site_license_key) ? EE_Registry::instance()->NET_CFG->core->get_pretty('site_license_key') : '';
348
+		$this->_template_args['organization_name'] = isset(EE_Registry::instance()->CFG->organization->name) ? EE_Registry::instance()->CFG->organization->get_pretty('name') : '';
349
+		$this->_template_args['organization_address_1'] = isset(EE_Registry::instance()->CFG->organization->address_1) ? EE_Registry::instance()->CFG->organization->get_pretty('address_1') : '';
350
+		$this->_template_args['organization_address_2'] = isset(EE_Registry::instance()->CFG->organization->address_2) ? EE_Registry::instance()->CFG->organization->get_pretty('address_2') : '';
351
+		$this->_template_args['organization_city'] = isset(EE_Registry::instance()->CFG->organization->city) ? EE_Registry::instance()->CFG->organization->get_pretty('city') : '';
352
+		$this->_template_args['organization_zip'] = isset(EE_Registry::instance()->CFG->organization->zip) ? EE_Registry::instance()->CFG->organization->get_pretty('zip') : '';
353
+		$this->_template_args['organization_email'] = isset(EE_Registry::instance()->CFG->organization->email) ? EE_Registry::instance()->CFG->organization->get_pretty('email') : '';
354
+		$this->_template_args['organization_phone'] = isset(EE_Registry::instance()->CFG->organization->phone) ? EE_Registry::instance()->CFG->organization->get_pretty('phone') : '';
355
+		$this->_template_args['organization_vat'] = isset(EE_Registry::instance()->CFG->organization->vat) ? EE_Registry::instance()->CFG->organization->get_pretty('vat') : '';
356
+		$this->_template_args['currency_sign'] = isset(EE_Registry::instance()->CFG->currency->sign) ? EE_Registry::instance()->CFG->currency->get_pretty('sign') : '$';
357
+		$this->_template_args['organization_logo_url'] = isset(EE_Registry::instance()->CFG->organization->logo_url) ? EE_Registry::instance()->CFG->organization->get_pretty('logo_url') : FALSE;
358
+		$this->_template_args['organization_facebook'] = isset(EE_Registry::instance()->CFG->organization->facebook) ? EE_Registry::instance()->CFG->organization->get_pretty('facebook') : '';
359
+		$this->_template_args['organization_twitter'] = isset(EE_Registry::instance()->CFG->organization->twitter) ? EE_Registry::instance()->CFG->organization->get_pretty('twitter') : '';
360
+		$this->_template_args['organization_linkedin'] = isset(EE_Registry::instance()->CFG->organization->linkedin) ? EE_Registry::instance()->CFG->organization->get_pretty('linkedin') : '';
361
+		$this->_template_args['organization_pinterest'] = isset(EE_Registry::instance()->CFG->organization->pinterest) ? EE_Registry::instance()->CFG->organization->get_pretty('pinterest') : '';
362
+		$this->_template_args['organization_google'] = isset(EE_Registry::instance()->CFG->organization->google) ? EE_Registry::instance()->CFG->organization->get_pretty('google') : '';
363
+		$this->_template_args['organization_instagram'] = isset(EE_Registry::instance()->CFG->organization->instagram) ? EE_Registry::instance()->CFG->organization->get_pretty('instagram') : '';
364 364
 		//UXIP settings
365
-		$this->_template_args['ee_ueip_optin'] = isset( EE_Registry::instance()->CFG->core->ee_ueip_optin ) ? EE_Registry::instance()->CFG->core->get_pretty( 'ee_ueip_optin' ) : TRUE;
365
+		$this->_template_args['ee_ueip_optin'] = isset(EE_Registry::instance()->CFG->core->ee_ueip_optin) ? EE_Registry::instance()->CFG->core->get_pretty('ee_ueip_optin') : TRUE;
366 366
 
367
-		EE_Registry::instance()->load_helper( 'Form_Fields' );
368
-		$STA_ID = isset( EE_Registry::instance()->CFG->organization->STA_ID ) ? EE_Registry::instance()->CFG->organization->STA_ID : 4;
367
+		EE_Registry::instance()->load_helper('Form_Fields');
368
+		$STA_ID = isset(EE_Registry::instance()->CFG->organization->STA_ID) ? EE_Registry::instance()->CFG->organization->STA_ID : 4;
369 369
 		$this->_template_args['states'] = new EE_Question_Form_Input(
370
-				EE_Question::new_instance ( array(
370
+				EE_Question::new_instance(array(
371 371
 					'QST_ID'=> 0,
372 372
 					'QST_display_text'=> __('State/Province', 'event_espresso'),
373 373
 					'QST_system'=>'admin-state'
374 374
 				)),
375
-				EE_Answer::new_instance ( array(
375
+				EE_Answer::new_instance(array(
376 376
 					'ANS_ID' => 0,
377 377
 					'ANS_value' => $STA_ID
378 378
 				)),
@@ -384,14 +384,14 @@  discard block
 block discarded – undo
384 384
 				)
385 385
 			);
386 386
 
387
-		$CNT_ISO = isset( EE_Registry::instance()->CFG->organization->CNT_ISO ) ? EE_Registry::instance()->CFG->organization->CNT_ISO : 'US';
387
+		$CNT_ISO = isset(EE_Registry::instance()->CFG->organization->CNT_ISO) ? EE_Registry::instance()->CFG->organization->CNT_ISO : 'US';
388 388
 		$this->_template_args['countries'] = new EE_Question_Form_Input(
389
-				EE_Question::new_instance ( array(
389
+				EE_Question::new_instance(array(
390 390
 					'QST_ID'=> 0,
391 391
 					'QST_display_text'=> __('Country', 'event_espresso'),
392 392
 					'QST_system'=>'admin-country'
393 393
 				)),
394
-				EE_Answer::new_instance ( array(
394
+				EE_Answer::new_instance(array(
395 395
 					'ANS_ID' => 0,
396 396
 					'ANS_value' => $CNT_ISO
397 397
 				)),
@@ -403,51 +403,51 @@  discard block
 block discarded – undo
403 403
 				)
404 404
 			);
405 405
 
406
-		add_filter( 'FHEE__EEH_Form_Fields__label_html', array( $this, 'country_form_field_label_wrap' ), 10, 2 );
407
-		add_filter( 'FHEE__EEH_Form_Fields__input_html', array( $this, 'country_form_field_input__wrap' ), 10, 2 );
406
+		add_filter('FHEE__EEH_Form_Fields__label_html', array($this, 'country_form_field_label_wrap'), 10, 2);
407
+		add_filter('FHEE__EEH_Form_Fields__input_html', array($this, 'country_form_field_input__wrap'), 10, 2);
408 408
 
409 409
 		//PUE verification stuff
410
-		$ver_option_key = 'puvererr_' . basename( EE_PLUGIN_BASENAME );
411
-		$verify_fail = get_option( $ver_option_key );
412
-		$this->_template_args['site_license_key_verified'] = $verify_fail || !empty( $verify_fail ) || ( empty( $this->_template_args['site_license_key'] ) && empty( $verify_fail ) )? '<span class="dashicons dashicons-admin-network ee-icon-color-ee-red ee-icon-size-20"></span>' : '<span class="dashicons dashicons-admin-network ee-icon-color-ee-green ee-icon-size-20"></span>';
410
+		$ver_option_key = 'puvererr_'.basename(EE_PLUGIN_BASENAME);
411
+		$verify_fail = get_option($ver_option_key);
412
+		$this->_template_args['site_license_key_verified'] = $verify_fail || ! empty($verify_fail) || (empty($this->_template_args['site_license_key']) && empty($verify_fail)) ? '<span class="dashicons dashicons-admin-network ee-icon-color-ee-red ee-icon-size-20"></span>' : '<span class="dashicons dashicons-admin-network ee-icon-color-ee-green ee-icon-size-20"></span>';
413 413
 
414
-		$this->_set_add_edit_form_tags( 'update_your_organization_settings' );
415
-		$this->_set_publish_post_box_vars( NULL, FALSE, FALSE, NULL, FALSE );
416
-		$this->_template_args['admin_page_content'] = EEH_Template::display_template( GEN_SET_TEMPLATE_PATH . 'your_organization_settings.template.php', $this->_template_args, TRUE );
414
+		$this->_set_add_edit_form_tags('update_your_organization_settings');
415
+		$this->_set_publish_post_box_vars(NULL, FALSE, FALSE, NULL, FALSE);
416
+		$this->_template_args['admin_page_content'] = EEH_Template::display_template(GEN_SET_TEMPLATE_PATH.'your_organization_settings.template.php', $this->_template_args, TRUE);
417 417
 
418 418
 		$this->display_admin_page_with_sidebar();
419 419
 	}
420 420
 
421 421
 	protected function _update_your_organization_settings() {
422
-		if ( is_main_site() )
423
-			EE_Registry::instance()->NET_CFG->core->site_license_key = isset( $this->_req_data['site_license_key'] ) ? sanitize_text_field( $this->_req_data['site_license_key'] ) : EE_Registry::instance()->NET_CFG->core->site_license_key;
424
-		EE_Registry::instance()->CFG->organization->name = isset( $this->_req_data['organization_name'] ) ? sanitize_text_field( $this->_req_data['organization_name'] ) : EE_Registry::instance()->CFG->organization->name;
425
-		EE_Registry::instance()->CFG->organization->address_1 = isset( $this->_req_data['organization_address_1'] ) ? sanitize_text_field( $this->_req_data['organization_address_1'] ) : EE_Registry::instance()->CFG->organization->address_1;
426
-		EE_Registry::instance()->CFG->organization->address_2 = isset( $this->_req_data['organization_address_2'] ) ? sanitize_text_field( $this->_req_data['organization_address_2'] ) : EE_Registry::instance()->CFG->organization->address_2;
427
-		EE_Registry::instance()->CFG->organization->city = isset( $this->_req_data['organization_city'] ) ? sanitize_text_field( $this->_req_data['organization_city'] ) : EE_Registry::instance()->CFG->organization->city;
428
-		EE_Registry::instance()->CFG->organization->STA_ID = isset( $this->_req_data['organization_state'] ) ? absint( $this->_req_data['organization_state'] ) : EE_Registry::instance()->CFG->organization->STA_ID;
429
-		EE_Registry::instance()->CFG->organization->CNT_ISO = isset( $this->_req_data['organization_country'] ) ? sanitize_text_field( $this->_req_data['organization_country'] ) : EE_Registry::instance()->CFG->organization->CNT_ISO;
430
-		EE_Registry::instance()->CFG->organization->zip = isset( $this->_req_data['organization_zip'] ) ? sanitize_text_field( $this->_req_data['organization_zip'] ) : EE_Registry::instance()->CFG->organization->zip;
431
-		EE_Registry::instance()->CFG->organization->email = isset( $this->_req_data['organization_email'] ) ? sanitize_email( $this->_req_data['organization_email'] ) : EE_Registry::instance()->CFG->organization->email;
432
-		EE_Registry::instance()->CFG->organization->vat = isset( $this->_req_data['organization_vat'] ) ? sanitize_text_field( $this->_req_data['organization_vat'] ) : EE_Registry::instance()->CFG->organization->vat;
433
-		EE_Registry::instance()->CFG->organization->phone = isset( $this->_req_data['organization_phone'] ) ? sanitize_text_field( $this->_req_data['organization_phone'] ) : EE_Registry::instance()->CFG->organization->phone;
434
-		EE_Registry::instance()->CFG->organization->logo_url = isset( $this->_req_data['organization_logo_url'] ) ? esc_url_raw( $this->_req_data['organization_logo_url'] ) : EE_Registry::instance()->CFG->organization->logo_url;
435
-		EE_Registry::instance()->CFG->organization->facebook = isset( $this->_req_data['organization_facebook'] ) ? esc_url_raw( $this->_req_data['organization_facebook'] ) : EE_Registry::instance()->CFG->organization->facebook;
436
-		EE_Registry::instance()->CFG->organization->twitter = isset( $this->_req_data['organization_twitter'] ) ? esc_url_raw( $this->_req_data['organization_twitter'] ) : EE_Registry::instance()->CFG->organization->twitter;
437
-		EE_Registry::instance()->CFG->organization->linkedin = isset( $this->_req_data['organization_linkedin'] ) ? esc_url_raw( $this->_req_data['organization_linkedin'] ) : EE_Registry::instance()->CFG->organization->linkedin;
438
-		EE_Registry::instance()->CFG->organization->pinterest = isset( $this->_req_data['organization_pinterest'] ) ? esc_url_raw( $this->_req_data['organization_pinterest'] ) : EE_Registry::instance()->CFG->organization->pinterest;
439
-		EE_Registry::instance()->CFG->organization->google = isset( $this->_req_data['organization_google'] ) ? esc_url_raw( $this->_req_data['organization_google'] ) : EE_Registry::instance()->CFG->organization->google;
440
-		EE_Registry::instance()->CFG->organization->instagram = isset( $this->_req_data['organization_instagram'] ) ? esc_url_raw( $this->_req_data['organization_instagram'] ) : EE_Registry::instance()->CFG->organization->instagram;
441
-		EE_Registry::instance()->CFG->core->ee_ueip_optin = isset( $this->_req_data['ueip_optin'] ) && !empty( $this->_req_data['ueip_optin'] ) ? $this->_req_data['ueip_optin'] : EE_Registry::instance()->CFG->core->ee_ueip_optin;
442
-
443
-		EE_Registry::instance()->CFG->currency = new EE_Currency_Config( EE_Registry::instance()->CFG->organization->CNT_ISO );
444
-
445
-		EE_Registry::instance()->CFG = apply_filters( 'FHEE__General_Settings_Admin_Page___update_your_organization_settings__CFG', EE_Registry::instance()->CFG );
422
+		if (is_main_site())
423
+			EE_Registry::instance()->NET_CFG->core->site_license_key = isset($this->_req_data['site_license_key']) ? sanitize_text_field($this->_req_data['site_license_key']) : EE_Registry::instance()->NET_CFG->core->site_license_key;
424
+		EE_Registry::instance()->CFG->organization->name = isset($this->_req_data['organization_name']) ? sanitize_text_field($this->_req_data['organization_name']) : EE_Registry::instance()->CFG->organization->name;
425
+		EE_Registry::instance()->CFG->organization->address_1 = isset($this->_req_data['organization_address_1']) ? sanitize_text_field($this->_req_data['organization_address_1']) : EE_Registry::instance()->CFG->organization->address_1;
426
+		EE_Registry::instance()->CFG->organization->address_2 = isset($this->_req_data['organization_address_2']) ? sanitize_text_field($this->_req_data['organization_address_2']) : EE_Registry::instance()->CFG->organization->address_2;
427
+		EE_Registry::instance()->CFG->organization->city = isset($this->_req_data['organization_city']) ? sanitize_text_field($this->_req_data['organization_city']) : EE_Registry::instance()->CFG->organization->city;
428
+		EE_Registry::instance()->CFG->organization->STA_ID = isset($this->_req_data['organization_state']) ? absint($this->_req_data['organization_state']) : EE_Registry::instance()->CFG->organization->STA_ID;
429
+		EE_Registry::instance()->CFG->organization->CNT_ISO = isset($this->_req_data['organization_country']) ? sanitize_text_field($this->_req_data['organization_country']) : EE_Registry::instance()->CFG->organization->CNT_ISO;
430
+		EE_Registry::instance()->CFG->organization->zip = isset($this->_req_data['organization_zip']) ? sanitize_text_field($this->_req_data['organization_zip']) : EE_Registry::instance()->CFG->organization->zip;
431
+		EE_Registry::instance()->CFG->organization->email = isset($this->_req_data['organization_email']) ? sanitize_email($this->_req_data['organization_email']) : EE_Registry::instance()->CFG->organization->email;
432
+		EE_Registry::instance()->CFG->organization->vat = isset($this->_req_data['organization_vat']) ? sanitize_text_field($this->_req_data['organization_vat']) : EE_Registry::instance()->CFG->organization->vat;
433
+		EE_Registry::instance()->CFG->organization->phone = isset($this->_req_data['organization_phone']) ? sanitize_text_field($this->_req_data['organization_phone']) : EE_Registry::instance()->CFG->organization->phone;
434
+		EE_Registry::instance()->CFG->organization->logo_url = isset($this->_req_data['organization_logo_url']) ? esc_url_raw($this->_req_data['organization_logo_url']) : EE_Registry::instance()->CFG->organization->logo_url;
435
+		EE_Registry::instance()->CFG->organization->facebook = isset($this->_req_data['organization_facebook']) ? esc_url_raw($this->_req_data['organization_facebook']) : EE_Registry::instance()->CFG->organization->facebook;
436
+		EE_Registry::instance()->CFG->organization->twitter = isset($this->_req_data['organization_twitter']) ? esc_url_raw($this->_req_data['organization_twitter']) : EE_Registry::instance()->CFG->organization->twitter;
437
+		EE_Registry::instance()->CFG->organization->linkedin = isset($this->_req_data['organization_linkedin']) ? esc_url_raw($this->_req_data['organization_linkedin']) : EE_Registry::instance()->CFG->organization->linkedin;
438
+		EE_Registry::instance()->CFG->organization->pinterest = isset($this->_req_data['organization_pinterest']) ? esc_url_raw($this->_req_data['organization_pinterest']) : EE_Registry::instance()->CFG->organization->pinterest;
439
+		EE_Registry::instance()->CFG->organization->google = isset($this->_req_data['organization_google']) ? esc_url_raw($this->_req_data['organization_google']) : EE_Registry::instance()->CFG->organization->google;
440
+		EE_Registry::instance()->CFG->organization->instagram = isset($this->_req_data['organization_instagram']) ? esc_url_raw($this->_req_data['organization_instagram']) : EE_Registry::instance()->CFG->organization->instagram;
441
+		EE_Registry::instance()->CFG->core->ee_ueip_optin = isset($this->_req_data['ueip_optin']) && ! empty($this->_req_data['ueip_optin']) ? $this->_req_data['ueip_optin'] : EE_Registry::instance()->CFG->core->ee_ueip_optin;
442
+
443
+		EE_Registry::instance()->CFG->currency = new EE_Currency_Config(EE_Registry::instance()->CFG->organization->CNT_ISO);
444
+
445
+		EE_Registry::instance()->CFG = apply_filters('FHEE__General_Settings_Admin_Page___update_your_organization_settings__CFG', EE_Registry::instance()->CFG);
446 446
 
447 447
 		$what = 'Your Organization Settings';
448
-		$success = $this->_update_espresso_configuration( $what, EE_Registry::instance()->CFG, __FILE__, __FUNCTION__, __LINE__ );
448
+		$success = $this->_update_espresso_configuration($what, EE_Registry::instance()->CFG, __FILE__, __FUNCTION__, __LINE__);
449 449
 
450
-		$this->_redirect_after_action( $success, $what, 'updated', array( 'action' => 'default' ) );
450
+		$this->_redirect_after_action($success, $what, 'updated', array('action' => 'default'));
451 451
 
452 452
 	}
453 453
 
@@ -458,36 +458,36 @@  discard block
 block discarded – undo
458 458
 	protected function _admin_option_settings() {
459 459
 
460 460
 		$this->_template_args['values'] = $this->_yes_no_values;
461
-		$this->_template_args['use_personnel_manager'] = isset( EE_Registry::instance()->CFG->admin->use_personnel_manager ) ? absint( EE_Registry::instance()->CFG->admin->use_personnel_manager ) : FALSE;
462
-		$this->_template_args['use_dashboard_widget'] = isset( EE_Registry::instance()->CFG->admin->use_dashboard_widget ) ? absint( EE_Registry::instance()->CFG->admin->use_dashboard_widget ) : TRUE;
463
-		$this->_template_args['events_in_dashboard'] = isset( EE_Registry::instance()->CFG->admin->events_in_dashboard ) ? absint( EE_Registry::instance()->CFG->admin->events_in_dashboard ) : 30;
464
-		$this->_template_args['use_event_timezones'] = isset( EE_Registry::instance()->CFG->admin->use_event_timezones ) ? absint( EE_Registry::instance()->CFG->admin->use_event_timezones ) : FALSE;
465
-		$this->_template_args['show_reg_footer'] = isset( EE_Registry::instance()->CFG->admin->show_reg_footer ) ? absint( EE_Registry::instance()->CFG->admin->show_reg_footer ) : TRUE;
466
-		$this->_template_args['affiliate_id'] = isset( EE_Registry::instance()->CFG->admin->affiliate_id ) ? EE_Registry::instance()->CFG->admin->get_pretty('affiliate_id') : '';
467
-		$this->_template_args['help_tour_activation'] = isset( EE_Registry::instance()->CFG->admin->help_tour_activation ) ? absint( EE_Registry::instance()->CFG->admin->help_tour_activation ): 1;
468
-
469
-		$this->_set_add_edit_form_tags( 'update_admin_option_settings' );
470
-		$this->_set_publish_post_box_vars( NULL, FALSE, FALSE, NULL, FALSE );
461
+		$this->_template_args['use_personnel_manager'] = isset(EE_Registry::instance()->CFG->admin->use_personnel_manager) ? absint(EE_Registry::instance()->CFG->admin->use_personnel_manager) : FALSE;
462
+		$this->_template_args['use_dashboard_widget'] = isset(EE_Registry::instance()->CFG->admin->use_dashboard_widget) ? absint(EE_Registry::instance()->CFG->admin->use_dashboard_widget) : TRUE;
463
+		$this->_template_args['events_in_dashboard'] = isset(EE_Registry::instance()->CFG->admin->events_in_dashboard) ? absint(EE_Registry::instance()->CFG->admin->events_in_dashboard) : 30;
464
+		$this->_template_args['use_event_timezones'] = isset(EE_Registry::instance()->CFG->admin->use_event_timezones) ? absint(EE_Registry::instance()->CFG->admin->use_event_timezones) : FALSE;
465
+		$this->_template_args['show_reg_footer'] = isset(EE_Registry::instance()->CFG->admin->show_reg_footer) ? absint(EE_Registry::instance()->CFG->admin->show_reg_footer) : TRUE;
466
+		$this->_template_args['affiliate_id'] = isset(EE_Registry::instance()->CFG->admin->affiliate_id) ? EE_Registry::instance()->CFG->admin->get_pretty('affiliate_id') : '';
467
+		$this->_template_args['help_tour_activation'] = isset(EE_Registry::instance()->CFG->admin->help_tour_activation) ? absint(EE_Registry::instance()->CFG->admin->help_tour_activation) : 1;
468
+
469
+		$this->_set_add_edit_form_tags('update_admin_option_settings');
470
+		$this->_set_publish_post_box_vars(NULL, FALSE, FALSE, NULL, FALSE);
471 471
 		$this->_template_args['template_args'] = $this->_template_args;
472
-		$this->_template_args['admin_page_content'] = EEH_Template::display_template( GEN_SET_TEMPLATE_PATH . 'admin_option_settings.template.php', $this->_template_args, TRUE );
472
+		$this->_template_args['admin_page_content'] = EEH_Template::display_template(GEN_SET_TEMPLATE_PATH.'admin_option_settings.template.php', $this->_template_args, TRUE);
473 473
 		$this->display_admin_page_with_sidebar();
474 474
 	}
475 475
 
476 476
 	protected function _update_admin_option_settings() {
477
-		EE_Registry::instance()->CFG->admin->use_personnel_manager = isset( $this->_req_data['use_personnel_manager'] ) ? absint( $this->_req_data['use_personnel_manager'] ) : EE_Registry::instance()->CFG->admin->use_personnel_manager;
478
-		EE_Registry::instance()->CFG->admin->use_dashboard_widget = isset( $this->_req_data['use_dashboard_widget'] ) ? absint( $this->_req_data['use_dashboard_widget'] ) : EE_Registry::instance()->CFG->admin->use_dashboard_widget;
479
-		EE_Registry::instance()->CFG->admin->events_in_dashboard = isset( $this->_req_data['events_in_dashboard'] ) ? absint( $this->_req_data['events_in_dashboard'] ) : EE_Registry::instance()->CFG->admin->events_in_dashboard;
480
-		EE_Registry::instance()->CFG->admin->use_event_timezones = isset( $this->_req_data['use_event_timezones'] ) ? absint( $this->_req_data['use_event_timezones'] ) : EE_Registry::instance()->CFG->admin->use_event_timezones;
481
-		EE_Registry::instance()->CFG->admin->show_reg_footer = isset( $this->_req_data['show_reg_footer'] ) ? absint( $this->_req_data['show_reg_footer'] ) : EE_Registry::instance()->CFG->admin->show_reg_footer;
482
-		EE_Registry::instance()->CFG->admin->affiliate_id = isset( $this->_req_data['affiliate_id'] ) ? sanitize_text_field( $this->_req_data['affiliate_id'] ) : EE_Registry::instance()->CFG->admin->affiliate_id;
483
-		EE_Registry::instance()->CFG->admin->help_tour_activation = isset( $this->_req_data['help_tour_activation'] ) ? absint( $this->_req_data['help_tour_activation'] ) : EE_Registry::instance()->CFG->admin->help_tour_activation;
477
+		EE_Registry::instance()->CFG->admin->use_personnel_manager = isset($this->_req_data['use_personnel_manager']) ? absint($this->_req_data['use_personnel_manager']) : EE_Registry::instance()->CFG->admin->use_personnel_manager;
478
+		EE_Registry::instance()->CFG->admin->use_dashboard_widget = isset($this->_req_data['use_dashboard_widget']) ? absint($this->_req_data['use_dashboard_widget']) : EE_Registry::instance()->CFG->admin->use_dashboard_widget;
479
+		EE_Registry::instance()->CFG->admin->events_in_dashboard = isset($this->_req_data['events_in_dashboard']) ? absint($this->_req_data['events_in_dashboard']) : EE_Registry::instance()->CFG->admin->events_in_dashboard;
480
+		EE_Registry::instance()->CFG->admin->use_event_timezones = isset($this->_req_data['use_event_timezones']) ? absint($this->_req_data['use_event_timezones']) : EE_Registry::instance()->CFG->admin->use_event_timezones;
481
+		EE_Registry::instance()->CFG->admin->show_reg_footer = isset($this->_req_data['show_reg_footer']) ? absint($this->_req_data['show_reg_footer']) : EE_Registry::instance()->CFG->admin->show_reg_footer;
482
+		EE_Registry::instance()->CFG->admin->affiliate_id = isset($this->_req_data['affiliate_id']) ? sanitize_text_field($this->_req_data['affiliate_id']) : EE_Registry::instance()->CFG->admin->affiliate_id;
483
+		EE_Registry::instance()->CFG->admin->help_tour_activation = isset($this->_req_data['help_tour_activation']) ? absint($this->_req_data['help_tour_activation']) : EE_Registry::instance()->CFG->admin->help_tour_activation;
484 484
 
485
-		EE_Registry::instance()->CFG->admin = apply_filters( 'FHEE__General_Settings_Admin_Page___update_admin_option_settings__CFG_admin', EE_Registry::instance()->CFG->admin );
485
+		EE_Registry::instance()->CFG->admin = apply_filters('FHEE__General_Settings_Admin_Page___update_admin_option_settings__CFG_admin', EE_Registry::instance()->CFG->admin);
486 486
 
487 487
 		$what = 'Admin Options';
488
-		$success = $this->_update_espresso_configuration( $what, EE_Registry::instance()->CFG->admin, __FILE__, __FUNCTION__, __LINE__ );
489
-		$success = apply_filters( 'FHEE__General_Settings_Admin_Page___update_admin_option_settings__success', $success );
490
-		$this->_redirect_after_action( $success, $what, 'updated', array( 'action' => 'admin_option_settings' ) );
488
+		$success = $this->_update_espresso_configuration($what, EE_Registry::instance()->CFG->admin, __FILE__, __FUNCTION__, __LINE__);
489
+		$success = apply_filters('FHEE__General_Settings_Admin_Page___update_admin_option_settings__success', $success);
490
+		$this->_redirect_after_action($success, $what, 'updated', array('action' => 'admin_option_settings'));
491 491
 
492 492
 	}
493 493
 
@@ -500,21 +500,21 @@  discard block
 block discarded – undo
500 500
 
501 501
 	protected function _country_settings() {
502 502
 
503
-		$CNT_ISO = isset( EE_Registry::instance()->CFG->organization->CNT_ISO ) ? EE_Registry::instance()->CFG->organization->CNT_ISO : 'US';
504
-		$CNT_ISO = isset( $this->_req_data['country'] ) ? strtoupper( sanitize_text_field( $this->_req_data['country'] )) : $CNT_ISO;
503
+		$CNT_ISO = isset(EE_Registry::instance()->CFG->organization->CNT_ISO) ? EE_Registry::instance()->CFG->organization->CNT_ISO : 'US';
504
+		$CNT_ISO = isset($this->_req_data['country']) ? strtoupper(sanitize_text_field($this->_req_data['country'])) : $CNT_ISO;
505 505
 
506 506
 		//load field generator helper
507
-		EE_Registry::instance()->load_helper( 'Form_Fields' );
507
+		EE_Registry::instance()->load_helper('Form_Fields');
508 508
 
509 509
 		$this->_template_args['values'] = $this->_yes_no_values;
510 510
 
511 511
 		$this->_template_args['countries'] = new EE_Question_Form_Input(
512
-				EE_Question::new_instance ( array(
512
+				EE_Question::new_instance(array(
513 513
 					'QST_ID'=> 0,
514 514
 					'QST_display_text'=> __('Select Country', 'event_espresso'),
515 515
 					'QST_system'=>'admin-country'
516 516
 				)),
517
-				EE_Answer::new_instance ( array(
517
+				EE_Answer::new_instance(array(
518 518
 					'ANS_ID' => 0,
519 519
 					'ANS_value' => $CNT_ISO
520 520
 				)),
@@ -527,14 +527,14 @@  discard block
 block discarded – undo
527 527
 			);
528 528
 //		EEH_Debug_Tools::printr( $this->_template_args['countries'], 'countries  <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span>', 'auto' );
529 529
 
530
-		add_filter( 'FHEE__EEH_Form_Fields__label_html', array( $this, 'country_form_field_label_wrap' ), 10, 2 );
531
-		add_filter( 'FHEE__EEH_Form_Fields__input_html', array( $this, 'country_form_field_input__wrap' ), 10, 2 );
530
+		add_filter('FHEE__EEH_Form_Fields__label_html', array($this, 'country_form_field_label_wrap'), 10, 2);
531
+		add_filter('FHEE__EEH_Form_Fields__input_html', array($this, 'country_form_field_input__wrap'), 10, 2);
532 532
 		$this->_template_args['country_details_settings'] = $this->display_country_settings();
533 533
 		$this->_template_args['country_states_settings'] = $this->display_country_states();
534 534
 
535
-		$this->_set_add_edit_form_tags( 'update_country_settings' );
536
-		$this->_set_publish_post_box_vars( NULL, FALSE, FALSE, NULL, FALSE );
537
-		$this->_template_args['admin_page_content'] = EEH_Template::display_template( GEN_SET_TEMPLATE_PATH . 'countries_settings.template.php', $this->_template_args, TRUE );
535
+		$this->_set_add_edit_form_tags('update_country_settings');
536
+		$this->_set_publish_post_box_vars(NULL, FALSE, FALSE, NULL, FALSE);
537
+		$this->_template_args['admin_page_content'] = EEH_Template::display_template(GEN_SET_TEMPLATE_PATH.'countries_settings.template.php', $this->_template_args, TRUE);
538 538
 		$this->display_admin_page_with_no_sidebar();
539 539
 	}
540 540
 
@@ -547,44 +547,44 @@  discard block
 block discarded – undo
547 547
 	 * 		@param 	string 		$CNT_ISO
548 548
 	 * 		@return 		mixed		string | array
549 549
 	 */
550
-	public function display_country_settings( $CNT_ISO = '' ) {
550
+	public function display_country_settings($CNT_ISO = '') {
551 551
 
552
-		$CNT_ISO = isset( $this->_req_data['country'] ) ? strtoupper( sanitize_text_field( $this->_req_data['country'] )) : $CNT_ISO;
553
-		if ( ! $CNT_ISO ) {
552
+		$CNT_ISO = isset($this->_req_data['country']) ? strtoupper(sanitize_text_field($this->_req_data['country'])) : $CNT_ISO;
553
+		if ( ! $CNT_ISO) {
554 554
 			return '';
555 555
 		}
556 556
 
557 557
 		// for ajax
558
-		EE_Registry::instance()->load_helper( 'Form_Fields' );
559
-		remove_all_filters( 'FHEE__EEH_Form_Fields__label_html' );
560
-		remove_all_filters( 'FHEE__EEH_Form_Fields__input_html' );
561
-		add_filter( 'FHEE__EEH_Form_Fields__label_html', array( $this, 'country_form_field_label_wrap' ), 10, 2 );
562
-		add_filter( 'FHEE__EEH_Form_Fields__input_html', array( $this, 'country_form_field_input__wrap' ), 10, 2 );
563
-		$country = EEM_Country::instance()->get_one_by_ID( $CNT_ISO );
558
+		EE_Registry::instance()->load_helper('Form_Fields');
559
+		remove_all_filters('FHEE__EEH_Form_Fields__label_html');
560
+		remove_all_filters('FHEE__EEH_Form_Fields__input_html');
561
+		add_filter('FHEE__EEH_Form_Fields__label_html', array($this, 'country_form_field_label_wrap'), 10, 2);
562
+		add_filter('FHEE__EEH_Form_Fields__input_html', array($this, 'country_form_field_input__wrap'), 10, 2);
563
+		$country = EEM_Country::instance()->get_one_by_ID($CNT_ISO);
564 564
 		//EEH_Debug_Tools::printr( $country, '$country  <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span>', 'auto' );
565 565
 		$country_input_types = array(
566
-			'CNT_active' => array( 'type' => 'RADIO_BTN', 'input_name' => 'cntry[' . $CNT_ISO . ']', 'class' => '', 'options' => $this->_yes_no_values, 'use_desc_4_label' => TRUE  ),
567
-			'CNT_ISO' => array( 'type' => 'TEXT', 'input_name' => 'cntry[' . $CNT_ISO . ']', 'class' => 'small-text' ),
568
-			'CNT_ISO3' => array( 'type' => 'TEXT', 'input_name' => 'cntry[' . $CNT_ISO . ']', 'class' => 'small-text' ),
569
-			'RGN_ID' => array( 'type' => 'TEXT', 'input_name' => 'cntry[' . $CNT_ISO . ']', 'class' => 'small-text' ),
570
-			'CNT_name' => array( 'type' => 'TEXT', 'input_name' => 'cntry[' . $CNT_ISO . ']', 'class' => 'regular-text' ),
571
-			'CNT_cur_code' => array( 'type' => 'TEXT', 'input_name' => 'cntry[' . $CNT_ISO . ']', 'class' => 'small-text' ),
572
-			'CNT_cur_single' => array( 'type' => 'TEXT', 'input_name' => 'cntry[' . $CNT_ISO . ']', 'class' => 'medium-text' ),
573
-			'CNT_cur_plural' => array( 'type' => 'TEXT', 'input_name' => 'cntry[' . $CNT_ISO . ']', 'class' => 'medium-text' ),
574
-			'CNT_cur_sign' => array( 'type' => 'TEXT', 'input_name' => 'cntry[' . $CNT_ISO . ']', 'class' => 'small-text', 'htmlentities' => FALSE ),
575
-			'CNT_cur_sign_b4' => array( 'type' => 'RADIO_BTN', 'input_name' => 'cntry[' . $CNT_ISO . ']', 'class' => '', 'options' => $this->_yes_no_values, 'use_desc_4_label' => TRUE ),
576
-			'CNT_cur_dec_plc' => array( 'type' => 'RADIO_BTN', 'input_name' => 'cntry[' . $CNT_ISO . ']', 'class' => '', 'options' => array( array( 'id' => 0, 'text' => '' ), array( 'id' => 1, 'text' => '' ), array( 'id' => 2, 'text' => '' ), array( 'id' => 3, 'text' => '' ))),
577
-			'CNT_cur_dec_mrk' => array( 'type' => 'RADIO_BTN', 'input_name' => 'cntry[' . $CNT_ISO . ']', 'class' => '', 'options' => array( array( 'id' => ',', 'text' => __(', (comma)', 'event_espresso')), array( 'id' => '.', 'text' => __('. (decimal)', 'event_espresso'))), 'use_desc_4_label' => TRUE ),
578
-			'CNT_cur_thsnds' => array( 'type' => 'RADIO_BTN', 'input_name' => 'cntry[' . $CNT_ISO . ']', 'class' => '', 'options' => array( array( 'id' => ',', 'text' => __(', (comma)', 'event_espresso')), array( 'id' => '.', 'text' => __('. (decimal)', 'event_espresso'))), 'use_desc_4_label' => TRUE ),
579
-			'CNT_tel_code' => array( 'type' => 'TEXT', 'input_name' => 'cntry[' . $CNT_ISO . ']', 'class' => 'small-text' ),
580
-			'CNT_is_EU' => array( 'type' => 'RADIO_BTN', 'input_name' => 'cntry[' . $CNT_ISO . ']', 'class' => '', 'options' => $this->_yes_no_values, 'use_desc_4_label' => TRUE  )
566
+			'CNT_active' => array('type' => 'RADIO_BTN', 'input_name' => 'cntry['.$CNT_ISO.']', 'class' => '', 'options' => $this->_yes_no_values, 'use_desc_4_label' => TRUE),
567
+			'CNT_ISO' => array('type' => 'TEXT', 'input_name' => 'cntry['.$CNT_ISO.']', 'class' => 'small-text'),
568
+			'CNT_ISO3' => array('type' => 'TEXT', 'input_name' => 'cntry['.$CNT_ISO.']', 'class' => 'small-text'),
569
+			'RGN_ID' => array('type' => 'TEXT', 'input_name' => 'cntry['.$CNT_ISO.']', 'class' => 'small-text'),
570
+			'CNT_name' => array('type' => 'TEXT', 'input_name' => 'cntry['.$CNT_ISO.']', 'class' => 'regular-text'),
571
+			'CNT_cur_code' => array('type' => 'TEXT', 'input_name' => 'cntry['.$CNT_ISO.']', 'class' => 'small-text'),
572
+			'CNT_cur_single' => array('type' => 'TEXT', 'input_name' => 'cntry['.$CNT_ISO.']', 'class' => 'medium-text'),
573
+			'CNT_cur_plural' => array('type' => 'TEXT', 'input_name' => 'cntry['.$CNT_ISO.']', 'class' => 'medium-text'),
574
+			'CNT_cur_sign' => array('type' => 'TEXT', 'input_name' => 'cntry['.$CNT_ISO.']', 'class' => 'small-text', 'htmlentities' => FALSE),
575
+			'CNT_cur_sign_b4' => array('type' => 'RADIO_BTN', 'input_name' => 'cntry['.$CNT_ISO.']', 'class' => '', 'options' => $this->_yes_no_values, 'use_desc_4_label' => TRUE),
576
+			'CNT_cur_dec_plc' => array('type' => 'RADIO_BTN', 'input_name' => 'cntry['.$CNT_ISO.']', 'class' => '', 'options' => array(array('id' => 0, 'text' => ''), array('id' => 1, 'text' => ''), array('id' => 2, 'text' => ''), array('id' => 3, 'text' => ''))),
577
+			'CNT_cur_dec_mrk' => array('type' => 'RADIO_BTN', 'input_name' => 'cntry['.$CNT_ISO.']', 'class' => '', 'options' => array(array('id' => ',', 'text' => __(', (comma)', 'event_espresso')), array('id' => '.', 'text' => __('. (decimal)', 'event_espresso'))), 'use_desc_4_label' => TRUE),
578
+			'CNT_cur_thsnds' => array('type' => 'RADIO_BTN', 'input_name' => 'cntry['.$CNT_ISO.']', 'class' => '', 'options' => array(array('id' => ',', 'text' => __(', (comma)', 'event_espresso')), array('id' => '.', 'text' => __('. (decimal)', 'event_espresso'))), 'use_desc_4_label' => TRUE),
579
+			'CNT_tel_code' => array('type' => 'TEXT', 'input_name' => 'cntry['.$CNT_ISO.']', 'class' => 'small-text'),
580
+			'CNT_is_EU' => array('type' => 'RADIO_BTN', 'input_name' => 'cntry['.$CNT_ISO.']', 'class' => '', 'options' => $this->_yes_no_values, 'use_desc_4_label' => TRUE)
581 581
 		);
582
-		$this->_template_args['inputs'] = EE_Question_Form_Input::generate_question_form_inputs_for_object( $country, $country_input_types );
583
-		$country_details_settings = EEH_Template::display_template( GEN_SET_TEMPLATE_PATH . 'country_details_settings.template.php', $this->_template_args, TRUE );
582
+		$this->_template_args['inputs'] = EE_Question_Form_Input::generate_question_form_inputs_for_object($country, $country_input_types);
583
+		$country_details_settings = EEH_Template::display_template(GEN_SET_TEMPLATE_PATH.'country_details_settings.template.php', $this->_template_args, TRUE);
584 584
 
585
-		if ( defined( 'DOING_AJAX' )) {
586
-			$notices = EE_Error::get_notices( FALSE, FALSE, FALSE );
587
-			echo json_encode( array( 'return_data' => $country_details_settings, 'success' => $notices['success'], 'errors' => $notices['errors'] ));
585
+		if (defined('DOING_AJAX')) {
586
+			$notices = EE_Error::get_notices(FALSE, FALSE, FALSE);
587
+			echo json_encode(array('return_data' => $country_details_settings, 'success' => $notices['success'], 'errors' => $notices['errors']));
588 588
 			die();
589 589
 		} else {
590 590
 			return $country_details_settings;
@@ -602,50 +602,50 @@  discard block
 block discarded – undo
602 602
 	 * 		@param 	string 		$CNT_ISO
603 603
 	 * 		@return 		string
604 604
 	 */
605
-	public function display_country_states( $CNT_ISO = '' ) {
605
+	public function display_country_states($CNT_ISO = '') {
606 606
 
607
-		$CNT_ISO = isset( $this->_req_data['country'] ) ? sanitize_text_field( $this->_req_data['country'] ) : $CNT_ISO;
607
+		$CNT_ISO = isset($this->_req_data['country']) ? sanitize_text_field($this->_req_data['country']) : $CNT_ISO;
608 608
 
609
-		if ( ! $CNT_ISO ) {
609
+		if ( ! $CNT_ISO) {
610 610
 			return '';
611 611
 		}
612 612
 		// for ajax
613
-		EE_Registry::instance()->load_helper( 'Form_Fields' );
614
-		remove_all_filters( 'FHEE__EEH_Form_Fields__label_html' );
615
-		remove_all_filters( 'FHEE__EEH_Form_Fields__input_html' );
616
-		add_filter( 'FHEE__EEH_Form_Fields__label_html', array( $this, 'state_form_field_label_wrap' ), 10, 2 );
617
-		add_filter( 'FHEE__EEH_Form_Fields__input_html', array( $this, 'state_form_field_input__wrap' ), 10, 2 );
618
-		$states = EEM_State::instance()->get_all_states_for_these_countries( array( $CNT_ISO => $CNT_ISO ));
613
+		EE_Registry::instance()->load_helper('Form_Fields');
614
+		remove_all_filters('FHEE__EEH_Form_Fields__label_html');
615
+		remove_all_filters('FHEE__EEH_Form_Fields__input_html');
616
+		add_filter('FHEE__EEH_Form_Fields__label_html', array($this, 'state_form_field_label_wrap'), 10, 2);
617
+		add_filter('FHEE__EEH_Form_Fields__input_html', array($this, 'state_form_field_input__wrap'), 10, 2);
618
+		$states = EEM_State::instance()->get_all_states_for_these_countries(array($CNT_ISO => $CNT_ISO));
619 619
 
620 620
 //			echo '<h4>$CNT_ISO : ' . $CNT_ISO . '  <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span></h4>';
621 621
 //			global $wpdb;
622 622
 //			echo '<h4>' . $wpdb->last_query . '  <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span></h4>';
623 623
 //			EEH_Debug_Tools::printr( $states, '$states  <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span>', 'auto' );
624
-		if ( $states ) {
625
-			foreach ( $states as $STA_ID => $state ) {
626
-				if ( $state instanceof EE_State ) {
624
+		if ($states) {
625
+			foreach ($states as $STA_ID => $state) {
626
+				if ($state instanceof EE_State) {
627 627
 					//STA_abbrev 	STA_name 	STA_active
628 628
 					$state_input_types = array(
629
-						'STA_abbrev' => array( 'type' => 'TEXT', 'input_name' => 'states[' . $STA_ID . ']', 'class' => 'mid-text' ),
630
-						'STA_name'   => array( 'type'       => 'TEXT', 'input_name' => 'states[' . $STA_ID . ']', 'class' => 'regular-text' ),
631
-						'STA_active' => array( 'type' => 'RADIO_BTN', 'input_name' => 'states[' . $STA_ID . ']', 'options' => $this->_yes_no_values, 'use_desc_4_label' => true )
629
+						'STA_abbrev' => array('type' => 'TEXT', 'input_name' => 'states['.$STA_ID.']', 'class' => 'mid-text'),
630
+						'STA_name'   => array('type'       => 'TEXT', 'input_name' => 'states['.$STA_ID.']', 'class' => 'regular-text'),
631
+						'STA_active' => array('type' => 'RADIO_BTN', 'input_name' => 'states['.$STA_ID.']', 'options' => $this->_yes_no_values, 'use_desc_4_label' => true)
632 632
 					);
633
-					$this->_template_args[ 'states' ][ $STA_ID ][ 'inputs' ] = EE_Question_Form_Input::generate_question_form_inputs_for_object( $state, $state_input_types );
634
-					$query_args = array( 'action'     => 'delete_state', 'STA_ID' => $STA_ID, 'CNT_ISO' => $CNT_ISO, 'STA_abbrev' => $state->abbrev() );
635
-					$this->_template_args[ 'states' ][ $STA_ID ][ 'delete_state_url' ] = EE_Admin_Page::add_query_args_and_nonce( $query_args, GEN_SET_ADMIN_URL );
633
+					$this->_template_args['states'][$STA_ID]['inputs'] = EE_Question_Form_Input::generate_question_form_inputs_for_object($state, $state_input_types);
634
+					$query_args = array('action'     => 'delete_state', 'STA_ID' => $STA_ID, 'CNT_ISO' => $CNT_ISO, 'STA_abbrev' => $state->abbrev());
635
+					$this->_template_args['states'][$STA_ID]['delete_state_url'] = EE_Admin_Page::add_query_args_and_nonce($query_args, GEN_SET_ADMIN_URL);
636 636
 				}
637 637
 			}
638 638
 		} else {
639 639
 			$this->_template_args['states'] = FALSE;
640 640
 		}
641 641
 //		EEH_Debug_Tools::printr( $this->_template_args['states'], 'states  <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span>', 'auto' );
642
-		$this->_template_args['add_new_state_url'] = EE_Admin_Page::add_query_args_and_nonce( array( 'action' => 'add_new_state' ),  GEN_SET_ADMIN_URL );
642
+		$this->_template_args['add_new_state_url'] = EE_Admin_Page::add_query_args_and_nonce(array('action' => 'add_new_state'), GEN_SET_ADMIN_URL);
643 643
 
644
-		$state_details_settings = EEH_Template::display_template( GEN_SET_TEMPLATE_PATH . 'state_details_settings.template.php', $this->_template_args, TRUE );
644
+		$state_details_settings = EEH_Template::display_template(GEN_SET_TEMPLATE_PATH.'state_details_settings.template.php', $this->_template_args, TRUE);
645 645
 
646
-		if ( defined( 'DOING_AJAX' )) {
647
-			$notices = EE_Error::get_notices( FALSE, FALSE, FALSE );
648
-			echo json_encode( array( 'return_data' => $state_details_settings, 'success' => $notices['success'], 'errors' => $notices['errors'] ));
646
+		if (defined('DOING_AJAX')) {
647
+			$notices = EE_Error::get_notices(FALSE, FALSE, FALSE);
648
+			echo json_encode(array('return_data' => $state_details_settings, 'success' => $notices['success'], 'errors' => $notices['errors']));
649 649
 			die();
650 650
 		} else {
651 651
 			return $state_details_settings;
@@ -666,40 +666,39 @@  discard block
 block discarded – undo
666 666
 
667 667
 		$success = TRUE;
668 668
 
669
-		$CNT_ISO = isset( $this->_req_data['CNT_ISO'] ) ? strtoupper( sanitize_text_field( $this->_req_data['CNT_ISO'] )) : FALSE;
670
-		if ( ! $CNT_ISO ) {
671
-			EE_Error::add_error( __( 'No Country ISO code or an invalid Country ISO code was received.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__ );
669
+		$CNT_ISO = isset($this->_req_data['CNT_ISO']) ? strtoupper(sanitize_text_field($this->_req_data['CNT_ISO'])) : FALSE;
670
+		if ( ! $CNT_ISO) {
671
+			EE_Error::add_error(__('No Country ISO code or an invalid Country ISO code was received.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
672 672
 			$success = FALSE;
673 673
 		}
674
-		$STA_abbrev = isset( $this->_req_data['STA_abbrev'] ) ? sanitize_text_field( $this->_req_data['STA_abbrev'] ) : FALSE;
675
-		if ( ! $STA_abbrev ) {
676
-			EE_Error::add_error( __( 'No State ISO code or an invalid State ISO code was received.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__ );
674
+		$STA_abbrev = isset($this->_req_data['STA_abbrev']) ? sanitize_text_field($this->_req_data['STA_abbrev']) : FALSE;
675
+		if ( ! $STA_abbrev) {
676
+			EE_Error::add_error(__('No State ISO code or an invalid State ISO code was received.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
677 677
 			$success = FALSE;
678 678
 		}
679
-		$STA_name = isset( $this->_req_data['STA_name'] ) ?  sanitize_text_field( $this->_req_data['STA_name'] ) :
680
-			FALSE;
681
-		if ( ! $STA_name ) {
682
-			EE_Error::add_error( __( 'No State name or an invalid State name was received.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__ );
679
+		$STA_name = isset($this->_req_data['STA_name']) ? sanitize_text_field($this->_req_data['STA_name']) : FALSE;
680
+		if ( ! $STA_name) {
681
+			EE_Error::add_error(__('No State name or an invalid State name was received.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
683 682
 			$success = FALSE;
684 683
 		}
685 684
 
686
-		if ( $success ) {
685
+		if ($success) {
687 686
 			$cols_n_values = array(
688 687
 				'CNT_ISO' => $CNT_ISO,
689 688
 				'STA_abbrev' => $STA_abbrev,
690 689
 				'STA_name' => $STA_name,
691 690
 				'STA_active' => TRUE
692 691
 			);
693
-			$success = EEM_State::instance()->insert ( $cols_n_values );
694
-			EE_Error::add_success( __( 'The State was added successfully.', 'event_espresso' ) );
692
+			$success = EEM_State::instance()->insert($cols_n_values);
693
+			EE_Error::add_success(__('The State was added successfully.', 'event_espresso'));
695 694
 		}
696 695
 
697
-		if ( defined( 'DOING_AJAX' )) {
698
-			$notices = EE_Error::get_notices( FALSE, FALSE, FALSE );
699
-			echo json_encode( array_merge( $notices, array( 'return_data' => $CNT_ISO ) ) );
696
+		if (defined('DOING_AJAX')) {
697
+			$notices = EE_Error::get_notices(FALSE, FALSE, FALSE);
698
+			echo json_encode(array_merge($notices, array('return_data' => $CNT_ISO)));
700 699
 			die();
701 700
 		} else {
702
-			$this->_redirect_after_action( $success, 'State', 'added', array( 'action' => 'country_settings' ) );
701
+			$this->_redirect_after_action($success, 'State', 'added', array('action' => 'country_settings'));
703 702
 		}
704 703
 	}
705 704
 
@@ -712,25 +711,25 @@  discard block
 block discarded – undo
712 711
 	 * 		@return 		boolean | void
713 712
 	 */
714 713
 	public function delete_state() {
715
-		$CNT_ISO = isset( $this->_req_data['CNT_ISO'] ) ? strtoupper( sanitize_text_field( $this->_req_data['CNT_ISO'] )) : FALSE;
716
-		$STA_ID = isset( $this->_req_data['STA_ID'] ) ? sanitize_text_field( $this->_req_data['STA_ID'] ) : FALSE;
717
-		$STA_abbrev = isset( $this->_req_data['STA_abbrev'] ) ? sanitize_text_field( $this->_req_data['STA_abbrev'] ) : FALSE;
718
-		if ( ! $STA_ID ) {
719
-			EE_Error::add_error( __( 'No State ID or an invalid State ID was received.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__ );
714
+		$CNT_ISO = isset($this->_req_data['CNT_ISO']) ? strtoupper(sanitize_text_field($this->_req_data['CNT_ISO'])) : FALSE;
715
+		$STA_ID = isset($this->_req_data['STA_ID']) ? sanitize_text_field($this->_req_data['STA_ID']) : FALSE;
716
+		$STA_abbrev = isset($this->_req_data['STA_abbrev']) ? sanitize_text_field($this->_req_data['STA_abbrev']) : FALSE;
717
+		if ( ! $STA_ID) {
718
+			EE_Error::add_error(__('No State ID or an invalid State ID was received.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
720 719
 			return FALSE;
721 720
 		}
722
-		$success = EEM_State::instance()->delete_by_ID( $STA_ID );
723
-		if ( $success !== FALSE ) {
724
-			do_action( 'AHEE__General_Settings_Admin_Page__delete_state__state_deleted', $CNT_ISO, $STA_ID, array( 'STA_abbrev' => $STA_abbrev ));
725
-			EE_Error::add_success( __( 'The State was deleted successfully.', 'event_espresso' ));
721
+		$success = EEM_State::instance()->delete_by_ID($STA_ID);
722
+		if ($success !== FALSE) {
723
+			do_action('AHEE__General_Settings_Admin_Page__delete_state__state_deleted', $CNT_ISO, $STA_ID, array('STA_abbrev' => $STA_abbrev));
724
+			EE_Error::add_success(__('The State was deleted successfully.', 'event_espresso'));
726 725
 		}
727
-		if ( defined( 'DOING_AJAX' )) {
728
-			$notices = EE_Error::get_notices( FALSE, FALSE );
726
+		if (defined('DOING_AJAX')) {
727
+			$notices = EE_Error::get_notices(FALSE, FALSE);
729 728
 			$notices['return_data'] = TRUE;
730
-			echo json_encode( $notices );
729
+			echo json_encode($notices);
731 730
 			die();
732 731
 		} else {
733
-			$this->_redirect_after_action( $success, 'State', 'deleted', array( 'action' => 'country_settings' ) );
732
+			$this->_redirect_after_action($success, 'State', 'deleted', array('action' => 'country_settings'));
734 733
 		}
735 734
 	}
736 735
 
@@ -746,63 +745,63 @@  discard block
 block discarded – undo
746 745
 	protected function _update_country_settings() {
747 746
 //		EEH_Debug_Tools::printr( $this->_req_data, '$this->_req_data  <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span>', 'auto' );
748 747
 		// grab the country ISO code
749
-		$CNT_ISO = isset( $this->_req_data['country'] ) ? strtoupper( sanitize_text_field( $this->_req_data['country'] )) : FALSE;
750
-		if ( ! $CNT_ISO ) {
751
-			EE_Error::add_error( __( 'No Country ISO code or an invalid Country ISO code was received.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__ );
748
+		$CNT_ISO = isset($this->_req_data['country']) ? strtoupper(sanitize_text_field($this->_req_data['country'])) : FALSE;
749
+		if ( ! $CNT_ISO) {
750
+			EE_Error::add_error(__('No Country ISO code or an invalid Country ISO code was received.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
752 751
 			return;
753 752
 		}
754 753
 		$cols_n_values = array();
755
-		$cols_n_values['CNT_ISO3'] = isset( $this->_req_data['cntry'][$CNT_ISO]['CNT_ISO3'] ) ? strtoupper( sanitize_text_field( $this->_req_data['cntry'][$CNT_ISO]['CNT_ISO3'] )) : FALSE;
756
-		$cols_n_values['RGN_ID'] = isset( $this->_req_data['cntry'][$CNT_ISO]['RGN_ID'] ) ? absint( $this->_req_data['cntry'][$CNT_ISO]['RGN_ID'] ) : NULL;
757
-		$cols_n_values['CNT_name'] = isset( $this->_req_data['cntry'][$CNT_ISO]['CNT_name'] ) ? sanitize_text_field( $this->_req_data['cntry'][$CNT_ISO]['CNT_name'] ) : NULL;
758
-		$cols_n_values['CNT_cur_code'] = isset( $this->_req_data['cntry'][$CNT_ISO]['CNT_cur_code'] ) ? strtoupper( sanitize_text_field( $this->_req_data['cntry'][$CNT_ISO]['CNT_cur_code'] )) : 'USD';
759
-		$cols_n_values['CNT_cur_single'] = isset( $this->_req_data['cntry'][$CNT_ISO]['CNT_cur_single'] ) ? sanitize_text_field( $this->_req_data['cntry'][$CNT_ISO]['CNT_cur_single'] ) : 'dollar';
760
-		$cols_n_values['CNT_cur_plural'] = isset( $this->_req_data['cntry'][$CNT_ISO]['CNT_cur_plural'] ) ? sanitize_text_field( $this->_req_data['cntry'][$CNT_ISO]['CNT_cur_plural'] ) : 'dollars';
761
-		$cols_n_values['CNT_cur_sign'] = isset( $this->_req_data['cntry'][$CNT_ISO]['CNT_cur_sign'] ) ? sanitize_text_field( $this->_req_data['cntry'][$CNT_ISO]['CNT_cur_sign'] ) : '$';
762
-		$cols_n_values['CNT_cur_sign_b4'] = isset( $this->_req_data['cntry'][$CNT_ISO]['CNT_cur_sign_b4'] ) ? absint( $this->_req_data['cntry'][$CNT_ISO]['CNT_cur_sign_b4'] ) : TRUE;
763
-		$cols_n_values['CNT_cur_dec_plc'] = isset( $this->_req_data['cntry'][$CNT_ISO]['CNT_cur_dec_plc'] ) ? absint( $this->_req_data['cntry'][$CNT_ISO]['CNT_cur_dec_plc'] ) : 2;
764
-		$cols_n_values['CNT_cur_dec_mrk'] = isset( $this->_req_data['cntry'][$CNT_ISO]['CNT_cur_dec_mrk'] ) ? sanitize_text_field( $this->_req_data['cntry'][$CNT_ISO]['CNT_cur_dec_mrk'] ) : '.';
765
-		$cols_n_values['CNT_cur_thsnds'] = isset( $this->_req_data['cntry'][$CNT_ISO]['CNT_cur_thsnds'] ) ? sanitize_text_field( $this->_req_data['cntry'][$CNT_ISO]['CNT_cur_thsnds'] ) : ',';
766
-		$cols_n_values['CNT_tel_code'] = isset( $this->_req_data['cntry'][$CNT_ISO]['CNT_tel_code'] ) ? sanitize_text_field( $this->_req_data['cntry'][$CNT_ISO]['CNT_tel_code'] ) : NULL;
767
-		$cols_n_values['CNT_is_EU'] = isset( $this->_req_data['cntry'][$CNT_ISO]['CNT_is_EU'] ) ? absint( $this->_req_data['cntry'][$CNT_ISO]['CNT_is_EU'] ) : FALSE;
768
-		$cols_n_values['CNT_active'] = isset( $this->_req_data['cntry'][$CNT_ISO]['CNT_active'] ) ? absint( $this->_req_data['cntry'][$CNT_ISO]['CNT_active'] ) : FALSE;
754
+		$cols_n_values['CNT_ISO3'] = isset($this->_req_data['cntry'][$CNT_ISO]['CNT_ISO3']) ? strtoupper(sanitize_text_field($this->_req_data['cntry'][$CNT_ISO]['CNT_ISO3'])) : FALSE;
755
+		$cols_n_values['RGN_ID'] = isset($this->_req_data['cntry'][$CNT_ISO]['RGN_ID']) ? absint($this->_req_data['cntry'][$CNT_ISO]['RGN_ID']) : NULL;
756
+		$cols_n_values['CNT_name'] = isset($this->_req_data['cntry'][$CNT_ISO]['CNT_name']) ? sanitize_text_field($this->_req_data['cntry'][$CNT_ISO]['CNT_name']) : NULL;
757
+		$cols_n_values['CNT_cur_code'] = isset($this->_req_data['cntry'][$CNT_ISO]['CNT_cur_code']) ? strtoupper(sanitize_text_field($this->_req_data['cntry'][$CNT_ISO]['CNT_cur_code'])) : 'USD';
758
+		$cols_n_values['CNT_cur_single'] = isset($this->_req_data['cntry'][$CNT_ISO]['CNT_cur_single']) ? sanitize_text_field($this->_req_data['cntry'][$CNT_ISO]['CNT_cur_single']) : 'dollar';
759
+		$cols_n_values['CNT_cur_plural'] = isset($this->_req_data['cntry'][$CNT_ISO]['CNT_cur_plural']) ? sanitize_text_field($this->_req_data['cntry'][$CNT_ISO]['CNT_cur_plural']) : 'dollars';
760
+		$cols_n_values['CNT_cur_sign'] = isset($this->_req_data['cntry'][$CNT_ISO]['CNT_cur_sign']) ? sanitize_text_field($this->_req_data['cntry'][$CNT_ISO]['CNT_cur_sign']) : '$';
761
+		$cols_n_values['CNT_cur_sign_b4'] = isset($this->_req_data['cntry'][$CNT_ISO]['CNT_cur_sign_b4']) ? absint($this->_req_data['cntry'][$CNT_ISO]['CNT_cur_sign_b4']) : TRUE;
762
+		$cols_n_values['CNT_cur_dec_plc'] = isset($this->_req_data['cntry'][$CNT_ISO]['CNT_cur_dec_plc']) ? absint($this->_req_data['cntry'][$CNT_ISO]['CNT_cur_dec_plc']) : 2;
763
+		$cols_n_values['CNT_cur_dec_mrk'] = isset($this->_req_data['cntry'][$CNT_ISO]['CNT_cur_dec_mrk']) ? sanitize_text_field($this->_req_data['cntry'][$CNT_ISO]['CNT_cur_dec_mrk']) : '.';
764
+		$cols_n_values['CNT_cur_thsnds'] = isset($this->_req_data['cntry'][$CNT_ISO]['CNT_cur_thsnds']) ? sanitize_text_field($this->_req_data['cntry'][$CNT_ISO]['CNT_cur_thsnds']) : ',';
765
+		$cols_n_values['CNT_tel_code'] = isset($this->_req_data['cntry'][$CNT_ISO]['CNT_tel_code']) ? sanitize_text_field($this->_req_data['cntry'][$CNT_ISO]['CNT_tel_code']) : NULL;
766
+		$cols_n_values['CNT_is_EU'] = isset($this->_req_data['cntry'][$CNT_ISO]['CNT_is_EU']) ? absint($this->_req_data['cntry'][$CNT_ISO]['CNT_is_EU']) : FALSE;
767
+		$cols_n_values['CNT_active'] = isset($this->_req_data['cntry'][$CNT_ISO]['CNT_active']) ? absint($this->_req_data['cntry'][$CNT_ISO]['CNT_active']) : FALSE;
769 768
 		// allow filtering of country data
770
-		$cols_n_values = apply_filters( 'FHEE__General_Settings_Admin_Page___update_country_settings__cols_n_values', $cols_n_values );
769
+		$cols_n_values = apply_filters('FHEE__General_Settings_Admin_Page___update_country_settings__cols_n_values', $cols_n_values);
771 770
 		//EEH_Debug_Tools::printr( $cols_n_values, '$cols_n_values  <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span>', 'auto' );
772 771
 		// where values
773
-		$where_cols_n_values = array( array( 'CNT_ISO' => $CNT_ISO ));
772
+		$where_cols_n_values = array(array('CNT_ISO' => $CNT_ISO));
774 773
 		// run the update
775
-		$success = EEM_Country::instance()->update( $cols_n_values, $where_cols_n_values );
774
+		$success = EEM_Country::instance()->update($cols_n_values, $where_cols_n_values);
776 775
 //		global $wpdb;
777 776
 //		echo '<h4>' . $wpdb->last_query . '  <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span></h4>';
778 777
 //		echo '<h4>$success : ' . $success . '  <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span></h4>';
779
-		if ( isset( $this->_req_data['states'] ) && is_array( $this->_req_data['states'] ) && $success !== FALSE ) {
778
+		if (isset($this->_req_data['states']) && is_array($this->_req_data['states']) && $success !== FALSE) {
780 779
 			// allow filtering of states data
781
-			$states = apply_filters( 'FHEE__General_Settings_Admin_Page___update_country_settings__states', $this->_req_data['states'] );
780
+			$states = apply_filters('FHEE__General_Settings_Admin_Page___update_country_settings__states', $this->_req_data['states']);
782 781
 //			EEH_Debug_Tools::printr( $states, '$states  <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span>', 'auto' );
783 782
 			// loop thru state data ( looks like : states[75][STA_name] )
784
-			foreach( $states as $STA_ID => $state ) {
783
+			foreach ($states as $STA_ID => $state) {
785 784
 				$cols_n_values = array(
786 785
 					'CNT_ISO' 		=> $CNT_ISO,
787
-					'STA_abbrev' => sanitize_text_field( $state['STA_abbrev'] ),
788
-					'STA_name' 	=> sanitize_text_field( $state['STA_name'] ),
789
-					'STA_active' 	=> (bool)absint( $state['STA_active'] )
786
+					'STA_abbrev' => sanitize_text_field($state['STA_abbrev']),
787
+					'STA_name' 	=> sanitize_text_field($state['STA_name']),
788
+					'STA_active' 	=> (bool) absint($state['STA_active'])
790 789
 				);
791 790
 				// where values
792
-				$where_cols_n_values = array( array( 'STA_ID' => $STA_ID ));
791
+				$where_cols_n_values = array(array('STA_ID' => $STA_ID));
793 792
 				// run the update
794
-				$success = EEM_State::instance()->update( $cols_n_values, $where_cols_n_values );
795
-				if ( $success !== FALSE ) {
796
-					do_action( 'AHEE__General_Settings_Admin_Page__update_country_settings__state_saved', $CNT_ISO, $STA_ID, $cols_n_values );
793
+				$success = EEM_State::instance()->update($cols_n_values, $where_cols_n_values);
794
+				if ($success !== FALSE) {
795
+					do_action('AHEE__General_Settings_Admin_Page__update_country_settings__state_saved', $CNT_ISO, $STA_ID, $cols_n_values);
797 796
 				}
798 797
 			}
799 798
 		}
800 799
 		// check if country being edited matches org option country, and if so, then  update EE_Config with new settings
801
-		if ( isset( EE_Registry::instance()->CFG->organization->CNT_ISO ) && $CNT_ISO == EE_Registry::instance()->CFG->organization->CNT_ISO ) {
802
-			EE_Registry::instance()->CFG->currency = new EE_Currency_Config( $CNT_ISO );
800
+		if (isset(EE_Registry::instance()->CFG->organization->CNT_ISO) && $CNT_ISO == EE_Registry::instance()->CFG->organization->CNT_ISO) {
801
+			EE_Registry::instance()->CFG->currency = new EE_Currency_Config($CNT_ISO);
803 802
 			EE_Registry::instance()->CFG->update_espresso_config();
804 803
 		}
805
-		$this->_redirect_after_action( $success, 'Countries', 'updated', array( 'action' => 'country_settings', 'country' => $CNT_ISO ));
804
+		$this->_redirect_after_action($success, 'Countries', 'updated', array('action' => 'country_settings', 'country' => $CNT_ISO));
806 805
 	}
807 806
 
808 807
 
@@ -816,11 +815,11 @@  discard block
 block discarded – undo
816 815
 	 * 		@param 		string 		$label
817 816
 	 * 		@return 		string
818 817
 	 */
819
-	public function country_form_field_label_wrap( $label, $required_text ) {
818
+	public function country_form_field_label_wrap($label, $required_text) {
820 819
 		return '
821 820
 			<tr>
822 821
 				<th>
823
-					' . $label  . '
822
+					' . $label.'
824 823
 				</th>';
825 824
 	}
826 825
 
@@ -834,10 +833,10 @@  discard block
 block discarded – undo
834 833
 	 * 		@param 		string 		$label
835 834
 	 * 		@return 		string
836 835
 	 */
837
-	public function country_form_field_input__wrap( $input, $label ) {
836
+	public function country_form_field_input__wrap($input, $label) {
838 837
 		return '
839 838
 				<td class="general-settings-country-input-td">
840
-					' . $input . '
839
+					' . $input.'
841 840
 				</td>
842 841
 			</tr>';
843 842
 	}
@@ -853,7 +852,7 @@  discard block
 block discarded – undo
853 852
 	 * 		@param 		string 		$required_text
854 853
 	 * 		@return 		string
855 854
 	 */
856
-	public function state_form_field_label_wrap( $label, $required_text  ) {
855
+	public function state_form_field_label_wrap($label, $required_text) {
857 856
 		return $required_text;
858 857
 	}
859 858
 
@@ -867,10 +866,10 @@  discard block
 block discarded – undo
867 866
 	 * 		@param 		string 		$label
868 867
 	 * 		@return 		string
869 868
 	 */
870
-	public function state_form_field_input__wrap( $input, $label ) {
869
+	public function state_form_field_input__wrap($input, $label) {
871 870
 		return '
872 871
 				<td class="general-settings-country-state-input-td">
873
-					' . $input . '
872
+					' . $input.'
874 873
 				</td>';
875 874
 
876 875
 	}
@@ -893,10 +892,10 @@  discard block
 block discarded – undo
893 892
 	 * @param int $ee_page_id
894 893
 	 * @return string
895 894
 	 */
896
-	public static function edit_view_links( $ee_page_id ) {
897
-		$links = '<a href="' . add_query_arg( array( 'post' => $ee_page_id, 'action' => 'edit' ),  admin_url( 'post.php' )) . '" >' . __('Edit', 'event_espresso') . '</a>';
895
+	public static function edit_view_links($ee_page_id) {
896
+		$links = '<a href="'.add_query_arg(array('post' => $ee_page_id, 'action' => 'edit'), admin_url('post.php')).'" >'.__('Edit', 'event_espresso').'</a>';
898 897
 		$links .= ' &nbsp;|&nbsp; ';
899
-		$links .= '<a href="' . get_permalink( $ee_page_id ) . '" >' . __('View', 'event_espresso') . '</a>';
898
+		$links .= '<a href="'.get_permalink($ee_page_id).'" >'.__('View', 'event_espresso').'</a>';
900 899
 		return $links;
901 900
 	}
902 901
 
@@ -909,27 +908,27 @@  discard block
 block discarded – undo
909 908
 	 * @param WP page object $ee_page
910 909
 	 * @return string
911 910
 	 */
912
-	public static function page_and_shortcode_status( $ee_page, $shortcode ) {
911
+	public static function page_and_shortcode_status($ee_page, $shortcode) {
913 912
 
914 913
 		// page status
915
-		if ( isset( $ee_page->post_status ) && $ee_page->post_status == 'publish') {
914
+		if (isset($ee_page->post_status) && $ee_page->post_status == 'publish') {
916 915
 			$pg_colour = 'green';
917
-			$pg_status = sprintf( __('Page%sStatus%sOK', 'event_espresso'), '&nbsp;' , '&nbsp;' );
916
+			$pg_status = sprintf(__('Page%sStatus%sOK', 'event_espresso'), '&nbsp;', '&nbsp;');
918 917
 		 } else {
919 918
 			$pg_colour = 'red';
920
-			$pg_status = sprintf( __('Page%sVisibility%sProblem', 'event_espresso'), '&nbsp;', '&nbsp;'  );
919
+			$pg_status = sprintf(__('Page%sVisibility%sProblem', 'event_espresso'), '&nbsp;', '&nbsp;');
921 920
 		}
922 921
 
923 922
 		// shortcode status
924
-		if ( isset( $ee_page->post_content ) && strpos( $ee_page->post_content, $shortcode ) !== FALSE ) {
923
+		if (isset($ee_page->post_content) && strpos($ee_page->post_content, $shortcode) !== FALSE) {
925 924
 			$sc_colour = 'green';
926
-			$sc_status = sprintf( __('Shortcode%sOK', 'event_espresso'), '&nbsp;' );
925
+			$sc_status = sprintf(__('Shortcode%sOK', 'event_espresso'), '&nbsp;');
927 926
 		 } else {
928 927
 			$sc_colour = 'red';
929
-			$sc_status = sprintf( __('Shortcode%sProblem', 'event_espresso'), '&nbsp;' );
928
+			$sc_status = sprintf(__('Shortcode%sProblem', 'event_espresso'), '&nbsp;');
930 929
 		}
931 930
 
932
-		return '<span style="color:' . $pg_colour . '; margin-right:2em;"><strong>' . $pg_status . '</strong></span><span style="color:' . $sc_colour . '"><strong>' . $sc_status . '</strong></span>';
931
+		return '<span style="color:'.$pg_colour.'; margin-right:2em;"><strong>'.$pg_status.'</strong></span><span style="color:'.$sc_colour.'"><strong>'.$sc_status.'</strong></span>';
933 932
 
934 933
 	}
935 934
 
@@ -944,20 +943,20 @@  discard block
 block discarded – undo
944 943
 	 * @param unknown_type $level
945 944
 	 * @return unknown
946 945
 	 */
947
-	public static function page_settings_dropdown( $default = 0, $parent = 0, $level = 0 ) {
946
+	public static function page_settings_dropdown($default = 0, $parent = 0, $level = 0) {
948 947
 		global $wpdb;
949
-		$items = $wpdb->get_results( $wpdb->prepare("SELECT ID, post_parent, post_title FROM $wpdb->posts WHERE post_parent = %d AND post_type = 'page' AND post_status != 'trash' ORDER BY menu_order", $parent) );
948
+		$items = $wpdb->get_results($wpdb->prepare("SELECT ID, post_parent, post_title FROM $wpdb->posts WHERE post_parent = %d AND post_type = 'page' AND post_status != 'trash' ORDER BY menu_order", $parent));
950 949
 
951
-		if ( $items ) {
952
-			foreach ( $items as $item ) {
953
-				$pad = str_repeat( '&nbsp;', $level * 3 );
954
-				if ( $item->ID == $default)
950
+		if ($items) {
951
+			foreach ($items as $item) {
952
+				$pad = str_repeat('&nbsp;', $level * 3);
953
+				if ($item->ID == $default)
955 954
 					$current = ' selected="selected"';
956 955
 				else
957 956
 					$current = '';
958 957
 
959
-				echo "\n\t<option class='level-$level' value='$item->ID'$current>$pad " . esc_html($item->post_title) . "</option>";
960
-				parent_dropdown( $default, $item->ID, $level +1 );
958
+				echo "\n\t<option class='level-$level' value='$item->ID'$current>$pad ".esc_html($item->post_title)."</option>";
959
+				parent_dropdown($default, $item->ID, $level + 1);
961 960
 			}
962 961
 		} else {
963 962
 			return false;
Please login to merge, or discard this patch.
admin_pages/payments/Payments_Admin_Page.core.php 4 patches
Doc Comments   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -421,7 +421,7 @@  discard block
 block discarded – undo
421 421
 	 *
422 422
 	 * @access protected
423 423
 	 * @param \EE_Payment_Method $payment_method
424
-	 * @return \EE_Form_Section_Proper
424
+	 * @return EE_Form_Section_HTML
425 425
 	 */
426 426
 	protected function _pci_dss_compliance( EE_Payment_Method $payment_method ) {
427 427
 		if ( $payment_method->type_obj()->requires_https() ) {
@@ -451,7 +451,7 @@  discard block
 block discarded – undo
451 451
 	 *
452 452
 	 * @access protected
453 453
 	 * @param \EE_Payment_Method $payment_method
454
-	 * @return \EE_Form_Section_Proper
454
+	 * @return EE_Form_Section_HTML
455 455
 	 */
456 456
 	protected function _currency_support( EE_Payment_Method $payment_method ) {
457 457
 		if ( ! $payment_method->usable_for_currency( EE_Config::instance()->currency->code )) {
@@ -483,7 +483,7 @@  discard block
 block discarded – undo
483 483
 	 *
484 484
 	 * @access protected
485 485
 	 * @param \EE_Payment_Method $payment_method
486
-	 * @return \EE_Form_Section_HTML
486
+	 * @return EE_Payment_Method_Form
487 487
 	 */
488 488
 	protected function _payment_method_settings( EE_Payment_Method $payment_method ) {
489 489
 		//modify the form so we only have/show fields that will be implemented for this version
@@ -551,7 +551,7 @@  discard block
 block discarded – undo
551 551
 	 *
552 552
 	 * @access protected
553 553
 	 * @param \EE_Payment_Method $payment_method
554
-	 * @return \EE_Form_Section_Proper
554
+	 * @return EE_Form_Section_HTML
555 555
 	 */
556 556
 	protected function _deactivate_payment_method_button( EE_Payment_Method $payment_method ) {
557 557
 		$link_text_and_title = sprintf( __( 'Deactivate %1$s Payments?', 'event_espresso'), $payment_method->admin_name() );
Please login to merge, or discard this patch.
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
 		 *
84 84
 		 * When cap mapping is implemented, some routes will need to use the singular form of
85 85
 		 * capability method and also include the $id of the payment method for the route.
86
-		**/
86
+		 **/
87 87
 		$this->_page_routes = array(
88 88
 			'default' => array(
89 89
 				'func'=>'_payment_methods_list',
@@ -747,9 +747,9 @@  discard block
 block discarded – undo
747 747
 
748 748
 	/**
749 749
 	 * 		_update_payment_settings
750
-	*		@access protected
751
-	*		@return array
752
-	*/
750
+	 *		@access protected
751
+	 *		@return array
752
+	 */
753 753
 	protected function _update_payment_settings() {
754 754
 		EE_Registry::instance()->CFG->registration->show_pending_payment_options = isset( $this->_req_data['show_pending_payment_options'] ) ? $this->_req_data['show_pending_payment_options'] : FALSE;
755 755
 		EE_Registry::instance()->CFG = apply_filters( 'FHEE__Payments_Admin_Page___update_payment_settings__CFG', EE_Registry::instance()->CFG );
Please login to merge, or discard this patch.
Braces   +8 added lines, -7 removed lines patch added patch discarded remove patch
@@ -1,6 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if (!defined('EVENT_ESPRESSO_VERSION') )
2
+if (!defined('EVENT_ESPRESSO_VERSION') ) {
3 3
 	exit('NO direct script access allowed');
4
+}
4 5
 
5 6
 /**
6 7
  * Event Espresso
@@ -655,7 +656,7 @@  discard block
 block discarded – undo
655 656
 			$payment_method = EE_Payment_Method_Manager::instance()->activate_a_payment_method_of_type( $payment_method_type );
656 657
 
657 658
 			$this->_redirect_after_action(1, 'Payment Method', 'activated', array('action' => 'default','payment_method'=>$payment_method->slug()));
658
-		}else{
659
+		} else{
659 660
 			$this->_redirect_after_action(FALSE, 'Payment Method', 'activated', array('action' => 'default'));
660 661
 		}
661 662
 	}
@@ -670,7 +671,7 @@  discard block
 block discarded – undo
670 671
 			EE_Registry::instance()->load_lib('Payment_Method_Manager');
671 672
 			$count_updated = EE_Payment_Method_Manager::instance()->deactivate_payment_method( $payment_method_slug );
672 673
 			$this->_redirect_after_action($count_updated, 'Payment Method', 'deactivated', array('action' => 'default','payment_method'=>$payment_method_slug));
673
-		}else{
674
+		} else{
674 675
 			$this->_redirect_after_action(FALSE, 'Payment Method', 'deactivated', array('action' => 'default'));
675 676
 		}
676 677
 	}
@@ -712,7 +713,7 @@  discard block
 block discarded – undo
712 713
 				$pm = $correct_pmt_form_to_use->get_model_object();
713 714
 				/** @var $pm EE_Payment_Method */
714 715
 				$this->_redirect_after_action(TRUE, 'Payment Method', 'updated', array('action' => 'default','payment_method'=>$pm->slug()));
715
-			}else{
716
+			} else{
716 717
 				EE_Error::add_error(
717 718
 					sprintf(
718 719
 						__('Payment method of type %s was not saved because there were validation errors. They have been marked in the form', 'event_espresso'),
@@ -838,7 +839,7 @@  discard block
 block discarded – undo
838 839
 		if(isset($this->_req_data['order'])){
839 840
 			$sort = ( isset( $this->_req_data['order'] ) && ! empty( $this->_req_data['order'] )) ? $this->_req_data['order'] : 'DESC';
840 841
 			$query_params['order_by'] = array('LOG_time' => $sort);
841
-		}else{
842
+		} else{
842 843
 				$query_params['order_by'] = array('LOG_time' => 'DESC');
843 844
 		}
844 845
 		$offset = ($current_page-1)*$per_page;
@@ -881,7 +882,7 @@  discard block
 block discarded – undo
881 882
 		$comparison = $timeA < $timeB ? -1 : 1;
882 883
 		if(strtoupper($this->_sort_logs_again_direction) == 'DESC'){
883 884
 			return $comparison * -1;
884
-		}else{
885
+		} else{
885 886
 			return $comparison;
886 887
 		}
887 888
 	}
@@ -896,7 +897,7 @@  discard block
 block discarded – undo
896 897
 			if( $payment_log->object() instanceof EE_Payment ){
897 898
 				$payment_method = $payment_log->object()->payment_method();
898 899
 				$transaction = $payment_log->object()->transaction();
899
-			}elseif($payment_log->object() instanceof EE_Payment_Method){
900
+			} elseif($payment_log->object() instanceof EE_Payment_Method){
900 901
 				$payment_method = $payment_log->object();
901 902
 			}
902 903
 		}
Please login to merge, or discard this patch.
Spacing   +168 added lines, -168 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if (!defined('EVENT_ESPRESSO_VERSION') )
2
+if ( ! defined('EVENT_ESPRESSO_VERSION'))
3 3
 	exit('NO direct script access allowed');
4 4
 
5 5
 /**
@@ -44,8 +44,8 @@  discard block
 block discarded – undo
44 44
 	 * @param bool $routing indicate whether we want to just load the object and handle routing or just load the object.
45 45
 	 * @return \Payments_Admin_Page
46 46
 	 */
47
-	public function __construct( $routing = TRUE ) {
48
-		parent::__construct( $routing );
47
+	public function __construct($routing = TRUE) {
48
+		parent::__construct($routing);
49 49
 	}
50 50
 
51 51
 
@@ -130,19 +130,19 @@  discard block
 block discarded – undo
130 130
 	protected function _set_page_config() {
131 131
 		$payment_method_list_config = array(
132 132
 			'nav'           => array(
133
-				'label' => __( 'Payment Methods', 'event_espresso' ),
133
+				'label' => __('Payment Methods', 'event_espresso'),
134 134
 				'order' => 10
135 135
 			),
136 136
 			'metaboxes'     => $this->_default_espresso_metaboxes,
137 137
 			'help_tabs'     => array_merge(
138 138
 				array(
139 139
 					'payment_methods_overview_help_tab' => array(
140
-						'title'    => __( 'Payment Methods Overview', 'event_espresso' ),
140
+						'title'    => __('Payment Methods Overview', 'event_espresso'),
141 141
 						'filename' => 'payment_methods_overview'
142 142
 					)
143 143
 				),
144 144
 				$this->_add_payment_method_help_tabs() ),
145
-			'help_tour'     => array( 'Payment_Methods_Selection_Help_Tour' ),
145
+			'help_tour'     => array('Payment_Methods_Selection_Help_Tour'),
146 146
 			'require_nonce' => false
147 147
 		);
148 148
 
@@ -160,7 +160,7 @@  discard block
 block discarded – undo
160 160
 					)
161 161
 				),
162 162
 				//'help_tour' => array( 'Payment_Methods_Settings_Help_Tour' ),
163
-				'metaboxes' => array_merge( $this->_default_espresso_metaboxes, array( '_publish_post_box' ) ),
163
+				'metaboxes' => array_merge($this->_default_espresso_metaboxes, array('_publish_post_box')),
164 164
 				'require_nonce' => FALSE
165 165
 			),
166 166
 			'payment_log'=>array(
@@ -179,17 +179,17 @@  discard block
 block discarded – undo
179 179
 	/**
180 180
 	 * @return array
181 181
 	 */
182
-	protected function _add_payment_method_help_tabs(){
182
+	protected function _add_payment_method_help_tabs() {
183 183
 		EE_Registry::instance()->load_lib('Payment_Method_Manager');
184 184
 		$payment_method_types = EE_Payment_Method_Manager::instance()->payment_method_types();
185 185
 		$all_pmt_help_tabs_config = array();
186
-		foreach( $payment_method_types as $payment_method_type ){
187
-			if ( ! EE_Registry::instance()->CAP->current_user_can( $payment_method_type->cap_name(), 'specific_payment_method_type_access' ) ) {
186
+		foreach ($payment_method_types as $payment_method_type) {
187
+			if ( ! EE_Registry::instance()->CAP->current_user_can($payment_method_type->cap_name(), 'specific_payment_method_type_access')) {
188 188
 				continue;
189 189
 			}
190
-			foreach( $payment_method_type->help_tabs_config() as $help_tab_name => $config ){
191
-				$template_args = isset( $config[ 'template_args' ] ) ? $config[ 'template_args' ] : array();
192
-				$template_args[ 'admin_page_obj' ] = $this;
190
+			foreach ($payment_method_type->help_tabs_config() as $help_tab_name => $config) {
191
+				$template_args = isset($config['template_args']) ? $config['template_args'] : array();
192
+				$template_args['admin_page_obj'] = $this;
193 193
 				$all_pmt_help_tabs_config[$help_tab_name] = array(
194 194
 					'title'=>$config['title'],
195 195
 					'content'=>EEH_Template::display_template( 
@@ -216,9 +216,9 @@  discard block
 block discarded – undo
216 216
 
217 217
 
218 218
 	public function load_scripts_styles() {
219
-		wp_enqueue_script( 'ee_admin_js' );
220
-		wp_enqueue_script( 'ee-text-links' );
221
-		wp_enqueue_script( 'espresso_payments', EE_PAYMENTS_ASSETS_URL . 'espresso_payments_admin.js', array( 'espresso-ui-theme', 'ee-datepicker' ), EVENT_ESPRESSO_VERSION, TRUE );
219
+		wp_enqueue_script('ee_admin_js');
220
+		wp_enqueue_script('ee-text-links');
221
+		wp_enqueue_script('espresso_payments', EE_PAYMENTS_ASSETS_URL.'espresso_payments_admin.js', array('espresso-ui-theme', 'ee-datepicker'), EVENT_ESPRESSO_VERSION, TRUE);
222 222
 	}
223 223
 
224 224
 
@@ -227,9 +227,9 @@  discard block
 block discarded – undo
227 227
 
228 228
 	public function load_scripts_styles_default() {
229 229
 		//styles
230
-		wp_register_style( 'espresso_payments', EE_PAYMENTS_ASSETS_URL . 'ee-payments.css', array(), EVENT_ESPRESSO_VERSION );
231
-		wp_enqueue_style( 'espresso_payments' );
232
-		wp_enqueue_style( 'ee-text-links' );
230
+		wp_register_style('espresso_payments', EE_PAYMENTS_ASSETS_URL.'ee-payments.css', array(), EVENT_ESPRESSO_VERSION);
231
+		wp_enqueue_style('espresso_payments');
232
+		wp_enqueue_style('ee-text-links');
233 233
 		//scripts
234 234
 	}
235 235
 
@@ -243,46 +243,46 @@  discard block
 block discarded – undo
243 243
 		 * to the loading process.  However, people MUST setup the details for the payment method so its safe to do a
244 244
 		 * recheck here.
245 245
 		 */
246
-		EE_Registry::instance()->load_lib( 'Payment_Method_Manager' );
246
+		EE_Registry::instance()->load_lib('Payment_Method_Manager');
247 247
 		EEM_Payment_Method::instance()->verify_button_urls();
248
-		EE_Registry::instance()->load_helper( 'Tabbed_Content' );
249
-		EE_Registry::instance()->load_helper( 'HTML' );
248
+		EE_Registry::instance()->load_helper('Tabbed_Content');
249
+		EE_Registry::instance()->load_helper('HTML');
250 250
 		//setup tabs, one for each payment method type
251 251
 		$tabs = array();
252 252
 		$payment_methods = array();
253
-		foreach( EE_Payment_Method_Manager::instance()->payment_method_types() as $pmt_obj ) {
253
+		foreach (EE_Payment_Method_Manager::instance()->payment_method_types() as $pmt_obj) {
254 254
 			// we don't want to show admin-only PMTs for now
255
-			if ( $pmt_obj instanceof EE_PMT_Admin_Only ) {
255
+			if ($pmt_obj instanceof EE_PMT_Admin_Only) {
256 256
 				continue;
257 257
 			}
258 258
 			//check access
259
-			if ( ! EE_Registry::instance()->CAP->current_user_can( $pmt_obj->cap_name(), 'specific_payment_method_type_access' ) ) {
259
+			if ( ! EE_Registry::instance()->CAP->current_user_can($pmt_obj->cap_name(), 'specific_payment_method_type_access')) {
260 260
 				continue;
261 261
 			}
262 262
 			//check for any active pms of that type
263
-			$payment_method = EEM_Payment_Method::instance()->get_one_of_type( $pmt_obj->system_name() );
264
-			if ( ! $payment_method instanceof EE_Payment_Method ) {
263
+			$payment_method = EEM_Payment_Method::instance()->get_one_of_type($pmt_obj->system_name());
264
+			if ( ! $payment_method instanceof EE_Payment_Method) {
265 265
 				$payment_method = EE_Payment_Method::new_instance(
266 266
 					array(
267
-						'PMD_slug'					=>sanitize_key( $pmt_obj->system_name() ),
267
+						'PMD_slug'					=>sanitize_key($pmt_obj->system_name()),
268 268
 						'PMD_type'					=>$pmt_obj->system_name(),
269 269
 						'PMD_name'				=>$pmt_obj->pretty_name(),
270 270
 						'PMD_admin_name'	=>$pmt_obj->pretty_name()
271 271
 					)
272 272
 				);
273 273
 			}
274
-			$payment_methods[ $payment_method->slug() ] = $payment_method;
274
+			$payment_methods[$payment_method->slug()] = $payment_method;
275 275
 		}
276
-		$payment_methods = apply_filters( 'FHEE__Payments_Admin_Page___payment_methods_list__payment_methods', $payment_methods );
277
-		foreach( $payment_methods as $payment_method ) {
278
-			if ( $payment_method instanceof EE_Payment_Method ) {
276
+		$payment_methods = apply_filters('FHEE__Payments_Admin_Page___payment_methods_list__payment_methods', $payment_methods);
277
+		foreach ($payment_methods as $payment_method) {
278
+			if ($payment_method instanceof EE_Payment_Method) {
279 279
 				add_meta_box(
280 280
 					//html id
281
-					'espresso_' . $payment_method->slug() . '_payment_settings',
281
+					'espresso_'.$payment_method->slug().'_payment_settings',
282 282
 					//title
283
-					sprintf( __( '%s Settings', 'event_espresso' ), $payment_method->admin_name() ),
283
+					sprintf(__('%s Settings', 'event_espresso'), $payment_method->admin_name()),
284 284
 					//callback
285
-					array( $this, 'payment_method_settings_meta_box' ),
285
+					array($this, 'payment_method_settings_meta_box'),
286 286
 					//post type
287 287
 					null,
288 288
 					//context
@@ -290,19 +290,19 @@  discard block
 block discarded – undo
290 290
 					//priority
291 291
 					'default',
292 292
 					//callback args
293
-					array( 'payment_method' => $payment_method )
293
+					array('payment_method' => $payment_method)
294 294
 				);
295 295
 				//setup for tabbed content
296
-				$tabs[ $payment_method->slug() ] = array(
296
+				$tabs[$payment_method->slug()] = array(
297 297
 					'label' => $payment_method->admin_name(),
298 298
 					'class' => $payment_method->active() ? 'gateway-active' : '',
299
-					'href'  => 'espresso_' . $payment_method->slug() . '_payment_settings',
300
-					'title' => __( 'Modify this Payment Method', 'event_espresso' ),
299
+					'href'  => 'espresso_'.$payment_method->slug().'_payment_settings',
300
+					'title' => __('Modify this Payment Method', 'event_espresso'),
301 301
 					'slug'  => $payment_method->slug()
302 302
 				);
303 303
 			}
304 304
 		}
305
-		$this->_template_args['admin_page_header'] = EEH_Tabbed_Content::tab_text_links( $tabs, 'payment_method_links', '|', $this->_get_active_payment_method_slug() );
305
+		$this->_template_args['admin_page_header'] = EEH_Tabbed_Content::tab_text_links($tabs, 'payment_method_links', '|', $this->_get_active_payment_method_slug());
306 306
 		$this->display_admin_page_with_sidebar();
307 307
 
308 308
 	}
@@ -313,20 +313,20 @@  discard block
 block discarded – undo
313 313
 	 *   _get_active_payment_method_slug
314 314
 	 * 	@return string
315 315
 	 */
316
-	protected function _get_active_payment_method_slug(){
316
+	protected function _get_active_payment_method_slug() {
317 317
 		$payment_method_slug = FALSE;
318 318
 		//decide which payment method tab to open first, as dictated by the request's 'payment_method'
319
-		if ( isset( $this->_req_data['payment_method'] )) {
319
+		if (isset($this->_req_data['payment_method'])) {
320 320
 			// if they provided the current payment method, use it
321
-			$payment_method_slug = sanitize_key( $this->_req_data['payment_method'] );
321
+			$payment_method_slug = sanitize_key($this->_req_data['payment_method']);
322 322
 		}
323
-		$payment_method = EEM_Payment_Method::instance()->get_one( array( array( 'PMD_slug' => $payment_method_slug )));
323
+		$payment_method = EEM_Payment_Method::instance()->get_one(array(array('PMD_slug' => $payment_method_slug)));
324 324
 		// if that didn't work or wasn't provided, find another way to select the current pm
325
-		if ( ! $this->_verify_payment_method( $payment_method )) {
325
+		if ( ! $this->_verify_payment_method($payment_method)) {
326 326
 			// like, looking for an active one
327
-			$payment_method = EEM_Payment_Method::instance()->get_one_active( 'CART' );
327
+			$payment_method = EEM_Payment_Method::instance()->get_one_active('CART');
328 328
 			// test that one as well
329
-			if ( $this->_verify_payment_method( $payment_method )) {
329
+			if ($this->_verify_payment_method($payment_method)) {
330 330
 				$payment_method_slug = $payment_method->slug();
331 331
 			} else {
332 332
 				$payment_method_slug = 'paypal_standard';
@@ -344,11 +344,11 @@  discard block
 block discarded – undo
344 344
 	 * @param \EE_Payment_Method $payment_method
345 345
 	 * @return boolean
346 346
 	 */
347
-	protected function _verify_payment_method( $payment_method ){
347
+	protected function _verify_payment_method($payment_method) {
348 348
 		if (
349 349
 			$payment_method instanceof EE_Payment_Method &&
350 350
 			$payment_method->type_obj() instanceof EE_PMT_Base &&
351
-			EE_Registry::instance()->CAP->current_user_can( $payment_method->type_obj()->cap_name(), 'specific_payment_method_type_access' )
351
+			EE_Registry::instance()->CAP->current_user_can($payment_method->type_obj()->cap_name(), 'specific_payment_method_type_access')
352 352
 		) {
353 353
 			return TRUE;
354 354
 		}
@@ -365,21 +365,21 @@  discard block
 block discarded – undo
365 365
 	 * @return string
366 366
 	 * @throws EE_Error
367 367
 	 */
368
-	public function payment_method_settings_meta_box( $post_obj_which_is_null, $metabox ){
369
-		$payment_method = isset( $metabox['args'], $metabox['args']['payment_method'] ) ? $metabox['args']['payment_method'] : NULL;
370
-		if ( ! $payment_method instanceof EE_Payment_Method ){
371
-			throw new EE_Error( sprintf( __( 'Payment method metabox setup incorrectly. No Payment method object was supplied', 'event_espresso' )));
368
+	public function payment_method_settings_meta_box($post_obj_which_is_null, $metabox) {
369
+		$payment_method = isset($metabox['args'], $metabox['args']['payment_method']) ? $metabox['args']['payment_method'] : NULL;
370
+		if ( ! $payment_method instanceof EE_Payment_Method) {
371
+			throw new EE_Error(sprintf(__('Payment method metabox setup incorrectly. No Payment method object was supplied', 'event_espresso')));
372 372
 		}
373 373
 		$payment_method_scopes = $payment_method->active();
374 374
 		// if the payment method really exists show its form, otherwise the activation template
375
-		if ( $payment_method->ID() && ! empty( $payment_method_scopes )) {
376
-				$form = $this->_generate_payment_method_settings_form( $payment_method );
377
-				if ( $form->form_data_present_in( $this->_req_data )) {
378
-					$form->receive_form_submission( $this->_req_data );
375
+		if ($payment_method->ID() && ! empty($payment_method_scopes)) {
376
+				$form = $this->_generate_payment_method_settings_form($payment_method);
377
+				if ($form->form_data_present_in($this->_req_data)) {
378
+					$form->receive_form_submission($this->_req_data);
379 379
 				}
380
-				echo $form->form_open() . $form->get_html_and_js() . $form->form_close();
380
+				echo $form->form_open().$form->get_html_and_js().$form->form_close();
381 381
 		} else {
382
-			echo $this->_activate_payment_method_button( $payment_method )->get_html_and_js();
382
+			echo $this->_activate_payment_method_button($payment_method)->get_html_and_js();
383 383
 		}
384 384
 	}
385 385
 
@@ -392,14 +392,14 @@  discard block
 block discarded – undo
392 392
 	 * @param \EE_Payment_Method $payment_method
393 393
 	 * @return \EE_Form_Section_Proper
394 394
 	 */
395
-	protected function _generate_payment_method_settings_form( EE_Payment_Method $payment_method ) {
396
-		if ( ! $payment_method instanceof EE_Payment_Method ){
395
+	protected function _generate_payment_method_settings_form(EE_Payment_Method $payment_method) {
396
+		if ( ! $payment_method instanceof EE_Payment_Method) {
397 397
 			return new EE_Form_Section_Proper();
398 398
 		}
399 399
 		return new EE_Form_Section_Proper(
400 400
 			array(
401
-				'name' 	=> $payment_method->slug() . '_settings_form',
402
-				'html_id' 	=> $payment_method->slug() . '_settings_form',
401
+				'name' 	=> $payment_method->slug().'_settings_form',
402
+				'html_id' 	=> $payment_method->slug().'_settings_form',
403 403
 				'action' 	=> EE_Admin_Page::add_query_args_and_nonce(
404 404
 					array(
405 405
 						'action' 						=> 'update_payment_method',
@@ -411,12 +411,12 @@  discard block
 block discarded – undo
411 411
 				'subsections' 			=> apply_filters(
412 412
 					'FHEE__Payments_Admin_Page___generate_payment_method_settings_form__form_subsections',
413 413
 					array(
414
-						'pci_dss_compliance_' . $payment_method->slug() 				=> $this->_pci_dss_compliance( $payment_method ),
415
-						'currency_support_' . $payment_method->slug()					=> $this->_currency_support( $payment_method ),
416
-						'payment_method_settings_' . $payment_method->slug() 	=> $this->_payment_method_settings( $payment_method ),
417
-						'update_' . $payment_method->slug()										=> $this->_update_payment_method_button( $payment_method ),
418
-						'deactivate_' . $payment_method->slug()								=> $this->_deactivate_payment_method_button( $payment_method ),
419
-						'fine_print_' . $payment_method->slug()									=> $this->_fine_print()
414
+						'pci_dss_compliance_'.$payment_method->slug() 				=> $this->_pci_dss_compliance($payment_method),
415
+						'currency_support_'.$payment_method->slug()					=> $this->_currency_support($payment_method),
416
+						'payment_method_settings_'.$payment_method->slug() 	=> $this->_payment_method_settings($payment_method),
417
+						'update_'.$payment_method->slug()										=> $this->_update_payment_method_button($payment_method),
418
+						'deactivate_'.$payment_method->slug()								=> $this->_deactivate_payment_method_button($payment_method),
419
+						'fine_print_'.$payment_method->slug()									=> $this->_fine_print()
420 420
 					),
421 421
 					$payment_method
422 422
 				)
@@ -433,19 +433,19 @@  discard block
 block discarded – undo
433 433
 	 * @param \EE_Payment_Method $payment_method
434 434
 	 * @return \EE_Form_Section_Proper
435 435
 	 */
436
-	protected function _pci_dss_compliance( EE_Payment_Method $payment_method ) {
437
-		if ( $payment_method->type_obj()->requires_https() ) {
436
+	protected function _pci_dss_compliance(EE_Payment_Method $payment_method) {
437
+		if ($payment_method->type_obj()->requires_https()) {
438 438
 			return new EE_Form_Section_HTML(
439 439
 				EEH_HTML::tr(
440 440
 					EEH_HTML::th(
441 441
 						EEH_HTML::label(
442
-							EEH_HTML::strong( __( 'IMPORTANT', 'event_espresso' ), '', 'important-notice' )
442
+							EEH_HTML::strong(__('IMPORTANT', 'event_espresso'), '', 'important-notice')
443 443
 						)
444
-					) .
444
+					).
445 445
 					EEH_HTML::td(
446
-						EEH_HTML::strong( __( 'You are responsible for your own website security and Payment Card Industry Data Security Standards (PCI DSS) compliance.', 'event_espresso' )) .
447
-						EEH_HTML::br() .
448
-						__( 'Learn more about ', 'event_espresso' ) . EEH_HTML::link( 'https://www.pcisecuritystandards.org/merchants/index.php', __( 'PCI DSS compliance', 'event_espresso' ))
446
+						EEH_HTML::strong(__('You are responsible for your own website security and Payment Card Industry Data Security Standards (PCI DSS) compliance.', 'event_espresso')).
447
+						EEH_HTML::br().
448
+						__('Learn more about ', 'event_espresso').EEH_HTML::link('https://www.pcisecuritystandards.org/merchants/index.php', __('PCI DSS compliance', 'event_espresso'))
449 449
 					)
450 450
 				)
451 451
 			);
@@ -463,19 +463,19 @@  discard block
 block discarded – undo
463 463
 	 * @param \EE_Payment_Method $payment_method
464 464
 	 * @return \EE_Form_Section_Proper
465 465
 	 */
466
-	protected function _currency_support( EE_Payment_Method $payment_method ) {
467
-		if ( ! $payment_method->usable_for_currency( EE_Config::instance()->currency->code )) {
466
+	protected function _currency_support(EE_Payment_Method $payment_method) {
467
+		if ( ! $payment_method->usable_for_currency(EE_Config::instance()->currency->code)) {
468 468
 			return new EE_Form_Section_HTML(
469 469
 				EEH_HTML::tr(
470 470
 					EEH_HTML::th(
471 471
 						EEH_HTML::label(
472
-							EEH_HTML::strong( __( 'IMPORTANT', 'event_espresso' ), '', 'important-notice' )
472
+							EEH_HTML::strong(__('IMPORTANT', 'event_espresso'), '', 'important-notice')
473 473
 						)
474
-					) .
474
+					).
475 475
 					EEH_HTML::td(
476 476
 						EEH_HTML::strong(
477 477
 							sprintf(
478
-								__( 'This payment method does not support the currency set on your site (%1$s) and so will not appear as a payment option to registrants. Please activate a different payment method or change your site\'s country and associated currency.', 'event_espresso'),
478
+								__('This payment method does not support the currency set on your site (%1$s) and so will not appear as a payment option to registrants. Please activate a different payment method or change your site\'s country and associated currency.', 'event_espresso'),
479 479
 								EE_Config::instance()->currency->code
480 480
 							)
481 481
 						)
@@ -495,9 +495,9 @@  discard block
 block discarded – undo
495 495
 	 * @param \EE_Payment_Method $payment_method
496 496
 	 * @return \EE_Form_Section_HTML
497 497
 	 */
498
-	protected function _payment_method_settings( EE_Payment_Method $payment_method ) {
498
+	protected function _payment_method_settings(EE_Payment_Method $payment_method) {
499 499
 		//modify the form so we only have/show fields that will be implemented for this version
500
-		return $this->_simplify_form( $payment_method->type_obj()->settings_form(), $payment_method->name() );
500
+		return $this->_simplify_form($payment_method->type_obj()->settings_form(), $payment_method->name());
501 501
 	}
502 502
 
503 503
 
@@ -510,8 +510,8 @@  discard block
 block discarded – undo
510 510
 	 * @return \EE_Payment_Method_Form
511 511
 	 * @throws \EE_Error
512 512
 	 */
513
-	protected function _simplify_form( $form_section, $payment_method_name = '' ){
514
-		if ( $form_section instanceof EE_Payment_Method_Form ) {
513
+	protected function _simplify_form($form_section, $payment_method_name = '') {
514
+		if ($form_section instanceof EE_Payment_Method_Form) {
515 515
 			$form_section->exclude(
516 516
 				array(
517 517
 					'PMD_type', //dont want them changing the type
@@ -522,7 +522,7 @@  discard block
 block discarded – undo
522 522
 			);
523 523
 			return $form_section;
524 524
 		} else {
525
-			throw new EE_Error( sprintf( __( 'The EE_Payment_Method_Form for the "%1$s" payment method is missing or invalid.', 'event_espresso' ), $payment_method_name ));
525
+			throw new EE_Error(sprintf(__('The EE_Payment_Method_Form for the "%1$s" payment method is missing or invalid.', 'event_espresso'), $payment_method_name));
526 526
 		}
527 527
 	}
528 528
 
@@ -535,18 +535,18 @@  discard block
 block discarded – undo
535 535
 	 * @param \EE_Payment_Method $payment_method
536 536
 	 * @return \EE_Form_Section_HTML
537 537
 	 */
538
-	protected function _update_payment_method_button( EE_Payment_Method $payment_method ) {
538
+	protected function _update_payment_method_button(EE_Payment_Method $payment_method) {
539 539
 		$update_button = new EE_Submit_Input(
540 540
 			array(
541
-				'html_id' 		=> 'save_' . $payment_method->slug() . '_settings',
542
-				'default' 		=> sprintf( __( 'Update %s Payment Settings', 'event_espresso' ), $payment_method->admin_name() ),
541
+				'html_id' 		=> 'save_'.$payment_method->slug().'_settings',
542
+				'default' 		=> sprintf(__('Update %s Payment Settings', 'event_espresso'), $payment_method->admin_name()),
543 543
 				'html_label' => EEH_HTML::nbsp()
544 544
 			)
545 545
 		);
546 546
 		return new EE_Form_Section_HTML(
547
-			EEH_HTML::no_row( EEH_HTML::br(2) ) .
547
+			EEH_HTML::no_row(EEH_HTML::br(2)).
548 548
 			EEH_HTML::tr(
549
-				EEH_HTML::th( __( 'Update Settings', 'event_espresso') ) .
549
+				EEH_HTML::th(__('Update Settings', 'event_espresso')).
550 550
 				EEH_HTML::td(
551 551
 					$update_button->get_html_for_input()
552 552
 				)
@@ -563,11 +563,11 @@  discard block
 block discarded – undo
563 563
 	 * @param \EE_Payment_Method $payment_method
564 564
 	 * @return \EE_Form_Section_Proper
565 565
 	 */
566
-	protected function _deactivate_payment_method_button( EE_Payment_Method $payment_method ) {
567
-		$link_text_and_title = sprintf( __( 'Deactivate %1$s Payments?', 'event_espresso'), $payment_method->admin_name() );
566
+	protected function _deactivate_payment_method_button(EE_Payment_Method $payment_method) {
567
+		$link_text_and_title = sprintf(__('Deactivate %1$s Payments?', 'event_espresso'), $payment_method->admin_name());
568 568
 		return new EE_Form_Section_HTML(
569 569
 			EEH_HTML::tr(
570
-				EEH_HTML::th( __( 'Deactivate Payment Method', 'event_espresso') ) .
570
+				EEH_HTML::th(__('Deactivate Payment Method', 'event_espresso')).
571 571
 				EEH_HTML::td(
572 572
 					EEH_HTML::link(
573 573
 						EE_Admin_Page::add_query_args_and_nonce(
@@ -579,7 +579,7 @@  discard block
 block discarded – undo
579 579
 						),
580 580
 						$link_text_and_title,
581 581
 						$link_text_and_title,
582
-						'deactivate_' . $payment_method->slug(),
582
+						'deactivate_'.$payment_method->slug(),
583 583
 						'espresso-button button-secondary'
584 584
 					)
585 585
 				)
@@ -595,12 +595,12 @@  discard block
 block discarded – undo
595 595
 	 * @param \EE_Payment_Method $payment_method
596 596
 	 * @return \EE_Form_Section_Proper
597 597
 	 */
598
-	protected function _activate_payment_method_button( EE_Payment_Method $payment_method ) {
599
-		$link_text_and_title = sprintf( __( 'Activate %1$s Payment Method?', 'event_espresso'), $payment_method->admin_name() );
598
+	protected function _activate_payment_method_button(EE_Payment_Method $payment_method) {
599
+		$link_text_and_title = sprintf(__('Activate %1$s Payment Method?', 'event_espresso'), $payment_method->admin_name());
600 600
 		return new EE_Form_Section_Proper(
601 601
 			array(
602
-				'name' 	=> 'activate_' . $payment_method->slug() . '_settings_form',
603
-				'html_id' 	=> 'activate_' . $payment_method->slug() . '_settings_form',
602
+				'name' 	=> 'activate_'.$payment_method->slug().'_settings_form',
603
+				'html_id' 	=> 'activate_'.$payment_method->slug().'_settings_form',
604 604
 				'action' 	=> '#',
605 605
 				'layout_strategy'		=> new EE_Admin_Two_Column_Layout(),
606 606
 				'subsections' 			=> apply_filters(
@@ -609,8 +609,8 @@  discard block
 block discarded – undo
609 609
 						new EE_Form_Section_HTML(
610 610
 							EEH_HTML::tr(
611 611
 								EEH_HTML::th(
612
-									EEH_HTML::label( __( 'Click to Activate ', 'event_espresso' ))
613
-								) .
612
+									EEH_HTML::label(__('Click to Activate ', 'event_espresso'))
613
+								).
614 614
 								EEH_HTML::td(
615 615
 									EEH_HTML::link(
616 616
 										EE_Admin_Page::add_query_args_and_nonce(
@@ -622,7 +622,7 @@  discard block
 block discarded – undo
622 622
 										),
623 623
 										$link_text_and_title,
624 624
 										$link_text_and_title,
625
-										'activate_' . $payment_method->slug(),
625
+										'activate_'.$payment_method->slug(),
626 626
 										'espresso-button-green button-primary'
627 627
 									)
628 628
 								)
@@ -644,9 +644,9 @@  discard block
 block discarded – undo
644 644
 	protected function _fine_print() {
645 645
 		return new EE_Form_Section_HTML(
646 646
 			EEH_HTML::tr(
647
-				EEH_HTML::th() .
647
+				EEH_HTML::th().
648 648
 				EEH_HTML::td(
649
-					EEH_HTML::p( __( 'All fields marked with a * are required fields', 'event_espresso' ), '', 'grey-text' )
649
+					EEH_HTML::p(__('All fields marked with a * are required fields', 'event_espresso'), '', 'grey-text')
650 650
 				)
651 651
 			)
652 652
 		);
@@ -658,15 +658,15 @@  discard block
 block discarded – undo
658 658
 	 * Activates a payment method of that type. Mostly assuming there is only 1 of that type (or none so far)
659 659
 	 * @global WP_User $current_user
660 660
 	 */
661
-	protected function _activate_payment_method(){
662
-		if(isset($this->_req_data['payment_method_type'])){
661
+	protected function _activate_payment_method() {
662
+		if (isset($this->_req_data['payment_method_type'])) {
663 663
 			$payment_method_type = sanitize_text_field($this->_req_data['payment_method_type']);
664 664
 			//see if one exists
665
-			EE_Registry::instance()->load_lib( 'Payment_Method_Manager' );
666
-			$payment_method = EE_Payment_Method_Manager::instance()->activate_a_payment_method_of_type( $payment_method_type );
665
+			EE_Registry::instance()->load_lib('Payment_Method_Manager');
666
+			$payment_method = EE_Payment_Method_Manager::instance()->activate_a_payment_method_of_type($payment_method_type);
667 667
 
668
-			$this->_redirect_after_action(1, 'Payment Method', 'activated', array('action' => 'default','payment_method'=>$payment_method->slug()));
669
-		}else{
668
+			$this->_redirect_after_action(1, 'Payment Method', 'activated', array('action' => 'default', 'payment_method'=>$payment_method->slug()));
669
+		} else {
670 670
 			$this->_redirect_after_action(FALSE, 'Payment Method', 'activated', array('action' => 'default'));
671 671
 		}
672 672
 	}
@@ -674,14 +674,14 @@  discard block
 block discarded – undo
674 674
 	/**
675 675
 	 * Deactivates the payment method with the specified slug, and redirects.
676 676
 	 */
677
-	protected function _deactivate_payment_method(){
678
-		if(isset($this->_req_data['payment_method'])){
677
+	protected function _deactivate_payment_method() {
678
+		if (isset($this->_req_data['payment_method'])) {
679 679
 			$payment_method_slug = sanitize_key($this->_req_data['payment_method']);
680 680
 			//deactivate it
681 681
 			EE_Registry::instance()->load_lib('Payment_Method_Manager');
682
-			$count_updated = EE_Payment_Method_Manager::instance()->deactivate_payment_method( $payment_method_slug );
683
-			$this->_redirect_after_action($count_updated, 'Payment Method', 'deactivated', array('action' => 'default','payment_method'=>$payment_method_slug));
684
-		}else{
682
+			$count_updated = EE_Payment_Method_Manager::instance()->deactivate_payment_method($payment_method_slug);
683
+			$this->_redirect_after_action($count_updated, 'Payment Method', 'deactivated', array('action' => 'default', 'payment_method'=>$payment_method_slug));
684
+		} else {
685 685
 			$this->_redirect_after_action(FALSE, 'Payment Method', 'deactivated', array('action' => 'default'));
686 686
 		}
687 687
 	}
@@ -695,39 +695,39 @@  discard block
 block discarded – undo
695 695
 	 * subsequently called 'headers_sent_func' which is _payment_methods_list)
696 696
 	 * @return void
697 697
 	 */
698
-	protected function _update_payment_method(){
699
-		if( $_SERVER['REQUEST_METHOD'] == 'POST'){
698
+	protected function _update_payment_method() {
699
+		if ($_SERVER['REQUEST_METHOD'] == 'POST') {
700 700
 			//ok let's find which gateway form to use based on the form input
701 701
 			EE_Registry::instance()->load_lib('Payment_Method_Manager');
702 702
 			/** @var $correct_pmt_form_to_use EE_Payment_Method_Form */
703 703
 			$correct_pmt_form_to_use = NULL;
704 704
 			$pmt_obj = NULL;
705
-			foreach(EE_Payment_Method_Manager::instance()->payment_method_types() as $pmt_obj){
705
+			foreach (EE_Payment_Method_Manager::instance()->payment_method_types() as $pmt_obj) {
706 706
 				/** @var $pmt_obj EE_PMT_Base */
707 707
 				//get the form and simplify it, like what we do when we display it
708 708
 				$pmt_form = $pmt_obj->settings_form();
709 709
 				$this->_simplify_form($pmt_form);
710
-				if($pmt_form->form_data_present_in($this->_req_data)){
710
+				if ($pmt_form->form_data_present_in($this->_req_data)) {
711 711
 					$correct_pmt_form_to_use = $pmt_form;
712 712
 					break;
713 713
 				}
714 714
 			}
715 715
 			//if we couldn't find the correct payment method type...
716
-			if( ! $correct_pmt_form_to_use ){
716
+			if ( ! $correct_pmt_form_to_use) {
717 717
 				EE_Error::add_error(__("We could not find which payment method type your form submission related to. Please contact support", 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
718 718
 				$this->_redirect_after_action(FALSE, 'Payment Method', 'activated', array('action' => 'default'));
719 719
 			}
720 720
 			$correct_pmt_form_to_use->receive_form_submission($this->_req_data);
721
-			if($correct_pmt_form_to_use->is_valid()){
721
+			if ($correct_pmt_form_to_use->is_valid()) {
722 722
 				$correct_pmt_form_to_use->save();
723 723
 				$pm = $correct_pmt_form_to_use->get_model_object();
724 724
 				/** @var $pm EE_Payment_Method */
725
-				$this->_redirect_after_action(TRUE, 'Payment Method', 'updated', array('action' => 'default','payment_method'=>$pm->slug()));
726
-			}else{
725
+				$this->_redirect_after_action(TRUE, 'Payment Method', 'updated', array('action' => 'default', 'payment_method'=>$pm->slug()));
726
+			} else {
727 727
 				EE_Error::add_error(
728 728
 					sprintf(
729 729
 						__('Payment method of type %s was not saved because there were validation errors. They have been marked in the form', 'event_espresso'),
730
-						$pmt_obj instanceof EE_PMT_Base ? $pmt_obj->pretty_name() : __( '"(unknown)"', 'event_espresso' )
730
+						$pmt_obj instanceof EE_PMT_Base ? $pmt_obj->pretty_name() : __('"(unknown)"', 'event_espresso')
731 731
 					),
732 732
 					__FILE__,
733 733
 					__FUNCTION__,
@@ -744,11 +744,11 @@  discard block
 block discarded – undo
744 744
 	protected function _payment_settings() {
745 745
 
746 746
 		$this->_template_args['values'] = $this->_yes_no_values;
747
-		$this->_template_args['show_pending_payment_options'] = isset( EE_Registry::instance()->CFG->registration->show_pending_payment_options ) ? absint( EE_Registry::instance()->CFG->registration->show_pending_payment_options ) : FALSE;
747
+		$this->_template_args['show_pending_payment_options'] = isset(EE_Registry::instance()->CFG->registration->show_pending_payment_options) ? absint(EE_Registry::instance()->CFG->registration->show_pending_payment_options) : FALSE;
748 748
 
749
-		$this->_set_add_edit_form_tags( 'update_payment_settings' );
750
-		$this->_set_publish_post_box_vars( NULL, FALSE, FALSE, NULL, FALSE );
751
-		$this->_template_args['admin_page_content'] = EEH_Template::display_template( EE_PAYMENTS_TEMPLATE_PATH . 'payment_settings.template.php', $this->_template_args, TRUE );
749
+		$this->_set_add_edit_form_tags('update_payment_settings');
750
+		$this->_set_publish_post_box_vars(NULL, FALSE, FALSE, NULL, FALSE);
751
+		$this->_template_args['admin_page_content'] = EEH_Template::display_template(EE_PAYMENTS_TEMPLATE_PATH.'payment_settings.template.php', $this->_template_args, TRUE);
752 752
 		$this->display_admin_page_with_sidebar();
753 753
 
754 754
 	}
@@ -762,13 +762,13 @@  discard block
 block discarded – undo
762 762
 	*		@return array
763 763
 	*/
764 764
 	protected function _update_payment_settings() {
765
-		EE_Registry::instance()->CFG->registration->show_pending_payment_options = isset( $this->_req_data['show_pending_payment_options'] ) ? $this->_req_data['show_pending_payment_options'] : FALSE;
766
-		EE_Registry::instance()->CFG = apply_filters( 'FHEE__Payments_Admin_Page___update_payment_settings__CFG', EE_Registry::instance()->CFG );
765
+		EE_Registry::instance()->CFG->registration->show_pending_payment_options = isset($this->_req_data['show_pending_payment_options']) ? $this->_req_data['show_pending_payment_options'] : FALSE;
766
+		EE_Registry::instance()->CFG = apply_filters('FHEE__Payments_Admin_Page___update_payment_settings__CFG', EE_Registry::instance()->CFG);
767 767
 
768 768
 
769
-		$what = __('Payment Settings','event_espresso');
770
-		$success = $this->_update_espresso_configuration( $what, EE_Registry::instance()->CFG, __FILE__, __FUNCTION__, __LINE__ );
771
-		$this->_redirect_after_action( $success, $what, __('updated','event_espresso'), array( 'action' => 'payment_settings' ) );
769
+		$what = __('Payment Settings', 'event_espresso');
770
+		$success = $this->_update_espresso_configuration($what, EE_Registry::instance()->CFG, __FILE__, __FUNCTION__, __LINE__);
771
+		$this->_redirect_after_action($success, $what, __('updated', 'event_espresso'), array('action' => 'payment_settings'));
772 772
 
773 773
 	}
774 774
 	protected function _payment_log_overview_list_table() {
@@ -794,18 +794,18 @@  discard block
 block discarded – undo
794 794
 	 * @param bool $count
795 795
 	 * @return array
796 796
 	 */
797
-	public function get_payment_logs($per_page = 50, $current_page = 0, $count = false){
798
-		EE_Registry::instance()->load_model( 'Change_Log' );
797
+	public function get_payment_logs($per_page = 50, $current_page = 0, $count = false) {
798
+		EE_Registry::instance()->load_model('Change_Log');
799 799
 		//we may need to do multiple queries (joining differently), so we actually wan tan array of query params
800
-		$query_params =  array(array('LOG_type'=>  EEM_Change_Log::type_gateway));
800
+		$query_params = array(array('LOG_type'=>  EEM_Change_Log::type_gateway));
801 801
 		//check if they've selected a specific payment method
802
-		if( isset($this->_req_data['_payment_method']) && $this->_req_data['_payment_method'] !== 'all'){
802
+		if (isset($this->_req_data['_payment_method']) && $this->_req_data['_payment_method'] !== 'all') {
803 803
 			$query_params[0]['OR*pm_or_pay_pm'] = array('Payment.Payment_Method.PMD_ID'=>$this->_req_data['_payment_method'],
804 804
 				'Payment_Method.PMD_ID'=>$this->_req_data['_payment_method']);
805 805
 		}
806 806
 		//take into account search
807
-		if(isset($this->_req_data['s']) && $this->_req_data['s']){
808
-			$similarity_string = array('LIKE','%'.str_replace("","%",$this->_req_data['s']) .'%');
807
+		if (isset($this->_req_data['s']) && $this->_req_data['s']) {
808
+			$similarity_string = array('LIKE', '%'.str_replace("", "%", $this->_req_data['s']).'%');
809 809
 			$query_params[0]['OR*s']['Payment.Transaction.Registration.Attendee.ATT_fname'] = $similarity_string;
810 810
 			$query_params[0]['OR*s']['Payment.Transaction.Registration.Attendee.ATT_lname'] = $similarity_string;
811 811
 			$query_params[0]['OR*s']['Payment.Transaction.Registration.Attendee.ATT_email'] = $similarity_string;
@@ -820,48 +820,48 @@  discard block
 block discarded – undo
820 820
 			$query_params[0]['OR*s']['LOG_message'] = $similarity_string;
821 821
 
822 822
 		}
823
-		if(isset( $this->_req_data['payment-filter-start-date'] ) && isset( $this->_req_data['payment-filter-end-date'] )){
823
+		if (isset($this->_req_data['payment-filter-start-date']) && isset($this->_req_data['payment-filter-end-date'])) {
824 824
 			//add date
825
-			$start_date =wp_strip_all_tags( $this->_req_data['payment-filter-start-date'] );
826
-			$end_date = wp_strip_all_tags( $this->_req_data['payment-filter-end-date'] );
825
+			$start_date = wp_strip_all_tags($this->_req_data['payment-filter-start-date']);
826
+			$end_date = wp_strip_all_tags($this->_req_data['payment-filter-end-date']);
827 827
 			//make sure our timestamps start and end right at the boundaries for each day
828
-			$start_date = date( 'Y-m-d', strtotime( $start_date ) ) . ' 00:00:00';
829
-			$end_date = date( 'Y-m-d', strtotime( $end_date ) ) . ' 23:59:59';
828
+			$start_date = date('Y-m-d', strtotime($start_date)).' 00:00:00';
829
+			$end_date = date('Y-m-d', strtotime($end_date)).' 23:59:59';
830 830
 
831 831
 			//convert to timestamps
832
-			$start_date = strtotime( $start_date );
833
-			$end_date = strtotime( $end_date );
832
+			$start_date = strtotime($start_date);
833
+			$end_date = strtotime($end_date);
834 834
 
835 835
 			//makes sure start date is the lowest value and vice versa
836
-			$start_date = min( $start_date, $end_date );
837
-			$end_date = max( $start_date, $end_date );
836
+			$start_date = min($start_date, $end_date);
837
+			$end_date = max($start_date, $end_date);
838 838
 
839 839
 			//convert for query
840
-			$start_date = EEM_Change_Log::instance()->convert_datetime_for_query( 'LOG_time', date( 'Y-m-d H:i:s', $start_date ), 'Y-m-d H:i:s' );
841
-			$end_date = EEM_Change_Log::instance()->convert_datetime_for_query( 'LOG_time', date( 'Y-m-d H:i:s', $end_date ), 'Y-m-d H:i:s' );
840
+			$start_date = EEM_Change_Log::instance()->convert_datetime_for_query('LOG_time', date('Y-m-d H:i:s', $start_date), 'Y-m-d H:i:s');
841
+			$end_date = EEM_Change_Log::instance()->convert_datetime_for_query('LOG_time', date('Y-m-d H:i:s', $end_date), 'Y-m-d H:i:s');
842 842
 
843
-			$query_params[0]['LOG_time'] = array('BETWEEN',array($start_date,$end_date));
843
+			$query_params[0]['LOG_time'] = array('BETWEEN', array($start_date, $end_date));
844 844
 
845 845
 		}
846
-		if($count){
846
+		if ($count) {
847 847
 			return EEM_Change_Log::instance()->count($query_params);
848 848
 		}
849
-		if(isset($this->_req_data['order'])){
850
-			$sort = ( isset( $this->_req_data['order'] ) && ! empty( $this->_req_data['order'] )) ? $this->_req_data['order'] : 'DESC';
849
+		if (isset($this->_req_data['order'])) {
850
+			$sort = (isset($this->_req_data['order']) && ! empty($this->_req_data['order'])) ? $this->_req_data['order'] : 'DESC';
851 851
 			$query_params['order_by'] = array('LOG_time' => $sort);
852
-		}else{
852
+		} else {
853 853
 				$query_params['order_by'] = array('LOG_time' => 'DESC');
854 854
 		}
855
-		$offset = ($current_page-1)*$per_page;
855
+		$offset = ($current_page - 1) * $per_page;
856 856
 
857
-		if( ! isset($this->_req_data['download_results'])){
858
-			$query_params['limit'] = array( $offset, $per_page );
857
+		if ( ! isset($this->_req_data['download_results'])) {
858
+			$query_params['limit'] = array($offset, $per_page);
859 859
 		}
860 860
 
861 861
 
862 862
 
863 863
 		//now they've requested to instead just download the file instead of viewing it.
864
-		if(isset($this->_req_data['download_results'])){
864
+		if (isset($this->_req_data['download_results'])) {
865 865
 			$wpdb_results = EEM_Change_Log::instance()->get_all_efficiently($query_params);
866 866
 			header('Content-Disposition: attachment');
867 867
 			header("Content-Disposition: attachment; filename=ee_payment_logs_for_".sanitize_key(site_url()));
@@ -883,36 +883,36 @@  discard block
 block discarded – undo
883 883
 	 * @param EE_Change_Log $logB
884 884
 	 * @return int
885 885
 	 */
886
-	protected function _sort_logs_again($logA,$logB){
886
+	protected function _sort_logs_again($logA, $logB) {
887 887
 		$timeA = $logA->get_raw('LOG_time');
888 888
 		$timeB = $logB->get_raw('LOG_time');
889
-		if($timeA == $timeB){
889
+		if ($timeA == $timeB) {
890 890
 			return 0;
891 891
 		}
892 892
 		$comparison = $timeA < $timeB ? -1 : 1;
893
-		if(strtoupper($this->_sort_logs_again_direction) == 'DESC'){
893
+		if (strtoupper($this->_sort_logs_again_direction) == 'DESC') {
894 894
 			return $comparison * -1;
895
-		}else{
895
+		} else {
896 896
 			return $comparison;
897 897
 		}
898 898
 	}
899 899
 
900 900
 	protected function _payment_log_details() {
901
-		EE_Registry::instance()->load_model( 'Change_Log' );
901
+		EE_Registry::instance()->load_model('Change_Log');
902 902
 		/** @var $payment_log EE_Change_Log */
903 903
 		$payment_log = EEM_Change_Log::instance()->get_one_by_ID($this->_req_data['ID']);
904 904
 		$payment_method = NULL;
905 905
 		$transaction = NULL;
906
-		if( $payment_log instanceof EE_Change_Log ){
907
-			if( $payment_log->object() instanceof EE_Payment ){
906
+		if ($payment_log instanceof EE_Change_Log) {
907
+			if ($payment_log->object() instanceof EE_Payment) {
908 908
 				$payment_method = $payment_log->object()->payment_method();
909 909
 				$transaction = $payment_log->object()->transaction();
910
-			}elseif($payment_log->object() instanceof EE_Payment_Method){
910
+			}elseif ($payment_log->object() instanceof EE_Payment_Method) {
911 911
 				$payment_method = $payment_log->object();
912 912
 			}
913 913
 		}
914 914
 		$this->_template_args['admin_page_content'] = EEH_Template::display_template(
915
-			EE_PAYMENTS_TEMPLATE_PATH . 'payment_log_details.template.php',
915
+			EE_PAYMENTS_TEMPLATE_PATH.'payment_log_details.template.php',
916 916
 			array(
917 917
 				'payment_log'=>$payment_log,
918 918
 				'payment_method'=>$payment_method,
Please login to merge, or discard this patch.
admin_pages/registrations/Registrations_Admin_Page.core.php 4 patches
Doc Comments   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1565,8 +1565,6 @@  discard block
 block discarded – undo
1565 1565
 	 * 		form_form_field_input__wrap
1566 1566
 	 *
1567 1567
 	 * 		@access 		public
1568
-	 * 		@param 		string 		$label
1569
-	 * 		@return 		string
1570 1568
 	 */
1571 1569
 	public function form_form_field_input__wrap( $input ) {
1572 1570
 		return '
@@ -1649,6 +1647,10 @@  discard block
 block discarded – undo
1649 1647
 
1650 1648
 
1651 1649
 	//TODO: try changing this to use the model directly... not indirectly through creating a default object...
1650
+
1651
+	/**
1652
+	 * @param boolean $REG_ID
1653
+	 */
1652 1654
 	private function _save_new_answer( $REG_ID, $QST_ID, $ans ) {
1653 1655
 		$set_values = array(
1654 1656
 			'QST_ID' => $QST_ID,
Please login to merge, or discard this patch.
Braces   +30 added lines, -21 removed lines patch added patch discarded remove patch
@@ -1,4 +1,6 @@  discard block
 block discarded – undo
1
-<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) exit('No direct script access allowed');
1
+<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) {
2
+	exit('No direct script access allowed');
3
+}
2 4
 /**
3 5
  * Event Espresso
4 6
  *
@@ -79,8 +81,9 @@  discard block
 block discarded – undo
79 81
 	public function clear_comment_link( $link, $comment, $args ) {
80 82
 		//gotta make sure this only happens on this route
81 83
 		$post_type = get_post_type( $comment->comment_post_ID);
82
-		if ( $post_type == 'espresso_attendees' )
83
-			return '#commentsdiv';
84
+		if ( $post_type == 'espresso_attendees' ) {
85
+					return '#commentsdiv';
86
+		}
84 87
 		return $link;
85 88
 	}
86 89
 
@@ -834,9 +837,9 @@  discard block
 block discarded – undo
834 837
 
835 838
 		$REG_ID = ( ! empty( $this->_req_data['_REG_ID'] )) ? absint( $this->_req_data['_REG_ID'] ) : FALSE;
836 839
 
837
-		if ( $this->_registration = $REG->get_one_by_ID( $REG_ID ))
838
-			return TRUE;
839
-		else {
840
+		if ( $this->_registration = $REG->get_one_by_ID( $REG_ID )) {
841
+					return TRUE;
842
+		} else {
840 843
 			$error_msg = sprintf( __('An error occurred and the details for Registration ID #%s could not be retrieved.', 'event_espresso'), $REG_ID );
841 844
 			EE_Error::add_error( $error_msg, __FILE__, __FUNCTION__, __LINE__ );
842 845
 			$this->_registration = NULL;
@@ -933,7 +936,7 @@  discard block
 block discarded – undo
933 936
 					EEM_Registration::instance()->convert_datetime_for_query( 'REG_date', $curdate . $time_start, 'Y-m-d H:i:s' ),
934 937
 					EEM_Registration::instance()->convert_datetime_for_query( 'REG_date', $curdate . $time_end, 'Y-m-d H:i:s' ),
935 938
 			));
936
-		}elseif($this_month_a || $this_month){
939
+		} elseif($this_month_a || $this_month){
937 940
 			$this_month_r = date('m', current_time('timestamp'));
938 941
 			$days_this_month = date( 't', current_time('timestamp') );
939 942
 			$_where['REG_date']= array('BETWEEN',
@@ -941,18 +944,18 @@  discard block
 block discarded – undo
941 944
 					EEM_Registration::instance()->convert_datetime_for_query( 'REG_date', $this_year_r . '-' . $this_month_r . '-01' . ' ' . $time_start, 'Y-m-d H:i:s' ),
942 945
 					EEM_Registration::instance()->convert_datetime_for_query( 'REG_date', $this_year_r . '-' . $this_month_r . '-' . $days_this_month . ' ' . $time_end, 'Y-m-d H:i:s' )
943 946
 			));
944
-		}elseif($month_range){
947
+		} elseif($month_range){
945 948
 			$pieces = explode(' ', $this->_req_data['month_range'], 3);
946 949
 			$month_r = !empty($pieces[0]) ? date('m', strtotime($pieces[0])) : '';
947 950
 			$year_r = !empty($pieces[1]) ? $pieces[1] : '';
948 951
 			$days_in_month = date('t', strtotime($year_r .  '-' . $month_r . '-' . '01') );
949 952
 			$_where['REG_date']= array('BETWEEN',
950 953
 				array(  EEM_Registration::instance()->convert_datetime_for_query( 'REG_date', $year_r . '-' . $month_r . '-01 00:00:00', 'Y-m-d H:i:s'), EEM_Registration::instance()->convert_datetime_for_query( 'REG_date', $year_r . '-' . $month_r . '-' . $days_in_month .  ' 23:59:59', 'Y-m-d H:i:s' ) ) );
951
-		}elseif($start_date && $end_date){
954
+		} elseif($start_date && $end_date){
952 955
 			throw new EE_Error("not yet supported");
953
-		}elseif($start_date){
956
+		} elseif($start_date){
954 957
 			throw new EE_Error("not yet supported");
955
-		}elseif($end_date){
958
+		} elseif($end_date){
956 959
 			throw new EE_Error("not yet supported");
957 960
 		}
958 961
 
@@ -1876,8 +1879,9 @@  discard block
 block discarded – undo
1876 1879
 			// cycle thru checkboxes
1877 1880
 			while (list( $ind, $REG_ID ) = each($this->_req_data['_REG_ID'])) {
1878 1881
 				$REG = $REG_MDL->get_one_by_ID($REG_ID);
1879
-				if ( ! $REG instanceof EE_Registration )
1880
-					continue;
1882
+				if ( ! $REG instanceof EE_Registration ) {
1883
+									continue;
1884
+				}
1881 1885
 				$deleted = $this->_delete_registration($REG);
1882 1886
 				if ( !$deleted ) {
1883 1887
 					$success = 0;
@@ -1916,8 +1920,9 @@  discard block
 block discarded – undo
1916 1920
 
1917 1921
 		$all_trashed = TRUE;
1918 1922
 		foreach ( $REGS as $registration ) {
1919
-			if ( ! $registration->get('REG_deleted') )
1920
-				$all_trashed = FALSE;
1923
+			if ( ! $registration->get('REG_deleted') ) {
1924
+							$all_trashed = FALSE;
1925
+			}
1921 1926
 		}
1922 1927
 
1923 1928
 		if ( ! $all_trashed ) {
@@ -1943,8 +1948,10 @@  discard block
 block discarded – undo
1943 1948
 			//now delete permanently the checkins related to this registration.
1944 1949
 			$registration->delete_related_permanently('Checkin');
1945 1950
 
1946
-			if ( $registration->ID() === $REG->ID() )
1947
-				continue; //we don't want to delete permanently the existing registration just yet.
1951
+			if ( $registration->ID() === $REG->ID() ) {
1952
+							continue;
1953
+			}
1954
+			//we don't want to delete permanently the existing registration just yet.
1948 1955
 
1949 1956
 			//remove relation to transaction for these registrations if NOT the existing registrations
1950 1957
 			$registration->_remove_relations('Transaction');
@@ -1997,8 +2004,9 @@  discard block
 block discarded – undo
1997 2004
 
1998 2005
 		$this->_template_args['step_content'] = $this->_get_registration_step_content();
1999 2006
 
2000
-		if ( defined('DOING_AJAX' ) )
2001
-			$this->_return_json();
2007
+		if ( defined('DOING_AJAX' ) ) {
2008
+					$this->_return_json();
2009
+		}
2002 2010
 
2003 2011
 
2004 2012
 		// grab header
@@ -2412,8 +2420,9 @@  discard block
 block discarded – undo
2412 2420
 			}
2413 2421
 		}
2414 2422
 
2415
-		if ( $success === FALSE )
2416
-			EE_Error::add_error(__('Something went wrong with updating the meta table data for the registration.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__ );
2423
+		if ( $success === FALSE ) {
2424
+					EE_Error::add_error(__('Something went wrong with updating the meta table data for the registration.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__ );
2425
+		}
2417 2426
 
2418 2427
 	}
2419 2428
 
Please login to merge, or discard this patch.
Indentation   +90 added lines, -90 removed lines patch added patch discarded remove patch
@@ -1,26 +1,26 @@  discard block
 block discarded – undo
1 1
 <?php if ( ! defined('EVENT_ESPRESSO_VERSION')) exit('No direct script access allowed');
2 2
 /**
3
- * Event Espresso
4
- *
5
- * Event Registration and Management Plugin for WordPress
6
- *
7
- * @ package			Event Espresso
8
- * @ author				Seth Shoultes
9
- * @ copyright		(c) 2008-2011 Event Espresso  All Rights Reserved.
10
- * @ license			{@link http://eventespresso.com/support/terms-conditions/}   * see Plugin Licensing *
11
- * @ link					{@link http://www.eventespresso.com}
12
- * @ since		 		4.0
13
- *
14
- * ------------------------------------------------------------------------
15
- *
16
- * Registrations_Admin_Page class
17
- *
18
- * @package			Event Espresso
19
- * @subpackage	includes/core/admin/transactions/Registrations_Admin_Page.core.php
20
- * @author				Brent Christensen
21
- *
22
- * ------------------------------------------------------------------------
23
- */
3
+	 * Event Espresso
4
+	 *
5
+	 * Event Registration and Management Plugin for WordPress
6
+	 *
7
+	 * @ package			Event Espresso
8
+	 * @ author				Seth Shoultes
9
+	 * @ copyright		(c) 2008-2011 Event Espresso  All Rights Reserved.
10
+	 * @ license			{@link http://eventespresso.com/support/terms-conditions/}   * see Plugin Licensing *
11
+	 * @ link					{@link http://www.eventespresso.com}
12
+	 * @ since		 		4.0
13
+	 *
14
+	 * ------------------------------------------------------------------------
15
+	 *
16
+	 * Registrations_Admin_Page class
17
+	 *
18
+	 * @package			Event Espresso
19
+	 * @subpackage	includes/core/admin/transactions/Registrations_Admin_Page.core.php
20
+	 * @author				Brent Christensen
21
+	 *
22
+	 * ------------------------------------------------------------------------
23
+	 */
24 24
 class Registrations_Admin_Page extends EE_Admin_Page_CPT {
25 25
 
26 26
 	/**
@@ -129,9 +129,9 @@  discard block
 block discarded – undo
129 129
 
130 130
 	/**
131 131
 	 * 		grab url requests and route them
132
-	*		@access private
133
-	*		@return void
134
-	*/
132
+	 *		@access private
133
+	 *		@return void
134
+	 */
135 135
 	public function _set_page_routes() {
136 136
 
137 137
 		$this->_get_registration_status_array();
@@ -403,7 +403,7 @@  discard block
 block discarded – undo
403 403
 						'title' => __('Registrations Other', 'event_espresso'),
404 404
 						'filename' => 'registrations_overview_other'
405 405
 					)
406
-                ),
406
+				),
407 407
 				'help_tour' => array( 'Registration_Overview_Help_Tour' ),
408 408
 				'qtips' => array('Registration_List_Table_Tips'),
409 409
 				'list_table' => 'EE_Registrations_List_Table',
@@ -417,7 +417,7 @@  discard block
 block discarded – undo
417 417
 					'url' => isset($this->_req_data['_REG_ID']) ? add_query_arg(array('_REG_ID' => $this->_req_data['_REG_ID'] ), $this->_current_page_view_url )  : $this->_admin_base_url,
418 418
 					'persistent' => FALSE
419 419
 					),
420
-                'help_tabs' => array(
420
+				'help_tabs' => array(
421 421
 					'registrations_details_help_tab' => array(
422 422
 						'title' => __('Registration Details', 'event_espresso'),
423 423
 						'filename' => 'registrations_details'
@@ -481,7 +481,7 @@  discard block
 block discarded – undo
481 481
 					'order' => 20
482 482
 					),
483 483
 				'list_table' => 'EE_Attendee_Contact_List_Table',
484
-                'help_tabs' => array(
484
+				'help_tabs' => array(
485 485
 					'registrations_contact_list_help_tab' => array(
486 486
 						'title' => __('Registrations Contact List', 'event_espresso'),
487 487
 						'filename' => 'registrations_contact_list'
@@ -498,7 +498,7 @@  discard block
 block discarded – undo
498 498
 						'title' => __('Contact List Other', 'event_espresso'),
499 499
 						'filename' => 'registrations_contact_list_other'
500 500
 					)
501
-                ),
501
+				),
502 502
 				'help_tour' => array( 'Contact_List_Help_Tour' ),
503 503
 				'metaboxes' => array(),
504 504
 				'require_nonce' => FALSE
@@ -532,9 +532,9 @@  discard block
 block discarded – undo
532 532
 
533 533
 	/**
534 534
 	 * 		get list of registration statuses
535
-	*		@access private
536
-	*		@return void
537
-	*/
535
+	 *		@access private
536
+	 *		@return void
537
+	 */
538 538
 	private function _get_registration_status_array() {
539 539
 		self::$_reg_status = EEM_Registration::reg_status_array( array(), TRUE);
540 540
 	}
@@ -839,7 +839,7 @@  discard block
 block discarded – undo
839 839
 			return TRUE;
840 840
 		}
841 841
 
842
-	    $REG = EEM_Registration::instance();
842
+		$REG = EEM_Registration::instance();
843 843
 
844 844
 		$REG_ID = ( ! empty( $this->_req_data['_REG_ID'] )) ? absint( $this->_req_data['_REG_ID'] ) : FALSE;
845 845
 
@@ -1062,9 +1062,9 @@  discard block
 block discarded – undo
1062 1062
 
1063 1063
 	/**
1064 1064
 	 * 		generates HTML for the View Registration Details Admin page
1065
-	*		@access protected
1066
-	*		@return void
1067
-	*/
1065
+	 *		@access protected
1066
+	 *		@return void
1067
+	 */
1068 1068
 	protected function _registration_details() {
1069 1069
 
1070 1070
 		$this->_template_args = array();
@@ -1141,9 +1141,9 @@  discard block
 block discarded – undo
1141 1141
 
1142 1142
 	/**
1143 1143
 	 * 		_set_approve_or_decline_reg_status_buttons
1144
-	*		@access protected
1145
-	*		@return string
1146
-	*/
1144
+	 *		@access protected
1145
+	 *		@return string
1146
+	 */
1147 1147
 	public function set_reg_status_buttons_metabox() {
1148 1148
 
1149 1149
 		//is registration for free event OR for a completed transaction? This will determine whether the set to pending option is shown.
@@ -1333,10 +1333,10 @@  discard block
 block discarded – undo
1333 1333
 
1334 1334
 	/**
1335 1335
 	 * 		approve_registration
1336
-	*		@access protected
1337
-	*		@param bool $notify whether or not to notify the registrant about their approval.
1338
-	*		@return void
1339
-	*/
1336
+	 *		@access protected
1337
+	 *		@param bool $notify whether or not to notify the registrant about their approval.
1338
+	 *		@return void
1339
+	 */
1340 1340
 	protected function approve_registration( $notify = false ) {
1341 1341
 		$this->_reg_status_change_return( EEM_Registration::status_id_approved, $notify );
1342 1342
 	}
@@ -1346,10 +1346,10 @@  discard block
 block discarded – undo
1346 1346
 
1347 1347
 	/**
1348 1348
 	 * 		decline_registration
1349
-	*		@access protected
1350
-	*		@param bool $notify whether or not to notify the registrant about their approval.
1351
-	*		@return void
1352
-	*/
1349
+	 *		@access protected
1350
+	 *		@param bool $notify whether or not to notify the registrant about their approval.
1351
+	 *		@return void
1352
+	 */
1353 1353
 	protected function decline_registration( $notify = false ) {
1354 1354
 		$this->_reg_status_change_return( EEM_Registration::status_id_declined, $notify );
1355 1355
 	}
@@ -1359,10 +1359,10 @@  discard block
 block discarded – undo
1359 1359
 
1360 1360
 	/**
1361 1361
 	 * 		cancel_registration
1362
-	*		@access protected
1363
-	*		@param bool $notify whether or not to notify the registrant about their approval.
1364
-	*		@return void
1365
-	*/
1362
+	 *		@access protected
1363
+	 *		@param bool $notify whether or not to notify the registrant about their approval.
1364
+	 *		@return void
1365
+	 */
1366 1366
 	protected function cancel_registration( $notify = false ) {
1367 1367
 		$this->_reg_status_change_return( EEM_Registration::status_id_cancelled, $notify );
1368 1368
 	}
@@ -1373,10 +1373,10 @@  discard block
 block discarded – undo
1373 1373
 
1374 1374
 	/**
1375 1375
 	 * 		not_approve_registration
1376
-	*		@access protected
1377
-	*		@param bool $notify whether or not to notify the registrant about their approval.
1378
-	*		@return void
1379
-	*/
1376
+	 *		@access protected
1377
+	 *		@param bool $notify whether or not to notify the registrant about their approval.
1378
+	 *		@return void
1379
+	 */
1380 1380
 	protected function not_approve_registration( $notify = false ) {
1381 1381
 		$this->_reg_status_change_return( EEM_Registration::status_id_not_approved, $notify );
1382 1382
 	}
@@ -1385,10 +1385,10 @@  discard block
 block discarded – undo
1385 1385
 
1386 1386
 	/**
1387 1387
 	 * 		decline_registration
1388
-	*		@access protected
1389
-	*		@param bool $notify whether or not to notify the registrant about their approval.
1390
-	*		@return void
1391
-	*/
1388
+	 *		@access protected
1389
+	 *		@param bool $notify whether or not to notify the registrant about their approval.
1390
+	 *		@return void
1391
+	 */
1392 1392
 	protected function pending_registration( $notify = false ) {
1393 1393
 		$this->_reg_status_change_return( EEM_Registration::status_id_pending_payment, $notify );
1394 1394
 	}
@@ -1398,9 +1398,9 @@  discard block
 block discarded – undo
1398 1398
 
1399 1399
 	/**
1400 1400
 	 * 		generates HTML for the Registration main meta box
1401
-	*		@access public
1402
-	*		@return void
1403
-	*/
1401
+	 *		@access public
1402
+	 *		@return void
1403
+	 */
1404 1404
 	public function _reg_details_meta_box() {
1405 1405
 		EEH_Autoloader::register_line_item_display_autoloaders();
1406 1406
 		EEH_Autoloader::register_line_item_filter_autoloaders();
@@ -1483,9 +1483,9 @@  discard block
 block discarded – undo
1483 1483
 
1484 1484
 	/**
1485 1485
 	 * 		generates HTML for the Registration Questions meta box
1486
-	*		@access public
1487
-	*		@return void
1488
-	*/
1486
+	 *		@access public
1487
+	 *		@return void
1488
+	 */
1489 1489
 	public function _reg_questions_meta_box() {
1490 1490
 
1491 1491
 		add_filter( 'FHEE__EEH_Form_Fields__generate_question_groups_html__before_question_group_questions', array( $this, 'form_before_question_group' ), 10, 1 );
@@ -1593,9 +1593,9 @@  discard block
 block discarded – undo
1593 1593
 
1594 1594
 	/**
1595 1595
 	 * 		generates HTML for the Registration main meta box
1596
-	*		@access protected
1597
-	*		@return void
1598
-	*/
1596
+	 *		@access protected
1597
+	 *		@return void
1598
+	 */
1599 1599
 	protected function _update_attendee_registration_form() {
1600 1600
 		$qstns = isset( $this->_req_data['qstn'] ) ? $this->_req_data['qstn'] : FALSE;
1601 1601
 		$REG_ID = isset( $this->_req_data['_REG_ID'] ) ? absint( $this->_req_data['_REG_ID'] ) : FALSE;
@@ -1677,12 +1677,12 @@  discard block
 block discarded – undo
1677 1677
 
1678 1678
 	/**
1679 1679
 	 * 		generates HTML for the Registration main meta box
1680
-	*		@access public
1681
-	*		@return void
1682
-	*/
1680
+	 *		@access public
1681
+	 *		@return void
1682
+	 */
1683 1683
 	public function _reg_attendees_meta_box() {
1684 1684
 
1685
-	    $REG = EEM_Registration::instance();
1685
+		$REG = EEM_Registration::instance();
1686 1686
 		//get all other registrations on this transaction, and cache
1687 1687
 		//the attendees for them so we don't have to run another query using force_join
1688 1688
 		$registrations = $REG->get_all(array(
@@ -1735,9 +1735,9 @@  discard block
 block discarded – undo
1735 1735
 
1736 1736
 	/**
1737 1737
 	 * 		generates HTML for the Edit Registration side meta box
1738
-	*		@access public
1739
-	*		@return void
1740
-	*/
1738
+	 *		@access public
1739
+	 *		@return void
1740
+	 */
1741 1741
 	public function _reg_registrant_side_meta_box() {
1742 1742
 
1743 1743
 		/*@var $attendee EE_Attendee */
@@ -2083,9 +2083,9 @@  discard block
 block discarded – undo
2083 2083
 
2084 2084
 	/**
2085 2085
 	 * 		set_reg_event
2086
-	*		@access private
2087
-	*		@return boolean
2088
-	*/
2086
+	 *		@access private
2087
+	 *		@return boolean
2088
+	 */
2089 2089
 	private function _set_reg_event() {
2090 2090
 		if ( is_object( $this->_reg_event )) {
2091 2091
 			return TRUE;
@@ -2189,9 +2189,9 @@  discard block
 block discarded – undo
2189 2189
 
2190 2190
 	/**
2191 2191
 	 * 		generates HTML for the Attendee Contact List
2192
-	*		@access protected
2193
-	*		@return void
2194
-	*/
2192
+	 *		@access protected
2193
+	 *		@return void
2194
+	 */
2195 2195
 	protected function _attendee_contact_list_table() {
2196 2196
 		do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' );
2197 2197
 		$this->_search_btn_label = __('Contacts', 'event_espresso');
@@ -2205,9 +2205,9 @@  discard block
 block discarded – undo
2205 2205
 	/**
2206 2206
 	 * 		get_attendees
2207 2207
 	 * 		@param bool $count whether to return count or data.
2208
-	*		@access public
2209
-	*		@return array
2210
-	*/
2208
+	 *		@access public
2209
+	 *		@return array
2210
+	 */
2211 2211
 	public function get_attendees( $per_page, $count = FALSE, $trash = FALSE ) {
2212 2212
 
2213 2213
 		do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' );
@@ -2525,9 +2525,9 @@  discard block
 block discarded – undo
2525 2525
 
2526 2526
 	/**
2527 2527
 	 * 		_attendee_details
2528
-	*		@access protected
2529
-	*		@return void
2530
-	*/
2528
+	 *		@access protected
2529
+	 *		@return void
2530
+	 */
2531 2531
 	public function attendee_registrations_meta_box( $post ) {
2532 2532
 
2533 2533
 		$this->_template_args['attendee'] = $this->_cpt_model_obj;
@@ -2560,10 +2560,10 @@  discard block
 block discarded – undo
2560 2560
 
2561 2561
 	/**
2562 2562
 	 * 		_trash_or_restore_attendee
2563
-	*		@param boolean 		$trash - whether to move item to trash (TRUE) or restore it (FALSE)
2564
-	*		@access protected
2565
-	*		@return void
2566
-	*/
2563
+	 *		@param boolean 		$trash - whether to move item to trash (TRUE) or restore it (FALSE)
2564
+	 *		@access protected
2565
+	 *		@return void
2566
+	 */
2567 2567
 	protected function _trash_or_restore_attendees( $trash = TRUE ) {
2568 2568
 
2569 2569
 		do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' );
Please login to merge, or discard this patch.
Spacing   +511 added lines, -511 removed lines patch added patch discarded remove patch
@@ -42,8 +42,8 @@  discard block
 block discarded – undo
42 42
 	 * @param bool $routing
43 43
 	 * @return Registrations_Admin_Page
44 44
 	 */
45
-	public function __construct( $routing = TRUE ) {
46
-		parent::__construct( $routing );
45
+	public function __construct($routing = TRUE) {
46
+		parent::__construct($routing);
47 47
 	}
48 48
 
49 49
 
@@ -75,16 +75,16 @@  discard block
 block discarded – undo
75 75
 				'trash' => 'post.php'
76 76
 			);
77 77
 
78
-		add_action('edit_form_after_title', array($this, 'after_title_form_fields'), 10 );
78
+		add_action('edit_form_after_title', array($this, 'after_title_form_fields'), 10);
79 79
 		//add filters so that the comment urls don't take users to a confusing 404 page
80
-		add_filter('get_comment_link', array( $this, 'clear_comment_link' ), 10, 3 );
80
+		add_filter('get_comment_link', array($this, 'clear_comment_link'), 10, 3);
81 81
 	}
82 82
 
83 83
 
84
-	public function clear_comment_link( $link, $comment, $args ) {
84
+	public function clear_comment_link($link, $comment, $args) {
85 85
 		//gotta make sure this only happens on this route
86
-		$post_type = get_post_type( $comment->comment_post_ID);
87
-		if ( $post_type == 'espresso_attendees' )
86
+		$post_type = get_post_type($comment->comment_post_ID);
87
+		if ($post_type == 'espresso_attendees')
88 88
 			return '#commentsdiv';
89 89
 		return $link;
90 90
 	}
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
 
93 93
 	protected function _ajax_hooks() {
94 94
 		//todo: all hooks for registrations ajax goes in here
95
-		add_action( 'wp_ajax_toggle_checkin_status', array( $this, 'toggle_checkin_status' ));
95
+		add_action('wp_ajax_toggle_checkin_status', array($this, 'toggle_checkin_status'));
96 96
 	}
97 97
 
98 98
 
@@ -107,8 +107,8 @@  discard block
 block discarded – undo
107 107
 					'add-attendee' => __('Add Contact', 'event_espresso'),
108 108
 					'edit' => __('Edit Contact', 'event_espresso'),
109 109
 					'report'=>  __("Event Registrations CSV Report", "event_espresso"),
110
-					'report_all' => __( 'All Registrations CSV Report', 'event_espresso' ),
111
-					'contact_list_report' => __( 'Contact List Report', 'event_espresso' ),
110
+					'report_all' => __('All Registrations CSV Report', 'event_espresso'),
111
+					'contact_list_report' => __('Contact List Report', 'event_espresso'),
112 112
 					'contact_list_export'=>  __("Export Data", "event_espresso"),
113 113
 				),
114 114
 			'publishbox' => array(
@@ -136,9 +136,9 @@  discard block
 block discarded – undo
136 136
 
137 137
 		$this->_get_registration_status_array();
138 138
 
139
-		$reg_id = ! empty( $this->_req_data['_REG_ID'] ) && ! is_array( $this->_req_data['_REG_ID'] ) ? $this->_req_data['_REG_ID'] : 0;
140
-		$att_id = ! empty( $this->_req_data[ 'ATT_ID' ] ) && ! is_array( $this->_req_data['ATT_ID'] ) ? $this->_req_data['ATT_ID'] : 0;
141
-		$att_id = ! empty( $this->_req_data['post'] ) && ! is_array( $this->_req_data['post'] ) ? $this->_req_data['post'] : $att_id;
139
+		$reg_id = ! empty($this->_req_data['_REG_ID']) && ! is_array($this->_req_data['_REG_ID']) ? $this->_req_data['_REG_ID'] : 0;
140
+		$att_id = ! empty($this->_req_data['ATT_ID']) && ! is_array($this->_req_data['ATT_ID']) ? $this->_req_data['ATT_ID'] : 0;
141
+		$att_id = ! empty($this->_req_data['post']) && ! is_array($this->_req_data['post']) ? $this->_req_data['post'] : $att_id;
142 142
 
143 143
 		$this->_page_routes = array(
144 144
 
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
 
156 156
 				'edit_registration'	=> array(
157 157
 						'func' => '_registration_details',
158
-						'args' => array( 'edit' ),
158
+						'args' => array('edit'),
159 159
 						'noheader' => TRUE,
160 160
 						'capability' => 'ee_edit_registration',
161 161
 						'obj_id' => $reg_id
@@ -170,7 +170,7 @@  discard block
 block discarded – undo
170 170
 
171 171
 				'restore_registrations' => array(
172 172
 					'func' => '_trash_or_restore_registrations',
173
-					'args' => array( 'trash' => FALSE ),
173
+					'args' => array('trash' => FALSE),
174 174
 					'noheader' => TRUE,
175 175
 					'capability' => 'ee_delete_registrations'
176 176
 					),
@@ -404,7 +404,7 @@  discard block
 block discarded – undo
404 404
 						'filename' => 'registrations_overview_other'
405 405
 					)
406 406
                 ),
407
-				'help_tour' => array( 'Registration_Overview_Help_Tour' ),
407
+				'help_tour' => array('Registration_Overview_Help_Tour'),
408 408
 				'qtips' => array('Registration_List_Table_Tips'),
409 409
 				'list_table' => 'EE_Registrations_List_Table',
410 410
 				'require_nonce' => FALSE
@@ -414,7 +414,7 @@  discard block
 block discarded – undo
414 414
 				'nav' => array(
415 415
 					'label' => __('REG Details', 'event_espresso'),
416 416
 					'order' => 15,
417
-					'url' => isset($this->_req_data['_REG_ID']) ? add_query_arg(array('_REG_ID' => $this->_req_data['_REG_ID'] ), $this->_current_page_view_url )  : $this->_admin_base_url,
417
+					'url' => isset($this->_req_data['_REG_ID']) ? add_query_arg(array('_REG_ID' => $this->_req_data['_REG_ID']), $this->_current_page_view_url) : $this->_admin_base_url,
418 418
 					'persistent' => FALSE
419 419
 					),
420 420
                 'help_tabs' => array(
@@ -435,8 +435,8 @@  discard block
 block discarded – undo
435 435
 						'filename' => 'registrations_details_registrant_details'
436 436
 						)
437 437
 					),
438
-				'help_tour' => array( 'Registration_Details_Help_Tour' ),
439
-				'metaboxes' => array_merge( $this->_default_espresso_metaboxes, array( '_registration_details_metaboxes' ) ),
438
+				'help_tour' => array('Registration_Details_Help_Tour'),
439
+				'metaboxes' => array_merge($this->_default_espresso_metaboxes, array('_registration_details_metaboxes')),
440 440
 				'require_nonce' => FALSE
441 441
 				),
442 442
 
@@ -460,7 +460,7 @@  discard block
 block discarded – undo
460 460
 					'order' => 15,
461 461
 					'persistent' => FALSE
462 462
 					),
463
-				'metaboxes' => array_merge( $this->_default_espresso_metaboxes, array('_publish_post_box', 'attendee_editor_metaboxes' ) ),
463
+				'metaboxes' => array_merge($this->_default_espresso_metaboxes, array('_publish_post_box', 'attendee_editor_metaboxes')),
464 464
 				'require_nonce' => FALSE
465 465
 				),
466 466
 
@@ -469,7 +469,7 @@  discard block
 block discarded – undo
469 469
 					'label' => __('Edit Contact', 'event_espresso'),
470 470
 					'order' => 15,
471 471
 					'persistent' => FALSE,
472
-					'url' => isset($this->_req_data['ATT_ID']) ? add_query_arg(array('ATT_ID' => $this->_req_data['ATT_ID'] ), $this->_current_page_view_url )  : $this->_admin_base_url
472
+					'url' => isset($this->_req_data['ATT_ID']) ? add_query_arg(array('ATT_ID' => $this->_req_data['ATT_ID']), $this->_current_page_view_url) : $this->_admin_base_url
473 473
 					),
474 474
 				'metaboxes' => array('attendee_editor_metaboxes'),
475 475
 				'require_nonce' => FALSE
@@ -499,7 +499,7 @@  discard block
 block discarded – undo
499 499
 						'filename' => 'registrations_contact_list_other'
500 500
 					)
501 501
                 ),
502
-				'help_tour' => array( 'Contact_List_Help_Tour' ),
502
+				'help_tour' => array('Contact_List_Help_Tour'),
503 503
 				'metaboxes' => array(),
504 504
 				'require_nonce' => FALSE
505 505
 				),
@@ -518,7 +518,7 @@  discard block
 block discarded – undo
518 518
 	protected function _add_screen_options() {}
519 519
 	protected function _add_feature_pointers() {}
520 520
 	public function admin_init() {
521
-		EE_Registry::$i18n_js_strings[ 'update_att_qstns' ] = __( 'click "Update Registration Questions" to save your changes', 'event_espresso' );
521
+		EE_Registry::$i18n_js_strings['update_att_qstns'] = __('click "Update Registration Questions" to save your changes', 'event_espresso');
522 522
 	}
523 523
 	public function admin_notices() {}
524 524
 	public function admin_footer_scripts() {}
@@ -536,7 +536,7 @@  discard block
 block discarded – undo
536 536
 	*		@return void
537 537
 	*/
538 538
 	private function _get_registration_status_array() {
539
-		self::$_reg_status = EEM_Registration::reg_status_array( array(), TRUE);
539
+		self::$_reg_status = EEM_Registration::reg_status_array(array(), TRUE);
540 540
 	}
541 541
 
542 542
 
@@ -559,11 +559,11 @@  discard block
 block discarded – undo
559 559
 	public function load_scripts_styles() {
560 560
 		//style
561 561
 		//wp_register_style('espresso_attendees', ATT_ASSETS_URL . 'espresso_attendees_admin.css', array(), EVENT_ESPRESSO_VERSION );
562
-		wp_register_style('espresso_reg', REG_ASSETS_URL . 'espresso_registrations_admin.css', array('ee-admin-css'), EVENT_ESPRESSO_VERSION );
562
+		wp_register_style('espresso_reg', REG_ASSETS_URL.'espresso_registrations_admin.css', array('ee-admin-css'), EVENT_ESPRESSO_VERSION);
563 563
 		wp_enqueue_style('espresso_reg');
564 564
 
565 565
 		//script
566
-		wp_register_script('espresso_reg', REG_ASSETS_URL . 'espresso_registrations_admin.js', array('jquery-ui-datepicker', 'jquery-ui-draggable', 'ee_admin_js'), EVENT_ESPRESSO_VERSION, TRUE);
566
+		wp_register_script('espresso_reg', REG_ASSETS_URL.'espresso_registrations_admin.js', array('jquery-ui-datepicker', 'jquery-ui-draggable', 'ee_admin_js'), EVENT_ESPRESSO_VERSION, TRUE);
567 567
 		wp_enqueue_script('espresso_reg');
568 568
 	}
569 569
 
@@ -572,9 +572,9 @@  discard block
 block discarded – undo
572 572
 	public function load_scripts_styles_edit_attendee() {
573 573
 		//stuff to only show up on our attendee edit details page.
574 574
 		$attendee_details_translations = array(
575
-			'att_publish_text' => sprintf( __('Created on: <b>%1$s</b>', 'event_espresso'), $this->_cpt_model_obj->get_datetime('ATT_created') )
575
+			'att_publish_text' => sprintf(__('Created on: <b>%1$s</b>', 'event_espresso'), $this->_cpt_model_obj->get_datetime('ATT_created'))
576 576
 			);
577
-		wp_localize_script( 'espresso_reg', 'ATTENDEE_DETAILS', $attendee_details_translations );
577
+		wp_localize_script('espresso_reg', 'ATTENDEE_DETAILS', $attendee_details_translations);
578 578
 		wp_enqueue_script('jquery-validate');
579 579
 	}
580 580
 
@@ -592,7 +592,7 @@  discard block
 block discarded – undo
592 592
 
593 593
 	public function load_scripts_styles_contact_list() {
594 594
 		wp_deregister_style('espresso_reg');
595
-		wp_register_style('espresso_att', REG_ASSETS_URL . 'espresso_attendees_admin.css', array('ee-admin-css'), EVENT_ESPRESSO_VERSION );
595
+		wp_register_style('espresso_att', REG_ASSETS_URL.'espresso_attendees_admin.css', array('ee-admin-css'), EVENT_ESPRESSO_VERSION);
596 596
 		wp_enqueue_style('espresso_att');
597 597
 	}
598 598
 
@@ -601,9 +601,9 @@  discard block
 block discarded – undo
601 601
 
602 602
 
603 603
 	public function load_scripts_styles_new_registration() {
604
-		wp_register_script( 'ee-spco-for-admin', REG_ASSETS_URL . 'spco_for_admin.js', array('underscore', 'jquery'), EVENT_ESPRESSO_VERSION, TRUE );
604
+		wp_register_script('ee-spco-for-admin', REG_ASSETS_URL.'spco_for_admin.js', array('underscore', 'jquery'), EVENT_ESPRESSO_VERSION, TRUE);
605 605
 		wp_enqueue_script('ee-spco-for-admin');
606
-		add_filter('FHEE__EED_Ticket_Selector__load_tckt_slctr_assets', '__return_true' );
606
+		add_filter('FHEE__EED_Ticket_Selector__load_tckt_slctr_assets', '__return_true');
607 607
 		EE_Form_Section_Proper::wp_enqueue_scripts();
608 608
 		EED_Ticket_Selector::load_tckt_slctr_assets();
609 609
 		EE_Datepicker_Input::enqueue_styles_and_scripts();
@@ -630,7 +630,7 @@  discard block
 block discarded – undo
630 630
 		//for notification related bulk actions we need to make sure only active messengers have an option.
631 631
 		EED_Messages::set_autoloaders();
632 632
 		/** @type EE_Messages $messages_controller */
633
-		$messages_controller = EE_Registry::instance()->load_lib( 'messages' );
633
+		$messages_controller = EE_Registry::instance()->load_lib('messages');
634 634
 		$active_mts = $messages_controller->get_active_message_types();
635 635
 		//key= bulk_action_slug, value= message type.
636 636
 		$match_array = array(
@@ -643,23 +643,23 @@  discard block
 block discarded – undo
643 643
 
644 644
 		/** setup reg status bulk actions **/
645 645
 		$def_reg_status_actions['approve_registration'] = __('Approve Registrations', 'event_espresso');
646
-		if ( in_array( $match_array['approve_registration'], $active_mts ) && EE_Registry::instance()->CAP->current_user_can( 'ee_send_message', 'batch_send_messages' ) ) {
646
+		if (in_array($match_array['approve_registration'], $active_mts) && EE_Registry::instance()->CAP->current_user_can('ee_send_message', 'batch_send_messages')) {
647 647
 			$def_reg_status_actions['approve_and_notify_registration'] = __('Approve and Notify Registrations', 'event_espresso');
648 648
 		}
649 649
 		$def_reg_status_actions['decline_registration'] = __('Decline Registrations', 'event_espresso');
650
-		if ( in_array( $match_array['decline_registration'], $active_mts ) && EE_Registry::instance()->CAP->current_user_can( 'ee_send_message', 'batch_send_messages' ) ) {
650
+		if (in_array($match_array['decline_registration'], $active_mts) && EE_Registry::instance()->CAP->current_user_can('ee_send_message', 'batch_send_messages')) {
651 651
 			$def_reg_status_actions['decline_and_notify_registration'] = __('Decline and Notify Registrations', 'event_espresso');
652 652
 		}
653 653
 		$def_reg_status_actions['pending_registration'] = __('Set Registrations to Pending Payment', 'event_espresso');
654
-		if ( in_array( $match_array['pending_registration'], $active_mts ) && EE_Registry::instance()->CAP->current_user_can( 'ee_send_message', 'batch_send_messages' ) ) {
654
+		if (in_array($match_array['pending_registration'], $active_mts) && EE_Registry::instance()->CAP->current_user_can('ee_send_message', 'batch_send_messages')) {
655 655
 			$def_reg_status_actions['pending_and_notify_registration'] = __('Set Registrations to Pending Payment and Notify', 'event_espresso');
656 656
 		}
657 657
 		$def_reg_status_actions['no_approve_registration'] = __('Set Registrations to Not Approved', 'event_espresso');
658
-		if ( in_array( $match_array['no_approve_registration'], $active_mts ) && EE_Registry::instance()->CAP->current_user_can( 'ee_send_message', 'batch_send_messages' ) ) {
658
+		if (in_array($match_array['no_approve_registration'], $active_mts) && EE_Registry::instance()->CAP->current_user_can('ee_send_message', 'batch_send_messages')) {
659 659
 			$def_reg_status_actions['no_approve_and_notify_registration'] = __('Set Registrations to Not Approved and Notify', 'event_espresso');
660 660
 		}
661 661
 		$def_reg_status_actions['cancel_registration'] = __('Cancel Registrations', 'event_espresso');
662
-		if ( in_array( $match_array['cancel_registration'], $active_mts ) && EE_Registry::instance()->CAP->current_user_can( 'ee_send_message', 'batch_send_messages' ) ) {
662
+		if (in_array($match_array['cancel_registration'], $active_mts) && EE_Registry::instance()->CAP->current_user_can('ee_send_message', 'batch_send_messages')) {
663 663
 			$def_reg_status_actions['cancel_and_notify_registration'] = __('Cancel Registrations and Notify', 'event_espresso');
664 664
 		}
665 665
 
@@ -668,29 +668,29 @@  discard block
 block discarded – undo
668 668
 				'slug' => 'all',
669 669
 				'label' => __('View All Registrations', 'event_espresso'),
670 670
 				'count' => 0,
671
-				'bulk_action' => array_merge( $def_reg_status_actions, array(
671
+				'bulk_action' => array_merge($def_reg_status_actions, array(
672 672
 					'trash_registrations' => __('Trash Registrations', 'event_espresso')
673
-					) )
673
+					))
674 674
 				),
675 675
 			'month' => array(
676 676
 				'slug' => 'month',
677 677
 				'label' => __('This Month', 'event_espresso'),
678 678
 				'count' => 0,
679
-				'bulk_action' => array_merge( $def_reg_status_actions, array(
679
+				'bulk_action' => array_merge($def_reg_status_actions, array(
680 680
 					'trash_registrations' => __('Trash Registrations', 'event_espresso')
681 681
 					))
682 682
 				),
683 683
 			'today' => array(
684 684
 				'slug' => 'today',
685
-				'label' => sprintf( __('Today - %s', 'event_espresso'), date('M d, Y', current_time('timestamp' ) ) ),
685
+				'label' => sprintf(__('Today - %s', 'event_espresso'), date('M d, Y', current_time('timestamp'))),
686 686
 				'count' => 0,
687
-				'bulk_action' => array_merge( $def_reg_status_actions,  array(
687
+				'bulk_action' => array_merge($def_reg_status_actions, array(
688 688
 					'trash_registrations' => __('Trash Registrations', 'event_espresso')
689 689
 					))
690 690
 				)
691 691
 			);
692 692
 
693
-		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_delete_registrations', 'espresso_registrations_delete_registration' ) ) {
693
+		if (EE_Registry::instance()->CAP->current_user_can('ee_delete_registrations', 'espresso_registrations_delete_registration')) {
694 694
 			$this->_views['incomplete'] = array(
695 695
 				'slug' => 'incomplete',
696 696
 				'label' => __('Incomplete', 'event_espresso'),
@@ -726,7 +726,7 @@  discard block
 block discarded – undo
726 726
 				)
727 727
 			);
728 728
 
729
-		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_delete_contacts', 'espresso_registrations_trash_attendees' ) ) {
729
+		if (EE_Registry::instance()->CAP->current_user_can('ee_delete_contacts', 'espresso_registrations_trash_attendees')) {
730 730
 			$this->_views['trash'] = array(
731 731
 				'slug' => 'trash',
732 732
 				'label' => __('Trash', 'event_espresso'),
@@ -765,42 +765,42 @@  discard block
 block discarded – undo
765 765
 				'desc' => __('View Transaction Invoice', 'event_espresso')
766 766
 				),
767 767
  			);
768
-		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_send_message', 'espresso_registrations_resend_registration' ) ) {
768
+		if (EE_Registry::instance()->CAP->current_user_can('ee_send_message', 'espresso_registrations_resend_registration')) {
769 769
 			$fc_items['resend_registration'] = array(
770 770
 				'class' => 'dashicons dashicons-email-alt',
771 771
 				'desc' => __('Resend Registration Details', 'event_espresso')
772 772
 				);
773 773
 		} else {
774
-			$fc_items['blank'] = array( 'class' => 'blank', 'desc' => '' );
774
+			$fc_items['blank'] = array('class' => 'blank', 'desc' => '');
775 775
 		}
776 776
 
777 777
 		$sc_items = array(
778 778
 			'approved_status' => array(
779
-				'class' => 'ee-status-legend ee-status-legend-' . EEM_Registration::status_id_approved,
780
-				'desc' => EEH_Template::pretty_status( EEM_Registration::status_id_approved, FALSE, 'sentence' )
779
+				'class' => 'ee-status-legend ee-status-legend-'.EEM_Registration::status_id_approved,
780
+				'desc' => EEH_Template::pretty_status(EEM_Registration::status_id_approved, FALSE, 'sentence')
781 781
 				),
782 782
 			'pending_status' => array(
783
-				'class' => 'ee-status-legend ee-status-legend-' . EEM_Registration::status_id_pending_payment,
784
-				'desc' => EEH_Template::pretty_status( EEM_Registration::status_id_pending_payment, FALSE, 'sentence' )
783
+				'class' => 'ee-status-legend ee-status-legend-'.EEM_Registration::status_id_pending_payment,
784
+				'desc' => EEH_Template::pretty_status(EEM_Registration::status_id_pending_payment, FALSE, 'sentence')
785 785
 				),
786 786
 			'incomplete_status' => array(
787
-				'class' => 'ee-status-legend ee-status-legend-' . EEM_Registration::status_id_incomplete,
788
-				'desc' => EEH_Template::pretty_status( EEM_Registration::status_id_incomplete, FALSE, 'sentence' )
787
+				'class' => 'ee-status-legend ee-status-legend-'.EEM_Registration::status_id_incomplete,
788
+				'desc' => EEH_Template::pretty_status(EEM_Registration::status_id_incomplete, FALSE, 'sentence')
789 789
 			),
790 790
 			'not_approved' => array(
791
-				'class' => 'ee-status-legend ee-status-legend-' . EEM_Registration::status_id_not_approved,
792
-				'desc' => EEH_Template::pretty_status( EEM_Registration::status_id_not_approved, FALSE, 'sentence' )
791
+				'class' => 'ee-status-legend ee-status-legend-'.EEM_Registration::status_id_not_approved,
792
+				'desc' => EEH_Template::pretty_status(EEM_Registration::status_id_not_approved, FALSE, 'sentence')
793 793
 				),
794 794
 			'declined_status' => array(
795
-				'class' => 'ee-status-legend ee-status-legend-' . EEM_Registration::status_id_declined,
796
-				'desc' => EEH_Template::pretty_status( EEM_Registration::status_id_declined, FALSE, 'sentence' )
795
+				'class' => 'ee-status-legend ee-status-legend-'.EEM_Registration::status_id_declined,
796
+				'desc' => EEH_Template::pretty_status(EEM_Registration::status_id_declined, FALSE, 'sentence')
797 797
 				),
798 798
 			'cancelled_status' => array(
799
-				'class' => 'ee-status-legend ee-status-legend-' . EEM_Registration::status_id_cancelled,
800
-				'desc' => EEH_Template::pretty_status( EEM_Registration::status_id_cancelled, FALSE, 'sentence' )
799
+				'class' => 'ee-status-legend ee-status-legend-'.EEM_Registration::status_id_cancelled,
800
+				'desc' => EEH_Template::pretty_status(EEM_Registration::status_id_cancelled, FALSE, 'sentence')
801 801
 				)
802 802
 			);
803
-		return array_merge( $fc_items, $sc_items );
803
+		return array_merge($fc_items, $sc_items);
804 804
 	}
805 805
 
806 806
 
@@ -813,15 +813,15 @@  discard block
 block discarded – undo
813 813
 
814 814
 
815 815
 	protected function _registrations_overview_list_table() {
816
-		$EVT_ID = ( ! empty( $this->_req_data['event_id'] )) ? absint( $this->_req_data['event_id'] ) : FALSE;
817
-		if ( $EVT_ID ) {
818
-			if ( EE_Registry::instance()->CAP->current_user_can( 'ee_edit_registrations', 'espresso_registrations_new_registration', $EVT_ID ) ) {
819
-				$this->_admin_page_title .= $this->get_action_link_or_button( 'new_registration', 'add-registrant', array( 'event_id' => $EVT_ID ), 'add-new-h2' );
816
+		$EVT_ID = ( ! empty($this->_req_data['event_id'])) ? absint($this->_req_data['event_id']) : FALSE;
817
+		if ($EVT_ID) {
818
+			if (EE_Registry::instance()->CAP->current_user_can('ee_edit_registrations', 'espresso_registrations_new_registration', $EVT_ID)) {
819
+				$this->_admin_page_title .= $this->get_action_link_or_button('new_registration', 'add-registrant', array('event_id' => $EVT_ID), 'add-new-h2');
820 820
 			}
821
-			$event = EEM_Event::instance()->get_one_by_ID( $EVT_ID );
822
-			$this->_template_args['admin_page_header'] = $event instanceof EE_Event ? sprintf( __('%s Viewing registrations for the event: %s%s', 'event_espresso'), '<h2>', '<a href="' . EE_Admin_Page::add_query_args_and_nonce( array('action' => 'edit', 'post' => $event->ID() ), EVENTS_ADMIN_URL ) . '">' . $event->get('EVT_name') . '</a>', '</h2>' ) : '';
821
+			$event = EEM_Event::instance()->get_one_by_ID($EVT_ID);
822
+			$this->_template_args['admin_page_header'] = $event instanceof EE_Event ? sprintf(__('%s Viewing registrations for the event: %s%s', 'event_espresso'), '<h2>', '<a href="'.EE_Admin_Page::add_query_args_and_nonce(array('action' => 'edit', 'post' => $event->ID()), EVENTS_ADMIN_URL).'">'.$event->get('EVT_name').'</a>', '</h2>') : '';
823 823
 		}
824
-		$this->_template_args['after_list_table'] = $this->_display_legend( $this->_registration_legend_items() );
824
+		$this->_template_args['after_list_table'] = $this->_display_legend($this->_registration_legend_items());
825 825
 		$this->display_admin_list_table_page_with_no_sidebar();
826 826
 	}
827 827
 
@@ -836,19 +836,19 @@  discard block
 block discarded – undo
836 836
 	 */
837 837
 	private function _set_registration_object() {
838 838
 		//get out if we've already set the object
839
-		if ( is_object( $this->_registration )) {
839
+		if (is_object($this->_registration)) {
840 840
 			return TRUE;
841 841
 		}
842 842
 
843 843
 	    $REG = EEM_Registration::instance();
844 844
 
845
-		$REG_ID = ( ! empty( $this->_req_data['_REG_ID'] )) ? absint( $this->_req_data['_REG_ID'] ) : FALSE;
845
+		$REG_ID = ( ! empty($this->_req_data['_REG_ID'])) ? absint($this->_req_data['_REG_ID']) : FALSE;
846 846
 
847
-		if ( $this->_registration = $REG->get_one_by_ID( $REG_ID ))
847
+		if ($this->_registration = $REG->get_one_by_ID($REG_ID))
848 848
 			return TRUE;
849 849
 		else {
850
-			$error_msg = sprintf( __('An error occurred and the details for Registration ID #%s could not be retrieved.', 'event_espresso'), $REG_ID );
851
-			EE_Error::add_error( $error_msg, __FILE__, __FUNCTION__, __LINE__ );
850
+			$error_msg = sprintf(__('An error occurred and the details for Registration ID #%s could not be retrieved.', 'event_espresso'), $REG_ID);
851
+			EE_Error::add_error($error_msg, __FILE__, __FUNCTION__, __LINE__);
852 852
 			$this->_registration = NULL;
853 853
 			return FALSE;
854 854
 		}
@@ -867,25 +867,25 @@  discard block
 block discarded – undo
867 867
 	 * @internal param bool $all whether to ignore all query params and just return ALL registrations (or count if count is set)
868 868
 	 * @return mixed (int|array)  int = count || array of registration objects
869 869
 	 */
870
-	public function get_registrations( $per_page = 10, $count = FALSE, $this_month = FALSE, $today = FALSE ) {
871
-
872
-		$EVT_ID = ! empty( $this->_req_data['event_id'] ) && $this->_req_data['event_id'] > 0 ? absint( $this->_req_data['event_id'] ) : FALSE;
873
-		$CAT_ID = ! empty( $this->_req_data['EVT_CAT'] ) && (int) $this->_req_data['EVT_CAT'] > 0? absint( $this->_req_data['EVT_CAT'] ) : FALSE;
874
-		$reg_status = ! empty( $this->_req_data['_reg_status'] ) ? sanitize_text_field( $this->_req_data['_reg_status'] ) : FALSE;
875
-		$month_range = ! empty( $this->_req_data['month_range'] ) ? sanitize_text_field( $this->_req_data['month_range'] ) : FALSE;//should be like 2013-april
876
-		$today_a = ! empty( $this->_req_data['status'] ) && $this->_req_data['status'] == 'today' ? TRUE : FALSE;
877
-		$this_month_a = ! empty( $this->_req_data['status'] ) && $this->_req_data['status'] == 'month' ? TRUE  : FALSE;
870
+	public function get_registrations($per_page = 10, $count = FALSE, $this_month = FALSE, $today = FALSE) {
871
+
872
+		$EVT_ID = ! empty($this->_req_data['event_id']) && $this->_req_data['event_id'] > 0 ? absint($this->_req_data['event_id']) : FALSE;
873
+		$CAT_ID = ! empty($this->_req_data['EVT_CAT']) && (int) $this->_req_data['EVT_CAT'] > 0 ? absint($this->_req_data['EVT_CAT']) : FALSE;
874
+		$reg_status = ! empty($this->_req_data['_reg_status']) ? sanitize_text_field($this->_req_data['_reg_status']) : FALSE;
875
+		$month_range = ! empty($this->_req_data['month_range']) ? sanitize_text_field($this->_req_data['month_range']) : FALSE; //should be like 2013-april
876
+		$today_a = ! empty($this->_req_data['status']) && $this->_req_data['status'] == 'today' ? TRUE : FALSE;
877
+		$this_month_a = ! empty($this->_req_data['status']) && $this->_req_data['status'] == 'month' ? TRUE : FALSE;
878 878
 		$start_date = FALSE;
879 879
 		$end_date = FALSE;
880 880
 		$_where = array();
881
-		$trash = ! empty( $this->_req_data['status'] ) && $this->_req_data['status'] == 'trash' ? TRUE : FALSE;
882
-		$incomplete = ! empty( $this->_req_data['status'] ) && $this->_req_data['status'] == 'incomplete' ? TRUE : FALSE;
881
+		$trash = ! empty($this->_req_data['status']) && $this->_req_data['status'] == 'trash' ? TRUE : FALSE;
882
+		$incomplete = ! empty($this->_req_data['status']) && $this->_req_data['status'] == 'incomplete' ? TRUE : FALSE;
883 883
 
884 884
 		//set orderby
885 885
 		$this->_req_data['orderby'] = ! empty($this->_req_data['orderby']) ? $this->_req_data['orderby'] : '';
886 886
 
887 887
 
888
-		switch ( $this->_req_data['orderby'] ) {
888
+		switch ($this->_req_data['orderby']) {
889 889
 			case '_REG_ID':
890 890
 				$orderby = 'REG_ID';
891 891
 				break;
@@ -905,26 +905,26 @@  discard block
 block discarded – undo
905 905
 				$orderby = 'REG_date';
906 906
 		}
907 907
 
908
-		$sort = ( isset( $this->_req_data['order'] ) && ! empty( $this->_req_data['order'] )) ? $this->_req_data['order'] : 'DESC';
909
-		$current_page = isset( $this->_req_data['paged'] ) && !empty( $this->_req_data['paged'] ) ? $this->_req_data['paged'] : 1;
910
-		$per_page = isset( $this->_req_data['perpage'] ) && !empty( $this->_req_data['perpage'] ) ? $this->_req_data['perpage'] : $per_page;
908
+		$sort = (isset($this->_req_data['order']) && ! empty($this->_req_data['order'])) ? $this->_req_data['order'] : 'DESC';
909
+		$current_page = isset($this->_req_data['paged']) && ! empty($this->_req_data['paged']) ? $this->_req_data['paged'] : 1;
910
+		$per_page = isset($this->_req_data['perpage']) && ! empty($this->_req_data['perpage']) ? $this->_req_data['perpage'] : $per_page;
911 911
 
912 912
 
913
-		$offset = ($current_page-1)*$per_page;
914
-		$limit = $count  ? NULL : array( $offset, $per_page );
913
+		$offset = ($current_page - 1) * $per_page;
914
+		$limit = $count ? NULL : array($offset, $per_page);
915 915
 
916
-		if($EVT_ID){
917
-			$_where['EVT_ID']=$EVT_ID;
916
+		if ($EVT_ID) {
917
+			$_where['EVT_ID'] = $EVT_ID;
918 918
 		}
919
-		if($CAT_ID){
919
+		if ($CAT_ID) {
920 920
 			$_where['Event.Term_Taxonomy.term_id'] = $CAT_ID;
921 921
 		}
922
-		if ( $incomplete ) {
922
+		if ($incomplete) {
923 923
 			$_where['STS_ID'] = EEM_Registration::status_id_incomplete;
924 924
 		} else if ( ! $trash) {
925
-			$_where['STS_ID'] = array( '!=', EEM_Registration::status_id_incomplete );
925
+			$_where['STS_ID'] = array('!=', EEM_Registration::status_id_incomplete);
926 926
 		}
927
-		if($reg_status){
927
+		if ($reg_status) {
928 928
 			$_where['STS_ID'] = $reg_status;
929 929
 		}
930 930
 
@@ -936,105 +936,105 @@  discard block
 block discarded – undo
936 936
 		$time_start = ' 00:00:00';
937 937
 		$time_end = ' 23:59:59';
938 938
 
939
-		if($today_a || $today ){
939
+		if ($today_a || $today) {
940 940
 			$curdate = date('Y-m-d', current_time('timestamp'));
941
-			$_where['REG_date']= array('BETWEEN',
941
+			$_where['REG_date'] = array('BETWEEN',
942 942
 				array(
943
-					EEM_Registration::instance()->convert_datetime_for_query( 'REG_date', $curdate . $time_start, 'Y-m-d H:i:s' ),
944
-					EEM_Registration::instance()->convert_datetime_for_query( 'REG_date', $curdate . $time_end, 'Y-m-d H:i:s' ),
943
+					EEM_Registration::instance()->convert_datetime_for_query('REG_date', $curdate.$time_start, 'Y-m-d H:i:s'),
944
+					EEM_Registration::instance()->convert_datetime_for_query('REG_date', $curdate.$time_end, 'Y-m-d H:i:s'),
945 945
 			));
946
-		}elseif($this_month_a || $this_month){
946
+		}elseif ($this_month_a || $this_month) {
947 947
 			$this_month_r = date('m', current_time('timestamp'));
948
-			$days_this_month = date( 't', current_time('timestamp') );
949
-			$_where['REG_date']= array('BETWEEN',
948
+			$days_this_month = date('t', current_time('timestamp'));
949
+			$_where['REG_date'] = array('BETWEEN',
950 950
 				array(
951
-					EEM_Registration::instance()->convert_datetime_for_query( 'REG_date', $this_year_r . '-' . $this_month_r . '-01' . ' ' . $time_start, 'Y-m-d H:i:s' ),
952
-					EEM_Registration::instance()->convert_datetime_for_query( 'REG_date', $this_year_r . '-' . $this_month_r . '-' . $days_this_month . ' ' . $time_end, 'Y-m-d H:i:s' )
951
+					EEM_Registration::instance()->convert_datetime_for_query('REG_date', $this_year_r.'-'.$this_month_r.'-01'.' '.$time_start, 'Y-m-d H:i:s'),
952
+					EEM_Registration::instance()->convert_datetime_for_query('REG_date', $this_year_r.'-'.$this_month_r.'-'.$days_this_month.' '.$time_end, 'Y-m-d H:i:s')
953 953
 			));
954
-		}elseif($month_range){
954
+		}elseif ($month_range) {
955 955
 			$pieces = explode(' ', $this->_req_data['month_range'], 3);
956
-			$month_r = !empty($pieces[0]) ? date('m', strtotime($pieces[0])) : '';
957
-			$year_r = !empty($pieces[1]) ? $pieces[1] : '';
958
-			$days_in_month = date('t', strtotime($year_r .  '-' . $month_r . '-' . '01') );
959
-			$_where['REG_date']= array('BETWEEN',
960
-				array(  EEM_Registration::instance()->convert_datetime_for_query( 'REG_date', $year_r . '-' . $month_r . '-01 00:00:00', 'Y-m-d H:i:s'), EEM_Registration::instance()->convert_datetime_for_query( 'REG_date', $year_r . '-' . $month_r . '-' . $days_in_month .  ' 23:59:59', 'Y-m-d H:i:s' ) ) );
961
-		}elseif($start_date && $end_date){
956
+			$month_r = ! empty($pieces[0]) ? date('m', strtotime($pieces[0])) : '';
957
+			$year_r = ! empty($pieces[1]) ? $pieces[1] : '';
958
+			$days_in_month = date('t', strtotime($year_r.'-'.$month_r.'-'.'01'));
959
+			$_where['REG_date'] = array('BETWEEN',
960
+				array(EEM_Registration::instance()->convert_datetime_for_query('REG_date', $year_r.'-'.$month_r.'-01 00:00:00', 'Y-m-d H:i:s'), EEM_Registration::instance()->convert_datetime_for_query('REG_date', $year_r.'-'.$month_r.'-'.$days_in_month.' 23:59:59', 'Y-m-d H:i:s')));
961
+		}elseif ($start_date && $end_date) {
962 962
 			throw new EE_Error("not yet supported");
963
-		}elseif($start_date){
963
+		}elseif ($start_date) {
964 964
 			throw new EE_Error("not yet supported");
965
-		}elseif($end_date){
965
+		}elseif ($end_date) {
966 966
 			throw new EE_Error("not yet supported");
967 967
 		}
968 968
 
969
-		if ( ! empty( $this->_req_data['s'] ) ) {
970
-			$sstr = '%' . $this->_req_data['s'] . '%';
969
+		if ( ! empty($this->_req_data['s'])) {
970
+			$sstr = '%'.$this->_req_data['s'].'%';
971 971
 			$_where['OR'] = array(
972
-				'Event.EVT_name' => array( 'LIKE', $sstr),
973
-				'Event.EVT_desc' => array( 'LIKE', $sstr ),
974
-				'Event.EVT_short_desc' => array( 'LIKE' , $sstr ),
975
-				'Attendee.ATT_full_name' => array( 'LIKE', $sstr ),
976
-				'Attendee.ATT_fname' => array( 'LIKE', $sstr ),
977
-				'Attendee.ATT_lname' => array( 'LIKE', $sstr ),
978
-				'Attendee.ATT_short_bio' => array( 'LIKE', $sstr ),
979
-				'Attendee.ATT_email' => array('LIKE', $sstr ),
980
-				'Attendee.ATT_address' => array( 'LIKE', $sstr ),
981
-				'Attendee.ATT_address2' => array( 'LIKE', $sstr ),
982
-				'Attendee.ATT_city' => array( 'LIKE', $sstr ),
983
-				'REG_final_price' => array( 'LIKE', $sstr ),
984
-				'REG_code' => array( 'LIKE', $sstr ),
985
-				'REG_count' => array( 'LIKE' , $sstr ),
986
-				'REG_group_size' => array( 'LIKE' , $sstr ),
987
-				'Ticket.TKT_name' => array( 'LIKE', $sstr ),
988
-				'Ticket.TKT_description' => array( 'LIKE', $sstr ),
989
-				'Transaction.Payment.PAY_txn_id_chq_nmbr' => array( 'LIKE', $sstr )
972
+				'Event.EVT_name' => array('LIKE', $sstr),
973
+				'Event.EVT_desc' => array('LIKE', $sstr),
974
+				'Event.EVT_short_desc' => array('LIKE', $sstr),
975
+				'Attendee.ATT_full_name' => array('LIKE', $sstr),
976
+				'Attendee.ATT_fname' => array('LIKE', $sstr),
977
+				'Attendee.ATT_lname' => array('LIKE', $sstr),
978
+				'Attendee.ATT_short_bio' => array('LIKE', $sstr),
979
+				'Attendee.ATT_email' => array('LIKE', $sstr),
980
+				'Attendee.ATT_address' => array('LIKE', $sstr),
981
+				'Attendee.ATT_address2' => array('LIKE', $sstr),
982
+				'Attendee.ATT_city' => array('LIKE', $sstr),
983
+				'REG_final_price' => array('LIKE', $sstr),
984
+				'REG_code' => array('LIKE', $sstr),
985
+				'REG_count' => array('LIKE', $sstr),
986
+				'REG_group_size' => array('LIKE', $sstr),
987
+				'Ticket.TKT_name' => array('LIKE', $sstr),
988
+				'Ticket.TKT_description' => array('LIKE', $sstr),
989
+				'Transaction.Payment.PAY_txn_id_chq_nmbr' => array('LIKE', $sstr)
990 990
 				);
991 991
 		}
992 992
 
993 993
 		//capability checks
994
-		if ( ! EE_Registry::instance()->CAP->current_user_can('ee_read_others_registrations', 'get_registrations' ) ) {
994
+		if ( ! EE_Registry::instance()->CAP->current_user_can('ee_read_others_registrations', 'get_registrations')) {
995 995
 			$_where['AND'] = array(
996 996
 				'Event.EVT_wp_user' => get_current_user_id()
997 997
 				);
998 998
 		}
999 999
 
1000 1000
 
1001
-		if( $count ){
1002
-			if ( $trash ) {
1003
-				return EEM_Registration::instance()->count_deleted( array( $_where ));
1004
-			} else if ( $incomplete ) {
1005
-				return EEM_Registration::instance()->count( array( $_where ));
1001
+		if ($count) {
1002
+			if ($trash) {
1003
+				return EEM_Registration::instance()->count_deleted(array($_where));
1004
+			} else if ($incomplete) {
1005
+				return EEM_Registration::instance()->count(array($_where));
1006 1006
 			} else {
1007
-				return EEM_Registration::instance()->count( array( $_where, 'default_where_conditions' => 'this_model_only' ));
1007
+				return EEM_Registration::instance()->count(array($_where, 'default_where_conditions' => 'this_model_only'));
1008 1008
 			}
1009 1009
 		} else {
1010 1010
 			//make sure we remove default where conditions cause all registrations matching query are returned
1011
-			$query_params = array( $_where, 'order_by' => array( $orderby => $sort ), 'default_where_conditions' => 'this_model_only' );
1012
-			if ( $per_page !== -1 ) {
1011
+			$query_params = array($_where, 'order_by' => array($orderby => $sort), 'default_where_conditions' => 'this_model_only');
1012
+			if ($per_page !== -1) {
1013 1013
 				$query_params['limit'] = $limit;
1014 1014
 			}
1015
-			$registrations =  $trash ? EEM_Registration::instance()->get_all_deleted($query_params) : EEM_Registration::instance()->get_all($query_params);
1015
+			$registrations = $trash ? EEM_Registration::instance()->get_all_deleted($query_params) : EEM_Registration::instance()->get_all($query_params);
1016 1016
 
1017 1017
 
1018
-			if ( $EVT_ID && isset( $registrations[0] ) && $registrations[0] instanceof EE_Registration &&  $registrations[0]->event_obj()) {
1018
+			if ($EVT_ID && isset($registrations[0]) && $registrations[0] instanceof EE_Registration && $registrations[0]->event_obj()) {
1019 1019
 				$first_registration = $registrations[0];
1020 1020
 				//EEH_Debug_Tools::printr( $registrations[0], '$registrations  <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span>', 'auto' );
1021 1021
 				$event_name = $first_registration->event_obj()->name();
1022
-				$event_date = $first_registration->date_obj()->start_date_and_time('l F j, Y,', 'g:i:s a');// isset( $registrations[0]->DTT_EVT_start ) ? date( 'l F j, Y,    g:i:s a', $registrations[0]->DTT_EVT_start ) : '';
1022
+				$event_date = $first_registration->date_obj()->start_date_and_time('l F j, Y,', 'g:i:s a'); // isset( $registrations[0]->DTT_EVT_start ) ? date( 'l F j, Y,    g:i:s a', $registrations[0]->DTT_EVT_start ) : '';
1023 1023
 				// edit event link
1024
-				if ( $event_name != '' ) {
1025
-					$edit_event_url = self::add_query_args_and_nonce( array( 'action'=>'edit_event', 'EVT_ID'=>$EVT_ID ), EVENTS_ADMIN_URL );
1026
-					$edit_event_lnk = '<a href="'.$edit_event_url.'" title="' . esc_attr__( 'Edit ', 'event_espresso' ) . $event_name . '">' . __( 'Edit Event', 'event_espresso' ) . '</a>';
1027
-					$event_name .= ' <span class="admin-page-header-edit-lnk not-bold">' . $edit_event_lnk . '</span>' ;
1024
+				if ($event_name != '') {
1025
+					$edit_event_url = self::add_query_args_and_nonce(array('action'=>'edit_event', 'EVT_ID'=>$EVT_ID), EVENTS_ADMIN_URL);
1026
+					$edit_event_lnk = '<a href="'.$edit_event_url.'" title="'.esc_attr__('Edit ', 'event_espresso').$event_name.'">'.__('Edit Event', 'event_espresso').'</a>';
1027
+					$event_name .= ' <span class="admin-page-header-edit-lnk not-bold">'.$edit_event_lnk.'</span>';
1028 1028
 				}
1029 1029
 
1030
-				$back_2_reg_url = self::add_query_args_and_nonce( array( 'action'=>'default' ), REG_ADMIN_URL );
1031
-				$back_2_reg_lnk = '<a href="'.$back_2_reg_url.'" title="' . esc_attr__( 'click to return to viewing all registrations ', 'event_espresso' ) . '">&laquo; ' . __( 'Back to All Registrations', 'event_espresso' ) . '</a>';
1030
+				$back_2_reg_url = self::add_query_args_and_nonce(array('action'=>'default'), REG_ADMIN_URL);
1031
+				$back_2_reg_lnk = '<a href="'.$back_2_reg_url.'" title="'.esc_attr__('click to return to viewing all registrations ', 'event_espresso').'">&laquo; '.__('Back to All Registrations', 'event_espresso').'</a>';
1032 1032
 
1033 1033
 				$this->_template_args['before_admin_page_content'] = '
1034 1034
 			<div id="admin-page-header">
1035
-				<h1><span class="small-text not-bold">'.__( 'Event: ', 'event_espresso' ).'</span>'. $event_name .'</h1>
1036
-				<h3><span class="small-text not-bold">'.__( 'Date: ', 'event_espresso' ). '</span>'. $event_date .'</h3>
1037
-				<span class="admin-page-header-go-back-lnk not-bold">' . $back_2_reg_lnk . '</span>
1035
+				<h1><span class="small-text not-bold">'.__('Event: ', 'event_espresso').'</span>'.$event_name.'</h1>
1036
+				<h3><span class="small-text not-bold">'.__('Date: ', 'event_espresso').'</span>'.$event_date.'</h3>
1037
+				<span class="admin-page-header-go-back-lnk not-bold">' . $back_2_reg_lnk.'</span>
1038 1038
 			</div>
1039 1039
 			';
1040 1040
 
@@ -1072,7 +1072,7 @@  discard block
 block discarded – undo
1072 1072
 
1073 1073
 		$this->_set_registration_object();
1074 1074
 
1075
-		if ( is_object( $this->_registration )) {
1075
+		if (is_object($this->_registration)) {
1076 1076
 			$transaction = $this->_registration->transaction() ? $this->_registration->transaction() : EE_Transaction::new_instance();
1077 1077
 			$this->_session = $transaction->session_data();
1078 1078
 
@@ -1080,10 +1080,10 @@  discard block
 block discarded – undo
1080 1080
 
1081 1081
 
1082 1082
 			$this->_template_args['reg_nmbr']['value'] = $this->_registration->ID();
1083
-			$this->_template_args['reg_nmbr']['label'] = __( 'Registration Number', 'event_espresso' );
1083
+			$this->_template_args['reg_nmbr']['label'] = __('Registration Number', 'event_espresso');
1084 1084
 
1085
-			$this->_template_args['reg_datetime']['value'] =  $this->_registration->pretty_date('l F j, Y','g:i:s a') ;
1086
-			$this->_template_args['reg_datetime']['label'] = __( 'Date', 'event_espresso' );
1085
+			$this->_template_args['reg_datetime']['value'] = $this->_registration->pretty_date('l F j, Y', 'g:i:s a');
1086
+			$this->_template_args['reg_datetime']['label'] = __('Date', 'event_espresso');
1087 1087
 
1088 1088
 			$this->_template_args['grand_total'] = $transaction->total();
1089 1089
 
@@ -1091,19 +1091,19 @@  discard block
 block discarded – undo
1091 1091
 			// link back to overview
1092 1092
 			$this->_template_args['reg_overview_url'] = REG_ADMIN_URL;
1093 1093
 			$this->_template_args['registration'] = $this->_registration;
1094
-			$this->_template_args['filtered_registrations_link'] = EE_Admin_Page::add_query_args_and_nonce( array( 'action' => 'default', 'event_id' => $event_id ), REG_ADMIN_URL );
1095
-			$this->_template_args['filtered_transactions_link'] = EE_Admin_Page::add_query_args_and_nonce( array( 'action' => 'default', 'EVT_ID' => $event_id, 'page' => 'espresso_transactions' ), admin_url( 'admin.php' ) );
1096
-			$this->_template_args['event_link'] = EE_Admin_Page::add_query_args_and_nonce( array( 'page' => 'espresso_events', 'action' => 'edit', 'post' => $event_id ), admin_url( 'admin.php' ) );
1094
+			$this->_template_args['filtered_registrations_link'] = EE_Admin_Page::add_query_args_and_nonce(array('action' => 'default', 'event_id' => $event_id), REG_ADMIN_URL);
1095
+			$this->_template_args['filtered_transactions_link'] = EE_Admin_Page::add_query_args_and_nonce(array('action' => 'default', 'EVT_ID' => $event_id, 'page' => 'espresso_transactions'), admin_url('admin.php'));
1096
+			$this->_template_args['event_link'] = EE_Admin_Page::add_query_args_and_nonce(array('page' => 'espresso_events', 'action' => 'edit', 'post' => $event_id), admin_url('admin.php'));
1097 1097
 
1098 1098
 			//next and previous links
1099
-			$next_reg = $this->_registration->next(null, array(), 'REG_ID' );
1100
-			$this->_template_args['next_registration'] = $next_reg ? $this->_next_link( EE_Admin_Page::add_query_args_and_nonce( array( 'action' => 'view_registration', '_REG_ID' => $next_reg['REG_ID'] ), REG_ADMIN_URL ), 'dashicons dashicons-arrow-right ee-icon-size-22' ) : '';
1101
-			$previous_reg = $this->_registration->previous( null, array(), 'REG_ID' );
1102
-			$this->_template_args['previous_registration'] = $previous_reg ? $this->_previous_link( EE_Admin_Page::add_query_args_and_nonce( array( 'action' => 'view_registration', '_REG_ID' => $previous_reg['REG_ID'] ), REG_ADMIN_URL ), 'dashicons dashicons-arrow-left ee-icon-size-22' ) : '';
1099
+			$next_reg = $this->_registration->next(null, array(), 'REG_ID');
1100
+			$this->_template_args['next_registration'] = $next_reg ? $this->_next_link(EE_Admin_Page::add_query_args_and_nonce(array('action' => 'view_registration', '_REG_ID' => $next_reg['REG_ID']), REG_ADMIN_URL), 'dashicons dashicons-arrow-right ee-icon-size-22') : '';
1101
+			$previous_reg = $this->_registration->previous(null, array(), 'REG_ID');
1102
+			$this->_template_args['previous_registration'] = $previous_reg ? $this->_previous_link(EE_Admin_Page::add_query_args_and_nonce(array('action' => 'view_registration', '_REG_ID' => $previous_reg['REG_ID']), REG_ADMIN_URL), 'dashicons dashicons-arrow-left ee-icon-size-22') : '';
1103 1103
 
1104 1104
 			// grab header
1105
-			$template_path = REG_TEMPLATE_PATH . 'reg_admin_details_header.template.php';
1106
-			$this->_template_args['admin_page_header'] = EEH_Template::display_template( $template_path, $this->_template_args, TRUE );
1105
+			$template_path = REG_TEMPLATE_PATH.'reg_admin_details_header.template.php';
1106
+			$this->_template_args['admin_page_header'] = EEH_Template::display_template($template_path, $this->_template_args, TRUE);
1107 1107
 
1108 1108
 		} else {
1109 1109
 
@@ -1124,14 +1124,14 @@  discard block
 block discarded – undo
1124 1124
 	protected function _registration_details_metaboxes() {
1125 1125
 		$this->_set_registration_object();
1126 1126
 		$attendee = $this->_registration instanceof EE_Registration ? $this->_registration->attendee() : null;
1127
-		add_meta_box( 'edit-reg-status-mbox', __( 'Registration Status', 'event_espresso' ), array( $this, 'set_reg_status_buttons_metabox' ), $this->wp_page_slug, 'normal', 'high' );
1128
-		add_meta_box( 'edit-reg-details-mbox', __( 'Registration Details', 'event_espresso' ), array( $this, '_reg_details_meta_box' ), $this->wp_page_slug, 'normal', 'high' );
1129
-		if ( $attendee instanceof EE_Attendee && EE_Registry::instance()->CAP->current_user_can('ee_edit_registration', 'edit-reg-questions-mbox' ) ) {
1130
-			add_meta_box( 'edit-reg-questions-mbox', __( 'Registration Form Answers', 'event_espresso' ), array( $this, '_reg_questions_meta_box' ), $this->wp_page_slug, 'normal', 'high' );
1127
+		add_meta_box('edit-reg-status-mbox', __('Registration Status', 'event_espresso'), array($this, 'set_reg_status_buttons_metabox'), $this->wp_page_slug, 'normal', 'high');
1128
+		add_meta_box('edit-reg-details-mbox', __('Registration Details', 'event_espresso'), array($this, '_reg_details_meta_box'), $this->wp_page_slug, 'normal', 'high');
1129
+		if ($attendee instanceof EE_Attendee && EE_Registry::instance()->CAP->current_user_can('ee_edit_registration', 'edit-reg-questions-mbox')) {
1130
+			add_meta_box('edit-reg-questions-mbox', __('Registration Form Answers', 'event_espresso'), array($this, '_reg_questions_meta_box'), $this->wp_page_slug, 'normal', 'high');
1131 1131
 		}
1132
-		add_meta_box( 'edit-reg-registrant-mbox', __( 'Contact Details', 'event_espresso' ), array( $this, '_reg_registrant_side_meta_box' ), $this->wp_page_slug, 'side', 'high' );
1133
-		if ( $this->_registration->group_size() > 1 ) {
1134
-			add_meta_box( 'edit-reg-attendees-mbox', __( 'Other Registrations in this Transaction', 'event_espresso' ), array( $this, '_reg_attendees_meta_box' ), $this->wp_page_slug, 'normal', 'high' );
1132
+		add_meta_box('edit-reg-registrant-mbox', __('Contact Details', 'event_espresso'), array($this, '_reg_registrant_side_meta_box'), $this->wp_page_slug, 'side', 'high');
1133
+		if ($this->_registration->group_size() > 1) {
1134
+			add_meta_box('edit-reg-attendees-mbox', __('Other Registrations in this Transaction', 'event_espresso'), array($this, '_reg_attendees_meta_box'), $this->wp_page_slug, 'normal', 'high');
1135 1135
 		}
1136 1136
 	}
1137 1137
 
@@ -1152,23 +1152,23 @@  discard block
 block discarded – undo
1152 1152
 
1153 1153
 		//let's get an array of all possible buttons that we can just reference
1154 1154
 		$status_buttons = $this->_get_reg_status_buttons();
1155
-		$template_args[ 'reg_status_value' ] = $this->_registration->pretty_status();
1156
-		$template_args[ 'reg_status_class' ] = 'status-' . $this->_registration->status_ID();
1155
+		$template_args['reg_status_value'] = $this->_registration->pretty_status();
1156
+		$template_args['reg_status_class'] = 'status-'.$this->_registration->status_ID();
1157 1157
 		$template_args['attendee'] = $this->_registration->attendee();
1158
-		$template = REG_TEMPLATE_PATH . 'reg_status_change_buttons.template.php';
1159
-		if ( $this->_set_registration_object() ) {
1158
+		$template = REG_TEMPLATE_PATH.'reg_status_change_buttons.template.php';
1159
+		if ($this->_set_registration_object()) {
1160 1160
 			$current_status = $this->_registration->status_ID();
1161
-			unset( $status_buttons[$current_status] );
1162
-			if ( $current_status != EEM_Registration::status_id_pending_payment && $is_complete ) {
1163
-				unset( $status_buttons[EEM_Registration::status_id_pending_payment] );
1161
+			unset($status_buttons[$current_status]);
1162
+			if ($current_status != EEM_Registration::status_id_pending_payment && $is_complete) {
1163
+				unset($status_buttons[EEM_Registration::status_id_pending_payment]);
1164 1164
 			}
1165
-			$template_args['status_buttons'] = implode( "\n", $status_buttons );
1165
+			$template_args['status_buttons'] = implode("\n", $status_buttons);
1166 1166
 		}
1167 1167
 		$template_args['form_url'] = REG_ADMIN_URL;
1168 1168
 		$template_args['REG_ID'] = $this->_registration->ID();
1169
-		$template_args['nonce'] = wp_nonce_field( 'change_reg_status_nonce',  'change_reg_status_nonce', FALSE, FALSE );
1169
+		$template_args['nonce'] = wp_nonce_field('change_reg_status_nonce', 'change_reg_status_nonce', FALSE, FALSE);
1170 1170
 
1171
-		EEH_Template::display_template( $template, $template_args );
1171
+		EEH_Template::display_template($template, $template_args);
1172 1172
 
1173 1173
 	}
1174 1174
 
@@ -1182,11 +1182,11 @@  discard block
 block discarded – undo
1182 1182
 	private function _get_reg_status_buttons() {
1183 1183
 
1184 1184
 		$buttons = array(
1185
-			EEM_Registration::status_id_approved => '<input type="submit" name="_reg_status_id" class="button-secondary ee-status-strip reg-status-' . EEM_Registration::status_id_approved . '" value="' . EEH_Template::pretty_status( EEM_Registration::status_id_approved, FALSE, 'sentence' ) . '">',
1186
-			EEM_Registration::status_id_pending_payment => '<input type="submit" name="_reg_status_id" class="button-secondary ee-status-strip reg-status-' . EEM_Registration::status_id_pending_payment . '" value="' . EEH_Template::pretty_status( EEM_Registration::status_id_pending_payment, FALSE, 'sentence' ) . '">',
1187
-			EEM_Registration::status_id_not_approved => '<input type="submit" name="_reg_status_id" class="button-secondary ee-status-strip reg-status-' . EEM_Registration::status_id_not_approved . '" value="' . EEH_Template::pretty_status( EEM_Registration::status_id_not_approved, FALSE, 'sentence' ) . '">',
1188
-			EEM_Registration::status_id_declined => '<input type="submit" name="_reg_status_id" class="button-secondary ee-status-strip reg-status-' . EEM_Registration::status_id_declined . '" value="' . EEH_Template::pretty_status( EEM_Registration::status_id_declined, FALSE, 'sentence' ) . '">',
1189
-			EEM_Registration::status_id_cancelled =>'<input type="submit" name="_reg_status_id" class="button-secondary ee-status-strip reg-status-' . EEM_Registration::status_id_cancelled . '" value="' . EEH_Template::pretty_status( EEM_Registration::status_id_cancelled, FALSE, 'sentence' ) . '">',
1185
+			EEM_Registration::status_id_approved => '<input type="submit" name="_reg_status_id" class="button-secondary ee-status-strip reg-status-'.EEM_Registration::status_id_approved.'" value="'.EEH_Template::pretty_status(EEM_Registration::status_id_approved, FALSE, 'sentence').'">',
1186
+			EEM_Registration::status_id_pending_payment => '<input type="submit" name="_reg_status_id" class="button-secondary ee-status-strip reg-status-'.EEM_Registration::status_id_pending_payment.'" value="'.EEH_Template::pretty_status(EEM_Registration::status_id_pending_payment, FALSE, 'sentence').'">',
1187
+			EEM_Registration::status_id_not_approved => '<input type="submit" name="_reg_status_id" class="button-secondary ee-status-strip reg-status-'.EEM_Registration::status_id_not_approved.'" value="'.EEH_Template::pretty_status(EEM_Registration::status_id_not_approved, FALSE, 'sentence').'">',
1188
+			EEM_Registration::status_id_declined => '<input type="submit" name="_reg_status_id" class="button-secondary ee-status-strip reg-status-'.EEM_Registration::status_id_declined.'" value="'.EEH_Template::pretty_status(EEM_Registration::status_id_declined, FALSE, 'sentence').'">',
1189
+			EEM_Registration::status_id_cancelled =>'<input type="submit" name="_reg_status_id" class="button-secondary ee-status-strip reg-status-'.EEM_Registration::status_id_cancelled.'" value="'.EEH_Template::pretty_status(EEM_Registration::status_id_cancelled, FALSE, 'sentence').'">',
1190 1190
 			);
1191 1191
 		return $buttons;
1192 1192
 	}
@@ -1200,13 +1200,13 @@  discard block
 block discarded – undo
1200 1200
 	 *
1201 1201
 	 * @return array  (array with reg_id(s) updated and whether update was successful.
1202 1202
 	 */
1203
-	protected function _set_registration_status_from_request( $status = false, $notify = false ) {
1204
-		$REG_ID = isset( $this->_req_data['_REG_ID'] ) ? (array) $this->_req_data['_REG_ID'] : array();
1203
+	protected function _set_registration_status_from_request($status = false, $notify = false) {
1204
+		$REG_ID = isset($this->_req_data['_REG_ID']) ? (array) $this->_req_data['_REG_ID'] : array();
1205 1205
 
1206
-		$success = $this->_set_registration_status( $REG_ID, $status );
1206
+		$success = $this->_set_registration_status($REG_ID, $status);
1207 1207
 
1208 1208
 		//notify?
1209
-		if ( $success && $notify && EE_Registry::instance()->CAP->current_user_can( 'ee_send_message', 'espresso_registrations_resend_registration' ) ) {
1209
+		if ($success && $notify && EE_Registry::instance()->CAP->current_user_can('ee_send_message', 'espresso_registrations_resend_registration')) {
1210 1210
 			$this->_process_resend_registration();
1211 1211
 		}
1212 1212
 
@@ -1224,19 +1224,19 @@  discard block
 block discarded – undo
1224 1224
 	 * @param bool $status
1225 1225
 	 * @return array (an array with 'success' key representing whether status change was successful, and 'REG_ID' as the array of updated registrations).
1226 1226
 	 */
1227
-	protected function _set_registration_status( $REG_ID, $status = false ) {
1227
+	protected function _set_registration_status($REG_ID, $status = false) {
1228 1228
 		$success = true;
1229 1229
 		// set default status if none is passed
1230 1230
 		$status = $status ? $status : EEM_Registration::status_id_pending_payment;
1231 1231
 
1232 1232
 		//typecast and sanitize reg_id
1233
-		$reg_ids = array_filter( (array) $REG_ID, 'absint' );
1233
+		$reg_ids = array_filter((array) $REG_ID, 'absint');
1234 1234
 
1235 1235
 		//loop through REG_ID's and change status
1236
-		foreach ( $reg_ids as $r_id ) {
1237
-			$registration = EEM_Registration::instance()->get_one_by_ID( $r_id );
1238
-			if ( $registration instanceof EE_Registration ) {
1239
-				$registration->set_status( $status );
1236
+		foreach ($reg_ids as $r_id) {
1237
+			$registration = EEM_Registration::instance()->get_one_by_ID($r_id);
1238
+			if ($registration instanceof EE_Registration) {
1239
+				$registration->set_status($status);
1240 1240
 				$result = $registration->save();
1241 1241
 
1242 1242
 				//verifying explicit fails because update *may* just return 0 for 0 rows affected
@@ -1248,7 +1248,7 @@  discard block
 block discarded – undo
1248 1248
 		$this->_req_data['_REG_ID'] = $reg_ids;
1249 1249
 
1250 1250
 		//return $success and processed registrations
1251
-		return array( 'REG_ID' => $reg_ids, 'success' => $success );
1251
+		return array('REG_ID' => $reg_ids, 'success' => $success);
1252 1252
 	}
1253 1253
 
1254 1254
 
@@ -1260,37 +1260,37 @@  discard block
 block discarded – undo
1260 1260
 	 * @param   bool    $notify indicates whether the _set_registration_status_from_request does notifications or not.
1261 1261
 	 * @return void
1262 1262
 	 */
1263
-	protected function _reg_status_change_return( $STS_ID, $notify = false ) {
1263
+	protected function _reg_status_change_return($STS_ID, $notify = false) {
1264 1264
 
1265
-		$result = ! empty( $STS_ID ) ? $this->_set_registration_status_from_request( $STS_ID, $notify ) : array( 'success' => false );
1265
+		$result = ! empty($STS_ID) ? $this->_set_registration_status_from_request($STS_ID, $notify) : array('success' => false);
1266 1266
 
1267 1267
 
1268
-		$success = isset( $result['success'] ) && $result['success'];
1268
+		$success = isset($result['success']) && $result['success'];
1269 1269
 
1270 1270
 		//setup success message
1271
-		if ( $success ) {
1272
-			$msg = is_array( $result['REG_ID'] ) && count( $result['REG_ID'] ) > 1  ? sprintf( __('Registration status has been set to %s', 'event_espresso'), EEH_Template::pretty_status($STS_ID, false, 'lower' ) ) :  sprintf( __('Registrations have been set to %s.', 'event_espresso'), EEH_Template::pretty_status($STS_ID, false, 'lower' ) ) ;
1273
-			EE_Error::add_success( $msg );
1271
+		if ($success) {
1272
+			$msg = is_array($result['REG_ID']) && count($result['REG_ID']) > 1 ? sprintf(__('Registration status has been set to %s', 'event_espresso'), EEH_Template::pretty_status($STS_ID, false, 'lower')) : sprintf(__('Registrations have been set to %s.', 'event_espresso'), EEH_Template::pretty_status($STS_ID, false, 'lower'));
1273
+			EE_Error::add_success($msg);
1274 1274
 		} else {
1275
-			EE_Error::add_error( __('Something went wrong, and the status was not changed', 'event_espresso' ), __FILE__, __LINE__, __FUNCTION__ );
1275
+			EE_Error::add_error(__('Something went wrong, and the status was not changed', 'event_espresso'), __FILE__, __LINE__, __FUNCTION__);
1276 1276
 		}
1277 1277
 
1278
-		$route = isset( $this->_req_data['return'] ) && $this->_req_data['return'] == 'view_registration' ? array( 'action' => 'view_registration', '_REG_ID' => $result['REG_ID'][0] ) : array( 'action' => 'default' );
1278
+		$route = isset($this->_req_data['return']) && $this->_req_data['return'] == 'view_registration' ? array('action' => 'view_registration', '_REG_ID' => $result['REG_ID'][0]) : array('action' => 'default');
1279 1279
 		//unset nonces
1280
-		foreach ( $this->_req_data as $ref => $value ) {
1281
-			if ( strpos( $ref, 'nonce' ) !== false ) {
1282
-				unset( $this->_req_data[$ref] );
1280
+		foreach ($this->_req_data as $ref => $value) {
1281
+			if (strpos($ref, 'nonce') !== false) {
1282
+				unset($this->_req_data[$ref]);
1283 1283
 				continue;
1284 1284
 			}
1285 1285
 
1286
-			$value = is_array( $value ) ? array_map( 'urlencode', $value ) : urlencode( $value );
1286
+			$value = is_array($value) ? array_map('urlencode', $value) : urlencode($value);
1287 1287
 			$this->_req_data[$ref] = $value;
1288 1288
 		}
1289 1289
 
1290 1290
 		//merge request vars so that the reloaded list table contains any existing filter query params
1291
-		$route = array_merge( $this->_req_data, $route );
1291
+		$route = array_merge($this->_req_data, $route);
1292 1292
 
1293
-		$this->_redirect_after_action( $success, '', '', $route, true );
1293
+		$this->_redirect_after_action($success, '', '', $route, true);
1294 1294
 
1295 1295
 		}
1296 1296
 
@@ -1303,29 +1303,29 @@  discard block
 block discarded – undo
1303 1303
 	protected function _change_reg_status() {
1304 1304
 		$this->_req_data['return'] = 'view_registration';
1305 1305
 		//set notify based on whether the send notifications toggle is set or not
1306
-		$notify = ! empty( $this->_req_data['txn_reg_status_change']['send_notifications'] );
1307
-		$this->_req_data[ '_reg_status_id' ] = isset( $this->_req_data[ '_reg_status_id' ] ) ? $this->_req_data[ '_reg_status_id' ] : '';
1306
+		$notify = ! empty($this->_req_data['txn_reg_status_change']['send_notifications']);
1307
+		$this->_req_data['_reg_status_id'] = isset($this->_req_data['_reg_status_id']) ? $this->_req_data['_reg_status_id'] : '';
1308 1308
 
1309
-		switch ( $this->_req_data['_reg_status_id'] ) {
1310
-			case EEH_Template::pretty_status( EEM_Registration::status_id_approved, false, 'sentence' ) :
1311
-				$this->approve_registration( $notify );
1309
+		switch ($this->_req_data['_reg_status_id']) {
1310
+			case EEH_Template::pretty_status(EEM_Registration::status_id_approved, false, 'sentence') :
1311
+				$this->approve_registration($notify);
1312 1312
 				break;
1313
-			case EEH_Template::pretty_status( EEM_Registration::status_id_pending_payment, false, 'sentence' ) :
1314
-				$this->pending_registration( $notify );
1313
+			case EEH_Template::pretty_status(EEM_Registration::status_id_pending_payment, false, 'sentence') :
1314
+				$this->pending_registration($notify);
1315 1315
 				break;
1316
-			case EEH_Template::pretty_status( EEM_Registration::status_id_not_approved, false, 'sentence' ) :
1317
-				$this->not_approve_registration( $notify );
1316
+			case EEH_Template::pretty_status(EEM_Registration::status_id_not_approved, false, 'sentence') :
1317
+				$this->not_approve_registration($notify);
1318 1318
 				break;
1319
-			case EEH_Template::pretty_status( EEM_Registration::status_id_declined, false, 'sentence' ) :
1320
-				$this->decline_registration( $notify );
1319
+			case EEH_Template::pretty_status(EEM_Registration::status_id_declined, false, 'sentence') :
1320
+				$this->decline_registration($notify);
1321 1321
 				break;
1322
-			case EEH_Template::pretty_status( EEM_Registration::status_id_cancelled, false, 'sentence' ) :
1323
-				$this->cancel_registration( $notify );
1322
+			case EEH_Template::pretty_status(EEM_Registration::status_id_cancelled, false, 'sentence') :
1323
+				$this->cancel_registration($notify);
1324 1324
 				break;
1325 1325
 			default :
1326 1326
 				$result['success'] = false;
1327
-				unset( $this->_req_data['return'] );
1328
-				$this->_reg_status_change_return( '', false );
1327
+				unset($this->_req_data['return']);
1328
+				$this->_reg_status_change_return('', false);
1329 1329
 				break;
1330 1330
 		}
1331 1331
 	}
@@ -1338,8 +1338,8 @@  discard block
 block discarded – undo
1338 1338
 	*		@param bool $notify whether or not to notify the registrant about their approval.
1339 1339
 	*		@return void
1340 1340
 	*/
1341
-	protected function approve_registration( $notify = false ) {
1342
-		$this->_reg_status_change_return( EEM_Registration::status_id_approved, $notify );
1341
+	protected function approve_registration($notify = false) {
1342
+		$this->_reg_status_change_return(EEM_Registration::status_id_approved, $notify);
1343 1343
 	}
1344 1344
 
1345 1345
 
@@ -1351,8 +1351,8 @@  discard block
 block discarded – undo
1351 1351
 	*		@param bool $notify whether or not to notify the registrant about their approval.
1352 1352
 	*		@return void
1353 1353
 	*/
1354
-	protected function decline_registration( $notify = false ) {
1355
-		$this->_reg_status_change_return( EEM_Registration::status_id_declined, $notify );
1354
+	protected function decline_registration($notify = false) {
1355
+		$this->_reg_status_change_return(EEM_Registration::status_id_declined, $notify);
1356 1356
 	}
1357 1357
 
1358 1358
 
@@ -1364,8 +1364,8 @@  discard block
 block discarded – undo
1364 1364
 	*		@param bool $notify whether or not to notify the registrant about their approval.
1365 1365
 	*		@return void
1366 1366
 	*/
1367
-	protected function cancel_registration( $notify = false ) {
1368
-		$this->_reg_status_change_return( EEM_Registration::status_id_cancelled, $notify );
1367
+	protected function cancel_registration($notify = false) {
1368
+		$this->_reg_status_change_return(EEM_Registration::status_id_cancelled, $notify);
1369 1369
 	}
1370 1370
 
1371 1371
 
@@ -1378,8 +1378,8 @@  discard block
 block discarded – undo
1378 1378
 	*		@param bool $notify whether or not to notify the registrant about their approval.
1379 1379
 	*		@return void
1380 1380
 	*/
1381
-	protected function not_approve_registration( $notify = false ) {
1382
-		$this->_reg_status_change_return( EEM_Registration::status_id_not_approved, $notify );
1381
+	protected function not_approve_registration($notify = false) {
1382
+		$this->_reg_status_change_return(EEM_Registration::status_id_not_approved, $notify);
1383 1383
 	}
1384 1384
 
1385 1385
 
@@ -1390,8 +1390,8 @@  discard block
 block discarded – undo
1390 1390
 	*		@param bool $notify whether or not to notify the registrant about their approval.
1391 1391
 	*		@return void
1392 1392
 	*/
1393
-	protected function pending_registration( $notify = false ) {
1394
-		$this->_reg_status_change_return( EEM_Registration::status_id_pending_payment, $notify );
1393
+	protected function pending_registration($notify = false) {
1394
+		$this->_reg_status_change_return(EEM_Registration::status_id_pending_payment, $notify);
1395 1395
 	}
1396 1396
 
1397 1397
 
@@ -1405,75 +1405,75 @@  discard block
 block discarded – undo
1405 1405
 	public function _reg_details_meta_box() {
1406 1406
 		EEH_Autoloader::register_line_item_display_autoloaders();
1407 1407
 		EEH_Autoloader::register_line_item_filter_autoloaders();
1408
-		EE_Registry::instance()->load_Helper( 'Line_Item' );
1408
+		EE_Registry::instance()->load_Helper('Line_Item');
1409 1409
 		$transaction = $this->_registration->transaction() ? $this->_registration->transaction() : EE_Transaction::new_instance();
1410 1410
 		$this->_session = $transaction->session_data();
1411 1411
 
1412 1412
 		$filters = new EE_Line_Item_Filter_Collection();
1413
-		$filters->add( new EE_Single_Registration_Line_Item_Filter( $this->_registration ) );
1414
-		$filters->add( new EE_Non_Zero_Line_Item_Filter() );
1415
-		$line_item_filter_processor = new EE_Line_Item_Filter_Processor( $filters, $transaction->total_line_item() );
1413
+		$filters->add(new EE_Single_Registration_Line_Item_Filter($this->_registration));
1414
+		$filters->add(new EE_Non_Zero_Line_Item_Filter());
1415
+		$line_item_filter_processor = new EE_Line_Item_Filter_Processor($filters, $transaction->total_line_item());
1416 1416
 		$filtered_line_item_tree = $line_item_filter_processor->process();
1417 1417
 
1418 1418
 		$this->_template_args['REG_ID'] = $this->_registration->ID();
1419
-		$line_item_display = new EE_Line_Item_Display( 'reg_admin_table', 'EE_Admin_Table_Registration_Line_Item_Display_Strategy' );
1420
-		$this->_template_args['line_item_table'] = $line_item_display->display_line_item( $filtered_line_item_tree, array( 'EE_Registration' => $this->_registration ) );
1419
+		$line_item_display = new EE_Line_Item_Display('reg_admin_table', 'EE_Admin_Table_Registration_Line_Item_Display_Strategy');
1420
+		$this->_template_args['line_item_table'] = $line_item_display->display_line_item($filtered_line_item_tree, array('EE_Registration' => $this->_registration));
1421 1421
 
1422 1422
 
1423 1423
 		$attendee = $this->_registration->attendee();
1424 1424
 
1425 1425
 
1426
-		$this->_template_args['view_transaction_button'] = EE_Registry::instance()->CAP->current_user_can( 'ee_read_transaction', 'espresso_transactions_view_transaction' ) ?EEH_Template::get_button_or_link( EE_Admin_Page::add_query_args_and_nonce( array('action'=> 'view_transaction', 'TXN_ID' => $transaction->ID() ), TXN_ADMIN_URL ), __(' View Transaction'), 'button secondary-button right', 'dashicons dashicons-cart' ) : '';
1427
-		$this->_template_args['resend_registration_button'] = $attendee instanceof EE_Attendee && EE_Registry::instance()->CAP->current_user_can( 'ee_send_message', 'espresso_registrations_resend_registration' ) ?EEH_Template::get_button_or_link( EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'resend_registration', '_REG_ID'=>$this->_registration->ID(), 'redirect_to' => 'view_registration' ), REG_ADMIN_URL ), __(' Resend Registration'), 'button secondary-button right', 'dashicons dashicons-email-alt' ) : '';
1426
+		$this->_template_args['view_transaction_button'] = EE_Registry::instance()->CAP->current_user_can('ee_read_transaction', 'espresso_transactions_view_transaction') ? EEH_Template::get_button_or_link(EE_Admin_Page::add_query_args_and_nonce(array('action'=> 'view_transaction', 'TXN_ID' => $transaction->ID()), TXN_ADMIN_URL), __(' View Transaction'), 'button secondary-button right', 'dashicons dashicons-cart') : '';
1427
+		$this->_template_args['resend_registration_button'] = $attendee instanceof EE_Attendee && EE_Registry::instance()->CAP->current_user_can('ee_send_message', 'espresso_registrations_resend_registration') ? EEH_Template::get_button_or_link(EE_Admin_Page::add_query_args_and_nonce(array('action'=>'resend_registration', '_REG_ID'=>$this->_registration->ID(), 'redirect_to' => 'view_registration'), REG_ADMIN_URL), __(' Resend Registration'), 'button secondary-button right', 'dashicons dashicons-email-alt') : '';
1428 1428
 
1429 1429
 
1430 1430
 		$this->_template_args['currency_sign'] = EE_Registry::instance()->CFG->currency->sign;
1431
-		$payment = $transaction->get_first_related( 'Payment' );
1431
+		$payment = $transaction->get_first_related('Payment');
1432 1432
 		$payment = ! $payment instanceof EE_Payment ? EE_Payment::new_instance() : $payment;
1433
-		$payment_method = $payment->get_first_related( 'Payment_Method' );
1433
+		$payment_method = $payment->get_first_related('Payment_Method');
1434 1434
 		$payment_method = ! $payment_method instanceof EE_Payment_Method ? EE_Payment_Method::new_instance() : $payment_method;
1435
-		$reg_status_class = 'status-' . $this->_registration->status_ID();
1435
+		$reg_status_class = 'status-'.$this->_registration->status_ID();
1436 1436
 		$reg_details = array(
1437 1437
 			'payment_method' => $payment_method->name(),
1438 1438
 			'response_msg' => $payment->gateway_response(),
1439
-			'registration_id' => $this->_registration->get( 'REG_code' ),
1439
+			'registration_id' => $this->_registration->get('REG_code'),
1440 1440
 			'registration_session' => $this->_registration->session_ID(),
1441
-			'ip_address' => isset( $this->_session['ip_address'] ) ? $this->_session['ip_address'] : '',
1442
-			'user_agent' => isset( $this->_session['user_agent'] ) ? $this->_session['user_agent'] : '',
1441
+			'ip_address' => isset($this->_session['ip_address']) ? $this->_session['ip_address'] : '',
1442
+			'user_agent' => isset($this->_session['user_agent']) ? $this->_session['user_agent'] : '',
1443 1443
 			);
1444 1444
 
1445 1445
 
1446
-		if ( isset( $reg_details['registration_id'] )) {
1446
+		if (isset($reg_details['registration_id'])) {
1447 1447
 			$this->_template_args['reg_details']['registration_id']['value'] = $reg_details['registration_id'];
1448
-			$this->_template_args['reg_details']['registration_id']['label'] = __( 'Registration ID', 'event_espresso' );
1448
+			$this->_template_args['reg_details']['registration_id']['label'] = __('Registration ID', 'event_espresso');
1449 1449
 			$this->_template_args['reg_details']['registration_id']['class'] = 'regular-text';
1450 1450
 		}
1451 1451
 
1452
-		if ( isset( $reg_details['payment_method'] ) ) {
1452
+		if (isset($reg_details['payment_method'])) {
1453 1453
 			$this->_template_args['reg_details']['payment_method']['value'] = $reg_details['payment_method'];
1454
-			$this->_template_args['reg_details']['payment_method']['label'] = __( 'Most Recent Payment Method', 'event_espresso' );
1454
+			$this->_template_args['reg_details']['payment_method']['label'] = __('Most Recent Payment Method', 'event_espresso');
1455 1455
 			$this->_template_args['reg_details']['payment_method']['class'] = 'regular-text';
1456 1456
 			$this->_template_args['reg_details']['response_msg']['value'] = $reg_details['response_msg'];
1457
-			$this->_template_args['reg_details']['response_msg']['label'] = __( 'Payment method response', 'event_espresso' );
1457
+			$this->_template_args['reg_details']['response_msg']['label'] = __('Payment method response', 'event_espresso');
1458 1458
 			$this->_template_args['reg_details']['response_msg']['class'] = 'regular-text';
1459 1459
 		}
1460 1460
 
1461 1461
 		$this->_template_args['reg_details']['registration_session']['value'] = $reg_details['registration_session'];
1462
-		$this->_template_args['reg_details']['registration_session']['label'] = __( 'Registration Session', 'event_espresso' );
1462
+		$this->_template_args['reg_details']['registration_session']['label'] = __('Registration Session', 'event_espresso');
1463 1463
 		$this->_template_args['reg_details']['registration_session']['class'] = 'regular-text';
1464 1464
 
1465 1465
 		$this->_template_args['reg_details']['ip_address']['value'] = $reg_details['ip_address'];
1466
-		$this->_template_args['reg_details']['ip_address']['label'] = __( 'Registration placed from IP', 'event_espresso' );
1466
+		$this->_template_args['reg_details']['ip_address']['label'] = __('Registration placed from IP', 'event_espresso');
1467 1467
 		$this->_template_args['reg_details']['ip_address']['class'] = 'regular-text';
1468 1468
 
1469 1469
 		$this->_template_args['reg_details']['user_agent']['value'] = $reg_details['user_agent'];
1470
-		$this->_template_args['reg_details']['user_agent']['label'] = __( 'Registrant User Agent', 'event_espresso' );
1470
+		$this->_template_args['reg_details']['user_agent']['label'] = __('Registrant User Agent', 'event_espresso');
1471 1471
 		$this->_template_args['reg_details']['user_agent']['class'] = 'large-text';
1472 1472
 
1473
-		$this->_template_args['event_link'] = EE_Admin_Page::add_query_args_and_nonce( array( 'action' => 'default', 'event_id' => $this->_registration->event_ID()), REG_ADMIN_URL );
1473
+		$this->_template_args['event_link'] = EE_Admin_Page::add_query_args_and_nonce(array('action' => 'default', 'event_id' => $this->_registration->event_ID()), REG_ADMIN_URL);
1474 1474
 
1475
-		$template_path = REG_TEMPLATE_PATH . 'reg_admin_details_main_meta_box_reg_details.template.php';
1476
-		echo EEH_Template::display_template( $template_path, $this->_template_args, TRUE );
1475
+		$template_path = REG_TEMPLATE_PATH.'reg_admin_details_main_meta_box_reg_details.template.php';
1476
+		echo EEH_Template::display_template($template_path, $this->_template_args, TRUE);
1477 1477
 
1478 1478
 	}
1479 1479
 
@@ -1489,23 +1489,23 @@  discard block
 block discarded – undo
1489 1489
 	*/
1490 1490
 	public function _reg_questions_meta_box() {
1491 1491
 
1492
-		add_filter( 'FHEE__EEH_Form_Fields__generate_question_groups_html__before_question_group_questions', array( $this, 'form_before_question_group' ), 10, 1 );
1493
-		add_filter( 'FHEE__EEH_Form_Fields__generate_question_groups_html__after_question_group_questions', array( $this, 'form_after_question_group' ), 10, 1 );
1494
-		add_filter( 'FHEE__EEH_Form_Fields__label_html', array( $this, 'form_form_field_label_wrap' ), 10, 1 );
1495
-		add_filter( 'FHEE__EEH_Form_Fields__input_html', array( $this, 'form_form_field_input__wrap' ), 10, 1 );
1492
+		add_filter('FHEE__EEH_Form_Fields__generate_question_groups_html__before_question_group_questions', array($this, 'form_before_question_group'), 10, 1);
1493
+		add_filter('FHEE__EEH_Form_Fields__generate_question_groups_html__after_question_group_questions', array($this, 'form_after_question_group'), 10, 1);
1494
+		add_filter('FHEE__EEH_Form_Fields__label_html', array($this, 'form_form_field_label_wrap'), 10, 1);
1495
+		add_filter('FHEE__EEH_Form_Fields__input_html', array($this, 'form_form_field_input__wrap'), 10, 1);
1496 1496
 
1497
-		$question_groups = EEM_Event::instance()->assemble_array_of_groups_questions_and_options( $this->_registration, $this->_registration->get('EVT_ID') );
1497
+		$question_groups = EEM_Event::instance()->assemble_array_of_groups_questions_and_options($this->_registration, $this->_registration->get('EVT_ID'));
1498 1498
 
1499 1499
 		//EEH_Debug_Tools::printr( $question_groups, '$question_groups  <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span>', 'auto' );
1500 1500
 
1501
-		EE_Registry::instance()->load_helper( 'Form_Fields' );
1502
-		$this->_template_args['att_questions'] = EEH_Form_Fields::generate_question_groups_html( $question_groups );
1501
+		EE_Registry::instance()->load_helper('Form_Fields');
1502
+		$this->_template_args['att_questions'] = EEH_Form_Fields::generate_question_groups_html($question_groups);
1503 1503
 
1504 1504
 		$this->_template_args['reg_questions_form_action'] = 'update_attendee_registration_form';
1505 1505
 		$this->_template_args['REG_ID'] = $this->_registration->ID();
1506 1506
 
1507
-		$template_path = REG_TEMPLATE_PATH . 'reg_admin_details_main_meta_box_reg_questions.template.php';
1508
-		echo EEH_Template::display_template( $template_path, $this->_template_args, TRUE );
1507
+		$template_path = REG_TEMPLATE_PATH.'reg_admin_details_main_meta_box_reg_questions.template.php';
1508
+		echo EEH_Template::display_template($template_path, $this->_template_args, TRUE);
1509 1509
 
1510 1510
 	}
1511 1511
 
@@ -1520,7 +1520,7 @@  discard block
 block discarded – undo
1520 1520
 	 * 		@param 		string 		$output
1521 1521
 	 * 		@return 		string
1522 1522
 	 */
1523
-	public function form_before_question_group( $output ) {
1523
+	public function form_before_question_group($output) {
1524 1524
 		return '
1525 1525
 	<table class="form-table ee-width-100">
1526 1526
 		<tbody>
@@ -1537,13 +1537,13 @@  discard block
 block discarded – undo
1537 1537
 	 * 		@param 		string 		$output
1538 1538
 	 * 		@return 		string
1539 1539
 	 */
1540
-	public function form_after_question_group( $output ) {
1540
+	public function form_after_question_group($output) {
1541 1541
 		return  '
1542 1542
 			<tr class="hide-if-no-js">
1543 1543
 				<th> </th>
1544 1544
 				<td class="reg-admin-edit-attendee-question-td">
1545
-					<a class="reg-admin-edit-attendee-question-lnk" href="#" title="' . esc_attr__( 'click to edit question', 'event_espresso' ) . '">
1546
-						<span class="reg-admin-edit-question-group-spn lt-grey-txt">' . __( 'edit the above question group', 'event_espresso' ) . '</span>
1545
+					<a class="reg-admin-edit-attendee-question-lnk" href="#" title="' . esc_attr__('click to edit question', 'event_espresso').'">
1546
+						<span class="reg-admin-edit-question-group-spn lt-grey-txt">' . __('edit the above question group', 'event_espresso').'</span>
1547 1547
 						<div class="dashicons dashicons-edit"></div>
1548 1548
 					</a>
1549 1549
 				</td>
@@ -1563,11 +1563,11 @@  discard block
 block discarded – undo
1563 1563
 	 * 		@param 		string 		$label
1564 1564
 	 * 		@return 		string
1565 1565
 	 */
1566
-	public function form_form_field_label_wrap( $label ) {
1566
+	public function form_form_field_label_wrap($label) {
1567 1567
 		return '
1568 1568
 			<tr>
1569 1569
 				<th>
1570
-					' . $label  . '
1570
+					' . $label.'
1571 1571
 				</th>';
1572 1572
 	}
1573 1573
 
@@ -1581,10 +1581,10 @@  discard block
 block discarded – undo
1581 1581
 	 * 		@param 		string 		$label
1582 1582
 	 * 		@return 		string
1583 1583
 	 */
1584
-	public function form_form_field_input__wrap( $input ) {
1584
+	public function form_form_field_input__wrap($input) {
1585 1585
 		return '
1586 1586
 				<td class="reg-admin-attendee-questions-input-td disabled-input">
1587
-					' . $input . '
1587
+					' . $input.'
1588 1588
 				</td>
1589 1589
 			</tr>';
1590 1590
 	}
@@ -1598,13 +1598,13 @@  discard block
 block discarded – undo
1598 1598
 	*		@return void
1599 1599
 	*/
1600 1600
 	protected function _update_attendee_registration_form() {
1601
-		$qstns = isset( $this->_req_data['qstn'] ) ? $this->_req_data['qstn'] : FALSE;
1602
-		$REG_ID = isset( $this->_req_data['_REG_ID'] ) ? absint( $this->_req_data['_REG_ID'] ) : FALSE;
1603
-		$qstns = apply_filters( 'FHEE__Registrations_Admin_Page___update_attendee_registration_form__qstns', $qstns );
1604
-		$success = $this->_save_attendee_registration_form( $REG_ID, $qstns );
1601
+		$qstns = isset($this->_req_data['qstn']) ? $this->_req_data['qstn'] : FALSE;
1602
+		$REG_ID = isset($this->_req_data['_REG_ID']) ? absint($this->_req_data['_REG_ID']) : FALSE;
1603
+		$qstns = apply_filters('FHEE__Registrations_Admin_Page___update_attendee_registration_form__qstns', $qstns);
1604
+		$success = $this->_save_attendee_registration_form($REG_ID, $qstns);
1605 1605
 		$what = __('Registration Form', 'event_espresso');
1606
-		$route = $REG_ID ? array( 'action' => 'view_registration', '_REG_ID' => $REG_ID ) : array( 'action' => 'default' );
1607
-		$this->_redirect_after_action( $success, $what, __('updated', 'event_espresso'), $route );
1606
+		$route = $REG_ID ? array('action' => 'view_registration', '_REG_ID' => $REG_ID) : array('action' => 'default');
1607
+		$this->_redirect_after_action($success, $what, __('updated', 'event_espresso'), $route);
1608 1608
 
1609 1609
 	}
1610 1610
 
@@ -1617,26 +1617,26 @@  discard block
 block discarded – undo
1617 1617
 	 * @param bool $qstns
1618 1618
 	 * @return bool
1619 1619
 	 */
1620
-	private function _save_attendee_registration_form( $REG_ID = FALSE, $qstns = FALSE ) {
1620
+	private function _save_attendee_registration_form($REG_ID = FALSE, $qstns = FALSE) {
1621 1621
 
1622
-		if ( ! $REG_ID || ! $qstns ) {
1623
-			EE_Error::add_error( __('An error occurred. No registration ID and/or registration questions were received.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__ );
1622
+		if ( ! $REG_ID || ! $qstns) {
1623
+			EE_Error::add_error(__('An error occurred. No registration ID and/or registration questions were received.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
1624 1624
 		}
1625 1625
 		$success = TRUE;
1626 1626
 
1627 1627
 		// allow others to get in on this awesome fun   :D
1628
-		do_action( 'AHEE__Registrations_Admin_Page___save_attendee_registration_form__after_reg_and_attendee_save', $REG_ID, $qstns );
1628
+		do_action('AHEE__Registrations_Admin_Page___save_attendee_registration_form__after_reg_and_attendee_save', $REG_ID, $qstns);
1629 1629
 		// loop thru questions... FINALLY!!!
1630 1630
 
1631
-		foreach ( $qstns as $QST_ID => $qstn ) {
1631
+		foreach ($qstns as $QST_ID => $qstn) {
1632 1632
 			//if $qstn isn't an array then it doesn't already have an answer, so let's create the answer
1633
-			if ( !is_array($qstn) ) {
1634
-				$success = $this->_save_new_answer( $REG_ID, $QST_ID, $qstn);
1633
+			if ( ! is_array($qstn)) {
1634
+				$success = $this->_save_new_answer($REG_ID, $QST_ID, $qstn);
1635 1635
 				continue;
1636 1636
 			}
1637 1637
 
1638 1638
 
1639
-			foreach ( $qstn as $ANS_ID => $ANS_value ) {
1639
+			foreach ($qstn as $ANS_ID => $ANS_value) {
1640 1640
 				//get answer
1641 1641
 				$query_params = array(
1642 1642
 					0 => array(
@@ -1647,8 +1647,8 @@  discard block
 block discarded – undo
1647 1647
 					);
1648 1648
 				$answer = EEM_Answer::instance()->get_one($query_params);
1649 1649
 				//this MAY be an array but NOT have an answer because its multi select.  If so then we need to create the answer
1650
-				if ( ! $answer instanceof EE_Answer ) {
1651
-					$success = $this->_save_new_answer( $REG_ID, $QST_ID, $qstn);
1650
+				if ( ! $answer instanceof EE_Answer) {
1651
+					$success = $this->_save_new_answer($REG_ID, $QST_ID, $qstn);
1652 1652
 					continue 2;
1653 1653
 				}
1654 1654
 
@@ -1662,7 +1662,7 @@  discard block
 block discarded – undo
1662 1662
 
1663 1663
 
1664 1664
 	//TODO: try changing this to use the model directly... not indirectly through creating a default object...
1665
-	private function _save_new_answer( $REG_ID, $QST_ID, $ans ) {
1665
+	private function _save_new_answer($REG_ID, $QST_ID, $ans) {
1666 1666
 		$set_values = array(
1667 1667
 			'QST_ID' => $QST_ID,
1668 1668
 			'REG_ID' => $REG_ID,
@@ -1689,30 +1689,30 @@  discard block
 block discarded – undo
1689 1689
 		$registrations = $REG->get_all(array(
1690 1690
 			array(
1691 1691
 				'TXN_ID'=>$this->_registration->transaction_ID(),
1692
-				'REG_ID'=>array('!=',$this->_registration->ID())
1692
+				'REG_ID'=>array('!=', $this->_registration->ID())
1693 1693
 			),
1694 1694
 			'force_join'=>array('Attendee')));
1695 1695
 
1696 1696
 		$this->_template_args['attendees'] = array();
1697 1697
 		$this->_template_args['attendee_notice'] = '';
1698 1698
 		EE_Registry::instance()->load_helper('Array');
1699
-		if ( empty( $registrations)  || ( is_array($registrations) &&  ! EEH_Array::get_one_item_from_array($registrations) ) ) {
1700
-			EE_Error::add_error( __('There are no records attached to this registration. Something may have gone wrong with the registration', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__ );
1699
+		if (empty($registrations) || (is_array($registrations) && ! EEH_Array::get_one_item_from_array($registrations))) {
1700
+			EE_Error::add_error(__('There are no records attached to this registration. Something may have gone wrong with the registration', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
1701 1701
 			$this->_template_args['attendee_notice'] = EE_Error::get_notices();
1702 1702
 		} else {
1703 1703
 
1704 1704
 			$att_nmbr = 1;
1705
-			foreach ( $registrations as $registration ) {
1705
+			foreach ($registrations as $registration) {
1706 1706
 				/* @var $registration EE_Registration */
1707 1707
 				$attendee = $registration->attendee() ? $registration->attendee() : EEM_Attendee::instance()->create_default_object();
1708
-				$this->_template_args['attendees'][ $att_nmbr ]['fname'] = $attendee->fname();//( isset( $registration->ATT_fname ) & ! empty( $registration->ATT_fname ) ) ? $registration->ATT_fname : '';
1709
-				$this->_template_args['attendees'][ $att_nmbr ]['lname'] = $attendee->lname();//( isset( $registration->ATT_lname ) & ! empty( $registration->ATT_lname ) ) ? $registration->ATT_lname : '';
1710
-				$this->_template_args['attendees'][ $att_nmbr ]['email'] = $attendee->email();//( isset( $registration->ATT_email ) & ! empty( $registration->ATT_email ) ) ? $registration->ATT_email : '';
1711
-				$this->_template_args['attendees'][ $att_nmbr ]['final_price'] = $registration->final_price();//( isset( $registration->REG_final_price ) & ! empty( $registration->REG_final_price ) ) ? $registration->REG_final_price : '';
1708
+				$this->_template_args['attendees'][$att_nmbr]['fname'] = $attendee->fname(); //( isset( $registration->ATT_fname ) & ! empty( $registration->ATT_fname ) ) ? $registration->ATT_fname : '';
1709
+				$this->_template_args['attendees'][$att_nmbr]['lname'] = $attendee->lname(); //( isset( $registration->ATT_lname ) & ! empty( $registration->ATT_lname ) ) ? $registration->ATT_lname : '';
1710
+				$this->_template_args['attendees'][$att_nmbr]['email'] = $attendee->email(); //( isset( $registration->ATT_email ) & ! empty( $registration->ATT_email ) ) ? $registration->ATT_email : '';
1711
+				$this->_template_args['attendees'][$att_nmbr]['final_price'] = $registration->final_price(); //( isset( $registration->REG_final_price ) & ! empty( $registration->REG_final_price ) ) ? $registration->REG_final_price : '';
1712 1712
 
1713
-				$this->_template_args['attendees'][ $att_nmbr ]['address'] = implode( ', ', $attendee->full_address_as_array() );
1713
+				$this->_template_args['attendees'][$att_nmbr]['address'] = implode(', ', $attendee->full_address_as_array());
1714 1714
 
1715
-				$this->_template_args['attendees'][ $att_nmbr ]['att_link'] = self::add_query_args_and_nonce( array( 'action'=>'edit_attendee', 'post'=>$attendee->ID() ), REG_ADMIN_URL );
1715
+				$this->_template_args['attendees'][$att_nmbr]['att_link'] = self::add_query_args_and_nonce(array('action'=>'edit_attendee', 'post'=>$attendee->ID()), REG_ADMIN_URL);
1716 1716
 
1717 1717
 				$att_nmbr++;
1718 1718
 			}
@@ -1724,8 +1724,8 @@  discard block
 block discarded – undo
1724 1724
 
1725 1725
 	//			$this->_template_args['registration_form_url'] = add_query_arg( array( 'action' => 'edit_registration', 'process' => 'attendees'  ), REG_ADMIN_URL );
1726 1726
 		}
1727
-		$template_path = REG_TEMPLATE_PATH . 'reg_admin_details_main_meta_box_attendees.template.php';
1728
-		echo EEH_Template::display_template( $template_path, $this->_template_args, TRUE );
1727
+		$template_path = REG_TEMPLATE_PATH.'reg_admin_details_main_meta_box_attendees.template.php';
1728
+		echo EEH_Template::display_template($template_path, $this->_template_args, TRUE);
1729 1729
 
1730 1730
 	}
1731 1731
 
@@ -1746,11 +1746,11 @@  discard block
 block discarded – undo
1746 1746
 		$attendee = $att_check instanceof EE_Attendee ? $att_check : EEM_Attendee::instance()->create_default_object();
1747 1747
 
1748 1748
 		//now let's determine if this is not the primary registration.  If it isn't then we set the primary_registration object for reference BUT ONLY if the Attendee object loaded is not the same as the primary registration object (that way we know if we need to show cereate button or not)
1749
-		if ( ! $this->_registration->is_primary_registrant() ) {
1749
+		if ( ! $this->_registration->is_primary_registrant()) {
1750 1750
 			$primary_registration = $this->_registration->get_primary_registration();
1751 1751
 			$primary_attendee = $primary_registration->attendee();
1752 1752
 
1753
-			if ( ! $primary_attendee instanceof EE_Attendee || $attendee->ID() !== $primary_attendee->ID() ) {
1753
+			if ( ! $primary_attendee instanceof EE_Attendee || $attendee->ID() !== $primary_attendee->ID()) {
1754 1754
 				//in here?  This means the displayed registration is not the primary registrant but ALREADY HAS its own custom attendee object so let's not worry about the primary reg.
1755 1755
 				$primary_registration = NULL;
1756 1756
 			}
@@ -1759,28 +1759,28 @@  discard block
 block discarded – undo
1759 1759
 		}
1760 1760
 
1761 1761
 		$this->_template_args['ATT_ID'] = $attendee->ID();
1762
-		$this->_template_args['fname'] = $attendee->fname();//$this->_registration->ATT_fname;
1763
-		$this->_template_args['lname'] = $attendee->lname();//$this->_registration->ATT_lname;
1764
-		$this->_template_args['email'] = $attendee->email();//$this->_registration->ATT_email;
1762
+		$this->_template_args['fname'] = $attendee->fname(); //$this->_registration->ATT_fname;
1763
+		$this->_template_args['lname'] = $attendee->lname(); //$this->_registration->ATT_lname;
1764
+		$this->_template_args['email'] = $attendee->email(); //$this->_registration->ATT_email;
1765 1765
 		$this->_template_args['phone'] = $attendee->phone();
1766 1766
 
1767
-		EE_Registry::instance()->load_helper( 'Formatter' );
1768
-		$this->_template_args[ 'formatted_address' ] = EEH_Address::format( $attendee );
1767
+		EE_Registry::instance()->load_helper('Formatter');
1768
+		$this->_template_args['formatted_address'] = EEH_Address::format($attendee);
1769 1769
 
1770 1770
 
1771 1771
 		//edit link
1772
-		$this->_template_args['att_edit_link'] = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'edit_attendee', 'post'=>$attendee->ID() ), REG_ADMIN_URL );
1773
-		$this->_template_args['att_edit_label'] = __('View/Edit Contact' );
1772
+		$this->_template_args['att_edit_link'] = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'edit_attendee', 'post'=>$attendee->ID()), REG_ADMIN_URL);
1773
+		$this->_template_args['att_edit_label'] = __('View/Edit Contact');
1774 1774
 
1775 1775
 		//create link
1776
-		$this->_template_args['create_link'] = $primary_registration instanceof EE_Registration ? EE_Admin_Page::add_query_args_and_nonce( array( 'action' => 'duplicate_attendee',  '_REG_ID' => $this->_registration->ID() ), REG_ADMIN_URL ): '';
1776
+		$this->_template_args['create_link'] = $primary_registration instanceof EE_Registration ? EE_Admin_Page::add_query_args_and_nonce(array('action' => 'duplicate_attendee', '_REG_ID' => $this->_registration->ID()), REG_ADMIN_URL) : '';
1777 1777
 		$this->_template_args['create_label'] = __('Create Contact', 'event_espresso');
1778 1778
 
1779 1779
 		$this->_template_args['att_check'] = $att_check;
1780 1780
 
1781 1781
 
1782
-		$template_path = REG_TEMPLATE_PATH . 'reg_admin_details_side_meta_box_registrant.template.php';
1783
-		echo EEH_Template::display_template( $template_path, $this->_template_args, TRUE );
1782
+		$template_path = REG_TEMPLATE_PATH.'reg_admin_details_side_meta_box_registrant.template.php';
1783
+		echo EEH_Template::display_template($template_path, $this->_template_args, TRUE);
1784 1784
 	}
1785 1785
 
1786 1786
 
@@ -1793,7 +1793,7 @@  discard block
 block discarded – undo
1793 1793
 	 * @access protected
1794 1794
 	 * @return void
1795 1795
 	 */
1796
-	protected function _trash_or_restore_registrations( $trash = TRUE ) {
1796
+	protected function _trash_or_restore_registrations($trash = TRUE) {
1797 1797
 		$REGM = EEM_Registration::instance();
1798 1798
 
1799 1799
 		$success = 1;
@@ -1803,26 +1803,26 @@  discard block
 block discarded – undo
1803 1803
 		$dtts = array();
1804 1804
 
1805 1805
 		//if empty _REG_ID then get out because there's nothing to do
1806
-		if ( empty( $this->_req_data['_REG_ID'] ) ) {
1806
+		if (empty($this->_req_data['_REG_ID'])) {
1807 1807
 			$msg = $trash ? __('In order to trash registrations you must select which ones you wish to trash by clicking the checkboxes.', 'event_espresso') : __('In order to restore registrations you must select which ones you wish to restore by clicking the checkboxes.', 'event_espresso');
1808
-			EE_Error::add_error( $msg, __FILE__, __LINE__, __FUNCTION__ );
1809
-			$this->_redirect_after_action(FALSE, '', '', array(), TRUE );
1808
+			EE_Error::add_error($msg, __FILE__, __LINE__, __FUNCTION__);
1809
+			$this->_redirect_after_action(FALSE, '', '', array(), TRUE);
1810 1810
 		}
1811 1811
 
1812 1812
 		//Checkboxes
1813
-		if (!empty($this->_req_data['_REG_ID']) && is_array($this->_req_data['_REG_ID'])) {
1813
+		if ( ! empty($this->_req_data['_REG_ID']) && is_array($this->_req_data['_REG_ID'])) {
1814 1814
 			// if array has more than one element than success message should be plural
1815
-			$success = count( $this->_req_data['_REG_ID'] ) > 1 ? 2 : 1;
1815
+			$success = count($this->_req_data['_REG_ID']) > 1 ? 2 : 1;
1816 1816
 			// cycle thru checkboxes
1817
-			while (list( $ind, $REG_ID ) = each($this->_req_data['_REG_ID'])) {
1817
+			while (list($ind, $REG_ID) = each($this->_req_data['_REG_ID'])) {
1818 1818
 
1819 1819
 				$REG = $REGM->get_one_by_ID($REG_ID);
1820 1820
 				$payment_count = $REG->get_first_related('Transaction')->count_related('Payment');
1821
-				if ( $payment_count > 0 ) {
1822
-					$name = $REG->attendee() instanceof EE_Attendee ? $REG->attendee()->full_name() : __( 'Unknown Attendee', 'event_espresso' );
1821
+				if ($payment_count > 0) {
1822
+					$name = $REG->attendee() instanceof EE_Attendee ? $REG->attendee()->full_name() : __('Unknown Attendee', 'event_espresso');
1823 1823
 					$error = 1;
1824 1824
 					$success = 0;
1825
-					EE_Error::add_error( sprintf( __('The registration for %s could not be trashed because it has payments attached to the related transaction.  If you wish to trash this registration you must first delete the payments on the related transaction.', 'event_espresso'), $name ), __FILE__, __FUNCTION__, __LINE__ );
1825
+					EE_Error::add_error(sprintf(__('The registration for %s could not be trashed because it has payments attached to the related transaction.  If you wish to trash this registration you must first delete the payments on the related transaction.', 'event_espresso'), $name), __FILE__, __FUNCTION__, __LINE__);
1826 1826
 					continue; //can't trash this registration because it has payments.
1827 1827
 				}
1828 1828
 				$ticket = $REG->get_first_related('Ticket');
@@ -1831,7 +1831,7 @@  discard block
 block discarded – undo
1831 1831
 				$dtts = array_merge($dtts, $dtt);
1832 1832
 
1833 1833
 				$updated = $trash ? $REG->delete() : $REG->restore();
1834
-				if ( !$updated ) {
1834
+				if ( ! $updated) {
1835 1835
 					$success = 0;
1836 1836
 				} else {
1837 1837
 					$success = 2;
@@ -1846,7 +1846,7 @@  discard block
 block discarded – undo
1846 1846
 			$tickets[$ticket->ID()] = $ticket;
1847 1847
 			$dtts = $ticket->get_many_related('Datetime');
1848 1848
 			$updated = $trash ? $REG->delete() : $REG->restore();
1849
-			if ( ! $updated ) {
1849
+			if ( ! $updated) {
1850 1850
 				$success = 0;
1851 1851
 			}
1852 1852
 
@@ -1856,10 +1856,10 @@  discard block
 block discarded – undo
1856 1856
 		EEM_Ticket::instance()->update_tickets_sold($tickets);
1857 1857
 		EEM_Datetime::instance()->update_sold($dtts);
1858 1858
 
1859
-		$what = $success > 1 ? __( 'Registrations', 'event_espresso' ) : __( 'Registration', 'event_espresso' );
1860
-		$action_desc = $trash ? __( 'moved to the trash', 'event_espresso' ) : __( 'restored', 'event_espresso' );
1859
+		$what = $success > 1 ? __('Registrations', 'event_espresso') : __('Registration', 'event_espresso');
1860
+		$action_desc = $trash ? __('moved to the trash', 'event_espresso') : __('restored', 'event_espresso');
1861 1861
 		$overwrite_msgs = $error ? TRUE : FALSE;
1862
-		$this->_redirect_after_action( $success, $what, $action_desc, array( 'action' => 'default' ), $overwrite_msgs );
1862
+		$this->_redirect_after_action($success, $what, $action_desc, array('action' => 'default'), $overwrite_msgs);
1863 1863
 	}
1864 1864
 
1865 1865
 
@@ -1883,16 +1883,16 @@  discard block
 block discarded – undo
1883 1883
 		$success = 1;
1884 1884
 
1885 1885
 		//Checkboxes
1886
-		if (!empty($this->_req_data['_REG_ID']) && is_array($this->_req_data['_REG_ID'])) {
1886
+		if ( ! empty($this->_req_data['_REG_ID']) && is_array($this->_req_data['_REG_ID'])) {
1887 1887
 			// if array has more than one element than success message should be plural
1888
-			$success = count( $this->_req_data['_REG_ID'] ) > 1 ? 2 : 1;
1888
+			$success = count($this->_req_data['_REG_ID']) > 1 ? 2 : 1;
1889 1889
 			// cycle thru checkboxes
1890
-			while (list( $ind, $REG_ID ) = each($this->_req_data['_REG_ID'])) {
1890
+			while (list($ind, $REG_ID) = each($this->_req_data['_REG_ID'])) {
1891 1891
 				$REG = $REG_MDL->get_one_by_ID($REG_ID);
1892
-				if ( ! $REG instanceof EE_Registration )
1892
+				if ( ! $REG instanceof EE_Registration)
1893 1893
 					continue;
1894 1894
 				$deleted = $this->_delete_registration($REG);
1895
-				if ( !$deleted ) {
1895
+				if ( ! $deleted) {
1896 1896
 					$success = 0;
1897 1897
 				}
1898 1898
 			}
@@ -1902,15 +1902,15 @@  discard block
 block discarded – undo
1902 1902
 			$REG_ID = $this->_req_data['_REG_ID'];
1903 1903
 			$REG = $REG_MDL->get_one_by_ID($REG_ID);
1904 1904
 			$deleted = $this->_delete_registration($REG);
1905
-			if ( ! $deleted ) {
1905
+			if ( ! $deleted) {
1906 1906
 				$success = 0;
1907 1907
 			}
1908 1908
 
1909 1909
 		}
1910 1910
 
1911
-		$what = $success > 1 ? __( 'Registrations', 'event_espresso' ) : __( 'Registration', 'event_espresso' );
1912
-		$action_desc = __( 'permanently deleted.', 'event_espresso' );
1913
-		$this->_redirect_after_action( $success, $what, $action_desc, array( 'action' => 'default' ), TRUE );
1911
+		$what = $success > 1 ? __('Registrations', 'event_espresso') : __('Registration', 'event_espresso');
1912
+		$action_desc = __('permanently deleted.', 'event_espresso');
1913
+		$this->_redirect_after_action($success, $what, $action_desc, array('action' => 'default'), TRUE);
1914 1914
 	}
1915 1915
 
1916 1916
 
@@ -1922,31 +1922,31 @@  discard block
 block discarded – undo
1922 1922
 	 * @param  EE_Registration $REG registration to be deleted permenantly
1923 1923
 	 * @return boolean              true = successful deletion, false = fail.
1924 1924
 	 */
1925
-	protected function _delete_registration( EE_Registration $REG ) {
1925
+	protected function _delete_registration(EE_Registration $REG) {
1926 1926
 		//first we start with the transaction... ultimately, we WILL not delete permanently if there are any related registrations on the transaction that are NOT trashed.
1927 1927
 		$TXN = $REG->get_first_related('Transaction');
1928 1928
 		$REGS = $TXN->get_many_related('Registration');
1929 1929
 
1930 1930
 		$all_trashed = TRUE;
1931
-		foreach ( $REGS as $registration ) {
1932
-			if ( ! $registration->get('REG_deleted') )
1931
+		foreach ($REGS as $registration) {
1932
+			if ( ! $registration->get('REG_deleted'))
1933 1933
 				$all_trashed = FALSE;
1934 1934
 		}
1935 1935
 
1936
-		if ( ! $all_trashed ) {
1937
-			EE_Error::add_error( __('Unable to permanently delete this registration. Before this registration can be permanently deleted, all registrations made in the same transaction must be trashed as well.  These registrations will be permanently deleted in the same action.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__ );
1936
+		if ( ! $all_trashed) {
1937
+			EE_Error::add_error(__('Unable to permanently delete this registration. Before this registration can be permanently deleted, all registrations made in the same transaction must be trashed as well.  These registrations will be permanently deleted in the same action.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
1938 1938
 			return false;
1939 1939
 		}
1940 1940
 
1941 1941
 		//k made it here so that means we can delete all the related transactions and their answers (but let's do them separately from THIS one).
1942
-		foreach ( $REGS as $registration ) {
1942
+		foreach ($REGS as $registration) {
1943 1943
 
1944 1944
 			//delete related answers
1945 1945
 			$registration->delete_related_permanently('Answer');
1946 1946
 
1947 1947
 			//remove relationship to EE_Attendee (but we ALWAYS leave the contact record intact)
1948 1948
 			$attendee = $registration->get_first_related('Attendee');
1949
-			if ( $attendee instanceof EE_Attendee ) {
1949
+			if ($attendee instanceof EE_Attendee) {
1950 1950
 				$registration->_remove_relation_to($attendee, 'Attendee');
1951 1951
 			}
1952 1952
 
@@ -1956,7 +1956,7 @@  discard block
 block discarded – undo
1956 1956
 			//now delete permanently the checkins related to this registration.
1957 1957
 			$registration->delete_related_permanently('Checkin');
1958 1958
 
1959
-			if ( $registration->ID() === $REG->ID() )
1959
+			if ($registration->ID() === $REG->ID())
1960 1960
 				continue; //we don't want to delete permanently the existing registration just yet.
1961 1961
 
1962 1962
 			//remove relation to transaction for these registrations if NOT the existing registrations
@@ -1989,34 +1989,34 @@  discard block
 block discarded – undo
1989 1989
 	 * @return void
1990 1990
 	 */
1991 1991
 	public function new_registration() {
1992
-		if ( ! $this->_set_reg_event() ) {
1993
-			throw new EE_Error(__('Unable to continue with registering because there is no Event ID in the request', 'event_espresso') );
1992
+		if ( ! $this->_set_reg_event()) {
1993
+			throw new EE_Error(__('Unable to continue with registering because there is no Event ID in the request', 'event_espresso'));
1994 1994
 		}
1995
-		EE_Registry::instance()->REQ->set_espresso_page( TRUE );
1995
+		EE_Registry::instance()->REQ->set_espresso_page(TRUE);
1996 1996
 
1997 1997
 		// gotta start with a clean slate if we're not coming here via ajax
1998
-		if ( ! defined('DOING_AJAX' ) && ( ! isset( $this->_req_data['processing_registration'] ) || isset( $this->_req_data['step_error'] ))) {
1999
-			EE_Registry::instance()->SSN->clear_session( __CLASS__, __FUNCTION__ );
1998
+		if ( ! defined('DOING_AJAX') && ( ! isset($this->_req_data['processing_registration']) || isset($this->_req_data['step_error']))) {
1999
+			EE_Registry::instance()->SSN->clear_session(__CLASS__, __FUNCTION__);
2000 2000
 		}
2001 2001
 
2002
-		$this->_template_args['event_name'] = '' ;
2002
+		$this->_template_args['event_name'] = '';
2003 2003
 		// event name
2004
-		if ( $this->_reg_event ) {
2004
+		if ($this->_reg_event) {
2005 2005
 			$this->_template_args['event_name'] = $this->_reg_event->name();
2006
-			$edit_event_url = self::add_query_args_and_nonce( array( 'action'=>'edit', 'post'=>$this->_reg_event->ID() ), EVENTS_ADMIN_URL );
2007
-			$edit_event_lnk = '<a href="'.$edit_event_url.'" title="' . esc_attr__( 'Edit ', 'event_espresso' ) . $this->_reg_event->name() . '">' . __( 'Edit Event', 'event_espresso' ) . '</a>';
2008
-			$this->_template_args['event_name'] .= ' <span class="admin-page-header-edit-lnk not-bold">' . $edit_event_lnk . '</span>' ;
2006
+			$edit_event_url = self::add_query_args_and_nonce(array('action'=>'edit', 'post'=>$this->_reg_event->ID()), EVENTS_ADMIN_URL);
2007
+			$edit_event_lnk = '<a href="'.$edit_event_url.'" title="'.esc_attr__('Edit ', 'event_espresso').$this->_reg_event->name().'">'.__('Edit Event', 'event_espresso').'</a>';
2008
+			$this->_template_args['event_name'] .= ' <span class="admin-page-header-edit-lnk not-bold">'.$edit_event_lnk.'</span>';
2009 2009
 		}
2010 2010
 
2011 2011
 		$this->_template_args['step_content'] = $this->_get_registration_step_content();
2012 2012
 
2013
-		if ( defined('DOING_AJAX' ) )
2013
+		if (defined('DOING_AJAX'))
2014 2014
 			$this->_return_json();
2015 2015
 
2016 2016
 
2017 2017
 		// grab header
2018
-		$template_path = REG_TEMPLATE_PATH . 'reg_admin_register_new_attendee.template.php';
2019
-		$this->_template_args['admin_page_content'] = EEH_Template::display_template( $template_path, $this->_template_args, TRUE );
2018
+		$template_path = REG_TEMPLATE_PATH.'reg_admin_register_new_attendee.template.php';
2019
+		$this->_template_args['admin_page_content'] = EEH_Template::display_template($template_path, $this->_template_args, TRUE);
2020 2020
 
2021 2021
 		//$this->_set_publish_post_box_vars( NULL, FALSE, FALSE, NULL, FALSE );
2022 2022
 		// the details template wrapper
@@ -2034,7 +2034,7 @@  discard block
 block discarded – undo
2034 2034
 	 */
2035 2035
 	protected function _get_registration_step_content() {
2036 2036
 
2037
-		$template_path = REG_TEMPLATE_PATH . 'reg_admin_register_new_attendee_step_content.template.php';
2037
+		$template_path = REG_TEMPLATE_PATH.'reg_admin_register_new_attendee_step_content.template.php';
2038 2038
 		$template_args = array(
2039 2039
 			'title' => '',
2040 2040
 			'content' => '',
@@ -2055,11 +2055,11 @@  discard block
 block discarded – undo
2055 2055
 
2056 2056
 		//if the cart is empty then we know we're at step one so we'll display ticket selector
2057 2057
 		$cart = EE_Registry::instance()->SSN->get_session_data('cart');
2058
-		$step = empty( $cart ) ? 'ticket' : 'questions';
2059
-		switch ( $step ) {
2058
+		$step = empty($cart) ? 'ticket' : 'questions';
2059
+		switch ($step) {
2060 2060
 			case 'ticket' :
2061 2061
 				$template_args['title'] = __('Step One: Select the Ticket for this registration', 'event_espresso');
2062
-				$template_args['content'] = EED_Ticket_Selector::instance()->display_ticket_selector( $this->_reg_event );
2062
+				$template_args['content'] = EED_Ticket_Selector::instance()->display_ticket_selector($this->_reg_event);
2063 2063
 				$template_args['step_button_text'] = __('Add Tickets and Continue to Registrant Details', 'event_espresso');
2064 2064
 				$template_args['show_notification_toggle'] = FALSE;
2065 2065
 				break;
@@ -2072,9 +2072,9 @@  discard block
 block discarded – undo
2072 2072
 				break;
2073 2073
 		}
2074 2074
 
2075
-		$this->_set_add_edit_form_tags( 'process_reg_step', $hidden_fields ); //we come back to the process_registration_step route.
2075
+		$this->_set_add_edit_form_tags('process_reg_step', $hidden_fields); //we come back to the process_registration_step route.
2076 2076
 
2077
-		return EEH_Template::display_template( $template_path, $template_args, TRUE );
2077
+		return EEH_Template::display_template($template_path, $template_args, TRUE);
2078 2078
 	}
2079 2079
 
2080 2080
 
@@ -2088,11 +2088,11 @@  discard block
 block discarded – undo
2088 2088
 	*		@return boolean
2089 2089
 	*/
2090 2090
 	private function _set_reg_event() {
2091
-		if ( is_object( $this->_reg_event )) {
2091
+		if (is_object($this->_reg_event)) {
2092 2092
 			return TRUE;
2093 2093
 		}
2094
-		$EVT_ID = ( ! empty( $this->_req_data['event_id'] )) ? absint( $this->_req_data['event_id'] ) : FALSE;
2095
-		if ( ! $EVT_ID ) {
2094
+		$EVT_ID = ( ! empty($this->_req_data['event_id'])) ? absint($this->_req_data['event_id']) : FALSE;
2095
+		if ( ! $EVT_ID) {
2096 2096
 			return FALSE;
2097 2097
 		}
2098 2098
 
@@ -2113,62 +2113,62 @@  discard block
 block discarded – undo
2113 2113
 	public function process_reg_step() {
2114 2114
 
2115 2115
 		$this->_set_reg_event();
2116
-		EE_Registry::instance()->REQ->set_espresso_page( TRUE );
2116
+		EE_Registry::instance()->REQ->set_espresso_page(TRUE);
2117 2117
 
2118 2118
 		//what step are we on?
2119
-		$cart = EE_Registry::instance()->SSN->get_session_data( 'cart' );
2120
-		$step = empty( $cart ) ? 'ticket' : 'questions';
2119
+		$cart = EE_Registry::instance()->SSN->get_session_data('cart');
2120
+		$step = empty($cart) ? 'ticket' : 'questions';
2121 2121
 
2122 2122
 		//if doing ajax then we need to verify the nonce
2123
-		if ( 'DOING_AJAX' ) {
2124
-			$nonce = isset( $this->_req_data[$this->_req_nonce] ) ? sanitize_text_field( $this->_req_data[$this->_req_nonce] ) : '';
2125
-			$this->_verify_nonce( $nonce, $this->_req_nonce );
2123
+		if ('DOING_AJAX') {
2124
+			$nonce = isset($this->_req_data[$this->_req_nonce]) ? sanitize_text_field($this->_req_data[$this->_req_nonce]) : '';
2125
+			$this->_verify_nonce($nonce, $this->_req_nonce);
2126 2126
 		}
2127 2127
 
2128
-		switch ( $step ) {
2128
+		switch ($step) {
2129 2129
 			case 'ticket' :
2130 2130
 				//process ticket selection
2131 2131
 				$success = EED_Ticket_Selector::instance()->process_ticket_selections();
2132
-				if ( $success ) {
2133
-					EE_Error::add_success( __('Tickets Selected. Now complete the registration.'), 'event_espresso');
2132
+				if ($success) {
2133
+					EE_Error::add_success(__('Tickets Selected. Now complete the registration.'), 'event_espresso');
2134 2134
 				} else {
2135 2135
 					$query_args['step_error'] = $this->_req_data['step_error'] = TRUE;
2136 2136
 				}
2137
-				if ( defined('DOING_AJAX') ) {
2137
+				if (defined('DOING_AJAX')) {
2138 2138
 					$this->new_registration(); //display next step
2139 2139
 				} else {
2140 2140
 					$query_args['action'] = 'new_registration';
2141 2141
 					$query_args['processing_registration'] = true;
2142 2142
 					$query_args['event_id'] = $this->_reg_event->ID();
2143
-					$this->_redirect_after_action( FALSE, '', '', $query_args, TRUE );
2143
+					$this->_redirect_after_action(FALSE, '', '', $query_args, TRUE);
2144 2144
 				}
2145 2145
 				break;
2146 2146
 			case 'questions' :
2147
-				if( ! isset( $this->_req_data[ 'txn_reg_status_change' ], $this->_req_data[ 'txn_reg_status_change' ][ 'send_notifications' ] ) ) {
2148
-					add_filter( 'FHEE__EED_Messages___maybe_registration__deliver_notifications', '__return_false', 15 );
2147
+				if ( ! isset($this->_req_data['txn_reg_status_change'], $this->_req_data['txn_reg_status_change']['send_notifications'])) {
2148
+					add_filter('FHEE__EED_Messages___maybe_registration__deliver_notifications', '__return_false', 15);
2149 2149
 				}
2150 2150
 				//process registration
2151 2151
 				$transaction = EED_Single_Page_Checkout::instance()->process_registration_from_admin();
2152
-				if ( ! $transaction instanceof EE_Transaction ) {
2152
+				if ( ! $transaction instanceof EE_Transaction) {
2153 2153
 					$query_args = array(
2154 2154
 						'action' => 'new_registration',
2155 2155
 						'processing_registration' => true,
2156 2156
 						'event_id' => $this->_reg_event->ID()
2157 2157
 					);
2158 2158
 
2159
-					if ( defined('DOING_AJAX' )) {
2159
+					if (defined('DOING_AJAX')) {
2160 2160
 						//display registration form again because there are errors (maybe validation?)
2161 2161
 						$this->new_registration();
2162 2162
 						return;
2163 2163
 					} else {
2164
-						$this->_redirect_after_action( FALSE, '', '', $query_args, TRUE );
2164
+						$this->_redirect_after_action(FALSE, '', '', $query_args, TRUE);
2165 2165
 						return;
2166 2166
 					}
2167 2167
 				}
2168 2168
 				/** @type EE_Transaction_Payments $transaction_payments */
2169
-				$transaction_payments = EE_Registry::instance()->load_class( 'Transaction_Payments' );
2169
+				$transaction_payments = EE_Registry::instance()->load_class('Transaction_Payments');
2170 2170
 				// maybe update status, and make sure to save transaction if not done already
2171
-				if ( ! $transaction_payments->update_transaction_status_based_on_total_paid( $transaction )) {
2171
+				if ( ! $transaction_payments->update_transaction_status_based_on_total_paid($transaction)) {
2172 2172
 					$transaction->save();
2173 2173
 				}
2174 2174
 				$query_args = array(
@@ -2176,8 +2176,8 @@  discard block
 block discarded – undo
2176 2176
 					'TXN_ID' => $transaction->ID(),
2177 2177
 					'page' => 'espresso_transactions'
2178 2178
 				);
2179
-				EE_Error::add_success( __('Registration Created.  Please review the transaction and add any payments as necessary', 'event_espresso') );
2180
-				$this->_redirect_after_action( FALSE, '', '', $query_args, TRUE );
2179
+				EE_Error::add_success(__('Registration Created.  Please review the transaction and add any payments as necessary', 'event_espresso'));
2180
+				$this->_redirect_after_action(FALSE, '', '', $query_args, TRUE);
2181 2181
 				break;
2182 2182
 			}
2183 2183
 
@@ -2197,7 +2197,7 @@  discard block
 block discarded – undo
2197 2197
 	*		@return void
2198 2198
 	*/
2199 2199
 	protected function _attendee_contact_list_table() {
2200
-		do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' );
2200
+		do_action('AHEE_log', __FILE__, __FUNCTION__, '');
2201 2201
 		$this->_search_btn_label = __('Contacts', 'event_espresso');
2202 2202
 		$this->display_admin_list_table_page_with_no_sidebar();
2203 2203
 	}
@@ -2212,10 +2212,10 @@  discard block
 block discarded – undo
2212 2212
 	*		@access public
2213 2213
 	*		@return array
2214 2214
 	*/
2215
-	public function get_attendees( $per_page, $count = FALSE, $trash = FALSE ) {
2215
+	public function get_attendees($per_page, $count = FALSE, $trash = FALSE) {
2216 2216
 
2217
-		do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' );
2218
-		require_once( REG_ADMIN . 'EE_Attendee_Contact_List_Table.class.php' );
2217
+		do_action('AHEE_log', __FILE__, __FUNCTION__, '');
2218
+		require_once(REG_ADMIN.'EE_Attendee_Contact_List_Table.class.php');
2219 2219
 		$ATT_MDL = EEM_Attendee::instance();
2220 2220
 
2221 2221
 		$this->_req_data['orderby'] = ! empty($this->_req_data['orderby']) ? $this->_req_data['orderby'] : '';
@@ -2243,47 +2243,47 @@  discard block
 block discarded – undo
2243 2243
 				$orderby = 'ATT_lname';
2244 2244
 		}
2245 2245
 
2246
-		$sort = ( isset( $this->_req_data['order'] ) && ! empty( $this->_req_data['order'] )) ? $this->_req_data['order'] : 'ASC';
2246
+		$sort = (isset($this->_req_data['order']) && ! empty($this->_req_data['order'])) ? $this->_req_data['order'] : 'ASC';
2247 2247
 
2248
-		$current_page = isset( $this->_req_data['paged'] ) && !empty( $this->_req_data['paged'] ) ? $this->_req_data['paged'] : 1;
2249
-		$per_page = isset( $per_page ) && !empty( $per_page ) ? $per_page : 10;
2250
-		$per_page = isset( $this->_req_data['perpage'] ) && !empty( $this->_req_data['perpage'] ) ? $this->_req_data['perpage'] : $per_page;
2248
+		$current_page = isset($this->_req_data['paged']) && ! empty($this->_req_data['paged']) ? $this->_req_data['paged'] : 1;
2249
+		$per_page = isset($per_page) && ! empty($per_page) ? $per_page : 10;
2250
+		$per_page = isset($this->_req_data['perpage']) && ! empty($this->_req_data['perpage']) ? $this->_req_data['perpage'] : $per_page;
2251 2251
 
2252 2252
 		$_where = array();
2253 2253
 
2254
-		if ( isset( $this->_req_data['s'] ) ) {
2255
-			$sstr = '%' . $this->_req_data['s'] . '%';
2254
+		if (isset($this->_req_data['s'])) {
2255
+			$sstr = '%'.$this->_req_data['s'].'%';
2256 2256
 			$_where['OR'] = array(
2257
-				'Registration.Event.EVT_name' => array( 'LIKE', $sstr),
2258
-				'Registration.Event.EVT_desc' => array( 'LIKE', $sstr ),
2259
-				'Registration.Event.EVT_short_desc' => array( 'LIKE' , $sstr ),
2260
-				'ATT_fname' => array( 'LIKE', $sstr ),
2261
-				'ATT_lname' => array( 'LIKE', $sstr ),
2262
-				'ATT_short_bio' => array( 'LIKE', $sstr ),
2263
-				'ATT_email' => array('LIKE', $sstr ),
2264
-				'ATT_address' => array( 'LIKE', $sstr ),
2265
-				'ATT_address2' => array( 'LIKE', $sstr ),
2266
-				'ATT_city' => array( 'LIKE', $sstr ),
2267
-				'Country.CNT_name' => array( 'LIKE', $sstr ),
2268
-				'State.STA_name' => array('LIKE', $sstr ),
2269
-				'ATT_phone' => array( 'LIKE', $sstr ),
2270
-				'Registration.REG_final_price' => array( 'LIKE', $sstr ),
2271
-				'Registration.REG_code' => array( 'LIKE', $sstr ),
2272
-				'Registration.REG_count' => array( 'LIKE' , $sstr ),
2273
-				'Registration.REG_group_size' => array( 'LIKE' , $sstr )
2257
+				'Registration.Event.EVT_name' => array('LIKE', $sstr),
2258
+				'Registration.Event.EVT_desc' => array('LIKE', $sstr),
2259
+				'Registration.Event.EVT_short_desc' => array('LIKE', $sstr),
2260
+				'ATT_fname' => array('LIKE', $sstr),
2261
+				'ATT_lname' => array('LIKE', $sstr),
2262
+				'ATT_short_bio' => array('LIKE', $sstr),
2263
+				'ATT_email' => array('LIKE', $sstr),
2264
+				'ATT_address' => array('LIKE', $sstr),
2265
+				'ATT_address2' => array('LIKE', $sstr),
2266
+				'ATT_city' => array('LIKE', $sstr),
2267
+				'Country.CNT_name' => array('LIKE', $sstr),
2268
+				'State.STA_name' => array('LIKE', $sstr),
2269
+				'ATT_phone' => array('LIKE', $sstr),
2270
+				'Registration.REG_final_price' => array('LIKE', $sstr),
2271
+				'Registration.REG_code' => array('LIKE', $sstr),
2272
+				'Registration.REG_count' => array('LIKE', $sstr),
2273
+				'Registration.REG_group_size' => array('LIKE', $sstr)
2274 2274
 				);
2275 2275
 		}
2276 2276
 
2277 2277
 
2278
-		$offset = ($current_page-1)*$per_page;
2279
-		$limit = $count ? NULL : array( $offset, $per_page );
2278
+		$offset = ($current_page - 1) * $per_page;
2279
+		$limit = $count ? NULL : array($offset, $per_page);
2280 2280
 
2281
-		if ( $trash ) {
2282
-			$_where['status'] = array( '!=', 'publish' );
2283
-			$all_attendees = $count ? $ATT_MDL->count( array($_where,'order_by'=>array($orderby=>$sort), 'limit'=>$limit)): $ATT_MDL->get_all( array($_where,'order_by'=>array($orderby=>$sort), 'limit'=>$limit));
2281
+		if ($trash) {
2282
+			$_where['status'] = array('!=', 'publish');
2283
+			$all_attendees = $count ? $ATT_MDL->count(array($_where, 'order_by'=>array($orderby=>$sort), 'limit'=>$limit)) : $ATT_MDL->get_all(array($_where, 'order_by'=>array($orderby=>$sort), 'limit'=>$limit));
2284 2284
 		} else {
2285
-			$_where['status'] = array( 'IN', array( 'publish' ) );
2286
-			$all_attendees = $count ? $ATT_MDL->count( array($_where, 'order_by'=>array($orderby=>$sort),'limit'=>$limit)) : $ATT_MDL->get_all( array($_where, 'order_by'=>array($orderby=>$sort), 'limit'=>$limit) );
2285
+			$_where['status'] = array('IN', array('publish'));
2286
+			$all_attendees = $count ? $ATT_MDL->count(array($_where, 'order_by'=>array($orderby=>$sort), 'limit'=>$limit)) : $ATT_MDL->get_all(array($_where, 'order_by'=>array($orderby=>$sort), 'limit'=>$limit));
2287 2287
 		}
2288 2288
 
2289 2289
 		return $all_attendees;
@@ -2300,10 +2300,10 @@  discard block
 block discarded – undo
2300 2300
 	 */
2301 2301
 	protected function _resend_registration() {
2302 2302
 		$this->_process_resend_registration();
2303
-		$query_args = isset($this->_req_data['redirect_to'] ) ? array('action' => $this->_req_data['redirect_to'], '_REG_ID' => $this->_req_data['_REG_ID'] ) : array(
2303
+		$query_args = isset($this->_req_data['redirect_to']) ? array('action' => $this->_req_data['redirect_to'], '_REG_ID' => $this->_req_data['_REG_ID']) : array(
2304 2304
 			'action' => 'default'
2305 2305
 		);
2306
-		$this->_redirect_after_action(FALSE, '', '', $query_args, TRUE );
2306
+		$this->_redirect_after_action(FALSE, '', '', $query_args, TRUE);
2307 2307
 	}
2308 2308
 
2309 2309
 
@@ -2311,27 +2311,27 @@  discard block
 block discarded – undo
2311 2311
 
2312 2312
 
2313 2313
 
2314
-	public function _registrations_report(){
2315
-		if( ! defined( 'EE_USE_OLD_CSV_REPORT_CLASS' ) ) {
2316
-			wp_redirect( EE_Admin_Page::add_query_args_and_nonce(
2314
+	public function _registrations_report() {
2315
+		if ( ! defined('EE_USE_OLD_CSV_REPORT_CLASS')) {
2316
+			wp_redirect(EE_Admin_Page::add_query_args_and_nonce(
2317 2317
 				array(
2318 2318
 					'page' => 'espresso_support',
2319 2319
 					'action' => 'batch_file_create',
2320
-					'EVT_ID' => isset( $this->_req_data[ 'EVT_ID'] ) ? $this->_req_data[ 'EVT_ID' ] : NULL,
2321
-					'job_handler' => urlencode( 'EventEspressoBatchRequest\JobHandlers\RegistrationsReport' ),
2322
-					'redirect_url' => urlencode( $this->_req_data[ 'return_url' ] ),
2323
-				)) );
2320
+					'EVT_ID' => isset($this->_req_data['EVT_ID']) ? $this->_req_data['EVT_ID'] : NULL,
2321
+					'job_handler' => urlencode('EventEspressoBatchRequest\JobHandlers\RegistrationsReport'),
2322
+					'redirect_url' => urlencode($this->_req_data['return_url']),
2323
+				)));
2324 2324
 		} else {
2325
-			EE_Registry::instance()->load_helper( 'File' );
2325
+			EE_Registry::instance()->load_helper('File');
2326 2326
 			$new_request_args = array(
2327 2327
 				'export' => 'report',
2328 2328
 				'action' => 'registrations_report_for_event',
2329
-				'EVT_ID' => isset( $this->_req_data[ 'EVT_ID'] ) ? $this->_req_data[ 'EVT_ID' ] : NULL,
2329
+				'EVT_ID' => isset($this->_req_data['EVT_ID']) ? $this->_req_data['EVT_ID'] : NULL,
2330 2330
 			);
2331 2331
 			$this->_req_data = array_merge($this->_req_data, $new_request_args);
2332 2332
 
2333
-			if ( is_readable(EE_CLASSES . 'EE_Export.class.php')) {
2334
-				require_once(EE_CLASSES . 'EE_Export.class.php');
2333
+			if (is_readable(EE_CLASSES.'EE_Export.class.php')) {
2334
+				require_once(EE_CLASSES.'EE_Export.class.php');
2335 2335
 				$EE_Export = EE_Export::instance($this->_req_data);
2336 2336
 				$EE_Export->export();
2337 2337
 			}
@@ -2340,28 +2340,28 @@  discard block
 block discarded – undo
2340 2340
 
2341 2341
 
2342 2342
 
2343
-	public function _contact_list_export(){
2344
-		EE_Registry::instance()->load_helper( 'File' );
2345
-		if ( is_readable(EE_CLASSES . 'EE_Export.class.php')) {
2346
-			require_once(EE_CLASSES . 'EE_Export.class.php');
2343
+	public function _contact_list_export() {
2344
+		EE_Registry::instance()->load_helper('File');
2345
+		if (is_readable(EE_CLASSES.'EE_Export.class.php')) {
2346
+			require_once(EE_CLASSES.'EE_Export.class.php');
2347 2347
 			$EE_Export = EE_Export::instance($this->_req_data);
2348 2348
 			$EE_Export->export_attendees();
2349 2349
 		}
2350 2350
 	}
2351 2351
 
2352
-	public function _contact_list_report(){
2353
-		if( ! defined( 'EE_USE_OLD_CSV_REPORT_CLASS' ) ) {
2354
-			wp_redirect( EE_Admin_Page::add_query_args_and_nonce(
2352
+	public function _contact_list_report() {
2353
+		if ( ! defined('EE_USE_OLD_CSV_REPORT_CLASS')) {
2354
+			wp_redirect(EE_Admin_Page::add_query_args_and_nonce(
2355 2355
 				array(
2356 2356
 					'page' => 'espresso_support',
2357 2357
 					'action' => 'batch_file_create',
2358
-					'job_handler' => urlencode( 'EventEspressoBatchRequest\JobHandlers\AttendeesReport' ),
2359
-					'redirect_url' => urlencode( $this->_req_data[ 'return_url' ] ),
2360
-				)) );
2358
+					'job_handler' => urlencode('EventEspressoBatchRequest\JobHandlers\AttendeesReport'),
2359
+					'redirect_url' => urlencode($this->_req_data['return_url']),
2360
+				)));
2361 2361
 		} else {
2362
-			EE_Registry::instance()->load_helper( 'File' );
2363
-			if ( is_readable(EE_CLASSES . 'EE_Export.class.php')) {
2364
-				require_once(EE_CLASSES . 'EE_Export.class.php');
2362
+			EE_Registry::instance()->load_helper('File');
2363
+			if (is_readable(EE_CLASSES.'EE_Export.class.php')) {
2364
+				require_once(EE_CLASSES.'EE_Export.class.php');
2365 2365
 				$EE_Export = EE_Export::instance($this->_req_data);
2366 2366
 				$EE_Export->report_attendees();
2367 2367
 			}
@@ -2381,73 +2381,73 @@  discard block
 block discarded – undo
2381 2381
 	 * @return void
2382 2382
 	 */
2383 2383
 	protected function _duplicate_attendee() {
2384
-		$action = !empty( $this->_req_data['return'] ) ? $this->_req_data['return'] : 'default';
2384
+		$action = ! empty($this->_req_data['return']) ? $this->_req_data['return'] : 'default';
2385 2385
 		//verify we have necessary info
2386
-		if ( empty($this->_req_data['_REG_ID'] )  ) {
2387
-			EE_Error::add_error( __('Unable to create the contact for the registration because the required paramaters are not present (_REG_ID )', 'event_espresso'),  __FILE__, __LINE__, __FUNCTION__ );
2388
-			$query_args = array( 'action' => $action );
2386
+		if (empty($this->_req_data['_REG_ID'])) {
2387
+			EE_Error::add_error(__('Unable to create the contact for the registration because the required paramaters are not present (_REG_ID )', 'event_espresso'), __FILE__, __LINE__, __FUNCTION__);
2388
+			$query_args = array('action' => $action);
2389 2389
 			$this->_redirect_after_action('', '', '', $query_args, TRUE);
2390 2390
 		}
2391 2391
 
2392 2392
 		//okay necessary deets present... let's dupe the incoming attendee and attach to incoming registration.
2393
-		$registration = EEM_Registration::instance()->get_one_by_ID( $this->_req_data['_REG_ID'] );
2393
+		$registration = EEM_Registration::instance()->get_one_by_ID($this->_req_data['_REG_ID']);
2394 2394
 		$attendee = $registration->attendee();
2395 2395
 
2396 2396
 		//remove relation of existing attendee on registration
2397
-		$registration->_remove_relation_to($attendee, 'Attendee' );
2397
+		$registration->_remove_relation_to($attendee, 'Attendee');
2398 2398
 		//new attendee
2399 2399
 		$new_attendee = clone $attendee;
2400
-		$new_attendee->set( 'ATT_ID', 0 );
2400
+		$new_attendee->set('ATT_ID', 0);
2401 2401
 		$new_attendee->save();
2402 2402
 
2403 2403
 		//add new attendee to reg
2404
-		$registration->_add_relation_to( $new_attendee, 'Attendee');
2404
+		$registration->_add_relation_to($new_attendee, 'Attendee');
2405 2405
 
2406
-		EE_Error::add_success( __('New Contact record created.  Now make any edits you wish to make for this contact.', 'event_espresso') );
2406
+		EE_Error::add_success(__('New Contact record created.  Now make any edits you wish to make for this contact.', 'event_espresso'));
2407 2407
 
2408 2408
 		//redirect to edit page for attendee
2409
-		$query_args = array( 'post' => $new_attendee->ID(), 'action' => 'edit_attendee' );
2409
+		$query_args = array('post' => $new_attendee->ID(), 'action' => 'edit_attendee');
2410 2410
 
2411
-		$this->_redirect_after_action( '', '', '', $query_args, TRUE );
2411
+		$this->_redirect_after_action('', '', '', $query_args, TRUE);
2412 2412
 	}
2413 2413
 
2414 2414
 
2415 2415
 	//related to cpt routes
2416 2416
 	protected function _insert_update_cpt_item($post_id, $post) {
2417 2417
 		$success = true;
2418
-		$attendee = EEM_Attendee::instance()->get_one_by_ID( $post_id );
2418
+		$attendee = EEM_Attendee::instance()->get_one_by_ID($post_id);
2419 2419
 		//for attendee updates
2420
-		if ( $post->post_type = 'espresso_attendees' && !empty( $attendee ) ) {
2420
+		if ($post->post_type = 'espresso_attendees' && ! empty($attendee)) {
2421 2421
 			//note we should only be UPDATING attendees at this point.
2422 2422
 			$updated_fields = array(
2423 2423
 				'ATT_fname' => $this->_req_data['ATT_fname'],
2424 2424
 				'ATT_lname' => $this->_req_data['ATT_lname'],
2425
-				'ATT_full_name'=> $this->_req_data['ATT_fname'] . ' ' . $this->_req_data['ATT_lname'],
2425
+				'ATT_full_name'=> $this->_req_data['ATT_fname'].' '.$this->_req_data['ATT_lname'],
2426 2426
 				'ATT_address' => isset($this->_req_data['ATT_address']) ? $this->_req_data['ATT_address'] : '',
2427 2427
 				'ATT_address2' => isset($this->_req_data['ATT_address2']) ? $this->_req_data['ATT_address2'] : '',
2428
-				'ATT_city' => isset( $this->_req_data['ATT_city'] ) ? $this->_req_data['ATT_city'] : '',
2429
-				'STA_ID' => isset( $this->_req_data['STA_ID'] ) ? $this->_req_data['STA_ID'] : '',
2430
-				'CNT_ISO' => isset( $this->_req_data['CNT_ISO'] ) ? $this->_req_data['CNT_ISO'] : '',
2431
-				'ATT_zip' => isset( $this->_req_data['ATT_zip'] ) ? $this->_req_data['ATT_zip'] : '',
2432
-				'ATT_email' => isset( $this->_req_data['ATT_email'] ) ? $this->_req_data['ATT_email'] : '',
2433
-				'ATT_phone' => isset( $this->_req_data['ATT_phone'] ) ? $this->_req_data['ATT_phone'] : ''
2428
+				'ATT_city' => isset($this->_req_data['ATT_city']) ? $this->_req_data['ATT_city'] : '',
2429
+				'STA_ID' => isset($this->_req_data['STA_ID']) ? $this->_req_data['STA_ID'] : '',
2430
+				'CNT_ISO' => isset($this->_req_data['CNT_ISO']) ? $this->_req_data['CNT_ISO'] : '',
2431
+				'ATT_zip' => isset($this->_req_data['ATT_zip']) ? $this->_req_data['ATT_zip'] : '',
2432
+				'ATT_email' => isset($this->_req_data['ATT_email']) ? $this->_req_data['ATT_email'] : '',
2433
+				'ATT_phone' => isset($this->_req_data['ATT_phone']) ? $this->_req_data['ATT_phone'] : ''
2434 2434
 				);
2435
-			foreach ( $updated_fields as $field => $value ) {
2435
+			foreach ($updated_fields as $field => $value) {
2436 2436
 				$attendee->set($field, $value);
2437 2437
 			}
2438 2438
 
2439 2439
 			$success = $attendee->save();
2440 2440
 
2441
-			$attendee_update_callbacks = apply_filters( 'FHEE__Registrations_Admin_Page__insert_update_cpt_item__attendee_update', array() );
2442
-			foreach ( $attendee_update_callbacks as $a_callback ) {
2443
-				if ( FALSE === call_user_func_array( $a_callback, array($attendee, $this->_req_data ) ) ) {
2444
-					throw new EE_Error( sprintf( __('The %s callback given for the "FHEE__Registrations_Admin_Page__insert_update_cpt_item__attendee_update" filter is not a valid callback.  Please check the spelling.', 'event_espresso'), $a_callback ) );
2441
+			$attendee_update_callbacks = apply_filters('FHEE__Registrations_Admin_Page__insert_update_cpt_item__attendee_update', array());
2442
+			foreach ($attendee_update_callbacks as $a_callback) {
2443
+				if (FALSE === call_user_func_array($a_callback, array($attendee, $this->_req_data))) {
2444
+					throw new EE_Error(sprintf(__('The %s callback given for the "FHEE__Registrations_Admin_Page__insert_update_cpt_item__attendee_update" filter is not a valid callback.  Please check the spelling.', 'event_espresso'), $a_callback));
2445 2445
 				}
2446 2446
 			}
2447 2447
 		}
2448 2448
 
2449
-		if ( $success === FALSE )
2450
-			EE_Error::add_error(__('Something went wrong with updating the meta table data for the registration.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__ );
2449
+		if ($success === FALSE)
2450
+			EE_Error::add_error(__('Something went wrong with updating the meta table data for the registration.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
2451 2451
 
2452 2452
 	}
2453 2453
 
@@ -2467,17 +2467,17 @@  discard block
 block discarded – undo
2467 2467
 		remove_meta_box('postexcerpt', __('Excerpt'), 'post_excerpt_meta_box', $this->_cpt_routes[$this->_req_action], 'normal', 'core');
2468 2468
 		remove_meta_box('commentstatusdiv', $this->_cpt_routes[$this->_req_action], 'normal', 'core');
2469 2469
 
2470
-		if ( post_type_supports( 'espresso_attendees', 'excerpt') ) {
2471
-			add_meta_box('postexcerpt', __('Short Biography', 'event_espresso'), 'post_excerpt_meta_box', $this->_cpt_routes[$this->_req_action], 'normal' );
2470
+		if (post_type_supports('espresso_attendees', 'excerpt')) {
2471
+			add_meta_box('postexcerpt', __('Short Biography', 'event_espresso'), 'post_excerpt_meta_box', $this->_cpt_routes[$this->_req_action], 'normal');
2472 2472
 		}
2473 2473
 
2474
-		if ( post_type_supports( 'espresso_attendees', 'comments') ) {
2474
+		if (post_type_supports('espresso_attendees', 'comments')) {
2475 2475
 			add_meta_box('commentsdiv', __('Notes on the Contact', 'event_espresso'), 'post_comment_meta_box', $this->_cpt_routes[$this->_req_action], 'normal', 'core');
2476 2476
 		}
2477 2477
 
2478
-		add_meta_box('attendee_contact_info', __('Contact Info', 'event_espresso'), array( $this, 'attendee_contact_info'), $this->_cpt_routes[$this->_req_action], 'side', 'core' );
2479
-		add_meta_box('attendee_details_address', __('Address Details', 'event_espresso'), array($this, 'attendee_address_details'), $this->_cpt_routes[$this->_req_action], 'normal', 'core' );
2480
-		add_meta_box('attendee_registrations', __('Registrations for this Contact', 'event_espresso'), array( $this, 'attendee_registrations_meta_box'), $this->_cpt_routes[$this->_req_action], 'normal', 'high');
2478
+		add_meta_box('attendee_contact_info', __('Contact Info', 'event_espresso'), array($this, 'attendee_contact_info'), $this->_cpt_routes[$this->_req_action], 'side', 'core');
2479
+		add_meta_box('attendee_details_address', __('Address Details', 'event_espresso'), array($this, 'attendee_address_details'), $this->_cpt_routes[$this->_req_action], 'normal', 'core');
2480
+		add_meta_box('attendee_registrations', __('Registrations for this Contact', 'event_espresso'), array($this, 'attendee_registrations_meta_box'), $this->_cpt_routes[$this->_req_action], 'normal', 'high');
2481 2481
 	}
2482 2482
 
2483 2483
 
@@ -2486,10 +2486,10 @@  discard block
 block discarded – undo
2486 2486
 	 * @param  WP_Post $post wp post object
2487 2487
 	 * @return string        attendee contact info ( and form )
2488 2488
 	 */
2489
-	public function attendee_contact_info( $post ) {
2489
+	public function attendee_contact_info($post) {
2490 2490
 		//get attendee object ( should already have it )
2491 2491
 		$this->_template_args['attendee'] = $this->_cpt_model_obj;
2492
-		$template = REG_TEMPLATE_PATH . 'attendee_contact_info_metabox_content.template.php';
2492
+		$template = REG_TEMPLATE_PATH.'attendee_contact_info_metabox_content.template.php';
2493 2493
 		EEH_Template::display_template($template, $this->_template_args);
2494 2494
 	}
2495 2495
 
@@ -2505,12 +2505,12 @@  discard block
 block discarded – undo
2505 2505
 		$this->_template_args['attendee'] = $this->_cpt_model_obj;
2506 2506
 		$this->_template_args['state_html'] = EEH_Form_Fields::generate_form_input(
2507 2507
 				new EE_Question_Form_Input(
2508
-				EE_Question::new_instance( array(
2508
+				EE_Question::new_instance(array(
2509 2509
 					'QST_ID' => 0,
2510 2510
 					'QST_display_text' => __('State/Province', 'event_espresso'),
2511 2511
 					'QST_system' => 'admin-state'
2512 2512
 					)),
2513
-				EE_Answer::new_instance( array(
2513
+				EE_Answer::new_instance(array(
2514 2514
 					'ANS_ID' => 0,
2515 2515
 					'ANS_value' => $this->_cpt_model_obj->state_ID()
2516 2516
 					)),
@@ -2523,12 +2523,12 @@  discard block
 block discarded – undo
2523 2523
 			));
2524 2524
 		$this->_template_args['country_html'] = EEH_Form_Fields::generate_form_input(
2525 2525
 				new EE_Question_Form_Input(
2526
-				EE_Question::new_instance( array(
2526
+				EE_Question::new_instance(array(
2527 2527
 					'QST_ID' => 0,
2528 2528
 					'QST_display_text' => __('Country', 'event_espresso'),
2529 2529
 					'QST_system' => 'admin-country'
2530 2530
 					)),
2531
-				EE_Answer::new_instance( array(
2531
+				EE_Answer::new_instance(array(
2532 2532
 					'ANS_ID' => 0,
2533 2533
 					'ANS_value' => $this->_cpt_model_obj->country_ID()
2534 2534
 					)),
@@ -2539,8 +2539,8 @@  discard block
 block discarded – undo
2539 2539
 					'append_qstn_id' => FALSE
2540 2540
 					)
2541 2541
 				));
2542
-		$template = REG_TEMPLATE_PATH . 'attendee_address_details_metabox_content.template.php';
2543
-		EEH_Template::display_template($template, $this->_template_args );
2542
+		$template = REG_TEMPLATE_PATH.'attendee_address_details_metabox_content.template.php';
2543
+		EEH_Template::display_template($template, $this->_template_args);
2544 2544
 
2545 2545
 	}
2546 2546
 
@@ -2550,11 +2550,11 @@  discard block
 block discarded – undo
2550 2550
 	*		@access protected
2551 2551
 	*		@return void
2552 2552
 	*/
2553
-	public function attendee_registrations_meta_box( $post ) {
2553
+	public function attendee_registrations_meta_box($post) {
2554 2554
 
2555 2555
 		$this->_template_args['attendee'] = $this->_cpt_model_obj;
2556 2556
 		$this->_template_args['registrations'] = $this->_cpt_model_obj->get_many_related('Registration');
2557
-		$template = REG_TEMPLATE_PATH . 'attendee_registrations_main_meta_box.template.php';
2557
+		$template = REG_TEMPLATE_PATH.'attendee_registrations_main_meta_box.template.php';
2558 2558
 		EEH_Template::display_template($template, $this->_template_args);
2559 2559
 
2560 2560
 	}
@@ -2568,8 +2568,8 @@  discard block
 block discarded – undo
2568 2568
 	 * @return string        html for new form.
2569 2569
 	 */
2570 2570
 	public function after_title_form_fields($post) {
2571
-		if ( $post->post_type == 'espresso_attendees' ) {
2572
-			$template = REG_TEMPLATE_PATH . 'attendee_details_after_title_form_fields.template.php';
2571
+		if ($post->post_type == 'espresso_attendees') {
2572
+			$template = REG_TEMPLATE_PATH.'attendee_details_after_title_form_fields.template.php';
2573 2573
 			$template_args['attendee'] = $this->_cpt_model_obj;
2574 2574
 			EEH_Template::display_template($template, $template_args);
2575 2575
 		}
@@ -2586,21 +2586,21 @@  discard block
 block discarded – undo
2586 2586
 	*		@access protected
2587 2587
 	*		@return void
2588 2588
 	*/
2589
-	protected function _trash_or_restore_attendees( $trash = TRUE ) {
2589
+	protected function _trash_or_restore_attendees($trash = TRUE) {
2590 2590
 
2591
-		do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' );
2591
+		do_action('AHEE_log', __FILE__, __FUNCTION__, '');
2592 2592
 
2593 2593
 		$ATT_MDL = EEM_Attendee::instance();
2594 2594
 
2595 2595
 		$success = 1;
2596 2596
 		//Checkboxes
2597
-		if (!empty($this->_req_data['checkbox']) && is_array($this->_req_data['checkbox'])) {
2597
+		if ( ! empty($this->_req_data['checkbox']) && is_array($this->_req_data['checkbox'])) {
2598 2598
 			// if array has more than one element than success message should be plural
2599
-			$success = count( $this->_req_data['checkbox'] ) > 1 ? 2 : 1;
2599
+			$success = count($this->_req_data['checkbox']) > 1 ? 2 : 1;
2600 2600
 			// cycle thru checkboxes
2601
-			while (list( $ATT_ID, $value ) = each($this->_req_data['checkbox'])) {
2602
-				$updated = $trash ? $ATT_MDL->update_by_ID(array( 'status' => 'trash' ), $ATT_ID) : $ATT_MDL->update_by_ID( array('status' => 'publish' ), $ATT_ID);
2603
-				if ( !$updated ) {
2601
+			while (list($ATT_ID, $value) = each($this->_req_data['checkbox'])) {
2602
+				$updated = $trash ? $ATT_MDL->update_by_ID(array('status' => 'trash'), $ATT_ID) : $ATT_MDL->update_by_ID(array('status' => 'publish'), $ATT_ID);
2603
+				if ( ! $updated) {
2604 2604
 					$success = 0;
2605 2605
 				}
2606 2606
 			}
@@ -2609,18 +2609,18 @@  discard block
 block discarded – undo
2609 2609
 			// grab single id and delete
2610 2610
 			$ATT_ID = absint($this->_req_data['ATT_ID']);
2611 2611
 			//get attendee
2612
-			$att = $ATT_MDL->get_one_by_ID( $ATT_ID );
2612
+			$att = $ATT_MDL->get_one_by_ID($ATT_ID);
2613 2613
 			$updated = $trash ? $att->set_status('trash') : $att->set_status('publish');
2614 2614
 			$updated = $att->save();
2615
-			if ( ! $updated ) {
2615
+			if ( ! $updated) {
2616 2616
 				$success = 0;
2617 2617
 			}
2618 2618
 
2619 2619
 		}
2620 2620
 
2621
-		$what = $success > 1 ? __( 'Contacts', 'event_espresso' ) : __( 'Contact', 'event_espresso' );
2622
-		$action_desc = $trash ? __( 'moved to the trash', 'event_espresso' ) : __( 'restored', 'event_espresso' );
2623
-		$this->_redirect_after_action( $success, $what, $action_desc, array( 'action' => 'contact_list' ) );
2621
+		$what = $success > 1 ? __('Contacts', 'event_espresso') : __('Contact', 'event_espresso');
2622
+		$action_desc = $trash ? __('moved to the trash', 'event_espresso') : __('restored', 'event_espresso');
2623
+		$this->_redirect_after_action($success, $what, $action_desc, array('action' => 'contact_list'));
2624 2624
 
2625 2625
 	}
2626 2626
 
Please login to merge, or discard this patch.
admin_pages/transactions/EE_Admin_Transactions_List_Table.class.php 4 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -93,7 +93,7 @@
 block discarded – undo
93 93
 	 *
94 94
 	 * @abstract
95 95
 	 * @access protected
96
-	 * @return array
96
+	 * @return string[]
97 97
 	 */
98 98
 	protected function _get_table_filters() {
99 99
 		$filters = array();
Please login to merge, or discard this patch.
Braces   +8 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,4 +1,6 @@  discard block
 block discarded – undo
1
-<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) exit('No direct script access allowed');
1
+<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) {
2
+	exit('No direct script access allowed');
3
+}
2 4
 /**
3 5
  * Event Espresso
4 6
  *
@@ -244,10 +246,11 @@  discard block
 block discarded – undo
244 246
 	 */
245 247
 	function column_ATT_email( EE_Transaction $item ){
246 248
 		$attendee = $item->primary_registration()->get_first_related('Attendee');
247
-		if ( !empty( $attendee ) )
248
-			return '<a href="mailto:' . $attendee->get('ATT_email') . '">' . $attendee->get('ATT_email') . '</a>';
249
-		else
250
-			return $item->failed() || $item->is_abandoned() ? __('no contact record.', 'event_espresso') : __('No contact record, because the transaction was abandoned or the registration process failed.', 'event_espresso');
249
+		if ( !empty( $attendee ) ) {
250
+					return '<a href="mailto:' . $attendee->get('ATT_email') . '">' . $attendee->get('ATT_email') . '</a>';
251
+		} else {
252
+					return $item->failed() || $item->is_abandoned() ? __('no contact record.', 'event_espresso') : __('No contact record, because the transaction was abandoned or the registration process failed.', 'event_espresso');
253
+		}
251 254
 		;
252 255
 	}
253 256
 
Please login to merge, or discard this patch.
Indentation   +34 added lines, -34 removed lines patch added patch discarded remove patch
@@ -1,26 +1,26 @@  discard block
 block discarded – undo
1 1
 <?php if ( ! defined('EVENT_ESPRESSO_VERSION')) exit('No direct script access allowed');
2 2
 /**
3
- * Event Espresso
4
- *
5
- * Event Registration and Management Plugin for WordPress
6
- *
7
- * @ package	Event Espresso
8
- * @ author		Seth Shoultes
9
- * @ copyright	(c) 2008-2011 Event Espresso  All Rights Reserved.
10
- * @ license	{@link http://eventespresso.com/support/terms-conditions/}   * see Plugin Licensing *
11
- * @ link		{@link http://www.eventespresso.com}
12
- * @ since		4.0
13
- *
14
- * ------------------------------------------------------------------------
15
- *
16
- * Transactions Table class
17
- *
18
- * @package				Event Espresso
19
- * @subpackage			includes/admin_screens/Transactions_List_Table.class.php
20
- * @author					Brent Christensen
21
- *
22
- * ------------------------------------------------------------------------
23
- */
3
+	 * Event Espresso
4
+	 *
5
+	 * Event Registration and Management Plugin for WordPress
6
+	 *
7
+	 * @ package	Event Espresso
8
+	 * @ author		Seth Shoultes
9
+	 * @ copyright	(c) 2008-2011 Event Espresso  All Rights Reserved.
10
+	 * @ license	{@link http://eventespresso.com/support/terms-conditions/}   * see Plugin Licensing *
11
+	 * @ link		{@link http://www.eventespresso.com}
12
+	 * @ since		4.0
13
+	 *
14
+	 * ------------------------------------------------------------------------
15
+	 *
16
+	 * Transactions Table class
17
+	 *
18
+	 * @package				Event Espresso
19
+	 * @subpackage			includes/admin_screens/Transactions_List_Table.class.php
20
+	 * @author					Brent Christensen
21
+	 *
22
+	 * ------------------------------------------------------------------------
23
+	 */
24 24
 
25 25
 
26 26
 class EE_Admin_Transactions_List_Table extends EE_Admin_List_Table {
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
 	 * @return string
141 141
 	 */
142 142
    function column_TXN_ID( EE_Transaction $item ){
143
-    	$view_lnk_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'view_transaction', 'TXN_ID'=>$item->ID() ), TXN_ADMIN_URL );
143
+		$view_lnk_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'view_transaction', 'TXN_ID'=>$item->ID() ), TXN_ADMIN_URL );
144 144
 	   $content = '<a href="' . $view_lnk_url . '" title="' . esc_attr__( 'Go to Transaction Details', 'event_espresso' ) . '">' . $item->ID() . '</a>';
145 145
 
146 146
 	   //txn timestamp
@@ -275,8 +275,8 @@  discard block
 block discarded – undo
275 275
 	 * @param \EE_Transaction $item
276 276
 	 * @return string|void
277 277
 	 */
278
-    function column_event_name( EE_Transaction $item ){
279
-    	$actions = array();
278
+	function column_event_name( EE_Transaction $item ){
279
+		$actions = array();
280 280
 		$event = $item->primary_registration()->get_first_related('Event');
281 281
 		if ( !empty( $event ) ) {
282 282
 			$edit_event_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'edit', 'post'=>$event->ID() ), EVENTS_ADMIN_URL );
@@ -300,21 +300,21 @@  discard block
 block discarded – undo
300 300
 	 * @param \EE_Transaction $item
301 301
 	 * @return string
302 302
 	 */
303
-    function column_actions( EE_Transaction $item ){
303
+	function column_actions( EE_Transaction $item ){
304 304
 
305
-    	$registration = $item->primary_registration();
306
-    	$attendee = $registration->attendee();
305
+		$registration = $item->primary_registration();
306
+		$attendee = $registration->attendee();
307 307
 		EE_Registry::instance()->load_helper( 'MSG_Template' );
308 308
 
309
-        //Build row actions
309
+		//Build row actions
310 310
 		$view_lnk_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'view_transaction', 'TXN_ID'=>$item->ID() ), TXN_ADMIN_URL );
311 311
 		$dl_invoice_lnk_url = $registration->invoice_url();
312 312
 		$dl_receipt_lnk_url = $registration->receipt_url();
313 313
 		$view_reg_lnk_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'view_registration', '_REG_ID'=>$registration->ID() ), REG_ADMIN_URL );
314 314
 		$send_pay_lnk_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'send_payment_reminder', 'TXN_ID'=>$item->ID() ), TXN_ADMIN_URL );
315
-	    $related_messages_link = EEH_MSG_Template::get_message_action_link( 'see_notifications_for', null, array(
316
-		    'TXN_ID' => $item->ID()
317
-	    ));
315
+		$related_messages_link = EEH_MSG_Template::get_message_action_link( 'see_notifications_for', null, array(
316
+			'TXN_ID' => $item->ID()
317
+		));
318 318
 
319 319
 		//Build row actions
320 320
 		$view_lnk = '
@@ -349,8 +349,8 @@  discard block
 block discarded – undo
349 349
 		$dl_receipt_lnk = '';
350 350
 	}
351 351
 
352
-      		//only show payment reminder link if the message type is active.
353
-      		if ( EEH_MSG_Template::is_mt_active( 'payment_reminder' ) ) {
352
+	  		//only show payment reminder link if the message type is active.
353
+	  		if ( EEH_MSG_Template::is_mt_active( 'payment_reminder' ) ) {
354 354
 		$send_pay_lnk = $attendee instanceof EE_Attendee && EE_Registry::instance()->CAP->current_user_can( 'ee_send_message', 'espresso_transactions_send_payment_reminder' ) ? '
355 355
 			<li>
356 356
 				<a href="'.$send_pay_lnk_url.'" title="' . esc_attr__( 'Send Payment Reminder', 'event_espresso' ) . '" class="tiny-text">
@@ -376,7 +376,7 @@  discard block
 block discarded – undo
376 376
 		}
377 377
 
378 378
 		return $this->_action_string( $view_lnk . $dl_invoice_lnk . $dl_receipt_lnk . $view_reg_lnk . $send_pay_lnk . $view_related_messages_lnk, $item, 'ul', 'txn-overview-actions-ul' );
379
-    }
379
+	}
380 380
 
381 381
 
382 382
 }
Please login to merge, or discard this patch.
Spacing   +87 added lines, -87 removed lines patch added patch discarded remove patch
@@ -33,8 +33,8 @@  discard block
 block discarded – undo
33 33
 	 * @param \EE_Admin_Page $admin_page
34 34
 	 * @return EE_Admin_Transactions_List_Table
35 35
 	 */
36
-	function __construct( EE_Admin_Page $admin_page ){
37
-   		parent::__construct( $admin_page );
36
+	function __construct(EE_Admin_Page $admin_page) {
37
+   		parent::__construct($admin_page);
38 38
    		$this->_status = $this->_admin_page->get_transaction_status_array();
39 39
 
40 40
 	}
@@ -44,9 +44,9 @@  discard block
 block discarded – undo
44 44
 
45 45
 
46 46
 	protected function _setup_data() {
47
-		$this->_data = $this->_admin_page->get_transactions( $this->_per_page );
48
-		$status = ! empty( $this->_req_data['status'] )? $this->_req_data['status'] : 'all';
49
-		$this->_all_data_count = $this->_admin_page->get_transactions( $this->_per_page, TRUE, $status );
47
+		$this->_data = $this->_admin_page->get_transactions($this->_per_page);
48
+		$status = ! empty($this->_req_data['status']) ? $this->_req_data['status'] : 'all';
49
+		$this->_all_data_count = $this->_admin_page->get_transactions($this->_per_page, TRUE, $status);
50 50
 	}
51 51
 
52 52
 
@@ -65,20 +65,20 @@  discard block
 block discarded – undo
65 65
 			);
66 66
 
67 67
 		$this->_columns = array(
68
-			'TXN_ID' => __( 'ID', 'event_espresso' ),
69
-			'TXN_timestamp'	=> __( 'Transaction Date', 'event_espresso' ),
70
-			'TXN_total' => __( 'Total', 'event_espresso' ),
71
-			'TXN_paid' => __( 'Paid', 'event_espresso' ),
72
-			'ATT_fname' => __( 'Primary Registrant', 'event_espresso' ),
73
-			'event_name' => __( 'Event', 'event_espresso' ),
74
-			'actions' => __( 'Actions', 'event_espresso' )
68
+			'TXN_ID' => __('ID', 'event_espresso'),
69
+			'TXN_timestamp'	=> __('Transaction Date', 'event_espresso'),
70
+			'TXN_total' => __('Total', 'event_espresso'),
71
+			'TXN_paid' => __('Paid', 'event_espresso'),
72
+			'ATT_fname' => __('Primary Registrant', 'event_espresso'),
73
+			'event_name' => __('Event', 'event_espresso'),
74
+			'actions' => __('Actions', 'event_espresso')
75 75
 		);
76 76
 
77 77
 		$this->_sortable_columns = array(
78
-			'TXN_ID' => array( 'TXN_ID' => FALSE ),
79
-			'event_name' => array( 'event_name'=> FALSE ),
80
-			'ATT_fname'	=> array( 'ATT_fname'=> FALSE ),
81
-			'TXN_timestamp'	=> array( 'TXN_timestamp'=> TRUE ) //true means its already sorted
78
+			'TXN_ID' => array('TXN_ID' => FALSE),
79
+			'event_name' => array('event_name'=> FALSE),
80
+			'ATT_fname'	=> array('ATT_fname'=> FALSE),
81
+			'TXN_timestamp'	=> array('TXN_timestamp'=> TRUE) //true means its already sorted
82 82
 		);
83 83
 
84 84
 		$this->_primary_column = 'TXN_ID';
@@ -88,11 +88,11 @@  discard block
 block discarded – undo
88 88
 
89 89
 
90 90
 
91
-	protected function _get_row_class( $item ) {
92
-		$class = parent::_get_row_class( $item );
91
+	protected function _get_row_class($item) {
92
+		$class = parent::_get_row_class($item);
93 93
 		//add status class
94
-		$class .= ' ee-status-strip txn-status-' . $item->status_ID();
95
-		if ( $this->_has_checkbox_column ) {
94
+		$class .= ' ee-status-strip txn-status-'.$item->status_ID();
95
+		if ($this->_has_checkbox_column) {
96 96
 			$class .= ' has-checkbox-column';
97 97
 		}
98 98
 		return $class;
@@ -109,8 +109,8 @@  discard block
 block discarded – undo
109 109
 	 */
110 110
 	protected function _get_table_filters() {
111 111
 		$filters = array();
112
-		$start_date = isset( $this->_req_data['txn-filter-start-date'] ) ? wp_strip_all_tags( $this->_req_data['txn-filter-start-date'] ) : date( 'm/d/Y', strtotime( '-10 year' ));
113
-		$end_date = isset( $this->_req_data['txn-filter-end-date'] ) ? wp_strip_all_tags( $this->_req_data['txn-filter-end-date'] ) : date( 'm/d/Y' );
112
+		$start_date = isset($this->_req_data['txn-filter-start-date']) ? wp_strip_all_tags($this->_req_data['txn-filter-start-date']) : date('m/d/Y', strtotime('-10 year'));
113
+		$end_date = isset($this->_req_data['txn-filter-end-date']) ? wp_strip_all_tags($this->_req_data['txn-filter-end-date']) : date('m/d/Y');
114 114
 		ob_start();
115 115
 		?>
116 116
 		<label for="txn-filter-start-date">Display Transactions from </label>
@@ -128,9 +128,9 @@  discard block
 block discarded – undo
128 128
 
129 129
 
130 130
 	protected function _add_view_counts() {
131
-		$this->_views['all']['count'] = $this->_admin_page->get_transactions( $this->_per_page, TRUE, 'all' );
132
-		$this->_views['abandoned']['count'] = $this->_admin_page->get_transactions( $this->_per_page, TRUE, 'abandoned' );
133
-		$this->_views['failed']['count'] = $this->_admin_page->get_transactions( $this->_per_page, TRUE, 'failed' );
131
+		$this->_views['all']['count'] = $this->_admin_page->get_transactions($this->_per_page, TRUE, 'all');
132
+		$this->_views['abandoned']['count'] = $this->_admin_page->get_transactions($this->_per_page, TRUE, 'abandoned');
133
+		$this->_views['failed']['count'] = $this->_admin_page->get_transactions($this->_per_page, TRUE, 'failed');
134 134
 	}
135 135
 
136 136
 
@@ -139,29 +139,29 @@  discard block
 block discarded – undo
139 139
 	 * @param \EE_Transaction $item
140 140
 	 * @return string
141 141
 	 */
142
-   function column_TXN_ID( EE_Transaction $item ){
143
-    	$view_lnk_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'view_transaction', 'TXN_ID'=>$item->ID() ), TXN_ADMIN_URL );
144
-	   $content = '<a href="' . $view_lnk_url . '" title="' . esc_attr__( 'Go to Transaction Details', 'event_espresso' ) . '">' . $item->ID() . '</a>';
142
+   function column_TXN_ID(EE_Transaction $item) {
143
+    	$view_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'view_transaction', 'TXN_ID'=>$item->ID()), TXN_ADMIN_URL);
144
+	   $content = '<a href="'.$view_lnk_url.'" title="'.esc_attr__('Go to Transaction Details', 'event_espresso').'">'.$item->ID().'</a>';
145 145
 
146 146
 	   //txn timestamp
147
-	   $content .= '  <span class="show-on-mobile-view-only">' . $this->_get_txn_timestamp( $item ) . '</span>';
147
+	   $content .= '  <span class="show-on-mobile-view-only">'.$this->_get_txn_timestamp($item).'</span>';
148 148
 	   return $content;
149 149
 	}
150 150
 
151 151
 
152 152
 
153
-	protected function _get_txn_timestamp( EE_Transaction $item ) {
153
+	protected function _get_txn_timestamp(EE_Transaction $item) {
154 154
 		//txn timestamp
155 155
 		// is TXN less than 2 hours old ?
156 156
 		if (
157
-			( ( time() - EE_Registry::instance()->SSN->lifespan() )
158
-			< $item->datetime( false, true )
157
+			((time() - EE_Registry::instance()->SSN->lifespan())
158
+			< $item->datetime(false, true)
159 159
 			)
160
-		&& ( $item->failed() || $item->is_abandoned() )
160
+		&& ($item->failed() || $item->is_abandoned())
161 161
 		) {
162
-			$timestamp = __( 'TXN in progress...', 'event_espresso' );
162
+			$timestamp = __('TXN in progress...', 'event_espresso');
163 163
 	   } else {
164
-			$timestamp = $item->get_i18n_datetime( 'TXN_timestamp' );
164
+			$timestamp = $item->get_i18n_datetime('TXN_timestamp');
165 165
 		}
166 166
 		return $timestamp;
167 167
 	}
@@ -173,8 +173,8 @@  discard block
 block discarded – undo
173 173
 	 * @param \EE_Transaction $item
174 174
 	 * @return string
175 175
 	 */
176
-	function column_cb($item ){
177
-		return sprintf( '<input type="checkbox" name="%1$s[]" value="%2$s" />', $this->_wp_list_args['singular'],  $item->ID());
176
+	function column_cb($item) {
177
+		return sprintf('<input type="checkbox" name="%1$s[]" value="%2$s" />', $this->_wp_list_args['singular'], $item->ID());
178 178
 	}
179 179
 
180 180
 
@@ -185,11 +185,11 @@  discard block
 block discarded – undo
185 185
 	 * @param \EE_Transaction $item
186 186
 	 * @return string
187 187
 	 */
188
-	function column_TXN_timestamp( EE_Transaction $item ){
189
-		$view_lnk_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'view_transaction', 'TXN_ID'=>$item->ID() ), TXN_ADMIN_URL );
190
-		$txn_date = '<a href="'.$view_lnk_url.'" title="' . esc_attr__( 'View Transaction Details for TXN #', 'event_espresso' ) . $item->ID() . '">' . $this->_get_txn_timestamp( $item ) . '</a>';
188
+	function column_TXN_timestamp(EE_Transaction $item) {
189
+		$view_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'view_transaction', 'TXN_ID'=>$item->ID()), TXN_ADMIN_URL);
190
+		$txn_date = '<a href="'.$view_lnk_url.'" title="'.esc_attr__('View Transaction Details for TXN #', 'event_espresso').$item->ID().'">'.$this->_get_txn_timestamp($item).'</a>';
191 191
 		//status
192
-		$txn_date .= '<br><span class="ee-status-text-small">' . EEH_Template::pretty_status( $item->status_ID(), false, 'sentence' ) . '</span>';
192
+		$txn_date .= '<br><span class="ee-status-text-small">'.EEH_Template::pretty_status($item->status_ID(), false, 'sentence').'</span>';
193 193
 		return $txn_date;
194 194
 	}
195 195
 
@@ -199,11 +199,11 @@  discard block
 block discarded – undo
199 199
 	 * @param \EE_Transaction $item
200 200
 	 * @return string
201 201
 	 */
202
-	function column_TXN_total( EE_Transaction $item ){
203
-		if ( $item->get('TXN_total') > 0 ) {
204
-			return '<span class="txn-pad-rght">' . apply_filters( 'FHEE__EE_Admin_Transactions_List_Table__column_TXN_total__TXN_total', $item->get_pretty('TXN_total'), $item ) . '</span>';
202
+	function column_TXN_total(EE_Transaction $item) {
203
+		if ($item->get('TXN_total') > 0) {
204
+			return '<span class="txn-pad-rght">'.apply_filters('FHEE__EE_Admin_Transactions_List_Table__column_TXN_total__TXN_total', $item->get_pretty('TXN_total'), $item).'</span>';
205 205
 		} else {
206
-			return '<span class="txn-overview-free-event-spn">' . __( 'free', 'event_espresso' ) . '</span>';
206
+			return '<span class="txn-overview-free-event-spn">'.__('free', 'event_espresso').'</span>';
207 207
 		}
208 208
 	}
209 209
 
@@ -213,19 +213,19 @@  discard block
 block discarded – undo
213 213
 	 * @param \EE_Transaction $item
214 214
 	 * @return mixed|string
215 215
 	 */
216
-	function column_TXN_paid( EE_Transaction $item ){
216
+	function column_TXN_paid(EE_Transaction $item) {
217 217
 		$transaction_total = $item->get('TXN_total');
218 218
 		$transaction_paid = $item->get('TXN_paid');
219 219
 
220
-		if (( $transaction_total > 0 ) && ( $transaction_paid >= $transaction_total )) {
220
+		if (($transaction_total > 0) && ($transaction_paid >= $transaction_total)) {
221 221
 			// paid in full
222 222
 			$span_class = 'txn-overview-full-payment-spn';
223 223
 
224
-		} elseif (( $transaction_total > 0 ) && ( $transaction_paid > 0 )) {
224
+		} elseif (($transaction_total > 0) && ($transaction_paid > 0)) {
225 225
 			// monies owing
226 226
 			$span_class = 'txn-overview-part-payment-spn';
227 227
 
228
-		} elseif (( $transaction_total > 0 ) && ( $transaction_paid == 0 )) {
228
+		} elseif (($transaction_total > 0) && ($transaction_paid == 0)) {
229 229
 			// no payments made
230 230
 			$span_class = 'txn-overview-no-payment-spn';
231 231
 
@@ -235,11 +235,11 @@  discard block
 block discarded – undo
235 235
 		}
236 236
 
237 237
 		$payment_method = $item->payment_method();
238
-		$payment_method_name = $payment_method instanceof EE_Payment_Method ? $payment_method->admin_name() : __( 'Unknown', 'event_espresso' );
238
+		$payment_method_name = $payment_method instanceof EE_Payment_Method ? $payment_method->admin_name() : __('Unknown', 'event_espresso');
239 239
 
240
-		$content = '<span class="' . $span_class . ' txn-pad-rght">' . $transaction_paid !== 0 ? $item->get_pretty('TXN_paid') : $transaction_paid . '</span>';
241
-		if ( $transaction_paid > 0 ) {
242
-			$content .= '<br><span class="ee-status-text-small">' . sprintf( __( '...via %s', 'event_espresso' ), $payment_method_name ) . '</span>';
240
+		$content = '<span class="'.$span_class.' txn-pad-rght">'.$transaction_paid !== 0 ? $item->get_pretty('TXN_paid') : $transaction_paid.'</span>';
241
+		if ($transaction_paid > 0) {
242
+			$content .= '<br><span class="ee-status-text-small">'.sprintf(__('...via %s', 'event_espresso'), $payment_method_name).'</span>';
243 243
 		}
244 244
 		return $content;
245 245
 	}
@@ -250,13 +250,13 @@  discard block
 block discarded – undo
250 250
 	 * @param \EE_Transaction $item
251 251
 	 * @return string|void
252 252
 	 */
253
-	function column_ATT_fname( EE_Transaction $item ){
253
+	function column_ATT_fname(EE_Transaction $item) {
254 254
 		$primary_reg = $item->primary_registration();
255 255
 		$attendee = $primary_reg->get_first_related('Attendee');
256
-		if ( $attendee instanceof EE_Attendee ) {
257
-			$edit_lnk_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'view_registration', '_REG_ID'=>$primary_reg->ID() ), REG_ADMIN_URL );
258
-			$content = EE_Registry::instance()->CAP->current_user_can( 'ee_read_registration', 'espresso_registrations_view_registration', $primary_reg->ID() ) ? '<a href="'.$edit_lnk_url.'" title="' . esc_attr__( 'View Registration Details', 'event_espresso' ) . '">' . $attendee->full_name() . '</a>' : $attendee->full_name();
259
-			$content .= '<br>' . $attendee->email();
256
+		if ($attendee instanceof EE_Attendee) {
257
+			$edit_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'view_registration', '_REG_ID'=>$primary_reg->ID()), REG_ADMIN_URL);
258
+			$content = EE_Registry::instance()->CAP->current_user_can('ee_read_registration', 'espresso_registrations_view_registration', $primary_reg->ID()) ? '<a href="'.$edit_lnk_url.'" title="'.esc_attr__('View Registration Details', 'event_espresso').'">'.$attendee->full_name().'</a>' : $attendee->full_name();
259
+			$content .= '<br>'.$attendee->email();
260 260
 			return $content;
261 261
 		}
262 262
 		return $item->failed() || $item->is_abandoned() ? __('no contact record.', 'event_espresso') : __('No contact record, because the transaction was abandoned or the registration process failed.', 'event_espresso');
@@ -268,10 +268,10 @@  discard block
 block discarded – undo
268 268
 	 * @param \EE_Transaction $item
269 269
 	 * @return string|void
270 270
 	 */
271
-	function column_ATT_email( EE_Transaction $item ){
271
+	function column_ATT_email(EE_Transaction $item) {
272 272
 		$attendee = $item->primary_registration()->get_first_related('Attendee');
273
-		if ( !empty( $attendee ) )
274
-			return '<a href="mailto:' . $attendee->get('ATT_email') . '">' . $attendee->get('ATT_email') . '</a>';
273
+		if ( ! empty($attendee))
274
+			return '<a href="mailto:'.$attendee->get('ATT_email').'">'.$attendee->get('ATT_email').'</a>';
275 275
 		else
276 276
 			return $item->failed() || $item->is_abandoned() ? __('no contact record.', 'event_espresso') : __('No contact record, because the transaction was abandoned or the registration process failed.', 'event_espresso');
277 277
 		;
@@ -283,20 +283,20 @@  discard block
 block discarded – undo
283 283
 	 * @param \EE_Transaction $item
284 284
 	 * @return string|void
285 285
 	 */
286
-    function column_event_name( EE_Transaction $item ){
286
+    function column_event_name(EE_Transaction $item) {
287 287
     	$actions = array();
288 288
 		$event = $item->primary_registration()->get_first_related('Event');
289
-		if ( !empty( $event ) ) {
290
-			$edit_event_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'edit', 'post'=>$event->ID() ), EVENTS_ADMIN_URL );
289
+		if ( ! empty($event)) {
290
+			$edit_event_url = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'edit', 'post'=>$event->ID()), EVENTS_ADMIN_URL);
291 291
 			$event_name = $event->get('EVT_name');
292 292
 
293 293
 			//filter this view by transactions for this event
294
-			$txn_by_event_lnk = EE_Admin_Page::add_query_args_and_nonce( array( 'action' => 'default', 'EVT_ID' => $event->ID() ) );
295
-			if ( EE_Registry::instance()->CAP->current_user_can( 'ee_edit_event', 'espresso_events_edit', $event->ID() ) ) {
296
-				$actions['filter_by_event'] = '<a href="' . $txn_by_event_lnk . '" title="' . esc_attr__('Filter transactions by this event', 'event_espresso') . '">' . __('View Transactions for this event', 'event_espresso') . '</a>';
294
+			$txn_by_event_lnk = EE_Admin_Page::add_query_args_and_nonce(array('action' => 'default', 'EVT_ID' => $event->ID()));
295
+			if (EE_Registry::instance()->CAP->current_user_can('ee_edit_event', 'espresso_events_edit', $event->ID())) {
296
+				$actions['filter_by_event'] = '<a href="'.$txn_by_event_lnk.'" title="'.esc_attr__('Filter transactions by this event', 'event_espresso').'">'.__('View Transactions for this event', 'event_espresso').'</a>';
297 297
 			}
298 298
 
299
-			return sprintf('%1$s %2$s', EE_Registry::instance()->CAP->current_user_can( 'ee_edit_event', 'espresso_events_edit', $event->ID() ) ? '<a href="' . $edit_event_url . '" title="' . sprintf( esc_attr__( 'Edit Event: %s', 'event_espresso' ), $event->get('EVT_name') ) .'">' .  wp_trim_words( $event_name, 30, '...' ) . '</a>' : wp_trim_words( $event_name, 30, '...' ), $this->row_actions($actions) );
299
+			return sprintf('%1$s %2$s', EE_Registry::instance()->CAP->current_user_can('ee_edit_event', 'espresso_events_edit', $event->ID()) ? '<a href="'.$edit_event_url.'" title="'.sprintf(esc_attr__('Edit Event: %s', 'event_espresso'), $event->get('EVT_name')).'">'.wp_trim_words($event_name, 30, '...').'</a>' : wp_trim_words($event_name, 30, '...'), $this->row_actions($actions));
300 300
 		} else {
301 301
 			return __('The event associated with this transaction via the primary registration cannot be retrieved.', 'event_espresso');
302 302
 		}
@@ -308,36 +308,36 @@  discard block
 block discarded – undo
308 308
 	 * @param \EE_Transaction $item
309 309
 	 * @return string
310 310
 	 */
311
-    function column_actions( EE_Transaction $item ){
311
+    function column_actions(EE_Transaction $item) {
312 312
 
313 313
     	$registration = $item->primary_registration();
314 314
     	$attendee = $registration->attendee();
315
-		EE_Registry::instance()->load_helper( 'MSG_Template' );
315
+		EE_Registry::instance()->load_helper('MSG_Template');
316 316
 
317 317
         //Build row actions
318
-		$view_lnk_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'view_transaction', 'TXN_ID'=>$item->ID() ), TXN_ADMIN_URL );
318
+		$view_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'view_transaction', 'TXN_ID'=>$item->ID()), TXN_ADMIN_URL);
319 319
 		$dl_invoice_lnk_url = $registration->invoice_url();
320 320
 		$dl_receipt_lnk_url = $registration->receipt_url();
321
-		$view_reg_lnk_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'view_registration', '_REG_ID'=>$registration->ID() ), REG_ADMIN_URL );
322
-		$send_pay_lnk_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'send_payment_reminder', 'TXN_ID'=>$item->ID() ), TXN_ADMIN_URL );
323
-	    $related_messages_link = EEH_MSG_Template::get_message_action_link( 'see_notifications_for', null, array(
321
+		$view_reg_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'view_registration', '_REG_ID'=>$registration->ID()), REG_ADMIN_URL);
322
+		$send_pay_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'send_payment_reminder', 'TXN_ID'=>$item->ID()), TXN_ADMIN_URL);
323
+	    $related_messages_link = EEH_MSG_Template::get_message_action_link('see_notifications_for', null, array(
324 324
 		    'TXN_ID' => $item->ID()
325 325
 	    ));
326 326
 
327 327
 		//Build row actions
328 328
 		$view_lnk = '
329 329
 			<li>
330
-				<a href="'.$view_lnk_url.'" title="' . esc_attr__( 'View Transaction Details', 'event_espresso' ) . '" class="tiny-text">
330
+				<a href="'.$view_lnk_url.'" title="'.esc_attr__('View Transaction Details', 'event_espresso').'" class="tiny-text">
331 331
 					<span class="dashicons dashicons-cart"></span>
332 332
 				</a>
333 333
 			</li>';
334 334
 
335 335
 
336 336
 	//only show invoice link if message type is active.
337
-	if ( $attendee instanceof EE_Attendee && EEH_MSG_Template::is_mt_active( 'invoice' ) ) {
337
+	if ($attendee instanceof EE_Attendee && EEH_MSG_Template::is_mt_active('invoice')) {
338 338
 		$dl_invoice_lnk = '
339 339
 		<li>
340
-			<a title="' . esc_attr__( 'View Transaction Invoice', 'event_espresso' ) . '" target="_blank" href="'.$dl_invoice_lnk_url.'" class="tiny-text">
340
+			<a title="' . esc_attr__('View Transaction Invoice', 'event_espresso').'" target="_blank" href="'.$dl_invoice_lnk_url.'" class="tiny-text">
341 341
 				<span class="dashicons dashicons-media-spreadsheet ee-icon-size-18"></span>
342 342
 			</a>
343 343
 		</li>';
@@ -346,10 +346,10 @@  discard block
 block discarded – undo
346 346
 	}
347 347
 
348 348
 	//only show receipt link if message type is active.
349
-	if ( $attendee instanceof EE_Attendee && EEH_MSG_Template::is_mt_active( 'receipt' ) ) {
349
+	if ($attendee instanceof EE_Attendee && EEH_MSG_Template::is_mt_active('receipt')) {
350 350
 		$dl_receipt_lnk = '
351 351
 		<li>
352
-			<a title="' . esc_attr__( 'View Transaction Receipt', 'event_espresso' ) . '" target="_blank" href="'.$dl_receipt_lnk_url.'" class="tiny-text">
352
+			<a title="' . esc_attr__('View Transaction Receipt', 'event_espresso').'" target="_blank" href="'.$dl_receipt_lnk_url.'" class="tiny-text">
353 353
 				<span class="dashicons dashicons-media-default ee-icon-size-18"></span>
354 354
 			</a>
355 355
 		</li>';
@@ -358,10 +358,10 @@  discard block
 block discarded – undo
358 358
 	}
359 359
 
360 360
       		//only show payment reminder link if the message type is active.
361
-      		if ( EEH_MSG_Template::is_mt_active( 'payment_reminder' ) ) {
362
-		$send_pay_lnk = $attendee instanceof EE_Attendee && EE_Registry::instance()->CAP->current_user_can( 'ee_send_message', 'espresso_transactions_send_payment_reminder' ) ? '
361
+      		if (EEH_MSG_Template::is_mt_active('payment_reminder')) {
362
+		$send_pay_lnk = $attendee instanceof EE_Attendee && EE_Registry::instance()->CAP->current_user_can('ee_send_message', 'espresso_transactions_send_payment_reminder') ? '
363 363
 			<li>
364
-				<a href="'.$send_pay_lnk_url.'" title="' . esc_attr__( 'Send Payment Reminder', 'event_espresso' ) . '" class="tiny-text">
364
+				<a href="'.$send_pay_lnk_url.'" title="'.esc_attr__('Send Payment Reminder', 'event_espresso').'" class="tiny-text">
365 365
 					<span class="dashicons dashicons-email-alt"></span>
366 366
 				</a>
367 367
 			</li>' : '';
@@ -370,20 +370,20 @@  discard block
 block discarded – undo
370 370
 			$send_pay_lnk = '';
371 371
 		}
372 372
 
373
-		$view_reg_lnk = EE_Registry::instance()->CAP->current_user_can( 'ee_read_registration', 'espresso_registrations_view_registration', $registration->ID() ) ? '
373
+		$view_reg_lnk = EE_Registry::instance()->CAP->current_user_can('ee_read_registration', 'espresso_registrations_view_registration', $registration->ID()) ? '
374 374
 			<li>
375
-				<a href="'.$view_reg_lnk_url.'" title="' . esc_attr__( 'View Registration Details', 'event_espresso' ) . '" class="tiny-text">
375
+				<a href="'.$view_reg_lnk_url.'" title="'.esc_attr__('View Registration Details', 'event_espresso').'" class="tiny-text">
376 376
 					<span class="dashicons dashicons-clipboard"></span>
377 377
 				</a>
378 378
 			</li>' : '';
379 379
 
380
-		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_read_messages', 'view_filtered_messages' ) ) {
381
-			$view_related_messages_lnk = '<li>' . $related_messages_link . '</li>';
380
+		if (EE_Registry::instance()->CAP->current_user_can('ee_read_messages', 'view_filtered_messages')) {
381
+			$view_related_messages_lnk = '<li>'.$related_messages_link.'</li>';
382 382
 		} else {
383 383
 			$view_related_messages_lnk = '';
384 384
 		}
385 385
 
386
-		return $this->_action_string( $view_lnk . $dl_invoice_lnk . $dl_receipt_lnk . $view_reg_lnk . $send_pay_lnk . $view_related_messages_lnk, $item, 'ul', 'txn-overview-actions-ul' );
386
+		return $this->_action_string($view_lnk.$dl_invoice_lnk.$dl_receipt_lnk.$view_reg_lnk.$send_pay_lnk.$view_related_messages_lnk, $item, 'ul', 'txn-overview-actions-ul');
387 387
     }
388 388
 
389 389
 
Please login to merge, or discard this patch.
admin/extend/registrations/Extend_Registrations_Admin_Page.core.php 4 patches
Doc Comments   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -478,7 +478,7 @@  discard block
 block discarded – undo
478 478
 	/**
479 479
 	 * 		generates Business Report showing total registratiopns per day
480 480
 	*		@access private
481
-	*		@return void
481
+	*		@return string
482 482
 	*/
483 483
 	private function _registrations_per_day_report( $period = '-1 month' ) {
484 484
 
@@ -535,7 +535,7 @@  discard block
 block discarded – undo
535 535
 	/**
536 536
 	 * 		generates Business Report showing total registratiopns per event
537 537
 	*		@access private
538
-	*		@return void
538
+	*		@return string
539 539
 	*/
540 540
 	private function _get_registrations_per_event_report( $period = '-1 month' ) {
541 541
 
@@ -650,8 +650,6 @@  discard block
 block discarded – undo
650 650
 	/**
651 651
 	 * 		handles toggleing the checkin status for the registration,
652 652
 	*		@access protected
653
-	*		@param boolean 	$check_in
654
-	*		@return void
655 653
 	*/
656 654
 	protected function _toggle_checkin_status() {
657 655
 		//first let's get the query args out of the way for the redirect
Please login to merge, or discard this patch.
Indentation   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -447,9 +447,9 @@  discard block
 block discarded – undo
447 447
 
448 448
 	/**
449 449
 	 * 		generates Business Reports regarding Registrations
450
-	*		@access protected
451
-	*		@return void
452
-	*/
450
+	 *		@access protected
451
+	 *		@return void
452
+	 */
453 453
 	protected function _registration_reports() {
454 454
 
455 455
 		do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' );
@@ -477,9 +477,9 @@  discard block
 block discarded – undo
477 477
 
478 478
 	/**
479 479
 	 * 		generates Business Report showing total registratiopns per day
480
-	*		@access private
481
-	*		@return void
482
-	*/
480
+	 *		@access private
481
+	 *		@return void
482
+	 */
483 483
 	private function _registrations_per_day_report( $period = '-1 month' ) {
484 484
 
485 485
 		$report_ID = 'reg-admin-registrations-per-day-report-dv';
@@ -534,9 +534,9 @@  discard block
 block discarded – undo
534 534
 
535 535
 	/**
536 536
 	 * 		generates Business Report showing total registratiopns per event
537
-	*		@access private
538
-	*		@return void
539
-	*/
537
+	 *		@access private
538
+	 *		@return void
539
+	 */
540 540
 	private function _get_registrations_per_event_report( $period = '-1 month' ) {
541 541
 
542 542
 		$report_ID = 'reg-admin-registrations-per-event-report-dv';
@@ -649,10 +649,10 @@  discard block
 block discarded – undo
649 649
 
650 650
 	/**
651 651
 	 * 		handles toggleing the checkin status for the registration,
652
-	*		@access protected
653
-	*		@param boolean 	$check_in
654
-	*		@return void
655
-	*/
652
+	 *		@access protected
653
+	 *		@param boolean 	$check_in
654
+	 *		@return void
655
+	 */
656 656
 	protected function _toggle_checkin_status() {
657 657
 		//first let's get the query args out of the way for the redirect
658 658
 		$query_args = array(
@@ -773,9 +773,9 @@  discard block
 block discarded – undo
773 773
 
774 774
 	/**
775 775
 	 * 		generates HTML for the Event Registrations List Table
776
-	*		@access protected
777
-	*		@return void
778
-	*/
776
+	 *		@access protected
777
+	 *		@return void
778
+	 */
779 779
 	protected function _event_registrations_list_table() {
780 780
 		do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' );
781 781
 		$this->_admin_page_title .= isset( $this->_req_data['event_id'] ) ? $this->get_action_link_or_button('new_registration', 'add-registrant', array('event_id' => $this->_req_data['event_id']), 'add-new-h2') : '';
@@ -805,11 +805,11 @@  discard block
 block discarded – undo
805 805
 				'class' => 'ee-status-legend ee-status-legend-' . EEM_Registration::status_id_approved,
806 806
 				'desc' => EEH_Template::pretty_status( EEM_Registration::status_id_approved, FALSE, 'sentence' )
807 807
 				),
808
-            'cancelled_status' => array(
808
+			'cancelled_status' => array(
809 809
 				'class' => 'ee-status-legend ee-status-legend-' . EEM_Registration::status_id_cancelled,
810 810
 				'desc' => EEH_Template::pretty_status( EEM_Registration::status_id_cancelled, FALSE, 'sentence' )
811 811
 				),
812
-            'declined_status' => array(
812
+			'declined_status' => array(
813 813
 				'class' => 'ee-status-legend ee-status-legend-' . EEM_Registration::status_id_declined,
814 814
 				'desc' => EEH_Template::pretty_status( EEM_Registration::status_id_declined, FALSE, 'sentence' )
815 815
 				),
@@ -837,9 +837,9 @@  discard block
 block discarded – undo
837 837
 	/**
838 838
 	 * 		get_attendees
839 839
 	 * 		@param bool $count whether to return count or data.
840
-	*		@access public
841
-	*		@return array
842
-	*/
840
+	 *		@access public
841
+	 *		@return array
842
+	 */
843 843
 	public function get_event_attendees( $per_page = 10, $count = FALSE, $trash = FALSE, $orderby = '' ) {
844 844
 
845 845
 		do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' );
Please login to merge, or discard this patch.
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1,6 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if (!defined('EVENT_ESPRESSO_VERSION') )
2
+if (!defined('EVENT_ESPRESSO_VERSION') ) {
3 3
 	exit('NO direct script access allowed');
4
+}
4 5
 
5 6
 /**
6 7
  * Event Espresso
@@ -679,8 +680,9 @@  discard block
 block discarded – undo
679 680
 			EE_Error::add_error(__('Missing some required data to toggle the Check-in', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__  );
680 681
 		}
681 682
 
682
-		if ( defined('DOING_AJAX' ) )
683
-			return $new_status;
683
+		if ( defined('DOING_AJAX' ) ) {
684
+					return $new_status;
685
+		}
684 686
 
685 687
 		$this->_redirect_after_action( FALSE,'', '', $query_args, TRUE );
686 688
 
@@ -918,7 +920,7 @@  discard block
 block discarded – undo
918 920
 		$query_params['force_join'] = array('Attendee');//force join to attendee model so that it gets cached, because we're going to need the attendee for each registration
919 921
 		if($count){
920 922
 			$registrations = EEM_Registration::instance()->count(array($query_params[0]));
921
-		}else{
923
+		} else{
922 924
 			$registrations = EEM_Registration::instance()->get_all($query_params);
923 925
 
924 926
 
Please login to merge, or discard this patch.
Spacing   +217 added lines, -217 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if (!defined('EVENT_ESPRESSO_VERSION') )
2
+if ( ! defined('EVENT_ESPRESSO_VERSION'))
3 3
 	exit('NO direct script access allowed');
4 4
 
5 5
 /**
@@ -29,11 +29,11 @@  discard block
 block discarded – undo
29 29
  */
30 30
 class Extend_Registrations_Admin_Page extends Registrations_Admin_Page {
31 31
 
32
-	public function __construct( $routing = TRUE ) {
33
-		parent::__construct( $routing );
34
-		define( 'REG_CAF_TEMPLATE_PATH', EE_CORE_CAF_ADMIN_EXTEND . 'registrations/templates/');
35
-		define( 'REG_CAF_ASSETS', EE_CORE_CAF_ADMIN_EXTEND . 'registrations/assets/');
36
-		define( 'REG_CAF_ASSETS_URL', EE_CORE_CAF_ADMIN_EXTEND_URL . 'registrations/assets/');
32
+	public function __construct($routing = TRUE) {
33
+		parent::__construct($routing);
34
+		define('REG_CAF_TEMPLATE_PATH', EE_CORE_CAF_ADMIN_EXTEND.'registrations/templates/');
35
+		define('REG_CAF_ASSETS', EE_CORE_CAF_ADMIN_EXTEND.'registrations/assets/');
36
+		define('REG_CAF_ASSETS_URL', EE_CORE_CAF_ADMIN_EXTEND_URL.'registrations/assets/');
37 37
 	}
38 38
 
39 39
 
@@ -42,11 +42,11 @@  discard block
 block discarded – undo
42 42
 
43 43
 
44 44
 	protected function _extend_page_config() {
45
-		$this->_admin_base_path = EE_CORE_CAF_ADMIN_EXTEND . 'registrations';
45
+		$this->_admin_base_path = EE_CORE_CAF_ADMIN_EXTEND.'registrations';
46 46
 
47
-		$reg_id = ! empty( $this->_req_data['_REG_ID'] ) && ! is_array( $this->_req_data['_REG_ID'] ) ? $this->_req_data['_REG_ID'] : 0;
48
-		$att_id = ! empty( $this->_req_data[ 'ATT_ID' ] ) ? ! is_array( $this->_req_data['ATT_ID'] ) : 0;
49
-		$att_id = ! empty( $this->_req_data['post'] ) && ! is_array( $this->_req_data['post'] ) ? $this->_req_data['post'] : $att_id;
47
+		$reg_id = ! empty($this->_req_data['_REG_ID']) && ! is_array($this->_req_data['_REG_ID']) ? $this->_req_data['_REG_ID'] : 0;
48
+		$att_id = ! empty($this->_req_data['ATT_ID']) ? ! is_array($this->_req_data['ATT_ID']) : 0;
49
+		$att_id = ! empty($this->_req_data['post']) && ! is_array($this->_req_data['post']) ? $this->_req_data['post'] : $att_id;
50 50
 
51 51
 		$new_page_routes = array(
52 52
 			'reports' => array(
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
 				)
86 86
 			);
87 87
 
88
-		$this->_page_routes = array_merge( $this->_page_routes, $new_page_routes );
88
+		$this->_page_routes = array_merge($this->_page_routes, $new_page_routes);
89 89
 
90 90
 		$new_page_config = array(
91 91
 			'reports' => array(
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
 						'filename' => 'registrations_reports'
100 100
 						)
101 101
 					),
102
-				'help_tour' => array( 'Registration_Reports_Help_Tour' ),
102
+				'help_tour' => array('Registration_Reports_Help_Tour'),
103 103
 				'require_nonce' => FALSE
104 104
 				),
105 105
 			'event_registrations' => array(
@@ -130,8 +130,8 @@  discard block
 block discarded – undo
130 130
 						'filename' => 'registrations_event_checkin_other'
131 131
 					)
132 132
 				),
133
-				'help_tour' => array( 'Event_Checkin_Help_Tour' ),
134
-				'qtips' => array('Registration_List_Table_Tips' ),
133
+				'help_tour' => array('Event_Checkin_Help_Tour'),
134
+				'qtips' => array('Registration_List_Table_Tips'),
135 135
 				'list_table' => 'EE_Event_Registrations_List_Table',
136 136
 				'metaboxes' => array(),
137 137
 				'require_nonce' => FALSE
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
 		// var_dump($this->_req_data);
153 153
 		// exit();
154 154
 
155
-		$this->_page_config = array_merge( $this->_page_config, $new_page_config );
155
+		$this->_page_config = array_merge($this->_page_config, $new_page_config);
156 156
 		$this->_page_config['contact_list']['list_table'] = 'Extend_EE_Attendee_Contact_List_Table';
157 157
 		$this->_page_config['default']['list_table'] = 'Extend_EE_Registrations_List_Table';
158 158
 	}
@@ -161,7 +161,7 @@  discard block
 block discarded – undo
161 161
 
162 162
 	protected function _ajax_hooks() {
163 163
 		parent::_ajax_hooks();
164
-		add_action('wp_ajax_get_newsletter_form_content', array( $this, 'get_newsletter_form_content') );
164
+		add_action('wp_ajax_get_newsletter_form_content', array($this, 'get_newsletter_form_content'));
165 165
 	}
166 166
 
167 167
 
@@ -171,12 +171,12 @@  discard block
 block discarded – undo
171 171
 
172 172
 		//if newsletter message type is active then let's add filter and load js for it.
173 173
 		EE_Registry::instance()->load_helper('MSG_Template');
174
-		if ( EEH_MSG_Template::is_mt_active('newsletter') ) {
174
+		if (EEH_MSG_Template::is_mt_active('newsletter')) {
175 175
 			//enqueue newsletter js
176
-			wp_enqueue_script( 'ee-newsletter-trigger', REG_CAF_ASSETS_URL . 'ee-newsletter-trigger.js', array( 'ee-dialog'), EVENT_ESPRESSO_VERSION, TRUE );
177
-			wp_enqueue_style( 'ee-newsletter-trigger-css', REG_CAF_ASSETS_URL . 'ee-newsletter-trigger.css', array(), EVENT_ESPRESSO_VERSION );
176
+			wp_enqueue_script('ee-newsletter-trigger', REG_CAF_ASSETS_URL.'ee-newsletter-trigger.js', array('ee-dialog'), EVENT_ESPRESSO_VERSION, TRUE);
177
+			wp_enqueue_style('ee-newsletter-trigger-css', REG_CAF_ASSETS_URL.'ee-newsletter-trigger.css', array(), EVENT_ESPRESSO_VERSION);
178 178
 			//hook in buttons for newsletter message type trigger.
179
-			add_action('AHEE__EE_Admin_List_Table__extra_tablenav__after_bottom_buttons', array( $this, 'add_newsletter_action_buttons'), 10 );
179
+			add_action('AHEE__EE_Admin_List_Table__extra_tablenav__after_bottom_buttons', array($this, 'add_newsletter_action_buttons'), 10);
180 180
 		}
181 181
 	}
182 182
 
@@ -188,12 +188,12 @@  discard block
 block discarded – undo
188 188
 
189 189
 		//scripts
190 190
 		global $is_IE;
191
-		if ( $is_IE ) {
192
-			wp_enqueue_script( 'excanvas' );
191
+		if ($is_IE) {
192
+			wp_enqueue_script('excanvas');
193 193
 		}
194 194
 
195
-		wp_register_script('espresso_reg_admin_regs_per_day', REG_CAF_ASSETS_URL  . 'espresso_reg_admin_regs_per_day_report.js', array('jqplot-all'), EVENT_ESPRESSO_VERSION, TRUE );
196
-		wp_register_script('espresso_reg_admin_regs_per_event', REG_CAF_ASSETS_URL . 'espresso_reg_admin_regs_per_event_report.js', array('jqplot-all'), EVENT_ESPRESSO_VERSION, TRUE );
195
+		wp_register_script('espresso_reg_admin_regs_per_day', REG_CAF_ASSETS_URL.'espresso_reg_admin_regs_per_day_report.js', array('jqplot-all'), EVENT_ESPRESSO_VERSION, TRUE);
196
+		wp_register_script('espresso_reg_admin_regs_per_event', REG_CAF_ASSETS_URL.'espresso_reg_admin_regs_per_event_report.js', array('jqplot-all'), EVENT_ESPRESSO_VERSION, TRUE);
197 197
 	}
198 198
 
199 199
 
@@ -224,7 +224,7 @@  discard block
 block discarded – undo
224 224
 				'slug' => 'all',
225 225
 				'label' => __('All', 'event_espresso'),
226 226
 				'count' => 0,
227
-				'bulk_action' => !isset( $this->_req_data['event_id'] ) ? array() : array(
227
+				'bulk_action' => ! isset($this->_req_data['event_id']) ? array() : array(
228 228
 					'toggle_checkin_status' => __('Toggle Check-In', 'event_espresso'),
229 229
 					//'trash_registrations' => __('Trash Registrations', 'event_espresso')
230 230
 					)
@@ -242,7 +242,7 @@  discard block
 block discarded – undo
242 242
 				'slug' => 'all',
243 243
 				'label' => __('All', 'event_espresso'),
244 244
 				'count' => 0,
245
-				'bulk_action' => array( 'delete_checkin_rows' => __('Delete Check-In Rows', 'event_espresso') )
245
+				'bulk_action' => array('delete_checkin_rows' => __('Delete Check-In Rows', 'event_espresso'))
246 246
 				),
247 247
 			);
248 248
 	}
@@ -258,20 +258,20 @@  discard block
 block discarded – undo
258 258
 	 */
259 259
 	public function get_newsletter_form_content() {
260 260
 		//do a nonce check cause we're not coming in from an normal route here.
261
-		$nonce = isset( $this->_req_data['get_newsletter_form_content_nonce'] ) ? sanitize_text_field( $this->_req_data['get_newsletter_form_content_nonce'] ) : '';
261
+		$nonce = isset($this->_req_data['get_newsletter_form_content_nonce']) ? sanitize_text_field($this->_req_data['get_newsletter_form_content_nonce']) : '';
262 262
 		$nonce_ref = 'get_newsletter_form_content_nonce';
263 263
 
264
-		$this->_verify_nonce( $nonce, $nonce_ref );
264
+		$this->_verify_nonce($nonce, $nonce_ref);
265 265
 		//let's get the mtp for the incoming MTP_ ID
266
-		if ( !isset( $this->_req_data['GRP_ID'] ) ) {
267
-			EE_Error::add_error( __('There must be something broken with the js or html structure because the required data for getting a message template group is not present (need an GRP_ID).', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__ );
266
+		if ( ! isset($this->_req_data['GRP_ID'])) {
267
+			EE_Error::add_error(__('There must be something broken with the js or html structure because the required data for getting a message template group is not present (need an GRP_ID).', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
268 268
 			$this->_template_args['success'] = FALSE;
269 269
 			$this->_template_args['error'] = TRUE;
270 270
 			$this->_return_json();
271 271
 		}
272
-		$MTPG = EEM_Message_Template_Group::instance()->get_one_by_ID( $this->_req_data['GRP_ID'] );
273
-		if ( ! $MTPG instanceof EE_Message_Template_Group ) {
274
-			EE_Error::add_error( sprintf( __('The GRP_ID given (%d) does not appear to have a corresponding row in the database.', 'event_espresso'), $this->_req_data['GRP_ID'] ), __FILE__, __FUNCTION__, __LINE__  );
272
+		$MTPG = EEM_Message_Template_Group::instance()->get_one_by_ID($this->_req_data['GRP_ID']);
273
+		if ( ! $MTPG instanceof EE_Message_Template_Group) {
274
+			EE_Error::add_error(sprintf(__('The GRP_ID given (%d) does not appear to have a corresponding row in the database.', 'event_espresso'), $this->_req_data['GRP_ID']), __FILE__, __FUNCTION__, __LINE__);
275 275
 			$this->_template_args['success'] = FALSE;
276 276
 			$this->_template_args['error'] = TRUE;
277 277
 			$this->_return_json();
@@ -280,11 +280,11 @@  discard block
 block discarded – undo
280 280
 		$MTPs = $MTPG->context_templates();
281 281
 		$MTPs = $MTPs['attendee'];
282 282
 		$template_fields = array();
283
-		foreach ( $MTPs as $MTP ) {
283
+		foreach ($MTPs as $MTP) {
284 284
 			$field = $MTP->get('MTP_template_field');
285
-			if ( $field == 'content'  ) {
285
+			if ($field == 'content') {
286 286
 				$content = $MTP->get('MTP_content');
287
-				if ( !empty( $content['newsletter_content'] ) ) {
287
+				if ( ! empty($content['newsletter_content'])) {
288 288
 					$template_fields['newsletter_content'] = $content['newsletter_content'];
289 289
 					}
290 290
 				continue;
@@ -297,7 +297,7 @@  discard block
 block discarded – undo
297 297
 		$this->_template_args['data'] = array(
298 298
 			'batch_message_from' => isset($template_fields['from']) ? $template_fields['from'] : '',
299 299
 			'batch_message_subject' => isset($template_fields['subject']) ? $template_fields['subject'] : '',
300
-			'batch_message_content' => isset( $template_fields['newsletter_content'] ) ? $template_fields['newsletter_content'] : ''
300
+			'batch_message_content' => isset($template_fields['newsletter_content']) ? $template_fields['newsletter_content'] : ''
301 301
 			);
302 302
 		$this->_return_json();
303 303
 	}
@@ -313,8 +313,8 @@  discard block
 block discarded – undo
313 313
 	 * @param EE_Admin_List_Table $list_table
314 314
 	 * @return string html string for extra buttons
315 315
 	 */
316
-	public function add_newsletter_action_buttons( EE_Admin_List_Table $list_table ) {
317
-		if ( ! EE_Registry::instance()->CAP->current_user_can( 'ee_send_message', 'espresso_registrations_newsletter_selected_send' ) ) {
316
+	public function add_newsletter_action_buttons(EE_Admin_List_Table $list_table) {
317
+		if ( ! EE_Registry::instance()->CAP->current_user_can('ee_send_message', 'espresso_registrations_newsletter_selected_send')) {
318 318
 			return '';
319 319
 		}
320 320
 
@@ -323,13 +323,13 @@  discard block
 block discarded – undo
323 323
 			'event_registrations',
324 324
 			'default'
325 325
 			);
326
-		if ( $this->_current_page == 'espresso_registrations' && in_array( $this->_req_action, $routes_to_add_to )  ) {
327
-			if ( ( $this->_req_action == 'event_registrations' && empty( $this->_req_data['event_id'] ) ) || ( isset( $this->_req_data['status'] ) && $this->_req_data['status'] == 'trash' ) ) {
326
+		if ($this->_current_page == 'espresso_registrations' && in_array($this->_req_action, $routes_to_add_to)) {
327
+			if (($this->_req_action == 'event_registrations' && empty($this->_req_data['event_id'])) || (isset($this->_req_data['status']) && $this->_req_data['status'] == 'trash')) {
328 328
 				echo '';
329 329
 			} else {
330
-				$button_text = sprintf( __('Send Batch Message (%s selected)', 'event_espresso'), '<span class="send-selected-newsletter-count">0</span>' );
331
-				echo '<button id="selected-batch-send-trigger" class="button secondary-button"><span class="dashicons dashicons-email "></span>' . $button_text . '</button>';
332
-				add_action('admin_footer', array( $this, 'newsletter_send_form_skeleton') );
330
+				$button_text = sprintf(__('Send Batch Message (%s selected)', 'event_espresso'), '<span class="send-selected-newsletter-count">0</span>');
331
+				echo '<button id="selected-batch-send-trigger" class="button secondary-button"><span class="dashicons dashicons-email "></span>'.$button_text.'</button>';
332
+				add_action('admin_footer', array($this, 'newsletter_send_form_skeleton'));
333 333
 			}
334 334
 		}
335 335
 	}
@@ -341,38 +341,38 @@  discard block
 block discarded – undo
341 341
 		$list_table = $this->_list_table_object;
342 342
 		$codes = array();
343 343
 		//need to templates for the newsletter message type for the template selector.
344
-		$values[] = array( 'text' => __('Select Template to Use', 'event_espresso'), 'id' => 0 );
345
-		$mtps = EEM_Message_Template_Group::instance()->get_all( array( array( 'MTP_message_type' => 'newsletter', 'MTP_messenger' => 'email' ) ) );
346
-		foreach ( $mtps as $mtp ) {
344
+		$values[] = array('text' => __('Select Template to Use', 'event_espresso'), 'id' => 0);
345
+		$mtps = EEM_Message_Template_Group::instance()->get_all(array(array('MTP_message_type' => 'newsletter', 'MTP_messenger' => 'email')));
346
+		foreach ($mtps as $mtp) {
347 347
 			$name = $mtp->name();
348 348
 			$values[] = array(
349
-				'text' => empty( $name ) ? __('Global', 'event_espresso') : $name,
349
+				'text' => empty($name) ? __('Global', 'event_espresso') : $name,
350 350
 				'id' => $mtp->ID()
351 351
 				);
352 352
 		}
353 353
 
354 354
 		//need to get a list of shortcodes that are available for the newsletter message type.
355 355
 		EE_Registry::instance()->load_helper('MSG_Template');
356
-		$shortcodes = EEH_MSG_Template::get_shortcodes( 'newsletter', 'email', array(), 'attendee', FALSE );
357
-		foreach ( $shortcodes as $field => $shortcode_array ) {
358
-			$codes[$field] = implode(', ', array_keys($shortcode_array ) );
356
+		$shortcodes = EEH_MSG_Template::get_shortcodes('newsletter', 'email', array(), 'attendee', FALSE);
357
+		foreach ($shortcodes as $field => $shortcode_array) {
358
+			$codes[$field] = implode(', ', array_keys($shortcode_array));
359 359
 		}
360 360
 
361 361
 		$shortcodes = $codes;
362 362
 
363
-		$form_template = REG_CAF_TEMPLATE_PATH . 'newsletter-send-form.template.php';
363
+		$form_template = REG_CAF_TEMPLATE_PATH.'newsletter-send-form.template.php';
364 364
 		$form_template_args = array(
365 365
 			'form_action' => admin_url('admin.php?page=espresso_registrations'),
366 366
 			'form_route' => 'newsletter_selected_send',
367 367
 			'form_nonce_name' => 'newsletter_selected_send_nonce',
368
-			'form_nonce' => wp_create_nonce( 'newsletter_selected_send_nonce' ),
368
+			'form_nonce' => wp_create_nonce('newsletter_selected_send_nonce'),
369 369
 			'redirect_back_to' => $this->_req_action,
370
-			'ajax_nonce' => wp_create_nonce( 'get_newsletter_form_content_nonce'),
371
-			'template_selector' => EEH_Form_Fields::select_input('newsletter_mtp_selected', $values ),
370
+			'ajax_nonce' => wp_create_nonce('get_newsletter_form_content_nonce'),
371
+			'template_selector' => EEH_Form_Fields::select_input('newsletter_mtp_selected', $values),
372 372
 			'shortcodes' => $shortcodes,
373 373
 			'id_type' => $list_table instanceof EE_Attendee_Contact_List_Table ? 'contact' : 'registration'
374 374
 			);
375
-		EEH_Template::display_template( $form_template, $form_template_args );
375
+		EEH_Template::display_template($form_template, $form_template_args);
376 376
 	}
377 377
 
378 378
 
@@ -387,35 +387,35 @@  discard block
 block discarded – undo
387 387
 	protected function _newsletter_selected_send() {
388 388
 		$success = TRUE;
389 389
 		//first we need to make sure we have a GRP_ID so we know what template we're sending and updating!
390
-		if ( empty( $this->_req_data['newsletter_mtp_selected'] ) ) {
391
-			EE_Error::add_error( __('In order to send a message, a Message Template GRP_ID is needed. It was not provided so messages were not sent.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__ );
390
+		if (empty($this->_req_data['newsletter_mtp_selected'])) {
391
+			EE_Error::add_error(__('In order to send a message, a Message Template GRP_ID is needed. It was not provided so messages were not sent.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
392 392
 			$success = FALSE;
393 393
 		}
394 394
 
395
-		if ( $success ) {
395
+		if ($success) {
396 396
 			//update Message template in case there are any changes
397
-			$MTPG = EEM_Message_Template_Group::instance()->get_one_by_ID( $this->_req_data['newsletter_mtp_selected'] );
397
+			$MTPG = EEM_Message_Template_Group::instance()->get_one_by_ID($this->_req_data['newsletter_mtp_selected']);
398 398
 			$MTPs = $MTPG instanceof EE_Message_Template_Group ? $MTPG->context_templates() : array();
399
-			if ( empty( $MTPs ) ) {
400
-				EE_Error::add_error( __('Unable to retrieve message template fields from the db. Messages not sent.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__ );
399
+			if (empty($MTPs)) {
400
+				EE_Error::add_error(__('Unable to retrieve message template fields from the db. Messages not sent.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
401 401
 				$success = FALSE;
402 402
 			}
403 403
 
404 404
 			//let's just update the specific fields
405
-			foreach ( $MTPs['attendee'] as $MTP ) {
405
+			foreach ($MTPs['attendee'] as $MTP) {
406 406
 				$field = $MTP->get('MTP_template_field');
407 407
 				$content = $MTP->get('MTP_content');
408 408
 				$new_content = $content;
409
-				switch( $field ) {
409
+				switch ($field) {
410 410
 					case 'from' :
411
-						$new_content = !empty( $this->_req_data['batch_message']['from'] ) ? $this->_req_data['batch_message']['from'] : $content;
411
+						$new_content = ! empty($this->_req_data['batch_message']['from']) ? $this->_req_data['batch_message']['from'] : $content;
412 412
 						break;
413 413
 					case 'subject' :
414
-						$new_content = !empty( $this->_req_data['batch_message']['subject'] ) ? $this->_req_data['batch_message']['subject'] : $content;
414
+						$new_content = ! empty($this->_req_data['batch_message']['subject']) ? $this->_req_data['batch_message']['subject'] : $content;
415 415
 						break;
416 416
 					case 'content' :
417 417
 						$new_content = $content;
418
-						$new_content['newsletter_content'] = !empty( $this->_req_data['batch_message']['content'] ) ? $this->_req_data['batch_message']['content'] : $content['newsletter_content'];
418
+						$new_content['newsletter_content'] = ! empty($this->_req_data['batch_message']['content']) ? $this->_req_data['batch_message']['content'] : $content['newsletter_content'];
419 419
 						break;
420 420
 					default :
421 421
 						continue;
@@ -426,20 +426,20 @@  discard block
 block discarded – undo
426 426
 			}
427 427
 
428 428
 			//great fields are updated!  now let's make sure we just have contact objects (EE_Attendee).
429
-			$id_type = !empty( $this->_req_data['batch_message']['id_type'] ) ? $this->_req_data['batch_message']['id_type'] : 'registration';
429
+			$id_type = ! empty($this->_req_data['batch_message']['id_type']) ? $this->_req_data['batch_message']['id_type'] : 'registration';
430 430
 
431 431
 			//id_type will affect how we assemble the ids.
432
-			$ids = !empty( $this->_req_data['batch_message']['ids'] ) ? json_decode( stripslashes($this->_req_data['batch_message']['ids']) ) : array();
432
+			$ids = ! empty($this->_req_data['batch_message']['ids']) ? json_decode(stripslashes($this->_req_data['batch_message']['ids'])) : array();
433 433
 
434
-			$contacts = $id_type == 'registration' ? EEM_Attendee::instance()->get_array_of_contacts_from_reg_ids( $ids ) : EEM_Attendee::instance()->get_all( array( array( 'ATT_ID' => array('in', $ids ) ) ) );
434
+			$contacts = $id_type == 'registration' ? EEM_Attendee::instance()->get_array_of_contacts_from_reg_ids($ids) : EEM_Attendee::instance()->get_all(array(array('ATT_ID' => array('in', $ids))));
435 435
 
436 436
 			//we do _action because ALL triggers are handled in EED_Messages.
437
-			do_action('AHEE__Extend_Registrations_Admin_Page___newsletter_selected_send', $contacts, $MTPG->ID() );
437
+			do_action('AHEE__Extend_Registrations_Admin_Page___newsletter_selected_send', $contacts, $MTPG->ID());
438 438
 		}
439 439
 		$query_args = array(
440
-			'action' => !empty( $this->_req_data['redirect_back_to'] ) ? $this->_req_data['redirect_back_to'] : 'default'
440
+			'action' => ! empty($this->_req_data['redirect_back_to']) ? $this->_req_data['redirect_back_to'] : 'default'
441 441
 			);
442
-		$this->_redirect_after_action( FALSE, '', '', $query_args, TRUE );
442
+		$this->_redirect_after_action(FALSE, '', '', $query_args, TRUE);
443 443
 	}
444 444
 
445 445
 
@@ -452,16 +452,16 @@  discard block
 block discarded – undo
452 452
 	*/
453 453
 	protected function _registration_reports() {
454 454
 
455
-		do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' );
455
+		do_action('AHEE_log', __FILE__, __FUNCTION__, '');
456 456
 
457 457
 		$page_args = array();
458 458
 
459
-		$page_args['admin_reports'][] = $this->_registrations_per_day_report( '-1 month' );  //  option: '-1 week', '-2 weeks' defaults to '-1 month'
460
-		$page_args['admin_reports'][] = $this->_get_registrations_per_event_report( '-1 month' ); //  option: '-1 week', '-2 weeks' defaults to '-1 month'
459
+		$page_args['admin_reports'][] = $this->_registrations_per_day_report('-1 month'); //  option: '-1 week', '-2 weeks' defaults to '-1 month'
460
+		$page_args['admin_reports'][] = $this->_get_registrations_per_event_report('-1 month'); //  option: '-1 week', '-2 weeks' defaults to '-1 month'
461 461
 //		$page_args['admin_reports'][] = 'chart1';
462 462
 
463
-		$template_path = EE_ADMIN_TEMPLATE . 'admin_reports.template.php';
464
-		$this->_template_args['admin_page_content'] = EEH_Template::display_template( $template_path, $page_args, TRUE );
463
+		$template_path = EE_ADMIN_TEMPLATE.'admin_reports.template.php';
464
+		$this->_template_args['admin_page_content'] = EEH_Template::display_template($template_path, $page_args, TRUE);
465 465
 
466 466
 //		EEH_Debug_Tools::printr( $page_args, '$page_args' );
467 467
 
@@ -480,36 +480,36 @@  discard block
 block discarded – undo
480 480
 	*		@access private
481 481
 	*		@return void
482 482
 	*/
483
-	private function _registrations_per_day_report( $period = '-1 month' ) {
483
+	private function _registrations_per_day_report($period = '-1 month') {
484 484
 
485 485
 		$report_ID = 'reg-admin-registrations-per-day-report-dv';
486 486
 		$report_JS = 'espresso_reg_admin_regs_per_day';
487 487
 
488
-		wp_enqueue_script( $report_JS );
488
+		wp_enqueue_script($report_JS);
489 489
 
490 490
 		$REG = EEM_Registration::instance();
491 491
 
492
-		$results = $REG->get_registrations_per_day_report( $period );
492
+		$results = $REG->get_registrations_per_day_report($period);
493 493
 
494 494
 		//EEH_Debug_Tools::printr( $results, '$registrations_per_day' );
495 495
 		$regs = array();
496
-		$xmin = date( 'Y-m-d', strtotime( '+1 year' ));
496
+		$xmin = date('Y-m-d', strtotime('+1 year'));
497 497
 		$xmax = 0;
498 498
 		$ymax = 0;
499 499
 		$results = (array) $results;
500
-		foreach ( $results as $result ) {
501
-			$regs[] = array( $result->regDate, (int)$result->total );
502
-			$xmin = strtotime( $result->regDate ) < strtotime( $xmin ) ? $result->regDate : $xmin;
503
-			$xmax = strtotime( $result->regDate ) > strtotime( $xmax ) ? $result->regDate : $xmax;
500
+		foreach ($results as $result) {
501
+			$regs[] = array($result->regDate, (int) $result->total);
502
+			$xmin = strtotime($result->regDate) < strtotime($xmin) ? $result->regDate : $xmin;
503
+			$xmax = strtotime($result->regDate) > strtotime($xmax) ? $result->regDate : $xmax;
504 504
 			$ymax = $result->total > $ymax ? $result->total : $ymax;
505 505
 		}
506 506
 
507
-		$xmin = date( 'Y-m-d', strtotime( date( 'Y-m-d', strtotime($xmin)) . ' -1 day' ));
508
-		$xmax = date( 'Y-m-d', strtotime( date( 'Y-m-d', strtotime($xmax)) . ' +1 day' ));
507
+		$xmin = date('Y-m-d', strtotime(date('Y-m-d', strtotime($xmin)).' -1 day'));
508
+		$xmax = date('Y-m-d', strtotime(date('Y-m-d', strtotime($xmax)).' +1 day'));
509 509
 		// calculate # days between our min and max dates
510
-		$span = floor( (strtotime($xmax) - strtotime($xmin)) / (60*60*24)) + 1;
510
+		$span = floor((strtotime($xmax) - strtotime($xmin)) / (60 * 60 * 24)) + 1;
511 511
 
512
-		$report_title = __( 'Total Registrations per Day', 'event_espresso' );
512
+		$report_title = __('Total Registrations per Day', 'event_espresso');
513 513
 
514 514
 		$report_params = array(
515 515
 				'title' 	=> $report_title,
@@ -520,9 +520,9 @@  discard block
 block discarded – undo
520 520
 				'ymax' 	=> ceil($ymax * 1.25),
521 521
 				'span' 	=> $span,
522 522
 				'width'	=> ceil(900 / $span),
523
-				'noRegsMsg' => sprintf( __('<h2>%s</h2><p>There are currently no registration records in the last month for this report.</p>', 'event_espresso'), $report_title )
523
+				'noRegsMsg' => sprintf(__('<h2>%s</h2><p>There are currently no registration records in the last month for this report.</p>', 'event_espresso'), $report_title)
524 524
 			);
525
-		wp_localize_script( $report_JS, 'regPerDay', $report_params );
525
+		wp_localize_script($report_JS, 'regPerDay', $report_params);
526 526
 
527 527
 		return $report_ID;
528 528
 	}
@@ -537,29 +537,29 @@  discard block
 block discarded – undo
537 537
 	*		@access private
538 538
 	*		@return void
539 539
 	*/
540
-	private function _get_registrations_per_event_report( $period = '-1 month' ) {
540
+	private function _get_registrations_per_event_report($period = '-1 month') {
541 541
 
542 542
 		$report_ID = 'reg-admin-registrations-per-event-report-dv';
543 543
 		$report_JS = 'espresso_reg_admin_regs_per_event';
544 544
 
545
-		wp_enqueue_script( $report_JS );
545
+		wp_enqueue_script($report_JS);
546 546
 
547
-		require_once ( EE_MODELS . 'EEM_Registration.model.php' );
547
+		require_once (EE_MODELS.'EEM_Registration.model.php');
548 548
 		$REG = EEM_Registration::instance();
549 549
 
550
-		$results = $REG->get_registrations_per_event_report( $period );
550
+		$results = $REG->get_registrations_per_event_report($period);
551 551
 		//EEH_Debug_Tools::printr( $results, '$registrations_per_event' );
552 552
 		$regs = array();
553 553
 		$ymax = 0;
554 554
 		$results = (array) $results;
555
-		foreach ( $results as $result ) {
556
-			$regs[] = array( wp_trim_words( $result->event_name, 4, '...' ), (int)$result->total );
555
+		foreach ($results as $result) {
556
+			$regs[] = array(wp_trim_words($result->event_name, 4, '...'), (int) $result->total);
557 557
 			$ymax = $result->total > $ymax ? $result->total : $ymax;
558 558
 		}
559 559
 
560 560
 		$span = $period == 'week' ? 9 : 33;
561 561
 
562
-		$report_title = __( 'Total Registrations per Event', 'event_espresso' );
562
+		$report_title = __('Total Registrations per Event', 'event_espresso');
563 563
 
564 564
 		$report_params = array(
565 565
 			'title' 	=> $report_title,
@@ -568,9 +568,9 @@  discard block
 block discarded – undo
568 568
 			'ymax' 	=> ceil($ymax * 1.25),
569 569
 			'span' 	=> $span,
570 570
 			'width'	=> ceil(900 / $span),
571
-			'noRegsMsg' => sprintf( __('<h2>%s</h2><p>There are currently no registration records in the last month for this report.</p>', 'event_espresso'), $report_title )
571
+			'noRegsMsg' => sprintf(__('<h2>%s</h2><p>There are currently no registration records in the last month for this report.</p>', 'event_espresso'), $report_title)
572 572
 		);
573
-		wp_localize_script( $report_JS, 'regPerEvent', $report_params );
573
+		wp_localize_script($report_JS, 'regPerEvent', $report_params);
574 574
 
575 575
 		return $report_ID;
576 576
 	}
@@ -584,8 +584,8 @@  discard block
 block discarded – undo
584 584
 	 * @return void
585 585
 	 */
586 586
 	protected function _registration_checkin_list_table() {
587
-		do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' );
588
-		$reg_id = isset( $this->_req_data['_REGID'] ) ? $this->_req_data['_REGID'] : null;
587
+		do_action('AHEE_log', __FILE__, __FUNCTION__, '');
588
+		$reg_id = isset($this->_req_data['_REGID']) ? $this->_req_data['_REGID'] : null;
589 589
 		$reg = EEM_Registration::instance()->get_one_by_ID($reg_id);
590 590
 		$this->_admin_page_title .= $this->get_action_link_or_button('new_registration', 'add-registrant', array('event_id' => $reg->event_ID()), 'add-new-h2');
591 591
 
@@ -599,15 +599,15 @@  discard block
 block discarded – undo
599 599
 				'desc' => __('This indicates the attendee has been checked out', 'event_espresso')
600 600
 				)
601 601
 			);
602
-		$this->_template_args['after_list_table'] = $this->_display_legend( $legend_items );
602
+		$this->_template_args['after_list_table'] = $this->_display_legend($legend_items);
603 603
 
604 604
 
605
-		$dtt_id = isset(  $this->_req_data['DTT_ID'] ) ? $this->_req_data['DTT_ID'] : NULL;
606
-		$go_back_url = !empty( $reg_id )  ? EE_Admin_Page::add_query_args_and_nonce(array('action' => 'event_registrations', 'event_id' => EEM_Registration::instance()->get_one_by_ID($reg_id)->get_first_related('Event')->ID(), 'DTT_ID' => $dtt_id ), $this->_admin_base_url ) : '';
605
+		$dtt_id = isset($this->_req_data['DTT_ID']) ? $this->_req_data['DTT_ID'] : NULL;
606
+		$go_back_url = ! empty($reg_id) ? EE_Admin_Page::add_query_args_and_nonce(array('action' => 'event_registrations', 'event_id' => EEM_Registration::instance()->get_one_by_ID($reg_id)->get_first_related('Event')->ID(), 'DTT_ID' => $dtt_id), $this->_admin_base_url) : '';
607 607
 
608
-		$this->_template_args['before_list_table'] = !empty( $reg_id ) && !empty( $dtt_id ) ? '<h2>' . sprintf(__("%s's check in records for %s at the event, %s", 'event_espresso'), '<span id="checkin-attendee-name">' . EEM_Registration::instance()->get_one_by_ID($reg_id)->get_first_related('Attendee')->full_name() . '</span>', '<span id="checkin-dtt"><a href="' . $go_back_url . '">' . EEM_Datetime::instance()->get_one_by_ID($dtt_id)->start_date_and_time() . ' - ' . EEM_Datetime::instance()->get_one_by_ID($dtt_id)->end_date_and_time() . '</a></span>', '<span id="checkin-event-name">' . EEM_Datetime::instance()->get_one_by_ID($dtt_id)->get_first_related('Event')->get('EVT_name') . '</span>' ) . '</h2>' : '';
609
-		$this->_template_args['list_table_hidden_fields'] = !empty( $reg_id ) ? '<input type="hidden" name="_REGID" value="' . $reg_id . '">' : '';
610
-		$this->_template_args['list_table_hidden_fields'] .= !empty( $dtt_id ) ? '<input type="hidden" name="DTT_ID" value="' . $dtt_id . '">' : '';
608
+		$this->_template_args['before_list_table'] = ! empty($reg_id) && ! empty($dtt_id) ? '<h2>'.sprintf(__("%s's check in records for %s at the event, %s", 'event_espresso'), '<span id="checkin-attendee-name">'.EEM_Registration::instance()->get_one_by_ID($reg_id)->get_first_related('Attendee')->full_name().'</span>', '<span id="checkin-dtt"><a href="'.$go_back_url.'">'.EEM_Datetime::instance()->get_one_by_ID($dtt_id)->start_date_and_time().' - '.EEM_Datetime::instance()->get_one_by_ID($dtt_id)->end_date_and_time().'</a></span>', '<span id="checkin-event-name">'.EEM_Datetime::instance()->get_one_by_ID($dtt_id)->get_first_related('Event')->get('EVT_name').'</span>').'</h2>' : '';
609
+		$this->_template_args['list_table_hidden_fields'] = ! empty($reg_id) ? '<input type="hidden" name="_REGID" value="'.$reg_id.'">' : '';
610
+		$this->_template_args['list_table_hidden_fields'] .= ! empty($dtt_id) ? '<input type="hidden" name="DTT_ID" value="'.$dtt_id.'">' : '';
611 611
 
612 612
 		$this->display_admin_list_table_page_with_no_sidebar();
613 613
 	}
@@ -620,24 +620,24 @@  discard block
 block discarded – undo
620 620
 	 */
621 621
 	public function toggle_checkin_status() {
622 622
 		//first make sure we have the necessary data
623
-		if ( !isset( $this->_req_data['_regid'] ) ) {
624
-			EE_Error::add_error( __('There must be something broken with the html structure because the required data for toggling the Check-in status is not being sent via ajax', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__ );
623
+		if ( ! isset($this->_req_data['_regid'])) {
624
+			EE_Error::add_error(__('There must be something broken with the html structure because the required data for toggling the Check-in status is not being sent via ajax', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
625 625
 			$this->_template_args['success'] = FALSE;
626 626
 			$this->_template_args['error'] = TRUE;
627 627
 			$this->_return_json();
628 628
 		};
629 629
 
630 630
 		//do a nonce check cause we're not coming in from an normal route here.
631
-		$nonce = isset( $this->_req_data['checkinnonce'] ) ? sanitize_text_field( $this->_req_data['checkinnonce'] ) : '';
631
+		$nonce = isset($this->_req_data['checkinnonce']) ? sanitize_text_field($this->_req_data['checkinnonce']) : '';
632 632
 		$nonce_ref = 'checkin_nonce';
633 633
 
634
-		$this->_verify_nonce( $nonce, $nonce_ref );
634
+		$this->_verify_nonce($nonce, $nonce_ref);
635 635
 
636 636
 		//beautiful! Made it this far so let's get the status.
637 637
 		$new_status = $this->_toggle_checkin_status();
638 638
 
639 639
 		//setup new class to return via ajax
640
-		$this->_template_args['admin_page_content'] = 'clickable trigger-checkin checkin-icons checkedin-status-' . $new_status;
640
+		$this->_template_args['admin_page_content'] = 'clickable trigger-checkin checkin-icons checkedin-status-'.$new_status;
641 641
 		$this->_template_args['success'] = TRUE;
642 642
 		$this->_return_json();
643 643
 	}
@@ -657,32 +657,32 @@  discard block
 block discarded – undo
657 657
 		//first let's get the query args out of the way for the redirect
658 658
 		$query_args = array(
659 659
 			'action' => 'event_registrations',
660
-			'event_id' => isset( $this->_req_data['event_id'] ) ? $this->_req_data['event_id'] : NULL,
661
-			'DTT_ID' => isset( $this->_req_data['DTT_ID'] ) ? $this->_req_data['DTT_ID'] : NULL
660
+			'event_id' => isset($this->_req_data['event_id']) ? $this->_req_data['event_id'] : NULL,
661
+			'DTT_ID' => isset($this->_req_data['DTT_ID']) ? $this->_req_data['DTT_ID'] : NULL
662 662
 			);
663 663
 		$new_status = FALSE;
664 664
 
665 665
 		// bulk action check in toggle
666
-		if ( ! empty( $this->_req_data['checkbox'] ) && is_array( $this->_req_data['checkbox'] )) {
666
+		if ( ! empty($this->_req_data['checkbox']) && is_array($this->_req_data['checkbox'])) {
667 667
 			// cycle thru checkboxes
668
-			while ( list( $REG_ID, $value ) = each($this->_req_data['checkbox'])) {
669
-				$DTT_ID = isset( $this->_req_data['DTT_ID'] ) ? $this->_req_data['DTT_ID'] : NULL;
668
+			while (list($REG_ID, $value) = each($this->_req_data['checkbox'])) {
669
+				$DTT_ID = isset($this->_req_data['DTT_ID']) ? $this->_req_data['DTT_ID'] : NULL;
670 670
 				$new_status = $this->_toggle_checkin($REG_ID, $DTT_ID);
671 671
 			}
672 672
 
673
-		} elseif ( isset( $this->_req_data['_regid'] ) ) {
673
+		} elseif (isset($this->_req_data['_regid'])) {
674 674
 			//coming from ajax request
675
-			$DTT_ID = isset( $this->_req_data['dttid'] ) ? $this->_req_data['dttid'] : NULL;
675
+			$DTT_ID = isset($this->_req_data['dttid']) ? $this->_req_data['dttid'] : NULL;
676 676
 			$query_args['DTT_ID'] = $DTT_ID;
677 677
 			$new_status = $this->_toggle_checkin($this->_req_data['_regid'], $DTT_ID);
678 678
 		} else {
679
-			EE_Error::add_error(__('Missing some required data to toggle the Check-in', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__  );
679
+			EE_Error::add_error(__('Missing some required data to toggle the Check-in', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
680 680
 		}
681 681
 
682
-		if ( defined('DOING_AJAX' ) )
682
+		if (defined('DOING_AJAX'))
683 683
 			return $new_status;
684 684
 
685
-		$this->_redirect_after_action( FALSE,'', '', $query_args, TRUE );
685
+		$this->_redirect_after_action(FALSE, '', '', $query_args, TRUE);
686 686
 
687 687
 	}
688 688
 
@@ -698,11 +698,11 @@  discard block
 block discarded – undo
698 698
 	 */
699 699
 	private function _toggle_checkin($REG_ID, $DTT_ID) {
700 700
 		$REG = EEM_Registration::instance()->get_one_by_ID($REG_ID);
701
-		$new_status = $REG->toggle_checkin_status( $DTT_ID );
702
-		if ( $new_status !== FALSE ) {
703
-			EE_Error::add_success($REG->get_checkin_msg($DTT_ID) );
701
+		$new_status = $REG->toggle_checkin_status($DTT_ID);
702
+		if ($new_status !== FALSE) {
703
+			EE_Error::add_success($REG->get_checkin_msg($DTT_ID));
704 704
 		} else {
705
-			EE_Error::add_error($REG->get_checkin_msg($DTT_ID, TRUE), __FILE__, __FUNCTION__, __LINE__ );
705
+			EE_Error::add_error($REG->get_checkin_msg($DTT_ID, TRUE), __FILE__, __FUNCTION__, __LINE__);
706 706
 			$new_status = FALSE;
707 707
 		}
708 708
 		return $new_status;
@@ -718,28 +718,28 @@  discard block
 block discarded – undo
718 718
 	protected function _delete_checkin_rows() {
719 719
 		$query_args = array(
720 720
 			'action' => 'registration_checkins',
721
-			'DTT_ID' => isset( $this->_req_data['DTT_ID'] ) ? $this->_req_data['DTT_ID'] : 0,
722
-			'_REGID' => isset( $this->_req_data['_REGID'] ) ? $this->_req_data['_REGID'] : 0
721
+			'DTT_ID' => isset($this->_req_data['DTT_ID']) ? $this->_req_data['DTT_ID'] : 0,
722
+			'_REGID' => isset($this->_req_data['_REGID']) ? $this->_req_data['_REGID'] : 0
723 723
 			);
724
-		if ( !empty( $this->_req_data['checkbox'] ) && is_array( $this->_req_data['checkbox'] ) ) {
725
-			while ( list( $CHK_ID, $value ) = each( $this->_req_data['checkbox'] ) ) {
724
+		if ( ! empty($this->_req_data['checkbox']) && is_array($this->_req_data['checkbox'])) {
725
+			while (list($CHK_ID, $value) = each($this->_req_data['checkbox'])) {
726 726
 				$errors = 0;
727
-				if ( ! EEM_Checkin::instance()->delete_by_ID($CHK_ID ) ) {
727
+				if ( ! EEM_Checkin::instance()->delete_by_ID($CHK_ID)) {
728 728
 					$errors++;
729 729
 				}
730 730
 			}
731 731
 		} else {
732
-			EE_Error::add_error(__('So, something went wrong with the bulk delete because there was no data received for instructions on WHAT to delete!', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__ );
733
-			$this->_redirect_after_action( FALSE, '', '', $query_args, TRUE );
732
+			EE_Error::add_error(__('So, something went wrong with the bulk delete because there was no data received for instructions on WHAT to delete!', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
733
+			$this->_redirect_after_action(FALSE, '', '', $query_args, TRUE);
734 734
 		}
735 735
 
736
-		if ( $errors > 0 ) {
737
-			EE_Error::add_error( sprintf( __('There were %d records that did not delete successfully', 'event_espresso'), $errors ), __FILE__, __FUNCTION__, __LINE__ );
736
+		if ($errors > 0) {
737
+			EE_Error::add_error(sprintf(__('There were %d records that did not delete successfully', 'event_espresso'), $errors), __FILE__, __FUNCTION__, __LINE__);
738 738
 		} else {
739
-			EE_Error::add_success( __('Records were successfully deleted', 'event_espresso') );
739
+			EE_Error::add_success(__('Records were successfully deleted', 'event_espresso'));
740 740
 		}
741 741
 
742
-		$this->_redirect_after_action( FALSE, '', '', $query_args, TRUE );
742
+		$this->_redirect_after_action(FALSE, '', '', $query_args, TRUE);
743 743
 	}
744 744
 
745 745
 
@@ -751,20 +751,20 @@  discard block
 block discarded – undo
751 751
 	protected function _delete_checkin_row() {
752 752
 		$query_args = array(
753 753
 			'action' => 'registration_checkins',
754
-			'DTT_ID' => isset( $this->_req_data['DTT_ID'] ) ? $this->_req_data['DTT_ID'] : 0,
755
-			'_REGID' => isset( $this->_req_data['_REGID'] ) ? $this->_req_data['_REGID'] : 0
754
+			'DTT_ID' => isset($this->_req_data['DTT_ID']) ? $this->_req_data['DTT_ID'] : 0,
755
+			'_REGID' => isset($this->_req_data['_REGID']) ? $this->_req_data['_REGID'] : 0
756 756
 			);
757 757
 
758
-		if ( !empty( $this->_req_data['CHK_ID'] ) ) {
759
-			if ( ! EEM_Checkin::instance()->delete_by_ID($this->_req_data['CHK_ID'] ) ) {
760
-				EE_Error::add_error(__('Something went wrong and this check-in record was not deleted', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__ );
758
+		if ( ! empty($this->_req_data['CHK_ID'])) {
759
+			if ( ! EEM_Checkin::instance()->delete_by_ID($this->_req_data['CHK_ID'])) {
760
+				EE_Error::add_error(__('Something went wrong and this check-in record was not deleted', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
761 761
 			} else {
762
-				EE_Error::add_success( __('Check-In record successfully deleted', 'event_espresso') );
762
+				EE_Error::add_success(__('Check-In record successfully deleted', 'event_espresso'));
763 763
 			}
764 764
 		} else {
765
-			EE_Error::add_error(__('In order to delete a Check-in record, there must be a Check-In ID available. There is not. It is not your fault, there is just a gremlin living in the code', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__ );
765
+			EE_Error::add_error(__('In order to delete a Check-in record, there must be a Check-In ID available. There is not. It is not your fault, there is just a gremlin living in the code', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
766 766
 		}
767
-		$this->_redirect_after_action( FALSE, '', '', $query_args, TRUE );
767
+		$this->_redirect_after_action(FALSE, '', '', $query_args, TRUE);
768 768
 	}
769 769
 
770 770
 
@@ -777,8 +777,8 @@  discard block
 block discarded – undo
777 777
 	*		@return void
778 778
 	*/
779 779
 	protected function _event_registrations_list_table() {
780
-		do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' );
781
-		$this->_admin_page_title .= isset( $this->_req_data['event_id'] ) ? $this->get_action_link_or_button('new_registration', 'add-registrant', array('event_id' => $this->_req_data['event_id']), 'add-new-h2') : '';
780
+		do_action('AHEE_log', __FILE__, __FUNCTION__, '');
781
+		$this->_admin_page_title .= isset($this->_req_data['event_id']) ? $this->get_action_link_or_button('new_registration', 'add-registrant', array('event_id' => $this->_req_data['event_id']), 'add-new-h2') : '';
782 782
 
783 783
 		$legend_items = array(
784 784
 			'star-icon' => array(
@@ -802,31 +802,31 @@  discard block
 block discarded – undo
802 802
 				'desc' => __('View All Check-in Records for this Registrant', 'event_espresso')
803 803
 				),
804 804
 			'approved_status' => array(
805
-				'class' => 'ee-status-legend ee-status-legend-' . EEM_Registration::status_id_approved,
806
-				'desc' => EEH_Template::pretty_status( EEM_Registration::status_id_approved, FALSE, 'sentence' )
805
+				'class' => 'ee-status-legend ee-status-legend-'.EEM_Registration::status_id_approved,
806
+				'desc' => EEH_Template::pretty_status(EEM_Registration::status_id_approved, FALSE, 'sentence')
807 807
 				),
808 808
             'cancelled_status' => array(
809
-				'class' => 'ee-status-legend ee-status-legend-' . EEM_Registration::status_id_cancelled,
810
-				'desc' => EEH_Template::pretty_status( EEM_Registration::status_id_cancelled, FALSE, 'sentence' )
809
+				'class' => 'ee-status-legend ee-status-legend-'.EEM_Registration::status_id_cancelled,
810
+				'desc' => EEH_Template::pretty_status(EEM_Registration::status_id_cancelled, FALSE, 'sentence')
811 811
 				),
812 812
             'declined_status' => array(
813
-				'class' => 'ee-status-legend ee-status-legend-' . EEM_Registration::status_id_declined,
814
-				'desc' => EEH_Template::pretty_status( EEM_Registration::status_id_declined, FALSE, 'sentence' )
813
+				'class' => 'ee-status-legend ee-status-legend-'.EEM_Registration::status_id_declined,
814
+				'desc' => EEH_Template::pretty_status(EEM_Registration::status_id_declined, FALSE, 'sentence')
815 815
 				),
816 816
 			'not_approved' => array(
817
-				'class' => 'ee-status-legend ee-status-legend-' . EEM_Registration::status_id_not_approved,
818
-				'desc' => EEH_Template::pretty_status( EEM_Registration::status_id_not_approved, FALSE, 'sentence' )
817
+				'class' => 'ee-status-legend ee-status-legend-'.EEM_Registration::status_id_not_approved,
818
+				'desc' => EEH_Template::pretty_status(EEM_Registration::status_id_not_approved, FALSE, 'sentence')
819 819
 				),
820 820
 			'pending_status' => array(
821
-				'class' => 'ee-status-legend ee-status-legend-' . EEM_Registration::status_id_pending_payment,
822
-				'desc' => EEH_Template::pretty_status( EEM_Registration::status_id_pending_payment, FALSE, 'sentence' )
821
+				'class' => 'ee-status-legend ee-status-legend-'.EEM_Registration::status_id_pending_payment,
822
+				'desc' => EEH_Template::pretty_status(EEM_Registration::status_id_pending_payment, FALSE, 'sentence')
823 823
 				)/**/
824 824
 			);
825
-		$this->_template_args['after_list_table'] = $this->_display_legend( $legend_items );
825
+		$this->_template_args['after_list_table'] = $this->_display_legend($legend_items);
826 826
 
827
-		$event_id = isset( $this->_req_data['event_id'] ) ? $this->_req_data['event_id'] : null;
828
-		$this->_template_args['before_list_table'] = !empty( $event_id ) ? '<h2>' . sprintf(__('Viewing Registrations for Event: %s', 'event_espresso'), EEM_Event::instance()->get_one_by_ID($event_id)->get('EVT_name') ) . '</h2>' : '';
829
-		$this->_template_args['list_table_hidden_fields'] = !empty( $event_id ) ? '<input type="hidden" name="event_id" value="' . $event_id . '">' : '';
827
+		$event_id = isset($this->_req_data['event_id']) ? $this->_req_data['event_id'] : null;
828
+		$this->_template_args['before_list_table'] = ! empty($event_id) ? '<h2>'.sprintf(__('Viewing Registrations for Event: %s', 'event_espresso'), EEM_Event::instance()->get_one_by_ID($event_id)->get('EVT_name')).'</h2>' : '';
829
+		$this->_template_args['list_table_hidden_fields'] = ! empty($event_id) ? '<input type="hidden" name="event_id" value="'.$event_id.'">' : '';
830 830
 
831 831
 		$this->display_admin_list_table_page_with_no_sidebar();
832 832
 	}
@@ -840,15 +840,15 @@  discard block
 block discarded – undo
840 840
 	*		@access public
841 841
 	*		@return array
842 842
 	*/
843
-	public function get_event_attendees( $per_page = 10, $count = FALSE, $trash = FALSE, $orderby = '' ) {
843
+	public function get_event_attendees($per_page = 10, $count = FALSE, $trash = FALSE, $orderby = '') {
844 844
 
845
-		do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' );
846
-		require_once(EE_MODELS . 'EEM_Attendee.model.php');
845
+		do_action('AHEE_log', __FILE__, __FUNCTION__, '');
846
+		require_once(EE_MODELS.'EEM_Attendee.model.php');
847 847
 		//$ATT_MDL = EEM_Attendee::instance();
848 848
 
849
-		$EVT_ID = isset($this->_req_data['event_id']) ? absint( $this->_req_data['event_id'] ) : FALSE;
850
-		$CAT_ID = isset($this->_req_data['category_id']) ? absint( $this->_req_data['category_id'] ) : FALSE;
851
-		$DTT_ID = isset( $this->_req_data['DTT_ID'] ) ? $this->_req_data['DTT_ID'] : NULL;
849
+		$EVT_ID = isset($this->_req_data['event_id']) ? absint($this->_req_data['event_id']) : FALSE;
850
+		$CAT_ID = isset($this->_req_data['category_id']) ? absint($this->_req_data['category_id']) : FALSE;
851
+		$DTT_ID = isset($this->_req_data['DTT_ID']) ? $this->_req_data['DTT_ID'] : NULL;
852 852
 
853 853
 		$this->_req_data['orderby'] = ! empty($this->_req_data['orderby']) ? $this->_req_data['orderby'] : $orderby;
854 854
 
@@ -861,94 +861,94 @@  discard block
 block discarded – undo
861 861
 //				$orderby = 'reg.REG_final_price';
862 862
 		}
863 863
 
864
-		$sort = ( isset( $this->_req_data['order'] ) && ! empty( $this->_req_data['order'] )) ? $this->_req_data['order'] : 'ASC';
864
+		$sort = (isset($this->_req_data['order']) && ! empty($this->_req_data['order'])) ? $this->_req_data['order'] : 'ASC';
865 865
 
866
-		$current_page = isset( $this->_req_data['paged'] ) && !empty( $this->_req_data['paged'] ) ? $this->_req_data['paged'] : 1;
867
-		$per_page = isset( $this->_req_data['perpage'] ) && !empty( $this->_req_data['perpage'] ) ? $this->_req_data['perpage'] : $per_page;
866
+		$current_page = isset($this->_req_data['paged']) && ! empty($this->_req_data['paged']) ? $this->_req_data['paged'] : 1;
867
+		$per_page = isset($this->_req_data['perpage']) && ! empty($this->_req_data['perpage']) ? $this->_req_data['perpage'] : $per_page;
868 868
 
869 869
 
870
-		$offset = ($current_page-1)*$per_page;
871
-		$limit = $count ? NULL : array( $offset, $per_page );
872
-		$query_params = array(array('Event.status'=>array('IN',  array_keys(EEM_Event::instance()->get_status_array()))));
873
-		if ($EVT_ID){
874
-			$query_params[0]['EVT_ID']=$EVT_ID;
870
+		$offset = ($current_page - 1) * $per_page;
871
+		$limit = $count ? NULL : array($offset, $per_page);
872
+		$query_params = array(array('Event.status'=>array('IN', array_keys(EEM_Event::instance()->get_status_array()))));
873
+		if ($EVT_ID) {
874
+			$query_params[0]['EVT_ID'] = $EVT_ID;
875 875
 		}
876
-		if($CAT_ID){
876
+		if ($CAT_ID) {
877 877
 			throw new EE_Error("You specified a Category Id for this query. Thats odd because we are now using terms and taxonomies. So did you mean the term taxonomy id o rthe term id?");
878 878
 		}
879 879
 
880 880
 		//if DTT is included we do multiple datetimes.
881
-		if ( $DTT_ID ) {
881
+		if ($DTT_ID) {
882 882
 			$query_params[0]['Ticket.Datetime.DTT_ID'] = $DTT_ID;
883 883
 		}
884 884
 
885 885
 		//make sure we only have default where on the current regs
886 886
 		$query_params['default_where_conditions'] = 'this_model_only';
887 887
 
888
-		$status_ids_array = apply_filters( 'FHEE__Extend_Registrations_Admin_Page__get_event_attendees__status_ids_array', array( EEM_Registration::status_id_pending_payment, EEM_Registration::status_id_approved ) );
888
+		$status_ids_array = apply_filters('FHEE__Extend_Registrations_Admin_Page__get_event_attendees__status_ids_array', array(EEM_Registration::status_id_pending_payment, EEM_Registration::status_id_approved));
889 889
 
890
-		$query_params[0]['STS_ID']= array('IN', $status_ids_array );
890
+		$query_params[0]['STS_ID'] = array('IN', $status_ids_array);
891 891
 
892
-		if($trash){
893
-			$query_params[0]['Attendee.status']=  EEM_CPT_Base::post_status_trashed;
892
+		if ($trash) {
893
+			$query_params[0]['Attendee.status'] = EEM_CPT_Base::post_status_trashed;
894 894
 		}
895 895
 
896
-		if ( isset( $this->_req_data['s'] ) ) {
897
-			$sstr = '%' . $this->_req_data['s'] . '%';
896
+		if (isset($this->_req_data['s'])) {
897
+			$sstr = '%'.$this->_req_data['s'].'%';
898 898
 			$query_params[0]['OR'] = array(
899
-				'Event.EVT_name' => array( 'LIKE', $sstr),
900
-				'Event.EVT_desc' => array( 'LIKE', $sstr ),
901
-				'Event.EVT_short_desc' => array( 'LIKE' , $sstr ),
902
-				'Attendee.ATT_fname' => array( 'LIKE', $sstr ),
903
-				'Attendee.ATT_lname' => array( 'LIKE', $sstr ),
904
-				'Attendee.ATT_short_bio' => array( 'LIKE', $sstr ),
905
-				'Attendee.ATT_email' => array('LIKE', $sstr ),
906
-				'Attendee.ATT_address' => array( 'LIKE', $sstr ),
907
-				'Attendee.ATT_address2' => array( 'LIKE', $sstr ),
908
-				'Attendee.ATT_city' => array( 'LIKE', $sstr ),
909
-				'REG_final_price' => array( 'LIKE', $sstr ),
910
-				'REG_code' => array( 'LIKE', $sstr ),
911
-				'REG_count' => array( 'LIKE' , $sstr ),
912
-				'REG_group_size' => array( 'LIKE' , $sstr ),
913
-				'Ticket.TKT_name' => array( 'LIKE', $sstr ),
914
-				'Ticket.TKT_description' => array( 'LIKE', $sstr )
899
+				'Event.EVT_name' => array('LIKE', $sstr),
900
+				'Event.EVT_desc' => array('LIKE', $sstr),
901
+				'Event.EVT_short_desc' => array('LIKE', $sstr),
902
+				'Attendee.ATT_fname' => array('LIKE', $sstr),
903
+				'Attendee.ATT_lname' => array('LIKE', $sstr),
904
+				'Attendee.ATT_short_bio' => array('LIKE', $sstr),
905
+				'Attendee.ATT_email' => array('LIKE', $sstr),
906
+				'Attendee.ATT_address' => array('LIKE', $sstr),
907
+				'Attendee.ATT_address2' => array('LIKE', $sstr),
908
+				'Attendee.ATT_city' => array('LIKE', $sstr),
909
+				'REG_final_price' => array('LIKE', $sstr),
910
+				'REG_code' => array('LIKE', $sstr),
911
+				'REG_count' => array('LIKE', $sstr),
912
+				'REG_group_size' => array('LIKE', $sstr),
913
+				'Ticket.TKT_name' => array('LIKE', $sstr),
914
+				'Ticket.TKT_description' => array('LIKE', $sstr)
915 915
 				);
916 916
 		}
917 917
 
918 918
 		$query_params['order_by'][$orderby] = $sort;
919 919
 		$query_params['limit'] = $limit;
920
-		$query_params['force_join'] = array('Attendee');//force join to attendee model so that it gets cached, because we're going to need the attendee for each registration
921
-		if($count){
922
-			$registrations = EEM_Registration::instance()->count(array($query_params[0], 'default_where_conditions' => 'this_model_only' ));
923
-		}else{
920
+		$query_params['force_join'] = array('Attendee'); //force join to attendee model so that it gets cached, because we're going to need the attendee for each registration
921
+		if ($count) {
922
+			$registrations = EEM_Registration::instance()->count(array($query_params[0], 'default_where_conditions' => 'this_model_only'));
923
+		} else {
924 924
 			$registrations = EEM_Registration::instance()->get_all($query_params);
925 925
 
926 926
 
927 927
 	//		$registrations = EEM_Registration::instance();
928 928
 	//		$all_attendees = EEM_Attendee::instance()->get_event_attendees( $EVT_ID, $CAT_ID, $reg_status, $trash, $orderby, $sort, $limit, $output );
929
-			if ( isset( $registrations[0] ) && $registrations[0] instanceof EE_Registration ) {
929
+			if (isset($registrations[0]) && $registrations[0] instanceof EE_Registration) {
930 930
 				//EEH_Debug_Tools::printr( $all_attendees[0], '$all_attendees[0]  <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span>', 'auto' );
931 931
 				// name
932 932
 				$first_registration = $registrations[0];
933 933
 				$event_obj = $first_registration->event_obj();
934
-				if($event_obj){
934
+				if ($event_obj) {
935 935
 					$event_name = $first_registration->event_obj()->name();
936
-					$event_date = 'TODO: we need to get date from earliest price date or should this be the actual event date?';//$first_registration->date_obj()->reg_start_date_and_time('l F j, Y,', ' g:i:s a');// isset( $registrations[0]->DTT_EVT_start ) ? date( 'l F j, Y,    g:i:s a', $registrations[0]->DTT_EVT_start ) : '';
936
+					$event_date = 'TODO: we need to get date from earliest price date or should this be the actual event date?'; //$first_registration->date_obj()->reg_start_date_and_time('l F j, Y,', ' g:i:s a');// isset( $registrations[0]->DTT_EVT_start ) ? date( 'l F j, Y,    g:i:s a', $registrations[0]->DTT_EVT_start ) : '';
937 937
 					// edit event link
938
-					if ( $event_name != '' ) {
939
-						$edit_event_url = self::add_query_args_and_nonce( array( 'action'=>'edit_event', 'EVT_ID'=>$EVT_ID ), EVENTS_ADMIN_URL );
940
-						$edit_event_lnk = '<a href="'.$edit_event_url.'" title="' . esc_attr__( 'Edit ', 'event_espresso' ) . $event_name . '">' . __( 'Edit Event', 'event_espresso' ) . '</a>';
941
-						$event_name .= ' <span class="admin-page-header-edit-lnk not-bold">' . $edit_event_lnk . '</span>' ;
938
+					if ($event_name != '') {
939
+						$edit_event_url = self::add_query_args_and_nonce(array('action'=>'edit_event', 'EVT_ID'=>$EVT_ID), EVENTS_ADMIN_URL);
940
+						$edit_event_lnk = '<a href="'.$edit_event_url.'" title="'.esc_attr__('Edit ', 'event_espresso').$event_name.'">'.__('Edit Event', 'event_espresso').'</a>';
941
+						$event_name .= ' <span class="admin-page-header-edit-lnk not-bold">'.$edit_event_lnk.'</span>';
942 942
 					}
943 943
 
944
-					$back_2_reg_url = self::add_query_args_and_nonce( array( 'action'=>'default' ), REG_ADMIN_URL );
945
-					$back_2_reg_lnk = '<a href="'.$back_2_reg_url.'" title="' . esc_attr__( 'click to return to viewing all registrations ', 'event_espresso' ) . '">&laquo; ' . __( 'Back to All Registrations', 'event_espresso' ) . '</a>';
944
+					$back_2_reg_url = self::add_query_args_and_nonce(array('action'=>'default'), REG_ADMIN_URL);
945
+					$back_2_reg_lnk = '<a href="'.$back_2_reg_url.'" title="'.esc_attr__('click to return to viewing all registrations ', 'event_espresso').'">&laquo; '.__('Back to All Registrations', 'event_espresso').'</a>';
946 946
 
947 947
 					$this->_template_args['before_admin_page_content'] = '
948 948
 				<div id="admin-page-header">
949
-					<h1><span class="small-text not-bold">'.__( 'Event: ', 'event_espresso' ).'</span>'. $event_name .'</h1>
950
-					<h3><span class="small-text not-bold">'.__( 'Date: ', 'event_espresso' ). '</span>'. $event_date .'</h3>
951
-					<span class="admin-page-header-go-back-lnk not-bold">' . $back_2_reg_lnk . '</span>
949
+					<h1><span class="small-text not-bold">'.__('Event: ', 'event_espresso').'</span>'.$event_name.'</h1>
950
+					<h3><span class="small-text not-bold">'.__('Date: ', 'event_espresso').'</span>'.$event_date.'</h3>
951
+					<span class="admin-page-header-go-back-lnk not-bold">' . $back_2_reg_lnk.'</span>
952 952
 				</div>
953 953
 				';
954 954
 				}
Please login to merge, or discard this patch.
admin/extend/transactions/Extend_Transactions_Admin_Page.core.php 4 patches
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
135 135
 	 *
136 136
 	 * @access private
137 137
 	 * @param string $period
138
-	 * @return int
138
+	 * @return string
139 139
 	 */
140 140
 	private function _revenue_per_day_report( $period = '-1 month' ) {
141 141
 
@@ -193,7 +193,7 @@  discard block
 block discarded – undo
193 193
 	 *
194 194
 	 * @access private
195 195
 	 * @param string $period
196
-	 * @return int
196
+	 * @return string
197 197
 	 */
198 198
 	private function _revenue_per_event_report( $period = '-1 month' ) {
199 199
 
Please login to merge, or discard this patch.
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -105,10 +105,10 @@
 block discarded – undo
105 105
 	/**
106 106
 	 * _transaction_reports
107 107
 	 * 	generates Business Reports regarding Transactions
108
-	*
108
+	 *
109 109
 	 * @access protected
110
-	*	@return void
111
-	*/
110
+	 *	@return void
111
+	 */
112 112
 	protected function _transaction_reports() {
113 113
 
114 114
 		$page_args = array();
Please login to merge, or discard this patch.
Spacing   +40 added lines, -40 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if (!defined('EVENT_ESPRESSO_VERSION') )
2
+if ( ! defined('EVENT_ESPRESSO_VERSION'))
3 3
 	exit('NO direct script access allowed');
4 4
 
5 5
 /**
@@ -35,11 +35,11 @@  discard block
 block discarded – undo
35 35
 	 * @param bool $routing
36 36
 	 * @return \Extend_Transactions_Admin_Page
37 37
 	 */
38
-	public function __construct( $routing = TRUE ) {
39
-		parent::__construct( $routing );
40
-		define( 'TXN_CAF_TEMPLATE_PATH', EE_CORE_CAF_ADMIN_EXTEND . 'transactions/templates/');
41
-		define( 'TXN_CAF_ASSETS', EE_CORE_CAF_ADMIN_EXTEND . 'transactions/assets/');
42
-		define( 'TXN_CAF_ASSETS_URL', EE_CORE_CAF_ADMIN_EXTEND_URL . 'transactions/assets/');
38
+	public function __construct($routing = TRUE) {
39
+		parent::__construct($routing);
40
+		define('TXN_CAF_TEMPLATE_PATH', EE_CORE_CAF_ADMIN_EXTEND.'transactions/templates/');
41
+		define('TXN_CAF_ASSETS', EE_CORE_CAF_ADMIN_EXTEND.'transactions/assets/');
42
+		define('TXN_CAF_ASSETS_URL', EE_CORE_CAF_ADMIN_EXTEND_URL.'transactions/assets/');
43 43
 	}
44 44
 
45 45
 
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
 	 * @return void
52 52
 	 */
53 53
 	protected function _extend_page_config() {
54
-		$this->_admin_base_path = EE_CORE_CAF_ADMIN_EXTEND . 'transactions';
54
+		$this->_admin_base_path = EE_CORE_CAF_ADMIN_EXTEND.'transactions';
55 55
 
56 56
 		$new_page_routes = array(
57 57
 			'reports' => array(
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
 			)
61 61
 		);
62 62
 
63
-		$this->_page_routes = array_merge( $this->_page_routes, $new_page_routes );
63
+		$this->_page_routes = array_merge($this->_page_routes, $new_page_routes);
64 64
 
65 65
 		$new_page_config = array(
66 66
 			'reports' => array(
@@ -74,11 +74,11 @@  discard block
 block discarded – undo
74 74
 						'filename' => 'transactions_reports'
75 75
 					)
76 76
 				),
77
-				'help_tour' => array( 'Transaction_Reports_Help_Tour' ),
77
+				'help_tour' => array('Transaction_Reports_Help_Tour'),
78 78
 				'require_nonce' => FALSE
79 79
 			)
80 80
 		);
81
-		$this->_page_config = array_merge( $this->_page_config, $new_page_config );
81
+		$this->_page_config = array_merge($this->_page_config, $new_page_config);
82 82
 	}
83 83
 
84 84
 
@@ -94,8 +94,8 @@  discard block
 block discarded – undo
94 94
 		wp_enqueue_style('jquery-jqplot-css');
95 95
 		//scripts
96 96
 		global $is_IE;
97
-		if ( $is_IE ) {
98
-			wp_enqueue_script( 'excanvas' );
97
+		if ($is_IE) {
98
+			wp_enqueue_script('excanvas');
99 99
 		}
100 100
 		wp_enqueue_script('jqplot-all');
101 101
 	}
@@ -113,13 +113,13 @@  discard block
 block discarded – undo
113 113
 
114 114
 		$page_args = array();
115 115
 
116
-		$page_args['admin_reports'][] = $this->_revenue_per_day_report( '-1 month' );  //  option: '-1 week', '-2 weeks' defaults to '-1 month'
117
-		$page_args['admin_reports'][] = $this->_revenue_per_event_report( '-1 month' ); //  option: '-1 week', '-2 weeks' defaults to '-1 month'
116
+		$page_args['admin_reports'][] = $this->_revenue_per_day_report('-1 month'); //  option: '-1 week', '-2 weeks' defaults to '-1 month'
117
+		$page_args['admin_reports'][] = $this->_revenue_per_event_report('-1 month'); //  option: '-1 week', '-2 weeks' defaults to '-1 month'
118 118
 //		$page_args['admin_reports'][] = 'chart1';
119 119
 
120
-		$template_path = EE_ADMIN_TEMPLATE . 'admin_reports.template.php';
120
+		$template_path = EE_ADMIN_TEMPLATE.'admin_reports.template.php';
121 121
 		$this->_admin_page_title = __('Transactions', 'event_espresso');
122
-		$this->_template_args['admin_page_content'] = EEH_Template::display_template( $template_path, $page_args, TRUE );
122
+		$this->_template_args['admin_page_content'] = EEH_Template::display_template($template_path, $page_args, TRUE);
123 123
 
124 124
 
125 125
 		// the final template wrapper
@@ -137,37 +137,37 @@  discard block
 block discarded – undo
137 137
 	 * @param string $period
138 138
 	 * @return int
139 139
 	 */
140
-	private function _revenue_per_day_report( $period = '-1 month' ) {
140
+	private function _revenue_per_day_report($period = '-1 month') {
141 141
 
142 142
 		$report_ID = 'txn-admin-revenue-per-day-report-dv';
143 143
 		$report_JS = 'espresso_txn_admin_revenue_per_day';
144 144
 
145
-		wp_enqueue_script( $report_JS, TXN_CAF_ASSETS_URL . $report_JS . '_report.js', array('jqplot-all'), '1.0', TRUE);
145
+		wp_enqueue_script($report_JS, TXN_CAF_ASSETS_URL.$report_JS.'_report.js', array('jqplot-all'), '1.0', TRUE);
146 146
 
147 147
 		$TXN = EEM_Transaction::instance();
148 148
 
149
-		$results = $TXN->get_revenue_per_day_report( $period );
149
+		$results = $TXN->get_revenue_per_day_report($period);
150 150
 		//EEH_Debug_Tools::printr( $results, '$registrations_per_day' );
151 151
 		$revenue = array();
152
-		$xmin = date( 'Y-m-d', strtotime( '+1 year' ));
152
+		$xmin = date('Y-m-d', strtotime('+1 year'));
153 153
 		$xmax = 0;
154 154
 		$ymax = 0;
155 155
 
156 156
 		$results = (array) $results;
157 157
 
158
-		foreach ( $results as $result ) {
159
-			$revenue[] = array( $result->txnDate, (float)$result->revenue );
160
-			$xmin = strtotime( $result->txnDate ) < strtotime( $xmin ) ? $result->txnDate : $xmin;
161
-			$xmax = strtotime( $result->txnDate ) > strtotime( $xmax ) ? $result->txnDate : $xmax;
158
+		foreach ($results as $result) {
159
+			$revenue[] = array($result->txnDate, (float) $result->revenue);
160
+			$xmin = strtotime($result->txnDate) < strtotime($xmin) ? $result->txnDate : $xmin;
161
+			$xmax = strtotime($result->txnDate) > strtotime($xmax) ? $result->txnDate : $xmax;
162 162
 			$ymax = $result->revenue > $ymax ? $result->revenue : $ymax;
163 163
 		}
164 164
 
165
-		$xmin = date( 'Y-m-d', strtotime( date( 'Y-m-d', strtotime($xmin)) . ' -1 day' ));
166
-		$xmax = date( 'Y-m-d', strtotime( date( 'Y-m-d', strtotime($xmax)) . ' +1 day' ));
165
+		$xmin = date('Y-m-d', strtotime(date('Y-m-d', strtotime($xmin)).' -1 day'));
166
+		$xmax = date('Y-m-d', strtotime(date('Y-m-d', strtotime($xmax)).' +1 day'));
167 167
 		// calculate # days between our min and max dates
168
-		$span = floor( (strtotime($xmax) - strtotime($xmin)) / (60*60*24)) + 1;
168
+		$span = floor((strtotime($xmax) - strtotime($xmin)) / (60 * 60 * 24)) + 1;
169 169
 
170
-		$report_title = __( 'Total Revenue per Day' );
170
+		$report_title = __('Total Revenue per Day');
171 171
 
172 172
 		$report_params = array(
173 173
 			'title' 		=> $report_title,
@@ -178,9 +178,9 @@  discard block
 block discarded – undo
178 178
 			'ymax' 		=> ceil($ymax * 1.25),
179 179
 			'span' 		=> $span,
180 180
 			'width'		=> ceil(900 / $span),
181
-			'noTxnMsg'	=> sprintf( __('<h2>%s</h2><p>There are currently no transaction records in the last month for this report.</p>', 'event_espresso'), $report_title )
181
+			'noTxnMsg'	=> sprintf(__('<h2>%s</h2><p>There are currently no transaction records in the last month for this report.</p>', 'event_espresso'), $report_title)
182 182
 		);
183
-		wp_localize_script( $report_JS, 'txnRevPerDay', $report_params );
183
+		wp_localize_script($report_JS, 'txnRevPerDay', $report_params);
184 184
 
185 185
 		return $report_ID;
186 186
 	}
@@ -195,29 +195,29 @@  discard block
 block discarded – undo
195 195
 	 * @param string $period
196 196
 	 * @return int
197 197
 	 */
198
-	private function _revenue_per_event_report( $period = '-1 month' ) {
198
+	private function _revenue_per_event_report($period = '-1 month') {
199 199
 
200 200
 		$report_ID = 'txn-admin-revenue-per-event-report-dv';
201 201
 		$report_JS = 'espresso_txn_admin_revenue_per_event';
202 202
 
203
-		wp_enqueue_script( $report_JS, TXN_CAF_ASSETS_URL . $report_JS . '_report.js', array('jqplot-all'), '1.0', TRUE);
203
+		wp_enqueue_script($report_JS, TXN_CAF_ASSETS_URL.$report_JS.'_report.js', array('jqplot-all'), '1.0', TRUE);
204 204
 
205 205
 		$TXN = EEM_Transaction::instance();
206 206
 
207
-		$results = $TXN->get_revenue_per_event_report( $period );
207
+		$results = $TXN->get_revenue_per_event_report($period);
208 208
 
209 209
 		//EEH_Debug_Tools::printr( $results, '$registrations_per_event' );
210 210
 		$revenue = array();
211 211
 		$results = (array) $results;
212
-		foreach ( $results as $result ) {
213
-			$event_name = stripslashes( html_entity_decode( $result->event_name, ENT_QUOTES, 'UTF-8' ));
214
-			$event_name = wp_trim_words( $event_name, 5, '...' );
215
-			$revenue[] = array( $event_name, (float)$result->revenue );
212
+		foreach ($results as $result) {
213
+			$event_name = stripslashes(html_entity_decode($result->event_name, ENT_QUOTES, 'UTF-8'));
214
+			$event_name = wp_trim_words($event_name, 5, '...');
215
+			$revenue[] = array($event_name, (float) $result->revenue);
216 216
 		}
217 217
 
218 218
 		$span = $period == 'week' ? 9 : 33;
219 219
 
220
-		$report_title = __( 'Total Revenue per Event' );
220
+		$report_title = __('Total Revenue per Event');
221 221
 
222 222
 		$report_params = array(
223 223
 			'title' 		=> $report_title,
@@ -225,9 +225,9 @@  discard block
 block discarded – undo
225 225
 			'revenue'	=> $revenue,
226 226
 			'span' 		=> $span,
227 227
 			'width'		=> ceil(900 / $span),
228
-			'noTxnMsg'	=> sprintf( __('<h2>%s</h2><p>There are currently no transaction records in the last month for this report.</p>', 'event_espresso'), $report_title )
228
+			'noTxnMsg'	=> sprintf(__('<h2>%s</h2><p>There are currently no transaction records in the last month for this report.</p>', 'event_espresso'), $report_title)
229 229
 		);
230
-		wp_localize_script( $report_JS, 'revenuePerEvent', $report_params );
230
+		wp_localize_script($report_JS, 'revenuePerEvent', $report_params);
231 231
 
232 232
 		return $report_ID;
233 233
 	}
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -6,8 +6,9 @@
 block discarded – undo
6 6
  * @package Event Espresso
7 7
  * @subpackage messages
8 8
  */
9
-if (!defined('EVENT_ESPRESSO_VERSION') )
9
+if (!defined('EVENT_ESPRESSO_VERSION') ) {
10 10
 	exit('NO direct script access allowed');
11
+}
11 12
 
12 13
 /**
13 14
  *
Please login to merge, or discard this patch.
caffeinated/brewing_regular.php 4 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -56,7 +56,7 @@
 block discarded – undo
56 56
 	/**
57 57
 	 * callback for the FHEE__EE_Registry__load_helper__helper_paths filter to add the caffeinated paths
58 58
 	 * @param array  $paths original helper paths array
59
-	 * @return array             new array of paths
59
+	 * @return string[]             new array of paths
60 60
 	 */
61 61
 	public function caf_helper_paths( $paths ) {
62 62
 		$paths[] = EE_CAF_CORE . 'helpers' . DS;
Please login to merge, or discard this patch.
Spacing   +59 added lines, -59 removed lines patch added patch discarded remove patch
@@ -25,30 +25,30 @@  discard block
 block discarded – undo
25 25
  * ------------------------------------------------------------------------
26 26
  */
27 27
 // defined some new constants related to caffeinated folder
28
-define('EE_CAF_URL', EE_PLUGIN_DIR_URL . 'caffeinated/' );
29
-define('EE_CAF_CORE', EE_CAFF_PATH . 'core' . DS);
30
-define('EE_CAF_LIBRARIES', EE_CAF_CORE . 'libraries' . DS);
31
-define('EE_CAF_PAYMENT_METHODS', EE_CAFF_PATH . 'payment_methods' . DS );
28
+define('EE_CAF_URL', EE_PLUGIN_DIR_URL.'caffeinated/');
29
+define('EE_CAF_CORE', EE_CAFF_PATH.'core'.DS);
30
+define('EE_CAF_LIBRARIES', EE_CAF_CORE.'libraries'.DS);
31
+define('EE_CAF_PAYMENT_METHODS', EE_CAFF_PATH.'payment_methods'.DS);
32 32
 class EE_Brewing_Regular extends EE_Base {
33 33
 
34 34
 	public function __construct() {
35
-		if ( defined( 'EE_CAFF_PATH' )) {
35
+		if (defined('EE_CAFF_PATH')) {
36 36
 			// activation
37
-			add_action( 'AHEE__EEH_Activation__initialize_db_content', array( $this, 'initialize_caf_db_content' ));
37
+			add_action('AHEE__EEH_Activation__initialize_db_content', array($this, 'initialize_caf_db_content'));
38 38
 			// load caff init
39
-			add_action( 'AHEE__EE_System__set_hooks_for_core', array( $this, 'caffeinated_init' ));
39
+			add_action('AHEE__EE_System__set_hooks_for_core', array($this, 'caffeinated_init'));
40 40
 			// make it so the PDF receipt doesn't show our shameless plug
41
-			add_filter( 'FHEE_Invoice__send_invoice__shameless_plug', '__return_false' );
41
+			add_filter('FHEE_Invoice__send_invoice__shameless_plug', '__return_false');
42 42
 			// add caffeinated modules
43
-			add_filter( 'FHEE__EE_Config__register_modules__modules_to_register', array( $this, 'caffeinated_modules_to_register' ));
43
+			add_filter('FHEE__EE_Config__register_modules__modules_to_register', array($this, 'caffeinated_modules_to_register'));
44 44
 			// load caff scripts
45
-			add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_caffeinated_scripts'), 10 );
45
+			add_action('wp_enqueue_scripts', array($this, 'enqueue_caffeinated_scripts'), 10);
46 46
 
47
-			add_filter( 'FHEE__EE_Registry__load_helper__helper_paths', array( $this, 'caf_helper_paths' ), 10 );
47
+			add_filter('FHEE__EE_Registry__load_helper__helper_paths', array($this, 'caf_helper_paths'), 10);
48 48
 
49
-			add_filter( 'FHEE__EE_Payment_Method_Manager__register_payment_methods__payment_methods_to_register', array( $this, 'caf_payment_methods' ) );
49
+			add_filter('FHEE__EE_Payment_Method_Manager__register_payment_methods__payment_methods_to_register', array($this, 'caf_payment_methods'));
50 50
 			// caffeinated constructed
51
-			do_action( 'AHEE__EE_Brewing_Regular__construct__complete' );
51
+			do_action('AHEE__EE_Brewing_Regular__construct__complete');
52 52
 		}
53 53
 	}
54 54
 
@@ -58,8 +58,8 @@  discard block
 block discarded – undo
58 58
 	 * @param array  $paths original helper paths array
59 59
 	 * @return array             new array of paths
60 60
 	 */
61
-	public function caf_helper_paths( $paths ) {
62
-		$paths[] = EE_CAF_CORE . 'helpers' . DS;
61
+	public function caf_helper_paths($paths) {
62
+		$paths[] = EE_CAF_CORE.'helpers'.DS;
63 63
 		return $paths;
64 64
 	}
65 65
 
@@ -75,22 +75,22 @@  discard block
 block discarded – undo
75 75
 	 * Right now, we ASSUME the only price types in the system are default ones
76 76
 	 * @global type $wpdb
77 77
 	 */
78
-	function initialize_caf_db_content(){
78
+	function initialize_caf_db_content() {
79 79
 //		echo "initialize caf db content!";
80 80
 		global $wpdb;
81 81
 
82 82
 		//use same method of getting creator id as the version introducing the change
83
-		$default_creator_id = apply_filters('FHEE__EE_DMS_Core_4_5_0__get_default_creator_id',get_current_user_id());
83
+		$default_creator_id = apply_filters('FHEE__EE_DMS_Core_4_5_0__get_default_creator_id', get_current_user_id());
84 84
 
85 85
 		$price_type_table = $wpdb->prefix."esp_price_type";
86 86
 		$price_table = $wpdb->prefix."esp_price";
87 87
 
88 88
 		if ($wpdb->get_var("SHOW TABLES LIKE '$price_type_table'") == $price_type_table) {
89 89
 
90
-			$SQL = 'SELECT COUNT(PRT_ID) FROM ' . $price_type_table . ' WHERE PBT_ID=4';//include trashed price types
91
-			$tax_price_type_count = $wpdb->get_var( $SQL );
90
+			$SQL = 'SELECT COUNT(PRT_ID) FROM '.$price_type_table.' WHERE PBT_ID=4'; //include trashed price types
91
+			$tax_price_type_count = $wpdb->get_var($SQL);
92 92
 
93
-			if ( $tax_price_type_count <= 1) {
93
+			if ($tax_price_type_count <= 1) {
94 94
 				$result = $wpdb->insert($price_type_table,
95 95
 						array(
96 96
 							'PRT_name'=>  __("Regional Tax", "event_espresso"),
@@ -101,11 +101,11 @@  discard block
 block discarded – undo
101 101
 							'PRT_wp_user' => $default_creator_id
102 102
 						),
103 103
 						array(
104
-							'%s',//PRT_name
105
-							'%d',//PBT_id
106
-							'%d',//PRT_is_percent
107
-							'%d',//PRT_order
108
-							'%d',//PRT_deleted
104
+							'%s', //PRT_name
105
+							'%d', //PBT_id
106
+							'%d', //PRT_is_percent
107
+							'%d', //PRT_order
108
+							'%d', //PRT_deleted
109 109
 							'%d', //PRT_wp_user
110 110
 						));
111 111
 				//federal tax
@@ -119,14 +119,14 @@  discard block
 block discarded – undo
119 119
 							'PRT_wp_user' => $default_creator_id,
120 120
 						),
121 121
 						array(
122
-							'%s',//PRT_name
123
-							'%d',//PBT_id
124
-							'%d',//PRT_is_percent
125
-							'%d',//PRT_order
126
-							'%d',//PRT_deleted
122
+							'%s', //PRT_name
123
+							'%d', //PBT_id
124
+							'%d', //PRT_is_percent
125
+							'%d', //PRT_order
126
+							'%d', //PRT_deleted
127 127
 							'%d' //PRT_wp_user
128 128
 						));
129
-				if( $result){
129
+				if ($result) {
130 130
 					$wpdb->insert($price_table,
131 131
 							array(
132 132
 								'PRT_ID'=>$wpdb->insert_id,
@@ -141,15 +141,15 @@  discard block
 block discarded – undo
141 141
 								'PRC_wp_user' => $default_creator_id
142 142
 							),
143 143
 							array(
144
-								'%d',//PRT_id
145
-								'%f',//PRC_amount
146
-								'%s',//PRC_name
147
-								'%s',//PRC_desc
148
-								'%d',//PRC_is_default
149
-								'%d',//PRC_overrides
150
-								'%d',//PRC_deleted
151
-								'%d',//PRC_order
152
-								'%d',//PRC_parent
144
+								'%d', //PRT_id
145
+								'%f', //PRC_amount
146
+								'%s', //PRC_name
147
+								'%s', //PRC_desc
148
+								'%d', //PRC_is_default
149
+								'%d', //PRC_overrides
150
+								'%d', //PRC_deleted
151
+								'%d', //PRC_order
152
+								'%d', //PRC_parent
153 153
 								'%d' //PRC_wp_user
154 154
 							));
155 155
 				}
@@ -169,11 +169,11 @@  discard block
 block discarded – undo
169 169
 	 *  	@param array $modules_to_register
170 170
 	 *  	@return array
171 171
 	 */
172
-	public function caffeinated_modules_to_register( $modules_to_register = array() ){
173
-		if ( is_readable( EE_CAFF_PATH . 'modules' )) {
174
-			$caffeinated_modules_to_register = glob( EE_CAFF_PATH . 'modules' . DS . '*', GLOB_ONLYDIR );
175
-			if ( is_array( $caffeinated_modules_to_register ) && ! empty( $caffeinated_modules_to_register )) {
176
-				$modules_to_register = array_merge( $modules_to_register, $caffeinated_modules_to_register );
172
+	public function caffeinated_modules_to_register($modules_to_register = array()) {
173
+		if (is_readable(EE_CAFF_PATH.'modules')) {
174
+			$caffeinated_modules_to_register = glob(EE_CAFF_PATH.'modules'.DS.'*', GLOB_ONLYDIR);
175
+			if (is_array($caffeinated_modules_to_register) && ! empty($caffeinated_modules_to_register)) {
176
+				$modules_to_register = array_merge($modules_to_register, $caffeinated_modules_to_register);
177 177
 			}
178 178
 		}
179 179
 		return $modules_to_register;
@@ -181,19 +181,19 @@  discard block
 block discarded – undo
181 181
 
182 182
 
183 183
 
184
-	public function caffeinated_init(){
184
+	public function caffeinated_init() {
185 185
 		// EE_Register_CPTs hooks
186
-		add_filter('FHEE__EE_Register_CPTs__get_taxonomies__taxonomies', array( $this, 'filter_taxonomies' ), 10 );
187
-		add_filter('FHEE__EE_Register_CPTs__get_CPTs__cpts', array( $this, 'filter_cpts' ), 10 );
188
-		add_filter('FHEE__EE_Admin__get_extra_nav_menu_pages_items', array( $this, 'nav_metabox_items' ), 10 );
189
-		EE_Registry::instance()->load_file( EE_CAFF_PATH, 'EE_Caf_Messages', 'class', array(), FALSE );
186
+		add_filter('FHEE__EE_Register_CPTs__get_taxonomies__taxonomies', array($this, 'filter_taxonomies'), 10);
187
+		add_filter('FHEE__EE_Register_CPTs__get_CPTs__cpts', array($this, 'filter_cpts'), 10);
188
+		add_filter('FHEE__EE_Admin__get_extra_nav_menu_pages_items', array($this, 'nav_metabox_items'), 10);
189
+		EE_Registry::instance()->load_file(EE_CAFF_PATH, 'EE_Caf_Messages', 'class', array(), FALSE);
190 190
 		// caffeinated_init__complete hook
191
-		do_action( 'AHEE__EE_Brewing_Regular__caffeinated_init__complete' );
191
+		do_action('AHEE__EE_Brewing_Regular__caffeinated_init__complete');
192 192
 	}
193 193
 
194 194
 
195 195
 
196
-	public function enqueue_caffeinated_scripts(){
196
+	public function enqueue_caffeinated_scripts() {
197 197
 		// sound of crickets...
198 198
 	}
199 199
 
@@ -202,23 +202,23 @@  discard block
 block discarded – undo
202 202
 	 * callbacks below here
203 203
 	 */
204 204
 
205
-	public function filter_taxonomies( $taxonomy_array ) {
205
+	public function filter_taxonomies($taxonomy_array) {
206 206
 		$taxonomy_array['espresso_venue_categories']['args']['show_in_nav_menus'] = TRUE;
207 207
 		return $taxonomy_array;
208 208
 	}
209 209
 
210 210
 
211 211
 
212
-	public function filter_cpts( $cpt_array ) {
212
+	public function filter_cpts($cpt_array) {
213 213
 		$cpt_array['espresso_venues']['args']['show_in_nav_menus'] = TRUE;
214 214
 		return $cpt_array;
215 215
 	}
216 216
 
217 217
 
218
-	public function nav_metabox_items( $menuitems ) {
218
+	public function nav_metabox_items($menuitems) {
219 219
 		$menuitems[] = array(
220 220
 			'title' => __('Venue List', 'event_espresso'),
221
-			'url' => get_post_type_archive_link( 'espresso_venues' ),
221
+			'url' => get_post_type_archive_link('espresso_venues'),
222 222
 			'description' => __('Archive page for all venues.', 'event_espresso')
223 223
 			);
224 224
 		return $menuitems;
@@ -229,9 +229,9 @@  discard block
 block discarded – undo
229 229
 	 * @param array $payment_method_paths
230 230
 	 * @return array values are folder paths to payment method folders
231 231
 	 */
232
-	public function caf_payment_methods( $payment_method_paths ) {
233
-		$caf_payment_methods_paths = glob( EE_CAF_PAYMENT_METHODS . '*', GLOB_ONLYDIR );
234
-		$payment_method_paths = array_merge( $payment_method_paths, $caf_payment_methods_paths );
232
+	public function caf_payment_methods($payment_method_paths) {
233
+		$caf_payment_methods_paths = glob(EE_CAF_PAYMENT_METHODS.'*', GLOB_ONLYDIR);
234
+		$payment_method_paths = array_merge($payment_method_paths, $caf_payment_methods_paths);
235 235
 		return $payment_method_paths;
236 236
 	}
237 237
 }
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,4 +1,6 @@
 block discarded – undo
1
-<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) exit('No direct script access allowed');
1
+<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) {
2
+	exit('No direct script access allowed');
3
+}
2 4
 /**
3 5
  * Event Espresso
4 6
  *
Please login to merge, or discard this patch.
Indentation   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -1,29 +1,29 @@
 block discarded – undo
1 1
 <?php if ( ! defined('EVENT_ESPRESSO_VERSION')) exit('No direct script access allowed');
2 2
 /**
3
- * the purpose of this file is to simply contain any action/filter hook callbacks etc for specific aspects of EE related to caffeinated (regular) use.  Before putting any code in here, First be certain that it isn't better to define and use the hook in a specific caffeinated/whatever class or file.
4
- */
3
+	 * the purpose of this file is to simply contain any action/filter hook callbacks etc for specific aspects of EE related to caffeinated (regular) use.  Before putting any code in here, First be certain that it isn't better to define and use the hook in a specific caffeinated/whatever class or file.
4
+	 */
5 5
 /**
6
- * Event Espresso
7
- *
8
- * Event Registration and Management Plugin for WordPress
9
- *
10
- * @ package			Event Espresso
11
- * @ author				Seth Shoultes
12
- * @ copyright			(c) 2008-2011 Event Espresso  All Rights Reserved.
13
- * @ license			http://eventespresso.com/support/terms-conditions/   * see Plugin Licensing *
14
- * @ link				http://www.eventespresso.com
15
- * @ version		 	4.0
16
- *
17
- * ------------------------------------------------------------------------
18
- *
19
- * EE_Brewing_Regular class.  Just a wrapper to help namespace activity for the functionality of this file.
20
- *
21
- * @package		Event Espresso
22
- * @subpackage	/caffeinated/brewing_regular.php
23
- * @author		Darren Ethier
24
- *
25
- * ------------------------------------------------------------------------
26
- */
6
+	 * Event Espresso
7
+	 *
8
+	 * Event Registration and Management Plugin for WordPress
9
+	 *
10
+	 * @ package			Event Espresso
11
+	 * @ author				Seth Shoultes
12
+	 * @ copyright			(c) 2008-2011 Event Espresso  All Rights Reserved.
13
+	 * @ license			http://eventespresso.com/support/terms-conditions/   * see Plugin Licensing *
14
+	 * @ link				http://www.eventespresso.com
15
+	 * @ version		 	4.0
16
+	 *
17
+	 * ------------------------------------------------------------------------
18
+	 *
19
+	 * EE_Brewing_Regular class.  Just a wrapper to help namespace activity for the functionality of this file.
20
+	 *
21
+	 * @package		Event Espresso
22
+	 * @subpackage	/caffeinated/brewing_regular.php
23
+	 * @author		Darren Ethier
24
+	 *
25
+	 * ------------------------------------------------------------------------
26
+	 */
27 27
 // defined some new constants related to caffeinated folder
28 28
 define('EE_CAF_URL', EE_PLUGIN_DIR_URL . 'caffeinated/' );
29 29
 define('EE_CAF_CORE', EE_CAFF_PATH . 'core' . DS);
Please login to merge, or discard this patch.
caffeinated/EE_Caf_Messages.class.php 3 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -72,7 +72,7 @@
 block discarded – undo
72 72
 	/**
73 73
 	 * This just allows us to add additional paths to the autoloader (EED_Messages::autoload_messages()) for the messages system.
74 74
 	 * @param  array  $dir_ref original array of paths
75
-	 * @return array           appended paths
75
+	 * @return string[]           appended paths
76 76
 	 */
77 77
 	public function messages_autoload_paths( $dir_ref ) {
78 78
 		$dir_ref[] = EE_CAF_LIBRARIES . 'shortcodes/';
Please login to merge, or discard this patch.
Braces   +21 added lines, -13 removed lines patch added patch discarded remove patch
@@ -5,7 +5,9 @@  discard block
 block discarded – undo
5 5
  * @subpackage plugin api, messages
6 6
  * @since           4.3.2
7 7
  */
8
-if ( ! defined('EVENT_ESPRESSO_VERSION')) exit('No direct script access allowed');
8
+if ( ! defined('EVENT_ESPRESSO_VERSION')) {
9
+	exit('No direct script access allowed');
10
+}
9 11
 
10 12
 /**
11 13
  * Used to initialize all EE messages caffeinated functionality.
@@ -291,8 +293,9 @@  discard block
 block discarded – undo
291 293
 
292 294
 	public function additional_attendee_parser( $parsed, $shortcode, $data, $extra_data, $shortcode_parser ) {
293 295
 
294
-		if ( strpos( $shortcode, '[ANSWER_*' ) === FALSE || !isset( $extra_data['data']->questions) || !isset( $extra_data['data']->registrations) )
295
-			return $parsed;
296
+		if ( strpos( $shortcode, '[ANSWER_*' ) === FALSE || !isset( $extra_data['data']->questions) || !isset( $extra_data['data']->registrations) ) {
297
+					return $parsed;
298
+		}
296 299
 
297 300
 		//let's get the question from the code.
298 301
 		$shortcode = str_replace('[ANSWER_*', '', $shortcode);
@@ -388,14 +391,16 @@  discard block
 block discarded – undo
388 391
 
389 392
 	public function additional_recipient_details_parser( $parsed, $shortcode, $data, $extra_data, $shortcode_parser ) {
390 393
 
391
-		if ( array($data) && ! isset( $data['data'] ) )
392
-			return $parsed;
394
+		if ( array($data) && ! isset( $data['data'] ) ) {
395
+					return $parsed;
396
+		}
393 397
 
394 398
 		$recipient = $data['data'] instanceof EE_Messages_Addressee ? $data['data'] : NULL;
395 399
 		$recipient = ! $recipient instanceof EE_Messages_Addressee && array($extra_data) && isset( $extra_data['data'] ) && $extra_data['data'] instanceof EE_Messages_Addressee ? $extra_data['data'] : $recipient;
396 400
 
397
-		if ( ! $recipient instanceof EE_Messages_Addressee )
398
-			return $parsed;
401
+		if ( ! $recipient instanceof EE_Messages_Addressee ) {
402
+					return $parsed;
403
+		}
399 404
 
400 405
 		switch ( $shortcode ) {
401 406
 			case '[RECIPIENT_QUESTION_LIST]' :
@@ -464,21 +469,24 @@  discard block
 block discarded – undo
464 469
 
465 470
 
466 471
 	public function additional_primary_registration_details_parser( $parsed, $shortcode, $data, $extra_data, $shortcode_parser ) {
467
-		if ( array($data) && ! isset( $data['data'] ) )
468
-			return $parsed;
472
+		if ( array($data) && ! isset( $data['data'] ) ) {
473
+					return $parsed;
474
+		}
469 475
 
470 476
 		$recipient = $data['data'] instanceof EE_Messages_Addressee ? $data['data'] : NULL;
471 477
 		$recipient = ! $recipient instanceof EE_Messages_Addressee && array($extra_data) && isset( $extra_data['data'] ) && $extra_data['data'] instanceof EE_Messages_Addressee ? $extra_data['data'] : $recipient;
472 478
 
473
-		if ( ! $recipient instanceof EE_Messages_Addressee )
474
-			return $parsed;
479
+		if ( ! $recipient instanceof EE_Messages_Addressee ) {
480
+					return $parsed;
481
+		}
475 482
 
476 483
 		$send_data = ! $data['data'] instanceof EE_Messages_Addressee ? $extra_data : $data;
477 484
 
478 485
 		switch ( $shortcode ) {
479 486
 			case '[RECIPIENT_QUESTION_LIST]' :
480
-				if ( ! $recipient->primary_att_obj instanceof EE_Attendee || ! $recipient->primary_reg_obj instanceof EE_Registration )
481
-					return '';
487
+				if ( ! $recipient->primary_att_obj instanceof EE_Attendee || ! $recipient->primary_reg_obj instanceof EE_Registration ) {
488
+									return '';
489
+				}
482 490
 				$registration = $recipient->primary_reg_obj;
483 491
 				$template = is_array($data['template'] ) && isset($data['template']['question_list']) ? $data['template']['question_list'] : $extra_data['template']['question_list'];
484 492
 				$valid_shortcodes = array('question');
Please login to merge, or discard this patch.
Spacing   +142 added lines, -142 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
  * @since            4.3.2
16 16
  * @author          Darren Ethier
17 17
  */
18
-class EE_Caf_Messages  {
18
+class EE_Caf_Messages {
19 19
 
20 20
 
21 21
 	/**
@@ -34,36 +34,36 @@  discard block
 block discarded – undo
34 34
 	 * @return void
35 35
 	 */
36 36
 	private function _caf_hooks() {
37
-		add_filter('FHEE__EED_Messages___set_messages_paths___MSG_PATHS', array( $this, 'messages_autoload_paths'), 5 );
38
-		add_filter('FHEE__EE_Email_messenger__get_validator_config', array( $this, 'email_messenger_validator_config'), 5, 2 );
39
-		add_filter('FHEE__EE_Email_messenger__get_template_fields', array( $this, 'email_messenger_template_fields'), 5, 2 );
40
-		add_filter( 'FHEE__EE_Html_messenger__get_template_fields', array( $this, 'html_messenger_template_fields' ), 5, 2 );
41
-		add_filter( 'FHEE__EE_Html_messenger__get_validator_config', array( $this, 'html_messenger_validator_config' ), 5, 2 );
42
-		add_filter( 'FHEE__EE_Pdf_messenger__get_template_fields', array( $this, 'pdf_messenger_template_fields' ), 5, 2 );
43
-		add_filter( 'FHEE__EE_Pdf_messenger__get_validator_config', array( $this, 'pdf_messenger_validator_config' ), 5, 2 );
44
-		add_filter('FHEE__EE_Messages_Template_Pack__get_specific_template__contents', array( $this, 'new_default_templates'), 5, 7 );
45
-		add_filter('FHEE__EE_Messages_Base__get_valid_shortcodes', array( $this, 'message_types_valid_shortcodes'), 5, 2 );
37
+		add_filter('FHEE__EED_Messages___set_messages_paths___MSG_PATHS', array($this, 'messages_autoload_paths'), 5);
38
+		add_filter('FHEE__EE_Email_messenger__get_validator_config', array($this, 'email_messenger_validator_config'), 5, 2);
39
+		add_filter('FHEE__EE_Email_messenger__get_template_fields', array($this, 'email_messenger_template_fields'), 5, 2);
40
+		add_filter('FHEE__EE_Html_messenger__get_template_fields', array($this, 'html_messenger_template_fields'), 5, 2);
41
+		add_filter('FHEE__EE_Html_messenger__get_validator_config', array($this, 'html_messenger_validator_config'), 5, 2);
42
+		add_filter('FHEE__EE_Pdf_messenger__get_template_fields', array($this, 'pdf_messenger_template_fields'), 5, 2);
43
+		add_filter('FHEE__EE_Pdf_messenger__get_validator_config', array($this, 'pdf_messenger_validator_config'), 5, 2);
44
+		add_filter('FHEE__EE_Messages_Template_Pack__get_specific_template__contents', array($this, 'new_default_templates'), 5, 7);
45
+		add_filter('FHEE__EE_Messages_Base__get_valid_shortcodes', array($this, 'message_types_valid_shortcodes'), 5, 2);
46 46
 
47 47
 		//shortcode parsers
48
-		add_filter('FHEE__EE_Attendee_Shortcodes__shortcodes', array( $this, 'additional_attendee_shortcodes'), 5, 2 );
49
-		add_filter('FHEE__EE_Attendee_Shortcodes__parser_after', array( $this, 'additional_attendee_parser'), 5, 5 );
50
-		add_filter('FHEE__EE_Recipient_List_Shortcodes__shortcodes', array( $this, 'additional_recipient_details_shortcodes'), 5, 2 );
51
-		add_filter('FHEE__EE_Recipient_List_Shortcodes__parser_after', array( $this, 'additional_recipient_details_parser'), 5, 5 );
52
-		add_filter('FHEE__EE_Primary_Registration_List_Shortcodes__shortcodes', array( $this, 'additional_primary_registration_details_shortcodes'), 5, 2 );
53
-		add_filter('FHEE__EE_Primary_Registration_List_Shortcodes__parser_after', array( $this, 'additional_primary_registration_details_parser'), 5, 5 );
48
+		add_filter('FHEE__EE_Attendee_Shortcodes__shortcodes', array($this, 'additional_attendee_shortcodes'), 5, 2);
49
+		add_filter('FHEE__EE_Attendee_Shortcodes__parser_after', array($this, 'additional_attendee_parser'), 5, 5);
50
+		add_filter('FHEE__EE_Recipient_List_Shortcodes__shortcodes', array($this, 'additional_recipient_details_shortcodes'), 5, 2);
51
+		add_filter('FHEE__EE_Recipient_List_Shortcodes__parser_after', array($this, 'additional_recipient_details_parser'), 5, 5);
52
+		add_filter('FHEE__EE_Primary_Registration_List_Shortcodes__shortcodes', array($this, 'additional_primary_registration_details_shortcodes'), 5, 2);
53
+		add_filter('FHEE__EE_Primary_Registration_List_Shortcodes__parser_after', array($this, 'additional_primary_registration_details_parser'), 5, 5);
54 54
 
55 55
 		/**
56 56
 		 * @since 4.2.0
57 57
 		 */
58
-		add_filter( 'FHEE__EE_Datetime_Shortcodes__shortcodes', array( $this, 'additional_datetime_shortcodes'), 10, 2 );
59
-		add_filter( 'FHEE__EE_Datetime_Shortcodes__parser_after', array( $this, 'additional_datetime_parser'), 10, 5 );
58
+		add_filter('FHEE__EE_Datetime_Shortcodes__shortcodes', array($this, 'additional_datetime_shortcodes'), 10, 2);
59
+		add_filter('FHEE__EE_Datetime_Shortcodes__parser_after', array($this, 'additional_datetime_parser'), 10, 5);
60 60
 
61 61
 		/**
62 62
 		 * @since 4.3.0
63 63
 		 */
64 64
 		//eat our own dog food!
65
-		add_action('EE_Brewing_Regular___messages_caf', array( $this, 'register_caf_message_types' ) );
66
-		add_action('EE_Brewing_Regular___messages_caf', array( $this, 'register_caf_shortcodes' ) );
65
+		add_action('EE_Brewing_Regular___messages_caf', array($this, 'register_caf_message_types'));
66
+		add_action('EE_Brewing_Regular___messages_caf', array($this, 'register_caf_shortcodes'));
67 67
 		do_action('EE_Brewing_Regular___messages_caf');
68 68
 	}
69 69
 
@@ -74,14 +74,14 @@  discard block
 block discarded – undo
74 74
 	 * @param  array  $dir_ref original array of paths
75 75
 	 * @return array           appended paths
76 76
 	 */
77
-	public function messages_autoload_paths( $dir_ref ) {
78
-		$dir_ref[] = EE_CAF_LIBRARIES . 'shortcodes/';
77
+	public function messages_autoload_paths($dir_ref) {
78
+		$dir_ref[] = EE_CAF_LIBRARIES.'shortcodes/';
79 79
 		return $dir_ref;
80 80
 	}
81 81
 
82 82
 
83 83
 
84
-	public function email_messenger_validator_config( $validator_config, EE_Email_Messenger $messenger ) {
84
+	public function email_messenger_validator_config($validator_config, EE_Email_Messenger $messenger) {
85 85
 		$validator_config['attendee_list'] = array(
86 86
 				'shortcodes' => array('attendee', 'event_list', 'ticket_list', 'question_list'),
87 87
 				'required' => array('[ATTENDEE_LIST]')
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
 
96 96
 
97 97
 
98
-	public function html_messenger_validator_config( $validator_config, EE_Html_Messenger $messenger ) {
98
+	public function html_messenger_validator_config($validator_config, EE_Html_Messenger $messenger) {
99 99
 		$validator_config['attendee_list'] = array(
100 100
 			'shortcodes' => array('attendee', 'question_list'),
101 101
 			'required' => array('[ATTENDEE_LIST]')
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
 
110 110
 
111 111
 
112
-	public function pdf_messenger_validator_config( $validator_config, EE_Pdf_Messenger $messenger ) {
112
+	public function pdf_messenger_validator_config($validator_config, EE_Pdf_Messenger $messenger) {
113 113
 		$validator_config['attendee_list'] = array(
114 114
 			'shortcodes' => array('attendee', 'event_list', 'ticket_list', 'question_list'),
115 115
 			'required' => array('[ATTENDEE_LIST]')
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
 
125 125
 
126 126
 
127
-	public function email_messenger_template_fields( $template_fields, EE_Email_Messenger $messenger ) {
127
+	public function email_messenger_template_fields($template_fields, EE_Email_Messenger $messenger) {
128 128
 		$template_fields['extra']['content']['question_list'] = array(
129 129
 						'input' => 'textarea',
130 130
 						'label' => '[QUESTION_LIST]',
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
 	}
141 141
 
142 142
 
143
-	public function html_messenger_template_fields( $template_fields, EE_Html_Messenger $messenger ) {
143
+	public function html_messenger_template_fields($template_fields, EE_Html_Messenger $messenger) {
144 144
 		$template_fields['extra']['content']['question_list'] = array(
145 145
 			'input' => 'textarea',
146 146
 			'label' => '[QUESTION_LIST]',
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
 
158 158
 
159 159
 
160
-	public function pdf_messenger_template_fields( $template_fields, EE_Pdf_Messenger $messenger ) {
160
+	public function pdf_messenger_template_fields($template_fields, EE_Pdf_Messenger $messenger) {
161 161
 		$template_fields['extra']['content']['question_list'] = array(
162 162
 			'input' => 'textarea',
163 163
 			'label' => '[QUESTION_LIST]',
@@ -174,39 +174,39 @@  discard block
 block discarded – undo
174 174
 
175 175
 
176 176
 
177
-	public function new_default_templates( $contents, $actual_path, EE_Messenger $messenger, EE_message_type $message_type, $field, $context, EE_Messages_Template_Pack $template_pack  ) {
177
+	public function new_default_templates($contents, $actual_path, EE_Messenger $messenger, EE_message_type $message_type, $field, $context, EE_Messages_Template_Pack $template_pack) {
178 178
 
179 179
 		//we're only modifying templates for the default template pack
180
-		if ( ! $template_pack instanceof EE_Messages_Template_Pack_Default ) {
180
+		if ( ! $template_pack instanceof EE_Messages_Template_Pack_Default) {
181 181
 			return $contents;
182 182
 		}
183 183
 
184 184
 		//the template file name we're replacing contents for.
185
-		$template_file_prefix = $field . '_' . $context;
186
-		$msg_prefix = $messenger->name . '_' . $message_type->name . '_' ;
185
+		$template_file_prefix = $field.'_'.$context;
186
+		$msg_prefix = $messenger->name.'_'.$message_type->name.'_';
187 187
 
188
-		$base_path = EE_CAF_LIBRARIES . 'messages/defaults/default/';
188
+		$base_path = EE_CAF_LIBRARIES.'messages/defaults/default/';
189 189
 
190
-		if ( $messenger->name == 'email' && $message_type->name == 'registration' ) {
190
+		if ($messenger->name == 'email' && $message_type->name == 'registration') {
191 191
 
192
-			switch ( $template_file_prefix ) {
192
+			switch ($template_file_prefix) {
193 193
 
194 194
 				case 'question_list_admin' :
195 195
 				case 'question_list_attendee' :
196 196
 				case 'question_list_primary_attendee' :
197
-					$path = $base_path . $msg_prefix . 'question_list.template.php';
198
-					$contents = EEH_Template::display_template( $path, array(), true );
197
+					$path = $base_path.$msg_prefix.'question_list.template.php';
198
+					$contents = EEH_Template::display_template($path, array(), true);
199 199
 					break;
200 200
 
201 201
 				case 'attendee_list_primary_attendee' :
202
-					$path = $base_path . $msg_prefix . 'attendee_list.template.php';
203
-					$contents = EEH_Template::display_template( $path, array(), true );
202
+					$path = $base_path.$msg_prefix.'attendee_list.template.php';
203
+					$contents = EEH_Template::display_template($path, array(), true);
204 204
 					break;
205 205
 
206 206
 				case 'attendee_list_admin' :
207
-					$path = $base_path . $msg_prefix . 'attendee_list_admin.template.php';
208
-					$contents = EEH_Template::display_template( $path,
209
-						array(), true );
207
+					$path = $base_path.$msg_prefix.'attendee_list_admin.template.php';
208
+					$contents = EEH_Template::display_template($path,
209
+						array(), true);
210 210
 					break;
211 211
 
212 212
 				case 'attendee_list_attendee' :
@@ -214,33 +214,33 @@  discard block
 block discarded – undo
214 214
 					break;
215 215
 
216 216
 				case 'event_list_attendee' :
217
-					$path = $base_path . $msg_prefix . 'event_list_attendee.template.php';
218
-					$contents = EEH_Template::display_template( $path, array(), true );
217
+					$path = $base_path.$msg_prefix.'event_list_attendee.template.php';
218
+					$contents = EEH_Template::display_template($path, array(), true);
219 219
 					break;
220 220
 			}
221
-		} elseif ( $messenger->name == 'email' && $message_type->name == 'newsletter' ) {
222
-			switch( $template_file_prefix ) {
221
+		} elseif ($messenger->name == 'email' && $message_type->name == 'newsletter') {
222
+			switch ($template_file_prefix) {
223 223
 
224 224
 				case 'content_attendee' :
225
-					$path = $base_path . $msg_prefix . 'content.template.php';
226
-					$contents = EEH_Template::display_template( $path, array(), true );
225
+					$path = $base_path.$msg_prefix.'content.template.php';
226
+					$contents = EEH_Template::display_template($path, array(), true);
227 227
 					break;
228 228
 
229 229
 				case 'newsletter_content_attendee' :
230
-					$path = $base_path . $msg_prefix . 'newsletter_content.template.php';
231
-					$contents = EEH_Template::display_template( $path, array(), true );
230
+					$path = $base_path.$msg_prefix.'newsletter_content.template.php';
231
+					$contents = EEH_Template::display_template($path, array(), true);
232 232
 					break;
233 233
 
234 234
 				case 'newsletter_subject_attendee' :
235
-					$path = $base_path . $msg_prefix . 'subject.template.php';
236
-					$contents = EEH_Template::display_template( $path, array(), true );
235
+					$path = $base_path.$msg_prefix.'subject.template.php';
236
+					$contents = EEH_Template::display_template($path, array(), true);
237 237
 					break;
238 238
 			}
239
-		} elseif ( $messenger->name == 'html' && $message_type->name == 'receipt' ) {
240
-			switch  ( $template_file_prefix ) {
239
+		} elseif ($messenger->name == 'html' && $message_type->name == 'receipt') {
240
+			switch ($template_file_prefix) {
241 241
 				case 'attendee_list_purchaser' :
242
-					$path = $base_path . $msg_prefix . 'attendee_list.template.php';
243
-					$contents = EEH_Template::display_template( $path, array(), true );
242
+					$path = $base_path.$msg_prefix.'attendee_list.template.php';
243
+					$contents = EEH_Template::display_template($path, array(), true);
244 244
 					break;
245 245
 			}
246 246
 		}
@@ -251,7 +251,7 @@  discard block
 block discarded – undo
251 251
 
252 252
 
253 253
 
254
-	public function message_types_valid_shortcodes( $valid_shortcodes, EE_Messages_Base $msg ) {
254
+	public function message_types_valid_shortcodes($valid_shortcodes, EE_Messages_Base $msg) {
255 255
 		//make sure question_list and question are ONLY added for the core message types.  Any other message types will have to explicitly set question_list as a valid shortcode.
256 256
 		$include_with = array(
257 257
 			'registration',
@@ -268,9 +268,9 @@  discard block
 block discarded – undo
268 268
 			'invoice',
269 269
 			'receipt'
270 270
 			);
271
-		if ( $msg instanceof EE_message_type && in_array( $msg->name, $include_with )) {
271
+		if ($msg instanceof EE_message_type && in_array($msg->name, $include_with)) {
272 272
 			$contexts = array_keys($msg->get_contexts());
273
-				foreach ( $contexts as $context ) {
273
+				foreach ($contexts as $context) {
274 274
 					$valid_shortcodes[$context][] = 'question_list';
275 275
 					$valid_shortcodes[$context][] = 'question';
276 276
 				}
@@ -282,35 +282,35 @@  discard block
 block discarded – undo
282 282
 
283 283
 
284 284
 
285
-	public function additional_attendee_shortcodes( $shortcodes, $shortcode_parser ) {
285
+	public function additional_attendee_shortcodes($shortcodes, $shortcode_parser) {
286 286
 		$shortcodes['[ANSWER_*]'] = __('This is a special dynamic shortcode. Right after the "*", add the exact text of a existing question, and if there is an answer for that question for this registrant, that will take the place of this shortcode.', 'event_espresso');
287 287
 		return $shortcodes;
288 288
 	}
289 289
 
290 290
 
291 291
 
292
-	public function additional_attendee_parser( $parsed, $shortcode, $data, $extra_data, $shortcode_parser ) {
292
+	public function additional_attendee_parser($parsed, $shortcode, $data, $extra_data, $shortcode_parser) {
293 293
 
294
-		if ( strpos( $shortcode, '[ANSWER_*' ) === FALSE || !isset( $extra_data['data']->questions) || !isset( $extra_data['data']->registrations) )
294
+		if (strpos($shortcode, '[ANSWER_*') === FALSE || ! isset($extra_data['data']->questions) || ! isset($extra_data['data']->registrations))
295 295
 			return $parsed;
296 296
 
297 297
 		//let's get the question from the code.
298 298
 		$shortcode = str_replace('[ANSWER_*', '', $shortcode);
299
-		$shortcode = trim( str_replace(']', '', $shortcode) );
299
+		$shortcode = trim(str_replace(']', '', $shortcode));
300 300
 
301 301
 		$registration = $data instanceof EE_Registration ? $data : null;
302
-		$registration = ! $registration instanceof EE_Registration && is_array( $extra_data ) && isset( $extra_data['data'] ) && $extra_data['data'] instanceof EE_Registration ? $extra_data['data'] : $registration;
302
+		$registration = ! $registration instanceof EE_Registration && is_array($extra_data) && isset($extra_data['data']) && $extra_data['data'] instanceof EE_Registration ? $extra_data['data'] : $registration;
303 303
 
304 304
 		$aee = $data instanceof EE_Messages_Addressee ? $data : null;
305
-		$aee = ! $aee instanceof EE_Messages_Addressee && is_array( $extra_data ) && isset( $extra_data['data'] ) ? $extra_data['data'] : $aee;
305
+		$aee = ! $aee instanceof EE_Messages_Addressee && is_array($extra_data) && isset($extra_data['data']) ? $extra_data['data'] : $aee;
306 306
 
307
-		if ( ! $registration instanceof EE_Registration || ! $aee instanceof EE_Messages_Addressee ) {
307
+		if ( ! $registration instanceof EE_Registration || ! $aee instanceof EE_Messages_Addressee) {
308 308
 			return $parsed;
309 309
 		}
310 310
 
311 311
 		//now let's figure out which question has this text.
312
-		foreach ( $aee->questions as $ansid => $question ) {
313
-			if ( $question instanceof EE_Question && $question->display_text() == $shortcode && isset($aee->registrations[$registration->ID()]['ans_objs'][$ansid]) ) {
312
+		foreach ($aee->questions as $ansid => $question) {
313
+			if ($question instanceof EE_Question && $question->display_text() == $shortcode && isset($aee->registrations[$registration->ID()]['ans_objs'][$ansid])) {
314 314
 				return $aee->registrations[$registration->ID()]['ans_objs'][$ansid]->get_pretty('ANS_value', 'no_wpautop');
315 315
 			}
316 316
 		}
@@ -332,7 +332,7 @@  discard block
 block discarded – undo
332 332
 	 * @return array                   						array of shortcodes and
333 333
 	 *                                             			descriptions
334 334
 	 */
335
-	public function additional_datetime_shortcodes( $shortcodes, $shortcode_parser ) {
335
+	public function additional_datetime_shortcodes($shortcodes, $shortcode_parser) {
336 336
 		$shortcodes['[DTT_NAME]'] = __('This will be parsed to the Title given for a Datetime', 'event_espresso');
337 337
 		$shortcodes['[DTT_DESCRIPTION]'] = __('This will be parsed to the description for a Datetime', 'event_espresso');
338 338
 		$shortcodes['[DTT_NAME_OR_DATES]'] = __('When parsed, if the Datetime has a name, it is used, otherwise a formatted string including the start date and end date will be used.', 'event_espresso');
@@ -354,13 +354,13 @@  discard block
 block discarded – undo
354 354
 	 * @param  EE_Datetime_Shortcodes $shortcode_parser
355 355
 	 * @return string                   The new parsed string.
356 356
 	 */
357
-	public function additional_datetime_parser( $parsed, $shortcode, $data, $extra_data, $shortcode_parser ) {
357
+	public function additional_datetime_parser($parsed, $shortcode, $data, $extra_data, $shortcode_parser) {
358 358
 
359
-		if ( ! $data instanceof EE_Datetime ) {
359
+		if ( ! $data instanceof EE_Datetime) {
360 360
 			return ''; //get out because we can only parse with the datetime object.
361 361
 		}
362 362
 
363
-		switch ( $shortcode ) {
363
+		switch ($shortcode) {
364 364
 			case '[DTT_NAME]' :
365 365
 				return $data->name();
366 366
 				break;
@@ -368,7 +368,7 @@  discard block
 block discarded – undo
368 368
 				return $data->description();
369 369
 				break;
370 370
 			case '[DTT_NAME_OR_DATES]' :
371
-				return $data->get_dtt_display_name( TRUE );
371
+				return $data->get_dtt_display_name(TRUE);
372 372
 				break;
373 373
 			default :
374 374
 				return $parsed;
@@ -380,40 +380,40 @@  discard block
 block discarded – undo
380 380
 
381 381
 
382 382
 
383
-	public function additional_recipient_details_shortcodes( $shortcodes, $shortcode_parser ) {
383
+	public function additional_recipient_details_shortcodes($shortcodes, $shortcode_parser) {
384 384
 		$shortcodes['[RECIPIENT_QUESTION_LIST]'] = __('This is used to indicate where you want the list of questions and answers to show for the person receiving the message.', 'event_espresso');
385 385
 		return $shortcodes;
386 386
 	}
387 387
 
388 388
 
389
-	public function additional_recipient_details_parser( $parsed, $shortcode, $data, $extra_data, $shortcode_parser ) {
389
+	public function additional_recipient_details_parser($parsed, $shortcode, $data, $extra_data, $shortcode_parser) {
390 390
 
391
-		if ( array($data) && ! isset( $data['data'] ) )
391
+		if (array($data) && ! isset($data['data']))
392 392
 			return $parsed;
393 393
 
394 394
 		$recipient = $data['data'] instanceof EE_Messages_Addressee ? $data['data'] : NULL;
395
-		$recipient = ! $recipient instanceof EE_Messages_Addressee && array($extra_data) && isset( $extra_data['data'] ) && $extra_data['data'] instanceof EE_Messages_Addressee ? $extra_data['data'] : $recipient;
395
+		$recipient = ! $recipient instanceof EE_Messages_Addressee && array($extra_data) && isset($extra_data['data']) && $extra_data['data'] instanceof EE_Messages_Addressee ? $extra_data['data'] : $recipient;
396 396
 
397
-		if ( ! $recipient instanceof EE_Messages_Addressee )
397
+		if ( ! $recipient instanceof EE_Messages_Addressee)
398 398
 			return $parsed;
399 399
 
400
-		switch ( $shortcode ) {
400
+		switch ($shortcode) {
401 401
 			case '[RECIPIENT_QUESTION_LIST]' :
402 402
 				$att = $recipient->att_obj;
403 403
 				$registrations_on_attendee = $att instanceof EE_Attendee ? $recipient->attendees[$att->ID()]['reg_objs'] : array();
404
-				$registrations_on_attendee = empty( $registrations_on_attendee ) && $recipient->reg_obj instanceof EE_Registration ? array( $recipient->reg_obj ) : $registrations_on_attendee;
404
+				$registrations_on_attendee = empty($registrations_on_attendee) && $recipient->reg_obj instanceof EE_Registration ? array($recipient->reg_obj) : $registrations_on_attendee;
405 405
 				$answers = array();
406 406
 
407
-				$template = is_array($data['template'] ) && isset($data['template']['question_list']) ? $data['template']['question_list'] : $extra_data['template']['question_list'];
407
+				$template = is_array($data['template']) && isset($data['template']['question_list']) ? $data['template']['question_list'] : $extra_data['template']['question_list'];
408 408
 				$valid_shortcodes = array('question');
409 409
 
410 410
 				//if the context is main_content then get all answers for all registrations on this attendee
411
-				if ( $data['data'] instanceof EE_Messages_Addressee ) {
412
-					foreach ( $registrations_on_attendee as $reg ) {
413
-						if ( $reg instanceof EE_Registration ) {
414
-							$anss = !empty($recipient->registrations[$reg->ID()]['ans_objs']) ? $recipient->registrations[$reg->ID()]['ans_objs'] : array();
415
-							foreach( $anss as $ans ) {
416
-								if ( $ans instanceof EE_Answer ) {
411
+				if ($data['data'] instanceof EE_Messages_Addressee) {
412
+					foreach ($registrations_on_attendee as $reg) {
413
+						if ($reg instanceof EE_Registration) {
414
+							$anss = ! empty($recipient->registrations[$reg->ID()]['ans_objs']) ? $recipient->registrations[$reg->ID()]['ans_objs'] : array();
415
+							foreach ($anss as $ans) {
416
+								if ($ans instanceof EE_Answer) {
417 417
 									$answers[$ans->ID()] = $ans;
418 418
 								}
419 419
 							}
@@ -422,13 +422,13 @@  discard block
 block discarded – undo
422 422
 				}
423 423
 
424 424
 				//if the context is the event list parser, then let's return just the answers for all registrations attached to the recipient for that event.
425
-				if ( $data['data'] instanceof EE_Event ) {
425
+				if ($data['data'] instanceof EE_Event) {
426 426
 					$event = $data['data'];
427
-					foreach( $registrations_on_attendee as $reg ) {
428
-						if ( $reg instanceof EE_Registration && $reg->event_ID() == $event->ID() ) {
429
-							$anss = !empty($recipient->registrations[$reg->ID()]['ans_objs']) ? $recipient->registrations[$reg->ID()]['ans_objs'] : array();
430
-							foreach( $anss as $ans ) {
431
-								if ( $ans instanceof EE_Answer ) {
427
+					foreach ($registrations_on_attendee as $reg) {
428
+						if ($reg instanceof EE_Registration && $reg->event_ID() == $event->ID()) {
429
+							$anss = ! empty($recipient->registrations[$reg->ID()]['ans_objs']) ? $recipient->registrations[$reg->ID()]['ans_objs'] : array();
430
+							foreach ($anss as $ans) {
431
+								if ($ans instanceof EE_Answer) {
432 432
 									$answers[$ans->ID()] = $ans;
433 433
 								}
434 434
 							}
@@ -438,13 +438,13 @@  discard block
 block discarded – undo
438 438
 
439 439
 				$question_list = '';
440 440
 				$shortcode_helper = $shortcode_parser->get_shortcode_helper();
441
-				foreach ( $answers as $answer ) {
442
-					if ( $answer instanceof EE_Answer ) {
441
+				foreach ($answers as $answer) {
442
+					if ($answer instanceof EE_Answer) {
443 443
 						$question = $answer->question();
444
-						if ( ! $question instanceof EE_Question || ( $question instanceof EE_Question && $question->admin_only() ) ) {
444
+						if ( ! $question instanceof EE_Question || ($question instanceof EE_Question && $question->admin_only())) {
445 445
 							continue;
446 446
 						}
447
-						$question_list .= $shortcode_helper->parse_question_list_template( $template, $answer, $valid_shortcodes, $extra_data);
447
+						$question_list .= $shortcode_helper->parse_question_list_template($template, $answer, $valid_shortcodes, $extra_data);
448 448
 					}
449 449
 				}
450 450
 				return $question_list;
@@ -457,41 +457,41 @@  discard block
 block discarded – undo
457 457
 	}
458 458
 
459 459
 
460
-	public function additional_primary_registration_details_shortcodes( $shortcodes, $shortcode_parser ) {
460
+	public function additional_primary_registration_details_shortcodes($shortcodes, $shortcode_parser) {
461 461
 		$shortcodes['[PRIMARY_REGISTRANT_QUESTION_LIST]'] = __('This is used to indicate the questions and answers for the primary_registrant. It should be placed in the "[attendee_list]" field', 'event_espresso');
462 462
 		return $shortcodes;
463 463
 	}
464 464
 
465 465
 
466
-	public function additional_primary_registration_details_parser( $parsed, $shortcode, $data, $extra_data, $shortcode_parser ) {
467
-		if ( array($data) && ! isset( $data['data'] ) )
466
+	public function additional_primary_registration_details_parser($parsed, $shortcode, $data, $extra_data, $shortcode_parser) {
467
+		if (array($data) && ! isset($data['data']))
468 468
 			return $parsed;
469 469
 
470 470
 		$recipient = $data['data'] instanceof EE_Messages_Addressee ? $data['data'] : NULL;
471
-		$recipient = ! $recipient instanceof EE_Messages_Addressee && array($extra_data) && isset( $extra_data['data'] ) && $extra_data['data'] instanceof EE_Messages_Addressee ? $extra_data['data'] : $recipient;
471
+		$recipient = ! $recipient instanceof EE_Messages_Addressee && array($extra_data) && isset($extra_data['data']) && $extra_data['data'] instanceof EE_Messages_Addressee ? $extra_data['data'] : $recipient;
472 472
 
473
-		if ( ! $recipient instanceof EE_Messages_Addressee )
473
+		if ( ! $recipient instanceof EE_Messages_Addressee)
474 474
 			return $parsed;
475 475
 
476 476
 		$send_data = ! $data['data'] instanceof EE_Messages_Addressee ? $extra_data : $data;
477 477
 
478
-		switch ( $shortcode ) {
478
+		switch ($shortcode) {
479 479
 			case '[RECIPIENT_QUESTION_LIST]' :
480
-				if ( ! $recipient->primary_att_obj instanceof EE_Attendee || ! $recipient->primary_reg_obj instanceof EE_Registration )
480
+				if ( ! $recipient->primary_att_obj instanceof EE_Attendee || ! $recipient->primary_reg_obj instanceof EE_Registration)
481 481
 					return '';
482 482
 				$registration = $recipient->primary_reg_obj;
483
-				$template = is_array($data['template'] ) && isset($data['template']['question_list']) ? $data['template']['question_list'] : $extra_data['template']['question_list'];
483
+				$template = is_array($data['template']) && isset($data['template']['question_list']) ? $data['template']['question_list'] : $extra_data['template']['question_list'];
484 484
 				$valid_shortcodes = array('question');
485 485
 				$shortcode_helper = $shortcode_parser->get_shortcode_helper();
486 486
 				$answers = $recipient->registrations[$registration->ID()]['ans_objs'];
487 487
 				$question_list = '';
488
-				foreach ( $answers as $answer ) {
489
-					if ( $answer instanceof EE_Answer ) {
488
+				foreach ($answers as $answer) {
489
+					if ($answer instanceof EE_Answer) {
490 490
 						$question = $answer->question();
491
-						if ( $question instanceof EE_Question and $question->admin_only() ) {
491
+						if ($question instanceof EE_Question and $question->admin_only()) {
492 492
 							continue;
493 493
 						}
494
-						$question_list .= $shortcode_helper->parse_question_list_template( $template, $answer, $valid_shortcodes, $send_data);
494
+						$question_list .= $shortcode_helper->parse_question_list_template($template, $answer, $valid_shortcodes, $send_data);
495 495
 					}
496 496
 				}
497 497
 				return $question_list;
@@ -517,67 +517,67 @@  discard block
 block discarded – undo
517 517
 		$setup_args = array(
518 518
 			'mtfilename' => 'EE_Newsletter_message_type.class.php',
519 519
 			'autoloadpaths' => array(
520
-				EE_CAF_LIBRARIES . 'messages/message_type/newsletter/'
520
+				EE_CAF_LIBRARIES.'messages/message_type/newsletter/'
521 521
 				),
522
-			'messengers_to_activate_with' => array( 'email' ),
523
-			'messengers_to_validate_with' => array( 'email' )
522
+			'messengers_to_activate_with' => array('email'),
523
+			'messengers_to_validate_with' => array('email')
524 524
 			);
525
-		EE_Register_Message_Type::register( 'newsletter', $setup_args );
525
+		EE_Register_Message_Type::register('newsletter', $setup_args);
526 526
 
527 527
 		//register payment reminder message type
528 528
 		$setup_args = array(
529 529
 			'mtfilename' => 'EE_Payment_Reminder_message_type.class.php',
530
-			'autoloadpaths' => array( EE_CAF_LIBRARIES . 'messages/message_type/payment_reminder/' ),
531
-			'messengers_to_activate_with' => array( 'email' ),
532
-			'messengers_to_validate_with' => array( 'email' )
530
+			'autoloadpaths' => array(EE_CAF_LIBRARIES.'messages/message_type/payment_reminder/'),
531
+			'messengers_to_activate_with' => array('email'),
532
+			'messengers_to_validate_with' => array('email')
533 533
 			);
534
-		EE_Register_Message_Type::register( 'payment_reminder', $setup_args );
534
+		EE_Register_Message_Type::register('payment_reminder', $setup_args);
535 535
 
536 536
 		//register payment declined message type
537 537
 		$setup_args = array(
538 538
 			'mtfilename' => 'EE_Payment_Declined_message_type.class.php',
539
-			'autoloadpaths' => array( EE_CAF_LIBRARIES . 'messages/message_type/payment_declined/' ),
540
-			'messengers_to_activate_with' => array( 'email' ),
541
-			'messengers_to_validate_with' => array( 'email' )
539
+			'autoloadpaths' => array(EE_CAF_LIBRARIES.'messages/message_type/payment_declined/'),
540
+			'messengers_to_activate_with' => array('email'),
541
+			'messengers_to_validate_with' => array('email')
542 542
 			);
543
-		EE_Register_Message_Type::register( 'payment_declined', $setup_args );
543
+		EE_Register_Message_Type::register('payment_declined', $setup_args);
544 544
 
545 545
 		//register registration declined message type
546 546
 		$setup_args = array(
547 547
 			'mtfilename' => 'EE_Declined_Registration_message_type.class.php',
548
-			'autoloadpaths' => array( EE_CAF_LIBRARIES . 'messages/message_type/declined_registration/' ),
549
-			'messengers_to_activate_with' => array( 'email' ),
550
-			'messengers_to_validate_with' => array( 'email' )
548
+			'autoloadpaths' => array(EE_CAF_LIBRARIES.'messages/message_type/declined_registration/'),
549
+			'messengers_to_activate_with' => array('email'),
550
+			'messengers_to_validate_with' => array('email')
551 551
 			);
552
-		EE_Register_Message_Type::register( 'declined_registration', $setup_args );
552
+		EE_Register_Message_Type::register('declined_registration', $setup_args);
553 553
 
554 554
 		//register registration cancelled message type
555 555
 		$setup_args = array(
556 556
 			'mtfilename' => 'EE_Cancelled_Registration_message_type.class.php',
557
-			'autoloadpaths' => array( EE_CAF_LIBRARIES . 'messages/message_type/cancelled_registration/' ),
558
-			'messengers_to_activate_with' => array( 'email' ),
559
-			'messengers_to_validate_with' => array( 'email' )
557
+			'autoloadpaths' => array(EE_CAF_LIBRARIES.'messages/message_type/cancelled_registration/'),
558
+			'messengers_to_activate_with' => array('email'),
559
+			'messengers_to_validate_with' => array('email')
560 560
 			);
561
-		EE_Register_Message_Type::register( 'cancelled_registration', $setup_args );
561
+		EE_Register_Message_Type::register('cancelled_registration', $setup_args);
562 562
 
563 563
 
564 564
 		//register payment failed message type
565 565
 		$setup_args = array(
566 566
 			'mtfilename' => 'EE_Payment_Failed_message_type.class.php',
567
-			'autoloadpaths' => array( EE_CAF_LIBRARIES . 'messages/message_type/payment_failed/' ),
568
-			'messengers_to_activate_with' => array( 'email' ),
569
-			'messengers_to_validate_with' => array( 'email' )
567
+			'autoloadpaths' => array(EE_CAF_LIBRARIES.'messages/message_type/payment_failed/'),
568
+			'messengers_to_activate_with' => array('email'),
569
+			'messengers_to_validate_with' => array('email')
570 570
 			);
571
-		EE_Register_Message_Type::register( 'payment_failed', $setup_args );
571
+		EE_Register_Message_Type::register('payment_failed', $setup_args);
572 572
 
573 573
 		//register payment declined message type
574 574
 		$setup_args = array(
575 575
 			'mtfilename' => 'EE_Payment_Cancelled_message_type.class.php',
576
-			'autoloadpaths' => array( EE_CAF_LIBRARIES . 'messages/message_type/payment_cancelled/' ),
577
-			'messengers_to_activate_with' => array( 'email' ),
578
-			'messengers_to_validate_with' => array( 'email' )
576
+			'autoloadpaths' => array(EE_CAF_LIBRARIES.'messages/message_type/payment_cancelled/'),
577
+			'messengers_to_activate_with' => array('email'),
578
+			'messengers_to_validate_with' => array('email')
579 579
 			);
580
-		EE_Register_Message_Type::register( 'payment_cancelled', $setup_args );
580
+		EE_Register_Message_Type::register('payment_cancelled', $setup_args);
581 581
 	}
582 582
 
583 583
 
@@ -593,12 +593,12 @@  discard block
 block discarded – undo
593 593
 	public function register_caf_shortcodes() {
594 594
 		$setup_args = array(
595 595
 			'autoloadpaths' => array(
596
-				EE_CAF_LIBRARIES . 'shortcodes/'
596
+				EE_CAF_LIBRARIES.'shortcodes/'
597 597
 				),
598
-			'msgr_validator_callback' => array( 'EE_Newsletter_Shortcodes', 'messenger_validator_config' ),
599
-			'msgr_template_fields_callback' => array( 'EE_Newsletter_Shortcodes', 'messenger_template_fields' ),
600
-			'list_type_shortcodes' => array( '[NEWSLETTER_CONTENT]' )
598
+			'msgr_validator_callback' => array('EE_Newsletter_Shortcodes', 'messenger_validator_config'),
599
+			'msgr_template_fields_callback' => array('EE_Newsletter_Shortcodes', 'messenger_template_fields'),
600
+			'list_type_shortcodes' => array('[NEWSLETTER_CONTENT]')
601 601
 			);
602
-		EE_Register_Messages_Shortcode_Library::register( 'newsletter', $setup_args );
602
+		EE_Register_Messages_Shortcode_Library::register('newsletter', $setup_args);
603 603
 	}
604 604
 }
Please login to merge, or discard this patch.
caffeinated/modules/recaptcha/EED_Recaptcha.module.php 3 patches
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -287,7 +287,7 @@  discard block
 block discarded – undo
287 287
 	 * 	process_recaptcha
288 288
 	 *
289 289
 	 * 	@access private
290
-	 * 	@return 	boolean
290
+	 * 	@return 	boolean|null
291 291
 	 */
292 292
 	private static function _get_recaptcha_response() {
293 293
 		EED_Recaptcha::$_recaptcha_response = EE_Registry::instance()->REQ->get( 'g-recaptcha-response', false );
@@ -574,7 +574,7 @@  discard block
 block discarded – undo
574 574
 	 *
575 575
 	 * @access public
576 576
 	 * @param EE_Registration_Config $EE_Registration_Config
577
-	 * @return array
577
+	 * @return EE_Registration_Config
578 578
 	 */
579 579
 	public static function update_admin_settings( EE_Registration_Config $EE_Registration_Config ) {
580 580
 		try {
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,4 +1,6 @@
 block discarded – undo
1
-<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) exit('No direct script access allowed');
1
+<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) {
2
+	exit('No direct script access allowed');
3
+}
2 4
 /**
3 5
  * Event Espresso
4 6
  *
Please login to merge, or discard this patch.
Spacing   +131 added lines, -132 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
 	 * @return EED_Recaptcha
44 44
 	 */
45 45
 	public static function instance() {
46
-		return parent::get_instance( __CLASS__ );
46
+		return parent::get_instance(__CLASS__);
47 47
 	}
48 48
 
49 49
 
@@ -56,15 +56,15 @@  discard block
 block discarded – undo
56 56
 	 */
57 57
 	public static function set_hooks() {
58 58
 		// use_captcha ?
59
-		if ( EE_Registry::instance()->CFG->registration->use_captcha ) {
59
+		if (EE_Registry::instance()->CFG->registration->use_captcha) {
60 60
 			EED_Recaptcha::set_definitions();
61 61
 			EED_Recaptcha::enqueue_styles_and_scripts();
62
-			add_action( 'wp', array( 'EED_Recaptcha', 'set_late_hooks' ), 1, 0 );
63
-			add_action( 'AHEE__before_spco_whats_next_buttons', array( 'EED_Recaptcha', 'display_recaptcha' ), 10, 0 );
64
-			add_filter( 'FHEE__EED_Single_Page_Checkout__init___continue_reg', array( 'EED_Recaptcha', 'not_a_robot' ), 10 );
65
-			add_filter( 'FHEE__EE_SPCO_Reg_Step__set_completed___completed', array( 'EED_Recaptcha', 'not_a_robot' ), 10 );
66
-			add_filter( 'FHEE__EE_SPCO_JSON_Response___toString__JSON_response', array( 'EED_Recaptcha', 'recaptcha_response' ), 10, 1 );
67
-			add_filter( 'FHEE__EED_Recaptcha___bypass_recaptcha__bypass_request_params_array', array( 'EED_Recaptcha', 'bypass_recaptcha_for_spco_load_payment_method' ), 10, 1 );
62
+			add_action('wp', array('EED_Recaptcha', 'set_late_hooks'), 1, 0);
63
+			add_action('AHEE__before_spco_whats_next_buttons', array('EED_Recaptcha', 'display_recaptcha'), 10, 0);
64
+			add_filter('FHEE__EED_Single_Page_Checkout__init___continue_reg', array('EED_Recaptcha', 'not_a_robot'), 10);
65
+			add_filter('FHEE__EE_SPCO_Reg_Step__set_completed___completed', array('EED_Recaptcha', 'not_a_robot'), 10);
66
+			add_filter('FHEE__EE_SPCO_JSON_Response___toString__JSON_response', array('EED_Recaptcha', 'recaptcha_response'), 10, 1);
67
+			add_filter('FHEE__EED_Recaptcha___bypass_recaptcha__bypass_request_params_array', array('EED_Recaptcha', 'bypass_recaptcha_for_spco_load_payment_method'), 10, 1);
68 68
 		}
69 69
 	}
70 70
 
@@ -79,15 +79,15 @@  discard block
 block discarded – undo
79 79
 	public static function set_hooks_admin() {
80 80
 		EED_Recaptcha::set_definitions();
81 81
 		// use_captcha ?
82
-		if ( EE_Registry::instance()->CFG->registration->use_captcha ) {
82
+		if (EE_Registry::instance()->CFG->registration->use_captcha) {
83 83
 			EED_Recaptcha::enqueue_styles_and_scripts();
84
-			add_filter( 'FHEE__EED_Single_Page_Checkout__init___continue_reg', array( 'EED_Recaptcha', 'not_a_robot' ), 10 );
85
-			add_filter( 'FHEE__EE_SPCO_Reg_Step__set_completed___completed', array( 'EED_Recaptcha', 'not_a_robot' ), 10 );
86
-			add_filter( 'FHEE__EE_SPCO_JSON_Response___toString__JSON_response', array( 'EED_Recaptcha', 'recaptcha_response' ), 10, 1 );
84
+			add_filter('FHEE__EED_Single_Page_Checkout__init___continue_reg', array('EED_Recaptcha', 'not_a_robot'), 10);
85
+			add_filter('FHEE__EE_SPCO_Reg_Step__set_completed___completed', array('EED_Recaptcha', 'not_a_robot'), 10);
86
+			add_filter('FHEE__EE_SPCO_JSON_Response___toString__JSON_response', array('EED_Recaptcha', 'recaptcha_response'), 10, 1);
87 87
 		}
88 88
 		// admin settings
89
-		add_action( 'AHEE__Extend_Registration_Form_Admin_Page___reg_form_settings_template', array( 'EED_Recaptcha', 'admin_settings' ), 10, 1 );
90
-		add_filter( 'FHEE__Extend_Registration_Form_Admin_Page___update_reg_form_settings__CFG_registration', array( 'EED_Recaptcha', 'update_admin_settings' ), 10, 1 );
89
+		add_action('AHEE__Extend_Registration_Form_Admin_Page___reg_form_settings_template', array('EED_Recaptcha', 'admin_settings'), 10, 1);
90
+		add_filter('FHEE__Extend_Registration_Form_Admin_Page___update_reg_form_settings__CFG_registration', array('EED_Recaptcha', 'update_admin_settings'), 10, 1);
91 91
 	}
92 92
 
93 93
 
@@ -99,11 +99,11 @@  discard block
 block discarded – undo
99 99
 	 *  @return 	void
100 100
 	 */
101 101
 	public static function set_definitions() {
102
-		if ( is_user_logged_in() ) {
102
+		if (is_user_logged_in()) {
103 103
 			EED_Recaptcha::$_not_a_robot = true;
104 104
 		}
105
-		define( 'RECAPTCHA_BASE_PATH', rtrim( str_replace( array( '\\', '/' ), DS, plugin_dir_path( __FILE__ )), DS ) . DS );
106
-		define( 'RECAPTCHA_BASE_URL', plugin_dir_url( __FILE__ ));
105
+		define('RECAPTCHA_BASE_PATH', rtrim(str_replace(array('\\', '/'), DS, plugin_dir_path(__FILE__)), DS).DS);
106
+		define('RECAPTCHA_BASE_URL', plugin_dir_url(__FILE__));
107 107
 	}
108 108
 
109 109
 
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
 	public static function set_late_hooks() {
118 118
 		add_filter(
119 119
 			'FHEE__Single_Page_Checkout__translate_js_strings__ajax_submit',
120
-			array( 'EED_Recaptcha', 'not_a_robot' )
120
+			array('EED_Recaptcha', 'not_a_robot')
121 121
 		);
122 122
 	}
123 123
 
@@ -130,11 +130,11 @@  discard block
 block discarded – undo
130 130
 	 *  @return 	void
131 131
 	 */
132 132
 	public static function enqueue_styles_and_scripts() {
133
-		wp_register_script( 'espresso_recaptcha', RECAPTCHA_BASE_URL . 'scripts' . DS . 'espresso_recaptcha.js', array( 'single_page_checkout' ), EVENT_ESPRESSO_VERSION, TRUE );
134
-		wp_register_script( 'google_recaptcha', 'https://www.google.com/recaptcha/api.js?hl=' . EE_Registry::instance()->CFG->registration->recaptcha_language, array( 'espresso_recaptcha' ), EVENT_ESPRESSO_VERSION, TRUE );
135
-		EE_Registry::$i18n_js_strings['no_SPCO_error'] = __( 'It appears the Single Page Checkout javascript was not loaded properly! Please refresh the page and try again or contact support.', 'event_espresso' );
136
-		EE_Registry::$i18n_js_strings['no_recaptcha_error'] = __( 'There appears to be a problem with the reCAPTCHA configuration! Please check the admin settings or contact support.', 'event_espresso' );
137
-		EE_Registry::$i18n_js_strings['recaptcha_fail'] = __( 'Please complete the anti-spam test before proceeding.', 'event_espresso' );
133
+		wp_register_script('espresso_recaptcha', RECAPTCHA_BASE_URL.'scripts'.DS.'espresso_recaptcha.js', array('single_page_checkout'), EVENT_ESPRESSO_VERSION, TRUE);
134
+		wp_register_script('google_recaptcha', 'https://www.google.com/recaptcha/api.js?hl='.EE_Registry::instance()->CFG->registration->recaptcha_language, array('espresso_recaptcha'), EVENT_ESPRESSO_VERSION, TRUE);
135
+		EE_Registry::$i18n_js_strings['no_SPCO_error'] = __('It appears the Single Page Checkout javascript was not loaded properly! Please refresh the page and try again or contact support.', 'event_espresso');
136
+		EE_Registry::$i18n_js_strings['no_recaptcha_error'] = __('There appears to be a problem with the reCAPTCHA configuration! Please check the admin settings or contact support.', 'event_espresso');
137
+		EE_Registry::$i18n_js_strings['recaptcha_fail'] = __('Please complete the anti-spam test before proceeding.', 'event_espresso');
138 138
 	}
139 139
 
140 140
 
@@ -145,7 +145,7 @@  discard block
 block discarded – undo
145 145
 	 * @access    public
146 146
 	 * @param \WP $WP
147 147
 	 */
148
-	public function run( $WP ) {
148
+	public function run($WP) {
149 149
 	}
150 150
 
151 151
 
@@ -155,8 +155,7 @@  discard block
 block discarded – undo
155 155
 	 *  @return boolean
156 156
 	 */
157 157
 	public static function not_a_robot() {
158
-		$not_a_robot = is_bool( EED_Recaptcha::$_not_a_robot ) ? EED_Recaptcha::$_not_a_robot :
159
-			EED_Recaptcha::recaptcha_passed();
158
+		$not_a_robot = is_bool(EED_Recaptcha::$_not_a_robot) ? EED_Recaptcha::$_not_a_robot : EED_Recaptcha::recaptcha_passed();
160 159
 		return $not_a_robot;
161 160
 	}
162 161
 
@@ -172,23 +171,23 @@  discard block
 block discarded – undo
172 171
 	 */
173 172
 	public static function display_recaptcha() {
174 173
 		// logged in means you have already passed a turing test of sorts
175
-		if ( is_user_logged_in() ) {
174
+		if (is_user_logged_in()) {
176 175
 			return;
177 176
 		}
178 177
 		// don't display if not using recaptcha or user is logged in
179
-		if ( EE_Registry::instance()->CFG->registration->use_captcha ) {
178
+		if (EE_Registry::instance()->CFG->registration->use_captcha) {
180 179
 			// only display if they have NOT passed the test yet
181
-			if ( ! EED_Recaptcha::$_not_a_robot ) {
182
-				EE_Registry::instance()->load_helper( 'Template' );
180
+			if ( ! EED_Recaptcha::$_not_a_robot) {
181
+				EE_Registry::instance()->load_helper('Template');
183 182
 				EEH_Template::display_template(
184
-					RECAPTCHA_BASE_PATH . DS . 'templates' . DS . 'recaptcha.template.php',
183
+					RECAPTCHA_BASE_PATH.DS.'templates'.DS.'recaptcha.template.php',
185 184
 					array(
186 185
 						'recaptcha_publickey' 	=> EE_Registry::instance()->CFG->registration->recaptcha_publickey,
187 186
 						'recaptcha_theme' 		=> EE_Registry::instance()->CFG->registration->recaptcha_theme,
188 187
 						'recaptcha_type' 			=> EE_Registry::instance()->CFG->registration->recaptcha_type
189 188
 					)
190 189
 				);
191
-				wp_enqueue_script( 'google_recaptcha' );
190
+				wp_enqueue_script('google_recaptcha');
192 191
 			}
193 192
 		}
194 193
 	}
@@ -219,17 +218,17 @@  discard block
 block discarded – undo
219 218
 	 */
220 219
 	public static function recaptcha_passed() {
221 220
 		// logged in means you have already passed a turing test of sorts
222
-		if ( is_user_logged_in() || EED_Recaptcha::_bypass_recaptcha() ) {
221
+		if (is_user_logged_in() || EED_Recaptcha::_bypass_recaptcha()) {
223 222
 			return TRUE;
224 223
 		}
225 224
 		// was test already passed?
226
-		$recaptcha_passed = EE_Registry::instance()->SSN->get_session_data( 'recaptcha_passed' );
227
-		$recaptcha_passed = filter_var( $recaptcha_passed, FILTER_VALIDATE_BOOLEAN );
225
+		$recaptcha_passed = EE_Registry::instance()->SSN->get_session_data('recaptcha_passed');
226
+		$recaptcha_passed = filter_var($recaptcha_passed, FILTER_VALIDATE_BOOLEAN);
228 227
 		// verify recaptcha
229 228
 		EED_Recaptcha::_get_recaptcha_response();
230
-		if ( ! $recaptcha_passed && EED_Recaptcha::$_recaptcha_response ) {
229
+		if ( ! $recaptcha_passed && EED_Recaptcha::$_recaptcha_response) {
231 230
 			$recaptcha_passed = EED_Recaptcha::_process_recaptcha_response();
232
-			EE_Registry::instance()->SSN->set_session_data( array( 'recaptcha_passed' => $recaptcha_passed ));
231
+			EE_Registry::instance()->SSN->set_session_data(array('recaptcha_passed' => $recaptcha_passed));
233 232
 			EE_Registry::instance()->SSN->update();
234 233
 		}
235 234
 		EED_Recaptcha::$_not_a_robot = $recaptcha_passed;
@@ -245,8 +244,8 @@  discard block
 block discarded – undo
245 244
 	 * @param array $recaptcha_response
246 245
 	 * @return boolean
247 246
 	 */
248
-	public static function recaptcha_response( $recaptcha_response = array() ) {
249
-		if ( EED_Recaptcha::_bypass_recaptcha() ) {
247
+	public static function recaptcha_response($recaptcha_response = array()) {
248
+		if (EED_Recaptcha::_bypass_recaptcha()) {
250 249
 			$recaptcha_response['bypass_recaptcha'] = TRUE;
251 250
 			$recaptcha_response['recaptcha_passed'] = TRUE;
252 251
 		} else {
@@ -266,16 +265,16 @@  discard block
 block discarded – undo
266 265
 	 */
267 266
 	private static function _bypass_recaptcha() {
268 267
 		// an array of key value pairs that must match exactly with the incoming request, in order to bypass recaptcha for the current request ONLY
269
-		$bypass_request_params_array = apply_filters( 'FHEE__EED_Recaptcha___bypass_recaptcha__bypass_request_params_array', array() );
268
+		$bypass_request_params_array = apply_filters('FHEE__EED_Recaptcha___bypass_recaptcha__bypass_request_params_array', array());
270 269
 		// does $bypass_request_params_array have any values ?
271
-		if ( empty( $bypass_request_params_array )) {
270
+		if (empty($bypass_request_params_array)) {
272 271
 			return FALSE;
273 272
 		}
274 273
 		// initially set bypass to TRUE
275 274
 		$bypass_recaptcha = TRUE;
276
-		foreach ( $bypass_request_params_array as $key => $value ) {
275
+		foreach ($bypass_request_params_array as $key => $value) {
277 276
 			// if $key is not found or value doesn't match exactly, then toggle bypass to FALSE, otherwise carry over it's value. This way, one missed setting results in no bypass
278
-			$bypass_recaptcha = isset( $_REQUEST[ $key ] ) && $_REQUEST[ $key ] === $value ? $bypass_recaptcha : FALSE;
277
+			$bypass_recaptcha = isset($_REQUEST[$key]) && $_REQUEST[$key] === $value ? $bypass_recaptcha : FALSE;
279 278
 		}
280 279
 		return $bypass_recaptcha;
281 280
 	}
@@ -290,7 +289,7 @@  discard block
 block discarded – undo
290 289
 	 * 	@return 	boolean
291 290
 	 */
292 291
 	private static function _get_recaptcha_response() {
293
-		EED_Recaptcha::$_recaptcha_response = EE_Registry::instance()->REQ->get( 'g-recaptcha-response', false );
292
+		EED_Recaptcha::$_recaptcha_response = EE_Registry::instance()->REQ->get('g-recaptcha-response', false);
294 293
 	}
295 294
 
296 295
 
@@ -304,26 +303,26 @@  discard block
 block discarded – undo
304 303
 	 */
305 304
 	private static function _process_recaptcha_response() {
306 305
 		// verify library is loaded
307
-		if ( ! class_exists( '\\ReCaptcha\\ReCaptcha' )) {
308
-			require_once( RECAPTCHA_BASE_PATH . DS . 'autoload.php' );
306
+		if ( ! class_exists('\\ReCaptcha\\ReCaptcha')) {
307
+			require_once(RECAPTCHA_BASE_PATH.DS.'autoload.php');
309 308
 		}
310 309
 		// The response from reCAPTCHA
311 310
 		EED_Recaptcha::_get_recaptcha_response();
312 311
 		$recaptcha_response = EED_Recaptcha::$_recaptcha_response;
313 312
 		// Was there a reCAPTCHA response?
314
-		if ( $recaptcha_response ) {
313
+		if ($recaptcha_response) {
315 314
 			// if allow_url_fopen is Off, then set a different request method
316
-			$request_method = ! ini_get( 'allow_url_fopen' ) ? new \ReCaptcha\RequestMethod\SocketPost() : null;
315
+			$request_method = ! ini_get('allow_url_fopen') ? new \ReCaptcha\RequestMethod\SocketPost() : null;
317 316
 			$recaptcha = new \ReCaptcha\ReCaptcha(
318 317
 				EE_Registry::instance()->CFG->registration->recaptcha_privatekey,
319 318
 				$request_method
320 319
 			);
321 320
 			$recaptcha_response = $recaptcha->verify(
322 321
 				EED_Recaptcha::$_recaptcha_response,
323
-				$_SERVER[ 'REMOTE_ADDR' ]
322
+				$_SERVER['REMOTE_ADDR']
324 323
 			);
325 324
 		}
326
-		if ( $recaptcha_response instanceof \ReCaptcha\Response && $recaptcha_response->isSuccess() ) {
325
+		if ($recaptcha_response instanceof \ReCaptcha\Response && $recaptcha_response->isSuccess()) {
327 326
 			return TRUE;
328 327
 		}
329 328
 		// sorry... it appears you can't don't know what soup or hamburgers are !!!
@@ -358,8 +357,8 @@  discard block
 block discarded – undo
358 357
 	 */
359 358
 	protected static function _recaptcha_settings_form() {
360 359
 
361
-		EE_Registry::instance()->load_helper( 'HTML' );
362
-		EE_Registry::instance()->load_helper( 'Template' );
360
+		EE_Registry::instance()->load_helper('HTML');
361
+		EE_Registry::instance()->load_helper('Template');
363 362
 
364 363
 		return new EE_Form_Section_Proper(
365 364
 			array(
@@ -369,12 +368,12 @@  discard block
 block discarded – undo
369 368
 				'subsections' 			=> apply_filters(
370 369
 					'FHEE__EED_Recaptcha___recaptcha_settings_form__form_subsections',
371 370
 					array(
372
-						'main_settings_hdr' 				=> new EE_Form_Section_HTML( EEH_HTML::h2( __( 'reCAPTCHA Anti-spam Settings', 'event_espresso' ) . EEH_Template::get_help_tab_link( 'recaptcha_info' ))),
371
+						'main_settings_hdr' 				=> new EE_Form_Section_HTML(EEH_HTML::h2(__('reCAPTCHA Anti-spam Settings', 'event_espresso').EEH_Template::get_help_tab_link('recaptcha_info'))),
373 372
 						'main_settings' 						=> EED_Recaptcha::_recaptcha_main_settings(),
374
-						'appearance_settings_hdr' 	=> new EE_Form_Section_HTML( EEH_HTML::h2( __( 'reCAPTCHA Appearance', 'event_espresso' ) )),
373
+						'appearance_settings_hdr' 	=> new EE_Form_Section_HTML(EEH_HTML::h2(__('reCAPTCHA Appearance', 'event_espresso'))),
375 374
 						'appearance_settings' 			=> EED_Recaptcha::_recaptcha_appearance_settings(),
376 375
 						// 'recaptcha_example' 				=> new EE_Form_Section_HTML( EED_Recaptcha::display_recaptcha() ),
377
-						'required_fields_note' 			=> new EE_Form_Section_HTML( EEH_HTML::p( __( 'All fields marked with a * are required fields', 'event_espresso' ), '', 'grey-text' ))
376
+						'required_fields_note' 			=> new EE_Form_Section_HTML(EEH_HTML::p(__('All fields marked with a * are required fields', 'event_espresso'), '', 'grey-text'))
378 377
 					)
379 378
 				)
380 379
 			)
@@ -401,28 +400,28 @@  discard block
 block discarded – undo
401 400
 					array(
402 401
 						'use_captcha' 				=> new EE_Yes_No_Input(
403 402
 							array(
404
-								'html_label_text'	 	=> __( 'Use reCAPTCHA', 'event_espresso' ),
403
+								'html_label_text'	 	=> __('Use reCAPTCHA', 'event_espresso'),
405 404
 								'html_help_text' 		=> sprintf(
406
-									__( 'reCAPTCHA is a free service that  protects your website from spam and abuse. It employs advanced risk analysis technology to separate humans from abusive actors. Sign up %1$shere%2$s to receive your Public and Private keys.', 'event_espresso' ),
405
+									__('reCAPTCHA is a free service that  protects your website from spam and abuse. It employs advanced risk analysis technology to separate humans from abusive actors. Sign up %1$shere%2$s to receive your Public and Private keys.', 'event_espresso'),
407 406
 									'<a href="https://www.google.com/recaptcha/intro/index.html">',
408 407
 									'</a>'
409 408
 								),
410
-								'default' 								=> isset( EE_Registry::instance()->CFG->registration->use_captcha ) ? EE_Registry::instance()->CFG->registration->use_captcha : FALSE,
409
+								'default' 								=> isset(EE_Registry::instance()->CFG->registration->use_captcha) ? EE_Registry::instance()->CFG->registration->use_captcha : FALSE,
411 410
 								'display_html_label_text' 	=> FALSE
412 411
 							)
413 412
 						),
414 413
 						'recaptcha_publickey' 		=> new EE_Text_Input(
415 414
 							array(
416
-								'html_label_text'	 	=> __( 'Site Key', 'event_espresso' ),
417
-								'html_help_text' 		=> __( 'The site key is used to display the widget on your site.', 'event_espresso' ),
418
-								'default' 					=> isset( EE_Registry::instance()->CFG->registration->recaptcha_publickey ) ? stripslashes( EE_Registry::instance()->CFG->registration->recaptcha_publickey ) : ''
415
+								'html_label_text'	 	=> __('Site Key', 'event_espresso'),
416
+								'html_help_text' 		=> __('The site key is used to display the widget on your site.', 'event_espresso'),
417
+								'default' 					=> isset(EE_Registry::instance()->CFG->registration->recaptcha_publickey) ? stripslashes(EE_Registry::instance()->CFG->registration->recaptcha_publickey) : ''
419 418
 							)
420 419
 						),
421 420
 						'recaptcha_privatekey' 		=> new EE_Text_Input(
422 421
 							array(
423
-								'html_label_text'	 	=> __( 'Secret Key', 'event_espresso' ),
424
-								'html_help_text' 		=> __( 'The secret key authorizes communication between your application backend and the reCAPTCHA server to verify the user\'s response. The secret key needs to be kept safe for security purposes.', 'event_espresso' ),
425
-								'default' 					=> isset( EE_Registry::instance()->CFG->registration->recaptcha_privatekey ) ? stripslashes( EE_Registry::instance()->CFG->registration->recaptcha_privatekey ) : ''
422
+								'html_label_text'	 	=> __('Secret Key', 'event_espresso'),
423
+								'html_help_text' 		=> __('The secret key authorizes communication between your application backend and the reCAPTCHA server to verify the user\'s response. The secret key needs to be kept safe for security purposes.', 'event_espresso'),
424
+								'default' 					=> isset(EE_Registry::instance()->CFG->registration->recaptcha_privatekey) ? stripslashes(EE_Registry::instance()->CFG->registration->recaptcha_privatekey) : ''
426 425
 							)
427 426
 						)
428 427
 					)
@@ -454,81 +453,81 @@  discard block
 block discarded – undo
454 453
 					array(
455 454
 						'recaptcha_theme' 		=> new EE_Radio_Button_Input(
456 455
 							array(
457
-								'light' => __( 'Light', 'event_espresso' ),
458
-								'dark' => __( 'Dark', 'event_espresso' )
456
+								'light' => __('Light', 'event_espresso'),
457
+								'dark' => __('Dark', 'event_espresso')
459 458
 							),
460 459
 							array(
461
-								'html_label_text'	 	=> __( 'Theme', 'event_espresso' ),
462
-								'html_help_text' 		=> __( 'The color theme of the widget.', 'event_espresso' ),
463
-								'default' 					=> isset( EE_Registry::instance()->CFG->registration->recaptcha_theme ) ? EE_Registry::instance()->CFG->registration->recaptcha_theme : 'light',
460
+								'html_label_text'	 	=> __('Theme', 'event_espresso'),
461
+								'html_help_text' 		=> __('The color theme of the widget.', 'event_espresso'),
462
+								'default' 					=> isset(EE_Registry::instance()->CFG->registration->recaptcha_theme) ? EE_Registry::instance()->CFG->registration->recaptcha_theme : 'light',
464 463
 								'display_html_label_text' => FALSE
465 464
 							)
466 465
 						),
467 466
 						'recaptcha_type' 		=> new EE_Radio_Button_Input(
468 467
 							array(
469
-								'image' => __( 'Image', 'event_espresso' ),
470
-								'audio' => __( 'Audio', 'event_espresso' )
468
+								'image' => __('Image', 'event_espresso'),
469
+								'audio' => __('Audio', 'event_espresso')
471 470
 							),
472 471
 							array(
473
-								'html_label_text'	 	=> __( 'Type', 'event_espresso' ),
474
-								'html_help_text' 		=> __( 'The type of CAPTCHA to serve.', 'event_espresso' ),
475
-								'default' 					=> isset( EE_Registry::instance()->CFG->registration->recaptcha_type ) ? EE_Registry::instance()->CFG->registration->recaptcha_type : 'image',
472
+								'html_label_text'	 	=> __('Type', 'event_espresso'),
473
+								'html_help_text' 		=> __('The type of CAPTCHA to serve.', 'event_espresso'),
474
+								'default' 					=> isset(EE_Registry::instance()->CFG->registration->recaptcha_type) ? EE_Registry::instance()->CFG->registration->recaptcha_type : 'image',
476 475
 								'display_html_label_text' =>FALSE
477 476
 							)
478 477
 						),
479 478
 						'recaptcha_language' 		=> new EE_Select_Input(
480 479
 							array(
481
-								 'ar' 			=> __( 'Arabic', 'event_espresso' ),
482
-								 'bg' 		=> __( 'Bulgarian', 'event_espresso' ),
483
-								 'ca' 			=> __( 'Catalan', 'event_espresso' ),
484
-								 'zh-CN' 	=>  __( 'Chinese (Simplified)', 'event_espresso' ),
485
-								 'zh-TW' 	=>  __( 'Chinese (Traditional)	', 'event_espresso' ),
486
-								 'hr' 			=> __( 'Croatian', 'event_espresso' ),
487
-								 'cs' 			=> __( 'Czech', 'event_espresso' ),
488
-								 'da' 			=> __( 'Danish', 'event_espresso' ),
489
-								 'nl' 			=> __( 'Dutch', 'event_espresso' ),
490
-								 'en-GB' 	=>  __( 'English (UK)', 'event_espresso' ),
491
-								 'en' 			=> __( 'English (US)', 'event_espresso' ),
492
-								 'fil' 			=> __( 'Filipino', 'event_espresso' ),
493
-								 'fi' 			=> __( 'Finnish', 'event_espresso' ),
494
-								 'fr' 			=> __( 'French', 'event_espresso' ),
495
-								 'fr-CA' 	=>  __( 'French (Canadian)', 'event_espresso' ),
496
-								 'de' 			=> __( 'German', 'event_espresso' ),
497
-								 'de-AT' 	=>  __( 'German (Austria)', 'event_espresso' ),
498
-								 'de-CH' 	=>  __( 'German (Switzerland)', 'event_espresso' ),
499
-								 'el' 			=> __( 'Greek', 'event_espresso' ),
500
-								 'iw' 			=> __( 'Hebrew', 'event_espresso' ),
501
-								 'hi' 			=> __( 'Hindi', 'event_espresso' ),
502
-								 'hu' 		=> __( 'Hungarian', 'event_espresso' ),
503
-								 'id' 			=> __( 'Indonesian', 'event_espresso' ),
504
-								 'it' 			=> __( 'Italian', 'event_espresso' ),
505
-								 'ja' 			=> __( 'Japanese', 'event_espresso' ),
506
-								 'ko' 			=> __( 'Korean', 'event_espresso' ),
507
-								 'lv' 			=> __( 'Latvian', 'event_espresso' ),
508
-								 'lt' 			=> __( 'Lithuanian', 'event_espresso' ),
509
-								 'no' 		=> __( 'Norwegian', 'event_espresso' ),
510
-								 'fa' 			=> __( 'Persian', 'event_espresso' ),
511
-								 'pl' 			=> __( 'Polish', 'event_espresso' ),
512
-								 'pt' 			=> __( 'Portuguese', 'event_espresso' ),
513
-								 'pt-BR' 	=>  __( 'Portuguese (Brazil)', 'event_espresso' ),
514
-								 'pt-PT' 	=>  __( 'Portuguese (Portugal)', 'event_espresso' ),
515
-								 'ro' 			=> __( 'Romanian', 'event_espresso' ),
516
-								 'ru' 			=> __( 'Russian', 'event_espresso' ),
517
-								 'sr' 			=> __( 'Serbian', 'event_espresso' ),
518
-								 'sk' 			=> __( 'Slovak', 'event_espresso' ),
519
-								 'sl' 			=> __( 'Slovenian', 'event_espresso' ),
520
-								 'es' 			=> __( 'Spanish', 'event_espresso' ),
521
-								 'es-419' 	=>  __( 'Spanish (Latin America)', 'event_espresso' ),
522
-								 'sv' 			=> __( 'Swedish', 'event_espresso' ),
523
-								 'th' 			=> __( 'Thai', 'event_espresso' ),
524
-								 'tr' 			=> __( 'Turkish', 'event_espresso' ),
525
-								 'uk' 			=> __( 'Ukrainian', 'event_espresso' ),
526
-								 'vi' 			=> __( 'Vietnamese', 'event_espresso')
480
+								 'ar' 			=> __('Arabic', 'event_espresso'),
481
+								 'bg' 		=> __('Bulgarian', 'event_espresso'),
482
+								 'ca' 			=> __('Catalan', 'event_espresso'),
483
+								 'zh-CN' 	=>  __('Chinese (Simplified)', 'event_espresso'),
484
+								 'zh-TW' 	=>  __('Chinese (Traditional)	', 'event_espresso'),
485
+								 'hr' 			=> __('Croatian', 'event_espresso'),
486
+								 'cs' 			=> __('Czech', 'event_espresso'),
487
+								 'da' 			=> __('Danish', 'event_espresso'),
488
+								 'nl' 			=> __('Dutch', 'event_espresso'),
489
+								 'en-GB' 	=>  __('English (UK)', 'event_espresso'),
490
+								 'en' 			=> __('English (US)', 'event_espresso'),
491
+								 'fil' 			=> __('Filipino', 'event_espresso'),
492
+								 'fi' 			=> __('Finnish', 'event_espresso'),
493
+								 'fr' 			=> __('French', 'event_espresso'),
494
+								 'fr-CA' 	=>  __('French (Canadian)', 'event_espresso'),
495
+								 'de' 			=> __('German', 'event_espresso'),
496
+								 'de-AT' 	=>  __('German (Austria)', 'event_espresso'),
497
+								 'de-CH' 	=>  __('German (Switzerland)', 'event_espresso'),
498
+								 'el' 			=> __('Greek', 'event_espresso'),
499
+								 'iw' 			=> __('Hebrew', 'event_espresso'),
500
+								 'hi' 			=> __('Hindi', 'event_espresso'),
501
+								 'hu' 		=> __('Hungarian', 'event_espresso'),
502
+								 'id' 			=> __('Indonesian', 'event_espresso'),
503
+								 'it' 			=> __('Italian', 'event_espresso'),
504
+								 'ja' 			=> __('Japanese', 'event_espresso'),
505
+								 'ko' 			=> __('Korean', 'event_espresso'),
506
+								 'lv' 			=> __('Latvian', 'event_espresso'),
507
+								 'lt' 			=> __('Lithuanian', 'event_espresso'),
508
+								 'no' 		=> __('Norwegian', 'event_espresso'),
509
+								 'fa' 			=> __('Persian', 'event_espresso'),
510
+								 'pl' 			=> __('Polish', 'event_espresso'),
511
+								 'pt' 			=> __('Portuguese', 'event_espresso'),
512
+								 'pt-BR' 	=>  __('Portuguese (Brazil)', 'event_espresso'),
513
+								 'pt-PT' 	=>  __('Portuguese (Portugal)', 'event_espresso'),
514
+								 'ro' 			=> __('Romanian', 'event_espresso'),
515
+								 'ru' 			=> __('Russian', 'event_espresso'),
516
+								 'sr' 			=> __('Serbian', 'event_espresso'),
517
+								 'sk' 			=> __('Slovak', 'event_espresso'),
518
+								 'sl' 			=> __('Slovenian', 'event_espresso'),
519
+								 'es' 			=> __('Spanish', 'event_espresso'),
520
+								 'es-419' 	=>  __('Spanish (Latin America)', 'event_espresso'),
521
+								 'sv' 			=> __('Swedish', 'event_espresso'),
522
+								 'th' 			=> __('Thai', 'event_espresso'),
523
+								 'tr' 			=> __('Turkish', 'event_espresso'),
524
+								 'uk' 			=> __('Ukrainian', 'event_espresso'),
525
+								 'vi' 			=> __('Vietnamese', 'event_espresso')
527 526
 							),
528 527
 							array(
529
-								'html_label_text'	 	=> __( 'Language', 'event_espresso' ),
530
-								'html_help_text' 		=> __( 'Forces the widget to render in a specific language.', 'event_espresso' ),
531
-								'default' 					=> isset( EE_Registry::instance()->CFG->registration->recaptcha_language ) ? EE_Registry::instance()->CFG->registration->recaptcha_language : 'en'
528
+								'html_label_text'	 	=> __('Language', 'event_espresso'),
529
+								'html_help_text' 		=> __('Forces the widget to render in a specific language.', 'event_espresso'),
530
+								'default' 					=> isset(EE_Registry::instance()->CFG->registration->recaptcha_language) ? EE_Registry::instance()->CFG->registration->recaptcha_language : 'en'
532 531
 							)
533 532
 						)
534 533
 					)
@@ -576,25 +575,25 @@  discard block
 block discarded – undo
576 575
 	 * @param EE_Registration_Config $EE_Registration_Config
577 576
 	 * @return array
578 577
 	 */
579
-	public static function update_admin_settings( EE_Registration_Config $EE_Registration_Config ) {
578
+	public static function update_admin_settings(EE_Registration_Config $EE_Registration_Config) {
580 579
 		try {
581 580
 			$recaptcha_settings_form = EED_Recaptcha::_recaptcha_settings_form();
582 581
 			// if not displaying a form, then check for form submission
583
-			if ( $recaptcha_settings_form->was_submitted() ) {
582
+			if ($recaptcha_settings_form->was_submitted()) {
584 583
 				// capture form data
585 584
 				$recaptcha_settings_form->receive_form_submission();
586 585
 				// validate form data
587
-				if ( $recaptcha_settings_form->is_valid() ) {
586
+				if ($recaptcha_settings_form->is_valid()) {
588 587
 					// grab validated data from form
589 588
 					$valid_data = $recaptcha_settings_form->valid_data();
590 589
 					// user proofing recaptcha:  If Use reCAPTCHA is set to yes but we dont' have site or secret keys then set Use reCAPTCHA to FALSE and give error message.
591 590
 					if (
592
-						apply_filters( 'FHEE__Extend_Registration_Form_Admin_Page__check_for_recaptcha_keys', TRUE, $EE_Registration_Config )
591
+						apply_filters('FHEE__Extend_Registration_Form_Admin_Page__check_for_recaptcha_keys', TRUE, $EE_Registration_Config)
593 592
 						&& $valid_data['main_settings']['use_captcha']
594
-						&& ( ! $EE_Registration_Config->use_captcha && ( empty( $valid_data['main_settings']['recaptcha_publickey'] ) || empty( $valid_data['main_settings']['recaptcha_privatekey'] )))
593
+						&& ( ! $EE_Registration_Config->use_captcha && (empty($valid_data['main_settings']['recaptcha_publickey']) || empty($valid_data['main_settings']['recaptcha_privatekey'])))
595 594
 					) {
596 595
 						$valid_data['main_settings']['use_captcha'] = FALSE;
597
-						EE_Error::add_error( __('The use reCAPTCHA setting has been reset to "no". In order to enable the reCAPTCHA service, you must enter a Site Key and Secret Key.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__ );
596
+						EE_Error::add_error(__('The use reCAPTCHA setting has been reset to "no". In order to enable the reCAPTCHA service, you must enter a Site Key and Secret Key.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
598 597
 					}
599 598
 					$EE_Registration_Config->use_captcha = $valid_data['main_settings']['use_captcha'];
600 599
 					$EE_Registration_Config->recaptcha_publickey = $valid_data['main_settings']['recaptcha_publickey'];
@@ -603,12 +602,12 @@  discard block
 block discarded – undo
603 602
 					$EE_Registration_Config->recaptcha_theme = $valid_data['appearance_settings']['recaptcha_theme'];
604 603
 					$EE_Registration_Config->recaptcha_language = $valid_data['appearance_settings']['recaptcha_language'];
605 604
 				} else {
606
-					if ( $recaptcha_settings_form->submission_error_message() != '' ) {
607
-						EE_Error::add_error( $recaptcha_settings_form->submission_error_message(), __FILE__, __FUNCTION__, __LINE__ );
605
+					if ($recaptcha_settings_form->submission_error_message() != '') {
606
+						EE_Error::add_error($recaptcha_settings_form->submission_error_message(), __FILE__, __FUNCTION__, __LINE__);
608 607
 					}
609 608
 				}
610 609
 			}
611
-		} catch( EE_Error $e ) {
610
+		} catch (EE_Error $e) {
612 611
 			$e->get_error();
613 612
 		}
614 613
 
Please login to merge, or discard this patch.