Completed
Branch BETA-4.9-message-activity (574755)
by
unknown
31:18 queued 14:02
created
core/EE_Capabilities.core.php 3 patches
Doc Comments   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -557,7 +557,7 @@  discard block
 block discarded – undo
557 557
 	 * @since    4.5.0
558 558
 	 *
559 559
 	 * @param string $meta_cap     What meta capability is this mapping.
560
-	 * @param array  $map_values   array {
560
+	 * @param string[]  $map_values   array {
561 561
 	 * 		//array of values that MUST match a count of 4.  It's okay to send an empty string for capabilities that don't get mapped to.
562 562
 	 * 		@type $map_values[0] string A string representing the model name. Required.  String's
563 563
 	 * 		      	    	       should always be used when Menu Maps are registered via the
@@ -625,8 +625,8 @@  discard block
 block discarded – undo
625 625
 	 * @see EE_Meta_Capability_Map::_map_meta_caps() for docs on params.
626 626
 	 * @since 4.6.x
627 627
 	 * @param $caps
628
-	 * @param $cap
629
-	 * @param $user_id
628
+	 * @param string $cap
629
+	 * @param integer $user_id
630 630
 	 * @param $args
631 631
 	 *
632 632
 	 * @return array
Please login to merge, or discard this patch.
Indentation   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -111,7 +111,6 @@  discard block
 block discarded – undo
111 111
 
112 112
 	/**
113 113
 	 * This sets the meta caps property.
114
-
115 114
 	 * @since 4.5.0
116 115
 	 *
117 116
 	 * @return void
@@ -209,7 +208,7 @@  discard block
 block discarded – undo
209 208
 			 * capability mapping which will be used for accessing payment methods owned by
210 209
 			 * other users.  This is not fully implemented yet in the payment method ui.
211 210
 			 * Currently only the "plural" caps are in active use. (Specific payment method caps are in use as well).
212
-			**/
211
+			 **/
213 212
 				'ee_manage_gateways',
214 213
 				'ee_read_payment_method',
215 214
 				'ee_read_payment_methods',
Please login to merge, or discard this patch.
Spacing   +127 added lines, -127 removed lines patch added patch discarded remove patch
@@ -7,8 +7,8 @@  discard block
 block discarded – undo
7 7
  * @package Event Espresso
8 8
  * @subpackage core, capabilities
9 9
  */
10
-if ( ! defined( 'EVENT_ESPRESSO_VERSION' ) ) {
11
-	exit( 'No direct script access allowed' );
10
+if ( ! defined('EVENT_ESPRESSO_VERSION')) {
11
+	exit('No direct script access allowed');
12 12
 }
13 13
 
14 14
 
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
 	 */
70 70
 	public static function instance() {
71 71
 		//check if instantiated, and if not do so.
72
-		if ( ! self::$_instance instanceof EE_Capabilities ) {
72
+		if ( ! self::$_instance instanceof EE_Capabilities) {
73 73
 			self::$_instance = new self();
74 74
 		}
75 75
 		return self::$_instance;
@@ -98,10 +98,10 @@  discard block
 block discarded – undo
98 98
 	 * @since 4.5.0
99 99
 	 * @return void
100 100
 	 */
101
-	public function init_caps( $reset = false ) {
102
-		if ( EE_Maintenance_Mode::instance()->models_can_query() ){
101
+	public function init_caps($reset = false) {
102
+		if (EE_Maintenance_Mode::instance()->models_can_query()) {
103 103
 			$this->_caps_map = $this->_init_caps_map();
104
-			$this->init_role_caps( $reset );
104
+			$this->init_role_caps($reset);
105 105
 			$this->_set_meta_caps();
106 106
 		}
107 107
 	}
@@ -120,11 +120,11 @@  discard block
 block discarded – undo
120 120
 		//make sure we're only ever initializing the default _meta_caps array once if it's empty.
121 121
 		$this->_meta_caps = $this->_get_default_meta_caps_array();
122 122
 
123
-		$this->_meta_caps = apply_filters( 'FHEE__EE_Capabilities___set_meta_caps__meta_caps', $this->_meta_caps );
123
+		$this->_meta_caps = apply_filters('FHEE__EE_Capabilities___set_meta_caps__meta_caps', $this->_meta_caps);
124 124
 
125 125
 		//add filter for map_meta_caps but only if models can query.
126
-		if ( EE_Maintenance_Mode::instance()->models_can_query() && ! has_filter( 'map_meta_cap', array( $this, 'map_meta_caps' ) ) ) {
127
-			add_filter( 'map_meta_cap', array( $this, 'map_meta_caps' ), 10, 4 );
126
+		if (EE_Maintenance_Mode::instance()->models_can_query() && ! has_filter('map_meta_cap', array($this, 'map_meta_caps'))) {
127
+			add_filter('map_meta_cap', array($this, 'map_meta_caps'), 10, 4);
128 128
 		}
129 129
 	}
130 130
 
@@ -137,37 +137,37 @@  discard block
 block discarded – undo
137 137
 	 */
138 138
 	private function _get_default_meta_caps_array() {
139 139
 		static $default_meta_caps = array();
140
-		if ( empty( $default_meta_caps ) ) {
140
+		if (empty($default_meta_caps)) {
141 141
 			$default_meta_caps = array(
142 142
 				//edits
143
-				new EE_Meta_Capability_Map_Edit( 'ee_edit_event', array( 'Event', 'ee_edit_published_events', 'ee_edit_others_events', 'ee_edit_private_events' ) ),
144
-				new EE_Meta_Capability_Map_Edit( 'ee_edit_venue', array( 'Venue', 'ee_edit_published_venues', 'ee_edit_others_venues', 'ee_edit_private_venues' ) ),
145
-				new EE_Meta_Capability_Map_Edit( 'ee_edit_registration', array( 'Registration', '', 'ee_edit_others_registrations', '' ) ),
146
-				new EE_Meta_Capability_Map_Edit( 'ee_edit_checkin', array( 'Registration', '', 'ee_edit_others_checkins', '' ) ),
147
-				new EE_Meta_Capability_Map_Messages_Cap( 'ee_edit_message', array( 'Message_Template_Group', '', 'ee_edit_others_messages', 'ee_edit_global_messages' ) ),
148
-				new EE_Meta_Capability_Map_Edit( 'ee_edit_default_ticket', array( 'Ticket', '', 'ee_edit_others_default_tickets', '' ) ),
149
-				new EE_Meta_Capability_Map_Registration_Form_Cap( 'ee_edit_question', array( 'Question', '', '', 'ee_edit_system_questions' ) ),
150
-				new EE_Meta_Capability_Map_Registration_Form_Cap( 'ee_edit_question_group', array( 'Question_Group', '', '', 'ee_edit_system_question_groups' ) ),
151
-				new EE_Meta_Capability_Map_Edit( 'ee_edit_payment_method', array( 'Payment_Method', '', 'ee_edit_others_payment_methods', '' ) ),
143
+				new EE_Meta_Capability_Map_Edit('ee_edit_event', array('Event', 'ee_edit_published_events', 'ee_edit_others_events', 'ee_edit_private_events')),
144
+				new EE_Meta_Capability_Map_Edit('ee_edit_venue', array('Venue', 'ee_edit_published_venues', 'ee_edit_others_venues', 'ee_edit_private_venues')),
145
+				new EE_Meta_Capability_Map_Edit('ee_edit_registration', array('Registration', '', 'ee_edit_others_registrations', '')),
146
+				new EE_Meta_Capability_Map_Edit('ee_edit_checkin', array('Registration', '', 'ee_edit_others_checkins', '')),
147
+				new EE_Meta_Capability_Map_Messages_Cap('ee_edit_message', array('Message_Template_Group', '', 'ee_edit_others_messages', 'ee_edit_global_messages')),
148
+				new EE_Meta_Capability_Map_Edit('ee_edit_default_ticket', array('Ticket', '', 'ee_edit_others_default_tickets', '')),
149
+				new EE_Meta_Capability_Map_Registration_Form_Cap('ee_edit_question', array('Question', '', '', 'ee_edit_system_questions')),
150
+				new EE_Meta_Capability_Map_Registration_Form_Cap('ee_edit_question_group', array('Question_Group', '', '', 'ee_edit_system_question_groups')),
151
+				new EE_Meta_Capability_Map_Edit('ee_edit_payment_method', array('Payment_Method', '', 'ee_edit_others_payment_methods', '')),
152 152
 				//reads
153
-				new EE_Meta_Capability_Map_Read( 'ee_read_event', array( 'Event', '', 'ee_read_others_events', 'ee_read_private_events' ) ),
154
-				new EE_Meta_Capability_Map_Read( 'ee_read_venue', array( 'Venue', '', 'ee_read_others_venues', 'ee_read_private_venues' ) ),
155
-				new EE_Meta_Capability_Map_Read( 'ee_read_registration', array( 'Registration', '', '', 'ee_edit_others_registrations' ) ),
156
-				new EE_Meta_Capability_Map_Read( 'ee_read_checkin', array( 'Registration', '', '', 'ee_read_others_checkins' ) ),
157
-				new EE_Meta_Capability_Map_Messages_Cap( 'ee_read_message', array( 'Message_Template_Group', '', 'ee_read_others_messages', 'ee_read_global_messages' ) ),
158
-				new EE_Meta_Capability_Map_Read( 'ee_read_default_ticket', array( 'Ticket', '', '', 'ee_read_others_default_tickets' ) ),
159
-				new EE_Meta_Capability_Map_Read( 'ee_read_payment_method', array( 'Payment_Method', '', '', 'ee_read_others_payment_methods' ) ),
153
+				new EE_Meta_Capability_Map_Read('ee_read_event', array('Event', '', 'ee_read_others_events', 'ee_read_private_events')),
154
+				new EE_Meta_Capability_Map_Read('ee_read_venue', array('Venue', '', 'ee_read_others_venues', 'ee_read_private_venues')),
155
+				new EE_Meta_Capability_Map_Read('ee_read_registration', array('Registration', '', '', 'ee_edit_others_registrations')),
156
+				new EE_Meta_Capability_Map_Read('ee_read_checkin', array('Registration', '', '', 'ee_read_others_checkins')),
157
+				new EE_Meta_Capability_Map_Messages_Cap('ee_read_message', array('Message_Template_Group', '', 'ee_read_others_messages', 'ee_read_global_messages')),
158
+				new EE_Meta_Capability_Map_Read('ee_read_default_ticket', array('Ticket', '', '', 'ee_read_others_default_tickets')),
159
+				new EE_Meta_Capability_Map_Read('ee_read_payment_method', array('Payment_Method', '', '', 'ee_read_others_payment_methods')),
160 160
 
161 161
 				//deletes
162
-				new EE_Meta_Capability_Map_Delete( 'ee_delete_event', array( 'Event', 'ee_delete_published_events', 'ee_delete_others_events', 'ee_delete_private_events' ) ),
163
-				new EE_Meta_Capability_Map_Delete( 'ee_delete_venue', array( 'Venue', 'ee_delete_published_venues', 'ee_delete_others_venues', 'ee_delete_private_venues' ) ),
164
-				new EE_Meta_Capability_Map_Delete( 'ee_delete_registration', array( 'Registration', '', 'ee_delete_others_registrations', '' ) ),
165
-				new EE_Meta_Capability_Map_Delete( 'ee_delete_checkin', array( 'Registration', '', 'ee_delete_others_checkins', '' ) ),
166
-				new EE_Meta_Capability_Map_Messages_Cap( 'ee_delete_message', array( 'Message_Template_Group', '', 'ee_delete_others_messages', 'ee_delete_global_messages' ) ),
167
-				new EE_Meta_Capability_Map_Delete( 'ee_delete_default_ticket', array( 'Ticket', '', 'ee_delete_others_default_tickets', '' ) ),
168
-				new EE_Meta_Capability_Map_Registration_Form_Cap( 'ee_delete_question', array( 'Question', '', '', 'delete_system_questions' ) ),
169
-				new EE_Meta_Capability_Map_Registration_Form_Cap( 'ee_delete_question_group', array( 'Question_Group', '', '', 'delete_system_question_groups' ) ),
170
-				new EE_Meta_Capability_Map_Delete( 'ee_delete_payment_method', array( 'Payment_Method', '', 'ee_delete_others_payment_methods', '' ) ),
162
+				new EE_Meta_Capability_Map_Delete('ee_delete_event', array('Event', 'ee_delete_published_events', 'ee_delete_others_events', 'ee_delete_private_events')),
163
+				new EE_Meta_Capability_Map_Delete('ee_delete_venue', array('Venue', 'ee_delete_published_venues', 'ee_delete_others_venues', 'ee_delete_private_venues')),
164
+				new EE_Meta_Capability_Map_Delete('ee_delete_registration', array('Registration', '', 'ee_delete_others_registrations', '')),
165
+				new EE_Meta_Capability_Map_Delete('ee_delete_checkin', array('Registration', '', 'ee_delete_others_checkins', '')),
166
+				new EE_Meta_Capability_Map_Messages_Cap('ee_delete_message', array('Message_Template_Group', '', 'ee_delete_others_messages', 'ee_delete_global_messages')),
167
+				new EE_Meta_Capability_Map_Delete('ee_delete_default_ticket', array('Ticket', '', 'ee_delete_others_default_tickets', '')),
168
+				new EE_Meta_Capability_Map_Registration_Form_Cap('ee_delete_question', array('Question', '', '', 'delete_system_questions')),
169
+				new EE_Meta_Capability_Map_Registration_Form_Cap('ee_delete_question_group', array('Question_Group', '', '', 'delete_system_question_groups')),
170
+				new EE_Meta_Capability_Map_Delete('ee_delete_payment_method', array('Payment_Method', '', 'ee_delete_others_payment_methods', '')),
171 171
 			);
172 172
 		}
173 173
 		return $default_meta_caps;
@@ -191,15 +191,15 @@  discard block
 block discarded – undo
191 191
 	 *
192 192
 	 * @return array   actual users capabilities
193 193
 	 */
194
-	public function map_meta_caps( $caps, $cap, $user_id, $args ) {
194
+	public function map_meta_caps($caps, $cap, $user_id, $args) {
195 195
 		//loop through our _meta_caps array
196
-		foreach ( $this->_meta_caps as $meta_map ) {
197
-			if ( ! $meta_map instanceof EE_Meta_Capability_Map ) {
196
+		foreach ($this->_meta_caps as $meta_map) {
197
+			if ( ! $meta_map instanceof EE_Meta_Capability_Map) {
198 198
 				continue;
199 199
 			}
200 200
 			$meta_map->ensure_is_model();
201 201
 
202
-			$caps = $meta_map->map_meta_caps( $caps, $cap, $user_id, $args );
202
+			$caps = $meta_map->map_meta_caps($caps, $cap, $user_id, $args);
203 203
 		}
204 204
 		return $caps;
205 205
 	}
@@ -364,7 +364,7 @@  discard block
 block discarded – undo
364 364
 				)
365 365
 			);
366 366
 
367
-		$caps = apply_filters( 'FHEE__EE_Capabilities__init_caps_map__caps', $caps );
367
+		$caps = apply_filters('FHEE__EE_Capabilities__init_caps_map__caps', $caps);
368 368
 		return $caps;
369 369
 	}
370 370
 
@@ -381,26 +381,26 @@  discard block
 block discarded – undo
381 381
 	 *
382 382
 	 * @return void
383 383
 	 */
384
-	public function init_role_caps( $reset = false, $custom_map = array() ) {
384
+	public function init_role_caps($reset = false, $custom_map = array()) {
385 385
 
386
-		$caps_map = empty( $custom_map ) ? $this->_caps_map : $custom_map;
386
+		$caps_map = empty($custom_map) ? $this->_caps_map : $custom_map;
387 387
 
388 388
 		//first let's determine if these caps have already been set.
389
-		$caps_set_before = get_option( self::option_name, array() );
389
+		$caps_set_before = get_option(self::option_name, array());
390 390
 		//if not reset, see what caps are new for each role. if they're new, add them.
391
-		foreach ( $caps_map as $role => $caps_for_role ) {
392
-			foreach ( $caps_for_role as $cap ) {
391
+		foreach ($caps_map as $role => $caps_for_role) {
392
+			foreach ($caps_for_role as $cap) {
393 393
 				//first check we haven't already added this cap before, or it's a reset
394
-				if ( $reset || ! isset( $caps_set_before[ $role ] ) || ! in_array( $cap, $caps_set_before[ $role ] ) ) {
395
-					$this->add_cap_to_role( $role, $cap );
396
-					$caps_set_before[ $role ][] = $cap;
394
+				if ($reset || ! isset($caps_set_before[$role]) || ! in_array($cap, $caps_set_before[$role])) {
395
+					$this->add_cap_to_role($role, $cap);
396
+					$caps_set_before[$role][] = $cap;
397 397
 				}
398 398
 			}
399 399
 		}
400 400
 
401 401
 		//now let's just save the cap that has been set.
402
-		update_option( self::option_name, $caps_set_before );
403
-		do_action( 'AHEE__EE_Capabilities__init_role_caps__complete', $caps_set_before );
402
+		update_option(self::option_name, $caps_set_before);
403
+		do_action('AHEE__EE_Capabilities__init_role_caps__complete', $caps_set_before);
404 404
 	}
405 405
 
406 406
 
@@ -419,10 +419,10 @@  discard block
 block discarded – undo
419 419
 	 * @param bool $grant  Whether to grant access to this cap on this role.
420 420
 	 * @return void
421 421
 	 */
422
-	public function add_cap_to_role( $role, $cap, $grant = true ) {
423
-		$role = get_role( $role );
424
-		if ( $role instanceof WP_Role ) {
425
-			$role->add_cap( $cap, $grant );
422
+	public function add_cap_to_role($role, $cap, $grant = true) {
423
+		$role = get_role($role);
424
+		if ($role instanceof WP_Role) {
425
+			$role->add_cap($cap, $grant);
426 426
 		}
427 427
 	}
428 428
 
@@ -442,10 +442,10 @@  discard block
 block discarded – undo
442 442
 	 *
443 443
 	 * @return void
444 444
 	 */
445
-	public function remove_cap_from_role( $role, $cap ) {
446
-		$role = get_role( $role );
447
-		if ( $role instanceof WP_Role ) {
448
-			$role->remove_cap( $cap );
445
+	public function remove_cap_from_role($role, $cap) {
446
+		$role = get_role($role);
447
+		if ($role instanceof WP_Role) {
448
+			$role->remove_cap($cap);
449 449
 		}
450 450
 	}
451 451
 
@@ -466,11 +466,11 @@  discard block
 block discarded – undo
466 466
 	 *
467 467
 	 * @return bool  Whether user can or not.
468 468
 	 */
469
-	public function current_user_can( $cap, $context, $id = 0 ) {
469
+	public function current_user_can($cap, $context, $id = 0) {
470 470
 		//apply filters (both a global on just the cap, and context specific.  Global overrides context specific)
471
-		$filtered_cap = apply_filters( 'FHEE__EE_Capabilities__current_user_can__cap__' . $context,  $cap, $id );
472
-		$filtered_cap = apply_filters( 'FHEE__EE_Capabilities__current_user_can__cap', $filtered_cap, $context, $cap, $id );
473
-		return ! empty( $id ) ? current_user_can( $filtered_cap, $id ) : current_user_can( $filtered_cap );
471
+		$filtered_cap = apply_filters('FHEE__EE_Capabilities__current_user_can__cap__'.$context, $cap, $id);
472
+		$filtered_cap = apply_filters('FHEE__EE_Capabilities__current_user_can__cap', $filtered_cap, $context, $cap, $id);
473
+		return ! empty($id) ? current_user_can($filtered_cap, $id) : current_user_can($filtered_cap);
474 474
 	}
475 475
 
476 476
 
@@ -487,11 +487,11 @@  discard block
 block discarded – undo
487 487
 	 *
488 488
 	 * @return bool Whether user can or not.
489 489
 	 */
490
-	public function user_can( $user, $cap, $context, $id = 0 ) {
490
+	public function user_can($user, $cap, $context, $id = 0) {
491 491
 		//apply filters (both a global on just the cap, and context specific.  Global overrides context specific)
492
-		$filtered_cap = apply_filters( 'FHEE__EE_Capabilities__user_can__cap__' . $context, $cap, $user, $id );
493
-		$filtered_cap = apply_filters( 'FHEE__EE_Capabilities__user_can__cap', $filtered_cap, $context, $cap, $user,  $id );
494
-		return ! empty( $id ) ? user_can( $user, $filtered_cap, $id ) : user_can( $user, $filtered_cap );
492
+		$filtered_cap = apply_filters('FHEE__EE_Capabilities__user_can__cap__'.$context, $cap, $user, $id);
493
+		$filtered_cap = apply_filters('FHEE__EE_Capabilities__user_can__cap', $filtered_cap, $context, $cap, $user, $id);
494
+		return ! empty($id) ? user_can($user, $filtered_cap, $id) : user_can($user, $filtered_cap);
495 495
 	}
496 496
 
497 497
 
@@ -511,12 +511,12 @@  discard block
 block discarded – undo
511 511
 	 *
512 512
 	 * @return bool  Whether user can or not.
513 513
 	 */
514
-	public function current_user_can_for_blog( $blog_id, $cap, $context, $id = 0 ) {
515
-		$user_can = ! empty( $id ) ? current_user_can_for_blog( $blog_id, $cap, $id ) : current_user_can( $blog_id, $cap );
514
+	public function current_user_can_for_blog($blog_id, $cap, $context, $id = 0) {
515
+		$user_can = ! empty($id) ? current_user_can_for_blog($blog_id, $cap, $id) : current_user_can($blog_id, $cap);
516 516
 
517 517
 		//apply filters (both a global on just the cap, and context specific.  Global overrides context specific)
518
-		$user_can = apply_filters( 'FHEE__EE_Capabilities__current_user_can_for_blog__user_can__' . $context, $user_can, $blog_id, $cap, $id );
519
-		$user_can = apply_filters( 'FHEE__EE_Capabilities__current_user_can_for_blog__user_can', $user_can, $context, $blog_id, $cap, $id );
518
+		$user_can = apply_filters('FHEE__EE_Capabilities__current_user_can_for_blog__user_can__'.$context, $user_can, $blog_id, $cap, $id);
519
+		$user_can = apply_filters('FHEE__EE_Capabilities__current_user_can_for_blog__user_can', $user_can, $context, $blog_id, $cap, $id);
520 520
 		return $user_can;
521 521
 	}
522 522
 
@@ -532,12 +532,12 @@  discard block
 block discarded – undo
532 532
 	 *
533 533
 	 * @return array
534 534
 	 */
535
-	public function get_ee_capabilities( $role = 'administrator' ) {
535
+	public function get_ee_capabilities($role = 'administrator') {
536 536
 		$capabilities = $this->_init_caps_map();
537
-		if ( empty( $role ) ) {
537
+		if (empty($role)) {
538 538
 			return $capabilities;
539 539
 		}
540
-		return isset( $capabilities[ $role ] ) ? $capabilities[ $role ] : array();
540
+		return isset($capabilities[$role]) ? $capabilities[$role] : array();
541 541
 	}
542 542
 }
543 543
 
@@ -585,11 +585,11 @@  discard block
 block discarded – undo
585 585
 	 * 	}
586 586
 	 * @throws EE_Error
587 587
 	 */
588
-	public function __construct( $meta_cap, $map_values ) {
588
+	public function __construct($meta_cap, $map_values) {
589 589
 		$this->meta_cap = $meta_cap;
590 590
 		//verify there are four args in the $map_values array;
591
-		if ( count( $map_values ) !== 4 ) {
592
-			throw new EE_Error( sprintf( __( 'Incoming $map_values array should have a count of four values in it.  This is what was given: %s', 'event_espresso' ), '<br>' . print_r( $map_values, true ) ) );
591
+		if (count($map_values) !== 4) {
592
+			throw new EE_Error(sprintf(__('Incoming $map_values array should have a count of four values in it.  This is what was given: %s', 'event_espresso'), '<br>'.print_r($map_values, true)));
593 593
 		}
594 594
 
595 595
 		//set properties
@@ -603,8 +603,8 @@  discard block
 block discarded – undo
603 603
 	/**
604 604
 	 * Makes it so this object stops filtering caps
605 605
 	 */
606
-	public function remove_filters(){
607
-		remove_filter( 'map_meta_cap', array( $this, 'map_meta_caps' ), 10 );
606
+	public function remove_filters() {
607
+		remove_filter('map_meta_cap', array($this, 'map_meta_caps'), 10);
608 608
 	}
609 609
 
610 610
 
@@ -619,19 +619,19 @@  discard block
 block discarded – undo
619 619
 	 */
620 620
 	public function ensure_is_model() {
621 621
 		//is it already instantiated?
622
-		if ( $this->_model instanceof EEM_Base ) {
622
+		if ($this->_model instanceof EEM_Base) {
623 623
 			return;
624 624
 		}
625 625
 
626 626
 		//ensure model name is string
627 627
 		$this->_model_name = (string) $this->_model_name;
628 628
 		//error proof if the name has EEM in it
629
-		$this->_model_name = str_replace( 'EEM', '', $this->_model_name );
629
+		$this->_model_name = str_replace('EEM', '', $this->_model_name);
630 630
 
631
-		$this->_model = EE_Registry::instance()->load_model( $this->_model_name );
631
+		$this->_model = EE_Registry::instance()->load_model($this->_model_name);
632 632
 
633
-		if ( ! $this->_model instanceof EEM_Base ) {
634
-			throw new EE_Error( sprintf( __( 'This string passed in to %s to represent a EEM_Base model class was not able to be used to instantiate the class.   Please ensure that the string is a match for the EEM_Base model name (not including the EEM_ part). This was given: %s', 'event_espresso' ), get_class( $this ), $this->_model ) );
633
+		if ( ! $this->_model instanceof EEM_Base) {
634
+			throw new EE_Error(sprintf(__('This string passed in to %s to represent a EEM_Base model class was not able to be used to instantiate the class.   Please ensure that the string is a match for the EEM_Base model name (not including the EEM_ part). This was given: %s', 'event_espresso'), get_class($this), $this->_model));
635 635
 		}
636 636
 	}
637 637
 
@@ -647,8 +647,8 @@  discard block
 block discarded – undo
647 647
 	 *
648 648
 	 * @return array
649 649
 	 */
650
-	public function map_meta_caps( $caps, $cap, $user_id, $args ) {
651
-		return $this->_map_meta_caps( $caps, $cap, $user_id, $args );
650
+	public function map_meta_caps($caps, $cap, $user_id, $args) {
651
+		return $this->_map_meta_caps($caps, $cap, $user_id, $args);
652 652
 	}
653 653
 
654 654
 
@@ -666,7 +666,7 @@  discard block
 block discarded – undo
666 666
 	 *
667 667
 	 * @return array   actual users capabilities
668 668
 	 */
669
-	abstract protected function _map_meta_caps( $caps, $cap, $user_id, $args );
669
+	abstract protected function _map_meta_caps($caps, $cap, $user_id, $args);
670 670
 }
671 671
 
672 672
 
@@ -698,28 +698,28 @@  discard block
 block discarded – undo
698 698
 	 *
699 699
 	 * @return array   actual users capabilities
700 700
 	 */
701
-	protected function _map_meta_caps( $caps, $cap, $user_id, $args ) {
701
+	protected function _map_meta_caps($caps, $cap, $user_id, $args) {
702 702
 		//only process if we're checking our mapped_cap
703
-		if ( $cap !== $this->meta_cap ) {
703
+		if ($cap !== $this->meta_cap) {
704 704
 			return $caps;
705 705
 		}
706 706
 
707
-		$obj = ! empty( $args[0] ) ? $this->_model->get_one_by_ID( $args[0] ) : null;
707
+		$obj = ! empty($args[0]) ? $this->_model->get_one_by_ID($args[0]) : null;
708 708
 
709 709
 		//if no obj then let's just do cap
710
-		if ( ! $obj instanceof EE_Base_Class ) {
710
+		if ( ! $obj instanceof EE_Base_Class) {
711 711
 			$caps[] = $cap;
712 712
 			return $caps;
713 713
 		}
714 714
 
715
-		if ( $obj instanceof EE_CPT_Base ) {
715
+		if ($obj instanceof EE_CPT_Base) {
716 716
 			//if the item author is set and the user is the author...
717
-			if ( $obj->wp_user() && $user_id == $obj->wp_user() ) {
718
-				if ( empty( $this->published_cap ) ) {
717
+			if ($obj->wp_user() && $user_id == $obj->wp_user()) {
718
+				if (empty($this->published_cap)) {
719 719
 					$caps[] = $cap;
720 720
 				} else {
721 721
 					//if obj is published...
722
-					if ( $obj->status() == 'publish' ) {
722
+					if ($obj->status() == 'publish') {
723 723
 						$caps[] = $this->published_cap;
724 724
 					} else {
725 725
 						$caps[] = $cap;
@@ -727,21 +727,21 @@  discard block
 block discarded – undo
727 727
 				}
728 728
 			} else {
729 729
 				//the user is trying to edit someone else's obj
730
-				if ( ! empty( $this->others_cap ) ) {
730
+				if ( ! empty($this->others_cap)) {
731 731
 					$caps[] = $this->others_cap;
732 732
 				}
733
-				if ( ! empty( $this->published_cap ) && $obj->status() == 'publish' ) {
733
+				if ( ! empty($this->published_cap) && $obj->status() == 'publish') {
734 734
 					$caps[] = $this->published_cap;
735
-				} elseif ( ! empty( $this->private_cap ) && $obj->status() == 'private' ) {
735
+				} elseif ( ! empty($this->private_cap) && $obj->status() == 'private') {
736 736
 					$caps[] = $this->private_cap;
737 737
 				}
738 738
 			}
739 739
 		} else {
740 740
 			//not a cpt object so handled differently
741
-			if ( method_exists( $obj, 'wp_user' ) && $obj->wp_user() && $user_id == $obj->wp_user() ) {
741
+			if (method_exists($obj, 'wp_user') && $obj->wp_user() && $user_id == $obj->wp_user()) {
742 742
 				$caps[] = $cap;
743 743
 			} else {
744
-				if ( ! empty( $this->others_cap ) ) {
744
+				if ( ! empty($this->others_cap)) {
745 745
 					$caps[] = $this->others_cap;
746 746
 				}
747 747
 			}
@@ -778,8 +778,8 @@  discard block
 block discarded – undo
778 778
 	 *
779 779
 	 * @return array   actual users capabilities
780 780
 	 */
781
-	protected function _map_meta_caps( $caps, $cap, $user_id, $args ) {
782
-		return parent::_map_meta_caps( $caps, $cap, $user_id, $args );
781
+	protected function _map_meta_caps($caps, $cap, $user_id, $args) {
782
+		return parent::_map_meta_caps($caps, $cap, $user_id, $args);
783 783
 	}
784 784
 }
785 785
 
@@ -811,45 +811,45 @@  discard block
 block discarded – undo
811 811
 	 *
812 812
 	 * @return array   actual users capabilities
813 813
 	 */
814
-	protected function _map_meta_caps( $caps, $cap, $user_id, $args ) {
814
+	protected function _map_meta_caps($caps, $cap, $user_id, $args) {
815 815
 		//only process if we're checking our mapped cap;
816
-		if ( $cap !== $this->meta_cap ) {
816
+		if ($cap !== $this->meta_cap) {
817 817
 			return $caps;
818 818
 		}
819 819
 
820
-		$obj = ! empty( $args[0] ) ? $this->_model->get_one_by_ID( $args[0] ) : null;
820
+		$obj = ! empty($args[0]) ? $this->_model->get_one_by_ID($args[0]) : null;
821 821
 
822 822
 		//if no obj then let's just do cap
823
-		if ( ! $obj instanceof EE_Base_Class ) {
823
+		if ( ! $obj instanceof EE_Base_Class) {
824 824
 			$caps[] = $cap;
825 825
 			return $caps;
826 826
 		}
827 827
 
828
-		if ( $obj instanceof EE_CPT_Base ) {
829
-			$status_obj = get_post_status_object( $obj->status() );
830
-			if ( $status_obj->public ) {
828
+		if ($obj instanceof EE_CPT_Base) {
829
+			$status_obj = get_post_status_object($obj->status());
830
+			if ($status_obj->public) {
831 831
 				$caps[] = $cap;
832 832
 				return $caps;
833 833
 			}
834 834
 
835 835
 			//if the item author is set and the user is the author...
836
-			if ( $obj->wp_user() && $user_id == $obj->wp_user() ) {
836
+			if ($obj->wp_user() && $user_id == $obj->wp_user()) {
837 837
 				$caps[] = $cap;
838
-			} elseif ( $status_obj->private && ! empty( $this->private_cap ) ) {
838
+			} elseif ($status_obj->private && ! empty($this->private_cap)) {
839 839
 				//the user is trying to view someone else's obj
840 840
 				$caps[] = $this->private_cap;
841
-			} elseif ( ! empty( $this->others_cap ) ) {
841
+			} elseif ( ! empty($this->others_cap)) {
842 842
 				$caps[] = $this->others_cap;
843 843
 			} else {
844 844
 				$caps[] = $cap;
845 845
 			}
846 846
 		} else {
847 847
 			//not a cpt object so handled differently
848
-			if ( method_exists( $obj, 'wp_user' ) && $obj->wp_user() && $user_id == $obj->wp_user() ) {
848
+			if (method_exists($obj, 'wp_user') && $obj->wp_user() && $user_id == $obj->wp_user()) {
849 849
 				$caps[] = $cap;
850
-			} elseif ( ! empty( $this->private_cap ) ) {
850
+			} elseif ( ! empty($this->private_cap)) {
851 851
 				$caps[] = $this->private_cap;
852
-			} elseif ( ! empty( $this->others_cap ) ) {
852
+			} elseif ( ! empty($this->others_cap)) {
853 853
 				$caps[] = $this->others_cap;
854 854
 			} else {
855 855
 				$caps[] = $cap;
@@ -886,30 +886,30 @@  discard block
 block discarded – undo
886 886
 	 *
887 887
 	 * @return array   actual users capabilities
888 888
 	 */
889
-	protected function _map_meta_caps( $caps, $cap, $user_id, $args ) {
889
+	protected function _map_meta_caps($caps, $cap, $user_id, $args) {
890 890
 		//only process if we're checking our mapped_cap
891
-		if ( $cap !== $this->meta_cap ) {
891
+		if ($cap !== $this->meta_cap) {
892 892
 			return $caps;
893 893
 		}
894 894
 
895
-		$obj = ! empty( $args[0] ) ? $this->_model->get_one_by_ID( $args[0] ) : null;
895
+		$obj = ! empty($args[0]) ? $this->_model->get_one_by_ID($args[0]) : null;
896 896
 
897 897
 		//if no obj then let's just do cap
898
-		if ( ! $obj instanceof EE_Message_Template_Group ) {
898
+		if ( ! $obj instanceof EE_Message_Template_Group) {
899 899
 			$caps[] = $cap;
900 900
 			return $caps;
901 901
 		}
902 902
 
903 903
 		$is_global = $obj->is_global();
904 904
 
905
-		if ( $obj->wp_user() && $user_id == $obj->wp_user() ) {
906
-			if ( $is_global ) {
907
-				$caps[]  = $this->private_cap;
905
+		if ($obj->wp_user() && $user_id == $obj->wp_user()) {
906
+			if ($is_global) {
907
+				$caps[] = $this->private_cap;
908 908
 			} else {
909 909
 				$caps[] = $cap;
910 910
 			}
911 911
 		} else {
912
-			if ( $is_global ) {
912
+			if ($is_global) {
913 913
 				$caps[] = $this->private_cap;
914 914
 			} else {
915 915
 				$caps[] = $this->others_cap;
@@ -947,16 +947,16 @@  discard block
 block discarded – undo
947 947
 	 *
948 948
 	 * @return array   actual users capabilities
949 949
 	 */
950
-	protected function _map_meta_caps( $caps, $cap, $user_id, $args ) {
950
+	protected function _map_meta_caps($caps, $cap, $user_id, $args) {
951 951
 		//only process if we're checking our mapped_cap
952
-		if ( $cap !== $this->meta_cap ) {
952
+		if ($cap !== $this->meta_cap) {
953 953
 			return $caps;
954 954
 		}
955 955
 
956
-		$obj = ! empty( $args[0] ) ? $this->_model->get_one_by_ID( $args[0] ) : null;
956
+		$obj = ! empty($args[0]) ? $this->_model->get_one_by_ID($args[0]) : null;
957 957
 
958 958
 		//if no obj then let's just do cap
959
-		if ( ! $obj instanceof EE_Base_Class ) {
959
+		if ( ! $obj instanceof EE_Base_Class) {
960 960
 			$caps[] = $cap;
961 961
 			return $caps;
962 962
 		}
@@ -964,7 +964,7 @@  discard block
 block discarded – undo
964 964
 		$is_system = $obj instanceof EE_Question_Group ? $obj->system_group() : false;
965 965
 		$is_system = $obj instanceof EE_Question ? $obj->is_system_question() : $is_system;
966 966
 
967
-		if ( $is_system ) {
967
+		if ($is_system) {
968 968
 			$caps[] = $this->private_cap;
969 969
 		} else {
970 970
 			$caps[] = $cap;
Please login to merge, or discard this patch.
core/EE_Config.core.php 4 patches
Doc Comments   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -313,7 +313,7 @@  discard block
 block discarded – undo
313 313
 	 *    update_espresso_config
314 314
 	 *
315 315
 	 * @access   public
316
-	 * @return   bool
316
+	 * @return   boolean|null
317 317
 	 */
318 318
 	protected function  _reset_espresso_addon_config() {
319 319
 		$this->_config_option_names = array();
@@ -381,7 +381,7 @@  discard block
 block discarded – undo
381 381
 	 * @param    string                $name
382 382
 	 * @param    string                $config_class
383 383
 	 * @param    EE_Config_Base 	$config_obj
384
-	 * @param    array                 $tests_to_run
384
+	 * @param    integer[]                 $tests_to_run
385 385
 	 * @param    bool                  $display_errors
386 386
 	 * @return    bool    TRUE on success, FALSE on fail
387 387
 	 */
@@ -1442,7 +1442,7 @@  discard block
 block discarded – undo
1442 1442
 
1443 1443
 
1444 1444
 	/**
1445
-	 * @return array
1445
+	 * @return integer[]
1446 1446
 	 */
1447 1447
 	public function get_critical_pages_array() {
1448 1448
 		return array(
@@ -1455,7 +1455,7 @@  discard block
 block discarded – undo
1455 1455
 
1456 1456
 
1457 1457
 	/**
1458
-	 * @return array
1458
+	 * @return string[]
1459 1459
 	 */
1460 1460
 	public function get_critical_pages_shortcodes_array() {
1461 1461
 		return array(
@@ -1778,7 +1778,7 @@  discard block
 block discarded – undo
1778 1778
 	 *    class constructor
1779 1779
 	 *
1780 1780
 	 * @access    public
1781
-	 * @param null $CNT_ISO
1781
+	 * @param string $CNT_ISO
1782 1782
 	 * @return \EE_Currency_Config
1783 1783
 	 */
1784 1784
 	public function __construct( $CNT_ISO = NULL ) {
Please login to merge, or discard this patch.
Braces   +6 added lines, -4 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
  *
4 6
  * Class EE_Payment_Method_Manager
@@ -139,7 +141,7 @@  discard block
 block discarded – undo
139 141
 		if(isset($this->_payment_method_types[$payment_method_name])){
140 142
 			require_once($this->_payment_method_types[$payment_method_name]);
141 143
 			return true;
142
-		}else{
144
+		} else{
143 145
 			return false;
144 146
 		}
145 147
 	}
@@ -159,7 +161,7 @@  discard block
 block discarded – undo
159 161
 				$payment_methods[] = $this->payment_method_class_from_type($classname);
160 162
 			}
161 163
 			return $payment_methods;
162
-		}else{
164
+		} else{
163 165
 			return array_keys($this->_payment_method_types);
164 166
 		}
165 167
 	}
@@ -242,7 +244,7 @@  discard block
 block discarded – undo
242 244
 				}
243 245
 			}
244 246
 
245
-		}else{
247
+		} else{
246 248
 			$payment_method->set_active();
247 249
 			$payment_method->save();
248 250
 		}
Please login to merge, or discard this patch.
Indentation   +140 added lines, -140 removed lines patch added patch discarded remove patch
@@ -89,10 +89,10 @@  discard block
 block discarded – undo
89 89
 	public $map_settings = null;
90 90
 
91 91
 	/**
92
-	*
93
-	* @deprecated
94
-	* @var EE_Gateway_Config
95
-	*/
92
+	 *
93
+	 * @deprecated
94
+	 * @var EE_Gateway_Config
95
+	 */
96 96
 	public $gateway = null;
97 97
 
98 98
 	/**
@@ -582,7 +582,7 @@  discard block
 block discarded – undo
582 582
 
583 583
 	/**
584 584
 	 *    update_config
585
-         * Important: the config object must ALREADY be set, otherwise this will produce an error.
585
+	 * Important: the config object must ALREADY be set, otherwise this will produce an error.
586 586
 	 *
587 587
 	 * @access    public
588 588
 	 * @param    string                 $section
@@ -1606,51 +1606,51 @@  discard block
 block discarded – undo
1606 1606
 class EE_Organization_Config extends EE_Config_Base {
1607 1607
 
1608 1608
 	/**
1609
-	* @var string  $name
1610
-	* eg EE4.1
1611
-	*/
1609
+	 * @var string  $name
1610
+	 * eg EE4.1
1611
+	 */
1612 1612
 	public $name;
1613 1613
 
1614 1614
 	/**
1615
-	* @var string $address_1
1616
-	* eg 123 Onna Road
1617
-	*/
1615
+	 * @var string $address_1
1616
+	 * eg 123 Onna Road
1617
+	 */
1618 1618
 	public $address_1;
1619 1619
 
1620 1620
 	/**
1621
-	* @var string $address_2
1622
-	* eg PO Box 123
1623
-	*/
1621
+	 * @var string $address_2
1622
+	 * eg PO Box 123
1623
+	 */
1624 1624
 	public $address_2;
1625 1625
 
1626 1626
 	/**
1627
-	* @var string $city
1628
-	* eg Inna City
1629
-	*/
1627
+	 * @var string $city
1628
+	 * eg Inna City
1629
+	 */
1630 1630
 	public $city;
1631 1631
 
1632 1632
 	/**
1633
-	* @var int $STA_ID
1634
-	* eg 4
1635
-	*/
1633
+	 * @var int $STA_ID
1634
+	 * eg 4
1635
+	 */
1636 1636
 	public $STA_ID;
1637 1637
 
1638 1638
 	/**
1639
-	* @var string  $CNT_ISO
1640
-	* eg US
1641
-	*/
1639
+	 * @var string  $CNT_ISO
1640
+	 * eg US
1641
+	 */
1642 1642
 	public $CNT_ISO;
1643 1643
 
1644 1644
 	/**
1645
-	* @var string $zip
1646
-	* eg 12345  or V1A 2B3
1647
-	*/
1645
+	 * @var string $zip
1646
+	 * eg 12345  or V1A 2B3
1647
+	 */
1648 1648
 	public $zip;
1649 1649
 
1650 1650
 	/**
1651
-	* @var string  $email
1652
-	* eg [email protected]
1653
-	*/
1651
+	 * @var string  $email
1652
+	 * eg [email protected]
1653
+	 */
1654 1654
 	public $email;
1655 1655
 
1656 1656
 
@@ -1669,9 +1669,9 @@  discard block
 block discarded – undo
1669 1669
 	public $vat;
1670 1670
 
1671 1671
 	/**
1672
-	* @var string  $logo_url
1673
-	* eg http://www.somedomain.com/wp-content/uploads/kittehs.jpg
1674
-	*/
1672
+	 * @var string  $logo_url
1673
+	 * eg http://www.somedomain.com/wp-content/uploads/kittehs.jpg
1674
+	 */
1675 1675
 	public $logo_url;
1676 1676
 
1677 1677
 
@@ -1765,55 +1765,55 @@  discard block
 block discarded – undo
1765 1765
 class EE_Currency_Config extends EE_Config_Base {
1766 1766
 
1767 1767
 	/**
1768
-	* @var string  $code
1769
-	* eg 'US'
1770
-	*/
1768
+	 * @var string  $code
1769
+	 * eg 'US'
1770
+	 */
1771 1771
 	public $code;
1772 1772
 
1773 1773
 	/**
1774
-	* @var string $name
1775
-	* eg 'Dollar'
1776
-	*/
1774
+	 * @var string $name
1775
+	 * eg 'Dollar'
1776
+	 */
1777 1777
 	public $name;
1778 1778
 
1779 1779
 	/**
1780
-	* plural name
1781
-	* @var string $plural
1782
-	* eg 'Dollars'
1783
-	*/
1780
+	 * plural name
1781
+	 * @var string $plural
1782
+	 * eg 'Dollars'
1783
+	 */
1784 1784
 	public $plural;
1785 1785
 
1786 1786
 	/**
1787
-	* currency sign
1788
-	* @var string  $sign
1789
-	* eg '$'
1790
-	*/
1787
+	 * currency sign
1788
+	 * @var string  $sign
1789
+	 * eg '$'
1790
+	 */
1791 1791
 	public $sign;
1792 1792
 
1793 1793
 	/**
1794
-	* Whether the currency sign should come before the number or not
1795
-	* @var boolean $sign_b4
1796
-	*/
1794
+	 * Whether the currency sign should come before the number or not
1795
+	 * @var boolean $sign_b4
1796
+	 */
1797 1797
 	public $sign_b4;
1798 1798
 
1799 1799
 	/**
1800
-	* How many digits should come after the decimal place
1801
-	* @var int $dec_plc
1802
-	*/
1800
+	 * How many digits should come after the decimal place
1801
+	 * @var int $dec_plc
1802
+	 */
1803 1803
 	public $dec_plc;
1804 1804
 
1805 1805
 	/**
1806
-	* Symbol to use for decimal mark
1807
-	* @var string $dec_mrk
1808
-	* eg '.'
1809
-	*/
1806
+	 * Symbol to use for decimal mark
1807
+	 * @var string $dec_mrk
1808
+	 * eg '.'
1809
+	 */
1810 1810
 	public $dec_mrk;
1811 1811
 
1812 1812
 	/**
1813
-	* Symbol to use for thousands
1814
-	* @var string $thsnds
1815
-	* eg ','
1816
-	*/
1813
+	 * Symbol to use for thousands
1814
+	 * @var string $thsnds
1815
+	 * eg ','
1816
+	 */
1817 1817
 	public $thsnds;
1818 1818
 
1819 1819
 
@@ -1881,13 +1881,13 @@  discard block
 block discarded – undo
1881 1881
 	 * 	whether or not to show alternate payment options during the reg process if payment status is pending
1882 1882
 	 * @var boolean $show_pending_payment_options
1883 1883
 	 */
1884
-      public $show_pending_payment_options;
1884
+	  public $show_pending_payment_options;
1885 1885
 
1886 1886
 	/**
1887 1887
 	 * Whether to skip the registration confirmation page
1888 1888
 	 * @var boolean $skip_reg_confirmation
1889 1889
 	 */
1890
-      public $skip_reg_confirmation;
1890
+	  public $skip_reg_confirmation;
1891 1891
 
1892 1892
 	/**
1893 1893
 	 * an array of SPCO reg steps where:
@@ -1898,64 +1898,64 @@  discard block
 block discarded – undo
1898 1898
 	 * 			"slug" => the URL param used to trigger the reg step
1899 1899
 	 * @var array $reg_steps
1900 1900
 	 */
1901
-      public $reg_steps;
1901
+	  public $reg_steps;
1902 1902
 
1903 1903
 	/**
1904 1904
 	 * Whether registration confirmation should be the last page of SPCO
1905 1905
 	 * @var boolean $reg_confirmation_last
1906 1906
 	 */
1907
-      public $reg_confirmation_last;
1907
+	  public $reg_confirmation_last;
1908 1908
 
1909 1909
 	  /**
1910 1910
 	   * Whether or not to enable the EE Bot Trap
1911 1911
 	   * @var boolean $use_bot_trap
1912 1912
 	   */
1913
-      public $use_bot_trap;
1913
+	  public $use_bot_trap;
1914 1914
 
1915 1915
 	  /**
1916 1916
 	   * Whether or not to encrypt some data sent by the EE Bot Trap
1917 1917
 	   * @var boolean $use_encryption
1918 1918
 	   */
1919
-      public $use_encryption;
1919
+	  public $use_encryption;
1920 1920
 
1921 1921
 	  /**
1922 1922
 	   * Whether or not to use ReCaptcha
1923 1923
 	   * @var boolean $use_captcha
1924 1924
 	   */
1925
-      public $use_captcha;
1925
+	  public $use_captcha;
1926 1926
 
1927 1927
 	  /**
1928 1928
 	   * ReCaptcha Theme
1929 1929
 	   * @var string $recaptcha_theme
1930 1930
 	   * 	options: 'dark	', 'light'
1931 1931
 	   */
1932
-      public $recaptcha_theme;
1932
+	  public $recaptcha_theme;
1933 1933
 
1934 1934
 	  /**
1935 1935
 	   * ReCaptcha Type
1936 1936
 	   * @var string $recaptcha_type
1937 1937
 	   * 	options: 'audio', 'image'
1938 1938
 	   */
1939
-      public $recaptcha_type;
1939
+	  public $recaptcha_type;
1940 1940
 
1941 1941
 	  /**
1942 1942
 	   * ReCaptcha language
1943 1943
 	   * @var string $recaptcha_language
1944 1944
 	   * eg 'en'
1945 1945
 	   */
1946
-      public $recaptcha_language;
1946
+	  public $recaptcha_language;
1947 1947
 
1948 1948
 	  /**
1949 1949
 	   * ReCaptcha public key
1950 1950
 	   * @var string $recaptcha_publickey
1951 1951
 	   */
1952
-      public $recaptcha_publickey;
1952
+	  public $recaptcha_publickey;
1953 1953
 
1954 1954
 	  /**
1955 1955
 	   * ReCaptcha private key
1956 1956
 	   * @var string $recaptcha_privatekey
1957 1957
 	   */
1958
-      public $recaptcha_privatekey;
1958
+	  public $recaptcha_privatekey;
1959 1959
 
1960 1960
 	/**
1961 1961
 	 * ReCaptcha width
@@ -2021,58 +2021,58 @@  discard block
 block discarded – undo
2021 2021
 class EE_Admin_Config extends EE_Config_Base {
2022 2022
 
2023 2023
 	/**
2024
-	* @var boolean $use_personnel_manager
2025
-	*/
2024
+	 * @var boolean $use_personnel_manager
2025
+	 */
2026 2026
 	public $use_personnel_manager;
2027 2027
 
2028 2028
 	/**
2029
-	* @var boolean $use_dashboard_widget
2030
-	*/
2029
+	 * @var boolean $use_dashboard_widget
2030
+	 */
2031 2031
 	public $use_dashboard_widget;
2032 2032
 
2033 2033
 	/**
2034
-	* @var int $events_in_dashboard
2035
-	*/
2034
+	 * @var int $events_in_dashboard
2035
+	 */
2036 2036
 	public $events_in_dashboard;
2037 2037
 
2038 2038
 	/**
2039
-	* @var boolean $use_event_timezones
2040
-	*/
2039
+	 * @var boolean $use_event_timezones
2040
+	 */
2041 2041
 	public $use_event_timezones;
2042 2042
 
2043 2043
 	/**
2044
-	* @var boolean $use_full_logging
2045
-	*/
2044
+	 * @var boolean $use_full_logging
2045
+	 */
2046 2046
 	public $use_full_logging;
2047 2047
 
2048 2048
 	/**
2049
-	* @var string $log_file_name
2050
-	*/
2049
+	 * @var string $log_file_name
2050
+	 */
2051 2051
 	public $log_file_name;
2052 2052
 
2053 2053
 	/**
2054
-	* @var string $debug_file_name
2055
-	*/
2054
+	 * @var string $debug_file_name
2055
+	 */
2056 2056
 	public $debug_file_name;
2057 2057
 
2058 2058
 	/**
2059
-	* @var boolean $use_remote_logging
2060
-	*/
2059
+	 * @var boolean $use_remote_logging
2060
+	 */
2061 2061
 	public $use_remote_logging;
2062 2062
 
2063 2063
 	/**
2064
-	* @var string $remote_logging_url
2065
-	*/
2064
+	 * @var string $remote_logging_url
2065
+	 */
2066 2066
 	public $remote_logging_url;
2067 2067
 
2068 2068
 	/**
2069
-	* @var boolean $show_reg_footer
2070
-	*/
2069
+	 * @var boolean $show_reg_footer
2070
+	 */
2071 2071
 	public $show_reg_footer;
2072 2072
 
2073 2073
 	/**
2074
-	* @var string $affiliate_id
2075
-	*/
2074
+	 * @var string $affiliate_id
2075
+	 */
2076 2076
 	public $affiliate_id;
2077 2077
 
2078 2078
 
@@ -2146,43 +2146,43 @@  discard block
 block discarded – undo
2146 2146
 class EE_Template_Config extends EE_Config_Base {
2147 2147
 
2148 2148
 	/**
2149
-	* @var boolean $enable_default_style
2150
-	*/
2149
+	 * @var boolean $enable_default_style
2150
+	 */
2151 2151
 	public $enable_default_style;
2152 2152
 
2153 2153
 	/**
2154
-	* @var string $custom_style_sheet
2155
-	*/
2154
+	 * @var string $custom_style_sheet
2155
+	 */
2156 2156
 	public $custom_style_sheet;
2157 2157
 
2158 2158
 	/**
2159
-	* @var boolean $display_address_in_regform
2160
-	*/
2159
+	 * @var boolean $display_address_in_regform
2160
+	 */
2161 2161
 	public $display_address_in_regform;
2162 2162
 
2163 2163
 	/**
2164
-	* @var int $display_description_on_multi_reg_page
2165
-	*/
2164
+	 * @var int $display_description_on_multi_reg_page
2165
+	 */
2166 2166
 	public $display_description_on_multi_reg_page;
2167 2167
 
2168 2168
 	/**
2169
-	* @var boolean $use_custom_templates
2170
-	*/
2169
+	 * @var boolean $use_custom_templates
2170
+	 */
2171 2171
 	public $use_custom_templates;
2172 2172
 
2173 2173
 	/**
2174
-	* @var string $current_espresso_theme
2175
-	*/
2174
+	 * @var string $current_espresso_theme
2175
+	 */
2176 2176
 	public $current_espresso_theme;
2177 2177
 
2178 2178
 	/**
2179
-	* @var EE_Event_Single_Config $EED_Event_Single
2180
-	*/
2179
+	 * @var EE_Event_Single_Config $EED_Event_Single
2180
+	 */
2181 2181
 	public $EED_Event_Single;
2182 2182
 
2183 2183
 	/**
2184
-	* @var EE_Events_Archive_Config $EED_Events_Archive
2185
-	*/
2184
+	 * @var EE_Events_Archive_Config $EED_Events_Archive
2185
+	 */
2186 2186
 	public $EED_Events_Archive;
2187 2187
 
2188 2188
 
@@ -2215,78 +2215,78 @@  discard block
 block discarded – undo
2215 2215
 class EE_Map_Config extends EE_Config_Base {
2216 2216
 
2217 2217
 	/**
2218
-	* @var boolean $use_google_maps
2219
-	*/
2218
+	 * @var boolean $use_google_maps
2219
+	 */
2220 2220
 	public $use_google_maps;
2221 2221
 
2222 2222
 	/**
2223
-	* @var int $event_details_map_width
2224
-	*/
2223
+	 * @var int $event_details_map_width
2224
+	 */
2225 2225
 	public $event_details_map_width;
2226 2226
 
2227 2227
 	/**
2228
-	* @var int $event_details_map_height
2229
-	*/
2228
+	 * @var int $event_details_map_height
2229
+	 */
2230 2230
 	public $event_details_map_height;
2231 2231
 
2232 2232
 	/**
2233
-	* @var int $event_details_map_zoom
2234
-	*/
2233
+	 * @var int $event_details_map_zoom
2234
+	 */
2235 2235
 	public $event_details_map_zoom;
2236 2236
 
2237 2237
 	/**
2238
-	* @var boolean $event_details_display_nav
2239
-	*/
2238
+	 * @var boolean $event_details_display_nav
2239
+	 */
2240 2240
 	public $event_details_display_nav;
2241 2241
 
2242 2242
 	/**
2243
-	* @var boolean $event_details_nav_size
2244
-	*/
2243
+	 * @var boolean $event_details_nav_size
2244
+	 */
2245 2245
 	public $event_details_nav_size;
2246 2246
 
2247 2247
 	/**
2248
-	* @var string $event_details_control_type
2249
-	*/
2248
+	 * @var string $event_details_control_type
2249
+	 */
2250 2250
 	public $event_details_control_type;
2251 2251
 
2252 2252
 	/**
2253
-	* @var string $event_details_map_align
2254
-	*/
2253
+	 * @var string $event_details_map_align
2254
+	 */
2255 2255
 	public $event_details_map_align;
2256 2256
 
2257 2257
 	/**
2258
-	* @var int $event_list_map_width
2259
-	*/
2258
+	 * @var int $event_list_map_width
2259
+	 */
2260 2260
 	public $event_list_map_width;
2261 2261
 
2262 2262
 	/**
2263
-	* @var int $event_list_map_height
2264
-	*/
2263
+	 * @var int $event_list_map_height
2264
+	 */
2265 2265
 	public $event_list_map_height;
2266 2266
 
2267 2267
 	/**
2268
-	* @var int $event_list_map_zoom
2269
-	*/
2268
+	 * @var int $event_list_map_zoom
2269
+	 */
2270 2270
 	public $event_list_map_zoom;
2271 2271
 
2272 2272
 	/**
2273
-	* @var boolean $event_list_display_nav
2274
-	*/
2273
+	 * @var boolean $event_list_display_nav
2274
+	 */
2275 2275
 	public $event_list_display_nav;
2276 2276
 
2277 2277
 	/**
2278
-	* @var boolean $event_list_nav_size
2279
-	*/
2278
+	 * @var boolean $event_list_nav_size
2279
+	 */
2280 2280
 	public $event_list_nav_size;
2281 2281
 
2282 2282
 	/**
2283
-	* @var string $event_list_control_type
2284
-	*/
2283
+	 * @var string $event_list_control_type
2284
+	 */
2285 2285
 	public $event_list_control_type;
2286 2286
 
2287 2287
 	/**
2288
-	* @var string $event_list_map_align
2289
-	*/
2288
+	 * @var string $event_list_map_align
2289
+	 */
2290 2290
 	public $event_list_map_align;
2291 2291
 
2292 2292
 
Please login to merge, or discard this patch.
Spacing   +397 added lines, -397 removed lines patch added patch discarded remove patch
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
 	 */
129 129
 	public static function instance() {
130 130
 		// check if class object is instantiated, and instantiated properly
131
-		if ( ! self::$_instance instanceof EE_Config ) {
131
+		if ( ! self::$_instance instanceof EE_Config) {
132 132
 			self::$_instance = new self();
133 133
 		}
134 134
 		return self::$_instance;
@@ -145,22 +145,22 @@  discard block
 block discarded – undo
145 145
 	 * not be ready to instantiate EE_Config currently (eg if the site was put into maintenance mode)
146 146
 	 * @return EE_Config
147 147
 	 */
148
-	public static function reset( $hard_reset = FALSE, $reinstantiate = TRUE ){
149
-		if ( $hard_reset ) {
148
+	public static function reset($hard_reset = FALSE, $reinstantiate = TRUE) {
149
+		if ($hard_reset) {
150 150
 			self::$_instance->_config_option_names = array();
151 151
 			self::$_instance->_initialize_config();
152 152
 			self::$_instance->update_espresso_config();
153 153
 		}
154
-		if( self::$_instance instanceof EE_Config ){
154
+		if (self::$_instance instanceof EE_Config) {
155 155
 			self::$_instance->shutdown();
156 156
 		}
157 157
 		self::$_instance = NULL;
158 158
 		//we don't need to reset the static properties imo because those should
159 159
 		//only change when a module is added or removed. Currently we don't
160 160
 		//support removing a module during a request when it previously existed
161
-		if( $reinstantiate ){
161
+		if ($reinstantiate) {
162 162
 			return self::instance();
163
-		}else{
163
+		} else {
164 164
 			return NULL;
165 165
 		}
166 166
 	}
@@ -174,8 +174,8 @@  discard block
 block discarded – undo
174 174
 	 * @return \EE_Config
175 175
 	 */
176 176
 	private function __construct() {
177
-		do_action( 'AHEE__EE_Config__construct__begin',$this );
178
-		$this->_config_option_names = get_option( 'ee_config_option_names', array() );
177
+		do_action('AHEE__EE_Config__construct__begin', $this);
178
+		$this->_config_option_names = get_option('ee_config_option_names', array());
179 179
 		// setup empty config classes
180 180
 		$this->_initialize_config();
181 181
 		// load existing EE site settings
@@ -183,15 +183,15 @@  discard block
 block discarded – undo
183 183
 		// confirm everything loaded correctly and set filtered defaults if not
184 184
 		$this->_verify_config();
185 185
 		//  register shortcodes and modules
186
-		add_action( 'AHEE__EE_System__register_shortcodes_modules_and_widgets', array( $this, 'register_shortcodes_and_modules' ), 999 );
186
+		add_action('AHEE__EE_System__register_shortcodes_modules_and_widgets', array($this, 'register_shortcodes_and_modules'), 999);
187 187
 		//  initialize shortcodes and modules
188
-		add_action( 'AHEE__EE_System__core_loaded_and_ready', array( $this, 'initialize_shortcodes_and_modules' ));
188
+		add_action('AHEE__EE_System__core_loaded_and_ready', array($this, 'initialize_shortcodes_and_modules'));
189 189
 		// register widgets
190
-		add_action( 'widgets_init', array( $this, 'widgets_init' ), 10 );
190
+		add_action('widgets_init', array($this, 'widgets_init'), 10);
191 191
 		// shutdown
192
-		add_action( 'shutdown', array( $this, 'shutdown' ), 10 );
192
+		add_action('shutdown', array($this, 'shutdown'), 10);
193 193
 		// construct__end hook
194
-		do_action( 'AHEE__EE_Config__construct__end',$this );
194
+		do_action('AHEE__EE_Config__construct__end', $this);
195 195
 		// hardcoded hack
196 196
 		$this->template_settings->current_espresso_theme = 'Espresso_Arabica_2014';
197 197
 	}
@@ -204,7 +204,7 @@  discard block
 block discarded – undo
204 204
 	 * @return string current theme set.
205 205
 	 */
206 206
 	public static function get_current_theme() {
207
-		return isset( self::$_instance->template_settings->current_espresso_theme ) ? self::$_instance->template_settings->current_espresso_theme : 'Espresso_Arabica_2014';
207
+		return isset(self::$_instance->template_settings->current_espresso_theme) ? self::$_instance->template_settings->current_espresso_theme : 'Espresso_Arabica_2014';
208 208
 	}
209 209
 
210 210
 
@@ -238,27 +238,27 @@  discard block
 block discarded – undo
238 238
 	 */
239 239
 	private function _load_core_config() {
240 240
 		// load_core_config__start hook
241
-		do_action( 'AHEE__EE_Config___load_core_config__start', $this );
241
+		do_action('AHEE__EE_Config___load_core_config__start', $this);
242 242
 		$espresso_config = $this->get_espresso_config();
243
-		foreach ( $espresso_config as $config => $settings ) {
243
+		foreach ($espresso_config as $config => $settings) {
244 244
 			// load_core_config__start hook
245
-			$settings = apply_filters( 'FHEE__EE_Config___load_core_config__config_settings', $settings, $config, $this );
246
-			if ( is_object( $settings ) && property_exists( $this, $config ) ) {
247
-				$this->{$config} = apply_filters( 'FHEE__EE_Config___load_core_config__' . $config, $settings );
245
+			$settings = apply_filters('FHEE__EE_Config___load_core_config__config_settings', $settings, $config, $this);
246
+			if (is_object($settings) && property_exists($this, $config)) {
247
+				$this->{$config} = apply_filters('FHEE__EE_Config___load_core_config__'.$config, $settings);
248 248
 				//call configs populate method to ensure any defaults are set for empty values.
249
-				if ( method_exists( $settings, 'populate' ) ) {
249
+				if (method_exists($settings, 'populate')) {
250 250
 					$this->{$config}->populate();
251 251
 				}
252
-				if ( method_exists( $settings, 'do_hooks' ) ) {
252
+				if (method_exists($settings, 'do_hooks')) {
253 253
 					$this->{$config}->do_hooks();
254 254
 				}
255 255
 			}
256 256
 		}
257
-		if ( apply_filters( 'FHEE__EE_Config___load_core_config__update_espresso_config', FALSE ) ) {
257
+		if (apply_filters('FHEE__EE_Config___load_core_config__update_espresso_config', FALSE)) {
258 258
 			$this->update_espresso_config();
259 259
 		}
260 260
 		// load_core_config__end hook
261
-		do_action( 'AHEE__EE_Config___load_core_config__end', $this );
261
+		do_action('AHEE__EE_Config___load_core_config__end', $this);
262 262
 	}
263 263
 
264 264
 
@@ -272,40 +272,40 @@  discard block
 block discarded – undo
272 272
 	protected function _verify_config() {
273 273
 
274 274
 		$this->core = $this->core instanceof EE_Core_Config
275
-			? $this->core  : new EE_Core_Config();
276
-		$this->core = apply_filters( 'FHEE__EE_Config___initialize_config__core', $this->core );
275
+			? $this->core : new EE_Core_Config();
276
+		$this->core = apply_filters('FHEE__EE_Config___initialize_config__core', $this->core);
277 277
 
278 278
 		$this->organization = $this->organization instanceof EE_Organization_Config
279
-			? $this->organization  : new EE_Organization_Config();
280
-		$this->organization = apply_filters( 'FHEE__EE_Config___initialize_config__organization', $this->organization );
279
+			? $this->organization : new EE_Organization_Config();
280
+		$this->organization = apply_filters('FHEE__EE_Config___initialize_config__organization', $this->organization);
281 281
 
282 282
 		$this->currency = $this->currency instanceof EE_Currency_Config
283 283
 			? $this->currency : new EE_Currency_Config();
284
-		$this->currency = apply_filters( 'FHEE__EE_Config___initialize_config__currency', $this->currency );
284
+		$this->currency = apply_filters('FHEE__EE_Config___initialize_config__currency', $this->currency);
285 285
 
286 286
 		$this->registration = $this->registration instanceof EE_Registration_Config
287 287
 			? $this->registration : new EE_Registration_Config();
288
-		$this->registration = apply_filters( 'FHEE__EE_Config___initialize_config__registration', $this->registration );
288
+		$this->registration = apply_filters('FHEE__EE_Config___initialize_config__registration', $this->registration);
289 289
 
290 290
 		$this->admin = $this->admin instanceof EE_Admin_Config
291 291
 			? $this->admin : new EE_Admin_Config();
292
-		$this->admin = apply_filters( 'FHEE__EE_Config___initialize_config__admin', $this->admin );
292
+		$this->admin = apply_filters('FHEE__EE_Config___initialize_config__admin', $this->admin);
293 293
 
294 294
 		$this->template_settings = $this->template_settings instanceof EE_Template_Config
295 295
 			? $this->template_settings : new EE_Template_Config();
296
-		$this->template_settings = apply_filters( 'FHEE__EE_Config___initialize_config__template_settings', $this->template_settings );
296
+		$this->template_settings = apply_filters('FHEE__EE_Config___initialize_config__template_settings', $this->template_settings);
297 297
 
298 298
 		$this->map_settings = $this->map_settings instanceof EE_Map_Config
299 299
 			? $this->map_settings : new EE_Map_Config();
300
-		$this->map_settings = apply_filters( 'FHEE__EE_Config___initialize_config__map_settings', $this->map_settings );
300
+		$this->map_settings = apply_filters('FHEE__EE_Config___initialize_config__map_settings', $this->map_settings);
301 301
 
302 302
 		$this->environment = $this->environment instanceof EE_Environment_Config
303 303
 			? $this->environment : new EE_Environment_Config();
304
-		$this->environment = apply_filters( 'FHEE__EE_Config___initialize_config__environment', $this->environment );
304
+		$this->environment = apply_filters('FHEE__EE_Config___initialize_config__environment', $this->environment);
305 305
 
306 306
 		$this->gateway = $this->gateway instanceof EE_Gateway_Config
307 307
 			? $this->gateway : new EE_Gateway_Config();
308
-		$this->gateway = apply_filters( 'FHEE__EE_Config___initialize_config__gateway', $this->gateway );
308
+		$this->gateway = apply_filters('FHEE__EE_Config___initialize_config__gateway', $this->gateway);
309 309
 
310 310
 	}
311 311
 
@@ -319,7 +319,7 @@  discard block
 block discarded – undo
319 319
 	 */
320 320
 	public function get_espresso_config() {
321 321
 		// grab espresso configuration
322
-		return apply_filters( 'FHEE__EE_Config__get_espresso_config__CFG', get_option( 'ee_config', array() ));
322
+		return apply_filters('FHEE__EE_Config__get_espresso_config__CFG', get_option('ee_config', array()));
323 323
 	}
324 324
 
325 325
 
@@ -332,12 +332,12 @@  discard block
 block discarded – undo
332 332
 	 * @param        $old_value
333 333
 	 * @param        $value
334 334
 	 */
335
-	public function double_check_config_comparison( $option = '', $old_value, $value ) {
335
+	public function double_check_config_comparison($option = '', $old_value, $value) {
336 336
 		// make sure we're checking the ee config
337
-		if ( $option == 'ee_config' ) {
337
+		if ($option == 'ee_config') {
338 338
 			// run a loose comparison of the old value against the new value for type and properties,
339 339
 			// but NOT exact instance like WP update_option does
340
-			if ( $value != $old_value ) {
340
+			if ($value != $old_value) {
341 341
 				// if they are NOT the same, then remove the hook,
342 342
 				// which means the subsequent update results will be based solely on the update query results
343 343
 				// the reason we do this is because, as stated above,
@@ -352,7 +352,7 @@  discard block
 block discarded – undo
352 352
 				// the string it sees in the db looks the same as the new one it has been passed!!!
353 353
 				// This results in the query returning an "affected rows" value of ZERO,
354 354
 				// which gets returned immediately by WP update_option and looks like an error.
355
-				remove_action( 'update_option', array( $this, 'check_config_updated' ));
355
+				remove_action('update_option', array($this, 'check_config_updated'));
356 356
 			}
357 357
 		}
358 358
 	}
@@ -367,11 +367,11 @@  discard block
 block discarded – undo
367 367
 	 */
368 368
 	protected function  _reset_espresso_addon_config() {
369 369
 		$this->_config_option_names = array();
370
-		foreach( $this->addons as $addon_name => $addon_config_obj ) {
371
-			$addon_config_obj = maybe_unserialize( $addon_config_obj );
372
-			$config_class = get_class( $addon_config_obj );
373
-			if ( $addon_config_obj instanceof $config_class && ! $addon_config_obj instanceof __PHP_Incomplete_Class ) {
374
-				$this->update_config( 'addons', $addon_name, $addon_config_obj, FALSE );
370
+		foreach ($this->addons as $addon_name => $addon_config_obj) {
371
+			$addon_config_obj = maybe_unserialize($addon_config_obj);
372
+			$config_class = get_class($addon_config_obj);
373
+			if ($addon_config_obj instanceof $config_class && ! $addon_config_obj instanceof __PHP_Incomplete_Class) {
374
+				$this->update_config('addons', $addon_name, $addon_config_obj, FALSE);
375 375
 			}
376 376
 			$this->addons->{$addon_name} = NULL;
377 377
 		}
@@ -387,17 +387,17 @@  discard block
 block discarded – undo
387 387
 	 * @param   bool $add_error
388 388
 	 * @return   bool
389 389
 	 */
390
-	public function  update_espresso_config( $add_success = FALSE, $add_error = TRUE ) {
390
+	public function  update_espresso_config($add_success = FALSE, $add_error = TRUE) {
391 391
 		// commented out the following re: https://events.codebasehq.com/projects/event-espresso/tickets/8197
392 392
 		//$clone = clone( self::$_instance );
393 393
 		//self::$_instance = NULL;
394
-		do_action( 'AHEE__EE_Config__update_espresso_config__begin',$this );
394
+		do_action('AHEE__EE_Config__update_espresso_config__begin', $this);
395 395
 		$this->_reset_espresso_addon_config();
396 396
 		// hook into update_option because that happens AFTER the ( $value === $old_value ) conditional
397 397
 		// but BEFORE the actual update occurs
398
-		add_action( 'update_option', array( $this, 'double_check_config_comparison' ), 1, 3 );
398
+		add_action('update_option', array($this, 'double_check_config_comparison'), 1, 3);
399 399
 		// now update "ee_config"
400
-		$saved = update_option( 'ee_config', $this );
400
+		$saved = update_option('ee_config', $this);
401 401
 		// if not saved... check if the hook we just added still exists;
402 402
 		// if it does, it means one of two things:
403 403
 		// 		that update_option bailed at the ( $value === $old_value ) conditional,
@@ -408,25 +408,25 @@  discard block
 block discarded – undo
408 408
 		// but just means no update occurred, so don't display an error to the user.
409 409
 		// BUT... if update_option returns FALSE, AND the hook is missing,
410 410
 		// then it means that something truly went wrong
411
-		$saved = ! $saved ? has_action( 'update_option', array( $this, 'double_check_config_comparison' )) : $saved;
411
+		$saved = ! $saved ? has_action('update_option', array($this, 'double_check_config_comparison')) : $saved;
412 412
 		// remove our action since we don't want it in the system anymore
413
-		remove_action( 'update_option', array( $this, 'double_check_config_comparison' ), 1 );
414
-		do_action( 'AHEE__EE_Config__update_espresso_config__end', $this, $saved );
413
+		remove_action('update_option', array($this, 'double_check_config_comparison'), 1);
414
+		do_action('AHEE__EE_Config__update_espresso_config__end', $this, $saved);
415 415
 		//self::$_instance = $clone;
416 416
 		//unset( $clone );
417 417
 		// if config remains the same or was updated successfully
418
-		if ( $saved ) {
419
-			if ( $add_success ) {
418
+		if ($saved) {
419
+			if ($add_success) {
420 420
 				EE_Error::add_success(
421
-					__( 'The Event Espresso Configuration Settings have been successfully updated.', 'event_espresso' ),
421
+					__('The Event Espresso Configuration Settings have been successfully updated.', 'event_espresso'),
422 422
 					__FILE__, __FUNCTION__, __LINE__
423 423
 				);
424 424
 			}
425 425
 			return TRUE;
426 426
 		} else {
427
-			if ( $add_error ) {
427
+			if ($add_error) {
428 428
 				EE_Error::add_error(
429
-					__( 'The Event Espresso Configuration Settings were not updated.', 'event_espresso' ),
429
+					__('The Event Espresso Configuration Settings were not updated.', 'event_espresso'),
430 430
 					__FILE__, __FUNCTION__, __LINE__
431 431
 				);
432 432
 			}
@@ -452,20 +452,20 @@  discard block
 block discarded – undo
452 452
 		$name = '',
453 453
 		$config_class = '',
454 454
 		$config_obj = NULL,
455
-		$tests_to_run = array( 1, 2, 3, 4, 5, 6, 7, 8 ),
455
+		$tests_to_run = array(1, 2, 3, 4, 5, 6, 7, 8),
456 456
 		$display_errors = TRUE
457 457
 	) {
458 458
 		try {
459
-			foreach ( $tests_to_run as $test ) {
460
-				switch ( $test ) {
459
+			foreach ($tests_to_run as $test) {
460
+				switch ($test) {
461 461
 
462 462
 					// TEST #1 : check that section was set
463 463
 					case 1 :
464
-						if ( empty( $section ) ) {
465
-							if ( $display_errors ) {
464
+						if (empty($section)) {
465
+							if ($display_errors) {
466 466
 								throw new EE_Error(
467 467
 									sprintf(
468
-										__( 'No configuration section has been provided while attempting to save "%s".', 'event_espresso' ),
468
+										__('No configuration section has been provided while attempting to save "%s".', 'event_espresso'),
469 469
 										$config_class
470 470
 									)
471 471
 								);
@@ -476,11 +476,11 @@  discard block
 block discarded – undo
476 476
 
477 477
 					// TEST #2 : check that settings section exists
478 478
 					case 2 :
479
-						if ( ! isset( $this->{$section} ) ) {
480
-							if ( $display_errors ) {
479
+						if ( ! isset($this->{$section} )) {
480
+							if ($display_errors) {
481 481
 								throw new EE_Error(
482
-									sprintf( __( 'The "%s" configuration section does not exist.', 'event_espresso' ),
483
-											 $section )
482
+									sprintf(__('The "%s" configuration section does not exist.', 'event_espresso'),
483
+											 $section)
484 484
 								);
485 485
 							}
486 486
 							return false;
@@ -490,12 +490,12 @@  discard block
 block discarded – undo
490 490
 					// TEST #3 : check that section is the proper format
491 491
 					case 3 :
492 492
 						if (
493
-							! ( $this->{$section} instanceof EE_Config_Base || $this->{$section} instanceof stdClass )
493
+							! ($this->{$section} instanceof EE_Config_Base || $this->{$section} instanceof stdClass)
494 494
 						) {
495
-							if ( $display_errors ) {
495
+							if ($display_errors) {
496 496
 								throw new EE_Error(
497 497
 									sprintf(
498
-										__( 'The "%s" configuration settings have not been formatted correctly.', 'event_espresso' ),
498
+										__('The "%s" configuration settings have not been formatted correctly.', 'event_espresso'),
499 499
 										$section
500 500
 									)
501 501
 								);
@@ -506,10 +506,10 @@  discard block
 block discarded – undo
506 506
 
507 507
 					// TEST #4 : check that config section name has been set
508 508
 					case 4 :
509
-						if ( empty( $name ) ) {
510
-							if ( $display_errors ) {
509
+						if (empty($name)) {
510
+							if ($display_errors) {
511 511
 								throw new EE_Error(
512
-									__( 'No name has been provided for the specific configuration section.', 'event_espresso' )
512
+									__('No name has been provided for the specific configuration section.', 'event_espresso')
513 513
 								);
514 514
 							}
515 515
 							return false;
@@ -518,10 +518,10 @@  discard block
 block discarded – undo
518 518
 
519 519
 					// TEST #5 : check that a config class name has been set
520 520
 					case 5 :
521
-						if ( empty( $config_class ) ) {
522
-							if ( $display_errors ) {
521
+						if (empty($config_class)) {
522
+							if ($display_errors) {
523 523
 								throw new EE_Error(
524
-									__( 'No class name has been provided for the specific configuration section.', 'event_espresso' )
524
+									__('No class name has been provided for the specific configuration section.', 'event_espresso')
525 525
 								);
526 526
 							}
527 527
 							return false;
@@ -530,11 +530,11 @@  discard block
 block discarded – undo
530 530
 
531 531
 					// TEST #6 : verify config class is accessible
532 532
 					case 6 :
533
-						if ( ! class_exists( $config_class ) ) {
534
-							if ( $display_errors ) {
533
+						if ( ! class_exists($config_class)) {
534
+							if ($display_errors) {
535 535
 								throw new EE_Error(
536 536
 									sprintf(
537
-										__( 'The "%s" class does not exist. Please ensure that an autoloader has been set for it.', 'event_espresso' ),
537
+										__('The "%s" class does not exist. Please ensure that an autoloader has been set for it.', 'event_espresso'),
538 538
 										$config_class
539 539
 									)
540 540
 								);
@@ -545,11 +545,11 @@  discard block
 block discarded – undo
545 545
 
546 546
 					// TEST #7 : check that config has even been set
547 547
 					case 7 :
548
-						if ( ! isset( $this->{$section}->{$name} ) ) {
549
-							if ( $display_errors ) {
548
+						if ( ! isset($this->{$section}->{$name} )) {
549
+							if ($display_errors) {
550 550
 								throw new EE_Error(
551 551
 									sprintf(
552
-										__( 'No configuration has been set for "%1$s->%2$s".', 'event_espresso' ),
552
+										__('No configuration has been set for "%1$s->%2$s".', 'event_espresso'),
553 553
 										$section,
554 554
 										$name
555 555
 									)
@@ -558,17 +558,17 @@  discard block
 block discarded – undo
558 558
 							return false;
559 559
 						} else {
560 560
 							// and make sure it's not serialized
561
-							$this->{$section}->{$name} = maybe_unserialize( $this->{$section}->{$name} );
561
+							$this->{$section}->{$name} = maybe_unserialize($this->{$section}->{$name} );
562 562
 						}
563 563
 						break;
564 564
 
565 565
 					// TEST #8 : check that config is the requested type
566 566
 					case 8 :
567
-						if ( ! $this->{$section}->{$name} instanceof $config_class ) {
568
-							if ( $display_errors ) {
567
+						if ( ! $this->{$section}->{$name} instanceof $config_class) {
568
+							if ($display_errors) {
569 569
 								throw new EE_Error(
570 570
 									sprintf(
571
-										__( 'The configuration for "%1$s->%2$s" is not of the "%3$s" class.', 'event_espresso' ),
571
+										__('The configuration for "%1$s->%2$s" is not of the "%3$s" class.', 'event_espresso'),
572 572
 										$section,
573 573
 										$name,
574 574
 										$config_class
@@ -581,12 +581,12 @@  discard block
 block discarded – undo
581 581
 
582 582
 					// TEST #9 : verify config object
583 583
 					case 9 :
584
-						if ( ! $config_obj instanceof EE_Config_Base ) {
585
-							if ( $display_errors ) {
584
+						if ( ! $config_obj instanceof EE_Config_Base) {
585
+							if ($display_errors) {
586 586
 								throw new EE_Error(
587 587
 									sprintf(
588
-										__( 'The "%s" class is not an instance of EE_Config_Base.', 'event_espresso' ),
589
-										print_r( $config_obj, true )
588
+										__('The "%s" class is not an instance of EE_Config_Base.', 'event_espresso'),
589
+										print_r($config_obj, true)
590 590
 									)
591 591
 								);
592 592
 							}
@@ -597,7 +597,7 @@  discard block
 block discarded – undo
597 597
 				}
598 598
 			}
599 599
 
600
-		} catch( EE_Error $e ) {
600
+		} catch (EE_Error $e) {
601 601
 			$e->get_error();
602 602
 		}
603 603
 		// you have successfully run the gauntlet
@@ -614,8 +614,8 @@  discard block
 block discarded – undo
614 614
 	 * @param        string          $name
615 615
 	 * @return        string
616 616
 	 */
617
-	private function _generate_config_option_name( $section = '', $name = '' ) {
618
-		return 'ee_config-' . strtolower( $section . '-' . str_replace( array( 'EE_', 'EED_' ), '', $name ) );
617
+	private function _generate_config_option_name($section = '', $name = '') {
618
+		return 'ee_config-'.strtolower($section.'-'.str_replace(array('EE_', 'EED_'), '', $name));
619 619
 	}
620 620
 
621 621
 
@@ -629,10 +629,10 @@  discard block
 block discarded – undo
629 629
 	 * @param 	string $name
630 630
 	 * @return 	string
631 631
 	 */
632
-	private function _set_config_class( $config_class = '', $name = '' ) {
633
-		return ! empty( $config_class )
632
+	private function _set_config_class($config_class = '', $name = '') {
633
+		return ! empty($config_class)
634 634
 			? $config_class
635
-			: str_replace( ' ', '_', ucwords( str_replace( '_', ' ', $name ) ) ) . '_Config';
635
+			: str_replace(' ', '_', ucwords(str_replace('_', ' ', $name))).'_Config';
636 636
 	}
637 637
 
638 638
 
@@ -646,34 +646,34 @@  discard block
 block discarded – undo
646 646
 	 * @param 	EE_Config_Base $config_obj
647 647
 	 * @return 	EE_Config_Base
648 648
 	 */
649
-	public function set_config( $section = '', $name = '', $config_class = '', EE_Config_Base $config_obj = null ) {
649
+	public function set_config($section = '', $name = '', $config_class = '', EE_Config_Base $config_obj = null) {
650 650
 		// ensure config class is set to something
651
-		$config_class = $this->_set_config_class( $config_class, $name );
651
+		$config_class = $this->_set_config_class($config_class, $name);
652 652
 		// run tests 1-4, 6, and 7 to verify all config params are set and valid
653
-		if ( ! $this->_verify_config_params( $section, $name, $config_class, null, array( 1, 2, 3, 4, 5, 6 ))) {
653
+		if ( ! $this->_verify_config_params($section, $name, $config_class, null, array(1, 2, 3, 4, 5, 6))) {
654 654
 			return null;
655 655
 		}
656
-		$config_option_name = $this->_generate_config_option_name( $section, $name );
656
+		$config_option_name = $this->_generate_config_option_name($section, $name);
657 657
 		// if the config option name hasn't been added yet to the list of option names we're tracking, then do so now
658
-		if ( ! isset( $this->_config_option_names[ $config_option_name ] )) {
659
-			$this->_config_option_names[ $config_option_name ] = $config_class;
658
+		if ( ! isset($this->_config_option_names[$config_option_name])) {
659
+			$this->_config_option_names[$config_option_name] = $config_class;
660 660
 		}
661 661
 		// verify the incoming config object but suppress errors
662
-		if ( ! $this->_verify_config_params( $section, $name, $config_class, $config_obj, array( 9 ), false )) {
662
+		if ( ! $this->_verify_config_params($section, $name, $config_class, $config_obj, array(9), false)) {
663 663
 			$config_obj = new $config_class();
664 664
 		}
665
-		if ( get_option( $config_option_name ) ) {
666
-			update_option( $config_option_name, $config_obj );
665
+		if (get_option($config_option_name)) {
666
+			update_option($config_option_name, $config_obj);
667 667
 			$this->{$section}->{$name} = $config_obj;
668 668
 			return $this->{$section}->{$name};
669 669
 		} else {
670 670
 			// create a wp-option for this config
671
-			if ( add_option( $config_option_name, $config_obj, '', 'no' )) {
672
-				$this->{$section}->{$name} = maybe_unserialize( $config_obj );
671
+			if (add_option($config_option_name, $config_obj, '', 'no')) {
672
+				$this->{$section}->{$name} = maybe_unserialize($config_obj);
673 673
 				return $this->{$section}->{$name};
674 674
 			} else {
675 675
 				EE_Error::add_error(
676
-					sprintf( __( 'The "%s" could not be saved to the database.', 'event_espresso' ), $config_class ),
676
+					sprintf(__('The "%s" could not be saved to the database.', 'event_espresso'), $config_class),
677 677
 					__FILE__, __FUNCTION__, __LINE__
678 678
 				);
679 679
 				return null;
@@ -694,37 +694,37 @@  discard block
 block discarded – undo
694 694
 	 * @param 	bool 					$throw_errors
695 695
 	 * @return 	bool
696 696
 	 */
697
-	public function update_config( $section = '', $name = '', $config_obj = '', $throw_errors = true ) {
698
-		$config_obj = maybe_unserialize( $config_obj );
697
+	public function update_config($section = '', $name = '', $config_obj = '', $throw_errors = true) {
698
+		$config_obj = maybe_unserialize($config_obj);
699 699
 		// get class name of the incoming object
700
-		$config_class = get_class( $config_obj );
700
+		$config_class = get_class($config_obj);
701 701
 		// run tests 1-5 and 9 to verify config
702
-		if ( ! $this->_verify_config_params( $section, $name, $config_class, $config_obj, array( 1, 2, 3, 4, 7, 9 ))) {
702
+		if ( ! $this->_verify_config_params($section, $name, $config_class, $config_obj, array(1, 2, 3, 4, 7, 9))) {
703 703
 			return false;
704 704
 		}
705
-		$config_option_name = $this->_generate_config_option_name( $section, $name );
705
+		$config_option_name = $this->_generate_config_option_name($section, $name);
706 706
 		// check if config object has been added to db by seeing if config option name is in $this->_config_option_names array
707
-		if ( ! isset( $this->_config_option_names[ $config_option_name ] )) {
707
+		if ( ! isset($this->_config_option_names[$config_option_name])) {
708 708
 			// save new config to db
709
-			return $this->set_config( $section, $name, $config_class, $config_obj );
709
+			return $this->set_config($section, $name, $config_class, $config_obj);
710 710
 		} else {
711 711
 			// first check if the record already exists
712
-			$existing_config = get_option( $config_option_name );
713
-			$config_obj = serialize( $config_obj );
712
+			$existing_config = get_option($config_option_name);
713
+			$config_obj = serialize($config_obj);
714 714
 			// just return if db record is already up to date
715
-			if ( $existing_config == $config_obj ) {
715
+			if ($existing_config == $config_obj) {
716 716
 				$this->{$section}->{$name} = $config_obj;
717 717
 				return true;
718
-			} else if ( update_option( $config_option_name, $config_obj )) {
718
+			} else if (update_option($config_option_name, $config_obj)) {
719 719
 				// update wp-option for this config class
720 720
 				$this->{$section}->{$name} = $config_obj;
721 721
 				return true;
722
-			} elseif ( $throw_errors ) {
722
+			} elseif ($throw_errors) {
723 723
 				EE_Error::add_error(
724 724
 					sprintf(
725
-						__( 'The "%1$s" object stored at"%2$s" was not successfully updated in the database.', 'event_espresso' ),
725
+						__('The "%1$s" object stored at"%2$s" was not successfully updated in the database.', 'event_espresso'),
726 726
 						$config_class,
727
-						'EE_Config->' . $section . '->' . $name
727
+						'EE_Config->'.$section.'->'.$name
728 728
 					),
729 729
 					__FILE__, __FUNCTION__, __LINE__
730 730
 				);
@@ -744,34 +744,34 @@  discard block
 block discarded – undo
744 744
 	 * @param 	string 	$config_class
745 745
 	 * @return 	mixed EE_Config_Base | NULL
746 746
 	 */
747
-	public function get_config( $section = '', $name = '', $config_class = '' ) {
747
+	public function get_config($section = '', $name = '', $config_class = '') {
748 748
 		// ensure config class is set to something
749
-		$config_class = $this->_set_config_class( $config_class, $name );
749
+		$config_class = $this->_set_config_class($config_class, $name);
750 750
 		// run tests 1-4, 6 and 7 to verify that all params have been set
751
-		if ( ! $this->_verify_config_params( $section, $name, $config_class, NULL, array( 1, 2, 3, 4, 5, 6 ))) {
751
+		if ( ! $this->_verify_config_params($section, $name, $config_class, NULL, array(1, 2, 3, 4, 5, 6))) {
752 752
 			return NULL;
753 753
 		}
754 754
 		// now test if the requested config object exists, but suppress errors
755
-		if ( $this->_verify_config_params( $section, $name, $config_class, NULL, array( 7, 8 ), FALSE )) {
755
+		if ($this->_verify_config_params($section, $name, $config_class, NULL, array(7, 8), FALSE)) {
756 756
 			// config already exists, so pass it back
757 757
 			return $this->{$section}->{$name};
758 758
 		}
759 759
 		// load config option from db if it exists
760
-		$config_obj = $this->get_config_option( $this->_generate_config_option_name( $section, $name ));
760
+		$config_obj = $this->get_config_option($this->_generate_config_option_name($section, $name));
761 761
 		// verify the newly retrieved config object, but suppress errors
762
-		if ( $this->_verify_config_params( $section, $name, $config_class, $config_obj, array( 9 ), FALSE )) {
762
+		if ($this->_verify_config_params($section, $name, $config_class, $config_obj, array(9), FALSE)) {
763 763
 			// config is good, so set it and pass it back
764 764
 			$this->{$section}->{$name} = $config_obj;
765 765
 			return $this->{$section}->{$name};
766 766
 		}
767 767
 		// oops! $config_obj is not already set and does not exist in the db, so create a new one
768
-		$config_obj =$this->set_config( $section, $name, $config_class );
768
+		$config_obj = $this->set_config($section, $name, $config_class);
769 769
 		// verify the newly created config object
770
-		if ( $this->_verify_config_params( $section, $name, $config_class, $config_obj, array( 9 ))) {
770
+		if ($this->_verify_config_params($section, $name, $config_class, $config_obj, array(9))) {
771 771
 			return $this->{$section}->{$name};
772 772
 		} else {
773 773
 			EE_Error::add_error(
774
-				sprintf( __( 'The "%s" could not be retrieved from the database.', 'event_espresso' ), $config_class ),
774
+				sprintf(__('The "%s" could not be retrieved from the database.', 'event_espresso'), $config_class),
775 775
 				__FILE__, __FUNCTION__, __LINE__
776 776
 			);
777 777
 		}
@@ -786,9 +786,9 @@  discard block
 block discarded – undo
786 786
 	 * @param 	string 	$config_option_name
787 787
 	 * @return 	mixed EE_Config_Base | FALSE
788 788
 	 */
789
-	public function get_config_option( $config_option_name = '' ) {
789
+	public function get_config_option($config_option_name = '') {
790 790
 		// retrieve the wp-option for this config class.
791
-		return maybe_unserialize( get_option( $config_option_name ));
791
+		return maybe_unserialize(get_option($config_option_name));
792 792
 	}
793 793
 
794 794
 
@@ -801,45 +801,45 @@  discard block
 block discarded – undo
801 801
 	 * @param $page_for_posts
802 802
 	 * @return    void
803 803
 	 */
804
-	public function update_post_shortcodes( $page_for_posts = '' ) {
804
+	public function update_post_shortcodes($page_for_posts = '') {
805 805
 		// make sure page_for_posts is set
806
-		$page_for_posts = ! empty( $page_for_posts ) ? $page_for_posts : EE_Config::get_page_for_posts();
806
+		$page_for_posts = ! empty($page_for_posts) ? $page_for_posts : EE_Config::get_page_for_posts();
807 807
 		// critical page shortcodes that we do NOT want added to the Posts page (blog)
808 808
 		$critical_shortcodes = $this->core->get_critical_pages_shortcodes_array();
809 809
 		// allow others to mess stuff up :D
810
-		do_action( 'AHEE__EE_Config__update_post_shortcodes', $this->core->post_shortcodes, $page_for_posts );
810
+		do_action('AHEE__EE_Config__update_post_shortcodes', $this->core->post_shortcodes, $page_for_posts);
811 811
 		// verify that post_shortcodes is set
812
-		$this->core->post_shortcodes = isset( $this->core->post_shortcodes ) && is_array( $this->core->post_shortcodes ) ? $this->core->post_shortcodes : array();
812
+		$this->core->post_shortcodes = isset($this->core->post_shortcodes) && is_array($this->core->post_shortcodes) ? $this->core->post_shortcodes : array();
813 813
 		// cycle thru post_shortcodes
814
-		foreach( $this->core->post_shortcodes as $post_name => $shortcodes ){
814
+		foreach ($this->core->post_shortcodes as $post_name => $shortcodes) {
815 815
 			// are there any shortcodes to track ?
816
-			if ( ! empty( $shortcodes )) {
816
+			if ( ! empty($shortcodes)) {
817 817
 				// loop thru list of tracked shortcodes
818
-				foreach( $shortcodes as $shortcode => $post_id ) {
818
+				foreach ($shortcodes as $shortcode => $post_id) {
819 819
 					// if shortcode is for a critical page, BUT this is NOT the corresponding critical page for that shortcode
820
-					if ( isset( $critical_shortcodes[ $post_id ] ) && $post_name == $page_for_posts ) {
820
+					if (isset($critical_shortcodes[$post_id]) && $post_name == $page_for_posts) {
821 821
 						// then remove this shortcode, because we don't want critical page shortcodes like ESPRESSO_TXN_PAGE running on the "Posts Page" (blog)
822
-						unset( $this->core->post_shortcodes[ $post_name ][ $shortcode ] );
822
+						unset($this->core->post_shortcodes[$post_name][$shortcode]);
823 823
 					}
824 824
 					// skip the posts page, because we want all shortcodes registered for it
825
-					if ( $post_name == $page_for_posts ) {
825
+					if ($post_name == $page_for_posts) {
826 826
 						continue;
827 827
 					}
828 828
 					// make sure post still exists
829
-					$post = get_post( $post_id );
830
-					if ( $post ) {
829
+					$post = get_post($post_id);
830
+					if ($post) {
831 831
 						// check that the post name matches what we have saved
832
-						if ( $post->post_name == $post_name ) {
832
+						if ($post->post_name == $post_name) {
833 833
 							// if so, then break before hitting the unset below
834 834
 							continue;
835 835
 						}
836 836
 					}
837 837
 					// we don't like missing posts around here >:(
838
-					unset( $this->core->post_shortcodes[ $post_name ] );
838
+					unset($this->core->post_shortcodes[$post_name]);
839 839
 				}
840 840
 			} else {
841 841
 				// you got no shortcodes to keep track of !
842
-				unset( $this->core->post_shortcodes[ $post_name ] );
842
+				unset($this->core->post_shortcodes[$post_name]);
843 843
 			}
844 844
 		}
845 845
 		//only show errors
@@ -858,14 +858,14 @@  discard block
 block discarded – undo
858 858
 	 *  @return 	string
859 859
 	 */
860 860
 	public static function get_page_for_posts() {
861
-		$page_for_posts = get_option( 'page_for_posts' );
862
-		if ( ! $page_for_posts ) {
861
+		$page_for_posts = get_option('page_for_posts');
862
+		if ( ! $page_for_posts) {
863 863
 			return 'posts';
864 864
 		}
865 865
 		/** @type WPDB $wpdb */
866 866
 		global $wpdb;
867 867
 		$SQL = "SELECT post_name from $wpdb->posts WHERE post_type='posts' OR post_type='page' AND post_status='publish' AND ID=%d";
868
-		return $wpdb->get_var( $wpdb->prepare( $SQL, $page_for_posts ));
868
+		return $wpdb->get_var($wpdb->prepare($SQL, $page_for_posts));
869 869
 	}
870 870
 
871 871
 
@@ -882,7 +882,7 @@  discard block
 block discarded – undo
882 882
 	 */
883 883
 	public function register_shortcodes_and_modules() {
884 884
 		// allow shortcodes to register with WP and to set hooks for the rest of the system
885
-		EE_Registry::instance()->shortcodes =$this->_register_shortcodes();
885
+		EE_Registry::instance()->shortcodes = $this->_register_shortcodes();
886 886
 		// allow modules to set hooks for the rest of the system
887 887
 		EE_Registry::instance()->modules = $this->_register_modules();
888 888
 	}
@@ -914,21 +914,21 @@  discard block
 block discarded – undo
914 914
 	public function widgets_init() {
915 915
 		//only init widgets on admin pages when not in complete maintenance, and
916 916
 		//on frontend when not in any maintenance mode
917
-		if (( is_admin() && EE_Maintenance_Mode::instance()->level() != EE_Maintenance_Mode::level_2_complete_maintenance)  || ! EE_Maintenance_Mode::instance()->level() ) {
917
+		if ((is_admin() && EE_Maintenance_Mode::instance()->level() != EE_Maintenance_Mode::level_2_complete_maintenance) || ! EE_Maintenance_Mode::instance()->level()) {
918 918
 			// grab list of installed widgets
919
-			$widgets_to_register = glob( EE_WIDGETS . '*', GLOB_ONLYDIR );
919
+			$widgets_to_register = glob(EE_WIDGETS.'*', GLOB_ONLYDIR);
920 920
 			// filter list of modules to register
921
-			$widgets_to_register = apply_filters( 'FHEE__EE_Config__register_widgets__widgets_to_register', $widgets_to_register );
921
+			$widgets_to_register = apply_filters('FHEE__EE_Config__register_widgets__widgets_to_register', $widgets_to_register);
922 922
 
923
-			if ( ! empty( $widgets_to_register ) ) {
923
+			if ( ! empty($widgets_to_register)) {
924 924
 				// cycle thru widget folders
925
-				foreach ( $widgets_to_register as $widget_path ) {
925
+				foreach ($widgets_to_register as $widget_path) {
926 926
 					// add to list of installed widget modules
927
-					EE_Config::register_ee_widget( $widget_path );
927
+					EE_Config::register_ee_widget($widget_path);
928 928
 				}
929 929
 			}
930 930
 			// filter list of installed modules
931
-			EE_Registry::instance()->widgets = apply_filters( 'FHEE__EE_Config__register_widgets__installed_widgets', EE_Registry::instance()->widgets );
931
+			EE_Registry::instance()->widgets = apply_filters('FHEE__EE_Config__register_widgets__installed_widgets', EE_Registry::instance()->widgets);
932 932
 		}
933 933
 	}
934 934
 
@@ -941,54 +941,54 @@  discard block
 block discarded – undo
941 941
 	 *  @param 	string 	$widget_path - full path up to and including widget folder
942 942
 	 *  @return 	void
943 943
 	 */
944
-	public static function register_ee_widget( $widget_path = NULL ) {
945
-		do_action( 'AHEE__EE_Config__register_widget__begin', $widget_path );
944
+	public static function register_ee_widget($widget_path = NULL) {
945
+		do_action('AHEE__EE_Config__register_widget__begin', $widget_path);
946 946
 		$widget_ext = '.widget.php';
947 947
 		// make all separators match
948
-		$widget_path = rtrim( str_replace( '/\\', DS, $widget_path ), DS );
948
+		$widget_path = rtrim(str_replace('/\\', DS, $widget_path), DS);
949 949
 		// does the file path INCLUDE the actual file name as part of the path ?
950
-		if ( strpos( $widget_path, $widget_ext ) !== FALSE ) {
950
+		if (strpos($widget_path, $widget_ext) !== FALSE) {
951 951
 			// grab and shortcode file name from directory name and break apart at dots
952
-			$file_name = explode( '.', basename( $widget_path ));
952
+			$file_name = explode('.', basename($widget_path));
953 953
 			// take first segment from file name pieces and remove class prefix if it exists
954
-			$widget = strpos( $file_name[0], 'EEW_' ) === 0 ? substr( $file_name[0], 4 ) : $file_name[0];
954
+			$widget = strpos($file_name[0], 'EEW_') === 0 ? substr($file_name[0], 4) : $file_name[0];
955 955
 			// sanitize shortcode directory name
956
-			$widget = sanitize_key( $widget );
956
+			$widget = sanitize_key($widget);
957 957
 			// now we need to rebuild the shortcode path
958
-			$widget_path = explode( DS, $widget_path );
958
+			$widget_path = explode(DS, $widget_path);
959 959
 			// remove last segment
960
-			array_pop( $widget_path );
960
+			array_pop($widget_path);
961 961
 			// glue it back together
962
-			$widget_path = implode( DS, $widget_path );
962
+			$widget_path = implode(DS, $widget_path);
963 963
 		} else {
964 964
 			// grab and sanitize widget directory name
965
-			$widget = sanitize_key( basename( $widget_path ));
965
+			$widget = sanitize_key(basename($widget_path));
966 966
 		}
967 967
 		// create classname from widget directory name
968
-		$widget = str_replace( ' ', '_', ucwords( str_replace( '_', ' ', $widget )));
968
+		$widget = str_replace(' ', '_', ucwords(str_replace('_', ' ', $widget)));
969 969
 		// add class prefix
970
-		$widget_class = 'EEW_' . $widget;
970
+		$widget_class = 'EEW_'.$widget;
971 971
 		// does the widget exist ?
972
-		if ( ! is_readable( $widget_path . DS . $widget_class . $widget_ext )) {
972
+		if ( ! is_readable($widget_path.DS.$widget_class.$widget_ext)) {
973 973
 			$msg = sprintf(
974
-				__( 'The requested %s widget file could not be found or is not readable due to file permissions. Please ensure the following path is correct: %s', 'event_espresso' ),
974
+				__('The requested %s widget file could not be found or is not readable due to file permissions. Please ensure the following path is correct: %s', 'event_espresso'),
975 975
 				$widget_class,
976
-				$widget_path . DS . $widget_class . $widget_ext
976
+				$widget_path.DS.$widget_class.$widget_ext
977 977
 			);
978
-			EE_Error::add_error( $msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__ );
978
+			EE_Error::add_error($msg.'||'.$msg, __FILE__, __FUNCTION__, __LINE__);
979 979
 			return;
980 980
 		}
981 981
 		// load the widget class file
982
-		require_once( $widget_path . DS . $widget_class . $widget_ext );
982
+		require_once($widget_path.DS.$widget_class.$widget_ext);
983 983
 		// verify that class exists
984
-		if ( ! class_exists( $widget_class )) {
985
-			$msg = sprintf( __( 'The requested %s widget class does not exist.', 'event_espresso' ), $widget_class );
986
-			EE_Error::add_error( $msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__ );
984
+		if ( ! class_exists($widget_class)) {
985
+			$msg = sprintf(__('The requested %s widget class does not exist.', 'event_espresso'), $widget_class);
986
+			EE_Error::add_error($msg.'||'.$msg, __FILE__, __FUNCTION__, __LINE__);
987 987
 			return;
988 988
 		}
989
-		register_widget( $widget_class );
989
+		register_widget($widget_class);
990 990
 		// add to array of registered widgets
991
-		EE_Registry::instance()->widgets->{$widget_class} = $widget_path . DS . $widget_class . $widget_ext;
991
+		EE_Registry::instance()->widgets->{$widget_class} = $widget_path.DS.$widget_class.$widget_ext;
992 992
 	}
993 993
 
994 994
 
@@ -1001,18 +1001,18 @@  discard block
 block discarded – undo
1001 1001
 	 */
1002 1002
 	private function _register_shortcodes() {
1003 1003
 		// grab list of installed shortcodes
1004
-		$shortcodes_to_register = glob( EE_SHORTCODES . '*', GLOB_ONLYDIR );
1004
+		$shortcodes_to_register = glob(EE_SHORTCODES.'*', GLOB_ONLYDIR);
1005 1005
 		// filter list of modules to register
1006
-		$shortcodes_to_register = apply_filters( 'FHEE__EE_Config__register_shortcodes__shortcodes_to_register', $shortcodes_to_register );
1007
-		if ( ! empty( $shortcodes_to_register ) ) {
1006
+		$shortcodes_to_register = apply_filters('FHEE__EE_Config__register_shortcodes__shortcodes_to_register', $shortcodes_to_register);
1007
+		if ( ! empty($shortcodes_to_register)) {
1008 1008
 			// cycle thru shortcode folders
1009
-			foreach ( $shortcodes_to_register as $shortcode_path ) {
1009
+			foreach ($shortcodes_to_register as $shortcode_path) {
1010 1010
 				// add to list of installed shortcode modules
1011
-				EE_Config::register_shortcode( $shortcode_path );
1011
+				EE_Config::register_shortcode($shortcode_path);
1012 1012
 			}
1013 1013
 		}
1014 1014
 		// filter list of installed modules
1015
-		return apply_filters( 'FHEE__EE_Config___register_shortcodes__installed_shortcodes', EE_Registry::instance()->shortcodes );
1015
+		return apply_filters('FHEE__EE_Config___register_shortcodes__installed_shortcodes', EE_Registry::instance()->shortcodes);
1016 1016
 	}
1017 1017
 
1018 1018
 
@@ -1024,56 +1024,56 @@  discard block
 block discarded – undo
1024 1024
 	 *  @param 	string 		$shortcode_path - full path up to and including shortcode folder
1025 1025
 	 *  @return 	bool
1026 1026
 	 */
1027
-	public static function register_shortcode( $shortcode_path = NULL ) {
1028
-		do_action( 'AHEE__EE_Config__register_shortcode__begin',$shortcode_path );
1027
+	public static function register_shortcode($shortcode_path = NULL) {
1028
+		do_action('AHEE__EE_Config__register_shortcode__begin', $shortcode_path);
1029 1029
 		$shortcode_ext = '.shortcode.php';
1030 1030
 		// make all separators match
1031
-		$shortcode_path = str_replace( array( '\\', '/' ), DS, $shortcode_path );
1031
+		$shortcode_path = str_replace(array('\\', '/'), DS, $shortcode_path);
1032 1032
 		// does the file path INCLUDE the actual file name as part of the path ?
1033
-		if ( strpos( $shortcode_path, $shortcode_ext ) !== FALSE ) {
1033
+		if (strpos($shortcode_path, $shortcode_ext) !== FALSE) {
1034 1034
 			// grab shortcode file name from directory name and break apart at dots
1035
-			$shortcode_file = explode( '.', basename( $shortcode_path ));
1035
+			$shortcode_file = explode('.', basename($shortcode_path));
1036 1036
 			// take first segment from file name pieces and remove class prefix if it exists
1037
-			$shortcode = strpos( $shortcode_file[0], 'EES_' ) === 0 ? substr( $shortcode_file[0], 4 ) : $shortcode_file[0];
1037
+			$shortcode = strpos($shortcode_file[0], 'EES_') === 0 ? substr($shortcode_file[0], 4) : $shortcode_file[0];
1038 1038
 			// sanitize shortcode directory name
1039
-			$shortcode = sanitize_key( $shortcode );
1039
+			$shortcode = sanitize_key($shortcode);
1040 1040
 			// now we need to rebuild the shortcode path
1041
-			$shortcode_path = explode( DS, $shortcode_path );
1041
+			$shortcode_path = explode(DS, $shortcode_path);
1042 1042
 			// remove last segment
1043
-			array_pop( $shortcode_path );
1043
+			array_pop($shortcode_path);
1044 1044
 			// glue it back together
1045
-			$shortcode_path = implode( DS, $shortcode_path ) . DS;
1045
+			$shortcode_path = implode(DS, $shortcode_path).DS;
1046 1046
 		} else {
1047 1047
 			// we need to generate the filename based off of the folder name
1048 1048
 			// grab and sanitize shortcode directory name
1049
-			$shortcode = sanitize_key( basename( $shortcode_path ));
1050
-			$shortcode_path = rtrim( $shortcode_path, DS ) . DS;
1049
+			$shortcode = sanitize_key(basename($shortcode_path));
1050
+			$shortcode_path = rtrim($shortcode_path, DS).DS;
1051 1051
 		}
1052 1052
 		// create classname from shortcode directory or file name
1053
-		$shortcode = str_replace( ' ', '_', ucwords( str_replace( '_', ' ', $shortcode )));
1053
+		$shortcode = str_replace(' ', '_', ucwords(str_replace('_', ' ', $shortcode)));
1054 1054
 		// add class prefix
1055
-		$shortcode_class = 'EES_' . $shortcode;
1055
+		$shortcode_class = 'EES_'.$shortcode;
1056 1056
 		// does the shortcode exist ?
1057
-		if ( ! is_readable( $shortcode_path . DS . $shortcode_class . $shortcode_ext )) {
1057
+		if ( ! is_readable($shortcode_path.DS.$shortcode_class.$shortcode_ext)) {
1058 1058
 			$msg = sprintf(
1059
-				__( 'The requested %s shortcode file could not be found or is not readable due to file permissions. It should be in %s', 'event_espresso' ),
1059
+				__('The requested %s shortcode file could not be found or is not readable due to file permissions. It should be in %s', 'event_espresso'),
1060 1060
 				$shortcode_class,
1061
-				$shortcode_path . DS . $shortcode_class . $shortcode_ext
1061
+				$shortcode_path.DS.$shortcode_class.$shortcode_ext
1062 1062
 			);
1063
-			EE_Error::add_error( $msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__ );
1063
+			EE_Error::add_error($msg.'||'.$msg, __FILE__, __FUNCTION__, __LINE__);
1064 1064
 			return FALSE;
1065 1065
 		}
1066 1066
 		// load the shortcode class file
1067
-		require_once( $shortcode_path . $shortcode_class . $shortcode_ext );
1067
+		require_once($shortcode_path.$shortcode_class.$shortcode_ext);
1068 1068
 		// verify that class exists
1069
-		if ( ! class_exists( $shortcode_class )) {
1070
-			$msg = sprintf( __( 'The requested %s shortcode class does not exist.', 'event_espresso' ), $shortcode_class );
1071
-			EE_Error::add_error( $msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__ );
1069
+		if ( ! class_exists($shortcode_class)) {
1070
+			$msg = sprintf(__('The requested %s shortcode class does not exist.', 'event_espresso'), $shortcode_class);
1071
+			EE_Error::add_error($msg.'||'.$msg, __FILE__, __FUNCTION__, __LINE__);
1072 1072
 			return FALSE;
1073 1073
 		}
1074
-		$shortcode = strtoupper( $shortcode );
1074
+		$shortcode = strtoupper($shortcode);
1075 1075
 		// add to array of registered shortcodes
1076
-		EE_Registry::instance()->shortcodes->{$shortcode} = $shortcode_path . $shortcode_class . $shortcode_ext;
1076
+		EE_Registry::instance()->shortcodes->{$shortcode} = $shortcode_path.$shortcode_class.$shortcode_ext;
1077 1077
 		return TRUE;
1078 1078
 	}
1079 1079
 
@@ -1088,23 +1088,23 @@  discard block
 block discarded – undo
1088 1088
 	 */
1089 1089
 	private function _register_modules() {
1090 1090
 		// grab list of installed modules
1091
-		$modules_to_register = glob( EE_MODULES . '*', GLOB_ONLYDIR );
1091
+		$modules_to_register = glob(EE_MODULES.'*', GLOB_ONLYDIR);
1092 1092
 		// filter list of modules to register
1093
-		$modules_to_register = apply_filters( 'FHEE__EE_Config__register_modules__modules_to_register', $modules_to_register );
1093
+		$modules_to_register = apply_filters('FHEE__EE_Config__register_modules__modules_to_register', $modules_to_register);
1094 1094
 
1095 1095
 
1096
-		if ( ! empty( $modules_to_register ) ) {
1096
+		if ( ! empty($modules_to_register)) {
1097 1097
 			// loop through folders
1098
-			foreach ( $modules_to_register as $module_path ) {
1098
+			foreach ($modules_to_register as $module_path) {
1099 1099
 				/**TEMPORARILY EXCLUDE gateways from modules for time being**/
1100
-				if ( $module_path != EE_MODULES . 'zzz-copy-this-module-template' && $module_path != EE_MODULES . 'gateways' ) {
1100
+				if ($module_path != EE_MODULES.'zzz-copy-this-module-template' && $module_path != EE_MODULES.'gateways') {
1101 1101
 					// add to list of installed modules
1102
-					EE_Config::register_module( $module_path );
1102
+					EE_Config::register_module($module_path);
1103 1103
 				}
1104 1104
 			}
1105 1105
 		}
1106 1106
 		// filter list of installed modules
1107
-		return apply_filters( 'FHEE__EE_Config___register_modules__installed_modules', EE_Registry::instance()->modules );
1107
+		return apply_filters('FHEE__EE_Config___register_modules__installed_modules', EE_Registry::instance()->modules);
1108 1108
 	}
1109 1109
 
1110 1110
 
@@ -1117,54 +1117,54 @@  discard block
 block discarded – undo
1117 1117
 	 *  @param 	string 		$module_path - full path up to and including module folder
1118 1118
 	 *  @return 	bool
1119 1119
 	 */
1120
-	public static function register_module( $module_path = NULL ) {
1121
-		do_action( 'AHEE__EE_Config__register_module__begin', $module_path );
1120
+	public static function register_module($module_path = NULL) {
1121
+		do_action('AHEE__EE_Config__register_module__begin', $module_path);
1122 1122
 		$module_ext = '.module.php';
1123 1123
 		// make all separators match
1124
-		$module_path = str_replace( array( '\\', '/' ), DS, $module_path );
1124
+		$module_path = str_replace(array('\\', '/'), DS, $module_path);
1125 1125
 		// does the file path INCLUDE the actual file name as part of the path ?
1126
-		if ( strpos( $module_path, $module_ext ) !== FALSE ) {
1126
+		if (strpos($module_path, $module_ext) !== FALSE) {
1127 1127
 			// grab and shortcode file name from directory name and break apart at dots
1128
-			$module_file = explode( '.', basename( $module_path ));
1128
+			$module_file = explode('.', basename($module_path));
1129 1129
 			// now we need to rebuild the shortcode path
1130
-			$module_path = explode( DS, $module_path );
1130
+			$module_path = explode(DS, $module_path);
1131 1131
 			// remove last segment
1132
-			array_pop( $module_path );
1132
+			array_pop($module_path);
1133 1133
 			// glue it back together
1134
-			$module_path = implode( DS, $module_path ) . DS;
1134
+			$module_path = implode(DS, $module_path).DS;
1135 1135
 			// take first segment from file name pieces and sanitize it
1136
-			$module = preg_replace( '/[^a-zA-Z0-9_\-]/', '', $module_file[0] );
1136
+			$module = preg_replace('/[^a-zA-Z0-9_\-]/', '', $module_file[0]);
1137 1137
 			// ensure class prefix is added
1138
-			$module_class = strpos( $module, 'EED_' ) !== 0 ? 'EED_' . $module : $module;
1138
+			$module_class = strpos($module, 'EED_') !== 0 ? 'EED_'.$module : $module;
1139 1139
 		} else {
1140 1140
 			// we need to generate the filename based off of the folder name
1141 1141
 			// grab and sanitize module name
1142
-			$module = strtolower( basename( $module_path ));
1143
-			$module = preg_replace( '/[^a-z0-9_\-]/', '', $module);
1142
+			$module = strtolower(basename($module_path));
1143
+			$module = preg_replace('/[^a-z0-9_\-]/', '', $module);
1144 1144
 			// like trailingslashit()
1145
-			$module_path = rtrim( $module_path, DS ) . DS;
1145
+			$module_path = rtrim($module_path, DS).DS;
1146 1146
 			// create classname from module directory name
1147
-			$module = str_replace( ' ', '_', ucwords( str_replace( '_', ' ', $module )));
1147
+			$module = str_replace(' ', '_', ucwords(str_replace('_', ' ', $module)));
1148 1148
 			// add class prefix
1149
-			$module_class = 'EED_' . $module;
1149
+			$module_class = 'EED_'.$module;
1150 1150
 		}
1151 1151
 		// does the module exist ?
1152
-		if ( ! is_readable( $module_path . DS . $module_class . $module_ext )) {
1153
-			$msg = sprintf( __( 'The requested %s module file could not be found or is not readable due to file permissions.', 'event_espresso' ), $module );
1154
-			EE_Error::add_error( $msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__ );
1152
+		if ( ! is_readable($module_path.DS.$module_class.$module_ext)) {
1153
+			$msg = sprintf(__('The requested %s module file could not be found or is not readable due to file permissions.', 'event_espresso'), $module);
1154
+			EE_Error::add_error($msg.'||'.$msg, __FILE__, __FUNCTION__, __LINE__);
1155 1155
 			return FALSE;
1156 1156
 		}
1157 1157
 		// load the module class file
1158
-		require_once( $module_path . $module_class . $module_ext );
1158
+		require_once($module_path.$module_class.$module_ext);
1159 1159
 		// verify that class exists
1160
-		if ( ! class_exists( $module_class )) {
1161
-			$msg = sprintf( __( 'The requested %s module class does not exist.', 'event_espresso' ), $module_class );
1162
-			EE_Error::add_error( $msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__ );
1160
+		if ( ! class_exists($module_class)) {
1161
+			$msg = sprintf(__('The requested %s module class does not exist.', 'event_espresso'), $module_class);
1162
+			EE_Error::add_error($msg.'||'.$msg, __FILE__, __FUNCTION__, __LINE__);
1163 1163
 			return FALSE;
1164 1164
 		}
1165 1165
 		// add to array of registered modules
1166
-		EE_Registry::instance()->modules->{$module_class} = $module_path . $module_class . $module_ext;
1167
-		do_action( 'AHEE__EE_Config__register_module__complete', $module_class, EE_Registry::instance()->modules->{$module_class} );
1166
+		EE_Registry::instance()->modules->{$module_class} = $module_path.$module_class.$module_ext;
1167
+		do_action('AHEE__EE_Config__register_module__complete', $module_class, EE_Registry::instance()->modules->{$module_class} );
1168 1168
 		return TRUE;
1169 1169
 	}
1170 1170
 
@@ -1178,23 +1178,23 @@  discard block
 block discarded – undo
1178 1178
 	 */
1179 1179
 	private function _initialize_shortcodes() {
1180 1180
 		// cycle thru shortcode folders
1181
-		foreach ( EE_Registry::instance()->shortcodes as $shortcode => $shortcode_path ) {
1181
+		foreach (EE_Registry::instance()->shortcodes as $shortcode => $shortcode_path) {
1182 1182
 			// add class prefix
1183
-			$shortcode_class = 'EES_' . $shortcode;
1183
+			$shortcode_class = 'EES_'.$shortcode;
1184 1184
 			// fire the shortcode class's set_hooks methods in case it needs to hook into other parts of the system
1185 1185
 			// which set hooks ?
1186
-			if ( is_admin() ) {
1186
+			if (is_admin()) {
1187 1187
 				// fire immediately
1188
-				call_user_func( array( $shortcode_class, 'set_hooks_admin' ));
1188
+				call_user_func(array($shortcode_class, 'set_hooks_admin'));
1189 1189
 			} else {
1190 1190
 				// delay until other systems are online
1191
-				add_action( 'AHEE__EE_System__set_hooks_for_shortcodes_modules_and_addons', array( $shortcode_class,'set_hooks' ));
1191
+				add_action('AHEE__EE_System__set_hooks_for_shortcodes_modules_and_addons', array($shortcode_class, 'set_hooks'));
1192 1192
 				// convert classname to UPPERCASE and create WP shortcode.
1193
-				$shortcode_tag = strtoupper( $shortcode );
1193
+				$shortcode_tag = strtoupper($shortcode);
1194 1194
 				// but first check if the shortcode has already been added before assigning 'fallback_shortcode_processor'
1195
-				if ( ! shortcode_exists( $shortcode_tag )) {
1195
+				if ( ! shortcode_exists($shortcode_tag)) {
1196 1196
 					// NOTE: this shortcode declaration will get overridden if the shortcode is successfully detected in the post content in EE_Front_Controller->_initialize_shortcodes()
1197
-					add_shortcode( $shortcode_tag, array( $shortcode_class, 'fallback_shortcode_processor' ));
1197
+					add_shortcode($shortcode_tag, array($shortcode_class, 'fallback_shortcode_processor'));
1198 1198
 				}
1199 1199
 			}
1200 1200
 		}
@@ -1211,15 +1211,15 @@  discard block
 block discarded – undo
1211 1211
 	 */
1212 1212
 	private function _initialize_modules() {
1213 1213
 		// cycle thru shortcode folders
1214
-		foreach ( EE_Registry::instance()->modules as $module_class => $module_path ) {
1214
+		foreach (EE_Registry::instance()->modules as $module_class => $module_path) {
1215 1215
 			// fire the shortcode class's set_hooks methods in case it needs to hook into other parts of the system
1216 1216
 			// which set hooks ?
1217
-			if ( is_admin() ) {
1217
+			if (is_admin()) {
1218 1218
 				// fire immediately
1219
-				call_user_func( array( $module_class, 'set_hooks_admin' ));
1219
+				call_user_func(array($module_class, 'set_hooks_admin'));
1220 1220
 			} else {
1221 1221
 				// delay until other systems are online
1222
-				add_action( 'AHEE__EE_System__set_hooks_for_shortcodes_modules_and_addons', array( $module_class,'set_hooks' ));
1222
+				add_action('AHEE__EE_System__set_hooks_for_shortcodes_modules_and_addons', array($module_class, 'set_hooks'));
1223 1223
 			}
1224 1224
 		}
1225 1225
 	}
@@ -1237,26 +1237,26 @@  discard block
 block discarded – undo
1237 1237
 	 *  @param 	string 		$key - url param key indicating a route is being called
1238 1238
 	 *  @return 	bool
1239 1239
 	 */
1240
-	public static function register_route( $route = NULL, $module = NULL, $method_name = NULL, $key = 'ee' ) {
1241
-		do_action( 'AHEE__EE_Config__register_route__begin', $route, $module, $method_name );
1242
-		$module = str_replace( 'EED_', '', $module );
1243
-		$module_class = 'EED_' . $module;
1244
-		if ( ! isset( EE_Registry::instance()->modules->{$module_class} )) {
1245
-			$msg = sprintf( __( 'The module %s has not been registered.', 'event_espresso' ), $module );
1246
-			EE_Error::add_error( $msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__ );
1240
+	public static function register_route($route = NULL, $module = NULL, $method_name = NULL, $key = 'ee') {
1241
+		do_action('AHEE__EE_Config__register_route__begin', $route, $module, $method_name);
1242
+		$module = str_replace('EED_', '', $module);
1243
+		$module_class = 'EED_'.$module;
1244
+		if ( ! isset(EE_Registry::instance()->modules->{$module_class} )) {
1245
+			$msg = sprintf(__('The module %s has not been registered.', 'event_espresso'), $module);
1246
+			EE_Error::add_error($msg.'||'.$msg, __FILE__, __FUNCTION__, __LINE__);
1247 1247
 			return FALSE;
1248 1248
 		}
1249
-		if ( empty( $route )) {
1250
-			$msg = sprintf( __( 'No route has been supplied.', 'event_espresso' ), $route );
1251
-			EE_Error::add_error( $msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__ );
1249
+		if (empty($route)) {
1250
+			$msg = sprintf(__('No route has been supplied.', 'event_espresso'), $route);
1251
+			EE_Error::add_error($msg.'||'.$msg, __FILE__, __FUNCTION__, __LINE__);
1252 1252
 			return FALSE;
1253 1253
 		}
1254
-		if ( ! method_exists ( 'EED_' . $module, $method_name )) {
1255
-			$msg = sprintf( __( 'A valid class method for the %s route has not been supplied.', 'event_espresso' ), $route );
1256
-			EE_Error::add_error( $msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__ );
1254
+		if ( ! method_exists('EED_'.$module, $method_name)) {
1255
+			$msg = sprintf(__('A valid class method for the %s route has not been supplied.', 'event_espresso'), $route);
1256
+			EE_Error::add_error($msg.'||'.$msg, __FILE__, __FUNCTION__, __LINE__);
1257 1257
 			return FALSE;
1258 1258
 		}
1259
-		EE_Config::$_module_route_map[ $key ][ $route ] = array( 'EED_' . $module, $method_name );
1259
+		EE_Config::$_module_route_map[$key][$route] = array('EED_'.$module, $method_name);
1260 1260
 		return TRUE;
1261 1261
 	}
1262 1262
 
@@ -1270,11 +1270,11 @@  discard block
 block discarded – undo
1270 1270
 	 *  @param 	string 		$key - url param key indicating a route is being called
1271 1271
 	 *  @return 	string
1272 1272
 	 */
1273
-	public static function get_route( $route = NULL, $key = 'ee' ) {
1274
-		do_action( 'AHEE__EE_Config__get_route__begin',$route );
1275
-		$route = apply_filters( 'FHEE__EE_Config__get_route',$route );
1276
-		if ( isset( EE_Config::$_module_route_map[ $key ][ $route ] )) {
1277
-			return EE_Config::$_module_route_map[ $key ][ $route ];
1273
+	public static function get_route($route = NULL, $key = 'ee') {
1274
+		do_action('AHEE__EE_Config__get_route__begin', $route);
1275
+		$route = apply_filters('FHEE__EE_Config__get_route', $route);
1276
+		if (isset(EE_Config::$_module_route_map[$key][$route])) {
1277
+			return EE_Config::$_module_route_map[$key][$route];
1278 1278
 		}
1279 1279
 		return NULL;
1280 1280
 	}
@@ -1303,35 +1303,35 @@  discard block
 block discarded – undo
1303 1303
 	 * @param    string 		$key - url param key indicating a route is being called
1304 1304
 	 * @return    bool
1305 1305
 	 */
1306
-	public static function register_forward( $route = NULL, $status = 0, $forward = NULL, $key = 'ee' ) {
1307
-		do_action( 'AHEE__EE_Config__register_forward',$route,$status,$forward );
1308
-		if ( ! isset( EE_Config::$_module_route_map[ $key ][ $route ] ) ||  empty( $route )) {
1309
-			$msg = sprintf( __( 'The module route %s for this forward has not been registered.', 'event_espresso' ), $route );
1310
-			EE_Error::add_error( $msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__ );
1306
+	public static function register_forward($route = NULL, $status = 0, $forward = NULL, $key = 'ee') {
1307
+		do_action('AHEE__EE_Config__register_forward', $route, $status, $forward);
1308
+		if ( ! isset(EE_Config::$_module_route_map[$key][$route]) || empty($route)) {
1309
+			$msg = sprintf(__('The module route %s for this forward has not been registered.', 'event_espresso'), $route);
1310
+			EE_Error::add_error($msg.'||'.$msg, __FILE__, __FUNCTION__, __LINE__);
1311 1311
 			return FALSE;
1312 1312
 		}
1313
-		if ( empty( $forward )) {
1314
-			$msg = sprintf( __( 'No forwarding route has been supplied.', 'event_espresso' ), $route );
1315
-			EE_Error::add_error( $msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__ );
1313
+		if (empty($forward)) {
1314
+			$msg = sprintf(__('No forwarding route has been supplied.', 'event_espresso'), $route);
1315
+			EE_Error::add_error($msg.'||'.$msg, __FILE__, __FUNCTION__, __LINE__);
1316 1316
 			return FALSE;
1317 1317
 		}
1318
-		if ( is_array( $forward )) {
1319
-			if ( ! isset( $forward[1] )) {
1320
-				$msg = sprintf( __( 'A class method for the %s forwarding route has not been supplied.', 'event_espresso' ), $route );
1321
-				EE_Error::add_error( $msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__ );
1318
+		if (is_array($forward)) {
1319
+			if ( ! isset($forward[1])) {
1320
+				$msg = sprintf(__('A class method for the %s forwarding route has not been supplied.', 'event_espresso'), $route);
1321
+				EE_Error::add_error($msg.'||'.$msg, __FILE__, __FUNCTION__, __LINE__);
1322 1322
 				return FALSE;
1323 1323
 			}
1324
-			if ( ! method_exists( $forward[0], $forward[1] )) {
1325
-				$msg = sprintf( __( 'The class method %s for the %s forwarding route is in invalid.', 'event_espresso' ), $forward[1], $route );
1326
-				EE_Error::add_error( $msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__ );
1324
+			if ( ! method_exists($forward[0], $forward[1])) {
1325
+				$msg = sprintf(__('The class method %s for the %s forwarding route is in invalid.', 'event_espresso'), $forward[1], $route);
1326
+				EE_Error::add_error($msg.'||'.$msg, __FILE__, __FUNCTION__, __LINE__);
1327 1327
 				return FALSE;
1328 1328
 			}
1329
-		} else if ( ! function_exists( $forward )) {
1330
-			$msg = sprintf( __( 'The function %s for the %s forwarding route is in invalid.', 'event_espresso' ), $forward, $route );
1331
-			EE_Error::add_error( $msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__ );
1329
+		} else if ( ! function_exists($forward)) {
1330
+			$msg = sprintf(__('The function %s for the %s forwarding route is in invalid.', 'event_espresso'), $forward, $route);
1331
+			EE_Error::add_error($msg.'||'.$msg, __FILE__, __FUNCTION__, __LINE__);
1332 1332
 			return FALSE;
1333 1333
 		}
1334
-		EE_Config::$_module_forward_map[ $key ][ $route ][ absint( $status ) ] = $forward;
1334
+		EE_Config::$_module_forward_map[$key][$route][absint($status)] = $forward;
1335 1335
 		return TRUE;
1336 1336
 	}
1337 1337
 
@@ -1346,10 +1346,10 @@  discard block
 block discarded – undo
1346 1346
 	 *  @param    string 		$key - url param key indicating a route is being called
1347 1347
 	 *  @return 	string
1348 1348
 	 */
1349
-	public static function get_forward( $route = NULL, $status = 0, $key = 'ee' ) {
1350
-		do_action( 'AHEE__EE_Config__get_forward__begin',$route,$status );
1351
-		if ( isset( EE_Config::$_module_forward_map[ $key ][ $route ][ $status ] )) {
1352
-			return apply_filters( 'FHEE__EE_Config__get_forward', EE_Config::$_module_forward_map[ $key ][ $route ][ $status ], $route,$status );
1349
+	public static function get_forward($route = NULL, $status = 0, $key = 'ee') {
1350
+		do_action('AHEE__EE_Config__get_forward__begin', $route, $status);
1351
+		if (isset(EE_Config::$_module_forward_map[$key][$route][$status])) {
1352
+			return apply_filters('FHEE__EE_Config__get_forward', EE_Config::$_module_forward_map[$key][$route][$status], $route, $status);
1353 1353
 		}
1354 1354
 		return NULL;
1355 1355
 	}
@@ -1366,19 +1366,19 @@  discard block
 block discarded – undo
1366 1366
 	 * @param    string 		$key - url param key indicating a route is being called
1367 1367
 	 * @return    bool
1368 1368
 	 */
1369
-	public static function register_view( $route = NULL, $status = 0, $view = NULL, $key = 'ee' ) {
1370
-		do_action( 'AHEE__EE_Config__register_view__begin',$route,$status,$view );
1371
-		if ( ! isset( EE_Config::$_module_route_map[ $key ][ $route ] ) ||  empty( $route )) {
1372
-			$msg = sprintf( __( 'The module route %s for this view has not been registered.', 'event_espresso' ), $route );
1373
-			EE_Error::add_error( $msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__ );
1369
+	public static function register_view($route = NULL, $status = 0, $view = NULL, $key = 'ee') {
1370
+		do_action('AHEE__EE_Config__register_view__begin', $route, $status, $view);
1371
+		if ( ! isset(EE_Config::$_module_route_map[$key][$route]) || empty($route)) {
1372
+			$msg = sprintf(__('The module route %s for this view has not been registered.', 'event_espresso'), $route);
1373
+			EE_Error::add_error($msg.'||'.$msg, __FILE__, __FUNCTION__, __LINE__);
1374 1374
 			return FALSE;
1375 1375
 		}
1376
-		if ( ! is_readable( $view )) {
1377
-			$msg = sprintf( __( 'The %s view file could not be found or is not readable due to file permissions.', 'event_espresso' ), $view );
1378
-			EE_Error::add_error( $msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__ );
1376
+		if ( ! is_readable($view)) {
1377
+			$msg = sprintf(__('The %s view file could not be found or is not readable due to file permissions.', 'event_espresso'), $view);
1378
+			EE_Error::add_error($msg.'||'.$msg, __FILE__, __FUNCTION__, __LINE__);
1379 1379
 			return FALSE;
1380 1380
 		}
1381
-		EE_Config::$_module_view_map[ $key ][ $route ][ absint( $status ) ] = $view;
1381
+		EE_Config::$_module_view_map[$key][$route][absint($status)] = $view;
1382 1382
 		return TRUE;
1383 1383
 	}
1384 1384
 
@@ -1395,10 +1395,10 @@  discard block
 block discarded – undo
1395 1395
 	 *  @param    string 		$key - url param key indicating a route is being called
1396 1396
 	 *  @return 	string
1397 1397
 	 */
1398
-	public static function get_view( $route = NULL, $status = 0, $key = 'ee' ) {
1399
-		do_action( 'AHEE__EE_Config__get_view__begin',$route,$status );
1400
-		if ( isset( EE_Config::$_module_view_map[ $key ][ $route ][ $status ] )) {
1401
-			return apply_filters( 'FHEE__EE_Config__get_view', EE_Config::$_module_view_map[ $key ][ $route ][ $status ], $route,$status );
1398
+	public static function get_view($route = NULL, $status = 0, $key = 'ee') {
1399
+		do_action('AHEE__EE_Config__get_view__begin', $route, $status);
1400
+		if (isset(EE_Config::$_module_view_map[$key][$route][$status])) {
1401
+			return apply_filters('FHEE__EE_Config__get_view', EE_Config::$_module_view_map[$key][$route][$status], $route, $status);
1402 1402
 		}
1403 1403
 		return NULL;
1404 1404
 	}
@@ -1406,7 +1406,7 @@  discard block
 block discarded – undo
1406 1406
 
1407 1407
 
1408 1408
 	public function shutdown() {
1409
-		update_option( 'ee_config_option_names', $this->_config_option_names );
1409
+		update_option('ee_config_option_names', $this->_config_option_names);
1410 1410
 	}
1411 1411
 
1412 1412
 
@@ -1422,7 +1422,7 @@  discard block
 block discarded – undo
1422 1422
  * magic functions in use, except we'll allow them to magically set and get stuff...
1423 1423
  * basically, they should just be well-defined stdClasses
1424 1424
  */
1425
-class EE_Config_Base{
1425
+class EE_Config_Base {
1426 1426
 
1427 1427
 	/**
1428 1428
 	 * Utility function for escaping the value of a property and returning.
@@ -1431,13 +1431,13 @@  discard block
 block discarded – undo
1431 1431
 	 * @return mixed if a detected type found return the escaped value, otherwise just the raw value is returned.
1432 1432
 	 * @throws \EE_Error
1433 1433
 	 */
1434
-	public function get_pretty( $property ) {
1435
-		if ( ! property_exists( $this, $property ) ) {
1436
-			throw new EE_Error( sprintf( __('%1$s::get_pretty() has been called with the property %2$s which does not exist on the %1$s config class.', 'event_espresso' ), get_class( $this ), $property ) );
1434
+	public function get_pretty($property) {
1435
+		if ( ! property_exists($this, $property)) {
1436
+			throw new EE_Error(sprintf(__('%1$s::get_pretty() has been called with the property %2$s which does not exist on the %1$s config class.', 'event_espresso'), get_class($this), $property));
1437 1437
 		}
1438 1438
 		//just handling escaping of strings for now.
1439
-		if ( is_string( $this->{$property} ) ) {
1440
-			return stripslashes( $this->{$property} );
1439
+		if (is_string($this->{$property} )) {
1440
+			return stripslashes($this->{$property} );
1441 1441
 		}
1442 1442
 		return $this->{$property};
1443 1443
 	}
@@ -1446,19 +1446,19 @@  discard block
 block discarded – undo
1446 1446
 
1447 1447
 	public function populate() {
1448 1448
 		//grab defaults via a new instance of this class.
1449
-		$class_name = get_class( $this );
1449
+		$class_name = get_class($this);
1450 1450
 		$defaults = new $class_name;
1451 1451
 
1452 1452
 		//loop through the properties for this class and see if they are set.  If they are NOT, then grab the
1453 1453
 		//default from our $defaults object.
1454
-		foreach ( get_object_vars( $defaults ) as $property => $value ) {
1455
-			if ( is_null( $this->{$property} ) ) {
1454
+		foreach (get_object_vars($defaults) as $property => $value) {
1455
+			if (is_null($this->{$property} )) {
1456 1456
 				$this->{$property} = $value;
1457 1457
 			}
1458 1458
 		}
1459 1459
 
1460 1460
 		//cleanup
1461
-		unset( $defaults );
1461
+		unset($defaults);
1462 1462
 	}
1463 1463
 
1464 1464
 
@@ -1550,12 +1550,12 @@  discard block
 block discarded – undo
1550 1550
 	 */
1551 1551
 	public function __construct() {
1552 1552
 		$current_network_main_site = is_multisite() ? get_current_site() : NULL;
1553
-		$current_main_site_id = !empty( $current_network_main_site ) ? $current_network_main_site->blog_id : 1;
1553
+		$current_main_site_id = ! empty($current_network_main_site) ? $current_network_main_site->blog_id : 1;
1554 1554
 		// set default organization settings
1555 1555
 		$this->current_blog_id = get_current_blog_id();
1556 1556
 		$this->current_blog_id = $this->current_blog_id === NULL ? 1 : $this->current_blog_id;
1557
-		$this->ee_ueip_optin = is_main_site() ? get_option( 'ee_ueip_optin', TRUE ) : get_blog_option( $current_main_site_id, 'ee_ueip_optin', TRUE );
1558
-		$this->ee_ueip_has_notified = is_main_site() ? get_option( 'ee_ueip_has_notified', FALSE ) : TRUE;
1557
+		$this->ee_ueip_optin = is_main_site() ? get_option('ee_ueip_optin', TRUE) : get_blog_option($current_main_site_id, 'ee_ueip_optin', TRUE);
1558
+		$this->ee_ueip_has_notified = is_main_site() ? get_option('ee_ueip_has_notified', FALSE) : TRUE;
1559 1559
 		$this->post_shortcodes = array();
1560 1560
 		$this->module_route_map = array();
1561 1561
 		$this->module_forward_map = array();
@@ -1574,7 +1574,7 @@  discard block
 block discarded – undo
1574 1574
 		$this->event_cpt_slug = __('events', 'event_espresso');
1575 1575
 
1576 1576
 		//ueip constant check
1577
-		if ( defined( 'EE_DISABLE_UXIP' ) && EE_DISABLE_UXIP ) {
1577
+		if (defined('EE_DISABLE_UXIP') && EE_DISABLE_UXIP) {
1578 1578
 			$this->ee_ueip_optin = FALSE;
1579 1579
 			$this->ee_ueip_has_notified = TRUE;
1580 1580
 		}
@@ -1614,8 +1614,8 @@  discard block
 block discarded – undo
1614 1614
 	 *  @return 	string
1615 1615
 	 */
1616 1616
 	public function reg_page_url() {
1617
-		if ( ! $this->reg_page_url ) {
1618
-			$this->reg_page_url = get_permalink( $this->reg_page_id ) . '#checkout';
1617
+		if ( ! $this->reg_page_url) {
1618
+			$this->reg_page_url = get_permalink($this->reg_page_id).'#checkout';
1619 1619
 		}
1620 1620
 		return $this->reg_page_url;
1621 1621
 	}
@@ -1628,12 +1628,12 @@  discard block
 block discarded – undo
1628 1628
 	 *  @return 	string
1629 1629
 	 */
1630 1630
 	public function txn_page_url($query_args = array()) {
1631
-		if ( ! $this->txn_page_url ) {
1632
-			$this->txn_page_url = get_permalink( $this->txn_page_id );
1631
+		if ( ! $this->txn_page_url) {
1632
+			$this->txn_page_url = get_permalink($this->txn_page_id);
1633 1633
 		}
1634
-		if($query_args){
1635
-			return add_query_arg($query_args,$this->txn_page_url);
1636
-		}else{
1634
+		if ($query_args) {
1635
+			return add_query_arg($query_args, $this->txn_page_url);
1636
+		} else {
1637 1637
 			return $this->txn_page_url;
1638 1638
 		}
1639 1639
 	}
@@ -1645,12 +1645,12 @@  discard block
 block discarded – undo
1645 1645
 	 *  @return 	string
1646 1646
 	 */
1647 1647
 	public function thank_you_page_url($query_args = array()) {
1648
-		if ( ! $this->thank_you_page_url ) {
1649
-			$this->thank_you_page_url = get_permalink( $this->thank_you_page_id );
1648
+		if ( ! $this->thank_you_page_url) {
1649
+			$this->thank_you_page_url = get_permalink($this->thank_you_page_id);
1650 1650
 		}
1651
-		if($query_args){
1652
-			return add_query_arg($query_args,$this->thank_you_page_url);
1653
-		}else{
1651
+		if ($query_args) {
1652
+			return add_query_arg($query_args, $this->thank_you_page_url);
1653
+		} else {
1654 1654
 			return $this->thank_you_page_url;
1655 1655
 		}
1656 1656
 	}
@@ -1661,8 +1661,8 @@  discard block
 block discarded – undo
1661 1661
 	 *  @return 	string
1662 1662
 	 */
1663 1663
 	public function cancel_page_url() {
1664
-		if ( ! $this->cancel_page_url ) {
1665
-			$this->cancel_page_url = get_permalink( $this->cancel_page_id );
1664
+		if ( ! $this->cancel_page_url) {
1665
+			$this->cancel_page_url = get_permalink($this->cancel_page_id);
1666 1666
 		}
1667 1667
 		return $this->cancel_page_url;
1668 1668
 	}
@@ -1690,7 +1690,7 @@  discard block
 block discarded – undo
1690 1690
 		//reset all url properties
1691 1691
 		$this->_reset_urls();
1692 1692
 		//return what to save to db
1693
-		return array_keys( get_object_vars( $this ) );
1693
+		return array_keys(get_object_vars($this));
1694 1694
 	}
1695 1695
 
1696 1696
 }
@@ -1922,39 +1922,39 @@  discard block
 block discarded – undo
1922 1922
 	 * @param null $CNT_ISO
1923 1923
 	 * @return \EE_Currency_Config
1924 1924
 	 */
1925
-	public function __construct( $CNT_ISO = NULL ) {
1925
+	public function __construct($CNT_ISO = NULL) {
1926 1926
 
1927 1927
 		// get country code from organization settings or use default
1928
-		$ORG_CNT = isset( EE_Registry::instance()->CFG->organization ) && EE_Registry::instance()->CFG->organization instanceof EE_Organization_Config ? EE_Registry::instance()->CFG->organization->CNT_ISO : NULL;
1928
+		$ORG_CNT = isset(EE_Registry::instance()->CFG->organization) && EE_Registry::instance()->CFG->organization instanceof EE_Organization_Config ? EE_Registry::instance()->CFG->organization->CNT_ISO : NULL;
1929 1929
 		// but override if requested
1930
-		$CNT_ISO = ! empty( $CNT_ISO ) ? $CNT_ISO : $ORG_CNT;
1931
-		EE_Registry::instance()->load_helper( 'Activation' );
1930
+		$CNT_ISO = ! empty($CNT_ISO) ? $CNT_ISO : $ORG_CNT;
1931
+		EE_Registry::instance()->load_helper('Activation');
1932 1932
 		// so if that all went well, and we are not in M-Mode (cuz you can't query the db in M-Mode) and double-check the countries table exists
1933
-		if ( ! empty( $CNT_ISO ) && EE_Maintenance_Mode::instance()->models_can_query() && EEH_Activation::table_exists( EE_Registry::instance()->load_model( 'Country' )->table() ) ) {
1933
+		if ( ! empty($CNT_ISO) && EE_Maintenance_Mode::instance()->models_can_query() && EEH_Activation::table_exists(EE_Registry::instance()->load_model('Country')->table())) {
1934 1934
 			// retrieve the country settings from the db, just in case they have been customized
1935
-			$country = EE_Registry::instance()->load_model( 'Country' )->get_one_by_ID( $CNT_ISO );
1936
-			if ( $country instanceof EE_Country ) {
1937
-				$this->code = $country->currency_code(); 	// currency code: USD, CAD, EUR
1938
-				$this->name = $country->currency_name_single();	// Dollar
1939
-				$this->plural = $country->currency_name_plural(); 	// Dollars
1940
-				$this->sign =  $country->currency_sign(); 			// currency sign: $
1941
-				$this->sign_b4 = $country->currency_sign_before(); 		// currency sign before or after: $TRUE  or  FALSE$
1942
-				$this->dec_plc = $country->currency_decimal_places();	// decimal places: 2 = 0.00  3 = 0.000
1943
-				$this->dec_mrk = $country->currency_decimal_mark();	// decimal mark: (comma) ',' = 0,01   or (decimal) '.' = 0.01
1944
-				$this->thsnds = $country->currency_thousands_separator();	// thousands separator: (comma) ',' = 1,000   or (decimal) '.' = 1.000
1935
+			$country = EE_Registry::instance()->load_model('Country')->get_one_by_ID($CNT_ISO);
1936
+			if ($country instanceof EE_Country) {
1937
+				$this->code = $country->currency_code(); // currency code: USD, CAD, EUR
1938
+				$this->name = $country->currency_name_single(); // Dollar
1939
+				$this->plural = $country->currency_name_plural(); // Dollars
1940
+				$this->sign = $country->currency_sign(); // currency sign: $
1941
+				$this->sign_b4 = $country->currency_sign_before(); // currency sign before or after: $TRUE  or  FALSE$
1942
+				$this->dec_plc = $country->currency_decimal_places(); // decimal places: 2 = 0.00  3 = 0.000
1943
+				$this->dec_mrk = $country->currency_decimal_mark(); // decimal mark: (comma) ',' = 0,01   or (decimal) '.' = 0.01
1944
+				$this->thsnds = $country->currency_thousands_separator(); // thousands separator: (comma) ',' = 1,000   or (decimal) '.' = 1.000
1945 1945
 			}
1946 1946
 		}
1947 1947
 		// fallback to hardcoded defaults, in case the above failed
1948
-		if ( empty( $this->code )) {
1948
+		if (empty($this->code)) {
1949 1949
 			// set default currency settings
1950
-			$this->code = 'USD'; 	// currency code: USD, CAD, EUR
1951
-			$this->name = __( 'Dollar', 'event_espresso' ); 	// Dollar
1952
-			$this->plural = __( 'Dollars', 'event_espresso' ); 	// Dollars
1953
-			$this->sign =  '$'; 	// currency sign: $
1954
-			$this->sign_b4 = TRUE; 	// currency sign before or after: $TRUE  or  FALSE$
1955
-			$this->dec_plc = 2; 	// decimal places: 2 = 0.00  3 = 0.000
1956
-			$this->dec_mrk = '.'; 	// decimal mark: (comma) ',' = 0,01   or (decimal) '.' = 0.01
1957
-			$this->thsnds = ','; 	// thousands separator: (comma) ',' = 1,000   or (decimal) '.' = 1.000
1950
+			$this->code = 'USD'; // currency code: USD, CAD, EUR
1951
+			$this->name = __('Dollar', 'event_espresso'); // Dollar
1952
+			$this->plural = __('Dollars', 'event_espresso'); // Dollars
1953
+			$this->sign = '$'; // currency sign: $
1954
+			$this->sign_b4 = TRUE; // currency sign before or after: $TRUE  or  FALSE$
1955
+			$this->dec_plc = 2; // decimal places: 2 = 0.00  3 = 0.000
1956
+			$this->dec_mrk = '.'; // decimal mark: (comma) ',' = 0,01   or (decimal) '.' = 0.01
1957
+			$this->thsnds = ','; // thousands separator: (comma) ',' = 1,000   or (decimal) '.' = 1.000
1958 1958
 		}
1959 1959
 	}
1960 1960
 }
@@ -2094,7 +2094,7 @@  discard block
 block discarded – undo
2094 2094
 	 * @since 4.8.8.rc.019
2095 2095
 	 */
2096 2096
 	public function do_hooks() {
2097
-		add_action( 'AHEE__EE_Config___load_core_config__end', array( $this, 'set_default_reg_status_on_EEM_Event' ));
2097
+		add_action('AHEE__EE_Config___load_core_config__end', array($this, 'set_default_reg_status_on_EEM_Event'));
2098 2098
 	}
2099 2099
 
2100 2100
 
@@ -2102,7 +2102,7 @@  discard block
 block discarded – undo
2102 2102
 	 * @return void
2103 2103
 	 */
2104 2104
 	public function set_default_reg_status_on_EEM_Event() {
2105
-		EEM_Event::set_default_reg_status( $this->default_STS_ID );
2105
+		EEM_Event::set_default_reg_status($this->default_STS_ID);
2106 2106
 	}
2107 2107
 
2108 2108
 
@@ -2207,10 +2207,10 @@  discard block
 block discarded – undo
2207 2207
 	 * @param bool $reset
2208 2208
 	 * @return string
2209 2209
 	 */
2210
-	public function log_file_name( $reset = FALSE ) {
2211
-		if ( empty( $this->log_file_name ) || $reset ) {
2212
-			$this->log_file_name = sanitize_key( 'espresso_log_' . md5( uniqid( '', TRUE ))) . '.txt';
2213
-			EE_Config::instance()->update_espresso_config( FALSE, FALSE );
2210
+	public function log_file_name($reset = FALSE) {
2211
+		if (empty($this->log_file_name) || $reset) {
2212
+			$this->log_file_name = sanitize_key('espresso_log_'.md5(uniqid('', TRUE))).'.txt';
2213
+			EE_Config::instance()->update_espresso_config(FALSE, FALSE);
2214 2214
 		}
2215 2215
 		return $this->log_file_name;
2216 2216
 	}
@@ -2222,10 +2222,10 @@  discard block
 block discarded – undo
2222 2222
 	 * @param bool $reset
2223 2223
 	 * @return string
2224 2224
 	 */
2225
-	public function debug_file_name( $reset = FALSE ) {
2226
-		if ( empty( $this->debug_file_name ) || $reset ) {
2227
-			$this->debug_file_name = sanitize_key( 'espresso_debug_' . md5( uniqid( '', TRUE ))) . '.txt';
2228
-			EE_Config::instance()->update_espresso_config( FALSE, FALSE );
2225
+	public function debug_file_name($reset = FALSE) {
2226
+		if (empty($this->debug_file_name) || $reset) {
2227
+			$this->debug_file_name = sanitize_key('espresso_debug_'.md5(uniqid('', TRUE))).'.txt';
2228
+			EE_Config::instance()->update_espresso_config(FALSE, FALSE);
2229 2229
 		}
2230 2230
 		return $this->debug_file_name;
2231 2231
 	}
@@ -2398,21 +2398,21 @@  discard block
 block discarded – undo
2398 2398
 		// set default map settings
2399 2399
 		$this->use_google_maps = TRUE;
2400 2400
 		// for event details pages (reg page)
2401
-		$this->event_details_map_width = 585; 			// ee_map_width_single
2402
-		$this->event_details_map_height = 362; 			// ee_map_height_single
2403
-		$this->event_details_map_zoom = 14; 			// ee_map_zoom_single
2404
-		$this->event_details_display_nav = TRUE; 			// ee_map_nav_display_single
2405
-		$this->event_details_nav_size = FALSE; 			// ee_map_nav_size_single
2406
-		$this->event_details_control_type = 'default'; 		// ee_map_type_control_single
2407
-		$this->event_details_map_align = 'center'; 			// ee_map_align_single
2401
+		$this->event_details_map_width = 585; // ee_map_width_single
2402
+		$this->event_details_map_height = 362; // ee_map_height_single
2403
+		$this->event_details_map_zoom = 14; // ee_map_zoom_single
2404
+		$this->event_details_display_nav = TRUE; // ee_map_nav_display_single
2405
+		$this->event_details_nav_size = FALSE; // ee_map_nav_size_single
2406
+		$this->event_details_control_type = 'default'; // ee_map_type_control_single
2407
+		$this->event_details_map_align = 'center'; // ee_map_align_single
2408 2408
 		// for event list pages
2409
-		$this->event_list_map_width = 300; 			// ee_map_width
2410
-		$this->event_list_map_height = 185; 		// ee_map_height
2411
-		$this->event_list_map_zoom = 12; 			// ee_map_zoom
2412
-		$this->event_list_display_nav = FALSE; 		// ee_map_nav_display
2413
-		$this->event_list_nav_size = TRUE; 			// ee_map_nav_size
2414
-		$this->event_list_control_type = 'dropdown'; 		// ee_map_type_control
2415
-		$this->event_list_map_align = 'center'; 			// ee_map_align
2409
+		$this->event_list_map_width = 300; // ee_map_width
2410
+		$this->event_list_map_height = 185; // ee_map_height
2411
+		$this->event_list_map_zoom = 12; // ee_map_zoom
2412
+		$this->event_list_display_nav = FALSE; // ee_map_nav_display
2413
+		$this->event_list_nav_size = TRUE; // ee_map_nav_size
2414
+		$this->event_list_control_type = 'dropdown'; // ee_map_type_control
2415
+		$this->event_list_map_align = 'center'; // ee_map_align
2416 2416
 	}
2417 2417
 
2418 2418
 }
@@ -2423,7 +2423,7 @@  discard block
 block discarded – undo
2423 2423
 /**
2424 2424
  * stores Events_Archive settings
2425 2425
  */
2426
-class EE_Events_Archive_Config extends EE_Config_Base{
2426
+class EE_Events_Archive_Config extends EE_Config_Base {
2427 2427
 
2428 2428
 	public $display_status_banner;
2429 2429
 	public $display_description;
@@ -2442,7 +2442,7 @@  discard block
 block discarded – undo
2442 2442
 	/**
2443 2443
 	 *	class constructor
2444 2444
 	 */
2445
-	public function __construct(){
2445
+	public function __construct() {
2446 2446
 		$this->display_status_banner = 0;
2447 2447
 		$this->display_description = 1;
2448 2448
 		$this->display_ticket_selector = 0;
@@ -2462,7 +2462,7 @@  discard block
 block discarded – undo
2462 2462
 /**
2463 2463
  * Stores Event_Single_Config settings
2464 2464
  */
2465
-class EE_Event_Single_Config extends EE_Config_Base{
2465
+class EE_Event_Single_Config extends EE_Config_Base {
2466 2466
 
2467 2467
 	public $display_status_banner_single;
2468 2468
 	public $display_venue;
@@ -2491,7 +2491,7 @@  discard block
 block discarded – undo
2491 2491
 /**
2492 2492
  * Stores Ticket_Selector_Config settings
2493 2493
  */
2494
-class EE_Ticket_Selector_Config extends EE_Config_Base{
2494
+class EE_Ticket_Selector_Config extends EE_Config_Base {
2495 2495
 	public $show_ticket_sale_columns;
2496 2496
 	public $show_ticket_details;
2497 2497
 	public $show_expired_tickets;
@@ -2545,7 +2545,7 @@  discard block
 block discarded – undo
2545 2545
 	 * @return void
2546 2546
 	 */
2547 2547
 	protected function _set_php_values() {
2548
-		$this->php->max_input_vars = ini_get( 'max_input_vars' );
2548
+		$this->php->max_input_vars = ini_get('max_input_vars');
2549 2549
 		$this->php->version = phpversion();
2550 2550
 	}
2551 2551
 
@@ -2564,8 +2564,8 @@  discard block
 block discarded – undo
2564 2564
 	 *         @type string $msg 		Any message to be displayed.
2565 2565
 	 * }
2566 2566
 	 */
2567
-	public function max_input_vars_limit_check( $input_count = 0 ) {
2568
-		if ( ( $input_count >= $this->php->max_input_vars ) && ( PHP_MAJOR_VERSION >= 5 && PHP_MINOR_VERSION >= 3 && PHP_RELEASE_VERSION >=9 ) ) {
2567
+	public function max_input_vars_limit_check($input_count = 0) {
2568
+		if (($input_count >= $this->php->max_input_vars) && (PHP_MAJOR_VERSION >= 5 && PHP_MINOR_VERSION >= 3 && PHP_RELEASE_VERSION >= 9)) {
2569 2569
 			return  __('The number of inputs on this page has been exceeded.  You cannot add anymore items (i.e. tickets, datetimes, custom fields) on this page because of your servers PHP "max_input_vars" setting.', 'event_espresso');
2570 2570
 		} else {
2571 2571
 			return '';
@@ -2601,7 +2601,7 @@  discard block
 block discarded – undo
2601 2601
  * stores payment gateway info
2602 2602
  * @deprecated
2603 2603
  */
2604
-class EE_Gateway_Config extends EE_Config_Base{
2604
+class EE_Gateway_Config extends EE_Config_Base {
2605 2605
 
2606 2606
 	/**
2607 2607
 	 * Array with keys that are payment gateways slugs, and values are arrays
@@ -2623,9 +2623,9 @@  discard block
 block discarded – undo
2623 2623
 	 *	class constructor
2624 2624
 	 * @deprecated
2625 2625
 	 */
2626
-	public function __construct(){
2626
+	public function __construct() {
2627 2627
 		$this->payment_settings = array();
2628
-		$this->active_gateways = array( 'Invoice' => FALSE );
2628
+		$this->active_gateways = array('Invoice' => FALSE);
2629 2629
 	}
2630 2630
 }
2631 2631
 
Please login to merge, or discard this patch.
core/EE_Maintenance_Mode.core.php 4 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -184,7 +184,7 @@
 block discarded – undo
184 184
 	 *   returns TRUE if M-Mode is engaged and the current request is not for the admin
185 185
 	 *
186 186
 	 * @access    public
187
-	 * @return    string
187
+	 * @return    boolean
188 188
 	 */
189 189
 	public static function disable_frontend_for_maintenance() {
190 190
 		return ! is_admin() && EE_Maintenance_Mode::instance()->level() ? TRUE : FALSE;
Please login to merge, or discard this patch.
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -48,10 +48,10 @@
 block discarded – undo
48 48
 	 */
49 49
 	const option_name_maintenance_mode = 'ee_maintenance_mode';
50 50
    /**
51
-     * 	EE_Maintenance_Mode Object
52
-     * 	@var EE_Maintenance_Mode $_instance
53
-	 * 	@access 	private
54
-     */
51
+    * 	EE_Maintenance_Mode Object
52
+    * 	@var EE_Maintenance_Mode $_instance
53
+    * 	@access 	private
54
+    */
55 55
 	private static $_instance = NULL;
56 56
 
57 57
 	/**
Please login to merge, or discard this patch.
Braces   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
 			current_user_can('administrator') && //when the user is an admin
142 142
 			$real_maintenance_mode_level == EE_Maintenance_Mode::level_1_frontend_only_maintenance){//and we're in level 1
143 143
 			$maintenance_mode_level = EE_Maintenance_Mode::level_0_not_in_maintenance;
144
-		}else{
144
+		} else{
145 145
 			$maintenance_mode_level = $real_maintenance_mode_level;
146 146
 		}
147 147
 		return $maintenance_mode_level;
@@ -156,12 +156,12 @@  discard block
 block discarded – undo
156 156
 		if( EE_Data_Migration_Manager::instance()->check_for_applicable_data_migration_scripts()){
157 157
 			update_option(self::option_name_maintenance_mode, self::level_2_complete_maintenance);
158 158
 			return true;
159
-		}elseif( $this->level() == self::level_2_complete_maintenance ){
159
+		} elseif( $this->level() == self::level_2_complete_maintenance ){
160 160
 			//we also want to handle the opposite: if the site is mm2, but there aren't any migrations to run
161 161
 			//then we shouldn't be in mm2. (Maybe an addon got deactivated?)
162 162
 			update_option( self::option_name_maintenance_mode, self::level_0_not_in_maintenance );
163 163
 			return false;
164
-		}else{
164
+		} else{
165 165
 			return false;
166 166
 		}
167 167
 	}
Please login to merge, or discard this patch.
Spacing   +35 added lines, -35 removed lines patch added patch discarded remove patch
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
 	 */
74 74
 	public static function instance() {
75 75
 		// check if class object is instantiated
76
-		if ( self::$_instance === NULL  or ! is_object( self::$_instance ) or ! ( self::$_instance instanceof EE_Maintenance_Mode )) {
76
+		if (self::$_instance === NULL or ! is_object(self::$_instance) or ! (self::$_instance instanceof EE_Maintenance_Mode)) {
77 77
 			self::$_instance = new self();
78 78
 		}
79 79
 		return self::$_instance;
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
 	 * Resets maintenance mode (mostly just re-checks whether or not we should be in maintenance mode)
84 84
 	 * @return EE_Maintenance_Mode
85 85
 	 */
86
-	public static function reset(){
86
+	public static function reset() {
87 87
 		self::instance()->set_maintenance_mode_if_db_old();
88 88
 		return self::instance();
89 89
 	}
@@ -98,11 +98,11 @@  discard block
 block discarded – undo
98 98
 	 */
99 99
 	private function __construct() {
100 100
 		// if M-Mode level 2 is engaged, we still need basic assets loaded
101
-		add_action( 'wp_enqueue_scripts', array( $this, 'load_assets_required_for_m_mode' ));
101
+		add_action('wp_enqueue_scripts', array($this, 'load_assets_required_for_m_mode'));
102 102
 		// shut 'er down down for maintenance ?
103
-		add_filter( 'the_content', array( $this, 'the_content' ), 2 );
103
+		add_filter('the_content', array($this, 'the_content'), 2);
104 104
 		// add powered by EE msg
105
-		add_action( 'shutdown', array( $this, 'display_maintenance_mode_notice' ), 10 );
105
+		add_action('shutdown', array($this, 'display_maintenance_mode_notice'), 10);
106 106
 	}
107 107
 
108 108
 
@@ -112,8 +112,8 @@  discard block
 block discarded – undo
112 112
 	 * retrieves the maintenance mode option value from the db
113 113
 	 * @return int
114 114
 	 */
115
-	public function real_level(){
116
-		return get_option( self::option_name_maintenance_mode, EE_Maintenance_Mode::level_0_not_in_maintenance );
115
+	public function real_level() {
116
+		return get_option(self::option_name_maintenance_mode, EE_Maintenance_Mode::level_0_not_in_maintenance);
117 117
 	}
118 118
 
119 119
 	/**
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
 	 * thinks their tables are present and up-to-date).
122 122
 	 * @return boolean
123 123
 	 */
124
-	public function models_can_query(){
124
+	public function models_can_query() {
125 125
 		return $this->real_level() != EE_Maintenance_Mode::level_2_complete_maintenance;
126 126
 	}
127 127
 
@@ -134,14 +134,14 @@  discard block
 block discarded – undo
134 134
 	 * EE_Maintenance_Mode::level_2_complete_maintenance => frontend and backend maintenance mode
135 135
 	 * @return int
136 136
 	 */
137
-	public function level(){
137
+	public function level() {
138 138
 		$real_maintenance_mode_level = $this->real_level();
139 139
 		//if this is an admin request, we'll be honest... except if it's ajax, because that might be from the frontend
140
-		if( ( ! is_admin() || (defined('DOING_AJAX') && DOING_AJAX)) && //only on frontend or ajax requests
140
+		if (( ! is_admin() || (defined('DOING_AJAX') && DOING_AJAX)) && //only on frontend or ajax requests
141 141
 			current_user_can('administrator') && //when the user is an admin
142
-			$real_maintenance_mode_level == EE_Maintenance_Mode::level_1_frontend_only_maintenance){//and we're in level 1
142
+			$real_maintenance_mode_level == EE_Maintenance_Mode::level_1_frontend_only_maintenance) {//and we're in level 1
143 143
 			$maintenance_mode_level = EE_Maintenance_Mode::level_0_not_in_maintenance;
144
-		}else{
144
+		} else {
145 145
 			$maintenance_mode_level = $real_maintenance_mode_level;
146 146
 		}
147 147
 		return $maintenance_mode_level;
@@ -151,17 +151,17 @@  discard block
 block discarded – undo
151 151
 	 * Determines if we need to put EE in maintenance mode because the database needs updating
152 152
 	 * @return boolean true if DB is old and maintenance mode was triggered; false otherwise
153 153
 	 */
154
-	public function set_maintenance_mode_if_db_old(){
155
-		EE_Registry::instance()->load_core( 'Data_Migration_Manager' );
156
-		if( EE_Data_Migration_Manager::instance()->check_for_applicable_data_migration_scripts()){
154
+	public function set_maintenance_mode_if_db_old() {
155
+		EE_Registry::instance()->load_core('Data_Migration_Manager');
156
+		if (EE_Data_Migration_Manager::instance()->check_for_applicable_data_migration_scripts()) {
157 157
 			update_option(self::option_name_maintenance_mode, self::level_2_complete_maintenance);
158 158
 			return true;
159
-		}elseif( $this->level() == self::level_2_complete_maintenance ){
159
+		}elseif ($this->level() == self::level_2_complete_maintenance) {
160 160
 			//we also want to handle the opposite: if the site is mm2, but there aren't any migrations to run
161 161
 			//then we shouldn't be in mm2. (Maybe an addon got deactivated?)
162
-			update_option( self::option_name_maintenance_mode, self::level_0_not_in_maintenance );
162
+			update_option(self::option_name_maintenance_mode, self::level_0_not_in_maintenance);
163 163
 			return false;
164
-		}else{
164
+		} else {
165 165
 			return false;
166 166
 		}
167 167
 	}
@@ -171,8 +171,8 @@  discard block
 block discarded – undo
171 171
 	 * @param int $level
172 172
 	 * @return void
173 173
 	 */
174
-	public function set_maintenance_level($level){
175
-		do_action( 'AHEE__EE_Maintenance_Mode__set_maintenance_level', $level );
174
+	public function set_maintenance_level($level) {
175
+		do_action('AHEE__EE_Maintenance_Mode__set_maintenance_level', $level);
176 176
 		update_option(self::option_name_maintenance_mode, intval($level));
177 177
 	}
178 178
 
@@ -199,11 +199,11 @@  discard block
 block discarded – undo
199 199
 	 *  @return 	string
200 200
 	 */
201 201
 	public function load_assets_required_for_m_mode() {
202
-		if ( $this->real_level() == EE_Maintenance_Mode::level_2_complete_maintenance && ! wp_script_is( 'espresso_core', 'enqueued' )) {
203
-			wp_register_style( 'espresso_default', EE_GLOBAL_ASSETS_URL . 'css/espresso_default.css', array( 'dashicons' ), EVENT_ESPRESSO_VERSION );
202
+		if ($this->real_level() == EE_Maintenance_Mode::level_2_complete_maintenance && ! wp_script_is('espresso_core', 'enqueued')) {
203
+			wp_register_style('espresso_default', EE_GLOBAL_ASSETS_URL.'css/espresso_default.css', array('dashicons'), EVENT_ESPRESSO_VERSION);
204 204
 			wp_enqueue_style('espresso_default');
205
-			wp_register_script( 'espresso_core', EE_GLOBAL_ASSETS_URL . 'scripts/espresso_core.js', array('jquery'), EVENT_ESPRESSO_VERSION, TRUE );
206
-			wp_enqueue_script( 'espresso_core' );
205
+			wp_register_script('espresso_core', EE_GLOBAL_ASSETS_URL.'scripts/espresso_core.js', array('jquery'), EVENT_ESPRESSO_VERSION, TRUE);
206
+			wp_enqueue_script('espresso_core');
207 207
 		}
208 208
 	}
209 209
 
@@ -221,7 +221,7 @@  discard block
 block discarded – undo
221 221
 	 */
222 222
 	public static function template_include() {
223 223
 		// shut 'er down down for maintenance ? then don't use any of our templates for our endpoints
224
-		return get_template_directory() . '/index.php';
224
+		return get_template_directory().'/index.php';
225 225
 	}
226 226
 
227 227
 
@@ -235,12 +235,12 @@  discard block
 block discarded – undo
235 235
 	 * @param    string $the_content
236 236
 	 * @return    string
237 237
 	 */
238
-	public function the_content( $the_content ) {
238
+	public function the_content($the_content) {
239 239
 		// check if M-mode is engaged and for EE shortcode
240
-		if ( $this->level() && strpos( $the_content, '[ESPRESSO_' ) !== false ) {
240
+		if ($this->level() && strpos($the_content, '[ESPRESSO_') !== false) {
241 241
 			// this can eventually be moved to a template, or edited via admin. But for now...
242 242
 			$the_content = sprintf(
243
-				__( '%sMaintenance Mode%sEvent Registration has been temporarily closed while system maintenance is being performed. We\'re sorry for any inconveniences this may have caused. Please try back again later.%s', 'event_espresso' ),
243
+				__('%sMaintenance Mode%sEvent Registration has been temporarily closed while system maintenance is being performed. We\'re sorry for any inconveniences this may have caused. Please try back again later.%s', 'event_espresso'),
244 244
 				'<h3>',
245 245
 				'</h3><p>',
246 246
 				'</p>'
@@ -264,16 +264,16 @@  discard block
 block discarded – undo
264 264
 		// check if M-mode is engaged and for EE shortcode
265 265
 		if (
266 266
 			$this->real_level() &&
267
-			current_user_can( 'administrator' ) &&
267
+			current_user_can('administrator') &&
268 268
 			! is_admin() &&
269
-			! ( defined( 'DOING_AJAX' ) && DOING_AJAX )
269
+			! (defined('DOING_AJAX') && DOING_AJAX)
270 270
 			&& EE_Registry::instance()->REQ->is_espresso_page()
271 271
 		) {
272 272
 			printf(
273
-				__( '%sclose%sEvent Registration is currently disabled because Event Espresso has been placed into Maintenance Mode. To change Maintenance Mode settings, click here %sEE Maintenance Mode Admin Page%s', 'event_espresso' ),
273
+				__('%sclose%sEvent Registration is currently disabled because Event Espresso has been placed into Maintenance Mode. To change Maintenance Mode settings, click here %sEE Maintenance Mode Admin Page%s', 'event_espresso'),
274 274
 				'<div id="ee-m-mode-admin-notice-dv" class="ee-really-important-notice-dv"><a class="close-espresso-notice" title="',
275 275
 				'">&times;</a><p>',
276
-				' &raquo; <a href="' . add_query_arg( array( 'page' => 'espresso_maintenance_settings' ), admin_url( 'admin.php' )) . '">',
276
+				' &raquo; <a href="'.add_query_arg(array('page' => 'espresso_maintenance_settings'), admin_url('admin.php')).'">',
277 277
 				'</a></p></div>'
278 278
 			);
279 279
 		}
@@ -291,9 +291,9 @@  discard block
 block discarded – undo
291 291
 	 *		@ return void
292 292
 	 */
293 293
 	final function __destruct() {}
294
-	final function __call($a,$b) {}
294
+	final function __call($a, $b) {}
295 295
 	final function __get($a) {}
296
-	final function __set($a,$b) {}
296
+	final function __set($a, $b) {}
297 297
 	final function __isset($a) {}
298 298
 	final function __unset($a) {}
299 299
 	final function __sleep() {
@@ -304,7 +304,7 @@  discard block
 block discarded – undo
304 304
 	final function __invoke() {}
305 305
 	final function __set_state() {}
306 306
 	final function __clone() {}
307
-	final static function __callStatic($a,$b) {}
307
+	final static function __callStatic($a, $b) {}
308 308
 
309 309
 }
310 310
 // End of file EE_Maintenance_Mode.core.php
Please login to merge, or discard this patch.
core/EE_Session.core.php 3 patches
Doc Comments   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -336,7 +336,7 @@  discard block
 block discarded – undo
336 336
 	 /**
337 337
 	  * retrieve session data
338 338
 	  * @access    public
339
-	  * @param null $key
339
+	  * @param string|null $key
340 340
 	  * @param bool $reset_cache
341 341
 	  * @return    array
342 342
 	  */
@@ -360,7 +360,7 @@  discard block
 block discarded – undo
360 360
 	  * set session data
361 361
 	  * @access 	public
362 362
 	  * @param 	array $data
363
-	  * @return 	TRUE on success, FALSE on fail
363
+	  * @return 	boolean on success, FALSE on fail
364 364
 	  */
365 365
 	public function set_session_data( $data ) {
366 366
 
@@ -390,7 +390,7 @@  discard block
 block discarded – undo
390 390
 	 /**
391 391
 	  * @initiate session
392 392
 	  * @access   private
393
-	  * @return TRUE on success, FALSE on fail
393
+	  * @return boolean on success, FALSE on fail
394 394
 	  * @throws \EE_Error
395 395
 	  */
396 396
 	private function _espresso_session() {
@@ -521,7 +521,7 @@  discard block
 block discarded – undo
521 521
 	  * @update session data  prior to saving to the db
522 522
 	  * @access public
523 523
 	  * @param bool $new_session
524
-	  * @return TRUE on success, FALSE on fail
524
+	  * @return boolean on success, FALSE on fail
525 525
 	  */
526 526
 	public function update( $new_session = FALSE ) {
527 527
 		do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' );
@@ -791,7 +791,7 @@  discard block
 block discarded – undo
791 791
 	  * @access public
792 792
 	  * @param array $data_to_reset
793 793
 	  * @param bool  $show_all_notices
794
-	  * @return TRUE on success, FALSE on fail
794
+	  * @return boolean on success, FALSE on fail
795 795
 	  */
796 796
 	public function reset_data( $data_to_reset = array(), $show_all_notices = FALSE ) {
797 797
 		// if $data_to_reset is not in an array, then put it in one
Please login to merge, or discard this patch.
Braces   +4 added lines, -2 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
 do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' );/**
3 5
  *
4 6
  * Event Espresso
@@ -349,7 +351,7 @@  discard block
 block discarded – undo
349 351
 		do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' );
350 352
 		 if ( ! empty( $key ))  {
351 353
 			return  isset( $this->_session_data[ $key ] ) ? $this->_session_data[ $key ] : NULL;
352
-		}  else  {
354
+		} else  {
353 355
 			return $this->_session_data;
354 356
 		}
355 357
 	}
Please login to merge, or discard this patch.
Spacing   +150 added lines, -150 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@  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')) exit('No direct script access allowed');
2 2
 /**
3 3
  *
4 4
  * Event Espresso
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
 	  * array for defining default session vars
105 105
 	  * @var array
106 106
 	  */
107
-	 private $_default_session_vars = array (
107
+	 private $_default_session_vars = array(
108 108
 		'id' => NULL,
109 109
 		'user_id' => NULL,
110 110
 		'ip_address' => NULL,
@@ -127,12 +127,12 @@  discard block
 block discarded – undo
127 127
 	 * @param \EE_Encryption $encryption
128 128
 	 *	@return EE_Session
129 129
 	 */
130
-	public static function instance( EE_Encryption $encryption = null ) {
130
+	public static function instance(EE_Encryption $encryption = null) {
131 131
 		// check if class object is instantiated
132 132
 		// session loading is turned ON by default, but prior to the init hook, can be turned back OFF via:
133 133
 		// add_filter( 'FHEE_load_EE_Session', '__return_false' );
134
-		if ( ! self::$_instance instanceof EE_Session && apply_filters( 'FHEE_load_EE_Session', true ) ) {
135
-			self::$_instance = new self( $encryption );
134
+		if ( ! self::$_instance instanceof EE_Session && apply_filters('FHEE_load_EE_Session', true)) {
135
+			self::$_instance = new self($encryption);
136 136
 		}
137 137
 		return self::$_instance;
138 138
 	}
@@ -145,15 +145,15 @@  discard block
 block discarded – undo
145 145
 	  * @access protected
146 146
 	  * @param \EE_Encryption $encryption
147 147
 	  */
148
-	 protected function __construct( EE_Encryption $encryption = null ) {
148
+	 protected function __construct(EE_Encryption $encryption = null) {
149 149
 
150 150
 		// session loading is turned ON by default, but prior to the init hook, can be turned back OFF via: add_filter( 'FHEE_load_EE_Session', '__return_false' );
151
-		if ( ! apply_filters( 'FHEE_load_EE_Session', TRUE ) ) {
151
+		if ( ! apply_filters('FHEE_load_EE_Session', TRUE)) {
152 152
 			return NULL;
153 153
 		}
154
-		do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' );
155
-		if ( ! defined( 'ESPRESSO_SESSION' ) ) {
156
-			define( 'ESPRESSO_SESSION', true );
154
+		do_action('AHEE_log', __FILE__, __FUNCTION__, '');
155
+		if ( ! defined('ESPRESSO_SESSION')) {
156
+			define('ESPRESSO_SESSION', true);
157 157
 		}
158 158
 		// default session lifespan in seconds
159 159
 		$this->_lifespan = apply_filters(
@@ -167,35 +167,35 @@  discard block
 block discarded – undo
167 167
 		 * 		}
168 168
 		 */
169 169
 		// retrieve session options from db
170
-		$session_settings = get_option( 'ee_session_settings' );
171
-		if ( $session_settings !== FALSE ) {
170
+		$session_settings = get_option('ee_session_settings');
171
+		if ($session_settings !== FALSE) {
172 172
 			// cycle though existing session options
173
-			foreach ( $session_settings as $var_name => $session_setting ) {
173
+			foreach ($session_settings as $var_name => $session_setting) {
174 174
 				// set values for class properties
175
-				$var_name = '_' . $var_name;
175
+				$var_name = '_'.$var_name;
176 176
 				$this->{$var_name} = $session_setting;
177 177
 			}
178 178
 		}
179 179
 		// are we using encryption?
180
-		if ( $this->_use_encryption && $encryption instanceof EE_Encryption ) {
180
+		if ($this->_use_encryption && $encryption instanceof EE_Encryption) {
181 181
 			// encrypt data via: $this->encryption->encrypt();
182 182
 			$this->encryption = $encryption;
183 183
 		}
184 184
 		// filter hook allows outside functions/classes/plugins to change default empty cart
185
-		$extra_default_session_vars = apply_filters( 'FHEE__EE_Session__construct__extra_default_session_vars', array() );
186
-		array_merge( $this->_default_session_vars, $extra_default_session_vars );
185
+		$extra_default_session_vars = apply_filters('FHEE__EE_Session__construct__extra_default_session_vars', array());
186
+		array_merge($this->_default_session_vars, $extra_default_session_vars);
187 187
 		// apply default session vars
188 188
 		$this->_set_defaults();
189 189
 		// check for existing session and retrieve it from db
190
-		if ( ! $this->_espresso_session() ) {
190
+		if ( ! $this->_espresso_session()) {
191 191
 			// or just start a new one
192 192
 			$this->_create_espresso_session();
193 193
 		}
194 194
 		// check request for 'clear_session' param
195
-		add_action( 'AHEE__EE_Request_Handler__construct__complete', array( $this, 'wp_loaded' ));
195
+		add_action('AHEE__EE_Request_Handler__construct__complete', array($this, 'wp_loaded'));
196 196
 		// once everything is all said and done,
197
-		add_action( 'shutdown', array( $this, 'update' ), 100 );
198
-		add_action( 'shutdown', array( $this, 'garbage_collection' ), 999 );
197
+		add_action('shutdown', array($this, 'update'), 100);
198
+		add_action('shutdown', array($this, 'garbage_collection'), 999);
199 199
 
200 200
 	}
201 201
 
@@ -227,11 +227,11 @@  discard block
 block discarded – undo
227 227
 	 */
228 228
 	private function _set_defaults() {
229 229
 		// set some defaults
230
-		foreach ( $this->_default_session_vars as $key => $default_var ) {
231
-			if ( is_array( $default_var )) {
232
-				$this->_session_data[ $key ] = array();
230
+		foreach ($this->_default_session_vars as $key => $default_var) {
231
+			if (is_array($default_var)) {
232
+				$this->_session_data[$key] = array();
233 233
 			} else {
234
-				$this->_session_data[ $key ] = '';
234
+				$this->_session_data[$key] = '';
235 235
 			}
236 236
 		}
237 237
 	}
@@ -253,7 +253,7 @@  discard block
 block discarded – undo
253 253
 	  * @param \EE_Cart $cart
254 254
 	  * @return bool
255 255
 	  */
256
-	 public function set_cart( EE_Cart $cart ) {
256
+	 public function set_cart(EE_Cart $cart) {
257 257
 		 $this->_session_data['cart'] = $cart;
258 258
 		 return TRUE;
259 259
 	 }
@@ -273,7 +273,7 @@  discard block
 block discarded – undo
273 273
 	  * @return \EE_Cart
274 274
 	  */
275 275
 	 public function cart() {
276
-		 return isset( $this->_session_data['cart'] ) ? $this->_session_data['cart'] : NULL;
276
+		 return isset($this->_session_data['cart']) ? $this->_session_data['cart'] : NULL;
277 277
 	 }
278 278
 
279 279
 
@@ -282,7 +282,7 @@  discard block
 block discarded – undo
282 282
 	  * @param \EE_Checkout $checkout
283 283
 	  * @return bool
284 284
 	  */
285
-	 public function set_checkout( EE_Checkout $checkout ) {
285
+	 public function set_checkout(EE_Checkout $checkout) {
286 286
 		 $this->_session_data['checkout'] = $checkout;
287 287
 		 return TRUE;
288 288
 	 }
@@ -302,7 +302,7 @@  discard block
 block discarded – undo
302 302
 	  * @return \EE_Checkout
303 303
 	  */
304 304
 	 public function checkout() {
305
-		 return isset( $this->_session_data['checkout'] ) ? $this->_session_data['checkout'] : NULL;
305
+		 return isset($this->_session_data['checkout']) ? $this->_session_data['checkout'] : NULL;
306 306
 	 }
307 307
 
308 308
 
@@ -311,9 +311,9 @@  discard block
 block discarded – undo
311 311
 	  * @param \EE_Transaction $transaction
312 312
 	  * @return bool
313 313
 	  */
314
-	 public function set_transaction( EE_Transaction $transaction ) {
314
+	 public function set_transaction(EE_Transaction $transaction) {
315 315
 		 // first remove the session from the transaction before we save the transaction in the session
316
-		 $transaction->set_txn_session_data( NULL );
316
+		 $transaction->set_txn_session_data(NULL);
317 317
 		 $this->_session_data['transaction'] = $transaction;
318 318
 		 return TRUE;
319 319
 	 }
@@ -333,7 +333,7 @@  discard block
 block discarded – undo
333 333
 	  * @return \EE_Transaction
334 334
 	  */
335 335
 	 public function transaction() {
336
-		 return isset( $this->_session_data['transaction'] ) ? $this->_session_data['transaction'] : NULL;
336
+		 return isset($this->_session_data['transaction']) ? $this->_session_data['transaction'] : NULL;
337 337
 	 }
338 338
 
339 339
 
@@ -345,15 +345,15 @@  discard block
 block discarded – undo
345 345
 	  * @param bool $reset_cache
346 346
 	  * @return    array
347 347
 	  */
348
-	public function get_session_data( $key = NULL, $reset_cache = FALSE ) {
349
-		if ( $reset_cache ) {
348
+	public function get_session_data($key = NULL, $reset_cache = FALSE) {
349
+		if ($reset_cache) {
350 350
 			$this->reset_cart();
351 351
 			$this->reset_checkout();
352 352
 			$this->reset_transaction();
353 353
 		}
354
-		 if ( ! empty( $key ))  {
355
-			return  isset( $this->_session_data[ $key ] ) ? $this->_session_data[ $key ] : NULL;
356
-		}  else  {
354
+		 if ( ! empty($key)) {
355
+			return  isset($this->_session_data[$key]) ? $this->_session_data[$key] : NULL;
356
+		} else {
357 357
 			return $this->_session_data;
358 358
 		}
359 359
 	}
@@ -366,20 +366,20 @@  discard block
 block discarded – undo
366 366
 	  * @param 	array $data
367 367
 	  * @return 	TRUE on success, FALSE on fail
368 368
 	  */
369
-	public function set_session_data( $data ) {
369
+	public function set_session_data($data) {
370 370
 
371 371
 		// nothing ??? bad data ??? go home!
372
-		if ( empty( $data ) || ! is_array( $data )) {
373
-			EE_Error::add_error( __( 'No session data or invalid session data was provided.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__ );
372
+		if (empty($data) || ! is_array($data)) {
373
+			EE_Error::add_error(__('No session data or invalid session data was provided.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
374 374
 			return FALSE;
375 375
 		}
376 376
 
377
-		foreach ( $data as $key =>$value ) {
378
-			if ( isset( $this->_default_session_vars[ $key ] )) {
379
-				EE_Error::add_error( sprintf( __( 'Sorry! %s is a default session datum and can not be reset.', 'event_espresso' ), $key ), __FILE__, __FUNCTION__, __LINE__ );
377
+		foreach ($data as $key =>$value) {
378
+			if (isset($this->_default_session_vars[$key])) {
379
+				EE_Error::add_error(sprintf(__('Sorry! %s is a default session datum and can not be reset.', 'event_espresso'), $key), __FILE__, __FUNCTION__, __LINE__);
380 380
 				return FALSE;
381 381
 			} else {
382
-				$this->_session_data[ $key ] = $value;
382
+				$this->_session_data[$key] = $value;
383 383
 			}
384 384
 		}
385 385
 
@@ -396,9 +396,9 @@  discard block
 block discarded – undo
396 396
 	  * @throws \EE_Error
397 397
 	  */
398 398
 	private function _espresso_session() {
399
-		do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' );
399
+		do_action('AHEE_log', __FILE__, __FUNCTION__, '');
400 400
 		// check that session has started
401
-		if ( session_id() === '' ) {
401
+		if (session_id() === '') {
402 402
 			//starts a new session if one doesn't already exist, or re-initiates an existing one
403 403
 			session_start();
404 404
 		}
@@ -407,57 +407,57 @@  discard block
 block discarded – undo
407 407
 		// and the visitors IP
408 408
 		$this->_ip_address = $this->_visitor_ip();
409 409
 		// set the "user agent"
410
-		$this->_user_agent = ( isset($_SERVER['HTTP_USER_AGENT'])) ? esc_attr( $_SERVER['HTTP_USER_AGENT'] ) : FALSE;
410
+		$this->_user_agent = (isset($_SERVER['HTTP_USER_AGENT'])) ? esc_attr($_SERVER['HTTP_USER_AGENT']) : FALSE;
411 411
 		// now let's retrieve what's in the db
412 412
 		// we're using WP's Transient API to store session data using the PHP session ID as the option name
413
-		$session_data = get_transient( EE_Session::session_id_prefix . $this->_sid );
414
-		if ( $session_data ) {
415
-			if ( apply_filters( 'FHEE__EE_Session___perform_session_id_hash_check', WP_DEBUG ) ) {
416
-				$hash_check = get_transient( EE_Session::hash_check_prefix . $this->_sid );
417
-				if ( $hash_check && $hash_check !== md5( $session_data ) ) {
413
+		$session_data = get_transient(EE_Session::session_id_prefix.$this->_sid);
414
+		if ($session_data) {
415
+			if (apply_filters('FHEE__EE_Session___perform_session_id_hash_check', WP_DEBUG)) {
416
+				$hash_check = get_transient(EE_Session::hash_check_prefix.$this->_sid);
417
+				if ($hash_check && $hash_check !== md5($session_data)) {
418 418
 					EE_Error::add_error(
419 419
 						sprintf(
420
-							__( 'The stored data for session %1$s failed to pass a hash check and therefore appears to be invalid.', 'event_espresso' ),
421
-							EE_Session::session_id_prefix . $this->_sid
420
+							__('The stored data for session %1$s failed to pass a hash check and therefore appears to be invalid.', 'event_espresso'),
421
+							EE_Session::session_id_prefix.$this->_sid
422 422
 						),
423 423
 						__FILE__, __FUNCTION__, __LINE__
424 424
 					);
425 425
 				}
426 426
 			}
427 427
 			// un-encrypt the data
428
-			$session_data = $this->_use_encryption ? $this->encryption->decrypt( $session_data ) : $session_data;
428
+			$session_data = $this->_use_encryption ? $this->encryption->decrypt($session_data) : $session_data;
429 429
 			// unserialize
430
-			$session_data = maybe_unserialize( $session_data );
430
+			$session_data = maybe_unserialize($session_data);
431 431
 			// just a check to make sure the session array is indeed an array
432
-			if ( ! is_array( $session_data ) ) {
432
+			if ( ! is_array($session_data)) {
433 433
 				// no?!?! then something is wrong
434 434
 				return FALSE;
435 435
 			}
436 436
 			// get the current time in UTC
437
-			$this->_time = isset( $this->_time ) ? $this->_time : time();
437
+			$this->_time = isset($this->_time) ? $this->_time : time();
438 438
 			// and reset the session expiration
439
-			$this->_expiration = isset( $session_data['expiration'] ) ? $session_data['expiration'] : $this->_time + $this->_lifespan;
439
+			$this->_expiration = isset($session_data['expiration']) ? $session_data['expiration'] : $this->_time + $this->_lifespan;
440 440
 
441 441
 		} else {
442 442
 			// set initial site access time and the session expiration
443 443
 			$this->_set_init_access_and_expiration();
444 444
 			// set referer
445
-			$this->_session_data[ 'pages_visited' ][ $this->_session_data['init_access'] ] = isset( $_SERVER['HTTP_REFERER'] ) ? esc_attr( $_SERVER['HTTP_REFERER'] ) : '';
445
+			$this->_session_data['pages_visited'][$this->_session_data['init_access']] = isset($_SERVER['HTTP_REFERER']) ? esc_attr($_SERVER['HTTP_REFERER']) : '';
446 446
 			// no previous session = go back and create one (on top of the data above)
447 447
 			return FALSE;
448 448
 		}
449 449
 		// now the user agent
450
-		if ( $session_data['user_agent'] != $this->_user_agent ) {
450
+		if ($session_data['user_agent'] != $this->_user_agent) {
451 451
 			return FALSE;
452 452
 		}
453 453
 		// wait a minute... how old are you?
454
-		if ( $this->_time > $this->_expiration ) {
454
+		if ($this->_time > $this->_expiration) {
455 455
 			// yer too old fer me!
456 456
 			// wipe out everything that isn't a default session datum
457
-			$this->clear_session( __CLASS__, __FUNCTION__ );
457
+			$this->clear_session(__CLASS__, __FUNCTION__);
458 458
 		}
459 459
 		// make event espresso session data available to plugin
460
-		$this->_session_data = array_merge( $this->_session_data, $session_data );
460
+		$this->_session_data = array_merge($this->_session_data, $session_data);
461 461
 		return TRUE;
462 462
 
463 463
 	}
@@ -475,12 +475,12 @@  discard block
 block discarded – undo
475 475
 	  */
476 476
 	protected function _generate_session_id() {
477 477
 		// check if the SID was passed explicitly, otherwise get from session, then add salt and hash it to reduce length
478
-		if ( isset( $_REQUEST[ 'EESID' ] ) ) {
479
-			$session_id = sanitize_text_field( $_REQUEST[ 'EESID' ] );
478
+		if (isset($_REQUEST['EESID'])) {
479
+			$session_id = sanitize_text_field($_REQUEST['EESID']);
480 480
 		} else {
481
-			$session_id = md5( session_id() . get_current_blog_id() . $this->_get_sid_salt() );
481
+			$session_id = md5(session_id().get_current_blog_id().$this->_get_sid_salt());
482 482
 		}
483
-		return apply_filters( 'FHEE__EE_Session___generate_session_id__session_id', $session_id );
483
+		return apply_filters('FHEE__EE_Session___generate_session_id__session_id', $session_id);
484 484
 	}
485 485
 
486 486
 
@@ -492,20 +492,20 @@  discard block
 block discarded – undo
492 492
 	  */
493 493
 	protected function _get_sid_salt() {
494 494
 		// was session id salt already saved to db ?
495
-		if ( empty( $this->_sid_salt ) ) {
495
+		if (empty($this->_sid_salt)) {
496 496
 			// no?  then maybe use WP defined constant
497
-			if ( defined( 'AUTH_SALT' ) ) {
497
+			if (defined('AUTH_SALT')) {
498 498
 				$this->_sid_salt = AUTH_SALT;
499 499
 			}
500 500
 			// if salt doesn't exist or is too short
501
-			if ( empty( $this->_sid_salt ) || strlen( $this->_sid_salt ) < 32 ) {
501
+			if (empty($this->_sid_salt) || strlen($this->_sid_salt) < 32) {
502 502
 				// create a new one
503
-				$this->_sid_salt = wp_generate_password( 64 );
503
+				$this->_sid_salt = wp_generate_password(64);
504 504
 			}
505 505
 			// and save it as a permanent session setting
506
-			$session_settings = get_option( 'ee_session_settings' );
507
-			$session_settings[ 'sid_salt' ] = $this->_sid_salt;
508
-			update_option( 'ee_session_settings', $session_settings );
506
+			$session_settings = get_option('ee_session_settings');
507
+			$session_settings['sid_salt'] = $this->_sid_salt;
508
+			update_option('ee_session_settings', $session_settings);
509 509
 		}
510 510
 		return $this->_sid_salt;
511 511
 	}
@@ -533,19 +533,19 @@  discard block
 block discarded – undo
533 533
 	  * @param bool $new_session
534 534
 	  * @return TRUE on success, FALSE on fail
535 535
 	  */
536
-	public function update( $new_session = FALSE ) {
537
-		$this->_session_data = isset( $this->_session_data )
538
-			&& is_array( $this->_session_data )
539
-			&& isset( $this->_session_data['id'])
536
+	public function update($new_session = FALSE) {
537
+		$this->_session_data = isset($this->_session_data)
538
+			&& is_array($this->_session_data)
539
+			&& isset($this->_session_data['id'])
540 540
 			? $this->_session_data
541 541
 			: NULL;
542
-		if ( empty( $this->_session_data )) {
542
+		if (empty($this->_session_data)) {
543 543
 			$this->_set_defaults();
544 544
 		}
545 545
 		$session_data = array();
546
-		foreach ( $this->_session_data as $key => $value ) {
546
+		foreach ($this->_session_data as $key => $value) {
547 547
 
548
-			switch( $key ) {
548
+			switch ($key) {
549 549
 
550 550
 				case 'id' :
551 551
 					// session ID
@@ -563,7 +563,7 @@  discard block
 block discarded – undo
563 563
 				break;
564 564
 
565 565
 				case 'init_access' :
566
-					$session_data['init_access'] = absint( $value );
566
+					$session_data['init_access'] = absint($value);
567 567
 				break;
568 568
 
569 569
 				case 'last_access' :
@@ -573,7 +573,7 @@  discard block
 block discarded – undo
573 573
 
574 574
 				case 'expiration' :
575 575
 					// when the session expires
576
-					$session_data['expiration'] = ! empty( $this->_expiration )
576
+					$session_data['expiration'] = ! empty($this->_expiration)
577 577
 						? $this->_expiration
578 578
 						: $session_data['init_access'] + $this->_lifespan;
579 579
 				break;
@@ -585,11 +585,11 @@  discard block
 block discarded – undo
585 585
 
586 586
 				case 'pages_visited' :
587 587
 					$page_visit = $this->_get_page_visit();
588
-					if ( $page_visit ) {
588
+					if ($page_visit) {
589 589
 						// set pages visited where the first will be the http referrer
590
-						$this->_session_data[ 'pages_visited' ][ $this->_time ] = $page_visit;
590
+						$this->_session_data['pages_visited'][$this->_time] = $page_visit;
591 591
 						// we'll only save the last 10 page visits.
592
-						$session_data[ 'pages_visited' ] = array_slice( $this->_session_data['pages_visited'], -10 );
592
+						$session_data['pages_visited'] = array_slice($this->_session_data['pages_visited'], -10);
593 593
 					}
594 594
 				break;
595 595
 
@@ -603,9 +603,9 @@  discard block
 block discarded – undo
603 603
 
604 604
 		$this->_session_data = $session_data;
605 605
 		// creating a new session does not require saving to the db just yet
606
-		if ( ! $new_session ) {
606
+		if ( ! $new_session) {
607 607
 			// ready? let's save
608
-			if ( $this->_save_session_to_db() ) {
608
+			if ($this->_save_session_to_db()) {
609 609
 				return TRUE;
610 610
 			} else {
611 611
 				return FALSE;
@@ -626,9 +626,9 @@  discard block
 block discarded – undo
626 626
 	 * 	@return bool
627 627
 	 */
628 628
 	private function _create_espresso_session( ) {
629
-		do_action( 'AHEE_log', __CLASS__, __FUNCTION__, '' );
629
+		do_action('AHEE_log', __CLASS__, __FUNCTION__, '');
630 630
 		// use the update function for now with $new_session arg set to TRUE
631
-		return  $this->update( TRUE ) ? TRUE : FALSE;
631
+		return  $this->update(TRUE) ? TRUE : FALSE;
632 632
 	}
633 633
 
634 634
 
@@ -652,15 +652,15 @@  discard block
 block discarded – undo
652 652
 			return FALSE;
653 653
 		}
654 654
 		// first serialize all of our session data
655
-		$session_data = serialize( $this->_session_data );
655
+		$session_data = serialize($this->_session_data);
656 656
 		// encrypt it if we are using encryption
657
-		$session_data = $this->_use_encryption ? $this->encryption->encrypt( $session_data ) : $session_data;
657
+		$session_data = $this->_use_encryption ? $this->encryption->encrypt($session_data) : $session_data;
658 658
 		// maybe save hash check
659
-		if ( apply_filters( 'FHEE__EE_Session___perform_session_id_hash_check', WP_DEBUG ) ) {
660
-			set_transient( EE_Session::hash_check_prefix . $this->_sid, md5( $session_data ), $this->_lifespan );
659
+		if (apply_filters('FHEE__EE_Session___perform_session_id_hash_check', WP_DEBUG)) {
660
+			set_transient(EE_Session::hash_check_prefix.$this->_sid, md5($session_data), $this->_lifespan);
661 661
 		}
662 662
 		// we're using the Transient API for storing session data, cuz it's so damn simple -> set_transient(  transient ID, data, expiry )
663
-		return set_transient( EE_Session::session_id_prefix . $this->_sid, $session_data, $this->_lifespan );
663
+		return set_transient(EE_Session::session_id_prefix.$this->_sid, $session_data, $this->_lifespan);
664 664
 	}
665 665
 
666 666
 
@@ -686,10 +686,10 @@  discard block
 block discarded – undo
686 686
 			'HTTP_FORWARDED',
687 687
 			'REMOTE_ADDR'
688 688
 		);
689
-		foreach ( $server_keys as $key ){
690
-			if ( isset( $_SERVER[ $key ] )) {
691
-				foreach ( array_map( 'trim', explode( ',', $_SERVER[ $key ] )) as $ip ) {
692
-					if ( $ip === '127.0.0.1' || filter_var( $ip, FILTER_VALIDATE_IP ) !== FALSE ) {
689
+		foreach ($server_keys as $key) {
690
+			if (isset($_SERVER[$key])) {
691
+				foreach (array_map('trim', explode(',', $_SERVER[$key])) as $ip) {
692
+					if ($ip === '127.0.0.1' || filter_var($ip, FILTER_VALIDATE_IP) !== FALSE) {
693 693
 						$visitor_ip = $ip;
694 694
 					}
695 695
 				}
@@ -710,45 +710,45 @@  discard block
 block discarded – undo
710 710
 	public function _get_page_visit() {
711 711
 
712 712
 //		echo '<h3>'. __CLASS__ .'->'.__FUNCTION__.'  ( line no: ' . __LINE__ . ' )</h3>';
713
-		$page_visit = home_url('/') . 'wp-admin/admin-ajax.php';
713
+		$page_visit = home_url('/').'wp-admin/admin-ajax.php';
714 714
 
715 715
 		// check for request url
716
-		if ( isset( $_SERVER['REQUEST_URI'] )) {
716
+		if (isset($_SERVER['REQUEST_URI'])) {
717 717
 
718
-			$request_uri = esc_url( $_SERVER['REQUEST_URI'] );
718
+			$request_uri = esc_url($_SERVER['REQUEST_URI']);
719 719
 
720
-			$ru_bits = explode( '?', $request_uri );
720
+			$ru_bits = explode('?', $request_uri);
721 721
 			$request_uri = $ru_bits[0];
722 722
 			//echo '<h1>$request_uri   ' . $request_uri . '</h1>';
723 723
 
724 724
 			// check for and grab host as well
725
-			if ( isset( $_SERVER['HTTP_HOST'] )) {
726
-				$http_host = esc_url( $_SERVER['HTTP_HOST'] );
725
+			if (isset($_SERVER['HTTP_HOST'])) {
726
+				$http_host = esc_url($_SERVER['HTTP_HOST']);
727 727
 			} else {
728 728
 				$http_host = '';
729 729
 			}
730 730
 			//echo '<h1>$http_host   ' . $http_host . '</h1>';
731 731
 
732 732
 			// check for page_id in SERVER REQUEST
733
-			if ( isset( $_REQUEST['page_id'] )) {
733
+			if (isset($_REQUEST['page_id'])) {
734 734
 				// rebuild $e_reg without any of the extra parameters
735
-				$page_id = '?page_id=' . esc_attr( $_REQUEST['page_id'] ) . '&amp;';
735
+				$page_id = '?page_id='.esc_attr($_REQUEST['page_id']).'&amp;';
736 736
 			} else {
737 737
 				$page_id = '?';
738 738
 			}
739 739
 			// check for $e_reg in SERVER REQUEST
740
-			if ( isset( $_REQUEST['ee'] )) {
740
+			if (isset($_REQUEST['ee'])) {
741 741
 				// rebuild $e_reg without any of the extra parameters
742
-				$e_reg = 'ee=' . esc_attr( $_REQUEST['ee'] );
742
+				$e_reg = 'ee='.esc_attr($_REQUEST['ee']);
743 743
 			} else {
744 744
 				$e_reg = '';
745 745
 			}
746 746
 
747
-			$page_visit = rtrim( $http_host . $request_uri . $page_id . $e_reg, '?' );
747
+			$page_visit = rtrim($http_host.$request_uri.$page_id.$e_reg, '?');
748 748
 
749 749
 		}
750 750
 
751
-		return $page_visit != home_url( '/wp-admin/admin-ajax.php' ) ? $page_visit : '';
751
+		return $page_visit != home_url('/wp-admin/admin-ajax.php') ? $page_visit : '';
752 752
 
753 753
 	}
754 754
 
@@ -777,14 +777,14 @@  discard block
 block discarded – undo
777 777
 	  * @param string $function
778 778
 	  * @return void
779 779
 	  */
780
-	public function clear_session( $class = '', $function = '' ) {
780
+	public function clear_session($class = '', $function = '') {
781 781
 		//echo '<h3 style="color:#999;line-height:.9em;"><span style="color:#2EA2CC">' . __CLASS__ . '</span>::<span style="color:#E76700">' . __FUNCTION__ . '( ' . $class . '::' . $function . '() )</span><br/><span style="font-size:9px;font-weight:normal;">' . __FILE__ . '</span>    <b style="font-size:10px;">  ' . __LINE__ . ' </b></h3>';
782
-		do_action( 'AHEE_log', __FILE__, __FUNCTION__, 'session cleared by : ' . $class . '::' .  $function . '()' );
782
+		do_action('AHEE_log', __FILE__, __FUNCTION__, 'session cleared by : '.$class.'::'.$function.'()');
783 783
 		$this->reset_cart();
784 784
 		$this->reset_checkout();
785 785
 		$this->reset_transaction();
786 786
 		// wipe out everything that isn't a default session datum
787
-		$this->reset_data( array_keys( $this->_session_data ));
787
+		$this->reset_data(array_keys($this->_session_data));
788 788
 		// reset initial site access time and the session expiration
789 789
 		$this->_set_init_access_and_expiration();
790 790
 		$this->_save_session_to_db();
@@ -799,42 +799,42 @@  discard block
 block discarded – undo
799 799
 	  * @param bool  $show_all_notices
800 800
 	  * @return TRUE on success, FALSE on fail
801 801
 	  */
802
-	public function reset_data( $data_to_reset = array(), $show_all_notices = FALSE ) {
802
+	public function reset_data($data_to_reset = array(), $show_all_notices = FALSE) {
803 803
 		// if $data_to_reset is not in an array, then put it in one
804
-		if ( ! is_array( $data_to_reset ) ) {
805
-			$data_to_reset = array ( $data_to_reset );
804
+		if ( ! is_array($data_to_reset)) {
805
+			$data_to_reset = array($data_to_reset);
806 806
 		}
807 807
 		// nothing ??? go home!
808
-		if ( empty( $data_to_reset )) {
809
-			EE_Error::add_error( __( 'No session data could be reset, because no session var name was provided.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__ );
808
+		if (empty($data_to_reset)) {
809
+			EE_Error::add_error(__('No session data could be reset, because no session var name was provided.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
810 810
 			return FALSE;
811 811
 		}
812 812
 		$return_value = TRUE;
813 813
 		// since $data_to_reset is an array, cycle through the values
814
-		foreach ( $data_to_reset as $reset ) {
814
+		foreach ($data_to_reset as $reset) {
815 815
 
816 816
 			// first check to make sure it is a valid session var
817
-			if ( isset( $this->_session_data[ $reset ] )) {
817
+			if (isset($this->_session_data[$reset])) {
818 818
 				// then check to make sure it is not a default var
819
-				if ( ! array_key_exists( $reset, $this->_default_session_vars )) {
819
+				if ( ! array_key_exists($reset, $this->_default_session_vars)) {
820 820
 					// remove session var
821
-					unset( $this->_session_data[ $reset ] );
822
-					if ( $show_all_notices ) {
823
-						EE_Error::add_success( sprintf( __( 'The session variable %s was removed.', 'event_espresso' ), $reset ), __FILE__, __FUNCTION__, __LINE__ );
821
+					unset($this->_session_data[$reset]);
822
+					if ($show_all_notices) {
823
+						EE_Error::add_success(sprintf(__('The session variable %s was removed.', 'event_espresso'), $reset), __FILE__, __FUNCTION__, __LINE__);
824 824
 					}
825
-					$return_value = !isset($return_value) ? TRUE : $return_value;
825
+					$return_value = ! isset($return_value) ? TRUE : $return_value;
826 826
 
827 827
 				} else {
828 828
 					// yeeeeeeeeerrrrrrrrrrr OUT !!!!
829
-					if ( $show_all_notices ) {
830
-						EE_Error::add_error( sprintf( __( 'Sorry! %s is a default session datum and can not be reset.', 'event_espresso' ), $reset ), __FILE__, __FUNCTION__, __LINE__ );
829
+					if ($show_all_notices) {
830
+						EE_Error::add_error(sprintf(__('Sorry! %s is a default session datum and can not be reset.', 'event_espresso'), $reset), __FILE__, __FUNCTION__, __LINE__);
831 831
 					}
832 832
 					$return_value = FALSE;
833 833
 				}
834 834
 
835
-			} else if ( $show_all_notices ) {
835
+			} else if ($show_all_notices) {
836 836
 				// oops! that session var does not exist!
837
-				EE_Error::add_error( sprintf( __( 'The session item provided, %s, is invalid or does not exist.', 'event_espresso' ), $reset ), __FILE__, __FUNCTION__, __LINE__ );
837
+				EE_Error::add_error(sprintf(__('The session item provided, %s, is invalid or does not exist.', 'event_espresso'), $reset), __FILE__, __FUNCTION__, __LINE__);
838 838
 				$return_value = FALSE;
839 839
 			}
840 840
 
@@ -855,8 +855,8 @@  discard block
 block discarded – undo
855 855
 	 *   @return	 string
856 856
 	 */
857 857
 	public function wp_loaded() {
858
-		if ( isset(  EE_Registry::instance()->REQ ) && EE_Registry::instance()->REQ->is_set( 'clear_session' )) {
859
-			$this->clear_session( __CLASS__, __FUNCTION__ );
858
+		if (isset(EE_Registry::instance()->REQ) && EE_Registry::instance()->REQ->is_set('clear_session')) {
859
+			$this->clear_session(__CLASS__, __FUNCTION__);
860 860
 		}
861 861
 	}
862 862
 
@@ -881,24 +881,24 @@  discard block
 block discarded – undo
881 881
 	  */
882 882
 	 public function garbage_collection() {
883 883
 		 // only perform during regular requests
884
-		 if ( ! defined( 'DOING_AJAX') || ! DOING_AJAX ) {
884
+		 if ( ! defined('DOING_AJAX') || ! DOING_AJAX) {
885 885
 			 /** @type WPDB $wpdb */
886 886
 			 global $wpdb;
887 887
 			 // since transient expiration timestamps are set in the future, we can compare against NOW
888 888
 			 $expiration = time();
889
-			 $too_far_in_the_the_future = $expiration + ( $this->_lifespan * 2 );
889
+			 $too_far_in_the_the_future = $expiration + ($this->_lifespan * 2);
890 890
 			 // filter the query limit. Set to 0 to turn off garbage collection
891
-			 $expired_session_transient_delete_query_limit = absint( apply_filters( 'FHEE__EE_Session__garbage_collection___expired_session_transient_delete_query_limit', 50 ));
891
+			 $expired_session_transient_delete_query_limit = absint(apply_filters('FHEE__EE_Session__garbage_collection___expired_session_transient_delete_query_limit', 50));
892 892
 			 // non-zero LIMIT means take out the trash
893
-			 if ( $expired_session_transient_delete_query_limit ) {
893
+			 if ($expired_session_transient_delete_query_limit) {
894 894
 				 //array of transient keys that require garbage collection
895 895
 				 $session_keys = array(
896 896
 					 EE_Session::session_id_prefix,
897 897
 					 EE_Session::hash_check_prefix,
898 898
 				 );
899
-				 foreach ( $session_keys as $session_key ) {
900
-					 $session_key = str_replace( '_', '\_', $session_key );
901
-					 $session_key = '\_transient\_timeout\_' . $session_key . '%';
899
+				 foreach ($session_keys as $session_key) {
900
+					 $session_key = str_replace('_', '\_', $session_key);
901
+					 $session_key = '\_transient\_timeout\_'.$session_key.'%';
902 902
 					 $SQL = "
903 903
 					SELECT option_name
904 904
 					FROM {$wpdb->options}
@@ -908,28 +908,28 @@  discard block
 block discarded – undo
908 908
 					OR option_value > {$too_far_in_the_the_future} )
909 909
 					LIMIT {$expired_session_transient_delete_query_limit}
910 910
 				";
911
-					 $expired_sessions = $wpdb->get_col( $SQL );
911
+					 $expired_sessions = $wpdb->get_col($SQL);
912 912
 					 // valid results?
913
-					 if ( ! $expired_sessions instanceof WP_Error && ! empty( $expired_sessions ) ) {
913
+					 if ( ! $expired_sessions instanceof WP_Error && ! empty($expired_sessions)) {
914 914
 						 // format array of results into something usable within the actual DELETE query's IN clause
915 915
 						 $expired = array();
916
-						 foreach ( $expired_sessions as $expired_session ) {
917
-							 $expired[ ] = "'" . $expired_session . "'";
918
-							 $expired[ ] = "'" . str_replace( 'timeout_', '', $expired_session ) . "'";
916
+						 foreach ($expired_sessions as $expired_session) {
917
+							 $expired[] = "'".$expired_session."'";
918
+							 $expired[] = "'".str_replace('timeout_', '', $expired_session)."'";
919 919
 						 }
920
-						 $expired = implode( ', ', $expired );
920
+						 $expired = implode(', ', $expired);
921 921
 						 $SQL = "
922 922
 						DELETE FROM {$wpdb->options}
923 923
 						WHERE option_name
924 924
 						IN ( $expired );
925 925
 					 ";
926
-						 $results = $wpdb->query( $SQL );
926
+						 $results = $wpdb->query($SQL);
927 927
 						 // if something went wrong, then notify the admin
928
-						 if ( $results instanceof WP_Error && is_admin() ) {
929
-							 EE_Error::add_error( $results->get_error_message(), __FILE__, __FUNCTION__, __LINE__ );
928
+						 if ($results instanceof WP_Error && is_admin()) {
929
+							 EE_Error::add_error($results->get_error_message(), __FILE__, __FUNCTION__, __LINE__);
930 930
 						 }
931 931
 					 }
932
-					 do_action( 'FHEE__EE_Session__garbage_collection___end', $expired_session_transient_delete_query_limit );
932
+					 do_action('FHEE__EE_Session__garbage_collection___end', $expired_session_transient_delete_query_limit);
933 933
 				 }
934 934
 			 }
935 935
 		 }
Please login to merge, or discard this patch.
core/helpers/EEH_Form_Fields.helper.php 4 patches
Doc Comments   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -774,7 +774,7 @@  discard block
 block discarded – undo
774 774
 	 *
775 775
 	 * @param mixed $opt_group
776 776
 	 * @param mixed $QSOs
777
-	 * @param mixed $answer
777
+	 * @param string $answer
778 778
 	 * @return string
779 779
 	 */
780 780
 	private static function _generate_select_option_group( $opt_group, $QSOs, $answer ){
@@ -1122,7 +1122,7 @@  discard block
 block discarded – undo
1122 1122
 	/**
1123 1123
 	 * 	prep_required
1124 1124
 	 * @param string|array 	$required
1125
-	 * @return array
1125
+	 * @return string
1126 1126
 	 */
1127 1127
 	static function prep_required( $required = array() ){
1128 1128
 		// make sure required is an array
@@ -1173,8 +1173,8 @@  discard block
 block discarded – undo
1173 1173
 
1174 1174
 	/**
1175 1175
 	 * 	_load_system_dropdowns
1176
-	 * @param array 	$QFI
1177
-	 * @return array
1176
+	 * @param EE_Question_Form_Input 	$QFI
1177
+	 * @return EE_Question_Form_Input
1178 1178
 	 */
1179 1179
 	private static function _load_system_dropdowns( $QFI ){
1180 1180
 		$QST_system = $QFI->get('QST_system');
@@ -1463,7 +1463,7 @@  discard block
 block discarded – undo
1463 1463
 	 * @param    string   $nonce_action     - if using nonces
1464 1464
 	 * @param    bool|string $input_only       - whether to print form header and footer. TRUE returns the input without the form
1465 1465
 	 * @param    string   $extra_attributes - any extra attributes that need to be attached to the form input
1466
-	 * @return    void
1466
+	 * @return    string
1467 1467
 	 */
1468 1468
 	public static function submit_button( $url = '', $ID = '', $class = '', $text = '', $nonce_action = '', $input_only = FALSE, $extra_attributes = '' ) {
1469 1469
 		$btn = '';
Please login to merge, or discard this patch.
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -393,7 +393,7 @@  discard block
 block discarded – undo
393 393
 
394 394
 	/**
395 395
 	 * generate_question_groups_html
396
- 	 *
396
+	 *
397 397
 	 * @param string $question_groups
398 398
 	 * @return string HTML
399 399
 	 */
@@ -537,7 +537,7 @@  discard block
 block discarded – undo
537 537
 
538 538
 	/**
539 539
 	 * generate_form_input
540
- 	 *
540
+	 *
541 541
 	 * @param EE_Question_Form_Input $QFI
542 542
 	 * @return string HTML
543 543
 	 */
@@ -612,7 +612,7 @@  discard block
 block discarded – undo
612 612
 
613 613
 	/**
614 614
 	 * generates HTML for a form text input
615
- 	 *
615
+	 *
616 616
 	 * @param string $question 	label content
617 617
 	 * @param string $answer 		form input value attribute
618 618
 	 * @param string $name 			form input name attribute
@@ -657,7 +657,7 @@  discard block
 block discarded – undo
657 657
 
658 658
 	/**
659 659
 	 * generates HTML for a form textarea
660
- 	 *
660
+	 *
661 661
 	 * @param string $question 		label content
662 662
 	 * @param string $answer 		form input value attribute
663 663
 	 * @param string $name 			form input name attribute
@@ -708,7 +708,7 @@  discard block
 block discarded – undo
708 708
 
709 709
 	/**
710 710
 	 * generates HTML for a form select input
711
- 	 *
711
+	 *
712 712
 	 * @param string $question 		label content
713 713
 	 * @param string $answer 		form input value attribute
714 714
 	 * @param array $options			array of answer options where array key = option value and array value = option display text
@@ -885,7 +885,7 @@  discard block
 block discarded – undo
885 885
 
886 886
 	/**
887 887
 	 * generates HTML for form checkbox inputs
888
- 	 *
888
+	 *
889 889
 	 * @param string $question 		label content
890 890
 	 * @param string $answer 		form input value attribute
891 891
 	 * @param array $options 			array of options where array key = option value and array value = option display text
@@ -966,7 +966,7 @@  discard block
 block discarded – undo
966 966
 
967 967
 	/**
968 968
 	 * generates HTML for a form datepicker input
969
- 	 *
969
+	 *
970 970
 	 * @param string $question 	label content
971 971
 	 * @param string $answer 		form input value attribute
972 972
 	 * @param string $name 			form input name attribute
Please login to merge, or discard this patch.
Braces   +9 added lines, -6 removed lines patch added patch discarded remove patch
@@ -366,14 +366,16 @@  discard block
 block discarded – undo
366 366
 		$field = '<select id="' . EEH_Formatter::ee_tep_output_string($name) . '" name="' . EEH_Formatter::ee_tep_output_string($name) . '"';
367 367
 		//Debug
368 368
 		//EEH_Debug_Tools::printr( $values, '$values  <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span>', 'auto' );
369
-		if ( EEH_Formatter::ee_tep_not_null($parameters))
370
-			$field .= ' ' . $parameters;
369
+		if ( EEH_Formatter::ee_tep_not_null($parameters)) {
370
+					$field .= ' ' . $parameters;
371
+		}
371 372
 		if ($autosize) {
372 373
 			$size = 'med';
373 374
 			for ($ii = 0, $ni = sizeof($values); $ii < $ni; $ii++) {
374 375
 				if ($values[$ii]['text']) {
375
-					if (strlen($values[$ii]['text']) > 5)
376
-						$size = 'wide';
376
+					if (strlen($values[$ii]['text']) > 5) {
377
+											$size = 'wide';
378
+					}
377 379
 				}
378 380
 			}
379 381
 		} else {
@@ -382,8 +384,9 @@  discard block
 block discarded – undo
382 384
 
383 385
 		$field .= ' class="' . $class . ' ' . $size . '">';
384 386
 
385
-		if (empty($default) && isset($GLOBALS[$name]))
386
-			$default = stripslashes($GLOBALS[$name]);
387
+		if (empty($default) && isset($GLOBALS[$name])) {
388
+					$default = stripslashes($GLOBALS[$name]);
389
+		}
387 390
 
388 391
 
389 392
 		for ($i = 0, $n = sizeof($values); $i < $n; $i++) {
Please login to merge, or discard this patch.
Spacing   +378 added lines, -378 removed lines patch added patch discarded remove patch
@@ -69,10 +69,10 @@  discard block
 block discarded – undo
69 69
 	 * 	@return string
70 70
 	 * 	@todo: at some point we can break this down into other static methods to abstract it a bit better.
71 71
 	 */
72
-	static public function get_form_fields( $input_vars = array(), $id = FALSE ) {
72
+	static public function get_form_fields($input_vars = array(), $id = FALSE) {
73 73
 		
74
-		if ( empty($input_vars) ) {
75
-			EE_Error::add_error( __('missing required variables for the form field generator', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
74
+		if (empty($input_vars)) {
75
+			EE_Error::add_error(__('missing required variables for the form field generator', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
76 76
 			return FALSE;
77 77
 		}
78 78
 
@@ -98,25 +98,25 @@  discard block
 block discarded – undo
98 98
 				'append_content' => ''
99 99
 				);
100 100
 
101
-			$input_value = wp_parse_args( $input_value, $defaults );
101
+			$input_value = wp_parse_args($input_value, $defaults);
102 102
 
103 103
 			// required fields get a *
104 104
 			$required = isset($input_value['required']) && $input_value['required'] ? ' <span>*</span>: ' : ': ';
105 105
 			// and the css class "required"
106
-			$css_class = isset( $input_value['css_class'] ) ? $input_value['css_class'] : '';
107
-			$styles = $input_value['required'] ? 'required ' . $css_class : $css_class;
106
+			$css_class = isset($input_value['css_class']) ? $input_value['css_class'] : '';
107
+			$styles = $input_value['required'] ? 'required '.$css_class : $css_class;
108 108
 
109
-			$field_id = ($id) ? $id . '-' . $input_key : $input_key;
110
-			$tabindex = !empty($input_value['tabindex']) ? ' tabindex="' . $input_value['tabindex'] . '"' : '';
109
+			$field_id = ($id) ? $id.'-'.$input_key : $input_key;
110
+			$tabindex = ! empty($input_value['tabindex']) ? ' tabindex="'.$input_value['tabindex'].'"' : '';
111 111
 
112 112
 			//rows or cols?
113
-			$rows = isset($input_value['rows'] ) ? $input_value['rows'] : '10';
114
-			$cols = isset($input_value['cols'] ) ? $input_value['cols'] : '80';
113
+			$rows = isset($input_value['rows']) ? $input_value['rows'] : '10';
114
+			$cols = isset($input_value['cols']) ? $input_value['cols'] : '80';
115 115
 
116 116
 			//any content?
117 117
 			$append_content = $input_value['append_content'];
118 118
 
119
-			$output .= (!$close) ? '<ul>' : '';
119
+			$output .= ( ! $close) ? '<ul>' : '';
120 120
 			$output .= '<li>';
121 121
 
122 122
 			// what type of input are we dealing with ?
@@ -124,15 +124,15 @@  discard block
 block discarded – undo
124 124
 
125 125
 				// text inputs
126 126
 				case 'text' :
127
-					$output .= "\n\t\t\t" . '<label for="' . $field_id . '">' . $input_value['label'] . $required . '</label>';
128
-					$output .= "\n\t\t\t" . '<input id="' . $field_id . '" class="' . $styles . '" type="text" value="' . $input_value['value'] . '" name="' . $input_value['name'] . '"' . $tabindex . '>';
127
+					$output .= "\n\t\t\t".'<label for="'.$field_id.'">'.$input_value['label'].$required.'</label>';
128
+					$output .= "\n\t\t\t".'<input id="'.$field_id.'" class="'.$styles.'" type="text" value="'.$input_value['value'].'" name="'.$input_value['name'].'"'.$tabindex.'>';
129 129
 					break;
130 130
 
131 131
 				// dropdowns
132 132
 				case 'select' :
133 133
 
134
-					$output .= "\n\t\t\t" . '<label for="' . $field_id . '">' . $input_value['label'] . $required . '</label>';
135
-					$output .= "\n\t\t\t" . '<select id="' . $field_id . '" class="' . $styles . '" name="' . $input_value['name'] . '"' . $tabindex . '>';
134
+					$output .= "\n\t\t\t".'<label for="'.$field_id.'">'.$input_value['label'].$required.'</label>';
135
+					$output .= "\n\t\t\t".'<select id="'.$field_id.'" class="'.$styles.'" name="'.$input_value['name'].'"'.$tabindex.'>';
136 136
 
137 137
 					if (is_array($input_value['options'])) {
138 138
 						$options = $input_value['options'];
@@ -141,30 +141,30 @@  discard block
 block discarded – undo
141 141
 					}
142 142
 
143 143
 					foreach ($options as $key => $value) {
144
-						$selected = isset( $input_value['value'] ) && $input_value['value'] == $key ? 'selected=selected' : '';
144
+						$selected = isset($input_value['value']) && $input_value['value'] == $key ? 'selected=selected' : '';
145 145
 						//$key = str_replace( ' ', '_', sanitize_key( $value ));
146
-						$output .= "\n\t\t\t\t" . '<option '. $selected . ' value="' . $key . '">' . $value . '</option>';
146
+						$output .= "\n\t\t\t\t".'<option '.$selected.' value="'.$key.'">'.$value.'</option>';
147 147
 					}
148
-					$output .= "\n\t\t\t" . '</select>';
148
+					$output .= "\n\t\t\t".'</select>';
149 149
 
150 150
 					break;
151 151
 
152 152
 				case 'textarea' :
153 153
 
154
-					$output .= "\n\t\t\t" . '<label for="' . $field_id . '">' . $input_value['label'] . $required . '</label>';
155
-					$output .= "\n\t\t\t" . '<textarea id="' . $field_id . '" class="' . $styles . '" rows="'.$rows.'" cols="'.$cols.'" name="' . $input_value['name'] . '"' . $tabindex . '>' . $input_value['value'] . '</textarea>';
154
+					$output .= "\n\t\t\t".'<label for="'.$field_id.'">'.$input_value['label'].$required.'</label>';
155
+					$output .= "\n\t\t\t".'<textarea id="'.$field_id.'" class="'.$styles.'" rows="'.$rows.'" cols="'.$cols.'" name="'.$input_value['name'].'"'.$tabindex.'>'.$input_value['value'].'</textarea>';
156 156
 					break;
157 157
 
158 158
 				case 'hidden' :
159 159
 					$close = false;
160 160
 					$output .= "</li></ul>";
161
-					$output .= "\n\t\t\t" . '<input id="' . $field_id . '" type="hidden" name="' . $input_value['name'] . '" value="' . $input_value['value'] . '">';
161
+					$output .= "\n\t\t\t".'<input id="'.$field_id.'" type="hidden" name="'.$input_value['name'].'" value="'.$input_value['value'].'">';
162 162
 					break;
163 163
 
164 164
 				case 'checkbox' :
165
-					$checked = ( $input_value['value'] == 1 ) ? 'checked="checked"' : '';
166
-					$output .= "\n\t\t\t" . '<label for="' . $field_id . '">' . $input_value['label'] . $required . '</label>';
167
-					$output .= "\n\t\t\t" . '<input id="' . $field_id. '" type="checkbox" name="' . $input_value['name'] . '" value="1"' . $checked . $tabindex . ' />';
165
+					$checked = ($input_value['value'] == 1) ? 'checked="checked"' : '';
166
+					$output .= "\n\t\t\t".'<label for="'.$field_id.'">'.$input_value['label'].$required.'</label>';
167
+					$output .= "\n\t\t\t".'<input id="'.$field_id.'" type="checkbox" name="'.$input_value['name'].'" value="1"'.$checked.$tabindex.' />';
168 168
 					break;
169 169
 
170 170
 				case 'wp_editor' :
@@ -177,19 +177,19 @@  discard block
 block discarded – undo
177 177
 					);
178 178
 					$output .= '</li>';
179 179
 					$output .= '</ul>';
180
-					$output .= '<h4>' . $input_value['label'] . '</h4>';
181
-					if ( $append_content ) {
180
+					$output .= '<h4>'.$input_value['label'].'</h4>';
181
+					if ($append_content) {
182 182
 						$output .= $append_content;
183 183
 					}
184 184
 					ob_start();
185
-					wp_editor( $input_value['value'], $field_id, $editor_settings);
185
+					wp_editor($input_value['value'], $field_id, $editor_settings);
186 186
 					$editor = ob_get_contents();
187 187
 					ob_end_clean();
188 188
 					$output .= $editor;
189 189
 					break;
190 190
 
191 191
 				}
192
-				if ( $append_content && $input_value['input'] !== 'wp_editor' ) {
192
+				if ($append_content && $input_value['input'] !== 'wp_editor') {
193 193
 					$output .= $append_content;
194 194
 				}
195 195
 				$output .= ($close) ? '</li>' : '';
@@ -230,7 +230,7 @@  discard block
 block discarded – undo
230 230
 		$form_fields = array();
231 231
 		$fields = (array) $fields;
232 232
 
233
-		foreach ( $fields as $field_name => $field_atts ) {
233
+		foreach ($fields as $field_name => $field_atts) {
234 234
 			//defaults:
235 235
 			$defaults = array(
236 236
 				'label' => '',
@@ -248,67 +248,67 @@  discard block
 block discarded – undo
248 248
 				'wpeditor_args' => array()
249 249
 				);
250 250
 			// merge defaults with passed arguments
251
-			$_fields = wp_parse_args( $field_atts, $defaults);
252
-			extract( $_fields );
251
+			$_fields = wp_parse_args($field_atts, $defaults);
252
+			extract($_fields);
253 253
 			// generate label
254
-			$label = empty($label) ? '' : '<label for="' . $id . '">' . $label . '</label>';
254
+			$label = empty($label) ? '' : '<label for="'.$id.'">'.$label.'</label>';
255 255
 			// generate field name
256
-			$f_name = !empty($unique_id) ? $field_name . '[' . $unique_id . ']' : $field_name;
256
+			$f_name = ! empty($unique_id) ? $field_name.'['.$unique_id.']' : $field_name;
257 257
 
258 258
 			//tabindex
259
-			$tabindex_str = !empty( $tabindex ) ? ' tabindex="' . $tabindex . '"' : '';
259
+			$tabindex_str = ! empty($tabindex) ? ' tabindex="'.$tabindex.'"' : '';
260 260
 
261 261
 			//we determine what we're building based on the type
262
-			switch ( $type ) {
262
+			switch ($type) {
263 263
 
264 264
 				case 'textarea' :
265
-						$fld = '<textarea id="' . $id . '" class="' . $class . '" rows="' . $dimensions[1] . '" cols="' . $dimensions[0] . '" name="' . $f_name . '"' . $tabindex_str . '>' . $value . '</textarea>';
265
+						$fld = '<textarea id="'.$id.'" class="'.$class.'" rows="'.$dimensions[1].'" cols="'.$dimensions[0].'" name="'.$f_name.'"'.$tabindex_str.'>'.$value.'</textarea>';
266 266
 						$fld .= $extra_desc;
267 267
 					break;
268 268
 
269 269
 				case 'checkbox' :
270 270
 						$c_input = '';
271
-						if ( is_array($value) ) {
272
-							foreach ( $value as $key => $val ) {
273
-								$c_id = $field_name . '_' . $value;
274
-								$c_class = isset($classes[$key]) ? ' class="' . $classes[$key] . '" ' : '';
275
-								$c_label = isset($labels[$key]) ? '<label for="' . $c_id . '">' . $labels[$key] . '</label>' : '';
276
-								$checked = !empty($default) && $default == $val ? ' checked="checked" ' : '';
277
-								$c_input .= '<input name="' . $f_name . '[]" type="checkbox" id="' . $c_id . '"' . $c_class . 'value="' . $val . '"' . $checked . $tabindex_str . ' />' . "\n" . $c_label;
271
+						if (is_array($value)) {
272
+							foreach ($value as $key => $val) {
273
+								$c_id = $field_name.'_'.$value;
274
+								$c_class = isset($classes[$key]) ? ' class="'.$classes[$key].'" ' : '';
275
+								$c_label = isset($labels[$key]) ? '<label for="'.$c_id.'">'.$labels[$key].'</label>' : '';
276
+								$checked = ! empty($default) && $default == $val ? ' checked="checked" ' : '';
277
+								$c_input .= '<input name="'.$f_name.'[]" type="checkbox" id="'.$c_id.'"'.$c_class.'value="'.$val.'"'.$checked.$tabindex_str.' />'."\n".$c_label;
278 278
 							}
279 279
 							$fld = $c_input;
280 280
 						} else {
281
-							$checked = !empty($default) && $default == $val ? 'checked="checked" ' : '';
282
-							$fld = '<input name="'. $f_name . '" type="checkbox" id="' . $id . '" class="' . $class . '" value="' . $value . '"' . $checked . $tabindex_str . ' />' . "\n";
281
+							$checked = ! empty($default) && $default == $val ? 'checked="checked" ' : '';
282
+							$fld = '<input name="'.$f_name.'" type="checkbox" id="'.$id.'" class="'.$class.'" value="'.$value.'"'.$checked.$tabindex_str.' />'."\n";
283 283
 						}
284 284
 					break;
285 285
 
286 286
 				case 'radio' :
287 287
 						$c_input = '';
288
-						if ( is_array($value) ) {
289
-							foreach ( $value as $key => $val ) {
290
-								$c_id = $field_name . '_' . $value;
291
-								$c_class = isset($classes[$key]) ? 'class="' . $classes[$key] . '" ' : '';
292
-								$c_label = isset($labels[$key]) ? '<label for="' . $c_id . '">' . $labels[$key] . '</label>' : '';
293
-								$checked = !empty($default) && $default == $val ? ' checked="checked" ' : '';
294
-								$c_input .= '<input name="' . $f_name . '" type="checkbox" id="' . $c_id . '"' . $c_class . 'value="' . $val . '"' . $checked . $tabindex_str . ' />' . "\n" . $c_label;
288
+						if (is_array($value)) {
289
+							foreach ($value as $key => $val) {
290
+								$c_id = $field_name.'_'.$value;
291
+								$c_class = isset($classes[$key]) ? 'class="'.$classes[$key].'" ' : '';
292
+								$c_label = isset($labels[$key]) ? '<label for="'.$c_id.'">'.$labels[$key].'</label>' : '';
293
+								$checked = ! empty($default) && $default == $val ? ' checked="checked" ' : '';
294
+								$c_input .= '<input name="'.$f_name.'" type="checkbox" id="'.$c_id.'"'.$c_class.'value="'.$val.'"'.$checked.$tabindex_str.' />'."\n".$c_label;
295 295
 							}
296 296
 							$fld = $c_input;
297 297
 						} else {
298
-							$checked = !empty($default) && $default == $val ? 'checked="checked" ' : '';
299
-							$fld = '<input name="'. $f_name . '" type="checkbox" id="' . $id . '" class="' . $class . '" value="' . $value . '"' . $checked . $tabindex_str . ' />' . "\n";
298
+							$checked = ! empty($default) && $default == $val ? 'checked="checked" ' : '';
299
+							$fld = '<input name="'.$f_name.'" type="checkbox" id="'.$id.'" class="'.$class.'" value="'.$value.'"'.$checked.$tabindex_str.' />'."\n";
300 300
 						}
301 301
 					break;
302 302
 
303 303
 				case 'hidden' :
304
-						$fld = '<input name="' . $f_name . '" type="hidden" id="' . $id . '" class="' . $class . '" value="' . $value . '" />' . "\n";
304
+						$fld = '<input name="'.$f_name.'" type="hidden" id="'.$id.'" class="'.$class.'" value="'.$value.'" />'."\n";
305 305
 					break;
306 306
 
307 307
 				case 'select' :
308
-						$fld = '<select name="' . $f_name . '" class="' . $class . '" id="' . $id . '"' . $tabindex_str . '>' . "\n";
309
-						foreach ( $value as $key => $val ) {
310
-							$checked = !empty($default) && $default == $val ? ' selected="selected"' : '';
311
-							$fld .= "\t" . '<option value="' . $val . '"' . $checked . '>' . $labels[$key] . '</option>' . "\n";
308
+						$fld = '<select name="'.$f_name.'" class="'.$class.'" id="'.$id.'"'.$tabindex_str.'>'."\n";
309
+						foreach ($value as $key => $val) {
310
+							$checked = ! empty($default) && $default == $val ? ' selected="selected"' : '';
311
+							$fld .= "\t".'<option value="'.$val.'"'.$checked.'>'.$labels[$key].'</option>'."\n";
312 312
 						}
313 313
 						$fld .= '</select>';
314 314
 					break;
@@ -320,21 +320,21 @@  discard block
 block discarded – undo
320 320
 							'editor_class' => $class,
321 321
 							'tabindex' => $tabindex
322 322
 							);
323
-						$editor_settings = array_merge( $wpeditor_args, $editor_settings );
323
+						$editor_settings = array_merge($wpeditor_args, $editor_settings);
324 324
 						ob_start();
325
-						wp_editor( $value, $id, $editor_settings );
325
+						wp_editor($value, $id, $editor_settings);
326 326
 						$editor = ob_get_contents();
327 327
 						ob_end_clean();
328 328
 						$fld = $editor;
329 329
 					break;
330 330
 
331 331
 				default : //'text fields'
332
-						$fld = '<input name="' . $f_name . '" type="text" id="' . $id . '" class="' . $class . '" value="' . $value . '"' . $tabindex_str . ' />' . "\n";
332
+						$fld = '<input name="'.$f_name.'" type="text" id="'.$id.'" class="'.$class.'" value="'.$value.'"'.$tabindex_str.' />'."\n";
333 333
 						$fld .= $extra_desc;
334 334
 
335 335
 			}
336 336
 
337
-			$form_fields[ $field_name ] = array( 'label' => $label, 'field' => $fld );
337
+			$form_fields[$field_name] = array('label' => $label, 'field' => $fld);
338 338
 		}
339 339
 
340 340
 		return $form_fields;
@@ -363,22 +363,22 @@  discard block
 block discarded – undo
363 363
 	 */
364 364
 	static public function select_input($name, $values, $default = '', $parameters = '', $class = '', $autosize = true) {
365 365
 		//if $values was submitted in the wrong format, convert it over
366
-		if(!empty($values) && (!array_key_exists(0,$values) || !is_array($values[0]))){
367
-			$converted_values=array();
368
-			foreach($values as $id=>$text){
369
-				$converted_values[]=array('id'=>$id,'text'=>$text);
366
+		if ( ! empty($values) && ( ! array_key_exists(0, $values) || ! is_array($values[0]))) {
367
+			$converted_values = array();
368
+			foreach ($values as $id=>$text) {
369
+				$converted_values[] = array('id'=>$id, 'text'=>$text);
370 370
 			}
371
-			$values=$converted_values;
371
+			$values = $converted_values;
372 372
 		}
373 373
 		//load formatter helper
374
-		EE_Registry::instance()->load_helper( 'Formatter' );
374
+		EE_Registry::instance()->load_helper('Formatter');
375 375
 		//EE_Registry::instance()->load_helper( 'Formatter' );
376 376
 
377
-		$field = '<select id="' . EEH_Formatter::ee_tep_output_string($name) . '" name="' . EEH_Formatter::ee_tep_output_string($name) . '"';
377
+		$field = '<select id="'.EEH_Formatter::ee_tep_output_string($name).'" name="'.EEH_Formatter::ee_tep_output_string($name).'"';
378 378
 		//Debug
379 379
 		//EEH_Debug_Tools::printr( $values, '$values  <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span>', 'auto' );
380
-		if ( EEH_Formatter::ee_tep_not_null($parameters))
381
-			$field .= ' ' . $parameters;
380
+		if (EEH_Formatter::ee_tep_not_null($parameters))
381
+			$field .= ' '.$parameters;
382 382
 		if ($autosize) {
383 383
 			$size = 'med';
384 384
 			for ($ii = 0, $ni = sizeof($values); $ii < $ni; $ii++) {
@@ -391,21 +391,21 @@  discard block
 block discarded – undo
391 391
 			$size = '';
392 392
 		}
393 393
 
394
-		$field .= ' class="' . $class . ' ' . $size . '">';
394
+		$field .= ' class="'.$class.' '.$size.'">';
395 395
 
396 396
 		if (empty($default) && isset($GLOBALS[$name]))
397 397
 			$default = stripslashes($GLOBALS[$name]);
398 398
 
399 399
 
400 400
 		for ($i = 0, $n = sizeof($values); $i < $n; $i++) {
401
-			$field .= '<option value="' . $values[$i]['id'] . '"';
401
+			$field .= '<option value="'.$values[$i]['id'].'"';
402 402
 			if ($default == $values[$i]['id']) {
403 403
 				$field .= ' selected = "selected"';
404 404
 			}
405
-			if ( isset( $values[$i]['class'] ) ) {
406
-				$field .= ' class="' . $values[$i]['class'] . '"';
405
+			if (isset($values[$i]['class'])) {
406
+				$field .= ' class="'.$values[$i]['class'].'"';
407 407
 			}
408
-			$field .= '>' . $values[$i]['text'] . '</option>';
408
+			$field .= '>'.$values[$i]['text'].'</option>';
409 409
 		}
410 410
 		$field .= '</select>';
411 411
 
@@ -423,38 +423,38 @@  discard block
 block discarded – undo
423 423
 	 * @param string $question_groups
424 424
 	 * @return string HTML
425 425
 	 */
426
-	static function generate_question_groups_html( $question_groups = array(), $group_wrapper = 'fieldset' ) {
426
+	static function generate_question_groups_html($question_groups = array(), $group_wrapper = 'fieldset') {
427 427
 
428 428
 		$html = '';
429
-		$before_question_group_questions = apply_filters( 'FHEE__EEH_Form_Fields__generate_question_groups_html__before_question_group_questions', '' );
430
-		$after_question_group_questions = apply_filters( 'FHEE__EEH_Form_Fields__generate_question_groups_html__after_question_group_questions', '' );
429
+		$before_question_group_questions = apply_filters('FHEE__EEH_Form_Fields__generate_question_groups_html__before_question_group_questions', '');
430
+		$after_question_group_questions = apply_filters('FHEE__EEH_Form_Fields__generate_question_groups_html__after_question_group_questions', '');
431 431
 
432
-		if ( ! empty( $question_groups )) {
432
+		if ( ! empty($question_groups)) {
433 433
 			//EEH_Debug_Tools::printr( $question_groups, '$question_groups  <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span>', 'auto' );
434 434
 			// loop thru question groups
435
-			foreach ( $question_groups as $QSG ) {
435
+			foreach ($question_groups as $QSG) {
436 436
 				// check that questions exist
437
-				if ( ! empty( $QSG['QSG_questions'] )) {
437
+				if ( ! empty($QSG['QSG_questions'])) {
438 438
 					// use fieldsets
439
-					$html .= "\n\t" . '<' . $group_wrapper . ' class="espresso-question-group-wrap" id="' . $QSG['QSG_identifier'] . '">';
439
+					$html .= "\n\t".'<'.$group_wrapper.' class="espresso-question-group-wrap" id="'.$QSG['QSG_identifier'].'">';
440 440
 					// group_name
441
-					$html .= $QSG['QSG_show_group_name'] ? "\n\t\t" . '<h5 class="espresso-question-group-title-h5 section-title">' . self::prep_answer( $QSG['QSG_name'] ) . '</h5>' : '';
441
+					$html .= $QSG['QSG_show_group_name'] ? "\n\t\t".'<h5 class="espresso-question-group-title-h5 section-title">'.self::prep_answer($QSG['QSG_name']).'</h5>' : '';
442 442
 					// group_desc
443
-					$html .= $QSG['QSG_show_group_desc'] && ! empty( $QSG['QSG_desc'] ) ? '<div class="espresso-question-group-desc-pg">' . self::prep_answer( $QSG['QSG_desc'] ) . '</div>' : '';
443
+					$html .= $QSG['QSG_show_group_desc'] && ! empty($QSG['QSG_desc']) ? '<div class="espresso-question-group-desc-pg">'.self::prep_answer($QSG['QSG_desc']).'</div>' : '';
444 444
 
445 445
 					$html .= $before_question_group_questions;
446 446
 					// loop thru questions
447
-					foreach ( $QSG['QSG_questions'] as $question ) {
447
+					foreach ($QSG['QSG_questions'] as $question) {
448 448
 //						EEH_Debug_Tools::printr( $question, '$question  <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span>', 'auto' );
449 449
 						$QFI = new EE_Question_Form_Input(
450 450
 							$question['qst_obj'],
451 451
 							$question['ans_obj'],
452 452
 							$question
453 453
 						);
454
-						$html .= self::generate_form_input( $QFI );
454
+						$html .= self::generate_form_input($QFI);
455 455
 					}
456 456
 					$html .= $after_question_group_questions;
457
-					$html .= "\n\t" . '</' . $group_wrapper . '>';
457
+					$html .= "\n\t".'</'.$group_wrapper.'>';
458 458
 				}
459 459
 			}
460 460
 		}
@@ -474,11 +474,11 @@  discard block
 block discarded – undo
474 474
 	 * @param string       $group_wrapper
475 475
 	 * @return string HTML
476 476
 	 */
477
-	static function generate_question_groups_html2( $question_groups = array(), $q_meta = array(), 	$from_admin = FALSE, $group_wrapper = 'fieldset' ) {
477
+	static function generate_question_groups_html2($question_groups = array(), $q_meta = array(), $from_admin = FALSE, $group_wrapper = 'fieldset') {
478 478
 
479 479
 		$html = '';
480
-		$before_question_group_questions = apply_filters( 'FHEE__EEH_Form_Fields__generate_question_groups_html__before_question_group_questions', '' );
481
-		$after_question_group_questions = apply_filters( 'FHEE__EEH_Form_Fields__generate_question_groups_html__after_question_group_questions', '' );
480
+		$before_question_group_questions = apply_filters('FHEE__EEH_Form_Fields__generate_question_groups_html__before_question_group_questions', '');
481
+		$after_question_group_questions = apply_filters('FHEE__EEH_Form_Fields__generate_question_groups_html__after_question_group_questions', '');
482 482
 
483 483
 		$default_q_meta = array(
484 484
 				'att_nmbr' => 1,
@@ -487,55 +487,55 @@  discard block
 block discarded – undo
487 487
 				'input_id' => '',
488 488
 				'input_class' => ''
489 489
 		);
490
-		$q_meta = array_merge( $default_q_meta, $q_meta );
490
+		$q_meta = array_merge($default_q_meta, $q_meta);
491 491
 		//EEH_Debug_Tools::printr( $q_meta, '$q_meta  <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span>', 'auto' );
492 492
 
493
-		if ( ! empty( $question_groups )) {
493
+		if ( ! empty($question_groups)) {
494 494
 //			EEH_Debug_Tools::printr( $question_groups, '$question_groups  <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span>', 'auto' );
495 495
 			// loop thru question groups
496
-			foreach ( $question_groups as $QSG ) {
497
-				if ( $QSG instanceof EE_Question_Group ) {
496
+			foreach ($question_groups as $QSG) {
497
+				if ($QSG instanceof EE_Question_Group) {
498 498
 					// check that questions exist
499 499
 
500
-					$where = array( 'QST_deleted' => 0 );
501
-					if ( ! $from_admin ) {
500
+					$where = array('QST_deleted' => 0);
501
+					if ( ! $from_admin) {
502 502
 						$where['QST_admin_only'] = 0;
503 503
 					}
504
-					$questions = $QSG->questions( array( $where, 'order_by' => array( 'Question_Group_Question.QGQ_order' => 'ASC' )));
505
-					if ( ! empty( $questions )) {
504
+					$questions = $QSG->questions(array($where, 'order_by' => array('Question_Group_Question.QGQ_order' => 'ASC')));
505
+					if ( ! empty($questions)) {
506 506
 						// use fieldsets
507
-						$html .= "\n\t" . '<' . $group_wrapper . ' class="espresso-question-group-wrap" id="' . $QSG->get( 'QSG_identifier' ) . '">';
507
+						$html .= "\n\t".'<'.$group_wrapper.' class="espresso-question-group-wrap" id="'.$QSG->get('QSG_identifier').'">';
508 508
 						// group_name
509
-						if ( $QSG->show_group_name() ) {
510
-							$html .=  "\n\t\t" . '<h5 class="espresso-question-group-title-h5 section-title">' . $QSG->get_pretty( 'QSG_name' ) . '</h5>';
509
+						if ($QSG->show_group_name()) {
510
+							$html .= "\n\t\t".'<h5 class="espresso-question-group-title-h5 section-title">'.$QSG->get_pretty('QSG_name').'</h5>';
511 511
 						}
512 512
 						// group_desc
513
-						if ( $QSG->show_group_desc() ) {
514
-							$html .=  '<div class="espresso-question-group-desc-pg">' . $QSG->get_pretty( 'QSG_desc'  ) . '</div>';
513
+						if ($QSG->show_group_desc()) {
514
+							$html .= '<div class="espresso-question-group-desc-pg">'.$QSG->get_pretty('QSG_desc').'</div>';
515 515
 						}
516 516
 
517 517
 						$html .= $before_question_group_questions;
518 518
 						// loop thru questions
519
-						foreach ( $questions as $QST ) {
519
+						foreach ($questions as $QST) {
520 520
 							$qstn_id = $QST->is_system_question() ? $QST->system_ID() : $QST->ID();
521 521
 
522 522
 							$answer = NULL;
523 523
 
524
-							if (  isset( $_GET['qstn'] ) && isset( $q_meta['input_id'] ) && isset( $q_meta['att_nmbr'] )) {
524
+							if (isset($_GET['qstn']) && isset($q_meta['input_id']) && isset($q_meta['att_nmbr'])) {
525 525
 								// check for answer in $_GET in case we are reprocessing a form after an error
526
-								if ( isset( $_GET['qstn'][ $q_meta['input_id'] ][ $qstn_id ] )) {
527
-									$answer = is_array( $_GET['qstn'][ $q_meta['input_id'] ][ $qstn_id ] ) ? $_GET['qstn'][ $q_meta['input_id'] ][ $qstn_id ] : sanitize_text_field( $_GET['qstn'][ $q_meta['input_id'] ][ $qstn_id ] );
526
+								if (isset($_GET['qstn'][$q_meta['input_id']][$qstn_id])) {
527
+									$answer = is_array($_GET['qstn'][$q_meta['input_id']][$qstn_id]) ? $_GET['qstn'][$q_meta['input_id']][$qstn_id] : sanitize_text_field($_GET['qstn'][$q_meta['input_id']][$qstn_id]);
528 528
 								}
529
-							} else if ( isset( $q_meta['attendee'] ) && $q_meta['attendee'] ) {
529
+							} else if (isset($q_meta['attendee']) && $q_meta['attendee']) {
530 530
 								//attendee data from the session
531
-								$answer = isset( $q_meta['attendee'][ $qstn_id ] ) ? $q_meta['attendee'][ $qstn_id ] : NULL;
531
+								$answer = isset($q_meta['attendee'][$qstn_id]) ? $q_meta['attendee'][$qstn_id] : NULL;
532 532
 							}
533 533
 
534 534
 
535 535
 
536 536
 							$QFI = new EE_Question_Form_Input(
537 537
 									$QST,
538
-									EE_Answer::new_instance ( array(
538
+									EE_Answer::new_instance(array(
539 539
 											'ANS_ID'=> 0,
540 540
 											'QST_ID'=> 0,
541 541
 											'REG_ID'=> 0,
@@ -544,10 +544,10 @@  discard block
 block discarded – undo
544 544
 									$q_meta
545 545
 							);
546 546
 							//EEH_Debug_Tools::printr( $QFI, '$QFI  <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span>', 'auto' );
547
-							$html .= self::generate_form_input( $QFI );
547
+							$html .= self::generate_form_input($QFI);
548 548
 						}
549 549
 						$html .= $after_question_group_questions;
550
-						$html .= "\n\t" . '</' . $group_wrapper . '>';
550
+						$html .= "\n\t".'</'.$group_wrapper.'>';
551 551
 					}
552 552
 				}
553 553
 			}
@@ -567,63 +567,63 @@  discard block
 block discarded – undo
567 567
 	 * @param EE_Question_Form_Input $QFI
568 568
 	 * @return string HTML
569 569
 	 */
570
-	static function generate_form_input( EE_Question_Form_Input $QFI ) {
571
-		if ( isset( $QFI->QST_admin_only) && $QFI->QST_admin_only && ! is_admin() ) {
570
+	static function generate_form_input(EE_Question_Form_Input $QFI) {
571
+		if (isset($QFI->QST_admin_only) && $QFI->QST_admin_only && ! is_admin()) {
572 572
 			return '';
573 573
 		}
574 574
 
575
-		$QFI = self::_load_system_dropdowns( $QFI );
576
-		$QFI = self::_load_specialized_dropdowns( $QFI );
575
+		$QFI = self::_load_system_dropdowns($QFI);
576
+		$QFI = self::_load_specialized_dropdowns($QFI);
577 577
 
578 578
 		//we also need to verify
579 579
 
580 580
 		$display_text = $QFI->get('QST_display_text');
581 581
 		$input_name = $QFI->get('QST_input_name');
582
-		$answer = EE_Registry::instance()->REQ->is_set( $input_name ) ? EE_Registry::instance()->REQ->get( $input_name ) : $QFI->get('ANS_value');
582
+		$answer = EE_Registry::instance()->REQ->is_set($input_name) ? EE_Registry::instance()->REQ->get($input_name) : $QFI->get('ANS_value');
583 583
 		$input_id = $QFI->get('QST_input_id');
584 584
 		$input_class = $QFI->get('QST_input_class');
585 585
 //		$disabled = $QFI->get('QST_disabled') ? ' disabled="disabled"' : '';
586 586
 		$disabled = $QFI->get('QST_disabled') ? TRUE : FALSE;
587
-		$required_label = apply_filters(' FHEE__EEH_Form_Fields__generate_form_input__required_label', '<em>*</em>' );
587
+		$required_label = apply_filters(' FHEE__EEH_Form_Fields__generate_form_input__required_label', '<em>*</em>');
588 588
 		$QST_required = $QFI->get('QST_required');
589
-		$required = $QST_required ? array( 'label' => $required_label, 'class' => 'required needs-value', 'title' => $QST_required ) : array();
590
-		$use_html_entities = $QFI->get_meta( 'htmlentities' );
591
-		$required_text = $QFI->get('QST_required_text') != '' ? $QFI->get('QST_required_text') : __( 'This field is required', 'event_espresso' );
592
-		$required_text = $QST_required ? "\n\t\t\t" . '<div class="required-text hidden">' . self::prep_answer( $required_text, $use_html_entities ) . '</div>' : '';
589
+		$required = $QST_required ? array('label' => $required_label, 'class' => 'required needs-value', 'title' => $QST_required) : array();
590
+		$use_html_entities = $QFI->get_meta('htmlentities');
591
+		$required_text = $QFI->get('QST_required_text') != '' ? $QFI->get('QST_required_text') : __('This field is required', 'event_espresso');
592
+		$required_text = $QST_required ? "\n\t\t\t".'<div class="required-text hidden">'.self::prep_answer($required_text, $use_html_entities).'</div>' : '';
593 593
 		$label_class = 'espresso-form-input-lbl';
594
-		$QST_options = $QFI->options(true,$answer);
595
-		$options = is_array( $QST_options ) ? self::prep_answer_options( $QST_options ) : array();
594
+		$QST_options = $QFI->options(true, $answer);
595
+		$options = is_array($QST_options) ? self::prep_answer_options($QST_options) : array();
596 596
 		$system_ID = $QFI->get('QST_system');
597
-		$label_b4 = $QFI->get_meta( 'label_b4' );
598
-		$use_desc_4_label = $QFI->get_meta( 'use_desc_4_label' );
597
+		$label_b4 = $QFI->get_meta('label_b4');
598
+		$use_desc_4_label = $QFI->get_meta('use_desc_4_label');
599 599
 
600 600
 
601
-		switch ( $QFI->get('QST_type') ){
601
+		switch ($QFI->get('QST_type')) {
602 602
 
603 603
 			case 'TEXTAREA' :
604
-					return EEH_Form_Fields::textarea( $display_text, $answer, $input_name, $input_id, $input_class, array(), $required, $required_text, $label_class, $disabled, $system_ID, $use_html_entities );
604
+					return EEH_Form_Fields::textarea($display_text, $answer, $input_name, $input_id, $input_class, array(), $required, $required_text, $label_class, $disabled, $system_ID, $use_html_entities);
605 605
 				break;
606 606
 
607 607
 			case 'DROPDOWN' :
608
-					return EEH_Form_Fields::select( $display_text, $answer, $options, $input_name, $input_id, $input_class, $required, $required_text, $label_class, $disabled, $system_ID, $use_html_entities, TRUE );
608
+					return EEH_Form_Fields::select($display_text, $answer, $options, $input_name, $input_id, $input_class, $required, $required_text, $label_class, $disabled, $system_ID, $use_html_entities, TRUE);
609 609
 				break;
610 610
 
611 611
 
612 612
 			case 'RADIO_BTN' :
613
-					return EEH_Form_Fields::radio( $display_text, $answer, $options, $input_name, $input_id, $input_class, $required, $required_text, $label_class, $disabled, $system_ID, $use_html_entities, $label_b4, $use_desc_4_label );
613
+					return EEH_Form_Fields::radio($display_text, $answer, $options, $input_name, $input_id, $input_class, $required, $required_text, $label_class, $disabled, $system_ID, $use_html_entities, $label_b4, $use_desc_4_label);
614 614
 				break;
615 615
 
616 616
 			case 'CHECKBOX' :
617
-					return EEH_Form_Fields::checkbox( $display_text, $answer, $options, $input_name, $input_id, $input_class, $required, $required_text, $label_class, $disabled, $label_b4, $system_ID, $use_html_entities );
617
+					return EEH_Form_Fields::checkbox($display_text, $answer, $options, $input_name, $input_id, $input_class, $required, $required_text, $label_class, $disabled, $label_b4, $system_ID, $use_html_entities);
618 618
 				break;
619 619
 
620 620
 			case 'DATE' :
621
-					return EEH_Form_Fields::datepicker( $display_text, $answer, $input_name, $input_id, $input_class, $required, $required_text, $label_class, $disabled, $system_ID, $use_html_entities );
621
+					return EEH_Form_Fields::datepicker($display_text, $answer, $input_name, $input_id, $input_class, $required, $required_text, $label_class, $disabled, $system_ID, $use_html_entities);
622 622
 				break;
623 623
 
624 624
 			case 'TEXT' :
625 625
 			default:
626
-					return EEH_Form_Fields::text( $display_text, $answer, $input_name, $input_id, $input_class, $required, $required_text, $label_class, $disabled, $system_ID, $use_html_entities );
626
+					return EEH_Form_Fields::text($display_text, $answer, $input_name, $input_id, $input_class, $required, $required_text, $label_class, $disabled, $system_ID, $use_html_entities);
627 627
 				break;
628 628
 
629 629
 		}
@@ -649,31 +649,31 @@  discard block
 block discarded – undo
649 649
 	 * @param string $disabled 		disabled="disabled" or null
650 650
 	 * @return string HTML
651 651
 	 */
652
-	static function text( $question = FALSE, $answer = NULL, $name = FALSE, $id = '', $class = '', $required = FALSE, $required_text = '', $label_class = '', $disabled = FALSE, $system_ID = FALSE, $use_html_entities = TRUE ) {
652
+	static function text($question = FALSE, $answer = NULL, $name = FALSE, $id = '', $class = '', $required = FALSE, $required_text = '', $label_class = '', $disabled = FALSE, $system_ID = FALSE, $use_html_entities = TRUE) {
653 653
 		// need these
654
-		if ( ! $question || ! $name ) {
654
+		if ( ! $question || ! $name) {
655 655
 			return NULL;
656 656
 		}
657 657
 		// prep the answer
658
-		$answer = is_array( $answer ) ? '' : self::prep_answer( $answer, $use_html_entities );
658
+		$answer = is_array($answer) ? '' : self::prep_answer($answer, $use_html_entities);
659 659
 		// prep the required array
660
-		$required = self::prep_required( $required );
660
+		$required = self::prep_required($required);
661 661
 		// set disabled tag
662
-		$disabled = $answer === NULL || ! $disabled  ? '' : ' disabled="disabled"';
662
+		$disabled = $answer === NULL || ! $disabled ? '' : ' disabled="disabled"';
663 663
 		// ya gots ta have style man!!!
664 664
 		$txt_class = is_admin() ? 'regular-text' : 'espresso-text-inp';
665
-		$class = empty( $class ) ? $txt_class : $class;
666
-		$class .= ! empty( $system_ID ) ? ' ' . $system_ID : '';
667
-		$extra = apply_filters( 'FHEE__EEH_Form_Fields__additional_form_field_attributes', '' );
665
+		$class = empty($class) ? $txt_class : $class;
666
+		$class .= ! empty($system_ID) ? ' '.$system_ID : '';
667
+		$extra = apply_filters('FHEE__EEH_Form_Fields__additional_form_field_attributes', '');
668 668
 
669
-		$label_html = $required_text . "\n\t\t\t" . '<label for="' . $name . '" class="' . $label_class . '">' . self::prep_question( $question ) . $required['label'] . '</label><br/>';
669
+		$label_html = $required_text."\n\t\t\t".'<label for="'.$name.'" class="'.$label_class.'">'.self::prep_question($question).$required['label'].'</label><br/>';
670 670
 		// filter label but ensure required text comes before it
671
-		$label_html = apply_filters( 'FHEE__EEH_Form_Fields__label_html', $label_html, $required_text );
671
+		$label_html = apply_filters('FHEE__EEH_Form_Fields__label_html', $label_html, $required_text);
672 672
 
673
-		$input_html = "\n\t\t\t" . '<input type="text" name="' . $name . '" id="' . $id . '" class="' . $class . ' ' . $required['class'] . '" value="' . esc_attr( $answer ) . '"  title="' . esc_attr( $required['msg'] ) . '" ' . $disabled .' ' . $extra . '/>';
673
+		$input_html = "\n\t\t\t".'<input type="text" name="'.$name.'" id="'.$id.'" class="'.$class.' '.$required['class'].'" value="'.esc_attr($answer).'"  title="'.esc_attr($required['msg']).'" '.$disabled.' '.$extra.'/>';
674 674
 
675
-		$input_html =  apply_filters( 'FHEE__EEH_Form_Fields__input_html', $input_html, $label_html, $id );
676
-		return  $label_html . $input_html;
675
+		$input_html = apply_filters('FHEE__EEH_Form_Fields__input_html', $input_html, $label_html, $id);
676
+		return  $label_html.$input_html;
677 677
 
678 678
 	}
679 679
 
@@ -695,35 +695,35 @@  discard block
 block discarded – undo
695 695
 	 * @param string $disabled 		disabled="disabled" or null
696 696
 	 * @return string HTML
697 697
 	 */
698
-	static function textarea( $question = FALSE, $answer = NULL, $name = FALSE, $id = '', $class = '', $dimensions = FALSE, $required = FALSE, $required_text = '', $label_class = '', $disabled = FALSE, $system_ID = FALSE, $use_html_entities = TRUE ) {
698
+	static function textarea($question = FALSE, $answer = NULL, $name = FALSE, $id = '', $class = '', $dimensions = FALSE, $required = FALSE, $required_text = '', $label_class = '', $disabled = FALSE, $system_ID = FALSE, $use_html_entities = TRUE) {
699 699
 		// need these
700
-		if ( ! $question || ! $name ) {
700
+		if ( ! $question || ! $name) {
701 701
 			return NULL;
702 702
 		}
703 703
 		// prep the answer
704
-		$answer = is_array( $answer ) ? '' : self::prep_answer( $answer, $use_html_entities );
704
+		$answer = is_array($answer) ? '' : self::prep_answer($answer, $use_html_entities);
705 705
 		// prep the required array
706
-		$required = self::prep_required( $required );
706
+		$required = self::prep_required($required);
707 707
 		// make sure $dimensions is an array
708
-		$dimensions = is_array( $dimensions ) ? $dimensions : array();
708
+		$dimensions = is_array($dimensions) ? $dimensions : array();
709 709
 		// and set some defaults
710
-		$dimensions = array_merge( array( 'rows' => 3, 'cols' => 40 ), $dimensions );
710
+		$dimensions = array_merge(array('rows' => 3, 'cols' => 40), $dimensions);
711 711
 		// set disabled tag
712
-		$disabled = $answer === NULL || ! $disabled  ? '' : ' disabled="disabled"';
712
+		$disabled = $answer === NULL || ! $disabled ? '' : ' disabled="disabled"';
713 713
 		// ya gots ta have style man!!!
714 714
 		$txt_class = is_admin() ? 'regular-text' : 'espresso-textarea-inp';
715
-		$class = empty( $class ) ? $txt_class : $class;
716
-		$class .= ! empty( $system_ID ) ? ' ' . $system_ID : '';
717
-		$extra = apply_filters( 'FHEE__EEH_Form_Fields__additional_form_field_attributes', '' );
715
+		$class = empty($class) ? $txt_class : $class;
716
+		$class .= ! empty($system_ID) ? ' '.$system_ID : '';
717
+		$extra = apply_filters('FHEE__EEH_Form_Fields__additional_form_field_attributes', '');
718 718
 
719
-		$label_html = $required_text . "\n\t\t\t" . '<label for="' . $name . '" class="' . $label_class . '">' . self::prep_question( $question ) . $required['label'] . '</label><br/>';
719
+		$label_html = $required_text."\n\t\t\t".'<label for="'.$name.'" class="'.$label_class.'">'.self::prep_question($question).$required['label'].'</label><br/>';
720 720
 		// filter label but ensure required text comes before it
721
-		$label_html = apply_filters( 'FHEE__EEH_Form_Fields__label_html', $label_html, $required_text );
721
+		$label_html = apply_filters('FHEE__EEH_Form_Fields__label_html', $label_html, $required_text);
722 722
 
723
-		$input_html = "\n\t\t\t" . '<textarea name="' . $name . '" id="' . $id . '" class="' . $class . ' ' . $required['class'] . '" rows="' . $dimensions['rows'] . '" cols="' . $dimensions['cols'] . '"  title="' . $required['msg'] . '" ' . $disabled . ' ' . $extra . '>' . $answer . '</textarea>';
723
+		$input_html = "\n\t\t\t".'<textarea name="'.$name.'" id="'.$id.'" class="'.$class.' '.$required['class'].'" rows="'.$dimensions['rows'].'" cols="'.$dimensions['cols'].'"  title="'.$required['msg'].'" '.$disabled.' '.$extra.'>'.$answer.'</textarea>';
724 724
 
725
-		$input_html =  apply_filters( 'FHEE__EEH_Form_Fields__input_html', $input_html, $label_html, $id );
726
-		return  $label_html . $input_html;
725
+		$input_html = apply_filters('FHEE__EEH_Form_Fields__input_html', $input_html, $label_html, $id);
726
+		return  $label_html.$input_html;
727 727
 
728 728
 	}
729 729
 
@@ -746,47 +746,47 @@  discard block
 block discarded – undo
746 746
 	 * @param string $disabled 		disabled="disabled" or null
747 747
 	 * @return string HTML
748 748
 	 */
749
-	static function select( $question = FALSE, $answer = NULL, $options = FALSE, $name = FALSE, $id = '', $class = '', $required = FALSE, $required_text = '', $label_class = '', $disabled = FALSE, $system_ID = FALSE, $use_html_entities = TRUE, $add_please_select_option = FALSE ) {
749
+	static function select($question = FALSE, $answer = NULL, $options = FALSE, $name = FALSE, $id = '', $class = '', $required = FALSE, $required_text = '', $label_class = '', $disabled = FALSE, $system_ID = FALSE, $use_html_entities = TRUE, $add_please_select_option = FALSE) {
750 750
 
751 751
 		// need these
752
-		if ( ! $question || ! $name || ! $options || empty( $options ) || ! is_array( $options )) {
752
+		if ( ! $question || ! $name || ! $options || empty($options) || ! is_array($options)) {
753 753
 			return NULL;
754 754
 		}
755 755
 		// prep the answer
756
-		$answer = is_array( $answer ) ? self::prep_answer( array_shift( $answer ), $use_html_entities) : self::prep_answer( $answer, $use_html_entities );
756
+		$answer = is_array($answer) ? self::prep_answer(array_shift($answer), $use_html_entities) : self::prep_answer($answer, $use_html_entities);
757 757
 		// prep the required array
758
-		$required = self::prep_required( $required );
758
+		$required = self::prep_required($required);
759 759
 		// set disabled tag
760
-		$disabled = $answer === NULL || ! $disabled  ? '' : ' disabled="disabled"';
760
+		$disabled = $answer === NULL || ! $disabled ? '' : ' disabled="disabled"';
761 761
 		// ya gots ta have style man!!!
762 762
 		$txt_class = is_admin() ? 'wide' : 'espresso-select-inp';
763
-		$class = empty( $class ) ? $txt_class : $class;
764
-		$class .= ! empty( $system_ID ) ? ' ' . $system_ID : '';
765
-		$extra = apply_filters( 'FHEE__EEH_Form_Fields__additional_form_field_attributes', '' );
763
+		$class = empty($class) ? $txt_class : $class;
764
+		$class .= ! empty($system_ID) ? ' '.$system_ID : '';
765
+		$extra = apply_filters('FHEE__EEH_Form_Fields__additional_form_field_attributes', '');
766 766
 
767
-		$label_html = $required_text . "\n\t\t\t" . '<label for="' . $name . '" class="' . $label_class . '">' . self::prep_question( $question ) . $required['label'] . '</label><br/>';
767
+		$label_html = $required_text."\n\t\t\t".'<label for="'.$name.'" class="'.$label_class.'">'.self::prep_question($question).$required['label'].'</label><br/>';
768 768
 		// filter label but ensure required text comes before it
769
-		$label_html = apply_filters( 'FHEE__EEH_Form_Fields__label_html', $label_html, $required_text );
769
+		$label_html = apply_filters('FHEE__EEH_Form_Fields__label_html', $label_html, $required_text);
770 770
 
771
-		$input_html = "\n\t\t\t" . '<select name="' . $name . '" id="' . $id . '" class="' . $class . ' ' . $required['class'] . '" title="' . esc_attr( $required['msg'] ) . '"' . $disabled . ' ' . $extra . '>';
771
+		$input_html = "\n\t\t\t".'<select name="'.$name.'" id="'.$id.'" class="'.$class.' '.$required['class'].'" title="'.esc_attr($required['msg']).'"'.$disabled.' '.$extra.'>';
772 772
 		// recursively count array elements, to determine total number of options
773
-		$only_option = count( $options, 1 ) == 1 ? TRUE : FALSE;
774
-		if ( ! $only_option ) {
773
+		$only_option = count($options, 1) == 1 ? TRUE : FALSE;
774
+		if ( ! $only_option) {
775 775
 			// if there is NO answer set and there are multiple options to choose from, then set the "please select" message as selected
776 776
 			$selected = $answer === NULL ? ' selected="selected"' : '';
777
-			$input_html .= $add_please_select_option ? "\n\t\t\t\t" . '<option value=""' . $selected . '>' . __(' - please select - ', 'event_espresso') . '</option>' : '';
777
+			$input_html .= $add_please_select_option ? "\n\t\t\t\t".'<option value=""'.$selected.'>'.__(' - please select - ', 'event_espresso').'</option>' : '';
778 778
 		}
779
-		foreach ( $options as $key => $value ) {
779
+		foreach ($options as $key => $value) {
780 780
 			// if value is an array, then create option groups, else create regular ol' options
781
-			$input_html .= is_array( $value ) ? self::_generate_select_option_group( $key, $value, $answer, $use_html_entities ) : self::_generate_select_option( $value->value(), $value->desc(), $answer, $only_option, $use_html_entities );
781
+			$input_html .= is_array($value) ? self::_generate_select_option_group($key, $value, $answer, $use_html_entities) : self::_generate_select_option($value->value(), $value->desc(), $answer, $only_option, $use_html_entities);
782 782
 		}
783 783
 
784
-		$input_html .= "\n\t\t\t" . '</select>';
784
+		$input_html .= "\n\t\t\t".'</select>';
785 785
 
786
-		$input_html =  apply_filters( 'FHEE__EEH_Form_Fields__select__before_end_wrapper', $input_html, $question, $answer, $name, $id, $class, $system_ID );
786
+		$input_html = apply_filters('FHEE__EEH_Form_Fields__select__before_end_wrapper', $input_html, $question, $answer, $name, $id, $class, $system_ID);
787 787
 
788
-		$input_html =  apply_filters( 'FHEE__EEH_Form_Fields__input_html', $input_html, $label_html, $id );
789
-		return  $label_html . $input_html;
788
+		$input_html = apply_filters('FHEE__EEH_Form_Fields__input_html', $input_html, $label_html, $id);
789
+		return  $label_html.$input_html;
790 790
 
791 791
 	}
792 792
 
@@ -804,12 +804,12 @@  discard block
 block discarded – undo
804 804
 	 * @param boolean $use_html_entities
805 805
 	 * @return string
806 806
 	 */
807
-	private static function _generate_select_option_group( $opt_group, $QSOs, $answer, $use_html_entities = true ){
808
-		$html = "\n\t\t\t\t" . '<optgroup label="' . self::prep_option_value( $opt_group ) . '">';
809
-		foreach ( $QSOs as $QSO ) {
810
-			$html .= self::_generate_select_option( $QSO->value(), $QSO->desc(), $answer, false, $use_html_entities );
807
+	private static function _generate_select_option_group($opt_group, $QSOs, $answer, $use_html_entities = true) {
808
+		$html = "\n\t\t\t\t".'<optgroup label="'.self::prep_option_value($opt_group).'">';
809
+		foreach ($QSOs as $QSO) {
810
+			$html .= self::_generate_select_option($QSO->value(), $QSO->desc(), $answer, false, $use_html_entities);
811 811
 		}
812
-		$html .= "\n\t\t\t\t" . '</optgroup>';
812
+		$html .= "\n\t\t\t\t".'</optgroup>';
813 813
 		return $html;
814 814
 	}
815 815
 
@@ -824,12 +824,12 @@  discard block
 block discarded – undo
824 824
 	 * @param boolean $use_html_entities
825 825
 	 * @return string
826 826
 	 */
827
-	private static function _generate_select_option( $key, $value, $answer, $only_option = FALSE, $use_html_entities = true ){
828
-		$key = self::prep_answer( $key, $use_html_entities );
829
-		$value = self::prep_answer( $value, $use_html_entities );
830
-		$value = ! empty( $value ) ? $value : $key;
831
-		$selected = ( $answer == $key || $only_option ) ? ' selected="selected"' : '';
832
-		return "\n\t\t\t\t" . '<option value="' . self::prep_option_value( $key ) . '"' . $selected . '> ' . $value . '&nbsp;&nbsp;&nbsp;</option>';
827
+	private static function _generate_select_option($key, $value, $answer, $only_option = FALSE, $use_html_entities = true) {
828
+		$key = self::prep_answer($key, $use_html_entities);
829
+		$value = self::prep_answer($value, $use_html_entities);
830
+		$value = ! empty($value) ? $value : $key;
831
+		$selected = ($answer == $key || $only_option) ? ' selected="selected"' : '';
832
+		return "\n\t\t\t\t".'<option value="'.self::prep_option_value($key).'"'.$selected.'> '.$value.'&nbsp;&nbsp;&nbsp;</option>';
833 833
 	}
834 834
 
835 835
 
@@ -853,56 +853,56 @@  discard block
 block discarded – undo
853 853
 	 * @param bool        $use_desc_4_label
854 854
 	 * @return string HTML
855 855
 	 */
856
-	static function radio( $question = FALSE, $answer = NULL, $options = FALSE, $name = FALSE, $id = '', $class = '', $required = FALSE, $required_text = '', $label_class = '', $disabled = FALSE, $system_ID = FALSE, $use_html_entities = TRUE, $label_b4 = FALSE, $use_desc_4_label = FALSE ) {
856
+	static function radio($question = FALSE, $answer = NULL, $options = FALSE, $name = FALSE, $id = '', $class = '', $required = FALSE, $required_text = '', $label_class = '', $disabled = FALSE, $system_ID = FALSE, $use_html_entities = TRUE, $label_b4 = FALSE, $use_desc_4_label = FALSE) {
857 857
 		// need these
858
-		if ( ! $question || ! $name || ! $options || empty( $options ) || ! is_array( $options )) {
858
+		if ( ! $question || ! $name || ! $options || empty($options) || ! is_array($options)) {
859 859
 			return NULL;
860 860
 		}
861 861
 		// prep the answer
862
-		$answer = is_array( $answer ) ? '' : self::prep_answer( $answer, $use_html_entities );
862
+		$answer = is_array($answer) ? '' : self::prep_answer($answer, $use_html_entities);
863 863
 		// prep the required array
864
-		$required = self::prep_required( $required );
864
+		$required = self::prep_required($required);
865 865
 		// set disabled tag
866
-		$disabled = $answer === NULL || ! $disabled  ? '' : ' disabled="disabled"';
866
+		$disabled = $answer === NULL || ! $disabled ? '' : ' disabled="disabled"';
867 867
 		// ya gots ta have style man!!!
868 868
 		$radio_class = is_admin() ? 'ee-admin-radio-lbl' : $label_class;
869
-		$class = ! empty( $class ) ? $class : 'espresso-radio-btn-inp';
870
-		$extra = apply_filters( 'FHEE__EEH_Form_Fields__additional_form_field_attributes', '' );
869
+		$class = ! empty($class) ? $class : 'espresso-radio-btn-inp';
870
+		$extra = apply_filters('FHEE__EEH_Form_Fields__additional_form_field_attributes', '');
871 871
 
872
-		$label_html = $required_text . "\n\t\t\t" . '<label class="' . $label_class . '">' . self::prep_question( $question ) . $required['label'] . '</label> ';
872
+		$label_html = $required_text."\n\t\t\t".'<label class="'.$label_class.'">'.self::prep_question($question).$required['label'].'</label> ';
873 873
 		// filter label but ensure required text comes before it
874
-		$label_html = apply_filters( 'FHEE__EEH_Form_Fields__label_html', $label_html, $required_text );
874
+		$label_html = apply_filters('FHEE__EEH_Form_Fields__label_html', $label_html, $required_text);
875 875
 
876
-		$input_html = "\n\t\t\t" . '<ul id="' . $id . '-ul" class="espresso-radio-btn-options-ul ' . $label_class . ' ' . $class . '-ul">';
876
+		$input_html = "\n\t\t\t".'<ul id="'.$id.'-ul" class="espresso-radio-btn-options-ul '.$label_class.' '.$class.'-ul">';
877 877
 
878
-		$class .= ! empty( $system_ID ) ? ' ' . $system_ID : '';
879
-		$class .= ! empty( $required['class'] ) ? ' ' . $required['class'] : '';
878
+		$class .= ! empty($system_ID) ? ' '.$system_ID : '';
879
+		$class .= ! empty($required['class']) ? ' '.$required['class'] : '';
880 880
 
881
-		foreach ( $options as $OPT ) {
882
-			if ( $OPT instanceof EE_Question_Option ) {
883
-				$value = self::prep_option_value( $OPT->value() );
881
+		foreach ($options as $OPT) {
882
+			if ($OPT instanceof EE_Question_Option) {
883
+				$value = self::prep_option_value($OPT->value());
884 884
 				$label = $use_desc_4_label ? $OPT->desc() : $OPT->value();
885
-				$size = $use_desc_4_label ? self::get_label_size_class( $OPT->value() . ' ' . $OPT->desc() ) : self::get_label_size_class( $OPT->value() );
886
-				$desc = $OPT->desc();//no self::prep_answer
887
-				$answer = is_numeric( $value ) && empty( $answer ) ? 0 : $answer;
888
-				$checked = (string)$value == (string)$answer ? ' checked="checked"' : '';
889
-				$opt = '-' . sanitize_key( $value );
890
-
891
-				$input_html .= "\n\t\t\t\t" . '<li' . $size . '>';
892
-				$input_html .= "\n\t\t\t\t\t" . '<label class="' . $radio_class . ' espresso-radio-btn-lbl">';
893
-				$input_html .= $label_b4  ? "\n\t\t\t\t\t\t" . '<span>' . $label . '</span>' : '';
894
-				$input_html .= "\n\t\t\t\t\t\t" . '<input type="radio" name="' . $name . '" id="' . $id . $opt . '" class="' . $class . '" value="' . $value . '" title="' . esc_attr( $required['msg'] ) . '" ' . $disabled . $checked . ' ' . $extra . '/>';
895
-				$input_html .= ! $label_b4  ? "\n\t\t\t\t\t\t" . '<span class="espresso-radio-btn-desc">' . $label . '</span>' : '';
896
-				$input_html .= "\n\t\t\t\t\t" . '</label>';
897
-				$input_html .= $use_desc_4_label ? '' : '<span class="espresso-radio-btn-option-desc small-text grey-text">' . $desc . '</span>';
898
-				$input_html .= "\n\t\t\t\t" . '</li>';
885
+				$size = $use_desc_4_label ? self::get_label_size_class($OPT->value().' '.$OPT->desc()) : self::get_label_size_class($OPT->value());
886
+				$desc = $OPT->desc(); //no self::prep_answer
887
+				$answer = is_numeric($value) && empty($answer) ? 0 : $answer;
888
+				$checked = (string) $value == (string) $answer ? ' checked="checked"' : '';
889
+				$opt = '-'.sanitize_key($value);
890
+
891
+				$input_html .= "\n\t\t\t\t".'<li'.$size.'>';
892
+				$input_html .= "\n\t\t\t\t\t".'<label class="'.$radio_class.' espresso-radio-btn-lbl">';
893
+				$input_html .= $label_b4 ? "\n\t\t\t\t\t\t".'<span>'.$label.'</span>' : '';
894
+				$input_html .= "\n\t\t\t\t\t\t".'<input type="radio" name="'.$name.'" id="'.$id.$opt.'" class="'.$class.'" value="'.$value.'" title="'.esc_attr($required['msg']).'" '.$disabled.$checked.' '.$extra.'/>';
895
+				$input_html .= ! $label_b4 ? "\n\t\t\t\t\t\t".'<span class="espresso-radio-btn-desc">'.$label.'</span>' : '';
896
+				$input_html .= "\n\t\t\t\t\t".'</label>';
897
+				$input_html .= $use_desc_4_label ? '' : '<span class="espresso-radio-btn-option-desc small-text grey-text">'.$desc.'</span>';
898
+				$input_html .= "\n\t\t\t\t".'</li>';
899 899
 			}
900 900
 		}
901 901
 
902
-		$input_html .= "\n\t\t\t" . '</ul>';
902
+		$input_html .= "\n\t\t\t".'</ul>';
903 903
 
904
-		$input_html =  apply_filters( 'FHEE__EEH_Form_Fields__input_html', $input_html, $label_html, $id );
905
-		return  $label_html . $input_html;
904
+		$input_html = apply_filters('FHEE__EEH_Form_Fields__input_html', $input_html, $label_html, $id);
905
+		return  $label_html.$input_html;
906 906
 
907 907
 	}
908 908
 
@@ -925,65 +925,65 @@  discard block
 block discarded – undo
925 925
 	 * @param string $disabled 		disabled="disabled" or null
926 926
 	 * @return string HTML
927 927
 	 */
928
-	static function checkbox( $question = FALSE, $answer = NULL, $options = FALSE, $name = FALSE, $id = '', $class = '', $required = FALSE, $required_text = '', $label_class = '', $disabled = FALSE, $label_b4 = FALSE, $system_ID = FALSE, $use_html_entities = TRUE ) {
928
+	static function checkbox($question = FALSE, $answer = NULL, $options = FALSE, $name = FALSE, $id = '', $class = '', $required = FALSE, $required_text = '', $label_class = '', $disabled = FALSE, $label_b4 = FALSE, $system_ID = FALSE, $use_html_entities = TRUE) {
929 929
 		// need these
930
-		if ( ! $question || ! $name || ! $options || empty( $options ) || ! is_array( $options )) {
930
+		if ( ! $question || ! $name || ! $options || empty($options) || ! is_array($options)) {
931 931
 			return NULL;
932 932
 		}
933
-		$answer = maybe_unserialize( $answer );
933
+		$answer = maybe_unserialize($answer);
934 934
 
935 935
 		// prep the answer(s)
936
-		$answer = is_array( $answer ) ? $answer : array( sanitize_key( $answer ) => $answer );
936
+		$answer = is_array($answer) ? $answer : array(sanitize_key($answer) => $answer);
937 937
 
938
-		foreach ( $answer as $key => $value ) {
939
-			$key = self::prep_option_value( $key );
940
-			$answer[$key] = self::prep_answer( $value, $use_html_entities );
938
+		foreach ($answer as $key => $value) {
939
+			$key = self::prep_option_value($key);
940
+			$answer[$key] = self::prep_answer($value, $use_html_entities);
941 941
 		}
942 942
 
943 943
 		// prep the required array
944
-		$required = self::prep_required( $required );
944
+		$required = self::prep_required($required);
945 945
 		// set disabled tag
946
-		$disabled = $answer === NULL || ! $disabled  ? '' : ' disabled="disabled"';
946
+		$disabled = $answer === NULL || ! $disabled ? '' : ' disabled="disabled"';
947 947
 		// ya gots ta have style man!!!
948 948
 		$radio_class = is_admin() ? 'ee-admin-radio-lbl' : $label_class;
949
-		$class = empty( $class ) ? 'espresso-radio-btn-inp' : $class;
950
-		$extra = apply_filters( 'FHEE__EEH_Form_Fields__additional_form_field_attributes', '' );
949
+		$class = empty($class) ? 'espresso-radio-btn-inp' : $class;
950
+		$extra = apply_filters('FHEE__EEH_Form_Fields__additional_form_field_attributes', '');
951 951
 
952
-		$label_html = $required_text . "\n\t\t\t" . '<label class="' . $label_class . '">' . self::prep_question( $question ) . $required['label'] . '</label> ';
952
+		$label_html = $required_text."\n\t\t\t".'<label class="'.$label_class.'">'.self::prep_question($question).$required['label'].'</label> ';
953 953
 		// filter label but ensure required text comes before it
954
-		$label_html = apply_filters( 'FHEE__EEH_Form_Fields__label_html', $label_html, $required_text );
955
-
956
-		$input_html = "\n\t\t\t" . '<ul id="' . $id . '-ul" class="espresso-checkbox-options-ul ' . $label_class . ' ' . $class . '-ul">';
957
-
958
-		$class .= ! empty( $system_ID ) ? ' ' . $system_ID : '';
959
-		$class .= ! empty( $required['class'] ) ? ' ' . $required['class'] : '';
960
-
961
-		foreach ( $options as $OPT ) {
962
-			$value = $OPT->value();//self::prep_option_value( $OPT->value() );
963
-			$size = self::get_label_size_class(  $OPT->value() . ' ' . $OPT->desc() );
964
-			$text = self::prep_answer( $OPT->value() );
965
-			$desc = $OPT->desc() ;
966
-			$opt = '-' . sanitize_key( $value );
967
-
968
-			$checked = is_array( $answer ) && in_array( $text, $answer ) ? ' checked="checked"' : '';
969
-
970
-			$input_html .= "\n\t\t\t\t" . '<li' . $size . '>';
971
-			$input_html .= "\n\t\t\t\t\t" . '<label class="' . $radio_class . ' espresso-checkbox-lbl">';
972
-			$input_html .= $label_b4  ? "\n\t\t\t\t\t\t" . '<span>' . $text . '</span>' : '';
973
-			$input_html .= "\n\t\t\t\t\t\t" . '<input type="checkbox" name="' . $name . '[' . $OPT->ID() . ']" id="' . $id . $opt . '" class="' . $class . '" value="' . $value . '" title="' . esc_attr( $required['msg'] ) . '" ' . $disabled . $checked . ' ' . $extra . '/>';
974
-			$input_html .= ! $label_b4  ? "\n\t\t\t\t\t\t" . '<span>' . $text . '</span>' : '';
975
- 			$input_html .= "\n\t\t\t\t\t" . '</label>';
976
-			if ( ! empty( $desc ) && $desc != $text ) {
977
-	 			$input_html .= "\n\t\t\t\t\t" . ' &nbsp; <br/><div class="espresso-checkbox-option-desc small-text grey-text">' . $desc . '</div>';
954
+		$label_html = apply_filters('FHEE__EEH_Form_Fields__label_html', $label_html, $required_text);
955
+
956
+		$input_html = "\n\t\t\t".'<ul id="'.$id.'-ul" class="espresso-checkbox-options-ul '.$label_class.' '.$class.'-ul">';
957
+
958
+		$class .= ! empty($system_ID) ? ' '.$system_ID : '';
959
+		$class .= ! empty($required['class']) ? ' '.$required['class'] : '';
960
+
961
+		foreach ($options as $OPT) {
962
+			$value = $OPT->value(); //self::prep_option_value( $OPT->value() );
963
+			$size = self::get_label_size_class($OPT->value().' '.$OPT->desc());
964
+			$text = self::prep_answer($OPT->value());
965
+			$desc = $OPT->desc();
966
+			$opt = '-'.sanitize_key($value);
967
+
968
+			$checked = is_array($answer) && in_array($text, $answer) ? ' checked="checked"' : '';
969
+
970
+			$input_html .= "\n\t\t\t\t".'<li'.$size.'>';
971
+			$input_html .= "\n\t\t\t\t\t".'<label class="'.$radio_class.' espresso-checkbox-lbl">';
972
+			$input_html .= $label_b4 ? "\n\t\t\t\t\t\t".'<span>'.$text.'</span>' : '';
973
+			$input_html .= "\n\t\t\t\t\t\t".'<input type="checkbox" name="'.$name.'['.$OPT->ID().']" id="'.$id.$opt.'" class="'.$class.'" value="'.$value.'" title="'.esc_attr($required['msg']).'" '.$disabled.$checked.' '.$extra.'/>';
974
+			$input_html .= ! $label_b4 ? "\n\t\t\t\t\t\t".'<span>'.$text.'</span>' : '';
975
+ 			$input_html .= "\n\t\t\t\t\t".'</label>';
976
+			if ( ! empty($desc) && $desc != $text) {
977
+	 			$input_html .= "\n\t\t\t\t\t".' &nbsp; <br/><div class="espresso-checkbox-option-desc small-text grey-text">'.$desc.'</div>';
978 978
 			}
979
-			$input_html .= "\n\t\t\t\t" . '</li>';
979
+			$input_html .= "\n\t\t\t\t".'</li>';
980 980
 
981 981
 		}
982 982
 
983
-		$input_html .= "\n\t\t\t" . '</ul>';
983
+		$input_html .= "\n\t\t\t".'</ul>';
984 984
 
985
-		$input_html =  apply_filters( 'FHEE__EEH_Form_Fields__input_html', $input_html, $label_html, $id );
986
-		return  $label_html . $input_html;
985
+		$input_html = apply_filters('FHEE__EEH_Form_Fields__input_html', $input_html, $label_html, $id);
986
+		return  $label_html.$input_html;
987 987
 
988 988
 	}
989 989
 
@@ -1005,36 +1005,36 @@  discard block
 block discarded – undo
1005 1005
 	 * @param string $disabled 		disabled="disabled" or null
1006 1006
 	 * @return string HTML
1007 1007
 	 */
1008
-	static function datepicker( $question = FALSE, $answer = NULL, $name = FALSE, $id = '', $class = '', $required = FALSE, $required_text = '', $label_class = '', $disabled = FALSE, $system_ID = FALSE, $use_html_entities = TRUE ) {
1008
+	static function datepicker($question = FALSE, $answer = NULL, $name = FALSE, $id = '', $class = '', $required = FALSE, $required_text = '', $label_class = '', $disabled = FALSE, $system_ID = FALSE, $use_html_entities = TRUE) {
1009 1009
 		// need these
1010
-		if ( ! $question || ! $name ) {
1010
+		if ( ! $question || ! $name) {
1011 1011
 			return NULL;
1012 1012
 		}
1013 1013
 		// prep the answer
1014
-		$answer = is_array( $answer ) ? '' : self::prep_answer( $answer, $use_html_entities );
1014
+		$answer = is_array($answer) ? '' : self::prep_answer($answer, $use_html_entities);
1015 1015
 		// prep the required array
1016
-		$required = self::prep_required( $required );
1016
+		$required = self::prep_required($required);
1017 1017
 		// set disabled tag
1018
-		$disabled = $answer === NULL || ! $disabled  ? '' : ' disabled="disabled"';
1018
+		$disabled = $answer === NULL || ! $disabled ? '' : ' disabled="disabled"';
1019 1019
 		// ya gots ta have style man!!!
1020 1020
 		$txt_class = is_admin() ? 'regular-text' : 'espresso-datepicker-inp';
1021
-		$class = empty( $class ) ? $txt_class : $class;
1022
-		$class .= ! empty( $system_ID ) ? ' ' . $system_ID : '';
1023
-		$extra = apply_filters( 'FHEE__EEH_Form_Fields__additional_form_field_attributes', '' );
1021
+		$class = empty($class) ? $txt_class : $class;
1022
+		$class .= ! empty($system_ID) ? ' '.$system_ID : '';
1023
+		$extra = apply_filters('FHEE__EEH_Form_Fields__additional_form_field_attributes', '');
1024 1024
 
1025
-		$label_html = $required_text . "\n\t\t\t" . '<label for="' . $name . '" class="' . $label_class . '">' . self::prep_question( $question ) . $required['label'] . '</label><br/>';
1025
+		$label_html = $required_text."\n\t\t\t".'<label for="'.$name.'" class="'.$label_class.'">'.self::prep_question($question).$required['label'].'</label><br/>';
1026 1026
 		// filter label but ensure required text comes before it
1027
-		$label_html = apply_filters( 'FHEE__EEH_Form_Fields__label_html', $label_html, $required_text );
1027
+		$label_html = apply_filters('FHEE__EEH_Form_Fields__label_html', $label_html, $required_text);
1028 1028
 
1029
-		$input_html = "\n\t\t\t" . '<input type="text" name="' . $name . '" id="' . $id . '" class="' . $class . ' ' . $required['class'] . ' datepicker" value="' . $answer . '"  title="' . esc_attr( $required['msg'] ) . '" ' . $disabled . ' ' . $extra . '/>';
1029
+		$input_html = "\n\t\t\t".'<input type="text" name="'.$name.'" id="'.$id.'" class="'.$class.' '.$required['class'].' datepicker" value="'.$answer.'"  title="'.esc_attr($required['msg']).'" '.$disabled.' '.$extra.'/>';
1030 1030
 
1031 1031
 		// enqueue scripts
1032
-		wp_register_style( 'espresso-ui-theme', EE_GLOBAL_ASSETS_URL . 'css/espresso-ui-theme/jquery-ui-1.10.3.custom.min.css', array(), EVENT_ESPRESSO_VERSION );
1033
-		wp_enqueue_style( 'espresso-ui-theme');
1034
-		wp_enqueue_script( 'jquery-ui-datepicker' );
1032
+		wp_register_style('espresso-ui-theme', EE_GLOBAL_ASSETS_URL.'css/espresso-ui-theme/jquery-ui-1.10.3.custom.min.css', array(), EVENT_ESPRESSO_VERSION);
1033
+		wp_enqueue_style('espresso-ui-theme');
1034
+		wp_enqueue_script('jquery-ui-datepicker');
1035 1035
 
1036
-		$input_html =  apply_filters( 'FHEE__EEH_Form_Fields__input_html', $input_html, $label_html, $id );
1037
-		return  $label_html . $input_html;
1036
+		$input_html = apply_filters('FHEE__EEH_Form_Fields__input_html', $input_html, $label_html, $id);
1037
+		return  $label_html.$input_html;
1038 1038
 
1039 1039
 	}
1040 1040
 
@@ -1046,7 +1046,7 @@  discard block
 block discarded – undo
1046 1046
 	 * 	@access public
1047 1047
 	 * 	@return 	string
1048 1048
 	 */
1049
-	public static function remove_label_keep_required_msg( $label_html, $required_text ) {
1049
+	public static function remove_label_keep_required_msg($label_html, $required_text) {
1050 1050
 		return $required_text;
1051 1051
 	}
1052 1052
 
@@ -1060,9 +1060,9 @@  discard block
 block discarded – undo
1060 1060
 	 * @param string $value
1061 1061
 	 * @return string HTML
1062 1062
 	 */
1063
-	static function hidden_input( $name, $value, $id = '' ){
1064
-		$id = ! empty( $id ) ? $id : $name;
1065
-		return '<input id="' . $id . '" type="hidden" name="'.$name.'" value="' .  $value . '"/>';
1063
+	static function hidden_input($name, $value, $id = '') {
1064
+		$id = ! empty($id) ? $id : $name;
1065
+		return '<input id="'.$id.'" type="hidden" name="'.$name.'" value="'.$value.'"/>';
1066 1066
 	}
1067 1067
 
1068 1068
 
@@ -1074,7 +1074,7 @@  discard block
 block discarded – undo
1074 1074
 	 * @param string $question
1075 1075
 	 * @return string
1076 1076
 	 */
1077
-	static function prep_question( $question ){
1077
+	static function prep_question($question) {
1078 1078
 		return $question;
1079 1079
 //		$link = '';
1080 1080
 //		// does this label have a help link attached ?
@@ -1097,13 +1097,13 @@  discard block
 block discarded – undo
1097 1097
 	 * @param mixed $answer
1098 1098
 	 * @return string
1099 1099
 	 */
1100
-	static function prep_answer( $answer, $use_html_entities = TRUE ){
1100
+	static function prep_answer($answer, $use_html_entities = TRUE) {
1101 1101
 		//make sure we convert bools first.  Otherwise (bool) false becomes an empty string which is NOT desired, we want "0".
1102
-		if ( is_bool( $answer ) ) {
1102
+		if (is_bool($answer)) {
1103 1103
 			$answer = $answer ? 1 : 0;
1104 1104
 		}
1105
-		$answer = trim( stripslashes( str_replace( '&#039;', "'", $answer )));
1106
-		return $use_html_entities ? htmlentities( $answer, ENT_QUOTES, 'UTF-8' ) : $answer;
1105
+		$answer = trim(stripslashes(str_replace('&#039;', "'", $answer)));
1106
+		return $use_html_entities ? htmlentities($answer, ENT_QUOTES, 'UTF-8') : $answer;
1107 1107
 	}
1108 1108
 
1109 1109
 
@@ -1113,18 +1113,18 @@  discard block
 block discarded – undo
1113 1113
 	 * 	@param array $QSOs  array of EE_Question_Option objects
1114 1114
 	 * 	@return array
1115 1115
 	 */
1116
-	public static function prep_answer_options( $QSOs = array() ){
1116
+	public static function prep_answer_options($QSOs = array()) {
1117 1117
 		$prepped_answer_options = array();
1118
-		if ( is_array( $QSOs ) && ! empty( $QSOs )) {
1119
-			foreach( $QSOs as $key => $QSO ) {
1120
-				if ( ! $QSO instanceof EE_Question_Option ) {
1121
-					$QSO = EE_Question_Option::new_instance( array(
1122
-						'QSO_value' => is_array( $QSO ) && isset( $QSO['id'] ) ? (string)$QSO['id'] : (string)$key,
1123
-						'QSO_desc' => is_array( $QSO ) && isset( $QSO['text'] ) ? (string)$QSO['text'] : (string)$QSO
1118
+		if (is_array($QSOs) && ! empty($QSOs)) {
1119
+			foreach ($QSOs as $key => $QSO) {
1120
+				if ( ! $QSO instanceof EE_Question_Option) {
1121
+					$QSO = EE_Question_Option::new_instance(array(
1122
+						'QSO_value' => is_array($QSO) && isset($QSO['id']) ? (string) $QSO['id'] : (string) $key,
1123
+						'QSO_desc' => is_array($QSO) && isset($QSO['text']) ? (string) $QSO['text'] : (string) $QSO
1124 1124
 					));
1125 1125
 				}
1126
-				if ( $QSO->opt_group() ) {
1127
-					$prepped_answer_options[ $QSO->opt_group() ][] = $QSO;
1126
+				if ($QSO->opt_group()) {
1127
+					$prepped_answer_options[$QSO->opt_group()][] = $QSO;
1128 1128
 				} else {
1129 1129
 					$prepped_answer_options[] = $QSO;
1130 1130
 				}
@@ -1140,8 +1140,8 @@  discard block
 block discarded – undo
1140 1140
 	 * @param string $option_value
1141 1141
 	 * @return string
1142 1142
 	 */
1143
-	static function prep_option_value( $option_value ){
1144
-		return esc_attr( trim( stripslashes( $option_value ) ) );
1143
+	static function prep_option_value($option_value) {
1144
+		return esc_attr(trim(stripslashes($option_value)));
1145 1145
 	}
1146 1146
 
1147 1147
 
@@ -1152,11 +1152,11 @@  discard block
 block discarded – undo
1152 1152
 	 * @param string|array 	$required
1153 1153
 	 * @return array
1154 1154
 	 */
1155
-	static function prep_required( $required = array() ){
1155
+	static function prep_required($required = array()) {
1156 1156
 		// make sure required is an array
1157
-		$required = is_array( $required ) ? $required : array();
1157
+		$required = is_array($required) ? $required : array();
1158 1158
 		// and set some defaults
1159
-		$required = array_merge( array( 'label' => '', 'class' => '', 'msg' => '' ), $required );
1159
+		$required = array_merge(array('label' => '', 'class' => '', 'msg' => ''), $required);
1160 1160
 		return $required;
1161 1161
 	}
1162 1162
 
@@ -1167,30 +1167,30 @@  discard block
 block discarded – undo
1167 1167
 	 * @param string 	$value
1168 1168
 	 * @return string
1169 1169
 	 */
1170
-	static function get_label_size_class( $value = FALSE ){
1171
-			if ( $value === FALSE || $value == '' ) {
1170
+	static function get_label_size_class($value = FALSE) {
1171
+			if ($value === FALSE || $value == '') {
1172 1172
 				return ' class="medium-lbl"';
1173 1173
 			}
1174 1174
 			// determine length of option value
1175
-			$val_size = strlen( $value );
1176
-			switch( $val_size ){
1175
+			$val_size = strlen($value);
1176
+			switch ($val_size) {
1177 1177
 				case $val_size < 3 :
1178
-					$size =  ' class="nano-lbl"';
1178
+					$size = ' class="nano-lbl"';
1179 1179
 					break;
1180 1180
 				case $val_size < 6 :
1181
-					$size =  ' class="micro-lbl"';
1181
+					$size = ' class="micro-lbl"';
1182 1182
 					break;
1183 1183
 				case $val_size < 12 :
1184
-					$size =  ' class="tiny-lbl"';
1184
+					$size = ' class="tiny-lbl"';
1185 1185
 					break;
1186 1186
 				case $val_size < 25 :
1187
-					$size =  ' class="small-lbl"';
1187
+					$size = ' class="small-lbl"';
1188 1188
 					break;
1189 1189
 				case $val_size > 100 :
1190
-					$size =  ' class="big-lbl"';
1190
+					$size = ' class="big-lbl"';
1191 1191
 					break;
1192 1192
 				default:
1193
-					$size =  ' class="medium-lbl"';
1193
+					$size = ' class="medium-lbl"';
1194 1194
 					break;
1195 1195
 			}
1196 1196
 		return $size;
@@ -1204,20 +1204,20 @@  discard block
 block discarded – undo
1204 1204
 	 * @param array 	$QFI
1205 1205
 	 * @return array
1206 1206
 	 */
1207
-	private static function _load_system_dropdowns( $QFI ){
1207
+	private static function _load_system_dropdowns($QFI) {
1208 1208
 		$QST_system = $QFI->get('QST_system');
1209
-		switch ( $QST_system ) {
1209
+		switch ($QST_system) {
1210 1210
 			case 'state' :
1211
-				$QFI = self::generate_state_dropdown( $QFI );
1211
+				$QFI = self::generate_state_dropdown($QFI);
1212 1212
 				break;
1213 1213
 			case 'country' :
1214
-				$QFI = self::generate_country_dropdown( $QFI );
1214
+				$QFI = self::generate_country_dropdown($QFI);
1215 1215
 				break;
1216 1216
 			case 'admin-state' :
1217
-				$QFI = self::generate_state_dropdown( $QFI, TRUE );
1217
+				$QFI = self::generate_state_dropdown($QFI, TRUE);
1218 1218
 				break;
1219 1219
 			case 'admin-country' :
1220
-				$QFI = self::generate_country_dropdown( $QFI, TRUE );
1220
+				$QFI = self::generate_country_dropdown($QFI, TRUE);
1221 1221
 				break;
1222 1222
 		}
1223 1223
 		return $QFI;
@@ -1234,13 +1234,13 @@  discard block
 block discarded – undo
1234 1234
 	 *
1235 1235
 	 * @return EE_Question_Form_Input
1236 1236
 	 */
1237
-	protected static function _load_specialized_dropdowns( $QFI ) {
1238
-		switch( $QFI->get( 'QST_type' ) ) {
1237
+	protected static function _load_specialized_dropdowns($QFI) {
1238
+		switch ($QFI->get('QST_type')) {
1239 1239
 			case 'STATE' :
1240
-				$QFI = self::generate_state_dropdown( $QFI );
1240
+				$QFI = self::generate_state_dropdown($QFI);
1241 1241
 				break;
1242 1242
 			case 'COUNTRY' :
1243
-				$QFI = self::generate_country_dropdown( $QFI );
1243
+				$QFI = self::generate_country_dropdown($QFI);
1244 1244
 				break;
1245 1245
 		}
1246 1246
 		return $QFI;
@@ -1254,23 +1254,23 @@  discard block
 block discarded – undo
1254 1254
 	 * @param bool  $get_all
1255 1255
 	 * @return array
1256 1256
 	 */
1257
-	public static function generate_state_dropdown( $QST, $get_all = FALSE ){
1257
+	public static function generate_state_dropdown($QST, $get_all = FALSE) {
1258 1258
 		$states = $get_all ? EEM_State::instance()->get_all_states() : EEM_State::instance()->get_all_states_of_active_countries();
1259
-		if ( $states && count( $states ) != count( $QST->options() )) {
1260
-			$QST->set( 'QST_type', 'DROPDOWN' );
1259
+		if ($states && count($states) != count($QST->options())) {
1260
+			$QST->set('QST_type', 'DROPDOWN');
1261 1261
 			// if multiple countries, we'll create option groups within the dropdown
1262
-			foreach ( $states as $state ) {
1263
-				if ( $state instanceof EE_State ) {
1264
-					$QSO = EE_Question_Option::new_instance ( array (
1262
+			foreach ($states as $state) {
1263
+				if ($state instanceof EE_State) {
1264
+					$QSO = EE_Question_Option::new_instance(array(
1265 1265
 						'QSO_value' => $state->ID(),
1266 1266
 						'QSO_desc' => $state->name(),
1267
-						'QST_ID' => $QST->get( 'QST_ID' ),
1267
+						'QST_ID' => $QST->get('QST_ID'),
1268 1268
 						'QSO_deleted' => FALSE
1269 1269
 					));
1270 1270
 					// set option group
1271
-					$QSO->set_opt_group( $state->country()->name() );
1271
+					$QSO->set_opt_group($state->country()->name());
1272 1272
 					// add option to question
1273
-					$QST->add_temp_option( $QSO );
1273
+					$QST->add_temp_option($QSO);
1274 1274
 				}
1275 1275
 			}
1276 1276
 		}
@@ -1286,20 +1286,20 @@  discard block
 block discarded – undo
1286 1286
 	 * @internal param array $question
1287 1287
 	 * @return array
1288 1288
 	 */
1289
-	public static function generate_country_dropdown( $QST, $get_all = FALSE ){
1289
+	public static function generate_country_dropdown($QST, $get_all = FALSE) {
1290 1290
 		$countries = $get_all ? EEM_Country::instance()->get_all_countries() : EEM_Country::instance()->get_all_active_countries();
1291
-		if ( $countries && count( $countries ) != count( $QST->options() ) ) {
1292
-			$QST->set( 'QST_type', 'DROPDOWN' );
1291
+		if ($countries && count($countries) != count($QST->options())) {
1292
+			$QST->set('QST_type', 'DROPDOWN');
1293 1293
 			// now add countries
1294
-			foreach ( $countries as $country ) {
1295
-				if ( $country instanceof EE_Country ) {
1296
-					$QSO = EE_Question_Option::new_instance ( array (
1294
+			foreach ($countries as $country) {
1295
+				if ($country instanceof EE_Country) {
1296
+					$QSO = EE_Question_Option::new_instance(array(
1297 1297
 						'QSO_value' => $country->ID(),
1298 1298
 						'QSO_desc' => $country->name(),
1299
-						'QST_ID' => $QST->get( 'QST_ID' ),
1299
+						'QST_ID' => $QST->get('QST_ID'),
1300 1300
 						'QSO_deleted' => FALSE
1301 1301
 					));
1302
-					$QST->add_temp_option( $QSO );
1302
+					$QST->add_temp_option($QSO);
1303 1303
 				}
1304 1304
 			}
1305 1305
 		}
@@ -1316,11 +1316,11 @@  discard block
 block discarded – undo
1316 1316
 	 */
1317 1317
 	public static function two_digit_months_dropdown_options() {
1318 1318
 		$options = array();
1319
-		for ( $x = 1; $x <= 12; $x++ ) {
1320
-			$mm = str_pad( $x, 2, '0', STR_PAD_LEFT );
1321
-			$options[ (string)$mm ] = (string)$mm;
1319
+		for ($x = 1; $x <= 12; $x++) {
1320
+			$mm = str_pad($x, 2, '0', STR_PAD_LEFT);
1321
+			$options[(string) $mm] = (string) $mm;
1322 1322
 		}
1323
-		return EEH_Form_Fields::prep_answer_options( $options );
1323
+		return EEH_Form_Fields::prep_answer_options($options);
1324 1324
 	}
1325 1325
 
1326 1326
 
@@ -1335,11 +1335,11 @@  discard block
 block discarded – undo
1335 1335
 		$options = array();
1336 1336
 		$current_year = date('y');
1337 1337
 		$next_decade = $current_year + 10;
1338
-		for ( $x = $current_year; $x <= $next_decade; $x++ ) {
1339
-			$yy = str_pad( $x, 2, '0', STR_PAD_LEFT );
1340
-			$options[ (string)$yy ] = (string)$yy;
1338
+		for ($x = $current_year; $x <= $next_decade; $x++) {
1339
+			$yy = str_pad($x, 2, '0', STR_PAD_LEFT);
1340
+			$options[(string) $yy] = (string) $yy;
1341 1341
 		}
1342
-		return EEH_Form_Fields::prep_answer_options( $options );
1342
+		return EEH_Form_Fields::prep_answer_options($options);
1343 1343
 	}
1344 1344
 
1345 1345
 
@@ -1353,17 +1353,17 @@  discard block
 block discarded – undo
1353 1353
 	 * @param  integer $evt_category Event Category ID if the Event Category filter is selected
1354 1354
 	 * @return string                html
1355 1355
 	 */
1356
-	public static function generate_registration_months_dropdown( $cur_date = '', $status = '', $evt_category = 0 ) {
1356
+	public static function generate_registration_months_dropdown($cur_date = '', $status = '', $evt_category = 0) {
1357 1357
 		$_where = array();
1358
-		if ( !empty( $status ) ) {
1358
+		if ( ! empty($status)) {
1359 1359
 			$_where['STS_ID'] = $status;
1360 1360
 		}
1361 1361
 
1362
-		if ( $evt_category > 0 ) {
1362
+		if ($evt_category > 0) {
1363 1363
 			$_where['Event.Term_Taxonomy.term_id'] = $evt_category;
1364 1364
 		}
1365 1365
 
1366
-		$regdtts = EEM_Registration::instance()->get_reg_months_and_years( $_where );
1366
+		$regdtts = EEM_Registration::instance()->get_reg_months_and_years($_where);
1367 1367
 
1368 1368
 		//setup vals for select input helper
1369 1369
 		$options = array(
@@ -1373,15 +1373,15 @@  discard block
 block discarded – undo
1373 1373
 				)
1374 1374
 			);
1375 1375
 
1376
-		foreach ( $regdtts as $regdtt ) {
1377
-			$date = $regdtt->reg_month. ' ' . $regdtt->reg_year;
1376
+		foreach ($regdtts as $regdtt) {
1377
+			$date = $regdtt->reg_month.' '.$regdtt->reg_year;
1378 1378
 			$options[] = array(
1379 1379
 				'text' => $date,
1380 1380
 				'id' => $date
1381 1381
 				);
1382 1382
 		}
1383 1383
 
1384
-		return self::select_input('month_range', $options, $cur_date, '', 'wide' );
1384
+		return self::select_input('month_range', $options, $cur_date, '', 'wide');
1385 1385
 	}
1386 1386
 
1387 1387
 
@@ -1395,18 +1395,18 @@  discard block
 block discarded – undo
1395 1395
 	 * @param  string $evt_active_status "upcoming", "expired", "active", or "inactive"
1396 1396
 	 * @return string                    html
1397 1397
 	 */
1398
-	public static function generate_event_months_dropdown( $cur_date = '', $status = NULL, $evt_category = NULL, $evt_active_status = NULL ) {
1398
+	public static function generate_event_months_dropdown($cur_date = '', $status = NULL, $evt_category = NULL, $evt_active_status = NULL) {
1399 1399
 		//determine what post_status our condition will have for the query.
1400
-		switch ( $status ) {
1400
+		switch ($status) {
1401 1401
 			case 'month' :
1402 1402
 			case 'today' :
1403 1403
 			case NULL :
1404 1404
 			case 'all' :
1405
-				$where['Event.status'] = array( 'NOT IN', array('trash') );
1405
+				$where['Event.status'] = array('NOT IN', array('trash'));
1406 1406
 				break;
1407 1407
 
1408 1408
 			case 'draft' :
1409
-				$where['Event.status'] = array( 'IN', array('draft', 'auto-draft') );
1409
+				$where['Event.status'] = array('IN', array('draft', 'auto-draft'));
1410 1410
 
1411 1411
 			default :
1412 1412
 				$where['Event.status'] = $status;
@@ -1415,7 +1415,7 @@  discard block
 block discarded – undo
1415 1415
 		//categories?
1416 1416
 
1417 1417
 
1418
-		if ( !empty ( $evt_category ) ) {
1418
+		if ( ! empty ($evt_category)) {
1419 1419
 			$where['Event.Term_Taxonomy.taxonomy'] = 'espresso_event_categories';
1420 1420
 			$where['Event.Term_Taxonomy.term_id'] = $evt_category;
1421 1421
 		}
@@ -1423,7 +1423,7 @@  discard block
 block discarded – undo
1423 1423
 
1424 1424
 //		$where['DTT_is_primary'] = 1;
1425 1425
 
1426
-		$DTTS = EE_Registry::instance()->load_model('Datetime')->get_dtt_months_and_years($where, $evt_active_status );
1426
+		$DTTS = EE_Registry::instance()->load_model('Datetime')->get_dtt_months_and_years($where, $evt_active_status);
1427 1427
 
1428 1428
 		//let's setup vals for select input helper
1429 1429
 		$options = array(
@@ -1438,9 +1438,9 @@  discard block
 block discarded – undo
1438 1438
 		//translate month and date
1439 1439
 		global $wp_locale;
1440 1440
 
1441
-		foreach ( $DTTS as $DTT ) {
1442
-			$localized_date = $wp_locale->get_month( $DTT->dtt_month_num ) . ' ' . $DTT->dtt_year;
1443
-			$id = $DTT->dtt_month . ' ' . $DTT->dtt_year;
1441
+		foreach ($DTTS as $DTT) {
1442
+			$localized_date = $wp_locale->get_month($DTT->dtt_month_num).' '.$DTT->dtt_year;
1443
+			$id = $DTT->dtt_month.' '.$DTT->dtt_year;
1444 1444
 			$options[] = array(
1445 1445
 				'text' => $localized_date,
1446 1446
 				'id' => $id
@@ -1448,7 +1448,7 @@  discard block
 block discarded – undo
1448 1448
 		}
1449 1449
 
1450 1450
 
1451
-		return self::select_input( 'month_range', $options, $cur_date, '', 'wide' );
1451
+		return self::select_input('month_range', $options, $cur_date, '', 'wide');
1452 1452
 	}
1453 1453
 
1454 1454
 
@@ -1459,7 +1459,7 @@  discard block
 block discarded – undo
1459 1459
 	 * @param  integer $current_cat currently selected category
1460 1460
 	 * @return string               html for dropdown
1461 1461
 	 */
1462
-	public static function generate_event_category_dropdown( $current_cat = -1 ) {
1462
+	public static function generate_event_category_dropdown($current_cat = -1) {
1463 1463
 		$categories = EEM_Term::instance()->get_all_ee_categories(TRUE);
1464 1464
 		$options = array(
1465 1465
 			'0' => array(
@@ -1469,14 +1469,14 @@  discard block
 block discarded – undo
1469 1469
 			);
1470 1470
 
1471 1471
 		//setup categories for dropdown
1472
-		foreach ( $categories as $category ) {
1472
+		foreach ($categories as $category) {
1473 1473
 			$options[] = array(
1474 1474
 				'text' => $category->get('name'),
1475 1475
 				'id' => $category->ID()
1476 1476
 				);
1477 1477
 		}
1478 1478
 
1479
-		return self::select_input( 'EVT_CAT', $options, $current_cat );
1479
+		return self::select_input('EVT_CAT', $options, $current_cat);
1480 1480
 	}
1481 1481
 
1482 1482
 
@@ -1495,20 +1495,20 @@  discard block
 block discarded – undo
1495 1495
 	 * @param    string   $extra_attributes - any extra attributes that need to be attached to the form input
1496 1496
 	 * @return    void
1497 1497
 	 */
1498
-	public static function submit_button( $url = '', $ID = '', $class = '', $text = '', $nonce_action = '', $input_only = FALSE, $extra_attributes = '' ) {
1498
+	public static function submit_button($url = '', $ID = '', $class = '', $text = '', $nonce_action = '', $input_only = FALSE, $extra_attributes = '') {
1499 1499
 		$btn = '';
1500
-		if ( empty( $url ) || empty( $ID )) {
1500
+		if (empty($url) || empty($ID)) {
1501 1501
 			return $btn;
1502 1502
 		}
1503
-		$text = ! empty( $text ) ? $text : __('Submit', 'event_espresso' );
1504
-		$btn .= '<input id="' . $ID . '-btn" class="' . $class . '" type="submit" value="' . $text . '" ' . $extra_attributes . '/>';
1505
-		if ( ! $input_only ) {
1506
-			$btn_frm = '<form id="' . $ID . '-frm" method="POST" action="' . $url . '">';
1507
-			$btn_frm .= ! empty( $nonce_action ) ? wp_nonce_field( $nonce_action, $nonce_action . '_nonce', TRUE, FALSE ) : '';
1503
+		$text = ! empty($text) ? $text : __('Submit', 'event_espresso');
1504
+		$btn .= '<input id="'.$ID.'-btn" class="'.$class.'" type="submit" value="'.$text.'" '.$extra_attributes.'/>';
1505
+		if ( ! $input_only) {
1506
+			$btn_frm = '<form id="'.$ID.'-frm" method="POST" action="'.$url.'">';
1507
+			$btn_frm .= ! empty($nonce_action) ? wp_nonce_field($nonce_action, $nonce_action.'_nonce', TRUE, FALSE) : '';
1508 1508
 			$btn_frm .= $btn;
1509 1509
 			$btn_frm .= '</form>';
1510 1510
 			$btn = $btn_frm;
1511
-			unset ( $btn_frm );
1511
+			unset ($btn_frm);
1512 1512
 		}
1513 1513
 		return $btn;
1514 1514
 	}
Please login to merge, or discard this patch.
core/helpers/EEH_Maps.helper.php 2 patches
Doc Comments   -2 removed lines patch added patch discarded remove patch
@@ -31,7 +31,6 @@  discard block
 block discarded – undo
31 31
 
32 32
 	/**
33 33
 	 * google_map - creates a Google Map Link
34
-	 * @param  array $atts aray of attributes required for the map link generation
35 34
 	 * @return string (link to map!)
36 35
 	 */
37 36
 	public static function google_map( $ee_gmaps_opts ){
@@ -116,7 +115,6 @@  discard block
 block discarded – undo
116 115
 
117 116
 	/**
118 117
 	 * creates a Google Map Link
119
-	 * @param  array $atts aray of attributes required for the map link generation
120 118
 	 * @return string (link to map!)
121 119
 	 */
122 120
 	public static function espresso_google_map_js() {
Please login to merge, or discard this patch.
Spacing   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -34,20 +34,20 @@  discard block
 block discarded – undo
34 34
 	 * @param  array $atts aray of attributes required for the map link generation
35 35
 	 * @return string (link to map!)
36 36
 	 */
37
-	public static function google_map( $ee_gmaps_opts ){
37
+	public static function google_map($ee_gmaps_opts) {
38 38
 
39 39
 		//d( $ee_gmaps_opts );
40 40
 
41
-		$ee_map_width = isset( $ee_gmaps_opts['ee_map_width'] ) && ! empty( $ee_gmaps_opts['ee_map_width'] ) ? $ee_gmaps_opts['ee_map_width'] : '300';
42
-		$ee_map_height = isset( $ee_gmaps_opts['ee_map_height'] ) && ! empty( $ee_gmaps_opts['ee_map_height'] ) ? $ee_gmaps_opts['ee_map_height'] : '185';
43
-		$ee_map_zoom = isset( $ee_gmaps_opts['ee_map_zoom'] ) && ! empty( $ee_gmaps_opts['ee_map_zoom'] ) ? $ee_gmaps_opts['ee_map_zoom'] : '12';
44
-		$ee_map_nav_display = isset( $ee_gmaps_opts['ee_map_nav_display'] ) && ! empty( $ee_gmaps_opts['ee_map_nav_display'] ) ? 'true' : 'false';
45
-		$ee_map_nav_size =  isset( $ee_gmaps_opts['ee_map_nav_size'] ) && ! empty( $ee_gmaps_opts['ee_map_nav_size'] )? $ee_gmaps_opts['ee_map_nav_size'] : 'default';
46
-		$ee_map_type_control =  isset( $ee_gmaps_opts['ee_map_type_control'] ) && ! empty( $ee_gmaps_opts['ee_map_type_control'] )? $ee_gmaps_opts['ee_map_type_control'] : 'default';
47
-		$static_url =  isset( $ee_gmaps_opts['ee_static_url'] ) && ! empty( $ee_gmaps_opts['ee_static_url'] )? $ee_gmaps_opts['ee_static_url'] : FALSE;
41
+		$ee_map_width = isset($ee_gmaps_opts['ee_map_width']) && ! empty($ee_gmaps_opts['ee_map_width']) ? $ee_gmaps_opts['ee_map_width'] : '300';
42
+		$ee_map_height = isset($ee_gmaps_opts['ee_map_height']) && ! empty($ee_gmaps_opts['ee_map_height']) ? $ee_gmaps_opts['ee_map_height'] : '185';
43
+		$ee_map_zoom = isset($ee_gmaps_opts['ee_map_zoom']) && ! empty($ee_gmaps_opts['ee_map_zoom']) ? $ee_gmaps_opts['ee_map_zoom'] : '12';
44
+		$ee_map_nav_display = isset($ee_gmaps_opts['ee_map_nav_display']) && ! empty($ee_gmaps_opts['ee_map_nav_display']) ? 'true' : 'false';
45
+		$ee_map_nav_size = isset($ee_gmaps_opts['ee_map_nav_size']) && ! empty($ee_gmaps_opts['ee_map_nav_size']) ? $ee_gmaps_opts['ee_map_nav_size'] : 'default';
46
+		$ee_map_type_control = isset($ee_gmaps_opts['ee_map_type_control']) && ! empty($ee_gmaps_opts['ee_map_type_control']) ? $ee_gmaps_opts['ee_map_type_control'] : 'default';
47
+		$static_url = isset($ee_gmaps_opts['ee_static_url']) && ! empty($ee_gmaps_opts['ee_static_url']) ? $ee_gmaps_opts['ee_static_url'] : FALSE;
48 48
 
49
-		if( isset( $ee_gmaps_opts['ee_map_align'] ) && ! empty( $ee_gmaps_opts['ee_map_align'] )){
50
-			switch( $ee_gmaps_opts['ee_map_align'] ){
49
+		if (isset($ee_gmaps_opts['ee_map_align']) && ! empty($ee_gmaps_opts['ee_map_align'])) {
50
+			switch ($ee_gmaps_opts['ee_map_align']) {
51 51
 				case "left":
52 52
 					$map_align = 'ee-gmap-align-left left';
53 53
 					break;
@@ -68,18 +68,18 @@  discard block
 block discarded – undo
68 68
 
69 69
 		// Determine whether user has set a hardoded url to use and
70 70
 		// if so display a Google static iframe map else run V3 api
71
-		if( $static_url ) {
71
+		if ($static_url) {
72 72
 
73
-			$html = '<div class="ee-gmap-iframewrap ee-gmap-wrapper ' . $map_align . '">';
74
-			$html .= '<iframe src="' . $static_url . '&output=embed" style="width: ' . $ee_map_width  .'px; height: ' . $ee_map_height . 'px;" frameborder="0" scrolling="no">';
73
+			$html = '<div class="ee-gmap-iframewrap ee-gmap-wrapper '.$map_align.'">';
74
+			$html .= '<iframe src="'.$static_url.'&output=embed" style="width: '.$ee_map_width.'px; height: '.$ee_map_height.'px;" frameborder="0" scrolling="no">';
75 75
 			$html .= '</iframe>';
76
-			$html .= '<a href="' . $static_url . '">View Large map</a>';
76
+			$html .= '<a href="'.$static_url.'">View Large map</a>';
77 77
 			$html .= '</div>';
78 78
 			return $html;
79 79
 
80 80
 		 } else {
81 81
 
82
-			EEH_Maps::$gmap_vars[ $ee_gmaps_opts['map_ID'] ] = array(
82
+			EEH_Maps::$gmap_vars[$ee_gmaps_opts['map_ID']] = array(
83 83
 				'map_ID' => $ee_gmaps_opts['map_ID'],
84 84
 				'ee_map_zoom' => $ee_map_zoom,
85 85
 				'ee_map_nav_display' => $ee_map_nav_display,
@@ -89,12 +89,12 @@  discard block
 block discarded – undo
89 89
 			);
90 90
 
91 91
 			$html = '<div class="ee-gmap-wrapper '.$map_align.';">';
92
-			$html .= '<div class="ee-gmap" id="map_canvas_' . $ee_gmaps_opts['map_ID'] .'" style="width: '.$ee_map_width.'px; height: '.$ee_map_height.'px;"></div>';  //
92
+			$html .= '<div class="ee-gmap" id="map_canvas_'.$ee_gmaps_opts['map_ID'].'" style="width: '.$ee_map_width.'px; height: '.$ee_map_height.'px;"></div>'; //
93 93
 			$html .= '</div>';
94 94
 
95
-			wp_enqueue_script( 'gmap_api' );
96
-			wp_enqueue_script( 'ee_gmap' );
97
-			add_action( 'wp_footer', array( 'EEH_Maps', 'footer_enqueue_script' ));
95
+			wp_enqueue_script('gmap_api');
96
+			wp_enqueue_script('ee_gmap');
97
+			add_action('wp_footer', array('EEH_Maps', 'footer_enqueue_script'));
98 98
 
99 99
 			return $html;
100 100
 
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
 	 * @return void
110 110
 	 */
111 111
 	public static function footer_enqueue_script() {
112
-		wp_localize_script( 'ee_gmap', 'ee_gmap_vars', EEH_Maps::$gmap_vars );
112
+		wp_localize_script('ee_gmap', 'ee_gmap_vars', EEH_Maps::$gmap_vars);
113 113
 	}
114 114
 
115 115
 
@@ -121,8 +121,8 @@  discard block
 block discarded – undo
121 121
 	 */
122 122
 	public static function espresso_google_map_js() {
123 123
 		$scheme = is_ssl() ? 'https://' : 'http://';
124
-		wp_register_script( 'gmap_api', $scheme . 'maps.google.com/maps/api/js?sensor=false', array('jquery'), NULL, TRUE );
125
-		wp_register_script( 'ee_gmap', plugin_dir_url(__FILE__) . 'assets/ee_gmap.js', array('gmap_api'), '1.0', TRUE );
124
+		wp_register_script('gmap_api', $scheme.'maps.google.com/maps/api/js?sensor=false', array('jquery'), NULL, TRUE);
125
+		wp_register_script('ee_gmap', plugin_dir_url(__FILE__).'assets/ee_gmap.js', array('gmap_api'), '1.0', TRUE);
126 126
 	}
127 127
 
128 128
 	/**
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
 	 * @return string (link to map!)
132 132
 	 */
133 133
 	public static function google_map_link($atts) {
134
-		do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' );
134
+		do_action('AHEE_log', __FILE__, __FUNCTION__, '');
135 135
 		extract($atts);
136 136
 
137 137
 		$address = "{$address}";
@@ -146,9 +146,9 @@  discard block
 block discarded – undo
146 146
 		$id = isset($id) ? $id : 'not_set';
147 147
 		$map_image_class = isset($map_image_class) ? $map_image_class : 'ee_google_map_view';
148 148
 
149
-		$address_string = ($address != '' ? $address : '') . ($city != '' ? ',' . $city : '') . ($state != '' ? ',' . $state : '') . ($zip != '' ? ',' . $zip : '') . ($country != '' ? ',' . $country : '');
149
+		$address_string = ($address != '' ? $address : '').($city != '' ? ','.$city : '').($state != '' ? ','.$state : '').($zip != '' ? ','.$zip : '').($country != '' ? ','.$country : '');
150 150
 
151
-		$google_map = htmlentities2('http://maps.google.com/maps?q=' . urlencode( $address_string ));
151
+		$google_map = htmlentities2('http://maps.google.com/maps?q='.urlencode($address_string));
152 152
 
153 153
 		switch ($type) {
154 154
 			case 'text':
@@ -162,10 +162,10 @@  discard block
 block discarded – undo
162 162
 
163 163
 			case 'map':
164 164
 				$scheme = is_ssl() ? 'https://' : 'http://';
165
-				return '<a class="a_map_image_link" href="' . $google_map . '" target="_blank">' . '<img class="map_image_link" id="venue_map_' . $id . '" ' . $map_image_class . ' src="' . htmlentities2( $scheme . 'maps.googleapis.com/maps/api/staticmap?center=' . urlencode( $address_string ) . '&amp;zoom=14&amp;size=' . $map_w . 'x' . $map_h . '&amp;markers=color:green|label:|' . urlencode( $address_string ) . '&amp;sensor=false' ) . '" /></a>';
165
+				return '<a class="a_map_image_link" href="'.$google_map.'" target="_blank">'.'<img class="map_image_link" id="venue_map_'.$id.'" '.$map_image_class.' src="'.htmlentities2($scheme.'maps.googleapis.com/maps/api/staticmap?center='.urlencode($address_string).'&amp;zoom=14&amp;size='.$map_w.'x'.$map_h.'&amp;markers=color:green|label:|'.urlencode($address_string).'&amp;sensor=false').'" /></a>';
166 166
 		}
167 167
 
168
-		return '<a href="' . $google_map . '" target="_blank">' . $text . '</a>';
168
+		return '<a href="'.$google_map.'" target="_blank">'.$text.'</a>';
169 169
 	}
170 170
 
171 171
 
Please login to merge, or discard this patch.
core/helpers/EEH_Qtip_Loader.helper.php 3 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -109,7 +109,7 @@
 block discarded – undo
109 109
 	 * - registers and enqueues the qtip scripts and styles.
110 110
 	 *
111 111
 	 * @access public
112
-	 * @param  array  $paths      Array of paths to check for the EE_Qtip class. If present we check these path(s) first.  If not present (empty array), then it's assumed it's either in core/libraries/qtips OR the file is already loaded.
112
+	 * @param  string[]  $paths      Array of paths to check for the EE_Qtip class. If present we check these path(s) first.  If not present (empty array), then it's assumed it's either in core/libraries/qtips OR the file is already loaded.
113 113
 	 * @param  string|array $configname name of the Qtip class (full class name is expected and will be used for looking for file, Qtip config classes must extend EE_Qtip_Config) [if this is an array, then we loop through the array to instantiate and setup the qtips]
114 114
 	 * @return void
115 115
 	 */
Please login to merge, or discard this patch.
Spacing   +44 added lines, -44 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
 	 */
33 33
 	public static function instance() {
34 34
 		// check if class object is instantiated
35
-		if ( self::$_instance === NULL  or ! is_object( self::$_instance ) or ! ( self::$_instance instanceof EEH_Qtip_Loader )) {
35
+		if (self::$_instance === NULL or ! is_object(self::$_instance) or ! (self::$_instance instanceof EEH_Qtip_Loader)) {
36 36
 			self::$_instance = new self();
37 37
 		}
38 38
 		return self::$_instance;
@@ -48,8 +48,8 @@  discard block
 block discarded – undo
48 48
 	 */
49 49
 	private function __construct() {
50 50
 		//let's just make sure this is instantiated in the right place.
51
-		if ( did_action( 'wp_print_styles' ) || did_action( 'admin_head' )) {
52
-			EE_Error::doing_it_wrong( 'EEH_Qtip_Loader', __('This helper must be instantiated before or within a callback for the WordPress wp_enqueue_scripts hook action hook.', 'event_espresso' ), '4.1' );
51
+		if (did_action('wp_print_styles') || did_action('admin_head')) {
52
+			EE_Error::doing_it_wrong('EEH_Qtip_Loader', __('This helper must be instantiated before or within a callback for the WordPress wp_enqueue_scripts hook action hook.', 'event_espresso'), '4.1');
53 53
 		}
54 54
 	}
55 55
 
@@ -61,27 +61,27 @@  discard block
 block discarded – undo
61 61
 	 * @return void
62 62
 	 */
63 63
 	public function register_and_enqueue() {
64
-		$qtips_js = !defined('SCRIPT_DEBUG') ? EE_THIRD_PARTY_URL . 'qtip/jquery.qtip.min.js' : EE_THIRD_PARTY_URL . 'qtip/jquery.qtip.js';
65
-		$qtip_images_loaded = EE_THIRD_PARTY_URL . 'qtip/imagesloaded.pkg.min.js';
66
-		$qtip_map = EE_THIRD_PARTY_URL . 'qtip/jquery.qtip.min.map';
67
-		$qtipcss = !defined('SCRIPT_DEBUG') ? EE_THIRD_PARTY_URL . 'qtip/jquery.qtip.min.css' : EE_THIRD_PARTY_URL . 'qtip/jquery.qtip.css';
64
+		$qtips_js = ! defined('SCRIPT_DEBUG') ? EE_THIRD_PARTY_URL.'qtip/jquery.qtip.min.js' : EE_THIRD_PARTY_URL.'qtip/jquery.qtip.js';
65
+		$qtip_images_loaded = EE_THIRD_PARTY_URL.'qtip/imagesloaded.pkg.min.js';
66
+		$qtip_map = EE_THIRD_PARTY_URL.'qtip/jquery.qtip.min.map';
67
+		$qtipcss = ! defined('SCRIPT_DEBUG') ? EE_THIRD_PARTY_URL.'qtip/jquery.qtip.min.css' : EE_THIRD_PARTY_URL.'qtip/jquery.qtip.css';
68 68
 
69
-		wp_register_script('qtip-map', $qtip_map, array(), '3', TRUE );
70
-		wp_register_script('qtip-images-loaded', $qtip_images_loaded, array(), '2.2.0', TRUE );
71
-		wp_register_script('qtip', $qtips_js, array('jquery'), '2.2.0', TRUE );
72
-		wp_register_script('ee-qtip-helper', EE_HELPERS_ASSETS . 'ee-qtip-helper.js', array('qtip', 'jquery-cookie'), EVENT_ESPRESSO_VERSION, TRUE );
69
+		wp_register_script('qtip-map', $qtip_map, array(), '3', TRUE);
70
+		wp_register_script('qtip-images-loaded', $qtip_images_loaded, array(), '2.2.0', TRUE);
71
+		wp_register_script('qtip', $qtips_js, array('jquery'), '2.2.0', TRUE);
72
+		wp_register_script('ee-qtip-helper', EE_HELPERS_ASSETS.'ee-qtip-helper.js', array('qtip', 'jquery-cookie'), EVENT_ESPRESSO_VERSION, TRUE);
73 73
 
74
-		wp_register_style('qtip-css', $qtipcss, array(), '2.2' );
74
+		wp_register_style('qtip-css', $qtipcss, array(), '2.2');
75 75
 
76 76
 		//k now let's see if there are any registered qtips.  If there are, then we need to setup the localized script for ee-qtip-helper.js (and enqueue ee-qtip-helper.js of course!)
77
-		if ( !empty( $this->_qtips ) ) {
77
+		if ( ! empty($this->_qtips)) {
78 78
 			wp_enqueue_script('ee-qtip-helper');
79 79
 			wp_enqueue_style('qtip-css');
80 80
 			$qtips = array();
81
-			foreach ( $this->_qtips as $qtip ) {
81
+			foreach ($this->_qtips as $qtip) {
82 82
 				$qts = $qtip->get_tips();
83
-				foreach ( $qts as $qt ) {
84
-					if ( ! $qt instanceof EE_Qtip )
83
+				foreach ($qts as $qt) {
84
+					if ( ! $qt instanceof EE_Qtip)
85 85
 						continue;
86 86
 					$qtips[] = array(
87 87
 						'content_id' => $qt->content_id,
@@ -90,8 +90,8 @@  discard block
 block discarded – undo
90 90
 						);
91 91
 				}
92 92
 			}
93
-			if ( !empty($qtips) )
94
-				wp_localize_script('ee-qtip-helper', 'EE_QTIP_HELPER', array( 'qtips' => $qtips ) );
93
+			if ( ! empty($qtips))
94
+				wp_localize_script('ee-qtip-helper', 'EE_QTIP_HELPER', array('qtips' => $qtips));
95 95
 
96 96
 		} else {
97 97
 			//qtips has been requested without any registration (so assuming its just directly used in the admin).
@@ -113,24 +113,24 @@  discard block
 block discarded – undo
113 113
 	 * @param  string|array $configname name of the Qtip class (full class name is expected and will be used for looking for file, Qtip config classes must extend EE_Qtip_Config) [if this is an array, then we loop through the array to instantiate and setup the qtips]
114 114
 	 * @return void
115 115
 	 */
116
-	public function register( $configname, $paths = array() ) {
116
+	public function register($configname, $paths = array()) {
117 117
 
118 118
 		//let's just make sure this is instantiated in the right place.
119
-		if ( did_action('wp_enqueue_scripts') || did_action('admin_enqueue_scripts') ) {
120
-			EE_Error::doing_it_wrong( 'EEH_Qtip_Loader->register()', __('EE_Qtip_Config objects must be registered before wp_enqueue_scripts is called.', 'event_espresso' ), '4.1' );
119
+		if (did_action('wp_enqueue_scripts') || did_action('admin_enqueue_scripts')) {
120
+			EE_Error::doing_it_wrong('EEH_Qtip_Loader->register()', __('EE_Qtip_Config objects must be registered before wp_enqueue_scripts is called.', 'event_espresso'), '4.1');
121 121
 		}
122 122
 
123 123
 		$configname = (array) $configname; //typecast to array
124
-		foreach ( $configname as $config ) {
125
-			$this->_register( $config, $paths );
124
+		foreach ($configname as $config) {
125
+			$this->_register($config, $paths);
126 126
 		}
127 127
 
128 128
 		//hook into appropriate footer
129 129
 		$footer_action = is_admin() ? 'admin_footer' : 'wp_footer';
130
-		add_action($footer_action, array($this, 'setup_qtip'), 10 );
130
+		add_action($footer_action, array($this, 'setup_qtip'), 10);
131 131
 
132 132
 		//make sure we "turn on" qtip js.
133
-		add_filter('FHEE_load_qtip', '__return_true' );
133
+		add_filter('FHEE_load_qtip', '__return_true');
134 134
 	}
135 135
 
136 136
 
@@ -144,15 +144,15 @@  discard block
 block discarded – undo
144 144
 	 * @throws EE_Error
145 145
 	 * @return void
146 146
 	 */
147
-	private function _register( $config, $paths ) {
147
+	private function _register($config, $paths) {
148 148
 		//before doing anything we have to make sure that EE_Qtip_Config parent is required.
149
-		EE_Registry::instance()->load_lib( 'Qtip_Config', array(), TRUE );
149
+		EE_Registry::instance()->load_lib('Qtip_Config', array(), TRUE);
150 150
 
151
-		if ( !empty( $paths ) ) {
151
+		if ( ! empty($paths)) {
152 152
 			$paths = (array) $paths;
153
-			foreach ( $paths as $path ) {
154
-				$path = $path . $config . '.lib.php';
155
-				if ( !is_readable($path ) ) {
153
+			foreach ($paths as $path) {
154
+				$path = $path.$config.'.lib.php';
155
+				if ( ! is_readable($path)) {
156 156
 					continue;
157 157
 				} else {
158 158
 					require_once $path;
@@ -161,26 +161,26 @@  discard block
 block discarded – undo
161 161
 		}
162 162
 
163 163
 		//does class exist at this point?  If it does then let's instantiate.  If it doesn't then let's continue with other paths.
164
-		if ( !class_exists($config) ) {
165
-			$path = EE_LIBRARIES . 'qtips/' . $config . '.lib.php';
166
-			if ( !is_readable($path ) ) {
167
-				throw new EE_Error( sprintf( __('Unable to load the Qtip Config registered for this page (%s) because none of the file paths attempted are readable.  Please check the spelling of the paths you\'ve used in the registration', 'event_espresso'), $config ) );
164
+		if ( ! class_exists($config)) {
165
+			$path = EE_LIBRARIES.'qtips/'.$config.'.lib.php';
166
+			if ( ! is_readable($path)) {
167
+				throw new EE_Error(sprintf(__('Unable to load the Qtip Config registered for this page (%s) because none of the file paths attempted are readable.  Please check the spelling of the paths you\'ve used in the registration', 'event_espresso'), $config));
168 168
 			} else {
169 169
 				require_once $path;
170 170
 			}
171 171
 		}
172 172
 
173 173
 		//now we attempt a class_exists one more time.
174
-		if ( !class_exists( $config ) )
175
-			throw new EE_Error( sprintf( __('The Qtip_Config class being registered (%s) does not exist, please check the spelling.', 'event_espresso'), $config ) );
174
+		if ( ! class_exists($config))
175
+			throw new EE_Error(sprintf(__('The Qtip_Config class being registered (%s) does not exist, please check the spelling.', 'event_espresso'), $config));
176 176
 
177 177
 		//made it HERE?  FINALLY, let's get things setup.
178 178
 		$a = new ReflectionClass($config);
179 179
 		$qtip = $a->newInstance();
180 180
 
181 181
 		//verify that $qtip is a valid object
182
-		if ( ! $qtip instanceof EE_Qtip_Config )
183
-			throw new EE_Error( sprintf( __( 'The class given for the Qtip loader (%s) is not a child of the <strong>EE_Qtip_Config</strong> class. Please make sure you are extending EE_Qtip_Config.', 'event_espresso'), $config ) );
182
+		if ( ! $qtip instanceof EE_Qtip_Config)
183
+			throw new EE_Error(sprintf(__('The class given for the Qtip loader (%s) is not a child of the <strong>EE_Qtip_Config</strong> class. Please make sure you are extending EE_Qtip_Config.', 'event_espresso'), $config));
184 184
 
185 185
 		$this->_qtips[] = $a->newInstance();
186 186
 
@@ -196,12 +196,12 @@  discard block
 block discarded – undo
196 196
 	 * @return void
197 197
 	 */
198 198
 	public function setup_qtip() {
199
-		if ( empty( $this->_qtips ) )
199
+		if (empty($this->_qtips))
200 200
 			return; //no qtips!
201 201
 
202 202
 		$content = array();
203 203
 
204
-		foreach ( $this->_qtips as $qtip ) {
204
+		foreach ($this->_qtips as $qtip) {
205 205
 			$content[] = $this->_generate_content_container($qtip);
206 206
 		}
207 207
 
@@ -218,10 +218,10 @@  discard block
 block discarded – undo
218 218
 	private function _generate_content_container($qtip) {
219 219
 		$qts = $qtip->get_tips();
220 220
 		$content = array();
221
-		foreach ( $qts as $qt ) {
222
-			if ( ! $qt instanceof EE_Qtip )
221
+		foreach ($qts as $qt) {
222
+			if ( ! $qt instanceof EE_Qtip)
223 223
 				continue;
224
-			$content[] = '<div class="ee-qtip-helper-content hidden" id="' . $qt->content_id . '">' . $qt->content . '</div>';
224
+			$content[] = '<div class="ee-qtip-helper-content hidden" id="'.$qt->content_id.'">'.$qt->content.'</div>';
225 225
 		}
226 226
 
227 227
 		return implode('<br />', $content);
Please login to merge, or discard this patch.
Braces   +19 added lines, -12 removed lines patch added patch discarded remove patch
@@ -81,8 +81,9 @@  discard block
 block discarded – undo
81 81
 			foreach ( $this->_qtips as $qtip ) {
82 82
 				$qts = $qtip->get_tips();
83 83
 				foreach ( $qts as $qt ) {
84
-					if ( ! $qt instanceof EE_Qtip )
85
-						continue;
84
+					if ( ! $qt instanceof EE_Qtip ) {
85
+											continue;
86
+					}
86 87
 					$qtips[] = array(
87 88
 						'content_id' => $qt->content_id,
88 89
 						'options' => $qt->options,
@@ -90,8 +91,9 @@  discard block
 block discarded – undo
90 91
 						);
91 92
 				}
92 93
 			}
93
-			if ( !empty($qtips) )
94
-				wp_localize_script('ee-qtip-helper', 'EE_QTIP_HELPER', array( 'qtips' => $qtips ) );
94
+			if ( !empty($qtips) ) {
95
+							wp_localize_script('ee-qtip-helper', 'EE_QTIP_HELPER', array( 'qtips' => $qtips ) );
96
+			}
95 97
 
96 98
 		} else {
97 99
 			//qtips has been requested without any registration (so assuming its just directly used in the admin).
@@ -171,16 +173,18 @@  discard block
 block discarded – undo
171 173
 		}
172 174
 
173 175
 		//now we attempt a class_exists one more time.
174
-		if ( !class_exists( $config ) )
175
-			throw new EE_Error( sprintf( __('The Qtip_Config class being registered (%s) does not exist, please check the spelling.', 'event_espresso'), $config ) );
176
+		if ( !class_exists( $config ) ) {
177
+					throw new EE_Error( sprintf( __('The Qtip_Config class being registered (%s) does not exist, please check the spelling.', 'event_espresso'), $config ) );
178
+		}
176 179
 
177 180
 		//made it HERE?  FINALLY, let's get things setup.
178 181
 		$a = new ReflectionClass($config);
179 182
 		$qtip = $a->newInstance();
180 183
 
181 184
 		//verify that $qtip is a valid object
182
-		if ( ! $qtip instanceof EE_Qtip_Config )
183
-			throw new EE_Error( sprintf( __( 'The class given for the Qtip loader (%s) is not a child of the <strong>EE_Qtip_Config</strong> class. Please make sure you are extending EE_Qtip_Config.', 'event_espresso'), $config ) );
185
+		if ( ! $qtip instanceof EE_Qtip_Config ) {
186
+					throw new EE_Error( sprintf( __( 'The class given for the Qtip loader (%s) is not a child of the <strong>EE_Qtip_Config</strong> class. Please make sure you are extending EE_Qtip_Config.', 'event_espresso'), $config ) );
187
+		}
184 188
 
185 189
 		$this->_qtips[] = $a->newInstance();
186 190
 
@@ -196,8 +200,10 @@  discard block
 block discarded – undo
196 200
 	 * @return void
197 201
 	 */
198 202
 	public function setup_qtip() {
199
-		if ( empty( $this->_qtips ) )
200
-			return; //no qtips!
203
+		if ( empty( $this->_qtips ) ) {
204
+					return;
205
+		}
206
+		//no qtips!
201 207
 
202 208
 		$content = array();
203 209
 
@@ -219,8 +225,9 @@  discard block
 block discarded – undo
219 225
 		$qts = $qtip->get_tips();
220 226
 		$content = array();
221 227
 		foreach ( $qts as $qt ) {
222
-			if ( ! $qt instanceof EE_Qtip )
223
-				continue;
228
+			if ( ! $qt instanceof EE_Qtip ) {
229
+							continue;
230
+			}
224 231
 			$content[] = '<div class="ee-qtip-helper-content hidden" id="' . $qt->content_id . '">' . $qt->content . '</div>';
225 232
 		}
226 233
 
Please login to merge, or discard this patch.
core/helpers/EEH_Template_Validator.helper.php 3 patches
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
 	/**
132 132
 	 * For verifying that a variable is indeed an array, else throw an EE_Error
133 133
 	 * @param type $variable_to_test
134
-	 * @param type $variable_name
134
+	 * @param string $variable_name
135 135
 	 * @param type $allow_empty one of 'allow_empty' or 'do_not_allow_empty'
136 136
 	 * @return void
137 137
 	 * @throws EE_Error
@@ -159,7 +159,7 @@  discard block
 block discarded – undo
159 159
 	 * for verifying that a variable is one of the string optiosn supplied
160 160
 	 * @param mixed $variable_to_test
161 161
 	 * @param mixed $variable_name the name you've given the variable. Eg, '$foo'. THis helps in producing better error messages
162
-	 * @param array $string_options an array of acceptable values
162
+	 * @param string[] $string_options an array of acceptable values
163 163
 	 * @return void
164 164
 	 * @throws EE_Error
165 165
 	 */
Please login to merge, or discard this patch.
Spacing   +39 added lines, -39 removed lines patch added patch discarded remove patch
@@ -50,14 +50,14 @@  discard block
 block discarded – undo
50 50
 	 * @return void
51 51
 	 * @throws EE_Error (indirectly)
52 52
 	 */
53
-	static function verify_is_array_of($variable_to_test,$name_of_variable,$class_name,$allow_null='allow_null'){
54
-		if(!WP_DEBUG)return;
55
-		self::verify_argument_is_one_of($allow_null, 'allow_null', array('allow_null','do_not_allow_null'));
56
-		if('allow_null' == $allow_null && is_null($variable_to_test)){
53
+	static function verify_is_array_of($variable_to_test, $name_of_variable, $class_name, $allow_null = 'allow_null') {
54
+		if ( ! WP_DEBUG)return;
55
+		self::verify_argument_is_one_of($allow_null, 'allow_null', array('allow_null', 'do_not_allow_null'));
56
+		if ('allow_null' == $allow_null && is_null($variable_to_test)) {
57 57
 			return;
58 58
 		}
59 59
 		self::verify_is_array($variable_to_test, $name_of_variable);
60
-		foreach($variable_to_test as $key=>$array_element){
60
+		foreach ($variable_to_test as $key=>$array_element) {
61 61
 			self::verify_instanceof($array_element, $key, $class_name);
62 62
 		}
63 63
 	}
@@ -73,12 +73,12 @@  discard block
 block discarded – undo
73 73
 	 * @return void
74 74
 	 * @throws EE_Error
75 75
 	 */
76
-	static function verify_isnt_null($variable_to_test,$name_of_variable){
77
-		if(!WP_DEBUG)return;
78
-		if($variable_to_test==null && $variable_to_test!=0 && $variable_to_test!=FALSE){
79
-			$error[]=__('Variable named %s is null.','event_espresso');
80
-			$error[]=__("Consider looking at the stack trace to see why it wasn't set.",'event_espresso');
81
-			throw new EE_Error(sprintf(implode(",",$error),$name_of_variable,$name_of_variable));
76
+	static function verify_isnt_null($variable_to_test, $name_of_variable) {
77
+		if ( ! WP_DEBUG)return;
78
+		if ($variable_to_test == null && $variable_to_test != 0 && $variable_to_test != FALSE) {
79
+			$error[] = __('Variable named %s is null.', 'event_espresso');
80
+			$error[] = __("Consider looking at the stack trace to see why it wasn't set.", 'event_espresso');
81
+			throw new EE_Error(sprintf(implode(",", $error), $name_of_variable, $name_of_variable));
82 82
 		}
83 83
 	}
84 84
 	
@@ -90,12 +90,12 @@  discard block
 block discarded – undo
90 90
 	 * @return void
91 91
 	 * @throws EE_Error
92 92
 	 */
93
-	static function verify_is_true($expression_to_test,$expression_string_representation){
94
-		if(!WP_DEBUG)return;
95
-		if(!$expression_to_test){
96
-			$error[]=__('Template error.','event_espresso');
97
-			$error[]=__("%s evaluated to false, but it must be true!",'event_espresso');
98
-			throw new EE_Error(sprintf(implode(",",$error),$expression_string_representation));
93
+	static function verify_is_true($expression_to_test, $expression_string_representation) {
94
+		if ( ! WP_DEBUG)return;
95
+		if ( ! $expression_to_test) {
96
+			$error[] = __('Template error.', 'event_espresso');
97
+			$error[] = __("%s evaluated to false, but it must be true!", 'event_espresso');
98
+			throw new EE_Error(sprintf(implode(",", $error), $expression_string_representation));
99 99
 		}
100 100
 	}
101 101
 	
@@ -111,16 +111,16 @@  discard block
 block discarded – undo
111 111
 	 * @return void
112 112
 	 * @throws EE_Error
113 113
 	 */
114
-	static function verify_instanceof($variable_to_test,$name_of_variable,$class_name, $allow_null = 'do_not_allow_null'){
115
-		if(!WP_DEBUG)return;
116
-		self::verify_argument_is_one_of($allow_null, 'allow_null', array('allow_null','do_not_allow_null'));
117
-		if($allow_null == 'allow_null' && is_null($variable_to_test)){
114
+	static function verify_instanceof($variable_to_test, $name_of_variable, $class_name, $allow_null = 'do_not_allow_null') {
115
+		if ( ! WP_DEBUG)return;
116
+		self::verify_argument_is_one_of($allow_null, 'allow_null', array('allow_null', 'do_not_allow_null'));
117
+		if ($allow_null == 'allow_null' && is_null($variable_to_test)) {
118 118
 			return;
119 119
 		}
120
-		if( $variable_to_test == NULL ||  ! ( $variable_to_test instanceof $class_name )){
121
-			$msg[]=__('Variable %s is not of the correct type.','event_espresso');
122
-			$msg[]=__("It should be of type %s",'event_espresso');
123
-			throw new EE_Error(sprintf(implode(",",$msg),$name_of_variable,$name_of_variable,$class_name));
120
+		if ($variable_to_test == NULL || ! ($variable_to_test instanceof $class_name)) {
121
+			$msg[] = __('Variable %s is not of the correct type.', 'event_espresso');
122
+			$msg[] = __("It should be of type %s", 'event_espresso');
123
+			throw new EE_Error(sprintf(implode(",", $msg), $name_of_variable, $name_of_variable, $class_name));
124 124
 		}
125 125
 	}
126 126
 	
@@ -136,16 +136,16 @@  discard block
 block discarded – undo
136 136
 	 * @return void
137 137
 	 * @throws EE_Error
138 138
 	 */
139
-	static function verify_is_array($variable_to_test,$variable_name,$allow_empty='allow_empty'){
140
-		if(!WP_DEBUG)return;
141
-		self::verify_argument_is_one_of($allow_empty, $variable_name, array('allow_empty','do_not_allow_empty'));
142
-		if(empty($variable_to_test) && 'allow_empty'==$allow_empty){
139
+	static function verify_is_array($variable_to_test, $variable_name, $allow_empty = 'allow_empty') {
140
+		if ( ! WP_DEBUG)return;
141
+		self::verify_argument_is_one_of($allow_empty, $variable_name, array('allow_empty', 'do_not_allow_empty'));
142
+		if (empty($variable_to_test) && 'allow_empty' == $allow_empty) {
143 143
 			return;
144 144
 		}
145
-		if(!is_array($variable_to_test)){
146
-			$error[]=__('Variable %s should be an array, but it is not.');
147
-			$error[]=__("Its value is, instead '%s'",'event_espresso');
148
-			throw new EE_Error(sprintf(implode(",",$error),$variable_name,$variable_name,$variable_to_test));
145
+		if ( ! is_array($variable_to_test)) {
146
+			$error[] = __('Variable %s should be an array, but it is not.');
147
+			$error[] = __("Its value is, instead '%s'", 'event_espresso');
148
+			throw new EE_Error(sprintf(implode(",", $error), $variable_name, $variable_name, $variable_to_test));
149 149
 		}
150 150
 	}
151 151
 	
@@ -163,12 +163,12 @@  discard block
 block discarded – undo
163 163
 	 * @return void
164 164
 	 * @throws EE_Error
165 165
 	 */
166
-	static function verify_argument_is_one_of($variable_to_test,$variable_name,$string_options){
167
-		if(!WP_DEBUG)return;
168
-		if(!in_array($variable_to_test,$string_options)){
169
-			$msg[0]=__('Malconfigured template.','event_espresso');
170
-			$msg[1]=__("Variable named '%s' was set to '%s'. It can only be one of '%s'",'event_espresso');
171
-			throw new EE_Error(sprintf(implode("||",$msg),$variable_name,$variable_to_test, implode("', '",$string_options)));
166
+	static function verify_argument_is_one_of($variable_to_test, $variable_name, $string_options) {
167
+		if ( ! WP_DEBUG)return;
168
+		if ( ! in_array($variable_to_test, $string_options)) {
169
+			$msg[0] = __('Malconfigured template.', 'event_espresso');
170
+			$msg[1] = __("Variable named '%s' was set to '%s'. It can only be one of '%s'", 'event_espresso');
171
+			throw new EE_Error(sprintf(implode("||", $msg), $variable_name, $variable_to_test, implode("', '", $string_options)));
172 172
 		}
173 173
 	}
174 174
 
Please login to merge, or discard this patch.
Braces   +21 added lines, -7 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
 /**
4 6
  * Event Espresso
@@ -51,7 +53,9 @@  discard block
 block discarded – undo
51 53
 	 * @throws EE_Error (indirectly)
52 54
 	 */
53 55
 	static function verify_is_array_of($variable_to_test,$name_of_variable,$class_name,$allow_null='allow_null'){
54
-		if(!WP_DEBUG)return;
56
+		if(!WP_DEBUG) {
57
+			return;
58
+		}
55 59
 		self::verify_argument_is_one_of($allow_null, 'allow_null', array('allow_null','do_not_allow_null'));
56 60
 		if('allow_null' == $allow_null && is_null($variable_to_test)){
57 61
 			return;
@@ -74,7 +78,9 @@  discard block
 block discarded – undo
74 78
 	 * @throws EE_Error
75 79
 	 */
76 80
 	static function verify_isnt_null($variable_to_test,$name_of_variable){
77
-		if(!WP_DEBUG)return;
81
+		if(!WP_DEBUG) {
82
+			return;
83
+		}
78 84
 		if($variable_to_test==null && $variable_to_test!=0 && $variable_to_test!=FALSE){
79 85
 			$error[]=__('Variable named %s is null.','event_espresso');
80 86
 			$error[]=__("Consider looking at the stack trace to see why it wasn't set.",'event_espresso');
@@ -91,7 +97,9 @@  discard block
 block discarded – undo
91 97
 	 * @throws EE_Error
92 98
 	 */
93 99
 	static function verify_is_true($expression_to_test,$expression_string_representation){
94
-		if(!WP_DEBUG)return;
100
+		if(!WP_DEBUG) {
101
+			return;
102
+		}
95 103
 		if(!$expression_to_test){
96 104
 			$error[]=__('Template error.','event_espresso');
97 105
 			$error[]=__("%s evaluated to false, but it must be true!",'event_espresso');
@@ -112,7 +120,9 @@  discard block
 block discarded – undo
112 120
 	 * @throws EE_Error
113 121
 	 */
114 122
 	static function verify_instanceof($variable_to_test,$name_of_variable,$class_name, $allow_null = 'do_not_allow_null'){
115
-		if(!WP_DEBUG)return;
123
+		if(!WP_DEBUG) {
124
+			return;
125
+		}
116 126
 		self::verify_argument_is_one_of($allow_null, 'allow_null', array('allow_null','do_not_allow_null'));
117 127
 		if($allow_null == 'allow_null' && is_null($variable_to_test)){
118 128
 			return;
@@ -137,7 +147,9 @@  discard block
 block discarded – undo
137 147
 	 * @throws EE_Error
138 148
 	 */
139 149
 	static function verify_is_array($variable_to_test,$variable_name,$allow_empty='allow_empty'){
140
-		if(!WP_DEBUG)return;
150
+		if(!WP_DEBUG) {
151
+			return;
152
+		}
141 153
 		self::verify_argument_is_one_of($allow_empty, $variable_name, array('allow_empty','do_not_allow_empty'));
142 154
 		if(empty($variable_to_test) && 'allow_empty'==$allow_empty){
143 155
 			return;
@@ -164,7 +176,9 @@  discard block
 block discarded – undo
164 176
 	 * @throws EE_Error
165 177
 	 */
166 178
 	static function verify_argument_is_one_of($variable_to_test,$variable_name,$string_options){
167
-		if(!WP_DEBUG)return;
179
+		if(!WP_DEBUG) {
180
+			return;
181
+		}
168 182
 		if(!in_array($variable_to_test,$string_options)){
169 183
 			$msg[0]=__('Malconfigured template.','event_espresso');
170 184
 			$msg[1]=__("Variable named '%s' was set to '%s'. It can only be one of '%s'",'event_espresso');
Please login to merge, or discard this patch.
core/helpers/EEH_URL.helper.php 4 patches
Doc Comments   -1 removed lines patch added patch discarded remove patch
@@ -49,7 +49,6 @@
 block discarded – undo
49 49
 	 * Returns whether not the remote file exists.
50 50
 	 * Checking via GET because HEAD requests are blocked on some server configurations.
51 51
 	 * @param string $url
52
-	 * @param boolean $sslverify whether we care if the SSL certificate for the requested site is setup properly
53 52
 	 * @return boolean
54 53
 	 */
55 54
 	public static function remote_file_exists( $url, $args = array() ){
Please login to merge, or discard this patch.
Braces   +4 added lines, -2 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
  * EEH_URL helper
4 6
  * Helper class for URL-related PHP functions
@@ -62,7 +64,7 @@  discard block
 block discarded – undo
62 64
 				isset($results['response']['code']) &&
63 65
 				$results['response']['code'] == '200'){
64 66
 			return true;
65
-		}else{
67
+		} else{
66 68
 			return false;
67 69
 		}
68 70
 	}
Please login to merge, or discard this patch.
Indentation   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -1,14 +1,14 @@
 block discarded – undo
1 1
 <?php if ( ! defined('EVENT_ESPRESSO_VERSION')) exit('No direct script access allowed');
2 2
 /**
3
- * EEH_URL helper
4
- * Helper class for URL-related PHP functions
5
- *
6
- * @package			Event Espresso
7
- * @subpackage 	/helper/EEH_URL.helper.php
8
- * @author				Brent Christensen, Michael Nelson
9
- *
10
- * ------------------------------------------------------------------------
11
- */
3
+	 * EEH_URL helper
4
+	 * Helper class for URL-related PHP functions
5
+	 *
6
+	 * @package			Event Espresso
7
+	 * @subpackage 	/helper/EEH_URL.helper.php
8
+	 * @author				Brent Christensen, Michael Nelson
9
+	 *
10
+	 * ------------------------------------------------------------------------
11
+	 */
12 12
 class EEH_URL{
13 13
 
14 14
 	/**
Please login to merge, or discard this patch.
Spacing   +56 added lines, -56 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
  *
10 10
  * ------------------------------------------------------------------------
11 11
  */
12
-class EEH_URL{
12
+class EEH_URL {
13 13
 
14 14
 	/**
15 15
 	 * _add_query_arg
@@ -21,30 +21,30 @@  discard block
 block discarded – undo
21 21
 	 * @param bool  $exclude_nonce  If true then the nonce will be excluded from the generated url.
22 22
 	 * @return string
23 23
 	 */
24
-	public static function add_query_args_and_nonce( $args = array(), $url = '', $exclude_nonce = false ) {
25
-		if ( empty( $url ) ) {
26
-			$user_msg = __('An error occurred. A URL is a required parameter for the add_query_args_and_nonce method.', 'event_espresso' );
27
-			$dev_msg = $user_msg . "\n" . sprintf(
28
-					__('In order to dynamically generate nonces for your actions, you need to supply a valid URL as a second parameter for the %s::add_query_args_and_nonce method.', 'event_espresso' ),
24
+	public static function add_query_args_and_nonce($args = array(), $url = '', $exclude_nonce = false) {
25
+		if (empty($url)) {
26
+			$user_msg = __('An error occurred. A URL is a required parameter for the add_query_args_and_nonce method.', 'event_espresso');
27
+			$dev_msg = $user_msg."\n".sprintf(
28
+					__('In order to dynamically generate nonces for your actions, you need to supply a valid URL as a second parameter for the %s::add_query_args_and_nonce method.', 'event_espresso'),
29 29
 					__CLASS__
30 30
 				);
31
-			EE_Error::add_error( $user_msg . '||' . $dev_msg, __FILE__, __FUNCTION__, __LINE__ );
31
+			EE_Error::add_error($user_msg.'||'.$dev_msg, __FILE__, __FUNCTION__, __LINE__);
32 32
 		}
33 33
 		// check that an action exists and add nonce
34
-		if ( ! $exclude_nonce ) {
35
-			if ( isset( $args['action'] ) && ! empty( $args['action'] ) ) {
36
-				$args = array_merge( $args, array( $args['action'] . '_nonce' => wp_create_nonce( $args['action'] . '_nonce' ) ) );
34
+		if ( ! $exclude_nonce) {
35
+			if (isset($args['action']) && ! empty($args['action'])) {
36
+				$args = array_merge($args, array($args['action'].'_nonce' => wp_create_nonce($args['action'].'_nonce')));
37 37
 			} else {
38
-				$args = array_merge( $args, array( 'action' => 'default', 'default_nonce' => wp_create_nonce( 'default_nonce' ) ) );
38
+				$args = array_merge($args, array('action' => 'default', 'default_nonce' => wp_create_nonce('default_nonce')));
39 39
 			}
40 40
 		}
41 41
 
42 42
 		//finally, let's always add a return address (if present) :)
43
-		$args = ! empty( $_REQUEST['action'] ) && ! isset( $_REQUEST[ 'return' ] )
44
-			? array_merge( $args, array( 'return' => $_REQUEST['action'] ) )
43
+		$args = ! empty($_REQUEST['action']) && ! isset($_REQUEST['return'])
44
+			? array_merge($args, array('return' => $_REQUEST['action']))
45 45
 			: $args;
46 46
 
47
-		return add_query_arg( $args, $url );
47
+		return add_query_arg($args, $url);
48 48
 
49 49
 	}
50 50
 
@@ -57,17 +57,17 @@  discard block
 block discarded – undo
57 57
 	 * @param boolean $sslverify whether we care if the SSL certificate for the requested site is setup properly
58 58
 	 * @return boolean
59 59
 	 */
60
-	public static function remote_file_exists( $url, $args = array() ){
61
-		$results = wp_remote_request($url,array_merge( array(
60
+	public static function remote_file_exists($url, $args = array()) {
61
+		$results = wp_remote_request($url, array_merge(array(
62 62
 			'method'=>'GET',
63 63
 			'redirection'=>1
64
-		), $args ) );
65
-		if( ! $results instanceof WP_Error &&
64
+		), $args));
65
+		if ( ! $results instanceof WP_Error &&
66 66
 				isset($results['response']) &&
67 67
 				isset($results['response']['code']) &&
68
-				$results['response']['code'] == '200'){
68
+				$results['response']['code'] == '200') {
69 69
 			return true;
70
-		}else{
70
+		} else {
71 71
 			return false;
72 72
 		}
73 73
 	}
@@ -83,29 +83,29 @@  discard block
 block discarded – undo
83 83
 	 * @param bool   $base_url_only - TRUE will only return the scheme and host with no other parameters
84 84
 	 * @return string
85 85
 	 */
86
-	public static function refactor_url( $url = '', $remove_query = TRUE, $base_url_only = FALSE ) {
86
+	public static function refactor_url($url = '', $remove_query = TRUE, $base_url_only = FALSE) {
87 87
 		// break apart incoming URL
88
-		$url_bits = parse_url( $url );
88
+		$url_bits = parse_url($url);
89 89
 		// HTTP or HTTPS ?
90
-		$scheme = isset( $url_bits[ 'scheme' ] ) ? $url_bits[ 'scheme' ] . '://' : 'http://';
90
+		$scheme = isset($url_bits['scheme']) ? $url_bits['scheme'].'://' : 'http://';
91 91
 		// domain
92
-		$host = isset( $url_bits[ 'host' ] ) ? $url_bits[ 'host' ] : '';
92
+		$host = isset($url_bits['host']) ? $url_bits['host'] : '';
93 93
 		// if only the base URL is requested, then return that now
94
-		if ( $base_url_only ) {
95
-			return $scheme . $host;
94
+		if ($base_url_only) {
95
+			return $scheme.$host;
96 96
 		}
97
-		$port = isset( $url_bits[ 'port' ] ) ? ':' . $url_bits[ 'port' ] : '';
98
-		$user = isset( $url_bits[ 'user' ] ) ? $url_bits[ 'user' ] : '';
99
-		$pass = isset( $url_bits[ 'pass' ] ) ? ':' . $url_bits[ 'pass' ] : '';
100
-		$pass = ( $user || $pass ) ? $pass . '@' : '';
101
-		$path = isset( $url_bits[ 'path' ] ) ? $url_bits[ 'path' ] : '';
97
+		$port = isset($url_bits['port']) ? ':'.$url_bits['port'] : '';
98
+		$user = isset($url_bits['user']) ? $url_bits['user'] : '';
99
+		$pass = isset($url_bits['pass']) ? ':'.$url_bits['pass'] : '';
100
+		$pass = ($user || $pass) ? $pass.'@' : '';
101
+		$path = isset($url_bits['path']) ? $url_bits['path'] : '';
102 102
 		// if the query string is not required, then return what we have so far
103
-		if ( $remove_query ) {
104
-			return $scheme . $user . $pass . $host . $port . $path;
103
+		if ($remove_query) {
104
+			return $scheme.$user.$pass.$host.$port.$path;
105 105
 		}
106
-		$query = isset( $url_bits[ 'query' ] ) ? '?' . $url_bits[ 'query' ] : '';
107
-		$fragment = isset( $url_bits[ 'fragment' ] ) ? '#' . $url_bits[ 'fragment' ] : '';
108
-		return $scheme . $user . $pass . $host . $port . $path . $query . $fragment;
106
+		$query = isset($url_bits['query']) ? '?'.$url_bits['query'] : '';
107
+		$fragment = isset($url_bits['fragment']) ? '#'.$url_bits['fragment'] : '';
108
+		return $scheme.$user.$pass.$host.$port.$path.$query.$fragment;
109 109
 	}
110 110
 
111 111
 
@@ -118,29 +118,29 @@  discard block
 block discarded – undo
118 118
 	 * @param bool   $as_array TRUE (default) will return query params as an array of key value pairs, FALSE will simply return the query string
119 119
 	 * @return string|array
120 120
 	 */
121
-	public static function get_query_string( $url = '', $as_array = TRUE ) {
121
+	public static function get_query_string($url = '', $as_array = TRUE) {
122 122
 		// break apart incoming URL
123
-		$url_bits = parse_url( $url );
123
+		$url_bits = parse_url($url);
124 124
 		// grab query string from URL
125
-		$query = isset( $url_bits[ 'query' ] ) ? $url_bits[ 'query' ] : '';
125
+		$query = isset($url_bits['query']) ? $url_bits['query'] : '';
126 126
 		// if we don't want the query string formatted into an array of key => value pairs, then just return it as is
127
-		if ( ! $as_array ) {
127
+		if ( ! $as_array) {
128 128
 			return $query;
129 129
 		}
130 130
 		// if no query string exists then just return an empty array now
131
-		if ( empty( $query )) {
131
+		if (empty($query)) {
132 132
 			return array();
133 133
 		}
134 134
 		// empty array to hold results
135 135
 		$query_params = array();
136 136
 		// now break apart the query string into separate params
137
-		$query = explode( '&', $query );
137
+		$query = explode('&', $query);
138 138
 		// loop thru our query params
139
-		foreach ( $query as $query_args ) {
139
+		foreach ($query as $query_args) {
140 140
 			// break apart the key value pairs
141
-			$query_args = explode( '=', $query_args );
141
+			$query_args = explode('=', $query_args);
142 142
 			// and add to our results array
143
-			$query_params[ $query_args[0] ] = $query_args[1];
143
+			$query_params[$query_args[0]] = $query_args[1];
144 144
 		}
145 145
 		return $query_params;
146 146
 	}
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
 	 * prevent_prefetching
152 152
 	 * @return void
153 153
 	 */
154
-	public static function prevent_prefetching(){
154
+	public static function prevent_prefetching() {
155 155
 		// prevent browsers from prefetching of the rel='next' link, because it may contain content that interferes with the registration process
156 156
 		remove_action('wp_head', 'adjacent_posts_rel_link_wp_head');
157 157
 	}
@@ -166,9 +166,9 @@  discard block
 block discarded – undo
166 166
 	 * @param   string $prefix Use this to prefix the string with something.
167 167
 	 * @return string
168 168
 	 */
169
-	public static function generate_unique_token( $prefix = '' ) {
170
-		$token =  md5( uniqid() . mt_rand() );
171
-		return $prefix ? $prefix . '_' . $token : $token;
169
+	public static function generate_unique_token($prefix = '') {
170
+		$token = md5(uniqid().mt_rand());
171
+		return $prefix ? $prefix.'_'.$token : $token;
172 172
 	}
173 173
 
174 174
 
@@ -177,7 +177,7 @@  discard block
 block discarded – undo
177 177
 	 * add_nocache_headers
178 178
 	 * @return void
179 179
 	 */
180
-	public static function add_nocache_headers(){
180
+	public static function add_nocache_headers() {
181 181
 		// add no cache headers
182 182
 //		add_action( 'wp_head' , array( 'EED_Single_Page_Checkout', 'nocache_headers' ), 10 );
183 183
 		// plus a little extra for nginx
@@ -194,19 +194,19 @@  discard block
 block discarded – undo
194 194
 	 * @param string $server_variable
195 195
 	 * @return string
196 196
 	 */
197
-	public static function filter_input_server_url( $server_variable = 'REQUEST_URI' ){
197
+	public static function filter_input_server_url($server_variable = 'REQUEST_URI') {
198 198
 		$URL = '';
199 199
 		$server_variables = array(
200 200
 			'REQUEST_URI' => 1,
201 201
 			'HTTP_HOST' => 1,
202 202
 			'PHP_SELF' => 1,
203 203
 		);
204
-		$server_variable = strtoupper( $server_variable );
204
+		$server_variable = strtoupper($server_variable);
205 205
 		// whitelist INPUT_SERVER var
206
-		if ( isset( $server_variables[ $server_variable ] ) ) {
207
-			$URL = filter_input( INPUT_SERVER, $server_variable, FILTER_SANITIZE_URL, FILTER_NULL_ON_FAILURE );
208
-			if ( empty( $URL ) ) {
209
-				$URL = esc_url( $_SERVER[ $server_variable ] );
206
+		if (isset($server_variables[$server_variable])) {
207
+			$URL = filter_input(INPUT_SERVER, $server_variable, FILTER_SANITIZE_URL, FILTER_NULL_ON_FAILURE);
208
+			if (empty($URL)) {
209
+				$URL = esc_url($_SERVER[$server_variable]);
210 210
 			}
211 211
 		}
212 212
 		return $URL;
Please login to merge, or discard this patch.