Completed
Branch BUG-5580-mike-implementation (468206)
by
unknown
14:28 queued 15s
created
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.
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,11 +332,11 @@  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, but NOT exact instance like WP update_option does
339
-			if ( $value != $old_value ) {
339
+			if ($value != $old_value) {
340 340
 				// if they are NOT the same, then remove the hook, which means the subsequent update results will be based solely on the update query results
341 341
 				// the reason we do this is because, as stated above, WP update_option performs an exact instance comparison (===) on any update values passed to it
342 342
 				// this happens PRIOR to serialization and any subsequent update. If values are found to match their previous old value, then WP bails before performing any update.
@@ -344,7 +344,7 @@  discard block
 block discarded – undo
344 344
 				// HOWEVER, once the object is serialized and passed off to MySQL to update,
345 345
 				// MySQL MAY ALSO NOT perform the update because the string it sees in the db looks the same as the new one it has been passed!!!
346 346
 				// This results in the query returning an "affected rows" value of ZERO, which gets returned immediately by WP update_option and looks like an error.
347
-				remove_action( 'update_option', array( $this, 'check_config_updated' ));
347
+				remove_action('update_option', array($this, 'check_config_updated'));
348 348
 			}
349 349
 		}
350 350
 	}
@@ -359,11 +359,11 @@  discard block
 block discarded – undo
359 359
 	 */
360 360
 	protected function  _reset_espresso_addon_config() {
361 361
 		$this->_config_option_names = array();
362
-		foreach( $this->addons as $addon_name => $addon_config_obj ) {
363
-			$addon_config_obj = maybe_unserialize( $addon_config_obj );
364
-			$config_class = get_class( $addon_config_obj );
365
-			if ( $addon_config_obj instanceof $config_class && ! $addon_config_obj instanceof __PHP_Incomplete_Class ) {
366
-				$this->update_config( 'addons', $addon_name, $addon_config_obj, FALSE );
362
+		foreach ($this->addons as $addon_name => $addon_config_obj) {
363
+			$addon_config_obj = maybe_unserialize($addon_config_obj);
364
+			$config_class = get_class($addon_config_obj);
365
+			if ($addon_config_obj instanceof $config_class && ! $addon_config_obj instanceof __PHP_Incomplete_Class) {
366
+				$this->update_config('addons', $addon_name, $addon_config_obj, FALSE);
367 367
 			}
368 368
 			$this->addons->$addon_name = NULL;
369 369
 		}
@@ -379,36 +379,36 @@  discard block
 block discarded – undo
379 379
 	 * @param   bool $add_error
380 380
 	 * @return   bool
381 381
 	 */
382
-	public function  update_espresso_config( $add_success = FALSE, $add_error = TRUE ) {
382
+	public function  update_espresso_config($add_success = FALSE, $add_error = TRUE) {
383 383
 		// commented out the following re: https://events.codebasehq.com/projects/event-espresso/tickets/8197
384 384
 		//$clone = clone( self::$_instance );
385 385
 		//self::$_instance = NULL;
386
-		do_action( 'AHEE__EE_Config__update_espresso_config__begin',$this );
386
+		do_action('AHEE__EE_Config__update_espresso_config__begin', $this);
387 387
 		$this->_reset_espresso_addon_config();
388 388
 		// hook into update_option because that happens AFTER the ( $value === $old_value ) conditional but BEFORE the actual update occurs
389
-		add_action( 'update_option', array( $this, 'double_check_config_comparison' ), 1, 3 );
389
+		add_action('update_option', array($this, 'double_check_config_comparison'), 1, 3);
390 390
 		// now update "ee_config"
391
-		$saved = update_option( 'ee_config', $this );
391
+		$saved = update_option('ee_config', $this);
392 392
 		// if not saved... check if the hook we just added still exists; if it does, it means one of two things:
393 393
 		// that update_option bailed at the ( $value === $old_value ) conditional, or...
394 394
 		// the db update query returned 0 rows affected (probably because the data  value was the same from it's perspective)
395 395
 		// so the existence of the hook means that a negative result from update_option is NOT an error, but just means no update occurred, so don't display an error to the user.
396 396
 		// BUT... if update_option returns FALSE, AND the hook is missing, then it means that something truly went wrong
397
-		$saved = ! $saved ? has_action( 'update_option', array( $this, 'double_check_config_comparison' )) : $saved;
397
+		$saved = ! $saved ? has_action('update_option', array($this, 'double_check_config_comparison')) : $saved;
398 398
 		// remove our action since we don't want it in the system anymore
399
-		remove_action( 'update_option', array( $this, 'double_check_config_comparison' ), 1 );
400
-		do_action( 'AHEE__EE_Config__update_espresso_config__end', $this, $saved );
399
+		remove_action('update_option', array($this, 'double_check_config_comparison'), 1);
400
+		do_action('AHEE__EE_Config__update_espresso_config__end', $this, $saved);
401 401
 		//self::$_instance = $clone;
402 402
 		//unset( $clone );
403 403
 		// if config remains the same or was updated successfully
404
-		if ( $saved ) {
405
-			if ( $add_success ) {
406
-				EE_Error::add_success( __( 'The Event Espresso Configuration Settings have been successfully updated.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__ );
404
+		if ($saved) {
405
+			if ($add_success) {
406
+				EE_Error::add_success(__('The Event Espresso Configuration Settings have been successfully updated.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
407 407
 			}
408 408
 			return TRUE;
409 409
 		} else {
410
-			if ( $add_error ) {
411
-				EE_Error::add_error( __( 'The Event Espresso Configuration Settings were not updated.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__ );
410
+			if ($add_error) {
411
+				EE_Error::add_error(__('The Event Espresso Configuration Settings were not updated.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
412 412
 			}
413 413
 			return FALSE;
414 414
 		}
@@ -427,77 +427,77 @@  discard block
 block discarded – undo
427 427
 	 * @param    bool                  $display_errors
428 428
 	 * @return    bool    TRUE on success, FALSE on fail
429 429
 	 */
430
-	private function _verify_config_params( $section = '', $name = '', $config_class = '', $config_obj = NULL, $tests_to_run = array( 1, 2, 3, 4, 5, 6, 7, 8 ), $display_errors = TRUE ) {
430
+	private function _verify_config_params($section = '', $name = '', $config_class = '', $config_obj = NULL, $tests_to_run = array(1, 2, 3, 4, 5, 6, 7, 8), $display_errors = TRUE) {
431 431
 		try {
432 432
 			// TEST #1 : check that section was set
433
-			if ( in_array( 1, $tests_to_run ) && empty( $section )) {
434
-				if ( $display_errors ) {
435
-					throw new EE_Error( sprintf( __( 'No configuration section has been provided while attempting to save "%s".', 'event_espresso' ), $config_class ));
433
+			if (in_array(1, $tests_to_run) && empty($section)) {
434
+				if ($display_errors) {
435
+					throw new EE_Error(sprintf(__('No configuration section has been provided while attempting to save "%s".', 'event_espresso'), $config_class));
436 436
 				}
437 437
 				return FALSE;
438 438
 			}
439 439
 			// TEST #2 : check that settings section exists
440
-			if ( in_array( 2, $tests_to_run ) && ! isset( $this->{$section} )) {
441
-				if ( $display_errors ) {
442
-					throw new EE_Error( sprintf( __( 'The "%s" configuration section does not exist.', 'event_espresso' ), $section ));
440
+			if (in_array(2, $tests_to_run) && ! isset($this->{$section} )) {
441
+				if ($display_errors) {
442
+					throw new EE_Error(sprintf(__('The "%s" configuration section does not exist.', 'event_espresso'), $section));
443 443
 				}
444 444
 				return FALSE;
445 445
 			}
446 446
 			// TEST #3 : check that section is the proper format
447
-			if ( in_array( 3, $tests_to_run ) && ! ( $this->{$section} instanceof EE_Config_Base || $this->{$section} instanceof stdClass )) {
448
-				if ( $display_errors ) {
449
-					throw new EE_Error( sprintf( __( 'The "%s" configuration settings have not been formatted correctly.', 'event_espresso' ), $section ));
447
+			if (in_array(3, $tests_to_run) && ! ($this->{$section} instanceof EE_Config_Base || $this->{$section} instanceof stdClass)) {
448
+				if ($display_errors) {
449
+					throw new EE_Error(sprintf(__('The "%s" configuration settings have not been formatted correctly.', 'event_espresso'), $section));
450 450
 				}
451 451
 				return FALSE;
452 452
 			}
453 453
 			// TEST #4 : check that config section name has been set
454
-			if ( in_array( 4, $tests_to_run ) && empty( $name )) {
455
-				if ( $display_errors ) {
456
-					throw new EE_Error( __( 'No name has been provided for the specific configuration section.', 'event_espresso' ));
454
+			if (in_array(4, $tests_to_run) && empty($name)) {
455
+				if ($display_errors) {
456
+					throw new EE_Error(__('No name has been provided for the specific configuration section.', 'event_espresso'));
457 457
 				}
458 458
 				return FALSE;
459 459
 			}
460 460
 			// TEST #5 : check that a config class name has been set
461
-			if ( in_array( 5, $tests_to_run ) && empty( $config_class )) {
462
-				if ( $display_errors ) {
463
-					throw new EE_Error( __( 'No class name has been provided for the specific configuration section.', 'event_espresso' ));
461
+			if (in_array(5, $tests_to_run) && empty($config_class)) {
462
+				if ($display_errors) {
463
+					throw new EE_Error(__('No class name has been provided for the specific configuration section.', 'event_espresso'));
464 464
 				}
465 465
 				return FALSE;
466 466
 			}
467 467
 			// TEST #6 : verify config class is accessible
468
-			if ( in_array( 6, $tests_to_run ) && ! class_exists( $config_class )) {
469
-				if ( $display_errors ) {
470
-					throw new EE_Error( sprintf( __( 'The "%s" class does not exist. Please ensure that an autoloader has been set for it.', 'event_espresso' ), $config_class ));
468
+			if (in_array(6, $tests_to_run) && ! class_exists($config_class)) {
469
+				if ($display_errors) {
470
+					throw new EE_Error(sprintf(__('The "%s" class does not exist. Please ensure that an autoloader has been set for it.', 'event_espresso'), $config_class));
471 471
 				}
472 472
 				return FALSE;
473 473
 			}
474 474
 			// TEST #7 : check that config has even been set
475
-			if ( in_array( 7, $tests_to_run )) {
476
-				if ( ! isset( $this->{$section}->{$name} )) {
477
-					if ( $display_errors ) {
478
-						throw new EE_Error( sprintf( __( 'No configuration has been set for "%s->%s".', 'event_espresso' ), $section, $name ));
475
+			if (in_array(7, $tests_to_run)) {
476
+				if ( ! isset($this->{$section}->{$name} )) {
477
+					if ($display_errors) {
478
+						throw new EE_Error(sprintf(__('No configuration has been set for "%s->%s".', 'event_espresso'), $section, $name));
479 479
 					}
480 480
 					return FALSE;
481 481
 				} else {
482 482
 					// and make sure it's not serialized
483
-					$this->{$section}->{$name} = maybe_unserialize( $this->{$section}->{$name} );
483
+					$this->{$section}->{$name} = maybe_unserialize($this->{$section}->{$name} );
484 484
 				}
485 485
 			}
486 486
 			// TEST #8 : check that config is the requested type
487
-			if ( in_array( 8, $tests_to_run ) && ! $this->{$section}->{$name} instanceof $config_class ) {
488
-				if ( $display_errors ) {
489
-					throw new EE_Error( sprintf( __( 'The configuration for "%s->%s" is not of the "%s" class.', 'event_espresso' ), $section, $name, $config_class ));
487
+			if (in_array(8, $tests_to_run) && ! $this->{$section}->{$name} instanceof $config_class) {
488
+				if ($display_errors) {
489
+					throw new EE_Error(sprintf(__('The configuration for "%s->%s" is not of the "%s" class.', 'event_espresso'), $section, $name, $config_class));
490 490
 				}
491 491
 				return FALSE;
492 492
 			}
493 493
 			// TEST #9 : verify config object
494
-			if ( in_array( 9, $tests_to_run ) && ! $config_obj instanceof EE_Config_Base ) {
495
-				if ( $display_errors ) {
496
-					throw new EE_Error( sprintf( __( 'The "%s" class is not an instance of EE_Config_Base.', 'event_espresso' ), print_r( $config_obj, TRUE )));
494
+			if (in_array(9, $tests_to_run) && ! $config_obj instanceof EE_Config_Base) {
495
+				if ($display_errors) {
496
+					throw new EE_Error(sprintf(__('The "%s" class is not an instance of EE_Config_Base.', 'event_espresso'), print_r($config_obj, TRUE)));
497 497
 				}
498 498
 				return FALSE;
499 499
 			}
500
-		} catch( EE_Error $e ) {
500
+		} catch (EE_Error $e) {
501 501
 			$e->get_error();
502 502
 		}
503 503
 		// you have successfully run the gauntlet
@@ -514,8 +514,8 @@  discard block
 block discarded – undo
514 514
 	 * @param        string          $name
515 515
 	 * @return        string
516 516
 	 */
517
-	private function _generate_config_option_name( $section = '', $name = '' ) {
518
-		return 'ee_config-' . $section . '-' . $name;
517
+	private function _generate_config_option_name($section = '', $name = '') {
518
+		return 'ee_config-'.$section.'-'.$name;
519 519
 	}
520 520
 
521 521
 
@@ -529,8 +529,8 @@  discard block
 block discarded – undo
529 529
 	 * @param 	string $name
530 530
 	 * @return 	string
531 531
 	 */
532
-	private function _set_config_class( $config_class = '', $name = '' ) {
533
-		return ! empty( $config_class ) ? $config_class : str_replace( ' ', '_', ucwords( str_replace( '_', ' ', $name ))) . '_Config';
532
+	private function _set_config_class($config_class = '', $name = '') {
533
+		return ! empty($config_class) ? $config_class : str_replace(' ', '_', ucwords(str_replace('_', ' ', $name))).'_Config';
534 534
 	}
535 535
 
536 536
 
@@ -544,35 +544,35 @@  discard block
 block discarded – undo
544 544
 	 * @param        \EE_Config_Base $config_obj
545 545
 	 * @return        \EE_Config_Base|bool
546 546
 	 */
547
-	public function set_config( $section = '', $name = '', $config_class = '', EE_Config_Base $config_obj = NULL ) {
547
+	public function set_config($section = '', $name = '', $config_class = '', EE_Config_Base $config_obj = NULL) {
548 548
 		// ensure config class is set to something
549
-		$config_class = $this->_set_config_class( $config_class, $name );
549
+		$config_class = $this->_set_config_class($config_class, $name);
550 550
 		// run tests 1-4, 6, and 7 to verify all config params are set and valid
551
-		if ( ! $this->_verify_config_params( $section, $name, $config_class, NULL, array( 1, 2, 3, 4, 5, 6 ))) {
551
+		if ( ! $this->_verify_config_params($section, $name, $config_class, NULL, array(1, 2, 3, 4, 5, 6))) {
552 552
 			return FALSE;
553 553
 		}
554
-		$config_option_name = $this->_generate_config_option_name( $section, $name );
554
+		$config_option_name = $this->_generate_config_option_name($section, $name);
555 555
 		// if the config option name hasn't been added yet to the list of option names we're tracking, then do so now
556
-		if ( ! isset( $this->_config_option_names[ $config_option_name ] )) {
557
-			$this->_config_option_names[ $config_option_name ] = $config_class;
556
+		if ( ! isset($this->_config_option_names[$config_option_name])) {
557
+			$this->_config_option_names[$config_option_name] = $config_class;
558 558
 		}
559 559
 		// verify the incoming config object but suppress errors
560
-		if ( ! $this->_verify_config_params( $section, $name, $config_class, $config_obj, array( 9 ), FALSE )) {
560
+		if ( ! $this->_verify_config_params($section, $name, $config_class, $config_obj, array(9), FALSE)) {
561 561
 			$config_obj = new $config_class();
562 562
 		}
563
-		$config_set = get_option( $config_option_name );
563
+		$config_set = get_option($config_option_name);
564 564
 
565
-		if ( $config_set ) {
566
-			update_option( $config_option_name, $config_obj );
565
+		if ($config_set) {
566
+			update_option($config_option_name, $config_obj);
567 567
 			$this->{$section}->{$name} = $config_obj;
568 568
 			return $this->{$section}->{$name};
569 569
 		} else {
570 570
 			// create a wp-option for this config
571
-			if ( add_option( $config_option_name, $config_obj, '', 'no' )) {
572
-				$this->{$section}->{$name} = maybe_unserialize( $config_obj );
571
+			if (add_option($config_option_name, $config_obj, '', 'no')) {
572
+				$this->{$section}->{$name} = maybe_unserialize($config_obj);
573 573
 				return $this->{$section}->{$name};
574 574
 			} else {
575
-				EE_Error::add_error( sprintf( __( 'The "%s" could not be saved to the database.', 'event_espresso' ), $config_class ), __FILE__, __FUNCTION__, __LINE__ );
575
+				EE_Error::add_error(sprintf(__('The "%s" could not be saved to the database.', 'event_espresso'), $config_class), __FILE__, __FUNCTION__, __LINE__);
576 576
 				return FALSE;
577 577
 			}
578 578
 		}
@@ -591,37 +591,37 @@  discard block
 block discarded – undo
591 591
 	 * @param bool                      $throw_errors
592 592
 	 * @return  bool
593 593
 	 */
594
-	public function update_config( $section = '', $name = '', $config_obj = '', $throw_errors = TRUE ) {
595
-		$config_obj = maybe_unserialize( $config_obj );
594
+	public function update_config($section = '', $name = '', $config_obj = '', $throw_errors = TRUE) {
595
+		$config_obj = maybe_unserialize($config_obj);
596 596
 		// get class name of the incoming object
597
-		$config_class = get_class( $config_obj );
597
+		$config_class = get_class($config_obj);
598 598
 		// run tests 1-5 and 9 to verify config
599
-		if ( ! $this->_verify_config_params( $section, $name, $config_class, $config_obj, array( 1, 2, 3, 4, 7, 9 ))) {
599
+		if ( ! $this->_verify_config_params($section, $name, $config_class, $config_obj, array(1, 2, 3, 4, 7, 9))) {
600 600
 			return FALSE;
601 601
 		}
602
-		$config_option_name = $this->_generate_config_option_name( $section, $name );
602
+		$config_option_name = $this->_generate_config_option_name($section, $name);
603 603
 		// check if config object has been added to db by seeing if config option name is in $this->_config_option_names array
604
-		if ( ! isset( $this->_config_option_names[ $config_option_name ] )) {
604
+		if ( ! isset($this->_config_option_names[$config_option_name])) {
605 605
 			// save new config to db
606
-			return $this->set_config( $section, $name, $config_class, $config_obj );
606
+			return $this->set_config($section, $name, $config_class, $config_obj);
607 607
 		} else {
608 608
 			// first check if the record already exists
609
-			$existing_config = get_option( $config_option_name );
610
-			$config_obj = serialize( $config_obj );
609
+			$existing_config = get_option($config_option_name);
610
+			$config_obj = serialize($config_obj);
611 611
 			// just return if db record is already up to date
612
-			if ( $existing_config == $config_obj ) {
612
+			if ($existing_config == $config_obj) {
613 613
 				$this->{$section}->{$name} = $config_obj;
614 614
 				return TRUE;
615
-			} else if ( update_option( $config_option_name, $config_obj )) {
615
+			} else if (update_option($config_option_name, $config_obj)) {
616 616
 				// update wp-option for this config class
617 617
 				$this->{$section}->{$name} = $config_obj;
618 618
 				return $this->update_espresso_config();
619
-			} elseif ( $throw_errors ) {
619
+			} elseif ($throw_errors) {
620 620
 				EE_Error::add_error(
621 621
 					sprintf(
622
-						__( 'The "%s" object stored at"%s" was not successfully updated in the database.', 'event_espresso' ),
622
+						__('The "%s" object stored at"%s" was not successfully updated in the database.', 'event_espresso'),
623 623
 						$config_class,
624
-						'EE_Config->' . $section . '->' . $name
624
+						'EE_Config->'.$section.'->'.$name
625 625
 					),
626 626
 					__FILE__, __FUNCTION__, __LINE__
627 627
 				);
@@ -641,33 +641,33 @@  discard block
 block discarded – undo
641 641
 	 * @param 	string 	$config_class
642 642
 	 * @return 	mixed EE_Config_Base | NULL
643 643
 	 */
644
-	public function get_config( $section = '', $name = '', $config_class = '' ) {
644
+	public function get_config($section = '', $name = '', $config_class = '') {
645 645
 		// ensure config class is set to something
646
-		$config_class = $this->_set_config_class( $config_class, $name );
646
+		$config_class = $this->_set_config_class($config_class, $name);
647 647
 		// run tests 1-4, 6 and 7 to verify that all params have been set
648
-		if ( ! $this->_verify_config_params( $section, $name, $config_class, NULL, array( 1, 2, 3, 4, 5, 6 ))) {
648
+		if ( ! $this->_verify_config_params($section, $name, $config_class, NULL, array(1, 2, 3, 4, 5, 6))) {
649 649
 			return NULL;
650 650
 		}
651 651
 		// now test if the requested config object exists, but suppress errors
652
-		if ( $this->_verify_config_params( $section, $name, $config_class, NULL, array( 7, 8 ), FALSE )) {
652
+		if ($this->_verify_config_params($section, $name, $config_class, NULL, array(7, 8), FALSE)) {
653 653
 			// config already exists, so pass it back
654 654
 			return $this->{$section}->{$name};
655 655
 		}
656 656
 		// load config option from db if it exists
657
-		$config_obj = $this->get_config_option( $this->_generate_config_option_name( $section, $name ));
657
+		$config_obj = $this->get_config_option($this->_generate_config_option_name($section, $name));
658 658
 		// verify the newly retrieved config object, but suppress errors
659
-		if ( $this->_verify_config_params( $section, $name, $config_class, $config_obj, array( 9 ), FALSE )) {
659
+		if ($this->_verify_config_params($section, $name, $config_class, $config_obj, array(9), FALSE)) {
660 660
 			// config is good, so set it and pass it back
661 661
 			$this->{$section}->{$name} = $config_obj;
662 662
 			return $this->{$section}->{$name};
663 663
 		}
664 664
 		// oops! $config_obj is not already set and does not exist in the db, so create a new one
665
-		$config_obj =$this->set_config( $section, $name, $config_class );
665
+		$config_obj = $this->set_config($section, $name, $config_class);
666 666
 		// verify the newly created config object
667
-		if ( $this->_verify_config_params( $section, $name, $config_class, $config_obj, array( 9 ))) {
667
+		if ($this->_verify_config_params($section, $name, $config_class, $config_obj, array(9))) {
668 668
 			return $this->{$section}->{$name};
669 669
 		} else {
670
-			EE_Error::add_error( sprintf( __( 'The "%s" could not be retrieved from the database.', 'event_espresso' ), $config_class ), __FILE__, __FUNCTION__, __LINE__ );
670
+			EE_Error::add_error(sprintf(__('The "%s" could not be retrieved from the database.', 'event_espresso'), $config_class), __FILE__, __FUNCTION__, __LINE__);
671 671
 		}
672 672
 		return NULL;
673 673
 	}
@@ -680,9 +680,9 @@  discard block
 block discarded – undo
680 680
 	 * @param 	string 	$config_option_name
681 681
 	 * @return 	mixed EE_Config_Base | FALSE
682 682
 	 */
683
-	public function get_config_option( $config_option_name = '' ) {
683
+	public function get_config_option($config_option_name = '') {
684 684
 		// retrieve the wp-option for this config class.
685
-		return maybe_unserialize( get_option( $config_option_name ));
685
+		return maybe_unserialize(get_option($config_option_name));
686 686
 	}
687 687
 
688 688
 
@@ -695,45 +695,45 @@  discard block
 block discarded – undo
695 695
 	 * @param $page_for_posts
696 696
 	 * @return    void
697 697
 	 */
698
-	public function update_post_shortcodes( $page_for_posts = '' ) {
698
+	public function update_post_shortcodes($page_for_posts = '') {
699 699
 		// make sure page_for_posts is set
700
-		$page_for_posts = ! empty( $page_for_posts ) ? $page_for_posts : EE_Config::get_page_for_posts();
700
+		$page_for_posts = ! empty($page_for_posts) ? $page_for_posts : EE_Config::get_page_for_posts();
701 701
 		// critical page shortcodes that we do NOT want added to the Posts page (blog)
702 702
 		$critical_shortcodes = $this->core->get_critical_pages_shortcodes_array();
703 703
 		// allow others to mess stuff up :D
704
-		do_action( 'AHEE__EE_Config__update_post_shortcodes', $this->core->post_shortcodes, $page_for_posts );
704
+		do_action('AHEE__EE_Config__update_post_shortcodes', $this->core->post_shortcodes, $page_for_posts);
705 705
 		// verify that post_shortcodes is set
706
-		$this->core->post_shortcodes = isset( $this->core->post_shortcodes ) && is_array( $this->core->post_shortcodes ) ? $this->core->post_shortcodes : array();
706
+		$this->core->post_shortcodes = isset($this->core->post_shortcodes) && is_array($this->core->post_shortcodes) ? $this->core->post_shortcodes : array();
707 707
 		// cycle thru post_shortcodes
708
-		foreach( $this->core->post_shortcodes as $post_name => $shortcodes ){
708
+		foreach ($this->core->post_shortcodes as $post_name => $shortcodes) {
709 709
 			// are there any shortcodes to track ?
710
-			if ( ! empty( $shortcodes )) {
710
+			if ( ! empty($shortcodes)) {
711 711
 				// loop thru list of tracked shortcodes
712
-				foreach( $shortcodes as $shortcode => $post_id ) {
712
+				foreach ($shortcodes as $shortcode => $post_id) {
713 713
 					// if shortcode is for a critical page, BUT this is NOT the corresponding critical page for that shortcode
714
-					if ( isset( $critical_shortcodes[ $post_id ] ) && $post_name == $page_for_posts ) {
714
+					if (isset($critical_shortcodes[$post_id]) && $post_name == $page_for_posts) {
715 715
 						// then remove this shortcode, because we don't want critical page shortcodes like ESPRESSO_TXN_PAGE running on the "Posts Page" (blog)
716
-						unset( $this->core->post_shortcodes[ $post_name ][ $shortcode ] );
716
+						unset($this->core->post_shortcodes[$post_name][$shortcode]);
717 717
 					}
718 718
 					// skip the posts page, because we want all shortcodes registered for it
719
-					if ( $post_name == $page_for_posts ) {
719
+					if ($post_name == $page_for_posts) {
720 720
 						continue;
721 721
 					}
722 722
 					// make sure post still exists
723
-					$post = get_post( $post_id );
724
-					if ( $post ) {
723
+					$post = get_post($post_id);
724
+					if ($post) {
725 725
 						// check that the post name matches what we have saved
726
-						if ( $post->post_name == $post_name ) {
726
+						if ($post->post_name == $post_name) {
727 727
 							// if so, then break before hitting the unset below
728 728
 							continue;
729 729
 						}
730 730
 					}
731 731
 					// we don't like missing posts around here >:(
732
-					unset( $this->core->post_shortcodes[ $post_name ] );
732
+					unset($this->core->post_shortcodes[$post_name]);
733 733
 				}
734 734
 			} else {
735 735
 				// you got no shortcodes to keep track of !
736
-				unset( $this->core->post_shortcodes[ $post_name ] );
736
+				unset($this->core->post_shortcodes[$post_name]);
737 737
 			}
738 738
 		}
739 739
 		//only show errors
@@ -752,14 +752,14 @@  discard block
 block discarded – undo
752 752
 	 *  @return 	string
753 753
 	 */
754 754
 	public static function get_page_for_posts() {
755
-		$page_for_posts = get_option( 'page_for_posts' );
756
-		if ( ! $page_for_posts ) {
755
+		$page_for_posts = get_option('page_for_posts');
756
+		if ( ! $page_for_posts) {
757 757
 			return 'posts';
758 758
 		}
759 759
 		/** @type WPDB $wpdb */
760 760
 		global $wpdb;
761 761
 		$SQL = "SELECT post_name from $wpdb->posts WHERE post_type='posts' OR post_type='page' AND post_status='publish' AND ID=%d";
762
-		return $wpdb->get_var( $wpdb->prepare( $SQL, $page_for_posts ));
762
+		return $wpdb->get_var($wpdb->prepare($SQL, $page_for_posts));
763 763
 	}
764 764
 
765 765
 
@@ -775,11 +775,11 @@  discard block
 block discarded – undo
775 775
 	 *  @return 	void
776 776
 	 */
777 777
 	public function register_shortcodes_and_modules() {
778
-		if ( EE_Maintenance_Mode::disable_frontend_for_maintenance() ) {
778
+		if (EE_Maintenance_Mode::disable_frontend_for_maintenance()) {
779 779
 			return;
780 780
 		}
781 781
 		// allow shortcodes to register with WP and to set hooks for the rest of the system
782
-		EE_Registry::instance()->shortcodes =$this->_register_shortcodes();
782
+		EE_Registry::instance()->shortcodes = $this->_register_shortcodes();
783 783
 		// allow modules to set hooks for the rest of the system
784 784
 		EE_Registry::instance()->modules = $this->_register_modules();
785 785
 	}
@@ -793,7 +793,7 @@  discard block
 block discarded – undo
793 793
 	 *  @return 	void
794 794
 	 */
795 795
 	public function initialize_shortcodes_and_modules() {
796
-		if ( EE_Maintenance_Mode::disable_frontend_for_maintenance() ) {
796
+		if (EE_Maintenance_Mode::disable_frontend_for_maintenance()) {
797 797
 			return;
798 798
 		}
799 799
 		// allow shortcodes to set hooks for the rest of the system
@@ -812,26 +812,26 @@  discard block
 block discarded – undo
812 812
 	 * 	@return void
813 813
 	 */
814 814
 	public function widgets_init() {
815
-		if ( EE_Maintenance_Mode::disable_frontend_for_maintenance() ) {
815
+		if (EE_Maintenance_Mode::disable_frontend_for_maintenance()) {
816 816
 			return;
817 817
 		}
818 818
 		//only init widgets on admin pages when not in complete maintenance, and
819 819
 		//on frontend when not in any maintenance mode
820
-		if (( is_admin() && EE_Maintenance_Mode::instance()->level() != EE_Maintenance_Mode::level_2_complete_maintenance)  || ! EE_Maintenance_Mode::instance()->level() ) {
820
+		if ((is_admin() && EE_Maintenance_Mode::instance()->level() != EE_Maintenance_Mode::level_2_complete_maintenance) || ! EE_Maintenance_Mode::instance()->level()) {
821 821
 			// grab list of installed widgets
822
-			$widgets_to_register = glob( EE_WIDGETS . '*', GLOB_ONLYDIR );
822
+			$widgets_to_register = glob(EE_WIDGETS.'*', GLOB_ONLYDIR);
823 823
 			// filter list of modules to register
824
-			$widgets_to_register = apply_filters( 'FHEE__EE_Config__register_widgets__widgets_to_register', $widgets_to_register );
824
+			$widgets_to_register = apply_filters('FHEE__EE_Config__register_widgets__widgets_to_register', $widgets_to_register);
825 825
 
826
-			if ( ! empty( $widgets_to_register ) ) {
826
+			if ( ! empty($widgets_to_register)) {
827 827
 				// cycle thru widget folders
828
-				foreach ( $widgets_to_register as $widget_path ) {
828
+				foreach ($widgets_to_register as $widget_path) {
829 829
 					// add to list of installed widget modules
830
-					EE_Config::register_ee_widget( $widget_path );
830
+					EE_Config::register_ee_widget($widget_path);
831 831
 				}
832 832
 			}
833 833
 			// filter list of installed modules
834
-			EE_Registry::instance()->widgets = apply_filters( 'FHEE__EE_Config__register_widgets__installed_widgets', EE_Registry::instance()->widgets );
834
+			EE_Registry::instance()->widgets = apply_filters('FHEE__EE_Config__register_widgets__installed_widgets', EE_Registry::instance()->widgets);
835 835
 		}
836 836
 	}
837 837
 
@@ -844,54 +844,54 @@  discard block
 block discarded – undo
844 844
 	 *  @param 	string 	$widget_path - full path up to and including widget folder
845 845
 	 *  @return 	void
846 846
 	 */
847
-	public static function register_ee_widget( $widget_path = NULL ) {
848
-		do_action( 'AHEE__EE_Config__register_widget__begin', $widget_path );
847
+	public static function register_ee_widget($widget_path = NULL) {
848
+		do_action('AHEE__EE_Config__register_widget__begin', $widget_path);
849 849
 		$widget_ext = '.widget.php';
850 850
 		// make all separators match
851
-		$widget_path = rtrim( str_replace( '/\\', DS, $widget_path ), DS );
851
+		$widget_path = rtrim(str_replace('/\\', DS, $widget_path), DS);
852 852
 		// does the file path INCLUDE the actual file name as part of the path ?
853
-		if ( strpos( $widget_path, $widget_ext ) !== FALSE ) {
853
+		if (strpos($widget_path, $widget_ext) !== FALSE) {
854 854
 			// grab and shortcode file name from directory name and break apart at dots
855
-			$file_name = explode( '.', basename( $widget_path ));
855
+			$file_name = explode('.', basename($widget_path));
856 856
 			// take first segment from file name pieces and remove class prefix if it exists
857
-			$widget = strpos( $file_name[0], 'EEW_' ) === 0 ? substr( $file_name[0], 4 ) : $file_name[0];
857
+			$widget = strpos($file_name[0], 'EEW_') === 0 ? substr($file_name[0], 4) : $file_name[0];
858 858
 			// sanitize shortcode directory name
859
-			$widget = sanitize_key( $widget );
859
+			$widget = sanitize_key($widget);
860 860
 			// now we need to rebuild the shortcode path
861
-			$widget_path = explode( DS, $widget_path );
861
+			$widget_path = explode(DS, $widget_path);
862 862
 			// remove last segment
863
-			array_pop( $widget_path );
863
+			array_pop($widget_path);
864 864
 			// glue it back together
865
-			$widget_path = implode( DS, $widget_path );
865
+			$widget_path = implode(DS, $widget_path);
866 866
 		} else {
867 867
 			// grab and sanitize widget directory name
868
-			$widget = sanitize_key( basename( $widget_path ));
868
+			$widget = sanitize_key(basename($widget_path));
869 869
 		}
870 870
 		// create classname from widget directory name
871
-		$widget = str_replace( ' ', '_', ucwords( str_replace( '_', ' ', $widget )));
871
+		$widget = str_replace(' ', '_', ucwords(str_replace('_', ' ', $widget)));
872 872
 		// add class prefix
873
-		$widget_class = 'EEW_' . $widget;
873
+		$widget_class = 'EEW_'.$widget;
874 874
 		// does the widget exist ?
875
-		if ( ! is_readable( $widget_path . DS . $widget_class . $widget_ext )) {
875
+		if ( ! is_readable($widget_path.DS.$widget_class.$widget_ext)) {
876 876
 			$msg = sprintf(
877
-				__( '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' ),
877
+				__('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'),
878 878
 				$widget_class,
879
-				$widget_path . DS . $widget_class . $widget_ext
879
+				$widget_path.DS.$widget_class.$widget_ext
880 880
 			);
881
-			EE_Error::add_error( $msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__ );
881
+			EE_Error::add_error($msg.'||'.$msg, __FILE__, __FUNCTION__, __LINE__);
882 882
 			return;
883 883
 		}
884 884
 		// load the widget class file
885
-		require_once( $widget_path . DS . $widget_class . $widget_ext );
885
+		require_once($widget_path.DS.$widget_class.$widget_ext);
886 886
 		// verify that class exists
887
-		if ( ! class_exists( $widget_class )) {
888
-			$msg = sprintf( __( 'The requested %s widget class does not exist.', 'event_espresso' ), $widget_class );
889
-			EE_Error::add_error( $msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__ );
887
+		if ( ! class_exists($widget_class)) {
888
+			$msg = sprintf(__('The requested %s widget class does not exist.', 'event_espresso'), $widget_class);
889
+			EE_Error::add_error($msg.'||'.$msg, __FILE__, __FUNCTION__, __LINE__);
890 890
 			return;
891 891
 		}
892
-		register_widget( $widget_class );
892
+		register_widget($widget_class);
893 893
 		// add to array of registered widgets
894
-		EE_Registry::instance()->widgets->$widget_class = $widget_path . DS . $widget_class . $widget_ext;
894
+		EE_Registry::instance()->widgets->$widget_class = $widget_path.DS.$widget_class.$widget_ext;
895 895
 	}
896 896
 
897 897
 
@@ -904,18 +904,18 @@  discard block
 block discarded – undo
904 904
 	 */
905 905
 	private function _register_shortcodes() {
906 906
 		// grab list of installed shortcodes
907
-		$shortcodes_to_register = glob( EE_SHORTCODES . '*', GLOB_ONLYDIR );
907
+		$shortcodes_to_register = glob(EE_SHORTCODES.'*', GLOB_ONLYDIR);
908 908
 		// filter list of modules to register
909
-		$shortcodes_to_register = apply_filters( 'FHEE__EE_Config__register_shortcodes__shortcodes_to_register', $shortcodes_to_register );
910
-		if ( ! empty( $shortcodes_to_register ) ) {
909
+		$shortcodes_to_register = apply_filters('FHEE__EE_Config__register_shortcodes__shortcodes_to_register', $shortcodes_to_register);
910
+		if ( ! empty($shortcodes_to_register)) {
911 911
 			// cycle thru shortcode folders
912
-			foreach ( $shortcodes_to_register as $shortcode_path ) {
912
+			foreach ($shortcodes_to_register as $shortcode_path) {
913 913
 				// add to list of installed shortcode modules
914
-				EE_Config::register_shortcode( $shortcode_path );
914
+				EE_Config::register_shortcode($shortcode_path);
915 915
 			}
916 916
 		}
917 917
 		// filter list of installed modules
918
-		return apply_filters( 'FHEE__EE_Config___register_shortcodes__installed_shortcodes', EE_Registry::instance()->shortcodes );
918
+		return apply_filters('FHEE__EE_Config___register_shortcodes__installed_shortcodes', EE_Registry::instance()->shortcodes);
919 919
 	}
920 920
 
921 921
 
@@ -927,56 +927,56 @@  discard block
 block discarded – undo
927 927
 	 *  @param 	string 		$shortcode_path - full path up to and including shortcode folder
928 928
 	 *  @return 	bool
929 929
 	 */
930
-	public static function register_shortcode( $shortcode_path = NULL ) {
931
-		do_action( 'AHEE__EE_Config__register_shortcode__begin',$shortcode_path );
930
+	public static function register_shortcode($shortcode_path = NULL) {
931
+		do_action('AHEE__EE_Config__register_shortcode__begin', $shortcode_path);
932 932
 		$shortcode_ext = '.shortcode.php';
933 933
 		// make all separators match
934
-		$shortcode_path = str_replace( array( '\\', '/' ), DS, $shortcode_path );
934
+		$shortcode_path = str_replace(array('\\', '/'), DS, $shortcode_path);
935 935
 		// does the file path INCLUDE the actual file name as part of the path ?
936
-		if ( strpos( $shortcode_path, $shortcode_ext ) !== FALSE ) {
936
+		if (strpos($shortcode_path, $shortcode_ext) !== FALSE) {
937 937
 			// grab shortcode file name from directory name and break apart at dots
938
-			$shortcode_file = explode( '.', basename( $shortcode_path ));
938
+			$shortcode_file = explode('.', basename($shortcode_path));
939 939
 			// take first segment from file name pieces and remove class prefix if it exists
940
-			$shortcode = strpos( $shortcode_file[0], 'EES_' ) === 0 ? substr( $shortcode_file[0], 4 ) : $shortcode_file[0];
940
+			$shortcode = strpos($shortcode_file[0], 'EES_') === 0 ? substr($shortcode_file[0], 4) : $shortcode_file[0];
941 941
 			// sanitize shortcode directory name
942
-			$shortcode = sanitize_key( $shortcode );
942
+			$shortcode = sanitize_key($shortcode);
943 943
 			// now we need to rebuild the shortcode path
944
-			$shortcode_path = explode( DS, $shortcode_path );
944
+			$shortcode_path = explode(DS, $shortcode_path);
945 945
 			// remove last segment
946
-			array_pop( $shortcode_path );
946
+			array_pop($shortcode_path);
947 947
 			// glue it back together
948
-			$shortcode_path = implode( DS, $shortcode_path ) . DS;
948
+			$shortcode_path = implode(DS, $shortcode_path).DS;
949 949
 		} else {
950 950
 			// we need to generate the filename based off of the folder name
951 951
 			// grab and sanitize shortcode directory name
952
-			$shortcode = sanitize_key( basename( $shortcode_path ));
953
-			$shortcode_path = rtrim( $shortcode_path, DS ) . DS;
952
+			$shortcode = sanitize_key(basename($shortcode_path));
953
+			$shortcode_path = rtrim($shortcode_path, DS).DS;
954 954
 		}
955 955
 		// create classname from shortcode directory or file name
956
-		$shortcode = str_replace( ' ', '_', ucwords( str_replace( '_', ' ', $shortcode )));
956
+		$shortcode = str_replace(' ', '_', ucwords(str_replace('_', ' ', $shortcode)));
957 957
 		// add class prefix
958
-		$shortcode_class = 'EES_' . $shortcode;
958
+		$shortcode_class = 'EES_'.$shortcode;
959 959
 		// does the shortcode exist ?
960
-		if ( ! is_readable( $shortcode_path . DS . $shortcode_class . $shortcode_ext )) {
960
+		if ( ! is_readable($shortcode_path.DS.$shortcode_class.$shortcode_ext)) {
961 961
 			$msg = sprintf(
962
-				__( 'The requested %s shortcode file could not be found or is not readable due to file permissions. It should be in %s', 'event_espresso' ),
962
+				__('The requested %s shortcode file could not be found or is not readable due to file permissions. It should be in %s', 'event_espresso'),
963 963
 				$shortcode_class,
964
-				$shortcode_path . DS . $shortcode_class . $shortcode_ext
964
+				$shortcode_path.DS.$shortcode_class.$shortcode_ext
965 965
 			);
966
-			EE_Error::add_error( $msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__ );
966
+			EE_Error::add_error($msg.'||'.$msg, __FILE__, __FUNCTION__, __LINE__);
967 967
 			return FALSE;
968 968
 		}
969 969
 		// load the shortcode class file
970
-		require_once( $shortcode_path . $shortcode_class . $shortcode_ext );
970
+		require_once($shortcode_path.$shortcode_class.$shortcode_ext);
971 971
 		// verify that class exists
972
-		if ( ! class_exists( $shortcode_class )) {
973
-			$msg = sprintf( __( 'The requested %s shortcode class does not exist.', 'event_espresso' ), $shortcode_class );
974
-			EE_Error::add_error( $msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__ );
972
+		if ( ! class_exists($shortcode_class)) {
973
+			$msg = sprintf(__('The requested %s shortcode class does not exist.', 'event_espresso'), $shortcode_class);
974
+			EE_Error::add_error($msg.'||'.$msg, __FILE__, __FUNCTION__, __LINE__);
975 975
 			return FALSE;
976 976
 		}
977
-		$shortcode = strtoupper( $shortcode );
977
+		$shortcode = strtoupper($shortcode);
978 978
 		// add to array of registered shortcodes
979
-		EE_Registry::instance()->shortcodes->$shortcode = $shortcode_path . $shortcode_class . $shortcode_ext;
979
+		EE_Registry::instance()->shortcodes->$shortcode = $shortcode_path.$shortcode_class.$shortcode_ext;
980 980
 		return TRUE;
981 981
 	}
982 982
 
@@ -991,23 +991,23 @@  discard block
 block discarded – undo
991 991
 	 */
992 992
 	private function _register_modules() {
993 993
 		// grab list of installed modules
994
-		$modules_to_register = glob( EE_MODULES . '*', GLOB_ONLYDIR );
994
+		$modules_to_register = glob(EE_MODULES.'*', GLOB_ONLYDIR);
995 995
 		// filter list of modules to register
996
-		$modules_to_register = apply_filters( 'FHEE__EE_Config__register_modules__modules_to_register', $modules_to_register );
996
+		$modules_to_register = apply_filters('FHEE__EE_Config__register_modules__modules_to_register', $modules_to_register);
997 997
 
998 998
 
999
-		if ( ! empty( $modules_to_register ) ) {
999
+		if ( ! empty($modules_to_register)) {
1000 1000
 			// loop through folders
1001
-			foreach ( $modules_to_register as $module_path ) {
1001
+			foreach ($modules_to_register as $module_path) {
1002 1002
 				/**TEMPORARILY EXCLUDE gateways from modules for time being**/
1003
-				if ( $module_path != EE_MODULES . 'zzz-copy-this-module-template' && $module_path != EE_MODULES . 'gateways' ) {
1003
+				if ($module_path != EE_MODULES.'zzz-copy-this-module-template' && $module_path != EE_MODULES.'gateways') {
1004 1004
 					// add to list of installed modules
1005
-					EE_Config::register_module( $module_path );
1005
+					EE_Config::register_module($module_path);
1006 1006
 				}
1007 1007
 			}
1008 1008
 		}
1009 1009
 		// filter list of installed modules
1010
-		return apply_filters( 'FHEE__EE_Config___register_modules__installed_modules', EE_Registry::instance()->modules );
1010
+		return apply_filters('FHEE__EE_Config___register_modules__installed_modules', EE_Registry::instance()->modules);
1011 1011
 	}
1012 1012
 
1013 1013
 
@@ -1020,54 +1020,54 @@  discard block
 block discarded – undo
1020 1020
 	 *  @param 	string 		$module_path - full path up to and including module folder
1021 1021
 	 *  @return 	bool
1022 1022
 	 */
1023
-	public static function register_module( $module_path = NULL ) {
1024
-		do_action( 'AHEE__EE_Config__register_module__begin', $module_path );
1023
+	public static function register_module($module_path = NULL) {
1024
+		do_action('AHEE__EE_Config__register_module__begin', $module_path);
1025 1025
 		$module_ext = '.module.php';
1026 1026
 		// make all separators match
1027
-		$module_path = str_replace( array( '\\', '/' ), DS, $module_path );
1027
+		$module_path = str_replace(array('\\', '/'), DS, $module_path);
1028 1028
 		// does the file path INCLUDE the actual file name as part of the path ?
1029
-		if ( strpos( $module_path, $module_ext ) !== FALSE ) {
1029
+		if (strpos($module_path, $module_ext) !== FALSE) {
1030 1030
 			// grab and shortcode file name from directory name and break apart at dots
1031
-			$module_file = explode( '.', basename( $module_path ));
1031
+			$module_file = explode('.', basename($module_path));
1032 1032
 			// now we need to rebuild the shortcode path
1033
-			$module_path = explode( DS, $module_path );
1033
+			$module_path = explode(DS, $module_path);
1034 1034
 			// remove last segment
1035
-			array_pop( $module_path );
1035
+			array_pop($module_path);
1036 1036
 			// glue it back together
1037
-			$module_path = implode( DS, $module_path ) . DS;
1037
+			$module_path = implode(DS, $module_path).DS;
1038 1038
 			// take first segment from file name pieces and sanitize it
1039
-			$module = preg_replace( '/[^a-zA-Z0-9_\-]/', '', $module_file[0] );
1039
+			$module = preg_replace('/[^a-zA-Z0-9_\-]/', '', $module_file[0]);
1040 1040
 			// ensure class prefix is added
1041
-			$module_class = strpos( $module, 'EED_' ) !== 0 ? 'EED_' . $module : $module;
1041
+			$module_class = strpos($module, 'EED_') !== 0 ? 'EED_'.$module : $module;
1042 1042
 		} else {
1043 1043
 			// we need to generate the filename based off of the folder name
1044 1044
 			// grab and sanitize module name
1045
-			$module = strtolower( basename( $module_path ));
1046
-			$module = preg_replace( '/[^a-z0-9_\-]/', '', $module);
1045
+			$module = strtolower(basename($module_path));
1046
+			$module = preg_replace('/[^a-z0-9_\-]/', '', $module);
1047 1047
 			// like trailingslashit()
1048
-			$module_path = rtrim( $module_path, DS ) . DS;
1048
+			$module_path = rtrim($module_path, DS).DS;
1049 1049
 			// create classname from module directory name
1050
-			$module = str_replace( ' ', '_', ucwords( str_replace( '_', ' ', $module )));
1050
+			$module = str_replace(' ', '_', ucwords(str_replace('_', ' ', $module)));
1051 1051
 			// add class prefix
1052
-			$module_class = 'EED_' . $module;
1052
+			$module_class = 'EED_'.$module;
1053 1053
 		}
1054 1054
 		// does the module exist ?
1055
-		if ( ! is_readable( $module_path . DS . $module_class . $module_ext )) {
1056
-			$msg = sprintf( __( 'The requested %s module file could not be found or is not readable due to file permissions.', 'event_espresso' ), $module );
1057
-			EE_Error::add_error( $msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__ );
1055
+		if ( ! is_readable($module_path.DS.$module_class.$module_ext)) {
1056
+			$msg = sprintf(__('The requested %s module file could not be found or is not readable due to file permissions.', 'event_espresso'), $module);
1057
+			EE_Error::add_error($msg.'||'.$msg, __FILE__, __FUNCTION__, __LINE__);
1058 1058
 			return FALSE;
1059 1059
 		}
1060 1060
 		// load the module class file
1061
-		require_once( $module_path . $module_class . $module_ext );
1061
+		require_once($module_path.$module_class.$module_ext);
1062 1062
 		// verify that class exists
1063
-		if ( ! class_exists( $module_class )) {
1064
-			$msg = sprintf( __( 'The requested %s module class does not exist.', 'event_espresso' ), $module_class );
1065
-			EE_Error::add_error( $msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__ );
1063
+		if ( ! class_exists($module_class)) {
1064
+			$msg = sprintf(__('The requested %s module class does not exist.', 'event_espresso'), $module_class);
1065
+			EE_Error::add_error($msg.'||'.$msg, __FILE__, __FUNCTION__, __LINE__);
1066 1066
 			return FALSE;
1067 1067
 		}
1068 1068
 		// add to array of registered modules
1069
-		EE_Registry::instance()->modules->$module_class = $module_path . $module_class . $module_ext;
1070
-		do_action( 'AHEE__EE_Config__register_module__complete', $module_class, EE_Registry::instance()->modules->$module_class );
1069
+		EE_Registry::instance()->modules->$module_class = $module_path.$module_class.$module_ext;
1070
+		do_action('AHEE__EE_Config__register_module__complete', $module_class, EE_Registry::instance()->modules->$module_class);
1071 1071
 		return TRUE;
1072 1072
 	}
1073 1073
 
@@ -1081,23 +1081,23 @@  discard block
 block discarded – undo
1081 1081
 	 */
1082 1082
 	private function _initialize_shortcodes() {
1083 1083
 		// cycle thru shortcode folders
1084
-		foreach ( EE_Registry::instance()->shortcodes as $shortcode => $shortcode_path ) {
1084
+		foreach (EE_Registry::instance()->shortcodes as $shortcode => $shortcode_path) {
1085 1085
 			// add class prefix
1086
-			$shortcode_class = 'EES_' . $shortcode;
1086
+			$shortcode_class = 'EES_'.$shortcode;
1087 1087
 			// fire the shortcode class's set_hooks methods in case it needs to hook into other parts of the system
1088 1088
 			// which set hooks ?
1089
-			if ( is_admin() ) {
1089
+			if (is_admin()) {
1090 1090
 				// fire immediately
1091
-				call_user_func( array( $shortcode_class, 'set_hooks_admin' ));
1091
+				call_user_func(array($shortcode_class, 'set_hooks_admin'));
1092 1092
 			} else {
1093 1093
 				// delay until other systems are online
1094
-				add_action( 'AHEE__EE_System__set_hooks_for_shortcodes_modules_and_addons', array( $shortcode_class,'set_hooks' ));
1094
+				add_action('AHEE__EE_System__set_hooks_for_shortcodes_modules_and_addons', array($shortcode_class, 'set_hooks'));
1095 1095
 				// convert classname to UPPERCASE and create WP shortcode.
1096
-				$shortcode_tag = strtoupper( $shortcode );
1096
+				$shortcode_tag = strtoupper($shortcode);
1097 1097
 				// but first check if the shortcode has already been added before assigning 'fallback_shortcode_processor'
1098
-				if ( ! shortcode_exists( $shortcode_tag )) {
1098
+				if ( ! shortcode_exists($shortcode_tag)) {
1099 1099
 					// NOTE: this shortcode declaration will get overridden if the shortcode is successfully detected in the post content in EE_Front_Controller->_initialize_shortcodes()
1100
-					add_shortcode( $shortcode_tag, array( $shortcode_class, 'fallback_shortcode_processor' ));
1100
+					add_shortcode($shortcode_tag, array($shortcode_class, 'fallback_shortcode_processor'));
1101 1101
 				}
1102 1102
 			}
1103 1103
 		}
@@ -1114,15 +1114,15 @@  discard block
 block discarded – undo
1114 1114
 	 */
1115 1115
 	private function _initialize_modules() {
1116 1116
 		// cycle thru shortcode folders
1117
-		foreach ( EE_Registry::instance()->modules as $module_class => $module_path ) {
1117
+		foreach (EE_Registry::instance()->modules as $module_class => $module_path) {
1118 1118
 			// fire the shortcode class's set_hooks methods in case it needs to hook into other parts of the system
1119 1119
 			// which set hooks ?
1120
-			if ( is_admin() ) {
1120
+			if (is_admin()) {
1121 1121
 				// fire immediately
1122
-				call_user_func( array( $module_class, 'set_hooks_admin' ));
1122
+				call_user_func(array($module_class, 'set_hooks_admin'));
1123 1123
 			} else {
1124 1124
 				// delay until other systems are online
1125
-				add_action( 'AHEE__EE_System__set_hooks_for_shortcodes_modules_and_addons', array( $module_class,'set_hooks' ));
1125
+				add_action('AHEE__EE_System__set_hooks_for_shortcodes_modules_and_addons', array($module_class, 'set_hooks'));
1126 1126
 			}
1127 1127
 		}
1128 1128
 	}
@@ -1140,26 +1140,26 @@  discard block
 block discarded – undo
1140 1140
 	 *  @param 	string 		$key - url param key indicating a route is being called
1141 1141
 	 *  @return 	bool
1142 1142
 	 */
1143
-	public static function register_route( $route = NULL, $module = NULL, $method_name = NULL, $key = 'ee' ) {
1144
-		do_action( 'AHEE__EE_Config__register_route__begin', $route, $module, $method_name );
1145
-		$module = str_replace( 'EED_', '', $module );
1146
-		$module_class = 'EED_' . $module;
1147
-		if ( ! isset( EE_Registry::instance()->modules->$module_class )) {
1148
-			$msg = sprintf( __( 'The module %s has not been registered.', 'event_espresso' ), $module );
1149
-			EE_Error::add_error( $msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__ );
1143
+	public static function register_route($route = NULL, $module = NULL, $method_name = NULL, $key = 'ee') {
1144
+		do_action('AHEE__EE_Config__register_route__begin', $route, $module, $method_name);
1145
+		$module = str_replace('EED_', '', $module);
1146
+		$module_class = 'EED_'.$module;
1147
+		if ( ! isset(EE_Registry::instance()->modules->$module_class)) {
1148
+			$msg = sprintf(__('The module %s has not been registered.', 'event_espresso'), $module);
1149
+			EE_Error::add_error($msg.'||'.$msg, __FILE__, __FUNCTION__, __LINE__);
1150 1150
 			return FALSE;
1151 1151
 		}
1152
-		if ( empty( $route )) {
1153
-			$msg = sprintf( __( 'No route has been supplied.', 'event_espresso' ), $route );
1154
-			EE_Error::add_error( $msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__ );
1152
+		if (empty($route)) {
1153
+			$msg = sprintf(__('No route has been supplied.', 'event_espresso'), $route);
1154
+			EE_Error::add_error($msg.'||'.$msg, __FILE__, __FUNCTION__, __LINE__);
1155 1155
 			return FALSE;
1156 1156
 		}
1157
-		if ( ! method_exists ( 'EED_' . $module, $method_name )) {
1158
-			$msg = sprintf( __( 'A valid class method for the %s route has not been supplied.', 'event_espresso' ), $route );
1159
-			EE_Error::add_error( $msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__ );
1157
+		if ( ! method_exists('EED_'.$module, $method_name)) {
1158
+			$msg = sprintf(__('A valid class method for the %s route has not been supplied.', 'event_espresso'), $route);
1159
+			EE_Error::add_error($msg.'||'.$msg, __FILE__, __FUNCTION__, __LINE__);
1160 1160
 			return FALSE;
1161 1161
 		}
1162
-		EE_Config::$_module_route_map[ $key ][ $route ] = array( 'EED_' . $module, $method_name );
1162
+		EE_Config::$_module_route_map[$key][$route] = array('EED_'.$module, $method_name);
1163 1163
 		return TRUE;
1164 1164
 	}
1165 1165
 
@@ -1173,11 +1173,11 @@  discard block
 block discarded – undo
1173 1173
 	 *  @param 	string 		$key - url param key indicating a route is being called
1174 1174
 	 *  @return 	string
1175 1175
 	 */
1176
-	public static function get_route( $route = NULL, $key = 'ee' ) {
1177
-		do_action( 'AHEE__EE_Config__get_route__begin',$route );
1178
-		$route = apply_filters( 'FHEE__EE_Config__get_route',$route );
1179
-		if ( isset( EE_Config::$_module_route_map[ $key ][ $route ] )) {
1180
-			return EE_Config::$_module_route_map[ $key ][ $route ];
1176
+	public static function get_route($route = NULL, $key = 'ee') {
1177
+		do_action('AHEE__EE_Config__get_route__begin', $route);
1178
+		$route = apply_filters('FHEE__EE_Config__get_route', $route);
1179
+		if (isset(EE_Config::$_module_route_map[$key][$route])) {
1180
+			return EE_Config::$_module_route_map[$key][$route];
1181 1181
 		}
1182 1182
 		return NULL;
1183 1183
 	}
@@ -1206,35 +1206,35 @@  discard block
 block discarded – undo
1206 1206
 	 * @param    string 		$key - url param key indicating a route is being called
1207 1207
 	 * @return    bool
1208 1208
 	 */
1209
-	public static function register_forward( $route = NULL, $status = 0, $forward = NULL, $key = 'ee' ) {
1210
-		do_action( 'AHEE__EE_Config__register_forward',$route,$status,$forward );
1211
-		if ( ! isset( EE_Config::$_module_route_map[ $key ][ $route ] ) ||  empty( $route )) {
1212
-			$msg = sprintf( __( 'The module route %s for this forward has not been registered.', 'event_espresso' ), $route );
1213
-			EE_Error::add_error( $msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__ );
1209
+	public static function register_forward($route = NULL, $status = 0, $forward = NULL, $key = 'ee') {
1210
+		do_action('AHEE__EE_Config__register_forward', $route, $status, $forward);
1211
+		if ( ! isset(EE_Config::$_module_route_map[$key][$route]) || empty($route)) {
1212
+			$msg = sprintf(__('The module route %s for this forward has not been registered.', 'event_espresso'), $route);
1213
+			EE_Error::add_error($msg.'||'.$msg, __FILE__, __FUNCTION__, __LINE__);
1214 1214
 			return FALSE;
1215 1215
 		}
1216
-		if ( empty( $forward )) {
1217
-			$msg = sprintf( __( 'No forwarding route has been supplied.', 'event_espresso' ), $route );
1218
-			EE_Error::add_error( $msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__ );
1216
+		if (empty($forward)) {
1217
+			$msg = sprintf(__('No forwarding route has been supplied.', 'event_espresso'), $route);
1218
+			EE_Error::add_error($msg.'||'.$msg, __FILE__, __FUNCTION__, __LINE__);
1219 1219
 			return FALSE;
1220 1220
 		}
1221
-		if ( is_array( $forward )) {
1222
-			if ( ! isset( $forward[1] )) {
1223
-				$msg = sprintf( __( 'A class method for the %s forwarding route has not been supplied.', 'event_espresso' ), $route );
1224
-				EE_Error::add_error( $msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__ );
1221
+		if (is_array($forward)) {
1222
+			if ( ! isset($forward[1])) {
1223
+				$msg = sprintf(__('A class method for the %s forwarding route has not been supplied.', 'event_espresso'), $route);
1224
+				EE_Error::add_error($msg.'||'.$msg, __FILE__, __FUNCTION__, __LINE__);
1225 1225
 				return FALSE;
1226 1226
 			}
1227
-			if ( ! method_exists( $forward[0], $forward[1] )) {
1228
-				$msg = sprintf( __( 'The class method %s for the %s forwarding route is in invalid.', 'event_espresso' ), $forward[1], $route );
1229
-				EE_Error::add_error( $msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__ );
1227
+			if ( ! method_exists($forward[0], $forward[1])) {
1228
+				$msg = sprintf(__('The class method %s for the %s forwarding route is in invalid.', 'event_espresso'), $forward[1], $route);
1229
+				EE_Error::add_error($msg.'||'.$msg, __FILE__, __FUNCTION__, __LINE__);
1230 1230
 				return FALSE;
1231 1231
 			}
1232
-		} else if ( ! function_exists( $forward )) {
1233
-			$msg = sprintf( __( 'The function %s for the %s forwarding route is in invalid.', 'event_espresso' ), $forward, $route );
1234
-			EE_Error::add_error( $msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__ );
1232
+		} else if ( ! function_exists($forward)) {
1233
+			$msg = sprintf(__('The function %s for the %s forwarding route is in invalid.', 'event_espresso'), $forward, $route);
1234
+			EE_Error::add_error($msg.'||'.$msg, __FILE__, __FUNCTION__, __LINE__);
1235 1235
 			return FALSE;
1236 1236
 		}
1237
-		EE_Config::$_module_forward_map[ $key ][ $route ][ absint( $status ) ] = $forward;
1237
+		EE_Config::$_module_forward_map[$key][$route][absint($status)] = $forward;
1238 1238
 		return TRUE;
1239 1239
 	}
1240 1240
 
@@ -1249,10 +1249,10 @@  discard block
 block discarded – undo
1249 1249
 	 *  @param    string 		$key - url param key indicating a route is being called
1250 1250
 	 *  @return 	string
1251 1251
 	 */
1252
-	public static function get_forward( $route = NULL, $status = 0, $key = 'ee' ) {
1253
-		do_action( 'AHEE__EE_Config__get_forward__begin',$route,$status );
1254
-		if ( isset( EE_Config::$_module_forward_map[ $key ][ $route ][ $status ] )) {
1255
-			return apply_filters( 'FHEE__EE_Config__get_forward', EE_Config::$_module_forward_map[ $key ][ $route ][ $status ], $route,$status );
1252
+	public static function get_forward($route = NULL, $status = 0, $key = 'ee') {
1253
+		do_action('AHEE__EE_Config__get_forward__begin', $route, $status);
1254
+		if (isset(EE_Config::$_module_forward_map[$key][$route][$status])) {
1255
+			return apply_filters('FHEE__EE_Config__get_forward', EE_Config::$_module_forward_map[$key][$route][$status], $route, $status);
1256 1256
 		}
1257 1257
 		return NULL;
1258 1258
 	}
@@ -1269,19 +1269,19 @@  discard block
 block discarded – undo
1269 1269
 	 * @param    string 		$key - url param key indicating a route is being called
1270 1270
 	 * @return    bool
1271 1271
 	 */
1272
-	public static function register_view( $route = NULL, $status = 0, $view = NULL, $key = 'ee' ) {
1273
-		do_action( 'AHEE__EE_Config__register_view__begin',$route,$status,$view );
1274
-		if ( ! isset( EE_Config::$_module_route_map[ $key ][ $route ] ) ||  empty( $route )) {
1275
-			$msg = sprintf( __( 'The module route %s for this view has not been registered.', 'event_espresso' ), $route );
1276
-			EE_Error::add_error( $msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__ );
1272
+	public static function register_view($route = NULL, $status = 0, $view = NULL, $key = 'ee') {
1273
+		do_action('AHEE__EE_Config__register_view__begin', $route, $status, $view);
1274
+		if ( ! isset(EE_Config::$_module_route_map[$key][$route]) || empty($route)) {
1275
+			$msg = sprintf(__('The module route %s for this view has not been registered.', 'event_espresso'), $route);
1276
+			EE_Error::add_error($msg.'||'.$msg, __FILE__, __FUNCTION__, __LINE__);
1277 1277
 			return FALSE;
1278 1278
 		}
1279
-		if ( ! is_readable( $view )) {
1280
-			$msg = sprintf( __( 'The %s view file could not be found or is not readable due to file permissions.', 'event_espresso' ), $view );
1281
-			EE_Error::add_error( $msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__ );
1279
+		if ( ! is_readable($view)) {
1280
+			$msg = sprintf(__('The %s view file could not be found or is not readable due to file permissions.', 'event_espresso'), $view);
1281
+			EE_Error::add_error($msg.'||'.$msg, __FILE__, __FUNCTION__, __LINE__);
1282 1282
 			return FALSE;
1283 1283
 		}
1284
-		EE_Config::$_module_view_map[ $key ][ $route ][ absint( $status ) ] = $view;
1284
+		EE_Config::$_module_view_map[$key][$route][absint($status)] = $view;
1285 1285
 		return TRUE;
1286 1286
 	}
1287 1287
 
@@ -1298,10 +1298,10 @@  discard block
 block discarded – undo
1298 1298
 	 *  @param    string 		$key - url param key indicating a route is being called
1299 1299
 	 *  @return 	string
1300 1300
 	 */
1301
-	public static function get_view( $route = NULL, $status = 0, $key = 'ee' ) {
1302
-		do_action( 'AHEE__EE_Config__get_view__begin',$route,$status );
1303
-		if ( isset( EE_Config::$_module_view_map[ $key ][ $route ][ $status ] )) {
1304
-			return apply_filters( 'FHEE__EE_Config__get_view', EE_Config::$_module_view_map[ $key ][ $route ][ $status ], $route,$status );
1301
+	public static function get_view($route = NULL, $status = 0, $key = 'ee') {
1302
+		do_action('AHEE__EE_Config__get_view__begin', $route, $status);
1303
+		if (isset(EE_Config::$_module_view_map[$key][$route][$status])) {
1304
+			return apply_filters('FHEE__EE_Config__get_view', EE_Config::$_module_view_map[$key][$route][$status], $route, $status);
1305 1305
 		}
1306 1306
 		return NULL;
1307 1307
 	}
@@ -1309,7 +1309,7 @@  discard block
 block discarded – undo
1309 1309
 
1310 1310
 
1311 1311
 	public function shutdown() {
1312
-		update_option( 'ee_config_option_names', $this->_config_option_names );
1312
+		update_option('ee_config_option_names', $this->_config_option_names);
1313 1313
 	}
1314 1314
 
1315 1315
 
@@ -1325,7 +1325,7 @@  discard block
 block discarded – undo
1325 1325
  * magic functions in use, except we'll allow them to magically set and get stuff...
1326 1326
  * basically, they should just be well-defined stdClasses
1327 1327
  */
1328
-class EE_Config_Base{
1328
+class EE_Config_Base {
1329 1329
 
1330 1330
 	/**
1331 1331
 	 * Utility function for escaping the value of a property and returning.
@@ -1334,13 +1334,13 @@  discard block
 block discarded – undo
1334 1334
 	 * @return mixed if a detected type found return the escaped value, otherwise just the raw value is returned.
1335 1335
 	 * @throws \EE_Error
1336 1336
 	 */
1337
-	public function get_pretty( $property ) {
1338
-		if ( ! property_exists( $this, $property ) ) {
1339
-			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 ) );
1337
+	public function get_pretty($property) {
1338
+		if ( ! property_exists($this, $property)) {
1339
+			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));
1340 1340
 		}
1341 1341
 		//just handling escaping of strings for now.
1342
-		if ( is_string( $this->$property ) ) {
1343
-			return stripslashes( $this->$property );
1342
+		if (is_string($this->$property)) {
1343
+			return stripslashes($this->$property);
1344 1344
 		}
1345 1345
 		return $this->$property;
1346 1346
 	}
@@ -1349,19 +1349,19 @@  discard block
 block discarded – undo
1349 1349
 
1350 1350
 	public function populate() {
1351 1351
 		//grab defaults via a new instance of this class.
1352
-		$class_name = get_class( $this );
1352
+		$class_name = get_class($this);
1353 1353
 		$defaults = new $class_name;
1354 1354
 
1355 1355
 		//loop through the properties for this class and see if they are set.  If they are NOT, then grab the
1356 1356
 		//default from our $defaults object.
1357
-		foreach ( get_object_vars( $defaults ) as $property => $value ) {
1358
-			if ( is_null( $this->$property ) ) {
1357
+		foreach (get_object_vars($defaults) as $property => $value) {
1358
+			if (is_null($this->$property)) {
1359 1359
 				$this->$property = $value;
1360 1360
 			}
1361 1361
 		}
1362 1362
 
1363 1363
 		//cleanup
1364
-		unset( $defaults );
1364
+		unset($defaults);
1365 1365
 	}
1366 1366
 
1367 1367
 
@@ -1453,12 +1453,12 @@  discard block
 block discarded – undo
1453 1453
 	 */
1454 1454
 	public function __construct() {
1455 1455
 		$current_network_main_site = is_multisite() ? get_current_site() : NULL;
1456
-		$current_main_site_id = !empty( $current_network_main_site ) ? $current_network_main_site->blog_id : 1;
1456
+		$current_main_site_id = ! empty($current_network_main_site) ? $current_network_main_site->blog_id : 1;
1457 1457
 		// set default organization settings
1458 1458
 		$this->current_blog_id = get_current_blog_id();
1459 1459
 		$this->current_blog_id = $this->current_blog_id === NULL ? 1 : $this->current_blog_id;
1460
-		$this->ee_ueip_optin = is_main_site() ? get_option( 'ee_ueip_optin', TRUE ) : get_blog_option( $current_main_site_id, 'ee_ueip_optin', TRUE );
1461
-		$this->ee_ueip_has_notified = is_main_site() ? get_option( 'ee_ueip_has_notified', FALSE ) : TRUE;
1460
+		$this->ee_ueip_optin = is_main_site() ? get_option('ee_ueip_optin', TRUE) : get_blog_option($current_main_site_id, 'ee_ueip_optin', TRUE);
1461
+		$this->ee_ueip_has_notified = is_main_site() ? get_option('ee_ueip_has_notified', FALSE) : TRUE;
1462 1462
 		$this->post_shortcodes = array();
1463 1463
 		$this->module_route_map = array();
1464 1464
 		$this->module_forward_map = array();
@@ -1477,7 +1477,7 @@  discard block
 block discarded – undo
1477 1477
 		$this->event_cpt_slug = __('events', 'event_espresso');
1478 1478
 
1479 1479
 		//ueip constant check
1480
-		if ( defined( 'EE_DISABLE_UXIP' ) && EE_DISABLE_UXIP ) {
1480
+		if (defined('EE_DISABLE_UXIP') && EE_DISABLE_UXIP) {
1481 1481
 			$this->ee_ueip_optin = FALSE;
1482 1482
 			$this->ee_ueip_has_notified = TRUE;
1483 1483
 		}
@@ -1517,8 +1517,8 @@  discard block
 block discarded – undo
1517 1517
 	 *  @return 	string
1518 1518
 	 */
1519 1519
 	public function reg_page_url() {
1520
-		if ( ! $this->reg_page_url ) {
1521
-			$this->reg_page_url = get_permalink( $this->reg_page_id ) . '#checkout';
1520
+		if ( ! $this->reg_page_url) {
1521
+			$this->reg_page_url = get_permalink($this->reg_page_id).'#checkout';
1522 1522
 		}
1523 1523
 		return $this->reg_page_url;
1524 1524
 	}
@@ -1531,12 +1531,12 @@  discard block
 block discarded – undo
1531 1531
 	 *  @return 	string
1532 1532
 	 */
1533 1533
 	public function txn_page_url($query_args = array()) {
1534
-		if ( ! $this->txn_page_url ) {
1535
-			$this->txn_page_url = get_permalink( $this->txn_page_id );
1534
+		if ( ! $this->txn_page_url) {
1535
+			$this->txn_page_url = get_permalink($this->txn_page_id);
1536 1536
 		}
1537
-		if($query_args){
1538
-			return add_query_arg($query_args,$this->txn_page_url);
1539
-		}else{
1537
+		if ($query_args) {
1538
+			return add_query_arg($query_args, $this->txn_page_url);
1539
+		} else {
1540 1540
 			return $this->txn_page_url;
1541 1541
 		}
1542 1542
 	}
@@ -1548,12 +1548,12 @@  discard block
 block discarded – undo
1548 1548
 	 *  @return 	string
1549 1549
 	 */
1550 1550
 	public function thank_you_page_url($query_args = array()) {
1551
-		if ( ! $this->thank_you_page_url ) {
1552
-			$this->thank_you_page_url = get_permalink( $this->thank_you_page_id );
1551
+		if ( ! $this->thank_you_page_url) {
1552
+			$this->thank_you_page_url = get_permalink($this->thank_you_page_id);
1553 1553
 		}
1554
-		if($query_args){
1555
-			return add_query_arg($query_args,$this->thank_you_page_url);
1556
-		}else{
1554
+		if ($query_args) {
1555
+			return add_query_arg($query_args, $this->thank_you_page_url);
1556
+		} else {
1557 1557
 			return $this->thank_you_page_url;
1558 1558
 		}
1559 1559
 	}
@@ -1564,8 +1564,8 @@  discard block
 block discarded – undo
1564 1564
 	 *  @return 	string
1565 1565
 	 */
1566 1566
 	public function cancel_page_url() {
1567
-		if ( ! $this->cancel_page_url ) {
1568
-			$this->cancel_page_url = get_permalink( $this->cancel_page_id );
1567
+		if ( ! $this->cancel_page_url) {
1568
+			$this->cancel_page_url = get_permalink($this->cancel_page_id);
1569 1569
 		}
1570 1570
 		return $this->cancel_page_url;
1571 1571
 	}
@@ -1593,7 +1593,7 @@  discard block
 block discarded – undo
1593 1593
 		//reset all url properties
1594 1594
 		$this->_reset_urls();
1595 1595
 		//return what to save to db
1596
-		return array_keys( get_object_vars( $this ) );
1596
+		return array_keys(get_object_vars($this));
1597 1597
 	}
1598 1598
 
1599 1599
 }
@@ -1825,39 +1825,39 @@  discard block
 block discarded – undo
1825 1825
 	 * @param null $CNT_ISO
1826 1826
 	 * @return \EE_Currency_Config
1827 1827
 	 */
1828
-	public function __construct( $CNT_ISO = NULL ) {
1828
+	public function __construct($CNT_ISO = NULL) {
1829 1829
 
1830 1830
 		// get country code from organization settings or use default
1831
-		$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;
1831
+		$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;
1832 1832
 		// but override if requested
1833
-		$CNT_ISO = ! empty( $CNT_ISO ) ? $CNT_ISO : $ORG_CNT;
1834
-		EE_Registry::instance()->load_helper( 'Activation' );
1833
+		$CNT_ISO = ! empty($CNT_ISO) ? $CNT_ISO : $ORG_CNT;
1834
+		EE_Registry::instance()->load_helper('Activation');
1835 1835
 		// 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
1836
-		if ( ! empty( $CNT_ISO ) && EE_Maintenance_Mode::instance()->models_can_query() && EEH_Activation::table_exists( EE_Registry::instance()->load_model( 'Country' )->table() ) ) {
1836
+		if ( ! empty($CNT_ISO) && EE_Maintenance_Mode::instance()->models_can_query() && EEH_Activation::table_exists(EE_Registry::instance()->load_model('Country')->table())) {
1837 1837
 			// retrieve the country settings from the db, just in case they have been customized
1838
-			$country = EE_Registry::instance()->load_model( 'Country' )->get_one_by_ID( $CNT_ISO );
1839
-			if ( $country instanceof EE_Country ) {
1840
-				$this->code = $country->currency_code(); 	// currency code: USD, CAD, EUR
1841
-				$this->name = $country->currency_name_single();	// Dollar
1842
-				$this->plural = $country->currency_name_plural(); 	// Dollars
1843
-				$this->sign =  $country->currency_sign(); 			// currency sign: $
1844
-				$this->sign_b4 = $country->currency_sign_before(); 		// currency sign before or after: $TRUE  or  FALSE$
1845
-				$this->dec_plc = $country->currency_decimal_places();	// decimal places: 2 = 0.00  3 = 0.000
1846
-				$this->dec_mrk = $country->currency_decimal_mark();	// decimal mark: (comma) ',' = 0,01   or (decimal) '.' = 0.01
1847
-				$this->thsnds = $country->currency_thousands_separator();	// thousands separator: (comma) ',' = 1,000   or (decimal) '.' = 1.000
1838
+			$country = EE_Registry::instance()->load_model('Country')->get_one_by_ID($CNT_ISO);
1839
+			if ($country instanceof EE_Country) {
1840
+				$this->code = $country->currency_code(); // currency code: USD, CAD, EUR
1841
+				$this->name = $country->currency_name_single(); // Dollar
1842
+				$this->plural = $country->currency_name_plural(); // Dollars
1843
+				$this->sign = $country->currency_sign(); // currency sign: $
1844
+				$this->sign_b4 = $country->currency_sign_before(); // currency sign before or after: $TRUE  or  FALSE$
1845
+				$this->dec_plc = $country->currency_decimal_places(); // decimal places: 2 = 0.00  3 = 0.000
1846
+				$this->dec_mrk = $country->currency_decimal_mark(); // decimal mark: (comma) ',' = 0,01   or (decimal) '.' = 0.01
1847
+				$this->thsnds = $country->currency_thousands_separator(); // thousands separator: (comma) ',' = 1,000   or (decimal) '.' = 1.000
1848 1848
 			}
1849 1849
 		}
1850 1850
 		// fallback to hardcoded defaults, in case the above failed
1851
-		if ( empty( $this->code )) {
1851
+		if (empty($this->code)) {
1852 1852
 			// set default currency settings
1853
-			$this->code = 'USD'; 	// currency code: USD, CAD, EUR
1854
-			$this->name = __( 'Dollar', 'event_espresso' ); 	// Dollar
1855
-			$this->plural = __( 'Dollars', 'event_espresso' ); 	// Dollars
1856
-			$this->sign =  '$'; 	// currency sign: $
1857
-			$this->sign_b4 = TRUE; 	// currency sign before or after: $TRUE  or  FALSE$
1858
-			$this->dec_plc = 2; 	// decimal places: 2 = 0.00  3 = 0.000
1859
-			$this->dec_mrk = '.'; 	// decimal mark: (comma) ',' = 0,01   or (decimal) '.' = 0.01
1860
-			$this->thsnds = ','; 	// thousands separator: (comma) ',' = 1,000   or (decimal) '.' = 1.000
1853
+			$this->code = 'USD'; // currency code: USD, CAD, EUR
1854
+			$this->name = __('Dollar', 'event_espresso'); // Dollar
1855
+			$this->plural = __('Dollars', 'event_espresso'); // Dollars
1856
+			$this->sign = '$'; // currency sign: $
1857
+			$this->sign_b4 = TRUE; // currency sign before or after: $TRUE  or  FALSE$
1858
+			$this->dec_plc = 2; // decimal places: 2 = 0.00  3 = 0.000
1859
+			$this->dec_mrk = '.'; // decimal mark: (comma) ',' = 0,01   or (decimal) '.' = 0.01
1860
+			$this->thsnds = ','; // thousands separator: (comma) ',' = 1,000   or (decimal) '.' = 1.000
1861 1861
 		}
1862 1862
 	}
1863 1863
 }
@@ -1997,7 +1997,7 @@  discard block
 block discarded – undo
1997 1997
 	 * @since 4.8.8.rc.019
1998 1998
 	 */
1999 1999
 	public function do_hooks() {
2000
-		add_action( 'AHEE__EE_Config___load_core_config__end', array( $this, 'set_default_reg_status_on_EEM_Event' ));
2000
+		add_action('AHEE__EE_Config___load_core_config__end', array($this, 'set_default_reg_status_on_EEM_Event'));
2001 2001
 	}
2002 2002
 
2003 2003
 
@@ -2005,7 +2005,7 @@  discard block
 block discarded – undo
2005 2005
 	 * @return void
2006 2006
 	 */
2007 2007
 	public function set_default_reg_status_on_EEM_Event() {
2008
-		EEM_Event::set_default_reg_status( $this->default_STS_ID );
2008
+		EEM_Event::set_default_reg_status($this->default_STS_ID);
2009 2009
 	}
2010 2010
 
2011 2011
 
@@ -2110,10 +2110,10 @@  discard block
 block discarded – undo
2110 2110
 	 * @param bool $reset
2111 2111
 	 * @return string
2112 2112
 	 */
2113
-	public function log_file_name( $reset = FALSE ) {
2114
-		if ( empty( $this->log_file_name ) || $reset ) {
2115
-			$this->log_file_name = sanitize_key( 'espresso_log_' . md5( uniqid( '', TRUE ))) . '.txt';
2116
-			EE_Config::instance()->update_espresso_config( FALSE, FALSE );
2113
+	public function log_file_name($reset = FALSE) {
2114
+		if (empty($this->log_file_name) || $reset) {
2115
+			$this->log_file_name = sanitize_key('espresso_log_'.md5(uniqid('', TRUE))).'.txt';
2116
+			EE_Config::instance()->update_espresso_config(FALSE, FALSE);
2117 2117
 		}
2118 2118
 		return $this->log_file_name;
2119 2119
 	}
@@ -2125,10 +2125,10 @@  discard block
 block discarded – undo
2125 2125
 	 * @param bool $reset
2126 2126
 	 * @return string
2127 2127
 	 */
2128
-	public function debug_file_name( $reset = FALSE ) {
2129
-		if ( empty( $this->debug_file_name ) || $reset ) {
2130
-			$this->debug_file_name = sanitize_key( 'espresso_debug_' . md5( uniqid( '', TRUE ))) . '.txt';
2131
-			EE_Config::instance()->update_espresso_config( FALSE, FALSE );
2128
+	public function debug_file_name($reset = FALSE) {
2129
+		if (empty($this->debug_file_name) || $reset) {
2130
+			$this->debug_file_name = sanitize_key('espresso_debug_'.md5(uniqid('', TRUE))).'.txt';
2131
+			EE_Config::instance()->update_espresso_config(FALSE, FALSE);
2132 2132
 		}
2133 2133
 		return $this->debug_file_name;
2134 2134
 	}
@@ -2306,21 +2306,21 @@  discard block
 block discarded – undo
2306 2306
 		// set default map settings
2307 2307
 		$this->use_google_maps = TRUE;
2308 2308
 		// for event details pages (reg page)
2309
-		$this->event_details_map_width = 585; 			// ee_map_width_single
2310
-		$this->event_details_map_height = 362; 			// ee_map_height_single
2311
-		$this->event_details_map_zoom = 14; 			// ee_map_zoom_single
2312
-		$this->event_details_display_nav = TRUE; 			// ee_map_nav_display_single
2313
-		$this->event_details_nav_size = FALSE; 			// ee_map_nav_size_single
2314
-		$this->event_details_control_type = 'default'; 		// ee_map_type_control_single
2315
-		$this->event_details_map_align = 'center'; 			// ee_map_align_single
2309
+		$this->event_details_map_width = 585; // ee_map_width_single
2310
+		$this->event_details_map_height = 362; // ee_map_height_single
2311
+		$this->event_details_map_zoom = 14; // ee_map_zoom_single
2312
+		$this->event_details_display_nav = TRUE; // ee_map_nav_display_single
2313
+		$this->event_details_nav_size = FALSE; // ee_map_nav_size_single
2314
+		$this->event_details_control_type = 'default'; // ee_map_type_control_single
2315
+		$this->event_details_map_align = 'center'; // ee_map_align_single
2316 2316
 		// for event list pages
2317
-		$this->event_list_map_width = 300; 			// ee_map_width
2318
-		$this->event_list_map_height = 185; 		// ee_map_height
2319
-		$this->event_list_map_zoom = 12; 			// ee_map_zoom
2320
-		$this->event_list_display_nav = FALSE; 		// ee_map_nav_display
2321
-		$this->event_list_nav_size = TRUE; 			// ee_map_nav_size
2322
-		$this->event_list_control_type = 'dropdown'; 		// ee_map_type_control
2323
-		$this->event_list_map_align = 'center'; 			// ee_map_align
2317
+		$this->event_list_map_width = 300; // ee_map_width
2318
+		$this->event_list_map_height = 185; // ee_map_height
2319
+		$this->event_list_map_zoom = 12; // ee_map_zoom
2320
+		$this->event_list_display_nav = FALSE; // ee_map_nav_display
2321
+		$this->event_list_nav_size = TRUE; // ee_map_nav_size
2322
+		$this->event_list_control_type = 'dropdown'; // ee_map_type_control
2323
+		$this->event_list_map_align = 'center'; // ee_map_align
2324 2324
 	}
2325 2325
 
2326 2326
 }
@@ -2331,7 +2331,7 @@  discard block
 block discarded – undo
2331 2331
 /**
2332 2332
  * stores Events_Archive settings
2333 2333
  */
2334
-class EE_Events_Archive_Config extends EE_Config_Base{
2334
+class EE_Events_Archive_Config extends EE_Config_Base {
2335 2335
 
2336 2336
 	public $display_status_banner;
2337 2337
 	public $display_description;
@@ -2350,7 +2350,7 @@  discard block
 block discarded – undo
2350 2350
 	/**
2351 2351
 	 *	class constructor
2352 2352
 	 */
2353
-	public function __construct(){
2353
+	public function __construct() {
2354 2354
 		$this->display_status_banner = 0;
2355 2355
 		$this->display_description = 1;
2356 2356
 		$this->display_ticket_selector = 0;
@@ -2370,7 +2370,7 @@  discard block
 block discarded – undo
2370 2370
 /**
2371 2371
  * Stores Event_Single_Config settings
2372 2372
  */
2373
-class EE_Event_Single_Config extends EE_Config_Base{
2373
+class EE_Event_Single_Config extends EE_Config_Base {
2374 2374
 
2375 2375
 	public $display_status_banner_single;
2376 2376
 	public $display_venue;
@@ -2399,7 +2399,7 @@  discard block
 block discarded – undo
2399 2399
 /**
2400 2400
  * Stores Ticket_Selector_Config settings
2401 2401
  */
2402
-class EE_Ticket_Selector_Config extends EE_Config_Base{
2402
+class EE_Ticket_Selector_Config extends EE_Config_Base {
2403 2403
 	public $show_ticket_sale_columns;
2404 2404
 	public $show_ticket_details;
2405 2405
 	public $show_expired_tickets;
@@ -2453,7 +2453,7 @@  discard block
 block discarded – undo
2453 2453
 	 * @return void
2454 2454
 	 */
2455 2455
 	protected function _set_php_values() {
2456
-		$this->php->max_input_vars = ini_get( 'max_input_vars' );
2456
+		$this->php->max_input_vars = ini_get('max_input_vars');
2457 2457
 		$this->php->version = phpversion();
2458 2458
 	}
2459 2459
 
@@ -2472,8 +2472,8 @@  discard block
 block discarded – undo
2472 2472
 	 *         @type string $msg 		Any message to be displayed.
2473 2473
 	 * }
2474 2474
 	 */
2475
-	public function max_input_vars_limit_check( $input_count = 0 ) {
2476
-		if ( ( $input_count >= $this->php->max_input_vars ) && ( PHP_MAJOR_VERSION >= 5 && PHP_MINOR_VERSION >= 3 && PHP_RELEASE_VERSION >=9 ) ) {
2475
+	public function max_input_vars_limit_check($input_count = 0) {
2476
+		if (($input_count >= $this->php->max_input_vars) && (PHP_MAJOR_VERSION >= 5 && PHP_MINOR_VERSION >= 3 && PHP_RELEASE_VERSION >= 9)) {
2477 2477
 			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');
2478 2478
 		} else {
2479 2479
 			return '';
@@ -2509,7 +2509,7 @@  discard block
 block discarded – undo
2509 2509
  * stores payment gateway info
2510 2510
  * @deprecated
2511 2511
  */
2512
-class EE_Gateway_Config extends EE_Config_Base{
2512
+class EE_Gateway_Config extends EE_Config_Base {
2513 2513
 
2514 2514
 	/**
2515 2515
 	 * Array with keys that are payment gateways slugs, and values are arrays
@@ -2531,9 +2531,9 @@  discard block
 block discarded – undo
2531 2531
 	 *	class constructor
2532 2532
 	 * @deprecated
2533 2533
 	 */
2534
-	public function __construct(){
2534
+	public function __construct() {
2535 2535
 		$this->payment_settings = array();
2536
-		$this->active_gateways = array( 'Invoice' => FALSE );
2536
+		$this->active_gateways = array('Invoice' => FALSE);
2537 2537
 	}
2538 2538
 }
2539 2539
 
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.
core/EE_Deprecated.core.php 3 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -319,7 +319,7 @@
 block discarded – undo
319 319
 	}
320 320
 
321 321
 	/**
322
-	 * @param $method_name
322
+	 * @param string $method_name
323 323
 	 */
324 324
 	public static function doing_it_wrong_call( $method_name ) {
325 325
 		EE_Error::doing_it_wrong( __CLASS__, sprintf( __('The %s in this class is deprecated as of EE4.5.0.  All functionality formerly in this class is now in the EED_Messages module.', 'event_espresso'), $method_name ), '4.5.0', E_USER_DEPRECATED );
Please login to merge, or discard this patch.
Spacing   +104 added lines, -104 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
  * @param \EE_Checkout $checkout
14 14
  * @return string
15 15
  */
16
-function ee_deprecated__registration_checkout__button_text( $submit_button_text, EE_Checkout $checkout ) {
16
+function ee_deprecated__registration_checkout__button_text($submit_button_text, EE_Checkout $checkout) {
17 17
 	// list of old filters
18 18
 	$deprecated_filters = array(
19 19
 		'update_registration_details' => true,
@@ -23,16 +23,16 @@  discard block
 block discarded – undo
23 23
 		'proceed_to' => true,
24 24
 	);
25 25
 	// loop thru and call doing_it_wrong() or remove any that aren't being used
26
-	foreach ( $deprecated_filters as $deprecated_filter => $on ) {
26
+	foreach ($deprecated_filters as $deprecated_filter => $on) {
27 27
 		// was this filter called ?
28
-		if ( has_action( 'FHEE__EED_Single_Page_Checkout__registration_checkout__button_text__' . $deprecated_filter )) {
28
+		if (has_action('FHEE__EED_Single_Page_Checkout__registration_checkout__button_text__'.$deprecated_filter)) {
29 29
 			// only display doing_it_wrong() notice to Event Admins during non-AJAX requests
30
-			if ( EE_Registry::instance()->CAP->current_user_can( 'ee_read_ee', 'hide_doing_it_wrong_for_deprecated_SPCO_filter' ) && ! defined( 'DOING_AJAX' ) ) {
30
+			if (EE_Registry::instance()->CAP->current_user_can('ee_read_ee', 'hide_doing_it_wrong_for_deprecated_SPCO_filter') && ! defined('DOING_AJAX')) {
31 31
 				EE_Error::doing_it_wrong(
32
-					'FHEE__EED_Single_Page_Checkout__registration_checkout__button_text__' . $deprecated_filter,
32
+					'FHEE__EED_Single_Page_Checkout__registration_checkout__button_text__'.$deprecated_filter,
33 33
 					sprintf(
34
-						__( 'The %1$s filter is deprecated.  It *may* work as an attempt to build in backwards compatibility.  However, it is recommended to use the following new filter: %2$s"%3$s" found in "%4$s"', 'event_espresso' ),
35
-						'FHEE__EED_Single_Page_Checkout__registration_checkout__button_text__' . $deprecated_filter,
34
+						__('The %1$s filter is deprecated.  It *may* work as an attempt to build in backwards compatibility.  However, it is recommended to use the following new filter: %2$s"%3$s" found in "%4$s"', 'event_espresso'),
35
+						'FHEE__EED_Single_Page_Checkout__registration_checkout__button_text__'.$deprecated_filter,
36 36
 						'<br />',
37 37
 						'FHEE__EE_SPCO_Reg_Step__set_submit_button_text___submit_button_text',
38 38
 						'/modules/single_page_checkout/inc/EE_SPCO_Reg_Step.class.php'
@@ -42,24 +42,24 @@  discard block
 block discarded – undo
42 42
 				);
43 43
 			}
44 44
 		} else {
45
-			unset( $deprecated_filters[ $deprecated_filter ] );
45
+			unset($deprecated_filters[$deprecated_filter]);
46 46
 		}
47 47
 	}
48
-	if ( ! empty( $deprecated_filters )) {
49
-
50
-		if ( $checkout->current_step->slug() == 'attendee_information' && $checkout->revisit && isset( $deprecated_filters[ 'update_registration_details' ] )) {
51
-			$submit_button_text = apply_filters( 'FHEE__EED_Single_Page_Checkout__registration_checkout__button_text__update_registration_details', $submit_button_text );
52
-		} else if ( $checkout->current_step->slug() == 'payment_options' && $checkout->revisit && isset( $deprecated_filters[ 'process_payment' ] ) ) {
53
-			$submit_button_text = apply_filters( 'FHEE__EED_Single_Page_Checkout__registration_checkout__button_text__process_payment', $submit_button_text );
54
-		} else if ( $checkout->next_step instanceof EE_SPCO_Reg_Step && $checkout->next_step->slug() == 'finalize_registration' && isset( $deprecated_filters[ 'finalize_registration' ] ) ) {
55
-			$submit_button_text = apply_filters( 'FHEE__EED_Single_Page_Checkout__registration_checkout__button_text__finalize_registration', $submit_button_text );
48
+	if ( ! empty($deprecated_filters)) {
49
+
50
+		if ($checkout->current_step->slug() == 'attendee_information' && $checkout->revisit && isset($deprecated_filters['update_registration_details'])) {
51
+			$submit_button_text = apply_filters('FHEE__EED_Single_Page_Checkout__registration_checkout__button_text__update_registration_details', $submit_button_text);
52
+		} else if ($checkout->current_step->slug() == 'payment_options' && $checkout->revisit && isset($deprecated_filters['process_payment'])) {
53
+			$submit_button_text = apply_filters('FHEE__EED_Single_Page_Checkout__registration_checkout__button_text__process_payment', $submit_button_text);
54
+		} else if ($checkout->next_step instanceof EE_SPCO_Reg_Step && $checkout->next_step->slug() == 'finalize_registration' && isset($deprecated_filters['finalize_registration'])) {
55
+			$submit_button_text = apply_filters('FHEE__EED_Single_Page_Checkout__registration_checkout__button_text__finalize_registration', $submit_button_text);
56 56
 		}
57
-		if ( $checkout->next_step instanceof EE_SPCO_Reg_Step ) {
58
-			if ( $checkout->payment_required() && $checkout->next_step->slug() == 'payment_options' && isset( $deprecated_filters[ 'and_proceed_to_payment' ] ) ) {
59
-				$submit_button_text .= apply_filters( 'FHEE__EED_Single_Page_Checkout__registration_checkout__button_text__and_proceed_to_payment', $submit_button_text );
57
+		if ($checkout->next_step instanceof EE_SPCO_Reg_Step) {
58
+			if ($checkout->payment_required() && $checkout->next_step->slug() == 'payment_options' && isset($deprecated_filters['and_proceed_to_payment'])) {
59
+				$submit_button_text .= apply_filters('FHEE__EED_Single_Page_Checkout__registration_checkout__button_text__and_proceed_to_payment', $submit_button_text);
60 60
 			}
61
-			if ( $checkout->next_step->slug() != 'finalize_registration' && ! $checkout->revisit && isset( $deprecated_filters[ 'proceed_to' ] ) ) {
62
-				$submit_button_text = apply_filters( 'FHEE__EED_Single_Page_Checkout__registration_checkout__button_text__proceed_to', $submit_button_text ) . $checkout->next_step->name();
61
+			if ($checkout->next_step->slug() != 'finalize_registration' && ! $checkout->revisit && isset($deprecated_filters['proceed_to'])) {
62
+				$submit_button_text = apply_filters('FHEE__EED_Single_Page_Checkout__registration_checkout__button_text__proceed_to', $submit_button_text).$checkout->next_step->name();
63 63
 			}
64 64
 		}
65 65
 
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
 	return $submit_button_text;
68 68
 
69 69
 }
70
-add_filter( 'FHEE__EE_SPCO_Reg_Step__set_submit_button_text___submit_button_text', 'ee_deprecated__registration_checkout__button_text', 10, 2 );
70
+add_filter('FHEE__EE_SPCO_Reg_Step__set_submit_button_text___submit_button_text', 'ee_deprecated__registration_checkout__button_text', 10, 2);
71 71
 
72 72
 
73 73
 
@@ -78,16 +78,16 @@  discard block
 block discarded – undo
78 78
  * @param \EE_Checkout $checkout
79 79
  * @param boolean $status_updates
80 80
  */
81
-function ee_deprecated_finalize_transaction( EE_Checkout $checkout, $status_updates ) {
81
+function ee_deprecated_finalize_transaction(EE_Checkout $checkout, $status_updates) {
82 82
 	$action_ref = NULL;
83
-	$action_ref = has_action( 'AHEE__EE_Transaction__finalize__new_transaction' ) ? 'AHEE__EE_Transaction__finalize__new_transaction' : $action_ref;
84
-	$action_ref = has_action( 'AHEE__EE_Transaction__finalize__all_transaction' ) ? 'AHEE__EE_Transaction__finalize__all_transaction' : $action_ref;
85
-	if ( $action_ref ) {
83
+	$action_ref = has_action('AHEE__EE_Transaction__finalize__new_transaction') ? 'AHEE__EE_Transaction__finalize__new_transaction' : $action_ref;
84
+	$action_ref = has_action('AHEE__EE_Transaction__finalize__all_transaction') ? 'AHEE__EE_Transaction__finalize__all_transaction' : $action_ref;
85
+	if ($action_ref) {
86 86
 
87 87
 		EE_Error::doing_it_wrong(
88 88
 			$action_ref,
89 89
 			sprintf(
90
-				__( 'This action is deprecated.  It *may* work as an attempt to build in backwards compatibility.  However, it is recommended to use one of the following new actions: %1$s"%3$s" found in "%2$s" %1$s"%4$s" found in "%2$s" %1$s"%5$s" found in "%2$s" %1$s"%6$s" found in "%2$s"', 'event_espresso' ),
90
+				__('This action is deprecated.  It *may* work as an attempt to build in backwards compatibility.  However, it is recommended to use one of the following new actions: %1$s"%3$s" found in "%2$s" %1$s"%4$s" found in "%2$s" %1$s"%5$s" found in "%2$s" %1$s"%6$s" found in "%2$s"', 'event_espresso'),
91 91
 				'<br />',
92 92
 				'/core/business/EE_Transaction_Processor.class.php',
93 93
 				'AHEE__EE_Transaction_Processor__finalize',
@@ -98,29 +98,29 @@  discard block
 block discarded – undo
98 98
 			'4.6.0',
99 99
 			E_USER_DEPRECATED
100 100
 		);
101
-		switch ( $action_ref ) {
101
+		switch ($action_ref) {
102 102
 			case 'AHEE__EE_Transaction__finalize__new_transaction' :
103
-				do_action( 'AHEE__EE_Transaction__finalize__new_transaction', $checkout->transaction, $checkout->admin_request );
103
+				do_action('AHEE__EE_Transaction__finalize__new_transaction', $checkout->transaction, $checkout->admin_request);
104 104
 				break;
105 105
 			case 'AHEE__EE_Transaction__finalize__all_transaction' :
106
-				do_action( 'AHEE__EE_Transaction__finalize__new_transaction', $checkout->transaction, array( 'new_reg' => ! $checkout->revisit, 'to_approved' => $status_updates ), $checkout->admin_request );
106
+				do_action('AHEE__EE_Transaction__finalize__new_transaction', $checkout->transaction, array('new_reg' => ! $checkout->revisit, 'to_approved' => $status_updates), $checkout->admin_request);
107 107
 				break;
108 108
 		}
109 109
 	}
110 110
 }
111
-add_action( 'AHEE__EE_SPCO_Reg_Step_Finalize_Registration__process_reg_step__completed', 'ee_deprecated_finalize_transaction', 10, 2 );
111
+add_action('AHEE__EE_SPCO_Reg_Step_Finalize_Registration__process_reg_step__completed', 'ee_deprecated_finalize_transaction', 10, 2);
112 112
 /**
113 113
  * ee_deprecated_finalize_registration
114 114
  *
115 115
  * @param EE_Registration $registration
116 116
  */
117
-function ee_deprecated_finalize_registration( EE_Registration $registration ) {
118
-	$action_ref = has_action( 'AHEE__EE_Registration__finalize__update_and_new_reg' ) ? 'AHEE__EE_Registration__finalize__update_and_new_reg' : NULL;
119
-	if ( $action_ref ) {
117
+function ee_deprecated_finalize_registration(EE_Registration $registration) {
118
+	$action_ref = has_action('AHEE__EE_Registration__finalize__update_and_new_reg') ? 'AHEE__EE_Registration__finalize__update_and_new_reg' : NULL;
119
+	if ($action_ref) {
120 120
 		EE_Error::doing_it_wrong(
121 121
 			$action_ref,
122 122
 			sprintf(
123
-				__( 'This action is deprecated.  It *may* work as an attempt to build in backwards compatibility.  However, it is recommended to use the following new action: %1$s"%3$s" found in "%2$s"', 'event_espresso' ),
123
+				__('This action is deprecated.  It *may* work as an attempt to build in backwards compatibility.  However, it is recommended to use the following new action: %1$s"%3$s" found in "%2$s"', 'event_espresso'),
124 124
 				'<br />',
125 125
 				'/core/business/EE_Registration_Processor.class.php',
126 126
 				'AHEE__EE_Registration_Processor__trigger_registration_status_changed_hook'
@@ -128,10 +128,10 @@  discard block
 block discarded – undo
128 128
 			'4.6.0',
129 129
 			E_USER_DEPRECATED
130 130
 		);
131
-		do_action( 'AHEE__EE_Registration__finalize__update_and_new_reg', $registration, ( is_admin() && ! ( defined( 'DOING_AJAX' ) && DOING_AJAX )));
131
+		do_action('AHEE__EE_Registration__finalize__update_and_new_reg', $registration, (is_admin() && ! (defined('DOING_AJAX') && DOING_AJAX)));
132 132
 	}
133 133
 }
134
-add_action( 'AHEE__EE_Registration_Processor__trigger_registration_update_notifications', 'ee_deprecated_finalize_registration', 10, 1 );
134
+add_action('AHEE__EE_Registration_Processor__trigger_registration_update_notifications', 'ee_deprecated_finalize_registration', 10, 1);
135 135
 
136 136
 
137 137
 
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
  *
153 153
  * @return array
154 154
  */
155
-function ee_deprecated_get_templates( $templates, EE_messenger $messenger, EE_message_type $message_type, EE_Messages_Template_Pack $template_pack ) {
155
+function ee_deprecated_get_templates($templates, EE_messenger $messenger, EE_message_type $message_type, EE_Messages_Template_Pack $template_pack) {
156 156
 	$old_default_classnames = array(
157 157
 		'EE_Messages_Email_Cancelled_Registration_Defaults',
158 158
 		'EE_Messages_Email_Declined_Registration_Defaults',
@@ -168,23 +168,23 @@  discard block
 block discarded – undo
168 168
 
169 169
 	$old_class_instance = new stdClass();
170 170
 
171
-	foreach ( $old_default_classnames as $classname ) {
172
-		$filter_ref = 'FHEE__' . $classname . '___create_new_templates___templates';
173
-		if ( has_filter( $filter_ref ) ) {
174
-			EE_Error::doing_it_wrong( $filter_ref, __('This filter is deprecated.  It *may* work as an attempt to build in backwards compatibility.  However, it is recommended to use the new filter provided which is "FHEE__EE_Template_Pack___get_templates__templates" found in the EE_Messages_Template_Pack class.', 'event_espresso'), '4.5.0', E_USER_DEPRECATED );
171
+	foreach ($old_default_classnames as $classname) {
172
+		$filter_ref = 'FHEE__'.$classname.'___create_new_templates___templates';
173
+		if (has_filter($filter_ref)) {
174
+			EE_Error::doing_it_wrong($filter_ref, __('This filter is deprecated.  It *may* work as an attempt to build in backwards compatibility.  However, it is recommended to use the new filter provided which is "FHEE__EE_Template_Pack___get_templates__templates" found in the EE_Messages_Template_Pack class.', 'event_espresso'), '4.5.0', E_USER_DEPRECATED);
175 175
 		}
176
-		$templates = apply_filters( $filter_ref, $templates, $old_class_instance );
176
+		$templates = apply_filters($filter_ref, $templates, $old_class_instance);
177 177
 	}
178 178
 
179 179
 	return $templates;
180 180
 }
181
-add_filter( 'FHEE__EE_Template_Pack___get_templates__templates', 'ee_deprecated_get_templates', 10, 4 );
181
+add_filter('FHEE__EE_Template_Pack___get_templates__templates', 'ee_deprecated_get_templates', 10, 4);
182 182
 
183 183
 /**
184 184
  * Called after EED_Module::set_hooks() and EED_Module::set_admin_hooks() was called.
185 185
  * Checks if any deprecated hooks were hooked-into and provide doing_it_wrong messages appropriately.
186 186
  */
187
-function ee_deprecated_hooks(){
187
+function ee_deprecated_hooks() {
188 188
 	/**
189 189
 	 * @var $hooks array where keys are hook names, and their values are array{
190 190
 	 *			@type string $version  when deprecated
@@ -195,26 +195,26 @@  discard block
 block discarded – undo
195 195
 	$hooks = array(
196 196
 		'AHEE__EE_System___do_setup_validations' => array(
197 197
 			'version' => '4.6.0',
198
-			'alternative' => __( 'Instead use "AHEE__EEH_Activation__validate_messages_system" which is called after validating messages (done on every new install, upgrade, reactivation, and downgrade)', 'event_espresso' ),
198
+			'alternative' => __('Instead use "AHEE__EEH_Activation__validate_messages_system" which is called after validating messages (done on every new install, upgrade, reactivation, and downgrade)', 'event_espresso'),
199 199
 			'still_works' => FALSE
200 200
 		)
201 201
 	);
202
-	foreach( $hooks as $name => $deprecation_info ){
203
-		if( has_action( $name ) ){
202
+	foreach ($hooks as $name => $deprecation_info) {
203
+		if (has_action($name)) {
204 204
 			EE_Error::doing_it_wrong(
205 205
 				$name,
206 206
 				sprintf(
207
-					__('This filter is deprecated. %1$s%2$s','event_espresso'),
208
-					$deprecation_info[ 'still_works' ] ?  __('It *may* work as an attempt to build in backwards compatibility.', 'event_espresso') : __( 'It has been completely removed.', 'event_espresso' ),
209
-					isset( $deprecation_info[ 'alternative' ] ) ? $deprecation_info[ 'alternative' ] : __( 'Please read the current EE4 documentation further or contact Support.', 'event_espresso' )
207
+					__('This filter is deprecated. %1$s%2$s', 'event_espresso'),
208
+					$deprecation_info['still_works'] ? __('It *may* work as an attempt to build in backwards compatibility.', 'event_espresso') : __('It has been completely removed.', 'event_espresso'),
209
+					isset($deprecation_info['alternative']) ? $deprecation_info['alternative'] : __('Please read the current EE4 documentation further or contact Support.', 'event_espresso')
210 210
 				),
211
-				isset( $deprecation_info[ 'version' ] ) ? $deprecation_info[ 'version' ] : __( 'recently', 'event_espresso' ),
211
+				isset($deprecation_info['version']) ? $deprecation_info['version'] : __('recently', 'event_espresso'),
212 212
 				E_USER_DEPRECATED
213 213
 			);
214 214
 		}
215 215
 	}
216 216
 }
217
-add_action( 'AHEE__EE_System__set_hooks_for_shortcodes_modules_and_addons', 'ee_deprecated_hooks' );
217
+add_action('AHEE__EE_System__set_hooks_for_shortcodes_modules_and_addons', 'ee_deprecated_hooks');
218 218
 
219 219
 
220 220
 
@@ -237,25 +237,25 @@  discard block
 block discarded – undo
237 237
  *
238 238
  * @return string                    The default contents for the messenger, message type, context and field.
239 239
  */
240
-function ee_deprecated_get_default_field_content( $contents, $actual_path, EE_messenger $messenger, EE_message_type $message_type, $field, $context, EE_Messages_Template_Pack $template_pack ) {
240
+function ee_deprecated_get_default_field_content($contents, $actual_path, EE_messenger $messenger, EE_message_type $message_type, $field, $context, EE_Messages_Template_Pack $template_pack) {
241 241
 
242 242
 	$classnames_to_try = array(
243
-		get_class( $messenger ) => $messenger,
244
-		get_class( $message_type ) => $message_type,
243
+		get_class($messenger) => $messenger,
244
+		get_class($message_type) => $message_type,
245 245
 		'EE_Messages_Base' => $message_type
246 246
 		);
247 247
 
248
-	foreach ( $classnames_to_try as $classname => $obj ) {
249
-		$filter_ref = 'FHEE__' . $classname . '__get_default_field_content';
250
-		if ( has_filter( $filter_ref ) ) {
251
-			EE_Error::doing_it_wrong( $filter_ref, __('This filter is deprecated.  It *may* work as an attempt to build in backwards compatibility.  However, it is recommended to use the new filter provided which is "FHEE__EE_Messages_Template_Pack__get_specific_template__contents" found in the EE_Messages_Template_Pack class.', 'event_espresso'), '4.5.0', E_USER_DEPRECATED );
248
+	foreach ($classnames_to_try as $classname => $obj) {
249
+		$filter_ref = 'FHEE__'.$classname.'__get_default_field_content';
250
+		if (has_filter($filter_ref)) {
251
+			EE_Error::doing_it_wrong($filter_ref, __('This filter is deprecated.  It *may* work as an attempt to build in backwards compatibility.  However, it is recommended to use the new filter provided which is "FHEE__EE_Messages_Template_Pack__get_specific_template__contents" found in the EE_Messages_Template_Pack class.', 'event_espresso'), '4.5.0', E_USER_DEPRECATED);
252 252
 		}
253
-		$contents = apply_filters( $filter_ref, $contents, $obj );
253
+		$contents = apply_filters($filter_ref, $contents, $obj);
254 254
 	}
255 255
 
256 256
 	return $contents;
257 257
 }
258
-add_filter( 'FHEE__EE_Messages_Template_Pack__get_specific_template__contents', 'ee_deprecated_get_default_field_content', 10, 7 );
258
+add_filter('FHEE__EE_Messages_Template_Pack__get_specific_template__contents', 'ee_deprecated_get_default_field_content', 10, 7);
259 259
 
260 260
 
261 261
 
@@ -283,23 +283,23 @@  discard block
 block discarded – undo
283 283
  *
284 284
  * @return string                    The path to the file being used.
285 285
  */
286
-function ee_deprecated_get_inline_css_template_filters( $variation_path, $messenger, $message_type, $type, $variation, $file_extension, $url,  EE_Messages_Template_Pack $template_pack ) {
286
+function ee_deprecated_get_inline_css_template_filters($variation_path, $messenger, $message_type, $type, $variation, $file_extension, $url, EE_Messages_Template_Pack $template_pack) {
287 287
 
288
-	if ( $messenger == 'email' ) {
288
+	if ($messenger == 'email') {
289 289
 		$filter_ref = $url ? 'FHEE__EE_Email_Messenger__get_inline_css_template__css_url' : 'FHEE__EE_Email_Messenger__get_inline_css_template__css_path';
290
-	} elseif ( $messenger == 'html' ) {
290
+	} elseif ($messenger == 'html') {
291 291
 		$filter_ref = $url ? 'FHEE__EE_Html_messenger__get_inline_css_template__css_url' : 'FHEE__EE_Html_messenger__get_inline_css_template__css_path';
292 292
 	} else {
293 293
 		return $variation_path;
294 294
 	}
295 295
 
296
-	if ( has_filter( $filter_ref ) ) {
297
-		EE_Error::doing_it_wrong( $filter_ref, __('This filter is deprecated.  It is recommended to use the new filter provided which is "FHEE__EE_Messages_Template_Pack__get_variation" found in the EE_Messages_Template_Pack class.', 'event_espresso'), '4.5.0', E_USER_DEPRECATED );
296
+	if (has_filter($filter_ref)) {
297
+		EE_Error::doing_it_wrong($filter_ref, __('This filter is deprecated.  It is recommended to use the new filter provided which is "FHEE__EE_Messages_Template_Pack__get_variation" found in the EE_Messages_Template_Pack class.', 'event_espresso'), '4.5.0', E_USER_DEPRECATED);
298 298
 	}
299 299
 
300
-	return apply_filters( $filter_ref, $variation_path, $url, $type );
300
+	return apply_filters($filter_ref, $variation_path, $url, $type);
301 301
 }
302
-add_filter( 'FHEE__EE_Messages_Template_Pack__get_variation', 'ee_deprecated_get_inline_css_template_filters', 10, 8 );
302
+add_filter('FHEE__EE_Messages_Template_Pack__get_variation', 'ee_deprecated_get_inline_css_template_filters', 10, 8);
303 303
 
304 304
 
305 305
 
@@ -315,78 +315,78 @@  discard block
 block discarded – undo
315 315
 class EE_Messages_Init extends EE_Base {
316 316
 
317 317
 	public function __construct() {
318
-		self::doing_it_wrong_call( __METHOD__ );
318
+		self::doing_it_wrong_call(__METHOD__);
319 319
 	}
320 320
 
321 321
 	/**
322 322
 	 * @param $method_name
323 323
 	 */
324
-	public static function doing_it_wrong_call( $method_name ) {
325
-		EE_Error::doing_it_wrong( __CLASS__, sprintf( __('The %s in this class is deprecated as of EE4.5.0.  All functionality formerly in this class is now in the EED_Messages module.', 'event_espresso'), $method_name ), '4.5.0', E_USER_DEPRECATED );
324
+	public static function doing_it_wrong_call($method_name) {
325
+		EE_Error::doing_it_wrong(__CLASS__, sprintf(__('The %s in this class is deprecated as of EE4.5.0.  All functionality formerly in this class is now in the EED_Messages module.', 'event_espresso'), $method_name), '4.5.0', E_USER_DEPRECATED);
326 326
 	}
327 327
 
328 328
 	/**
329 329
 	 * @deprecated 4.5.0
330 330
 	 */
331 331
 	public static function set_autoloaders() {
332
-		self::doing_it_wrong_call( __METHOD__ );
332
+		self::doing_it_wrong_call(__METHOD__);
333 333
 		EED_Messages::set_autoloaders();
334 334
 	}
335 335
 
336 336
 	/**
337 337
 	 * @deprecated 4.5.0
338 338
 	 */
339
-	public function payment_reminder( $transaction ) {
340
-		self::doing_it_wrong_call( __METHOD__ );
341
-		EED_Messages::payment_reminder( $transaction );
339
+	public function payment_reminder($transaction) {
340
+		self::doing_it_wrong_call(__METHOD__);
341
+		EED_Messages::payment_reminder($transaction);
342 342
 	}
343 343
 
344 344
 	/**
345 345
 	 * @deprecated 4.5.0
346 346
 	 */
347
-	public function payment( $transaction, $payment ) {
348
-		self::doing_it_wrong_call( __METHOD__ );
349
-		EED_Messages::payment( $transaction, $payment );
347
+	public function payment($transaction, $payment) {
348
+		self::doing_it_wrong_call(__METHOD__);
349
+		EED_Messages::payment($transaction, $payment);
350 350
 	}
351 351
 
352 352
 	/**
353 353
 	 * @deprecated 4.5.0
354 354
 	 */
355
-	public function cancelled_registration( $transaction ) {
356
-		self::doing_it_wrong_call( __METHOD__ );
357
-		EED_Messages::cancelled_registration( $transaction );
355
+	public function cancelled_registration($transaction) {
356
+		self::doing_it_wrong_call(__METHOD__);
357
+		EED_Messages::cancelled_registration($transaction);
358 358
 	}
359 359
 
360 360
 	/**
361 361
 	 * @deprecated 4.5.0
362 362
 	 */
363
-	public function maybe_registration( $transaction, $reg_msg, $from_admin ) {
364
-		self::doing_it_wrong_call( __METHOD__ );
365
-		EED_Messages::maybe_registration( $transaction, $reg_msg, $from_admin );
363
+	public function maybe_registration($transaction, $reg_msg, $from_admin) {
364
+		self::doing_it_wrong_call(__METHOD__);
365
+		EED_Messages::maybe_registration($transaction, $reg_msg, $from_admin);
366 366
 	}
367 367
 
368 368
 	/**
369 369
 	 * @deprecated 4.5.0
370 370
 	 */
371
-	public function process_resend( $success, $req_data ) {
372
-		self::doing_it_wrong_call( __METHOD__ );
373
-		EED_Messages::process_resend( $req_data );
371
+	public function process_resend($success, $req_data) {
372
+		self::doing_it_wrong_call(__METHOD__);
373
+		EED_Messages::process_resend($req_data);
374 374
 	}
375 375
 
376 376
 	/**
377 377
 	 * @deprecated 4.5.0
378 378
 	 */
379
-	public function process_admin_payment( $success, $payment ) {
380
-		self::doing_it_wrong_call( __METHOD__ );
381
-		EED_Messages::process_admin_payment( $success, $payment );
379
+	public function process_admin_payment($success, $payment) {
380
+		self::doing_it_wrong_call(__METHOD__);
381
+		EED_Messages::process_admin_payment($success, $payment);
382 382
 	}
383 383
 
384 384
 	/**
385 385
 	 * @deprecated 4.5.0
386 386
 	 */
387
-	public function send_newsletter_message( $contacts, $grp_id ) {
388
-		self::doing_it_wrong_call( __METHOD__ );
389
-		EED_Messages::send_newsletter_message( $contacts, $grp_id );
387
+	public function send_newsletter_message($contacts, $grp_id) {
388
+		self::doing_it_wrong_call(__METHOD__);
389
+		EED_Messages::send_newsletter_message($contacts, $grp_id);
390 390
 	}
391 391
 
392 392
 
@@ -407,13 +407,13 @@  discard block
 block discarded – undo
407 407
  *
408 408
  * @return array additional cpts.
409 409
  */
410
-function ee_deprecated_get_cpts( $cpts ) {
411
-	if ( has_filter( 'FHEE__EE_Register_CPTs__construct__CPTs' ) ) {
412
-		EE_Error::doing_it_wrong( 'FHEE__EE_Register_CPTs__construct__CPTs', __('This filter is deprecated. It will still work for the time being.  However, it is recommended to use the new filter provided which is "FHEE__EE_Register_CPTs__get_CPTs__cpts" found in EE_Register_CPTs::get_CPTs()', 'event_espresso'), '4.5.0', E_USER_DEPRECATED );
410
+function ee_deprecated_get_cpts($cpts) {
411
+	if (has_filter('FHEE__EE_Register_CPTs__construct__CPTs')) {
412
+		EE_Error::doing_it_wrong('FHEE__EE_Register_CPTs__construct__CPTs', __('This filter is deprecated. It will still work for the time being.  However, it is recommended to use the new filter provided which is "FHEE__EE_Register_CPTs__get_CPTs__cpts" found in EE_Register_CPTs::get_CPTs()', 'event_espresso'), '4.5.0', E_USER_DEPRECATED);
413 413
 	}
414
-	return apply_filters( 'FHEE__EE_Register_CPTs__construct__CPTs', $cpts );
414
+	return apply_filters('FHEE__EE_Register_CPTs__construct__CPTs', $cpts);
415 415
 }
416
-add_filter( 'FHEE__EE_Register_CPTs__get_CPTs__cpts', 'ee_deprecated_get_cpts', 10 );
416
+add_filter('FHEE__EE_Register_CPTs__get_CPTs__cpts', 'ee_deprecated_get_cpts', 10);
417 417
 
418 418
 
419 419
 
@@ -427,10 +427,10 @@  discard block
 block discarded – undo
427 427
  *
428 428
  * @return array additional custom taxonomies.
429 429
  */
430
-function ee_deprecated_get_taxonomies( $cts ) {
431
-	if ( has_filter( 'FHEE__EE_Register_CPTs__construct__taxonomies' ) ) {
432
-		EE_Error::doing_it_wrong( 'FHEE__EE_Register_CPTs__construct__taxonomies', __('This filter is deprecated. It will still work for the time being.  However, it is recommended to use the new filter provided which is "FHEE__EE_Register_CPTs__get_taxonomies__taxonomies" found in EE_Register_CPTs::get_taxonomies()', 'event_espresso'), '4.5.0', E_USER_DEPRECATED );
430
+function ee_deprecated_get_taxonomies($cts) {
431
+	if (has_filter('FHEE__EE_Register_CPTs__construct__taxonomies')) {
432
+		EE_Error::doing_it_wrong('FHEE__EE_Register_CPTs__construct__taxonomies', __('This filter is deprecated. It will still work for the time being.  However, it is recommended to use the new filter provided which is "FHEE__EE_Register_CPTs__get_taxonomies__taxonomies" found in EE_Register_CPTs::get_taxonomies()', 'event_espresso'), '4.5.0', E_USER_DEPRECATED);
433 433
 	}
434
-	return apply_filters( 'FHEE__EE_Register_CPTs__construct__taxonomies', $cts );
434
+	return apply_filters('FHEE__EE_Register_CPTs__construct__taxonomies', $cts);
435 435
 }
436
-add_filter( 'FHEE__EE_Register_CPTs__get_taxonomies__taxonomies', 'ee_deprecated_get_taxonomies', 10 );
436
+add_filter('FHEE__EE_Register_CPTs__get_taxonomies__taxonomies', 'ee_deprecated_get_taxonomies', 10);
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -5,7 +5,9 @@
 block discarded – undo
5 5
  * @subpackage plugin api, messages
6 6
  * @since           4.5.0
7 7
  */
8
-if ( ! defined('EVENT_ESPRESSO_VERSION')) exit('No direct script access allowed');
8
+if ( ! defined('EVENT_ESPRESSO_VERSION')) {
9
+	exit('No direct script access allowed');
10
+}
9 11
 
10 12
 /**
11 13
  * Use this to register or deregister a new message template pack variation for the EE messages system.
Please login to merge, or discard this patch.
core/EE_Error.core.php 4 patches
Doc Comments   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
 	/**
89 89
 	 *    error_handler
90 90
 	 * @access public
91
-	 * @param $code
91
+	 * @param integer $code
92 92
 	 * @param $message
93 93
 	 * @param $file
94 94
 	 * @param $line
@@ -189,7 +189,7 @@  discard block
 block discarded – undo
189 189
 	/**
190 190
 	 *    _format_error
191 191
 	 * @access private
192
-	 * @param $code
192
+	 * @param string $code
193 193
 	 * @param $message
194 194
 	 * @param $file
195 195
 	 * @param $line
@@ -936,7 +936,7 @@  discard block
 block discarded – undo
936 936
 	 *
937 937
 	 * @access    public
938 938
 	 * @param string $return_url
939
-	 * @return    array
939
+	 * @return    string
940 940
 	 */
941 941
 	public static function get_persistent_admin_notices( $return_url = '' ) {
942 942
 		$notices = '';
@@ -961,7 +961,7 @@  discard block
 block discarded – undo
961 961
 	 *
962 962
 	 * @access 	public
963 963
 	 * @param 	bool $force_print
964
-	 * @return 	void
964
+	 * @return 	null|string
965 965
 	 */
966 966
 	private static function _print_scripts( $force_print = FALSE ) {
967 967
 		if (( did_action( 'admin_enqueue_scripts' ) || did_action( 'wp_enqueue_scripts' )) && ! $force_print ) {
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,4 +1,6 @@
 block discarded – undo
1
-<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) exit('No direct script access allowed');
1
+<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) {
2
+	exit('No direct script access allowed');
3
+}
2 4
 /**
3 5
  * Event Espresso
4 6
  *
Please login to merge, or discard this patch.
Spacing   +232 added lines, -232 removed lines patch added patch discarded remove patch
@@ -1,8 +1,8 @@  discard block
 block discarded – undo
1 1
 <?php if ( ! defined('EVENT_ESPRESSO_VERSION')) exit('No direct script access allowed');
2 2
 // if you're a dev and want to receive all errors via email add this to your wp-config.php: define( 'EE_ERROR_EMAILS', TRUE );
3
-if ( defined( 'WP_DEBUG' ) && WP_DEBUG === TRUE && defined( 'EE_ERROR_EMAILS' ) && EE_ERROR_EMAILS === TRUE ) {
4
-	set_error_handler( array( 'EE_Error', 'error_handler' ));
5
-	register_shutdown_function( array( 'EE_Error', 'fatal_error_handler' ));
3
+if (defined('WP_DEBUG') && WP_DEBUG === TRUE && defined('EE_ERROR_EMAILS') && EE_ERROR_EMAILS === TRUE) {
4
+	set_error_handler(array('EE_Error', 'error_handler'));
5
+	register_shutdown_function(array('EE_Error', 'fatal_error_handler'));
6 6
 }
7 7
 /**
8 8
  *
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
 	* 	@access	private
65 65
     *	@var boolean
66 66
 	*/
67
-	private static $_espresso_notices = array( 'success' => FALSE, 'errors' => FALSE, 'attention' => FALSE );
67
+	private static $_espresso_notices = array('success' => FALSE, 'errors' => FALSE, 'attention' => FALSE);
68 68
 
69 69
 
70 70
 
@@ -75,11 +75,11 @@  discard block
 block discarded – undo
75 75
 	*	@access public
76 76
 	*	@echo string
77 77
 	*/
78
-	function __construct( $message, $code = 0, Exception $previous = NULL ) {
79
-		if ( version_compare( phpversion(), '5.3.0', '<' )) {
80
-			parent::__construct( $message, $code );
78
+	function __construct($message, $code = 0, Exception $previous = NULL) {
79
+		if (version_compare(phpversion(), '5.3.0', '<')) {
80
+			parent::__construct($message, $code);
81 81
 		} else {
82
-			parent::__construct( $message, $code, $previous );
82
+			parent::__construct($message, $code, $previous);
83 83
 		}
84 84
 	}
85 85
 
@@ -94,10 +94,10 @@  discard block
 block discarded – undo
94 94
 	 * @param $line
95 95
 	 * @return void
96 96
 	 */
97
-	public static function error_handler( $code, $message, $file, $line ) {
98
-		$type = EE_Error::error_type( $code );
97
+	public static function error_handler($code, $message, $file, $line) {
98
+		$type = EE_Error::error_type($code);
99 99
 		$site = site_url();
100
-		switch ( $site ) {
100
+		switch ($site) {
101 101
 			case 'http://ee4.eventespresso.com/' :
102 102
 			case 'http://ee4decaf.eventespresso.com/' :
103 103
 			case 'http://ee4hf.eventespresso.com/' :
@@ -110,16 +110,16 @@  discard block
 block discarded – undo
110 110
 				$to = '[email protected]';
111 111
 				break;
112 112
 			default :
113
-				$to = get_option( 'admin_email' );
113
+				$to = get_option('admin_email');
114 114
 		}
115
-		$subject = $type . ' ' . $message . ' in ' . EVENT_ESPRESSO_VERSION . ' on ' . site_url();
116
-		$msg = EE_Error::_format_error( $type, $message, $file, $line );
117
-		if ( function_exists( 'wp_mail' )) {
118
-			add_filter( 'wp_mail_content_type', array( 'EE_Error', 'set_content_type' ));
119
-			wp_mail( $to, $subject, $msg );
115
+		$subject = $type.' '.$message.' in '.EVENT_ESPRESSO_VERSION.' on '.site_url();
116
+		$msg = EE_Error::_format_error($type, $message, $file, $line);
117
+		if (function_exists('wp_mail')) {
118
+			add_filter('wp_mail_content_type', array('EE_Error', 'set_content_type'));
119
+			wp_mail($to, $subject, $msg);
120 120
 		}
121 121
 		echo '<div id="message" class="espresso-notices error"><p>';
122
-		echo $type . ': ' . $message . '<br />' . $file . ' line ' . $line;
122
+		echo $type.': '.$message.'<br />'.$file.' line '.$line;
123 123
 		echo '<br /></p></div>';
124 124
 	}
125 125
 
@@ -132,8 +132,8 @@  discard block
 block discarded – undo
132 132
 	 * @param $code
133 133
 	 * @return string
134 134
 	 */
135
-	public static function error_type( $code ) {
136
-		switch( $code ) {
135
+	public static function error_type($code) {
136
+		switch ($code) {
137 137
 			case E_ERROR: // 1 //
138 138
 			return 'E_ERROR';
139 139
 			case E_WARNING: // 2 //
@@ -179,8 +179,8 @@  discard block
 block discarded – undo
179 179
 	*/
180 180
 	public static function fatal_error_handler() {
181 181
 		$last_error = error_get_last();
182
-		if ( $last_error['type'] === E_ERROR ) {
183
-			EE_Error::error_handler( E_ERROR, $last_error['message'], $last_error['file'], $last_error['line'] );
182
+		if ($last_error['type'] === E_ERROR) {
183
+			EE_Error::error_handler(E_ERROR, $last_error['message'], $last_error['file'], $last_error['line']);
184 184
 		}
185 185
 	}
186 186
 
@@ -195,7 +195,7 @@  discard block
 block discarded – undo
195 195
 	 * @param $line
196 196
 	 * @return string
197 197
 	 */
198
-	private static function _format_error( $code, $message, $file, $line ) {
198
+	private static function _format_error($code, $message, $file, $line) {
199 199
 		$html  = "<table cellpadding='5'><thead bgcolor='#f8f8f8'><th>Item</th><th align='left'>Details</th></thead><tbody>";
200 200
 		$html .= "<tr valign='top'><td><b>Code</b></td><td>$code</td></tr>";
201 201
 		$html .= "<tr valign='top'><td><b>Error</b></td><td>$message</td></tr>";
@@ -213,7 +213,7 @@  discard block
 block discarded – undo
213 213
 	 * @param $content_type
214 214
 	 * @return string
215 215
 	 */
216
-	public static function set_content_type( $content_type ) {
216
+	public static function set_content_type($content_type) {
217 217
 		return 'text/html';
218 218
 	}
219 219
 
@@ -227,24 +227,24 @@  discard block
 block discarded – undo
227 227
 	*/
228 228
     public function get_error() {
229 229
 
230
-		if( apply_filters( 'FHEE__EE_Error__get_error__show_normal_exceptions', FALSE ) ){
230
+		if (apply_filters('FHEE__EE_Error__get_error__show_normal_exceptions', FALSE)) {
231 231
 			throw $this;
232 232
 		}
233 233
 		// get separate user and developer messages if they exist
234
-		$msg = explode( '||', $this->getMessage() );
234
+		$msg = explode('||', $this->getMessage());
235 235
 		$user_msg = $msg[0];
236
-		$dev_msg = isset( $msg[1] ) ? $msg[1] : $msg[0];
236
+		$dev_msg = isset($msg[1]) ? $msg[1] : $msg[0];
237 237
 		$msg = WP_DEBUG ? $dev_msg : $user_msg;
238 238
 
239 239
 		// add details to _all_exceptions array
240 240
 		$x_time = time();
241
-		self::$_all_exceptions[ $x_time ]['name'] 	= get_class( $this );
242
-		self::$_all_exceptions[ $x_time ]['file'] 		= $this->getFile();
243
-		self::$_all_exceptions[ $x_time ]['line'] 		= $this->getLine();
244
-		self::$_all_exceptions[ $x_time ]['msg'] 	= $msg;
245
-		self::$_all_exceptions[ $x_time ]['code'] 	= $this->getCode();
246
-		self::$_all_exceptions[ $x_time ]['trace'] 	= $this->getTrace();
247
-		self::$_all_exceptions[ $x_time ]['string'] 	= $this->getTraceAsString();
241
+		self::$_all_exceptions[$x_time]['name'] = get_class($this);
242
+		self::$_all_exceptions[$x_time]['file'] 		= $this->getFile();
243
+		self::$_all_exceptions[$x_time]['line'] 		= $this->getLine();
244
+		self::$_all_exceptions[$x_time]['msg'] = $msg;
245
+		self::$_all_exceptions[$x_time]['code'] = $this->getCode();
246
+		self::$_all_exceptions[$x_time]['trace'] 	= $this->getTrace();
247
+		self::$_all_exceptions[$x_time]['string'] = $this->getTraceAsString();
248 248
 		self::$_error_count++;
249 249
 
250 250
 		//add_action( 'shutdown', array( $this, 'display_errors' ));
@@ -259,7 +259,7 @@  discard block
 block discarded – undo
259 259
 	*	@access public
260 260
 	*	@return boolean
261 261
 	*/
262
-    public static function has_error(){
262
+    public static function has_error() {
263 263
 		return self::$_error_count ? TRUE : FALSE;
264 264
 	}
265 265
 
@@ -270,7 +270,7 @@  discard block
 block discarded – undo
270 270
 	*	@access public
271 271
 	*	@echo string
272 272
 	*/
273
-    public function display_errors(){
273
+    public function display_errors() {
274 274
 
275 275
 		$trace_details = '';
276 276
 
@@ -331,18 +331,18 @@  discard block
 block discarded – undo
331 331
 </style>
332 332
 <div id="ee-error-message" class="error">';
333 333
 
334
-		if ( ! WP_DEBUG ) {
334
+		if ( ! WP_DEBUG) {
335 335
 			$output .= '
336 336
 	<p>';
337 337
 		}
338 338
 
339 339
 		// cycle thru errors
340
-		foreach ( self::$_all_exceptions as $time => $ex ) {
340
+		foreach (self::$_all_exceptions as $time => $ex) {
341 341
 
342 342
 			// process trace info
343
-			if ( empty( $ex['trace'] )) {
343
+			if (empty($ex['trace'])) {
344 344
 
345
-	            $trace_details .= __( 'Sorry, but no trace information was available for this exception.', 'event_espresso' );
345
+	            $trace_details .= __('Sorry, but no trace information was available for this exception.', 'event_espresso');
346 346
 
347 347
 			} else {
348 348
 
@@ -357,50 +357,50 @@  discard block
 block discarded – undo
357 357
 					<th scope="col" align="left">Method( arguments )</th>
358 358
 				</tr>';
359 359
 
360
-				$last_on_stack = count( $ex['trace'] ) - 1;
360
+				$last_on_stack = count($ex['trace']) - 1;
361 361
 				// reverse array so that stack is in proper chronological order
362
-				$sorted_trace = array_reverse( $ex['trace'] );
362
+				$sorted_trace = array_reverse($ex['trace']);
363 363
 
364
-				foreach ( $sorted_trace as $nmbr => $trace ) {
364
+				foreach ($sorted_trace as $nmbr => $trace) {
365 365
 
366
-					$file = isset( $trace['file'] ) ? $trace['file'] : '' ;
367
-					$class = isset( $trace['class'] ) ? $trace['class'] : '';
368
-					$type = isset( $trace['type'] ) ? $trace['type'] : '';
369
-					$function = isset( $trace['function'] ) ? $trace['function'] : '';
370
-					$args = isset( $trace['args'] ) ? $this->_convert_args_to_string( $trace['args'] ) : '';
371
-					$line = isset( $trace['line'] ) ? $trace['line'] : '';
366
+					$file = isset($trace['file']) ? $trace['file'] : '';
367
+					$class = isset($trace['class']) ? $trace['class'] : '';
368
+					$type = isset($trace['type']) ? $trace['type'] : '';
369
+					$function = isset($trace['function']) ? $trace['function'] : '';
370
+					$args = isset($trace['args']) ? $this->_convert_args_to_string($trace['args']) : '';
371
+					$line = isset($trace['line']) ? $trace['line'] : '';
372 372
 					$zebra = $nmbr % 2 ? ' odd' : '';
373 373
 
374
-					if ( empty( $file ) && ! empty( $class )) {
375
-						$a = new ReflectionClass( $class );
374
+					if (empty($file) && ! empty($class)) {
375
+						$a = new ReflectionClass($class);
376 376
 						$file = $a->getFileName();
377
-						if ( empty( $line ) && ! empty( $function )) {
378
-							$b = new ReflectionMethod( $class, $function );
377
+						if (empty($line) && ! empty($function)) {
378
+							$b = new ReflectionMethod($class, $function);
379 379
 							$line = $b->getStartLine();
380 380
 						}
381 381
 					}
382 382
 
383
-					if ( $nmbr == $last_on_stack ) {
383
+					if ($nmbr == $last_on_stack) {
384 384
 						$file = $ex['file'] != '' ? $ex['file'] : $file;
385 385
 						$line = $ex['line'] != '' ? $ex['line'] : $line;
386
-						$error_code = self::generate_error_code ( $file, $trace['function'], $line );
386
+						$error_code = self::generate_error_code($file, $trace['function'], $line);
387 387
 					}
388 388
 
389
-					$nmbr_dsply = ! empty( $nmbr ) ? $nmbr : '&nbsp;';
390
-					$line_dsply = ! empty( $line ) ? $line : '&nbsp;';
391
-					$file_dsply = ! empty( $file ) ? $file : '&nbsp;';
392
-					$class_dsply = ! empty( $class ) ? $class : '&nbsp;';
393
-					$type_dsply = ! empty( $type ) ? $type : '&nbsp;';
394
-					$function_dsply = ! empty( $function ) ? $function : '&nbsp;';
395
-					$args_dsply = ! empty( $args ) ? '( ' . $args . ' )' : '';
389
+					$nmbr_dsply = ! empty($nmbr) ? $nmbr : '&nbsp;';
390
+					$line_dsply = ! empty($line) ? $line : '&nbsp;';
391
+					$file_dsply = ! empty($file) ? $file : '&nbsp;';
392
+					$class_dsply = ! empty($class) ? $class : '&nbsp;';
393
+					$type_dsply = ! empty($type) ? $type : '&nbsp;';
394
+					$function_dsply = ! empty($function) ? $function : '&nbsp;';
395
+					$args_dsply = ! empty($args) ? '( '.$args.' )' : '';
396 396
 
397 397
 		              $trace_details .= '
398 398
 					<tr>
399
-						<td align="right" class="' . $zebra . '">' . $nmbr_dsply . '</td>
400
-						<td align="right" class="' . $zebra . '">' . $line_dsply . '</td>
401
-						<td align="left" class="' . $zebra . '">' . $file_dsply . '</td>
402
-						<td align="left" class="' . $zebra . '">' . $class_dsply . '</td>
403
-						<td align="left" class="' . $zebra . '">' . $type_dsply . $function_dsply . $args_dsply . '</td>
399
+						<td align="right" class="' . $zebra.'">'.$nmbr_dsply.'</td>
400
+						<td align="right" class="' . $zebra.'">'.$line_dsply.'</td>
401
+						<td align="left" class="' . $zebra.'">'.$file_dsply.'</td>
402
+						<td align="left" class="' . $zebra.'">'.$class_dsply.'</td>
403
+						<td align="left" class="' . $zebra.'">'.$type_dsply.$function_dsply.$args_dsply.'</td>
404 404
 					</tr>';
405 405
 
406 406
 
@@ -415,9 +415,9 @@  discard block
 block discarded – undo
415 415
 			$ex['code'] = $ex['code'] ? $ex['code'] : $error_code;
416 416
 
417 417
 			// add generic non-identifying messages for non-privileged uesrs
418
-			if ( ! WP_DEBUG ) {
418
+			if ( ! WP_DEBUG) {
419 419
 
420
-				$output .= '<span class="ee-error-user-msg-spn">' . trim( $ex['msg'] )  . '</span> &nbsp; <sup>' . $ex['code'] . '</sup><br />';
420
+				$output .= '<span class="ee-error-user-msg-spn">'.trim($ex['msg']).'</span> &nbsp; <sup>'.$ex['code'].'</sup><br />';
421 421
 
422 422
 			} else {
423 423
 
@@ -425,24 +425,24 @@  discard block
 block discarded – undo
425 425
 				$output .= '
426 426
 		<div class="ee-error-dev-msg-dv">
427 427
 			<p class="ee-error-dev-msg-pg">
428
-				<strong class="ee-error-dev-msg-str">An ' . $ex['name'] . ' exception was thrown!</strong>  &nbsp; <span>code: ' . $ex['code'] . '</span><br />
429
-				<span class="big-text">"' . trim( $ex['msg'] ) . '"</span><br/>
430
-				<a id="display-ee-error-trace-' . self::$_error_count . $time . '" class="display-ee-error-trace-lnk small-text" rel="ee-error-trace-' . self::$_error_count . $time . '">
431
-					' . __( 'click to view backtrace and class/method details', 'event_espresso' ) . '
428
+				<strong class="ee-error-dev-msg-str">An ' . $ex['name'].' exception was thrown!</strong>  &nbsp; <span>code: '.$ex['code'].'</span><br />
429
+				<span class="big-text">"' . trim($ex['msg']).'"</span><br/>
430
+				<a id="display-ee-error-trace-' . self::$_error_count.$time.'" class="display-ee-error-trace-lnk small-text" rel="ee-error-trace-'.self::$_error_count.$time.'">
431
+					' . __('click to view backtrace and class/method details', 'event_espresso').'
432 432
 				</a><br />
433 433
 				<span class="small-text lt-grey-text">'.$ex['file'].' &nbsp; ( line no: '.$ex['line'].' )</span>
434 434
 			</p>
435
-			<div id="ee-error-trace-' . self::$_error_count . $time . '-dv" class="ee-error-trace-dv" style="display: none;">
435
+			<div id="ee-error-trace-' . self::$_error_count.$time.'-dv" class="ee-error-trace-dv" style="display: none;">
436 436
 				' . $trace_details;
437 437
 
438
-				if ( ! empty( $class )) {
438
+				if ( ! empty($class)) {
439 439
 					$output .= '
440 440
 				<div style="padding:3px; margin:0 0 1em; border:1px solid #666; background:#fff; border-radius:3px;">
441 441
 					<div style="padding:1em 2em; border:1px solid #666; background:#f9f9f9;">
442 442
 						<h3>Class Details</h3>';
443
-						$a = new ReflectionClass( $class );
443
+						$a = new ReflectionClass($class);
444 444
 						$output .= '
445
-						<pre>' . $a . '</pre>
445
+						<pre>' . $a.'</pre>
446 446
 					</div>
447 447
 				</div>';
448 448
 				}
@@ -454,14 +454,14 @@  discard block
 block discarded – undo
454 454
 
455 455
 			}
456 456
 
457
-			$this->write_to_error_log( $time, $ex );
457
+			$this->write_to_error_log($time, $ex);
458 458
 
459 459
 		}
460 460
 
461 461
 		// remove last linebreak
462
-		$output = substr( $output, 0, ( count( $output ) - 7 ));
462
+		$output = substr($output, 0, (count($output) - 7));
463 463
 
464
-		if ( ! WP_DEBUG ) {
464
+		if ( ! WP_DEBUG) {
465 465
 			$output .= '
466 466
 	</p>';
467 467
 		}
@@ -469,10 +469,10 @@  discard block
 block discarded – undo
469 469
 		$output .= '
470 470
 </div>';
471 471
 
472
-		$output .= self::_print_scripts( TRUE );
472
+		$output .= self::_print_scripts(TRUE);
473 473
 
474
-		if ( defined( 'DOING_AJAX' )) {
475
-			echo json_encode( array( 'error' => $output ));
474
+		if (defined('DOING_AJAX')) {
475
+			echo json_encode(array('error' => $output));
476 476
 			exit();
477 477
 		}
478 478
 
@@ -492,29 +492,29 @@  discard block
 block discarded – undo
492 492
 	*	@ param array $arguments
493 493
 	*	@ return string
494 494
 	*/
495
-	private function _convert_args_to_string ( $arguments = array(), $array = FALSE ) {
495
+	private function _convert_args_to_string($arguments = array(), $array = FALSE) {
496 496
 
497 497
 		$arg_string = '';
498
-		if ( ! empty( $arguments )) {
498
+		if ( ! empty($arguments)) {
499 499
 
500 500
 			$args = array();
501 501
 
502
-			foreach ( $arguments as $arg ) {
502
+			foreach ($arguments as $arg) {
503 503
 
504
-				if ( ! empty( $arg )) {
504
+				if ( ! empty($arg)) {
505 505
 
506
-					if ( is_string( $arg )) {
507
-						$args[] = " '" . $arg . "'";
508
-					} elseif ( is_array( $arg )) {
509
-						$args[] = 'ARRAY(' . $this->_convert_args_to_string( $arg, TRUE );
510
-					} elseif ( is_null( $arg )) {
506
+					if (is_string($arg)) {
507
+						$args[] = " '".$arg."'";
508
+					} elseif (is_array($arg)) {
509
+						$args[] = 'ARRAY('.$this->_convert_args_to_string($arg, TRUE);
510
+					} elseif (is_null($arg)) {
511 511
 						$args[] = ' NULL';
512
-					} elseif ( is_bool( $arg )) {
513
-						$args[] = ( $arg ) ? ' TRUE' : ' FALSE';
514
-					} elseif ( is_object( $arg )) {
515
-						$args[] = ' OBJECT ' . get_class( $arg );
516
-					} elseif ( is_resource( $arg )) {
517
-						$args[] = get_resource_type( $arg );
512
+					} elseif (is_bool($arg)) {
513
+						$args[] = ($arg) ? ' TRUE' : ' FALSE';
514
+					} elseif (is_object($arg)) {
515
+						$args[] = ' OBJECT '.get_class($arg);
516
+					} elseif (is_resource($arg)) {
517
+						$args[] = get_resource_type($arg);
518 518
 					} else {
519 519
 						$args[] = $arg;
520 520
 					}
@@ -522,9 +522,9 @@  discard block
 block discarded – undo
522 522
 				}
523 523
 
524 524
 			}
525
-			$arg_string = implode( ', ', $args );
525
+			$arg_string = implode(', ', $args);
526 526
 		}
527
-		if ( $array ) {
527
+		if ($array) {
528 528
 			$arg_string .= ' )';
529 529
 		}
530 530
 		return $arg_string;
@@ -544,8 +544,8 @@  discard block
 block discarded – undo
544 544
 	* 	@param		string		$line	the line number where the error occurred - just use __LINE__
545 545
 	* 	@return 		void
546 546
 	*/
547
-	public static function add_error( $msg = NULL, $file = NULL, $func = NULL, $line = NULL ) {
548
-		self::_add_notice ( 'errors', $msg, $file, $func, $line );
547
+	public static function add_error($msg = NULL, $file = NULL, $func = NULL, $line = NULL) {
548
+		self::_add_notice('errors', $msg, $file, $func, $line);
549 549
 		self::$_error_count++;
550 550
 	}
551 551
 
@@ -563,8 +563,8 @@  discard block
 block discarded – undo
563 563
 	* 	@param		string		$line	the line number where the error occurred - just use __LINE__
564 564
 	* 	@return 		void
565 565
 	*/
566
-	public static function add_success( $msg = NULL, $file = NULL, $func = NULL, $line = NULL ) {
567
-		self::_add_notice ( 'success', $msg, $file, $func, $line );
566
+	public static function add_success($msg = NULL, $file = NULL, $func = NULL, $line = NULL) {
567
+		self::_add_notice('success', $msg, $file, $func, $line);
568 568
 	}
569 569
 
570 570
 
@@ -581,8 +581,8 @@  discard block
 block discarded – undo
581 581
 	* 	@param		string		$line	the line number where the error occurred - just use __LINE__
582 582
 	* 	@return 		void
583 583
 	*/
584
-	public static function add_attention( $msg = NULL, $file = NULL, $func = NULL, $line = NULL ) {
585
-		self::_add_notice ( 'attention', $msg, $file, $func, $line );
584
+	public static function add_attention($msg = NULL, $file = NULL, $func = NULL, $line = NULL) {
585
+		self::_add_notice('attention', $msg, $file, $func, $line);
586 586
 	}
587 587
 
588 588
 
@@ -600,12 +600,12 @@  discard block
 block discarded – undo
600 600
 	* 	@param		string		$line	the line number where the error occurred - just use __LINE__
601 601
 	* 	@return 		void
602 602
 	*/
603
-	private static function _add_notice( $type = 'success', $msg = NULL, $file = NULL, $func = NULL, $line = NULL ) {
604
-		if ( empty( $msg )) {
603
+	private static function _add_notice($type = 'success', $msg = NULL, $file = NULL, $func = NULL, $line = NULL) {
604
+		if (empty($msg)) {
605 605
 			EE_Error::doing_it_wrong(
606
-				'EE_Error::add_' . $type . '()',
606
+				'EE_Error::add_'.$type.'()',
607 607
 				sprintf(
608
-					__( 'Notifications are not much use without a message! Please add a message to the EE_Error::add_%s() call made in %s on line %d', 'event_espresso' ),
608
+					__('Notifications are not much use without a message! Please add a message to the EE_Error::add_%s() call made in %s on line %d', 'event_espresso'),
609 609
 					$type,
610 610
 					$file,
611 611
 					$line
@@ -613,27 +613,27 @@  discard block
 block discarded – undo
613 613
 				EVENT_ESPRESSO_VERSION
614 614
 			);
615 615
 		}
616
-		if ( $type == 'errors' && ( empty( $file ) || empty( $func ) || empty( $line ))) {
616
+		if ($type == 'errors' && (empty($file) || empty($func) || empty($line))) {
617 617
 			EE_Error::doing_it_wrong(
618 618
 				'EE_Error::add_error()',
619
-				__('You need to provide the file name, function name, and line number that the error occurred on in order to better assist with debugging.', 'event_espresso' ),
619
+				__('You need to provide the file name, function name, and line number that the error occurred on in order to better assist with debugging.', 'event_espresso'),
620 620
 				EVENT_ESPRESSO_VERSION
621 621
 			);
622 622
 		}
623 623
 		// get separate user and developer messages if they exist
624
-		$msg = explode( '||', $msg );
624
+		$msg = explode('||', $msg);
625 625
 		$user_msg = $msg[0];
626
-		$dev_msg = isset( $msg[1] ) ? $msg[1] : $msg[0];
626
+		$dev_msg = isset($msg[1]) ? $msg[1] : $msg[0];
627 627
 		$msg = WP_DEBUG ? $dev_msg : $user_msg;
628 628
 		// add notice if message exists
629
-		if ( ! empty( $msg )) {
629
+		if ( ! empty($msg)) {
630 630
 			// get error code, but only on error
631
-			if ( WP_DEBUG && $type == 'errors' ) {
632
-				$msg .= '<br/><span class="tiny-text">' . EE_Error::generate_error_code( $file, $func, $line ) . '</span>';
631
+			if (WP_DEBUG && $type == 'errors') {
632
+				$msg .= '<br/><span class="tiny-text">'.EE_Error::generate_error_code($file, $func, $line).'</span>';
633 633
 			}
634 634
 			// add notice
635
-			self::$_espresso_notices[ $type ][] = $msg;
636
-			add_action( 'wp_footer', array( 'EE_Error', 'enqueue_error_scripts' ), 1 );
635
+			self::$_espresso_notices[$type][] = $msg;
636
+			add_action('wp_footer', array('EE_Error', 'enqueue_error_scripts'), 1);
637 637
 		}
638 638
 
639 639
 	}
@@ -687,7 +687,7 @@  discard block
 block discarded – undo
687 687
 	*	@access private
688 688
 	*	@return void
689 689
 	*/
690
-	public static function reset_notices(){
690
+	public static function reset_notices() {
691 691
     	self::$_espresso_notices['success'] = FALSE;
692 692
     	self::$_espresso_notices['attention'] = FALSE;
693 693
     	self::$_espresso_notices['errors'] = FALSE;
@@ -700,14 +700,14 @@  discard block
 block discarded – undo
700 700
 	*	@access public
701 701
 	*	@return int
702 702
 	*/
703
-    public static function has_notices(){
703
+    public static function has_notices() {
704 704
 		$has_notices = 0;
705 705
 		// check for success messages
706
-		$has_notices = self::$_espresso_notices['success'] && ! empty(  self::$_espresso_notices['success'] ) ? 3 : $has_notices;
706
+		$has_notices = self::$_espresso_notices['success'] && ! empty(self::$_espresso_notices['success']) ? 3 : $has_notices;
707 707
 		// check for attention messages
708
-		$has_notices = self::$_espresso_notices['attention'] && ! empty(  self::$_espresso_notices['attention'] ) ? 2 : $has_notices;
708
+		$has_notices = self::$_espresso_notices['attention'] && ! empty(self::$_espresso_notices['attention']) ? 2 : $has_notices;
709 709
 		// check for error messages
710
-		$has_notices = self::$_espresso_notices['errors'] && ! empty(  self::$_espresso_notices['errors'] ) ? 1 : $has_notices;
710
+		$has_notices = self::$_espresso_notices['errors'] && ! empty(self::$_espresso_notices['errors']) ? 1 : $has_notices;
711 711
 		return $has_notices;
712 712
 	}
713 713
 
@@ -722,8 +722,8 @@  discard block
 block discarded – undo
722 722
 	* 	@param		boolean		$remove_empty		whether or not to unset empty messages
723 723
 	* 	@return 		array
724 724
 	*/
725
-	public static function get_notices( $format_output = TRUE, $save_to_transient = FALSE, $remove_empty = TRUE ) {
726
-		do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' );
725
+	public static function get_notices($format_output = TRUE, $save_to_transient = FALSE, $remove_empty = TRUE) {
726
+		do_action('AHEE_log', __FILE__, __FUNCTION__, '');
727 727
 
728 728
 		$success_messages = '';
729 729
 		$attention_messages = '';
@@ -733,44 +733,44 @@  discard block
 block discarded – undo
733 733
 		// EEH_Debug_Tools::printr( self::$_espresso_notices, 'espresso_notices  <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span>', 'auto' );
734 734
 
735 735
 		// either save notices to the db
736
-		if ( $save_to_transient ) {
737
-			update_option( 'ee_notices', self::$_espresso_notices );
736
+		if ($save_to_transient) {
737
+			update_option('ee_notices', self::$_espresso_notices);
738 738
 			return;
739 739
 		}
740 740
 		// grab any notices that have been previously saved
741
-		if ( $notices = get_option( 'ee_notices', FALSE )) {
742
-			foreach ( $notices as $type => $notice ) {
743
-				if ( is_array( $notice ) && ! empty( $notice )) {
741
+		if ($notices = get_option('ee_notices', FALSE)) {
742
+			foreach ($notices as $type => $notice) {
743
+				if (is_array($notice) && ! empty($notice)) {
744 744
 					// make sure that existsing notice type is an array
745
-					self::$_espresso_notices[ $type ] =  is_array( self::$_espresso_notices[ $type ] ) && ! empty( self::$_espresso_notices[ $type ] ) ? self::$_espresso_notices[ $type ] : array();
745
+					self::$_espresso_notices[$type] = is_array(self::$_espresso_notices[$type]) && ! empty(self::$_espresso_notices[$type]) ? self::$_espresso_notices[$type] : array();
746 746
 					// merge stored notices with any newly created ones
747
-					self::$_espresso_notices[ $type ] = array_merge( self::$_espresso_notices[ $type ], $notice );
747
+					self::$_espresso_notices[$type] = array_merge(self::$_espresso_notices[$type], $notice);
748 748
 					$print_scripts = TRUE;
749 749
 				}
750 750
 			}
751 751
 			// now clear any stored notices
752
-			update_option( 'ee_notices', FALSE );
752
+			update_option('ee_notices', FALSE);
753 753
 		}
754 754
 
755 755
 		// check for success messages
756
-		if ( self::$_espresso_notices['success'] && ! empty(  self::$_espresso_notices['success'] )) {
756
+		if (self::$_espresso_notices['success'] && ! empty(self::$_espresso_notices['success'])) {
757 757
 			// combine messages
758
-			$success_messages .= implode( self::$_espresso_notices['success'], '<br />' );
758
+			$success_messages .= implode(self::$_espresso_notices['success'], '<br />');
759 759
 			$print_scripts = TRUE;
760 760
 		}
761 761
 
762 762
 		// check for attention messages
763
-		if ( self::$_espresso_notices['attention'] && ! empty(  self::$_espresso_notices['attention'] ) ) {
763
+		if (self::$_espresso_notices['attention'] && ! empty(self::$_espresso_notices['attention'])) {
764 764
 			// combine messages
765
-			$attention_messages .= implode( self::$_espresso_notices['attention'], '<br />' );
765
+			$attention_messages .= implode(self::$_espresso_notices['attention'], '<br />');
766 766
 			$print_scripts = TRUE;
767 767
 		}
768 768
 
769 769
 		// check for error messages
770
-		if ( self::$_espresso_notices['errors'] && ! empty(  self::$_espresso_notices['errors'] ) ) {
771
-			$error_messages .= count( self::$_espresso_notices['errors'] ) > 1 ? __( 'The following errors have occurred:<br />', 'event_espresso' ) : __( 'An error has occurred:<br />', 'event_espresso' );
770
+		if (self::$_espresso_notices['errors'] && ! empty(self::$_espresso_notices['errors'])) {
771
+			$error_messages .= count(self::$_espresso_notices['errors']) > 1 ? __('The following errors have occurred:<br />', 'event_espresso') : __('An error has occurred:<br />', 'event_espresso');
772 772
 			// combine messages
773
-			$error_messages .= implode( self::$_espresso_notices['errors'], '<br />' );
773
+			$error_messages .= implode(self::$_espresso_notices['errors'], '<br />');
774 774
 			$print_scripts = TRUE;
775 775
 		}
776 776
 
@@ -784,21 +784,21 @@  discard block
 block discarded – undo
784 784
 				$css_id = is_admin() ? 'message' : 'espresso-notices-success';
785 785
 				$css_class = is_admin() ? 'updated fade' : 'success fade-away';
786 786
 				//showMessage( $success_messages );
787
-				$notices .= '<div id="' . $css_id . '" class="espresso-notices ' . $css_class . '" style="display:none;"><p>' . $success_messages . '</p>' . $close . '</div>';
787
+				$notices .= '<div id="'.$css_id.'" class="espresso-notices '.$css_class.'" style="display:none;"><p>'.$success_messages.'</p>'.$close.'</div>';
788 788
 			}
789 789
 
790 790
 			if ($attention_messages != '') {
791 791
 				$css_id = is_admin() ? 'message' : 'espresso-notices-attention';
792 792
 				$css_class = is_admin() ? 'updated ee-notices-attention' : 'attention fade-away';
793 793
 				//showMessage( $error_messages, TRUE );
794
-				$notices .= '<div id="' . $css_id . '" class="espresso-notices ' . $css_class . '" style="display:none;"><p>' . $attention_messages . '</p>' . $close . '</div>';
794
+				$notices .= '<div id="'.$css_id.'" class="espresso-notices '.$css_class.'" style="display:none;"><p>'.$attention_messages.'</p>'.$close.'</div>';
795 795
 			}
796 796
 
797 797
 			if ($error_messages != '') {
798 798
 				$css_id = is_admin() ? 'message' : 'espresso-notices-error';
799 799
 				$css_class = is_admin() ? 'error' : 'error fade-away';
800 800
 				//showMessage( $error_messages, TRUE );
801
-				$notices .= '<div id="' . $css_id . '" class="espresso-notices ' . $css_class . '" style="display:none;"><p>' . $error_messages . '</p>' . $close . '</div>';
801
+				$notices .= '<div id="'.$css_id.'" class="espresso-notices '.$css_class.'" style="display:none;"><p>'.$error_messages.'</p>'.$close.'</div>';
802 802
 			}
803 803
 
804 804
 			$notices .= '</div>';
@@ -811,7 +811,7 @@  discard block
 block discarded – undo
811 811
 					'errors' => $error_messages
812 812
 			);
813 813
 
814
-			if ( $remove_empty ) {
814
+			if ($remove_empty) {
815 815
 				// remove empty notices
816 816
 				foreach ($notices as $type => $notice) {
817 817
 					if (empty($notice)) {
@@ -821,7 +821,7 @@  discard block
 block discarded – undo
821 821
 			}
822 822
 		}
823 823
 
824
-		if ( $print_scripts ) {
824
+		if ($print_scripts) {
825 825
 			self::_print_scripts();
826 826
 		}
827 827
 
@@ -841,17 +841,17 @@  discard block
 block discarded – undo
841 841
 	* 	@param bool $force_update allows one to enforce the reappearance of a persistent message.
842 842
 	* 	@return 		void
843 843
 	*/
844
-	public static function add_persistent_admin_notice( $pan_name = '', $pan_message, $force_update = FALSE ) {
845
-		if ( ! empty( $pan_name ) && ! empty( $pan_message )) {
846
-			$persistent_admin_notices = get_option( 'ee_pers_admin_notices', array() );
844
+	public static function add_persistent_admin_notice($pan_name = '', $pan_message, $force_update = FALSE) {
845
+		if ( ! empty($pan_name) && ! empty($pan_message)) {
846
+			$persistent_admin_notices = get_option('ee_pers_admin_notices', array());
847 847
 			//maybe initialize persistent_admin_notices
848
-			if ( empty( $persistent_admin_notices )) {
849
-				add_option( 'ee_pers_admin_notices', array(), '', 'no' );
848
+			if (empty($persistent_admin_notices)) {
849
+				add_option('ee_pers_admin_notices', array(), '', 'no');
850 850
 			}
851
-			$pan_name = sanitize_key( $pan_name );
852
-			if ( ! array_key_exists( $pan_name, $persistent_admin_notices ) || $force_update ) {
853
-				$persistent_admin_notices[ $pan_name ] = $pan_message;
854
-				update_option( 'ee_pers_admin_notices', $persistent_admin_notices );
851
+			$pan_name = sanitize_key($pan_name);
852
+			if ( ! array_key_exists($pan_name, $persistent_admin_notices) || $force_update) {
853
+				$persistent_admin_notices[$pan_name] = $pan_message;
854
+				update_option('ee_pers_admin_notices', $persistent_admin_notices);
855 855
 			}
856 856
 		}
857 857
 	}
@@ -867,34 +867,34 @@  discard block
 block discarded – undo
867 867
 	 * @param bool          $return_immediately
868 868
 	 * @return        void
869 869
 	 */
870
-	public static function dismiss_persistent_admin_notice( $pan_name = '', $purge = FALSE, $return_immediately = FALSE ) {
871
-		$pan_name = EE_Registry::instance()->REQ->is_set( 'ee_nag_notice' ) ? EE_Registry::instance()->REQ->get( 'ee_nag_notice' ) : $pan_name;
872
-		if ( ! empty( $pan_name )) {
873
-			$persistent_admin_notices = get_option( 'ee_pers_admin_notices', array() );
870
+	public static function dismiss_persistent_admin_notice($pan_name = '', $purge = FALSE, $return_immediately = FALSE) {
871
+		$pan_name = EE_Registry::instance()->REQ->is_set('ee_nag_notice') ? EE_Registry::instance()->REQ->get('ee_nag_notice') : $pan_name;
872
+		if ( ! empty($pan_name)) {
873
+			$persistent_admin_notices = get_option('ee_pers_admin_notices', array());
874 874
 			// check if notice we wish to dismiss is actually in the $persistent_admin_notices array
875
-			if ( is_array( $persistent_admin_notices ) && isset( $persistent_admin_notices[ $pan_name ] )) {
875
+			if (is_array($persistent_admin_notices) && isset($persistent_admin_notices[$pan_name])) {
876 876
 				// completely delete nag notice, or just NULL message so that it can NOT be added again ?
877
-				if ( $purge ) {
878
-					unset( $persistent_admin_notices[ $pan_name ] );
877
+				if ($purge) {
878
+					unset($persistent_admin_notices[$pan_name]);
879 879
 				} else {
880
-					$persistent_admin_notices[ $pan_name ] = NULL;
880
+					$persistent_admin_notices[$pan_name] = NULL;
881 881
 				}
882
-				if ( update_option( 'ee_pers_admin_notices', $persistent_admin_notices ) === FALSE ) {
883
-					EE_Error::add_error( sprintf( __( 'The persistent admin notice for "%s" could not be deleted.', 'event_espresso' ), $pan_name ), __FILE__, __FUNCTION__, __LINE__ );
882
+				if (update_option('ee_pers_admin_notices', $persistent_admin_notices) === FALSE) {
883
+					EE_Error::add_error(sprintf(__('The persistent admin notice for "%s" could not be deleted.', 'event_espresso'), $pan_name), __FILE__, __FUNCTION__, __LINE__);
884 884
 				}
885 885
 			}
886 886
 		}
887
-		if ( $return_immediately ) {
887
+		if ($return_immediately) {
888 888
 			return;
889
-		} else if ( EE_Registry::instance()->REQ->ajax ) {
889
+		} else if (EE_Registry::instance()->REQ->ajax) {
890 890
 			// grab any notices and concatenate into string
891
-			echo json_encode( array( 'errors' => implode( '<br />', EE_Error::get_notices( FALSE ))));
891
+			echo json_encode(array('errors' => implode('<br />', EE_Error::get_notices(FALSE))));
892 892
 			exit();
893 893
 		} else {
894 894
 			// save errors to a transient to be displayed on next request (after redirect)
895
-			EE_Error::get_notices( FALSE, TRUE );
896
-			$return_url = EE_Registry::instance()->REQ->is_set( 'return_url' ) ? EE_Registry::instance()->REQ->get( 'return_url' ) : '';
897
-			wp_safe_redirect( urldecode( $return_url ));
895
+			EE_Error::get_notices(FALSE, TRUE);
896
+			$return_url = EE_Registry::instance()->REQ->is_set('return_url') ? EE_Registry::instance()->REQ->get('return_url') : '';
897
+			wp_safe_redirect(urldecode($return_url));
898 898
 		}
899 899
 	}
900 900
 
@@ -909,20 +909,20 @@  discard block
 block discarded – undo
909 909
 	* 	@param		string	$return_url	URL to go back to aftger nag notice is dismissed
910 910
 	 *  	@return 		string
911 911
 	 */
912
-	public static function display_persistent_admin_notices( $pan_name = '', $pan_message = '', $return_url = '' ) {
913
-		if ( ! empty( $pan_name ) && ! empty( $pan_message )) {
912
+	public static function display_persistent_admin_notices($pan_name = '', $pan_message = '', $return_url = '') {
913
+		if ( ! empty($pan_name) && ! empty($pan_message)) {
914 914
 			$args = array(
915 915
 				'nag_notice' => $pan_name,
916
-				'return_url' => urlencode( $return_url ),
916
+				'return_url' => urlencode($return_url),
917 917
 				'ajax_url' => WP_AJAX_URL,
918
-				'unknown_error' => __( 'An unknown error has occurred on the server while attempting to dismiss this notice.', 'event_espresso' )
918
+				'unknown_error' => __('An unknown error has occurred on the server while attempting to dismiss this notice.', 'event_espresso')
919 919
 			);
920
-			wp_localize_script( 'espresso_core', 'ee_dismiss', $args );
920
+			wp_localize_script('espresso_core', 'ee_dismiss', $args);
921 921
 			return '
922
-			<div id="' . $pan_name . '" class="espresso-notices updated ee-nag-notice clearfix" style="border-left: 4px solid #fcb93c;">
923
-				<p>' . $pan_message . '</p>
924
-				<a class="dismiss-ee-nag-notice hide-if-no-js" style="float: right; cursor: pointer; text-decoration:none;" rel="' . $pan_name . '">
925
-					<span class="dashicons dashicons-dismiss" style="position:relative; top:-1px; margin-right:.25em;"></span>'.__( 'Dismiss', 'event_espresso' ) .'
922
+			<div id="' . $pan_name.'" class="espresso-notices updated ee-nag-notice clearfix" style="border-left: 4px solid #fcb93c;">
923
+				<p>' . $pan_message.'</p>
924
+				<a class="dismiss-ee-nag-notice hide-if-no-js" style="float: right; cursor: pointer; text-decoration:none;" rel="' . $pan_name.'">
925
+					<span class="dashicons dashicons-dismiss" style="position:relative; top:-1px; margin-right:.25em;"></span>'.__('Dismiss', 'event_espresso').'
926 926
 				</a>
927 927
 				<div style="clear:both;"></div>
928 928
 			</div>';
@@ -938,17 +938,17 @@  discard block
 block discarded – undo
938 938
 	 * @param string $return_url
939 939
 	 * @return    array
940 940
 	 */
941
-	public static function get_persistent_admin_notices( $return_url = '' ) {
941
+	public static function get_persistent_admin_notices($return_url = '') {
942 942
 		$notices = '';
943 943
 		// check for persistent admin notices
944
-		if ( $persistent_admin_notices = get_option( 'ee_pers_admin_notices', FALSE )) {
944
+		if ($persistent_admin_notices = get_option('ee_pers_admin_notices', FALSE)) {
945 945
 			// load scripts
946
-			wp_register_script( 'espresso_core', EE_GLOBAL_ASSETS_URL . 'scripts/espresso_core.js', array('jquery'), EVENT_ESPRESSO_VERSION, TRUE );
947
-			wp_register_script( 'ee_error_js', EE_GLOBAL_ASSETS_URL . 'scripts/EE_Error.js', array('espresso_core'), EVENT_ESPRESSO_VERSION, TRUE );
948
-			wp_enqueue_script( 'ee_error_js' );
946
+			wp_register_script('espresso_core', EE_GLOBAL_ASSETS_URL.'scripts/espresso_core.js', array('jquery'), EVENT_ESPRESSO_VERSION, TRUE);
947
+			wp_register_script('ee_error_js', EE_GLOBAL_ASSETS_URL.'scripts/EE_Error.js', array('espresso_core'), EVENT_ESPRESSO_VERSION, TRUE);
948
+			wp_enqueue_script('ee_error_js');
949 949
 			// and display notices
950
-			foreach( $persistent_admin_notices as $pan_name => $pan_message ) {
951
-				$notices .= self::display_persistent_admin_notices( $pan_name, $pan_message, $return_url );
950
+			foreach ($persistent_admin_notices as $pan_name => $pan_message) {
951
+				$notices .= self::display_persistent_admin_notices($pan_name, $pan_message, $return_url);
952 952
 			}
953 953
 		}
954 954
 		return $notices;
@@ -963,26 +963,26 @@  discard block
 block discarded – undo
963 963
 	 * @param 	bool $force_print
964 964
 	 * @return 	void
965 965
 	 */
966
-	private static function _print_scripts( $force_print = FALSE ) {
967
-		if (( did_action( 'admin_enqueue_scripts' ) || did_action( 'wp_enqueue_scripts' )) && ! $force_print ) {
968
-			if ( wp_script_is( 'ee_error_js', 'enqueued' )) {
966
+	private static function _print_scripts($force_print = FALSE) {
967
+		if ((did_action('admin_enqueue_scripts') || did_action('wp_enqueue_scripts')) && ! $force_print) {
968
+			if (wp_script_is('ee_error_js', 'enqueued')) {
969 969
 				return;
970
-			} else if ( wp_script_is( 'ee_error_js', 'registered' )) {
971
-				add_filter( 'FHEE_load_css', '__return_true' );
972
-				add_filter( 'FHEE_load_js', '__return_true' );
973
-				wp_enqueue_script( 'ee_error_js' );
974
-				wp_localize_script( 'ee_error_js','ee_settings', array( 'wp_debug'=>WP_DEBUG ));
970
+			} else if (wp_script_is('ee_error_js', 'registered')) {
971
+				add_filter('FHEE_load_css', '__return_true');
972
+				add_filter('FHEE_load_js', '__return_true');
973
+				wp_enqueue_script('ee_error_js');
974
+				wp_localize_script('ee_error_js', 'ee_settings', array('wp_debug'=>WP_DEBUG));
975 975
 			}
976 976
 		} else {
977 977
 			return '
978 978
 <script>
979 979
 /* <![CDATA[ */
980
-var ee_settings = {"wp_debug":"' . WP_DEBUG . '"};
980
+var ee_settings = {"wp_debug":"' . WP_DEBUG.'"};
981 981
 /* ]]> */
982 982
 </script>
983
-<script src="' . includes_url() . 'js/jquery/jquery.js" type="text/javascript"></script>
984
-<script src="' . EE_GLOBAL_ASSETS_URL . 'scripts/espresso_core.js' . '?ver=' . espresso_version() . '" type="text/javascript"></script>
985
-<script src="' . EE_GLOBAL_ASSETS_URL . 'scripts/EE_Error.js' . '?ver=' . espresso_version() . '" type="text/javascript"></script>
983
+<script src="' . includes_url().'js/jquery/jquery.js" type="text/javascript"></script>
984
+<script src="' . EE_GLOBAL_ASSETS_URL.'scripts/espresso_core.js'.'?ver='.espresso_version().'" type="text/javascript"></script>
985
+<script src="' . EE_GLOBAL_ASSETS_URL.'scripts/EE_Error.js'.'?ver='.espresso_version().'" type="text/javascript"></script>
986 986
 ';
987 987
 
988 988
 		}
@@ -1016,11 +1016,11 @@  discard block
 block discarded – undo
1016 1016
 	*	@ param string $line
1017 1017
 	*	@ return string
1018 1018
 	*/
1019
-	public static function generate_error_code ( $file = '', $func = '', $line = '' ) {
1020
-		$file = explode( '.', basename( $file ));
1021
-		$error_code = ! empty( $file[0] ) ? $file[0] : '';
1022
-		$error_code .= ! empty( $func ) ? ' - ' . $func : '';
1023
-		$error_code .= ! empty( $line ) ? ' - ' . $line : '';
1019
+	public static function generate_error_code($file = '', $func = '', $line = '') {
1020
+		$file = explode('.', basename($file));
1021
+		$error_code = ! empty($file[0]) ? $file[0] : '';
1022
+		$error_code .= ! empty($func) ? ' - '.$func : '';
1023
+		$error_code .= ! empty($line) ? ' - '.$line : '';
1024 1024
 		return $error_code;
1025 1025
 	}
1026 1026
 
@@ -1036,36 +1036,36 @@  discard block
 block discarded – undo
1036 1036
 	*	@ param object $ex
1037 1037
 	*	@ return void
1038 1038
 	*/
1039
-	public function write_to_error_log ( $time = FALSE, $ex = FALSE, $clear = FALSE ) {
1039
+	public function write_to_error_log($time = FALSE, $ex = FALSE, $clear = FALSE) {
1040 1040
 
1041
-		if ( ! $ex ) {
1041
+		if ( ! $ex) {
1042 1042
 			return;
1043 1043
 		}
1044 1044
 
1045
-		if ( ! $time ) {
1045
+		if ( ! $time) {
1046 1046
 			$time = time();
1047 1047
 		}
1048 1048
 
1049
-		$exception_log = '----------------------------------------------------------------------------------------' . PHP_EOL;
1050
-		$exception_log .= '[' . date( 'Y-m-d H:i:s', $time ) . ']  Exception Details' . PHP_EOL;
1051
-		$exception_log .= 'Message: ' . $ex['msg'] . PHP_EOL;
1052
-		$exception_log .= 'Code: '. $ex['code'] . PHP_EOL;
1053
-		$exception_log .= 'File: '. $ex['file'] . PHP_EOL;
1054
-		$exception_log .= 'Line No: ' . $ex['line'] . PHP_EOL;
1055
-		$exception_log .= 'Stack trace: ' . PHP_EOL;
1056
-		$exception_log .= $ex['string'] . PHP_EOL;
1057
-		$exception_log .= '----------------------------------------------------------------------------------------' . PHP_EOL;
1058
-
1059
-		EE_Registry::instance()->load_helper( 'File' );
1049
+		$exception_log = '----------------------------------------------------------------------------------------'.PHP_EOL;
1050
+		$exception_log .= '['.date('Y-m-d H:i:s', $time).']  Exception Details'.PHP_EOL;
1051
+		$exception_log .= 'Message: '.$ex['msg'].PHP_EOL;
1052
+		$exception_log .= 'Code: '.$ex['code'].PHP_EOL;
1053
+		$exception_log .= 'File: '.$ex['file'].PHP_EOL;
1054
+		$exception_log .= 'Line No: '.$ex['line'].PHP_EOL;
1055
+		$exception_log .= 'Stack trace: '.PHP_EOL;
1056
+		$exception_log .= $ex['string'].PHP_EOL;
1057
+		$exception_log .= '----------------------------------------------------------------------------------------'.PHP_EOL;
1058
+
1059
+		EE_Registry::instance()->load_helper('File');
1060 1060
 		try {
1061
-			EEH_File::ensure_file_exists_and_is_writable( EVENT_ESPRESSO_UPLOAD_DIR . 'logs' . DS . self::$_exception_log_file );
1062
-			if ( ! $clear ) {
1061
+			EEH_File::ensure_file_exists_and_is_writable(EVENT_ESPRESSO_UPLOAD_DIR.'logs'.DS.self::$_exception_log_file);
1062
+			if ( ! $clear) {
1063 1063
 				//get existing log file and append new log info
1064
-				$exception_log = EEH_File::get_file_contents( EVENT_ESPRESSO_UPLOAD_DIR . 'logs' . DS . self::$_exception_log_file ) . $exception_log;
1064
+				$exception_log = EEH_File::get_file_contents(EVENT_ESPRESSO_UPLOAD_DIR.'logs'.DS.self::$_exception_log_file).$exception_log;
1065 1065
 			}
1066
-			EEH_File::write_to_file( EVENT_ESPRESSO_UPLOAD_DIR . 'logs' . DS . self::$_exception_log_file, $exception_log );
1067
-		} catch( EE_Error $e ){
1068
-			EE_Error::add_error( sprintf( __(  'Event Espresso error logging could not be setup because: %s', 'event_espresso' ), $e->getMessage() ));
1066
+			EEH_File::write_to_file(EVENT_ESPRESSO_UPLOAD_DIR.'logs'.DS.self::$_exception_log_file, $exception_log);
1067
+		} catch (EE_Error $e) {
1068
+			EE_Error::add_error(sprintf(__('Event Espresso error logging could not be setup because: %s', 'event_espresso'), $e->getMessage()));
1069 1069
 			return;
1070 1070
 		}
1071 1071
 
@@ -1089,10 +1089,10 @@  discard block
 block discarded – undo
1089 1089
 	 * @param int     $error_type
1090 1090
 	 * @return void
1091 1091
 	 */
1092
-	public static function doing_it_wrong( $function, $message, $version, $error_type = E_USER_NOTICE ) {
1093
-		if ( defined('WP_DEBUG') && WP_DEBUG ) {
1092
+	public static function doing_it_wrong($function, $message, $version, $error_type = E_USER_NOTICE) {
1093
+		if (defined('WP_DEBUG') && WP_DEBUG) {
1094 1094
 			EE_Registry::instance()->load_helper('Debug_Tools');
1095
-			EEH_Debug_Tools::instance()->doing_it_wrong( $function, $message, $version, $error_type );
1095
+			EEH_Debug_Tools::instance()->doing_it_wrong($function, $message, $version, $error_type);
1096 1096
 		}
1097 1097
 	}
1098 1098
 
@@ -1112,13 +1112,13 @@  discard block
 block discarded – undo
1112 1112
  */
1113 1113
 function espresso_error_enqueue_scripts() {
1114 1114
 	// js for error handling
1115
-	wp_register_script( 'espresso_core', EE_GLOBAL_ASSETS_URL . 'scripts/espresso_core.js', array('jquery'), EVENT_ESPRESSO_VERSION, FALSE );
1116
-	wp_register_script( 'ee_error_js', EE_GLOBAL_ASSETS_URL . 'scripts/EE_Error.js', array('espresso_core'), EVENT_ESPRESSO_VERSION, FALSE );
1115
+	wp_register_script('espresso_core', EE_GLOBAL_ASSETS_URL.'scripts/espresso_core.js', array('jquery'), EVENT_ESPRESSO_VERSION, FALSE);
1116
+	wp_register_script('ee_error_js', EE_GLOBAL_ASSETS_URL.'scripts/EE_Error.js', array('espresso_core'), EVENT_ESPRESSO_VERSION, FALSE);
1117 1117
 }
1118
-if ( is_admin() ) {
1119
-	add_action( 'admin_enqueue_scripts', 'espresso_error_enqueue_scripts', 2 );
1118
+if (is_admin()) {
1119
+	add_action('admin_enqueue_scripts', 'espresso_error_enqueue_scripts', 2);
1120 1120
 } else {
1121
-	add_action( 'wp_enqueue_scripts', 'espresso_error_enqueue_scripts', 2 );
1121
+	add_action('wp_enqueue_scripts', 'espresso_error_enqueue_scripts', 2);
1122 1122
 }
1123 1123
 
1124 1124
 
Please login to merge, or discard this patch.
Indentation   +165 added lines, -165 removed lines patch added patch discarded remove patch
@@ -18,52 +18,52 @@  discard block
 block discarded – undo
18 18
 
19 19
 
20 20
 	/**
21
-	* 	name of the file to log exceptions to
22
-	* 	@access	private
23
-    *	@var string
24
-	*/
21
+	 * 	name of the file to log exceptions to
22
+	 * 	@access	private
23
+	 *	@var string
24
+	 */
25 25
 	private static $_exception_log_file = 'espresso_error_log.txt';
26 26
 
27 27
 	/**
28
-	* 	the exception
29
-	* 	@access	private
30
-    *	@var object
31
-	*/
28
+	 * 	the exception
29
+	 * 	@access	private
30
+	 *	@var object
31
+	 */
32 32
 	private $_exception;
33 33
 
34 34
 	/**
35
-	* 	stores details for all exception
36
-	* 	@access	private
37
-    *	@var array
38
-	*/
35
+	 * 	stores details for all exception
36
+	 * 	@access	private
37
+	 *	@var array
38
+	 */
39 39
 	private static $_all_exceptions = array();
40 40
 
41 41
 	/**
42
-	* 	tracks number of errors
43
-	* 	@access	private
44
-    *	@var int
45
-	*/
42
+	 * 	tracks number of errors
43
+	 * 	@access	private
44
+	 *	@var int
45
+	 */
46 46
 	private static $_error_count = 0;
47 47
 
48 48
 	/**
49
-	* 	has JS been loaded ?
50
-	* 	@access	private
51
-    *	@var boolean
52
-	*/
49
+	 * 	has JS been loaded ?
50
+	 * 	@access	private
51
+	 *	@var boolean
52
+	 */
53 53
 	private static $_js_loaded = FALSE;
54 54
 
55 55
 	/**
56
-	* 	has shutdown action been added ?
57
-	* 	@access	private
58
-    *	@var boolean
59
-	*/
56
+	 * 	has shutdown action been added ?
57
+	 * 	@access	private
58
+	 *	@var boolean
59
+	 */
60 60
 	private static $_action_added = FALSE;
61 61
 
62 62
 	/**
63
-	* 	has shutdown action been added ?
64
-	* 	@access	private
65
-    *	@var boolean
66
-	*/
63
+	 * 	has shutdown action been added ?
64
+	 * 	@access	private
65
+	 *	@var boolean
66
+	 */
67 67
 	private static $_espresso_notices = array( 'success' => FALSE, 'errors' => FALSE, 'attention' => FALSE );
68 68
 
69 69
 
@@ -71,10 +71,10 @@  discard block
 block discarded – undo
71 71
 
72 72
 
73 73
 	/**
74
-	*	@override default exception handling
75
-	*	@access public
76
-	*	@echo string
77
-	*/
74
+	 *	@override default exception handling
75
+	 *	@access public
76
+	 *	@echo string
77
+	 */
78 78
 	function __construct( $message, $code = 0, Exception $previous = NULL ) {
79 79
 		if ( version_compare( phpversion(), '5.3.0', '<' )) {
80 80
 			parent::__construct( $message, $code );
@@ -173,10 +173,10 @@  discard block
 block discarded – undo
173 173
 
174 174
 
175 175
 	/**
176
-	*	fatal_error_handler
177
-	*	@access public
178
-	*	@return void
179
-	*/
176
+	 *	fatal_error_handler
177
+	 *	@access public
178
+	 *	@return void
179
+	 */
180 180
 	public static function fatal_error_handler() {
181 181
 		$last_error = error_get_last();
182 182
 		if ( $last_error['type'] === E_ERROR ) {
@@ -221,11 +221,11 @@  discard block
 block discarded – undo
221 221
 
222 222
 
223 223
 	/**
224
-	*	_add_actions
225
-	*	@access public
226
-	*	@return void
227
-	*/
228
-    public function get_error() {
224
+	 *	_add_actions
225
+	 *	@access public
226
+	 *	@return void
227
+	 */
228
+	public function get_error() {
229 229
 
230 230
 		if( apply_filters( 'FHEE__EE_Error__get_error__show_normal_exceptions', FALSE ) ){
231 231
 			throw $this;
@@ -255,22 +255,22 @@  discard block
 block discarded – undo
255 255
 
256 256
 
257 257
 	/**
258
-	*	has_error
259
-	*	@access public
260
-	*	@return boolean
261
-	*/
262
-    public static function has_error(){
258
+	 *	has_error
259
+	 *	@access public
260
+	 *	@return boolean
261
+	 */
262
+	public static function has_error(){
263 263
 		return self::$_error_count ? TRUE : FALSE;
264 264
 	}
265 265
 
266 266
 
267 267
 
268 268
 	/**
269
-	*	display_errors
270
-	*	@access public
271
-	*	@echo string
272
-	*/
273
-    public function display_errors(){
269
+	 *	display_errors
270
+	 *	@access public
271
+	 *	@echo string
272
+	 */
273
+	public function display_errors(){
274 274
 
275 275
 		$trace_details = '';
276 276
 
@@ -342,7 +342,7 @@  discard block
 block discarded – undo
342 342
 			// process trace info
343 343
 			if ( empty( $ex['trace'] )) {
344 344
 
345
-	            $trace_details .= __( 'Sorry, but no trace information was available for this exception.', 'event_espresso' );
345
+				$trace_details .= __( 'Sorry, but no trace information was available for this exception.', 'event_espresso' );
346 346
 
347 347
 			} else {
348 348
 
@@ -394,7 +394,7 @@  discard block
 block discarded – undo
394 394
 					$function_dsply = ! empty( $function ) ? $function : '&nbsp;';
395 395
 					$args_dsply = ! empty( $args ) ? '( ' . $args . ' )' : '';
396 396
 
397
-		              $trace_details .= '
397
+					  $trace_details .= '
398 398
 					<tr>
399 399
 						<td align="right" class="' . $zebra . '">' . $nmbr_dsply . '</td>
400 400
 						<td align="right" class="' . $zebra . '">' . $line_dsply . '</td>
@@ -406,7 +406,7 @@  discard block
 block discarded – undo
406 406
 
407 407
 				}
408 408
 
409
-	            $trace_details .= '
409
+				$trace_details .= '
410 410
 			 </table>
411 411
 			</div>';
412 412
 
@@ -486,12 +486,12 @@  discard block
 block discarded – undo
486 486
 
487 487
 
488 488
 	/**
489
-	*	generate string from exception trace args
490
-	*
491
-	*	@access private
492
-	*	@ param array $arguments
493
-	*	@ return string
494
-	*/
489
+	 *	generate string from exception trace args
490
+	 *
491
+	 *	@access private
492
+	 *	@ param array $arguments
493
+	 *	@ return string
494
+	 */
495 495
 	private function _convert_args_to_string ( $arguments = array(), $array = FALSE ) {
496 496
 
497 497
 		$arg_string = '';
@@ -535,15 +535,15 @@  discard block
 block discarded – undo
535 535
 
536 536
 
537 537
 	/**
538
-	* 	add error message
539
-	*
540
-	*	@access public
541
-	* 	@param		string		$msg	the message to display to users or developers - adding a double pipe || (OR) creates separate messages for user || dev
542
-	* 	@param		string		$file		the file that the error occurred in - just use __FILE__
543
-	* 	@param		string		$func	the function/method that the error occurred in - just use __FUNCTION__
544
-	* 	@param		string		$line	the line number where the error occurred - just use __LINE__
545
-	* 	@return 		void
546
-	*/
538
+	 * 	add error message
539
+	 *
540
+	 *	@access public
541
+	 * 	@param		string		$msg	the message to display to users or developers - adding a double pipe || (OR) creates separate messages for user || dev
542
+	 * 	@param		string		$file		the file that the error occurred in - just use __FILE__
543
+	 * 	@param		string		$func	the function/method that the error occurred in - just use __FUNCTION__
544
+	 * 	@param		string		$line	the line number where the error occurred - just use __LINE__
545
+	 * 	@return 		void
546
+	 */
547 547
 	public static function add_error( $msg = NULL, $file = NULL, $func = NULL, $line = NULL ) {
548 548
 		self::_add_notice ( 'errors', $msg, $file, $func, $line );
549 549
 		self::$_error_count++;
@@ -554,15 +554,15 @@  discard block
 block discarded – undo
554 554
 
555 555
 
556 556
 	/**
557
-	* 	add success message
558
-	*
559
-	*	@access public
560
-	* 	@param		string		$msg	the message to display to users or developers - adding a double pipe || (OR) creates separate messages for user || dev
561
-	* 	@param		string		$file		the file that the error occurred in - just use __FILE__
562
-	* 	@param		string		$func	the function/method that the error occurred in - just use __FUNCTION__
563
-	* 	@param		string		$line	the line number where the error occurred - just use __LINE__
564
-	* 	@return 		void
565
-	*/
557
+	 * 	add success message
558
+	 *
559
+	 *	@access public
560
+	 * 	@param		string		$msg	the message to display to users or developers - adding a double pipe || (OR) creates separate messages for user || dev
561
+	 * 	@param		string		$file		the file that the error occurred in - just use __FILE__
562
+	 * 	@param		string		$func	the function/method that the error occurred in - just use __FUNCTION__
563
+	 * 	@param		string		$line	the line number where the error occurred - just use __LINE__
564
+	 * 	@return 		void
565
+	 */
566 566
 	public static function add_success( $msg = NULL, $file = NULL, $func = NULL, $line = NULL ) {
567 567
 		self::_add_notice ( 'success', $msg, $file, $func, $line );
568 568
 	}
@@ -572,15 +572,15 @@  discard block
 block discarded – undo
572 572
 
573 573
 
574 574
 	/**
575
-	* 	add attention message
576
-	*
577
-	*	@access public
578
-	* 	@param		string		$msg	the message to display to users or developers - adding a double pipe || (OR) creates separate messages for user || dev
579
-	* 	@param		string		$file		the file that the error occurred in - just use __FILE__
580
-	* 	@param		string		$func	the function/method that the error occurred in - just use __FUNCTION__
581
-	* 	@param		string		$line	the line number where the error occurred - just use __LINE__
582
-	* 	@return 		void
583
-	*/
575
+	 * 	add attention message
576
+	 *
577
+	 *	@access public
578
+	 * 	@param		string		$msg	the message to display to users or developers - adding a double pipe || (OR) creates separate messages for user || dev
579
+	 * 	@param		string		$file		the file that the error occurred in - just use __FILE__
580
+	 * 	@param		string		$func	the function/method that the error occurred in - just use __FUNCTION__
581
+	 * 	@param		string		$line	the line number where the error occurred - just use __LINE__
582
+	 * 	@return 		void
583
+	 */
584 584
 	public static function add_attention( $msg = NULL, $file = NULL, $func = NULL, $line = NULL ) {
585 585
 		self::_add_notice ( 'attention', $msg, $file, $func, $line );
586 586
 	}
@@ -590,16 +590,16 @@  discard block
 block discarded – undo
590 590
 
591 591
 
592 592
 	/**
593
-	* 	add success message
594
-	*
595
-	*	@access public
596
-	* 	@param		string		$type	whether the message is for a success or error notification
597
-	* 	@param		string		$msg	the message to display to users or developers - adding a double pipe || (OR) creates separate messages for user || dev
598
-	* 	@param		string		$file		the file that the error occurred in - just use __FILE__
599
-	* 	@param		string		$func	the function/method that the error occurred in - just use __FUNCTION__
600
-	* 	@param		string		$line	the line number where the error occurred - just use __LINE__
601
-	* 	@return 		void
602
-	*/
593
+	 * 	add success message
594
+	 *
595
+	 *	@access public
596
+	 * 	@param		string		$type	whether the message is for a success or error notification
597
+	 * 	@param		string		$msg	the message to display to users or developers - adding a double pipe || (OR) creates separate messages for user || dev
598
+	 * 	@param		string		$file		the file that the error occurred in - just use __FILE__
599
+	 * 	@param		string		$func	the function/method that the error occurred in - just use __FUNCTION__
600
+	 * 	@param		string		$line	the line number where the error occurred - just use __LINE__
601
+	 * 	@return 		void
602
+	 */
603 603
 	private static function _add_notice( $type = 'success', $msg = NULL, $file = NULL, $func = NULL, $line = NULL ) {
604 604
 		if ( empty( $msg )) {
605 605
 			EE_Error::doing_it_wrong(
@@ -643,11 +643,11 @@  discard block
 block discarded – undo
643 643
 
644 644
 
645 645
 	/**
646
-	* 	in some case it may be necessary to overwrite the existing success messages
647
-	*
648
-	*	@access public
649
-	* 	@return 		void
650
-	*/
646
+	 * 	in some case it may be necessary to overwrite the existing success messages
647
+	 *
648
+	 *	@access public
649
+	 * 	@return 		void
650
+	 */
651 651
 	public static function overwrite_success() {
652 652
 		self::$_espresso_notices['success'] = FALSE;
653 653
 	}
@@ -657,11 +657,11 @@  discard block
 block discarded – undo
657 657
 
658 658
 
659 659
 	/**
660
-	* 	in some case it may be necessary to overwrite the existing attention messages
661
-	*
662
-	*	@access public
663
-	* 	@return 		void
664
-	*/
660
+	 * 	in some case it may be necessary to overwrite the existing attention messages
661
+	 *
662
+	 *	@access public
663
+	 * 	@return 		void
664
+	 */
665 665
 	public static function overwrite_attention() {
666 666
 		self::$_espresso_notices['attention'] = FALSE;
667 667
 	}
@@ -671,11 +671,11 @@  discard block
 block discarded – undo
671 671
 
672 672
 
673 673
 	/**
674
-	* 	in some case it may be necessary to overwrite the existing error messages
675
-	*
676
-	*	@access public
677
-	* 	@return 		void
678
-	*/
674
+	 * 	in some case it may be necessary to overwrite the existing error messages
675
+	 *
676
+	 *	@access public
677
+	 * 	@return 		void
678
+	 */
679 679
 	public static function overwrite_errors() {
680 680
 		self::$_espresso_notices['errors'] = FALSE;
681 681
 	}
@@ -683,24 +683,24 @@  discard block
 block discarded – undo
683 683
 
684 684
 
685 685
 	/**
686
-	*	reset_notices
687
-	*	@access private
688
-	*	@return void
689
-	*/
686
+	 *	reset_notices
687
+	 *	@access private
688
+	 *	@return void
689
+	 */
690 690
 	public static function reset_notices(){
691
-    	self::$_espresso_notices['success'] = FALSE;
692
-    	self::$_espresso_notices['attention'] = FALSE;
693
-    	self::$_espresso_notices['errors'] = FALSE;
694
-    }
691
+		self::$_espresso_notices['success'] = FALSE;
692
+		self::$_espresso_notices['attention'] = FALSE;
693
+		self::$_espresso_notices['errors'] = FALSE;
694
+	}
695 695
 
696 696
 
697 697
 
698 698
 	/**
699
-	*	has_errors
700
-	*	@access public
701
-	*	@return int
702
-	*/
703
-    public static function has_notices(){
699
+	 *	has_errors
700
+	 *	@access public
701
+	 *	@return int
702
+	 */
703
+	public static function has_notices(){
704 704
 		$has_notices = 0;
705 705
 		// check for success messages
706 706
 		$has_notices = self::$_espresso_notices['success'] && ! empty(  self::$_espresso_notices['success'] ) ? 3 : $has_notices;
@@ -714,14 +714,14 @@  discard block
 block discarded – undo
714 714
 
715 715
 
716 716
 	/**
717
-	* 	compile all error or success messages into one string
718
-	*
719
-	*	@access public
720
-	* 	@param		boolean		$format_output		whether or not to format the messages for display in the WP admin
721
-	* 	@param		boolean		$save_to_transient	whether or not to save notices to the db for retrieval on next request - ONLY do this just before redirecting
722
-	* 	@param		boolean		$remove_empty		whether or not to unset empty messages
723
-	* 	@return 		array
724
-	*/
717
+	 * 	compile all error or success messages into one string
718
+	 *
719
+	 *	@access public
720
+	 * 	@param		boolean		$format_output		whether or not to format the messages for display in the WP admin
721
+	 * 	@param		boolean		$save_to_transient	whether or not to save notices to the db for retrieval on next request - ONLY do this just before redirecting
722
+	 * 	@param		boolean		$remove_empty		whether or not to unset empty messages
723
+	 * 	@return 		array
724
+	 */
725 725
 	public static function get_notices( $format_output = TRUE, $save_to_transient = FALSE, $remove_empty = TRUE ) {
726 726
 		do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' );
727 727
 
@@ -833,14 +833,14 @@  discard block
 block discarded – undo
833 833
 
834 834
 
835 835
 	/**
836
-	* 	add_persistent_admin_notice
837
-	*
838
-	*	@access 	public
839
-	* 	@param		string	$pan_name	the name, or key of the Persistent Admin Notice to be stored
840
-	* 	@param		string	$pan_message	the message to be stored persistently until dismissed
841
-	* 	@param bool $force_update allows one to enforce the reappearance of a persistent message.
842
-	* 	@return 		void
843
-	*/
836
+	 * 	add_persistent_admin_notice
837
+	 *
838
+	 *	@access 	public
839
+	 * 	@param		string	$pan_name	the name, or key of the Persistent Admin Notice to be stored
840
+	 * 	@param		string	$pan_message	the message to be stored persistently until dismissed
841
+	 * 	@param bool $force_update allows one to enforce the reappearance of a persistent message.
842
+	 * 	@return 		void
843
+	 */
844 844
 	public static function add_persistent_admin_notice( $pan_name = '', $pan_message, $force_update = FALSE ) {
845 845
 		if ( ! empty( $pan_name ) && ! empty( $pan_message )) {
846 846
 			$persistent_admin_notices = get_option( 'ee_pers_admin_notices', array() );
@@ -904,9 +904,9 @@  discard block
 block discarded – undo
904 904
 	 * 	display_persistent_admin_notices
905 905
 	 *
906 906
 	 *  	@access 	public
907
-	* 	@param		string	$pan_name	the name, or key of the Persistent Admin Notice to be stored
908
-	* 	@param		string	$pan_name	the message to be stored persistently until dismissed
909
-	* 	@param		string	$return_url	URL to go back to aftger nag notice is dismissed
907
+	 * 	@param		string	$pan_name	the name, or key of the Persistent Admin Notice to be stored
908
+	 * 	@param		string	$pan_name	the message to be stored persistently until dismissed
909
+	 * 	@param		string	$return_url	URL to go back to aftger nag notice is dismissed
910 910
 	 *  	@return 		string
911 911
 	 */
912 912
 	public static function display_persistent_admin_notices( $pan_name = '', $pan_message = '', $return_url = '' ) {
@@ -995,11 +995,11 @@  discard block
 block discarded – undo
995 995
 
996 996
 
997 997
 	/**
998
-	* 	enqueue_error_scripts
999
-	*
1000
-	*	@access public
1001
-	* 	@return 		void
1002
-	*/
998
+	 * 	enqueue_error_scripts
999
+	 *
1000
+	 *	@access public
1001
+	 * 	@return 		void
1002
+	 */
1003 1003
 	public static function enqueue_error_scripts() {
1004 1004
 		self::_print_scripts();
1005 1005
 	}
@@ -1007,15 +1007,15 @@  discard block
 block discarded – undo
1007 1007
 
1008 1008
 
1009 1009
 	/**
1010
-	*	create error code from filepath, function name,
1011
-	*	and line number where exception or error was thrown
1012
-	*
1013
-	*	@access public
1014
-	*	@ param string $file
1015
-	*	@ param string $func
1016
-	*	@ param string $line
1017
-	*	@ return string
1018
-	*/
1010
+	 *	create error code from filepath, function name,
1011
+	 *	and line number where exception or error was thrown
1012
+	 *
1013
+	 *	@access public
1014
+	 *	@ param string $file
1015
+	 *	@ param string $func
1016
+	 *	@ param string $line
1017
+	 *	@ return string
1018
+	 */
1019 1019
 	public static function generate_error_code ( $file = '', $func = '', $line = '' ) {
1020 1020
 		$file = explode( '.', basename( $file ));
1021 1021
 		$error_code = ! empty( $file[0] ) ? $file[0] : '';
@@ -1029,13 +1029,13 @@  discard block
 block discarded – undo
1029 1029
 
1030 1030
 
1031 1031
 	/**
1032
-	*	write exception details to log file
1033
-	*
1034
-	*	@access public
1035
-	*	@ param timestamp $time
1036
-	*	@ param object $ex
1037
-	*	@ return void
1038
-	*/
1032
+	 *	write exception details to log file
1033
+	 *
1034
+	 *	@access public
1035
+	 *	@ param timestamp $time
1036
+	 *	@ param object $ex
1037
+	 *	@ return void
1038
+	 */
1039 1039
 	public function write_to_error_log ( $time = FALSE, $ex = FALSE, $clear = FALSE ) {
1040 1040
 
1041 1041
 		if ( ! $ex ) {
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   +37 added lines, -37 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' ), 999 );
103
+		add_filter('the_content', array($this, 'the_content'), 999);
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
 
@@ -218,9 +218,9 @@  discard block
 block discarded – undo
218 218
 	 * @param    string $template_path
219 219
 	 * @return    string
220 220
 	 */
221
-	public static function template_include( $template_path ) {
222
-		EE_Registry::instance()->load_helper( 'Template' );
223
-		$template_located = EEH_Template::locate_template( EE_TEMPLATES . 'maintenance_mode.template.php', FALSE, FALSE );
221
+	public static function template_include($template_path) {
222
+		EE_Registry::instance()->load_helper('Template');
223
+		$template_located = EEH_Template::locate_template(EE_TEMPLATES.'maintenance_mode.template.php', FALSE, FALSE);
224 224
 		return $template_located ? $template_located : $template_path;
225 225
 	}
226 226
 
@@ -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_' )) {
240
+		if ($this->level() && strpos($the_content, '[ESPRESSO_')) {
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
 				'<h2>',
245 245
 				'</h2><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_Registry.core.php 4 patches
Doc Comments   +10 added lines, -9 removed lines patch added patch discarded remove patch
@@ -214,6 +214,7 @@  discard block
 block discarded – undo
214 214
 
215 215
 	/**
216 216
 	 * @param mixed string | EED_Module $module
217
+	 * @param boolean|string $module
217 218
 	 */
218 219
 	public function add_module( $module ) {
219 220
 		if ( $module instanceof EED_Module ) {
@@ -245,7 +246,7 @@  discard block
 block discarded – undo
245 246
 	 * @param string $class_name - simple class name ie: session
246 247
 	 * @param mixed  $arguments
247 248
 	 * @param bool   $load_only
248
-	 * @return mixed
249
+	 * @return boolean
249 250
 	 */
250 251
 	public function load_core ( $class_name, $arguments = array(), $load_only = FALSE ) {
251 252
 		$core_paths = apply_filters(
@@ -269,7 +270,7 @@  discard block
 block discarded – undo
269 270
 	 * @access    public
270 271
 	 * @param string $class_name - class name for the DMS ie: EE_DMS_Core_4_2_0
271 272
 	 * @param mixed  $arguments
272
-	 * @return EE_Data_Migration_Script_Base
273
+	 * @return boolean
273 274
 	 */
274 275
 	public function load_dms ( $class_name, $arguments = array() ) {
275 276
 		// retrieve instantiated class
@@ -286,7 +287,7 @@  discard block
 block discarded – undo
286 287
 	 *	@param bool   $from_db    - some classes are instantiated from the db and thus call a different method to instantiate
287 288
 	 *	@param bool   $cache      if you don't want the class to be stored in the internal cache (non-persistent) then set this to FALSE (ie. when instantiating model objects from client in a loop)
288 289
 	 *	@param bool   $load_only      whether or not to just load the file and NOT instantiate, or load AND instantiate (default)
289
-	 *	@return EE_Base_Class
290
+	 *	@return boolean
290 291
 	 */
291 292
 	public function load_class ( $class_name, $arguments = array(), $from_db = FALSE, $cache = TRUE, $load_only = FALSE ) {
292 293
 		$paths = apply_filters('FHEE__EE_Registry__load_class__paths',array(
@@ -307,7 +308,7 @@  discard block
 block discarded – undo
307 308
 	 * @param string $class_name - simple class name ie: price
308 309
 	 * @param mixed  $arguments
309 310
 	 * @param bool   $load_only
310
-	 * @return EEH_Base
311
+	 * @return boolean
311 312
 	 */
312 313
 	public function load_helper ( $class_name, $arguments = array(), $load_only = TRUE ) {
313 314
 		$helper_paths = apply_filters( 'FHEE__EE_Registry__load_helper__helper_paths', array(EE_HELPERS ) );
@@ -324,7 +325,7 @@  discard block
 block discarded – undo
324 325
 	 * @param string $class_name - simple class name ie: session
325 326
 	 * @param mixed  $arguments
326 327
 	 * @param bool   $load_only
327
-	 * @return mixed
328
+	 * @return boolean
328 329
 	 */
329 330
 	public function load_lib ( $class_name, $arguments = array(), $load_only = FALSE ) {
330 331
 		$paths = array(
@@ -346,7 +347,7 @@  discard block
 block discarded – undo
346 347
 	 * @param string $class_name - simple class name ie: price
347 348
 	 * @param mixed  $arguments
348 349
 	 * @param bool   $load_only
349
-	 * @return EEM_Base
350
+	 * @return boolean
350 351
 	 */
351 352
 	public function load_model ( $class_name, $arguments = array(), $load_only = FALSE ) {
352 353
 		$paths = apply_filters('FHEE__EE_Registry__load_model__paths',array(
@@ -365,7 +366,7 @@  discard block
 block discarded – undo
365 366
 	 * @param string $class_name - simple class name ie: price
366 367
 	 * @param mixed  $arguments
367 368
 	 * @param bool   $load_only
368
-	 * @return mixed
369
+	 * @return boolean
369 370
 	 */
370 371
 	public function load_model_class ( $class_name, $arguments = array(), $load_only = TRUE ) {
371 372
 		$paths = array(
@@ -401,7 +402,7 @@  discard block
 block discarded – undo
401 402
 	 * @param string $type         - file type - core? class? helper? model?
402 403
 	 * @param mixed  $arguments
403 404
 	 * @param bool   $load_only
404
-	 * @return mixed
405
+	 * @return boolean
405 406
 	 */
406 407
 	public function load_file ( $path_to_file, $file_name, $type = '', $arguments = array(), $load_only = TRUE ) {
407 408
 		// retrieve instantiated class
@@ -418,7 +419,7 @@  discard block
 block discarded – undo
418 419
 	 * @param string $type         - file type - core? class? helper? model?
419 420
 	 * @param mixed  $arguments
420 421
 	 * @param bool   $load_only
421
-	 * @return EE_Addon
422
+	 * @return boolean
422 423
 	 */
423 424
 	public function load_addon ( $path_to_file, $class_name, $type = 'class', $arguments = array(), $load_only = FALSE ) {
424 425
 		// retrieve instantiated class
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -90,7 +90,7 @@
 block discarded – undo
90 90
 		//so in case teh IPN is arriving later, let's try to process an IPN!
91 91
 		if($_SERVER['REQUEST_METHOD'] == 'POST'){
92 92
 			return $this->handle_ipn($_POST, $transaction );
93
-		}else{
93
+		} else{
94 94
 			return parent::finalize_payment_for( $transaction );
95 95
 		}
96 96
 	}
Please login to merge, or discard this patch.
Spacing   +119 added lines, -119 removed lines patch added patch discarded remove patch
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
 	 */
157 157
 	public static function instance() {
158 158
 		// check if class object is instantiated
159
-		if ( self::$_instance === NULL  or ! is_object( self::$_instance ) or ! ( self::$_instance instanceof EE_Registry )) {
159
+		if (self::$_instance === NULL or ! is_object(self::$_instance) or ! (self::$_instance instanceof EE_Registry)) {
160 160
 			self::$_instance = new self();
161 161
 		}
162 162
 		return self::$_instance;
@@ -171,14 +171,14 @@  discard block
 block discarded – undo
171 171
 	 * @return EE_Registry
172 172
 	 */
173 173
 	private function __construct() {
174
-		$this->load_core( 'Base' );
174
+		$this->load_core('Base');
175 175
 		// class library
176 176
 		$this->LIB = new StdClass();
177 177
 		$this->addons = new StdClass();
178 178
 		$this->modules = new StdClass();
179 179
 		$this->shortcodes = new StdClass();
180 180
 		$this->widgets = new StdClass();
181
-		add_action( 'AHEE__EE_System__set_hooks_for_core', array( $this, 'init' ));
181
+		add_action('AHEE__EE_System__set_hooks_for_core', array($this, 'init'));
182 182
 	}
183 183
 
184 184
 
@@ -191,10 +191,10 @@  discard block
 block discarded – undo
191 191
 	 */
192 192
 	public function init() {
193 193
 		// Get current page protocol
194
-		$protocol = isset( $_SERVER['HTTPS'] ) ? 'https://' : 'http://';
194
+		$protocol = isset($_SERVER['HTTPS']) ? 'https://' : 'http://';
195 195
 		// Output admin-ajax.php URL with same protocol as current page
196
-		self::$i18n_js_strings['ajax_url'] = admin_url( 'admin-ajax.php', $protocol );
197
-		self::$i18n_js_strings['wp_debug'] = defined( 'WP_DEBUG' ) ? WP_DEBUG : FALSE;
196
+		self::$i18n_js_strings['ajax_url'] = admin_url('admin-ajax.php', $protocol);
197
+		self::$i18n_js_strings['wp_debug'] = defined('WP_DEBUG') ? WP_DEBUG : FALSE;
198 198
 	}
199 199
 
200 200
 
@@ -205,14 +205,14 @@  discard block
 block discarded – undo
205 205
 	 * @return string
206 206
 	 */
207 207
 	public static function localize_i18n_js_strings() {
208
-		$i18n_js_strings = (array)EE_Registry::$i18n_js_strings;
209
-		foreach ( $i18n_js_strings as $key => $value ) {
210
-			if ( is_scalar( $value ) ) {
211
-				$i18n_js_strings[ $key ] = html_entity_decode( (string)$value, ENT_QUOTES, 'UTF-8' );
208
+		$i18n_js_strings = (array) EE_Registry::$i18n_js_strings;
209
+		foreach ($i18n_js_strings as $key => $value) {
210
+			if (is_scalar($value)) {
211
+				$i18n_js_strings[$key] = html_entity_decode((string) $value, ENT_QUOTES, 'UTF-8');
212 212
 			}
213 213
 		}
214 214
 
215
-		return "/* <![CDATA[ */ var eei18n = " . wp_json_encode( $i18n_js_strings ) . '; /* ]]> */';
215
+		return "/* <![CDATA[ */ var eei18n = ".wp_json_encode($i18n_js_strings).'; /* ]]> */';
216 216
 	}
217 217
 
218 218
 
@@ -220,15 +220,15 @@  discard block
 block discarded – undo
220 220
 	/**
221 221
 	 * @param mixed string | EED_Module $module
222 222
 	 */
223
-	public function add_module( $module ) {
224
-		if ( $module instanceof EED_Module ) {
225
-			$module_class = get_class( $module );
223
+	public function add_module($module) {
224
+		if ($module instanceof EED_Module) {
225
+			$module_class = get_class($module);
226 226
 			$this->modules->{$module_class} = $module;
227 227
 		} else {
228
-			if ( ! class_exists( 'EE_Module_Request_Router' )) {
229
-				$this->load_core( 'Module_Request_Router' );
228
+			if ( ! class_exists('EE_Module_Request_Router')) {
229
+				$this->load_core('Module_Request_Router');
230 230
 			}
231
-			$this->modules->{$module} = EE_Module_Request_Router::module_factory( $module );
231
+			$this->modules->{$module} = EE_Module_Request_Router::module_factory($module);
232 232
 		}
233 233
 	}
234 234
 
@@ -238,8 +238,8 @@  discard block
 block discarded – undo
238 238
 	 * @param string $module_name
239 239
 	 * @return mixed EED_Module | NULL
240 240
 	 */
241
-	public function get_module( $module_name = '' ) {
242
-		return isset( $this->modules->{$module_name} ) ? $this->modules->{$module_name} : NULL;
241
+	public function get_module($module_name = '') {
242
+		return isset($this->modules->{$module_name} ) ? $this->modules->{$module_name} : NULL;
243 243
 	}
244 244
 
245 245
 
@@ -252,18 +252,18 @@  discard block
 block discarded – undo
252 252
 	 * @param bool   $load_only
253 253
 	 * @return mixed
254 254
 	 */
255
-	public function load_core ( $class_name, $arguments = array(), $load_only = FALSE ) {
255
+	public function load_core($class_name, $arguments = array(), $load_only = FALSE) {
256 256
 		$core_paths = apply_filters(
257 257
 			'FHEE__EE_Registry__load_core__core_paths',
258 258
 			array(
259 259
 				EE_CORE,
260 260
 				EE_ADMIN,
261 261
 				EE_CPTS,
262
-				EE_CORE . 'data_migration_scripts' . DS
262
+				EE_CORE.'data_migration_scripts'.DS
263 263
 			)
264 264
 		);
265 265
 		// retrieve instantiated class
266
-		return $this->_load( $core_paths, 'EE_' , $class_name, 'core', $arguments, FALSE, TRUE, $load_only );
266
+		return $this->_load($core_paths, 'EE_', $class_name, 'core', $arguments, FALSE, TRUE, $load_only);
267 267
 	}
268 268
 
269 269
 
@@ -276,9 +276,9 @@  discard block
 block discarded – undo
276 276
 	 * @param mixed  $arguments
277 277
 	 * @return EE_Data_Migration_Script_Base
278 278
 	 */
279
-	public function load_dms ( $class_name, $arguments = array() ) {
279
+	public function load_dms($class_name, $arguments = array()) {
280 280
 		// retrieve instantiated class
281
-		return $this->_load( EE_Data_Migration_Manager::instance()->get_data_migration_script_folders(), 'EE_DMS_' , $class_name, 'dms', $arguments, FALSE, FALSE, FALSE );
281
+		return $this->_load(EE_Data_Migration_Manager::instance()->get_data_migration_script_folders(), 'EE_DMS_', $class_name, 'dms', $arguments, FALSE, FALSE, FALSE);
282 282
 	}
283 283
 
284 284
 
@@ -293,14 +293,14 @@  discard block
 block discarded – undo
293 293
 	 *	@param bool   $load_only      whether or not to just load the file and NOT instantiate, or load AND instantiate (default)
294 294
 	 *	@return EE_Base_Class
295 295
 	 */
296
-	public function load_class ( $class_name, $arguments = array(), $from_db = FALSE, $cache = TRUE, $load_only = FALSE ) {
297
-		$paths = apply_filters('FHEE__EE_Registry__load_class__paths',array(
296
+	public function load_class($class_name, $arguments = array(), $from_db = FALSE, $cache = TRUE, $load_only = FALSE) {
297
+		$paths = apply_filters('FHEE__EE_Registry__load_class__paths', array(
298 298
 			EE_CORE,
299 299
 			EE_CLASSES,
300 300
 			EE_BUSINESS
301 301
 		));
302 302
 		// retrieve instantiated class
303
-		return $this->_load( $paths, 'EE_' , $class_name, 'class', $arguments, $from_db, $cache, $load_only );
303
+		return $this->_load($paths, 'EE_', $class_name, 'class', $arguments, $from_db, $cache, $load_only);
304 304
 	}
305 305
 
306 306
 
@@ -314,10 +314,10 @@  discard block
 block discarded – undo
314 314
 	 * @param bool   $load_only
315 315
 	 * @return EEH_Base
316 316
 	 */
317
-	public function load_helper ( $class_name, $arguments = array(), $load_only = TRUE ) {
318
-		$helper_paths = apply_filters( 'FHEE__EE_Registry__load_helper__helper_paths', array(EE_HELPERS ) );
317
+	public function load_helper($class_name, $arguments = array(), $load_only = TRUE) {
318
+		$helper_paths = apply_filters('FHEE__EE_Registry__load_helper__helper_paths', array(EE_HELPERS));
319 319
 		// retrieve instantiated class
320
-		return $this->_load( $helper_paths, 'EEH_', $class_name, 'helper', $arguments, FALSE, TRUE, $load_only );
320
+		return $this->_load($helper_paths, 'EEH_', $class_name, 'helper', $arguments, FALSE, TRUE, $load_only);
321 321
 	}
322 322
 
323 323
 
@@ -331,16 +331,16 @@  discard block
 block discarded – undo
331 331
 	 * @param bool   $load_only
332 332
 	 * @return mixed
333 333
 	 */
334
-	public function load_lib ( $class_name, $arguments = array(), $load_only = FALSE ) {
334
+	public function load_lib($class_name, $arguments = array(), $load_only = FALSE) {
335 335
 		$paths = array(
336 336
 			EE_LIBRARIES,
337
-			EE_LIBRARIES . 'messages' . DS,
338
-			EE_LIBRARIES . 'shortcodes' . DS,
339
-			EE_LIBRARIES . 'qtips' . DS,
340
-			EE_LIBRARIES . 'payment_methods' . DS,
337
+			EE_LIBRARIES.'messages'.DS,
338
+			EE_LIBRARIES.'shortcodes'.DS,
339
+			EE_LIBRARIES.'qtips'.DS,
340
+			EE_LIBRARIES.'payment_methods'.DS,
341 341
 		);
342 342
 		// retrieve instantiated class
343
-		return $this->_load( $paths, 'EE_' , $class_name, 'lib', $arguments, FALSE, TRUE, $load_only );
343
+		return $this->_load($paths, 'EE_', $class_name, 'lib', $arguments, FALSE, TRUE, $load_only);
344 344
 	}
345 345
 
346 346
 
@@ -353,13 +353,13 @@  discard block
 block discarded – undo
353 353
 	 * @param bool   $load_only
354 354
 	 * @return EEM_Base
355 355
 	 */
356
-	public function load_model ( $class_name, $arguments = array(), $load_only = FALSE ) {
357
-		$paths = apply_filters('FHEE__EE_Registry__load_model__paths',array(
356
+	public function load_model($class_name, $arguments = array(), $load_only = FALSE) {
357
+		$paths = apply_filters('FHEE__EE_Registry__load_model__paths', array(
358 358
 			EE_MODELS,
359 359
 			EE_CORE
360 360
 		));
361 361
 		// retrieve instantiated class
362
-		return $this->_load( $paths, 'EEM_' , $class_name, 'model', $arguments, FALSE, TRUE, $load_only );
362
+		return $this->_load($paths, 'EEM_', $class_name, 'model', $arguments, FALSE, TRUE, $load_only);
363 363
 	}
364 364
 
365 365
 
@@ -372,15 +372,15 @@  discard block
 block discarded – undo
372 372
 	 * @param bool   $load_only
373 373
 	 * @return mixed
374 374
 	 */
375
-	public function load_model_class ( $class_name, $arguments = array(), $load_only = TRUE ) {
375
+	public function load_model_class($class_name, $arguments = array(), $load_only = TRUE) {
376 376
 		$paths = array(
377
-			EE_MODELS . 'fields' . DS,
378
-			EE_MODELS . 'helpers' . DS,
379
-			EE_MODELS . 'relations' . DS,
380
-			EE_MODELS . 'strategies' . DS
377
+			EE_MODELS.'fields'.DS,
378
+			EE_MODELS.'helpers'.DS,
379
+			EE_MODELS.'relations'.DS,
380
+			EE_MODELS.'strategies'.DS
381 381
 		);
382 382
 		// retrieve instantiated class
383
-		return $this->_load( $paths, 'EE_' , $class_name, '', $arguments, FALSE, TRUE, $load_only );
383
+		return $this->_load($paths, 'EE_', $class_name, '', $arguments, FALSE, TRUE, $load_only);
384 384
 	}
385 385
 
386 386
 
@@ -392,8 +392,8 @@  discard block
 block discarded – undo
392 392
 	 * @param string $model_name like Event, Attendee, Question_Group_Question, etc.
393 393
 	 * @return boolean
394 394
 	 */
395
-	public function is_model_name( $model_name ){
396
-		return isset( $this->models[ $model_name ] ) ? TRUE : FALSE;
395
+	public function is_model_name($model_name) {
396
+		return isset($this->models[$model_name]) ? TRUE : FALSE;
397 397
 	}
398 398
 
399 399
 
@@ -408,9 +408,9 @@  discard block
 block discarded – undo
408 408
 	 * @param bool   $load_only
409 409
 	 * @return mixed
410 410
 	 */
411
-	public function load_file ( $path_to_file, $file_name, $type = '', $arguments = array(), $load_only = TRUE ) {
411
+	public function load_file($path_to_file, $file_name, $type = '', $arguments = array(), $load_only = TRUE) {
412 412
 		// retrieve instantiated class
413
-		return $this->_load( $path_to_file, '', $file_name, $type, $arguments, FALSE, TRUE, $load_only );
413
+		return $this->_load($path_to_file, '', $file_name, $type, $arguments, FALSE, TRUE, $load_only);
414 414
 	}
415 415
 
416 416
 
@@ -425,9 +425,9 @@  discard block
 block discarded – undo
425 425
 	 * @param bool   $load_only
426 426
 	 * @return EE_Addon
427 427
 	 */
428
-	public function load_addon ( $path_to_file, $class_name, $type = 'class', $arguments = array(), $load_only = FALSE ) {
428
+	public function load_addon($path_to_file, $class_name, $type = 'class', $arguments = array(), $load_only = FALSE) {
429 429
 		// retrieve instantiated class
430
-		return $this->_load( $path_to_file, 'addon', $class_name, $type, $arguments, FALSE, TRUE, $load_only );
430
+		return $this->_load($path_to_file, 'addon', $class_name, $type, $arguments, FALSE, TRUE, $load_only);
431 431
 	}
432 432
 
433 433
 
@@ -445,15 +445,15 @@  discard block
 block discarded – undo
445 445
 	 * @internal param string $file_path - file path including file name
446 446
 	 * @return bool | object
447 447
 	 */
448
-	private function _load ( $file_paths = array(), $class_prefix = 'EE_', $class_name = FALSE, $type = 'class', $arguments = array(), $from_db = FALSE, $cache = TRUE, $load_only = FALSE ) {
448
+	private function _load($file_paths = array(), $class_prefix = 'EE_', $class_name = FALSE, $type = 'class', $arguments = array(), $from_db = FALSE, $cache = TRUE, $load_only = FALSE) {
449 449
 		// strip php file extension
450
-		$class_name = str_replace( '.php', '', trim( $class_name ));
450
+		$class_name = str_replace('.php', '', trim($class_name));
451 451
 		// does the class have a prefix ?
452
-		if ( ! empty( $class_prefix ) && $class_prefix != 'addon' ) {
452
+		if ( ! empty($class_prefix) && $class_prefix != 'addon') {
453 453
 			// make sure $class_prefix is uppercase
454
-			$class_prefix = strtoupper( trim( $class_prefix ));
454
+			$class_prefix = strtoupper(trim($class_prefix));
455 455
 			// add class prefix ONCE!!!
456
-			$class_name = $class_prefix . str_replace( $class_prefix, '', $class_name );
456
+			$class_name = $class_prefix.str_replace($class_prefix, '', $class_name);
457 457
 		}
458 458
 
459 459
 		$class_abbreviations = array(
@@ -466,56 +466,56 @@  discard block
 block discarded – undo
466 466
 		);
467 467
 
468 468
 		// check if class has already been loaded, and return it if it has been
469
-		if ( isset( $class_abbreviations[ $class_name ] ) && ! is_null( $this->$class_abbreviations[ $class_name ] )) {
470
-			return $this->$class_abbreviations[ $class_name ];
471
-		} else if ( isset ( $this->{$class_name} )) {
469
+		if (isset($class_abbreviations[$class_name]) && ! is_null($this->$class_abbreviations[$class_name])) {
470
+			return $this->$class_abbreviations[$class_name];
471
+		} else if (isset ($this->{$class_name} )) {
472 472
 			return $this->{$class_name};
473
-		} else if ( isset ( $this->LIB->$class_name )) {
473
+		} else if (isset ($this->LIB->$class_name)) {
474 474
 			return $this->LIB->$class_name;
475
-		} else if ( $class_prefix == 'addon' && isset ( $this->addons->$class_name )) {
475
+		} else if ($class_prefix == 'addon' && isset ($this->addons->$class_name)) {
476 476
 			return $this->addons->$class_name;
477 477
 		}
478 478
 
479 479
 		// assume all paths lead nowhere
480 480
 		$path = FALSE;
481 481
 		// make sure $file_paths is an array
482
-		$file_paths = is_array( $file_paths ) ? $file_paths : array( $file_paths );
482
+		$file_paths = is_array($file_paths) ? $file_paths : array($file_paths);
483 483
 		// cycle thru paths
484
-		foreach ( $file_paths as $key => $file_path ) {
484
+		foreach ($file_paths as $key => $file_path) {
485 485
 			// convert all separators to proper DS, if no filepath, then use EE_CLASSES
486
-			$file_path = $file_path ? str_replace( array( '/', '\\' ), DS, $file_path ) : EE_CLASSES;
486
+			$file_path = $file_path ? str_replace(array('/', '\\'), DS, $file_path) : EE_CLASSES;
487 487
 			// prep file type
488
-			$type = ! empty( $type ) ? trim( $type, '.' ) . '.' : '';
488
+			$type = ! empty($type) ? trim($type, '.').'.' : '';
489 489
 			// build full file path
490
-			$file_paths[ $key ] = rtrim( $file_path, DS ) . DS . $class_name . '.' . $type . 'php';
490
+			$file_paths[$key] = rtrim($file_path, DS).DS.$class_name.'.'.$type.'php';
491 491
 			//does the file exist and can be read ?
492
-			if ( is_readable( $file_paths[ $key ] )) {
493
-				$path = $file_paths[ $key ];
492
+			if (is_readable($file_paths[$key])) {
493
+				$path = $file_paths[$key];
494 494
 				break;
495 495
 			}
496 496
 		}
497 497
 		// don't give up! you gotta...
498 498
 		try {
499 499
 			//does the file exist and can it be read ?
500
-			if ( ! $path ) {
500
+			if ( ! $path) {
501 501
 				// so sorry, can't find the file
502
-				throw new EE_Error (
503
-					sprintf (
504
-						__('The %1$s file %2$s could not be located or is not readable due to file permissions. Please ensure that the following filepath(s) are correct: %3$s','event_espresso'),
505
-						trim( $type, '.' ),
502
+				throw new EE_Error(
503
+					sprintf(
504
+						__('The %1$s file %2$s could not be located or is not readable due to file permissions. Please ensure that the following filepath(s) are correct: %3$s', 'event_espresso'),
505
+						trim($type, '.'),
506 506
 						$class_name,
507
-						'<br />' . implode( ',<br />', $file_paths )
507
+						'<br />'.implode(',<br />', $file_paths)
508 508
 					)
509 509
 				);
510 510
 			}
511 511
 			// get the file
512
-			require_once( $path );
512
+			require_once($path);
513 513
 			// if the class isn't already declared somewhere
514
-			if ( class_exists( $class_name, FALSE ) === FALSE ) {
514
+			if (class_exists($class_name, FALSE) === FALSE) {
515 515
 				// so sorry, not a class
516 516
 				throw new EE_Error(
517 517
 					sprintf(
518
-						__('The %s file %s does not appear to contain the %s Class.','event_espresso'),
518
+						__('The %s file %s does not appear to contain the %s Class.', 'event_espresso'),
519 519
 						$type,
520 520
 						$path,
521 521
 						$class_name
@@ -523,7 +523,7 @@  discard block
 block discarded – undo
523 523
 				);
524 524
 			}
525 525
 
526
-		} catch ( EE_Error $e ) {
526
+		} catch (EE_Error $e) {
527 527
 			$e->get_error();
528 528
 		}
529 529
 
@@ -531,38 +531,38 @@  discard block
 block discarded – undo
531 531
 		// don't give up! you gotta...
532 532
 		try {
533 533
 			// create reflection
534
-			$reflector = new ReflectionClass( $class_name );
534
+			$reflector = new ReflectionClass($class_name);
535 535
 			// instantiate the class and add to the LIB array for tracking
536 536
 			// EE_Base_Classes are instantiated via new_instance by default (models call them via new_instance_from_db)
537
-			if ( $reflector->getConstructor() === NULL || $reflector->isAbstract() || $load_only ) {
537
+			if ($reflector->getConstructor() === NULL || $reflector->isAbstract() || $load_only) {
538 538
 //				$instantiation_mode = 0;
539 539
 				// no constructor = static methods only... nothing to instantiate, loading file was enough
540 540
 				return TRUE;
541
-			} else if ( $from_db && method_exists( $class_name, 'new_instance_from_db' ) ) {
541
+			} else if ($from_db && method_exists($class_name, 'new_instance_from_db')) {
542 542
 //				$instantiation_mode = 1;
543
-				$class_obj =  call_user_func_array( array( $class_name, 'new_instance_from_db' ), $arguments );
544
-			} else if ( method_exists( $class_name, 'new_instance' ) ) {
543
+				$class_obj = call_user_func_array(array($class_name, 'new_instance_from_db'), $arguments);
544
+			} else if (method_exists($class_name, 'new_instance')) {
545 545
 //				$instantiation_mode = 2;
546
-				$class_obj =  call_user_func_array( array( $class_name, 'new_instance' ), $arguments );
547
-			} else if ( method_exists( $class_name, 'instance' )) {
546
+				$class_obj = call_user_func_array(array($class_name, 'new_instance'), $arguments);
547
+			} else if (method_exists($class_name, 'instance')) {
548 548
 //				$instantiation_mode = 3;
549
-				$class_obj =  call_user_func_array( array( $class_name, 'instance' ), $arguments );
550
-			} else if ( $reflector->isInstantiable() ) {
549
+				$class_obj = call_user_func_array(array($class_name, 'instance'), $arguments);
550
+			} else if ($reflector->isInstantiable()) {
551 551
 //				$instantiation_mode = 4;
552
-				$class_obj =  $reflector->newInstance( $arguments );
553
-			} else if ( ! $load_only ) {
552
+				$class_obj = $reflector->newInstance($arguments);
553
+			} else if ( ! $load_only) {
554 554
 				// heh ? something's not right !
555 555
 //				$instantiation_mode = 5;
556 556
 				throw new EE_Error(
557 557
 					sprintf(
558
-						__('The %s file %s could not be instantiated.','event_espresso'),
558
+						__('The %s file %s could not be instantiated.', 'event_espresso'),
559 559
 						$type,
560 560
 						$class_name
561 561
 					)
562 562
 				);
563 563
 			}
564 564
 
565
-		} catch ( EE_Error $e ) {
565
+		} catch (EE_Error $e) {
566 566
 			$e->get_error();
567 567
 		}
568 568
 
@@ -574,15 +574,15 @@  discard block
 block discarded – undo
574 574
 //	EEH_Debug_Tools::printr( $class_obj, '$class_obj  <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span>', 'auto' );
575 575
 
576 576
 
577
-		if ( isset( $class_obj )) {
577
+		if (isset($class_obj)) {
578 578
 			// return newly instantiated class
579
-			if ( isset( $class_abbreviations[ $class_name ] )) {
580
-				$this->$class_abbreviations[ $class_name ] = $class_obj;
581
-			} else if ( EEH_Class_Tools::has_property( $this, $class_name )) {
579
+			if (isset($class_abbreviations[$class_name])) {
580
+				$this->$class_abbreviations[$class_name] = $class_obj;
581
+			} else if (EEH_Class_Tools::has_property($this, $class_name)) {
582 582
 				$this->{$class_name} = $class_obj;
583
-			} else if ( $class_prefix == 'addon' && $cache  ) {
583
+			} else if ($class_prefix == 'addon' && $cache) {
584 584
 				$this->addons->$class_name = $class_obj;
585
-			} else if ( !$from_db && $cache  ) {
585
+			} else if ( ! $from_db && $cache) {
586 586
 				$this->LIB->$class_name = $class_obj;
587 587
 			}
588 588
 			return $class_obj;
@@ -607,7 +607,7 @@  discard block
 block discarded – undo
607 607
 	 * @param $a
608 608
 	 * @param $b
609 609
 	 */
610
-	final function __call($a,$b) {}
610
+	final function __call($a, $b) {}
611 611
 
612 612
 
613 613
 
@@ -622,7 +622,7 @@  discard block
 block discarded – undo
622 622
 	 * @param $a
623 623
 	 * @param $b
624 624
 	 */
625
-	final function __set($a,$b) {}
625
+	final function __set($a, $b) {}
626 626
 
627 627
 
628 628
 
@@ -662,7 +662,7 @@  discard block
 block discarded – undo
662 662
 	 * @param $a
663 663
 	 * @param $b
664 664
 	 */
665
-	final static function __callStatic($a,$b) {}
665
+	final static function __callStatic($a, $b) {}
666 666
 
667 667
 	/**
668 668
 	 * Gets the addon by its name/slug (not classname. For that, just
@@ -670,9 +670,9 @@  discard block
 block discarded – undo
670 670
 	 * @param string $name
671 671
 	 * @return EE_Addon
672 672
 	 */
673
-	public function get_addon_by_name( $name ){
674
-		foreach($this->addons as $addon){
675
-			if( $addon->name() == $name){
673
+	public function get_addon_by_name($name) {
674
+		foreach ($this->addons as $addon) {
675
+			if ($addon->name() == $name) {
676 676
 				return $addon;
677 677
 			}
678 678
 		}
@@ -683,10 +683,10 @@  discard block
 block discarded – undo
683 683
 	 *
684 684
 	 * @return EE_Addon[] where the KEYS are the addon's name()
685 685
 	 */
686
-	public function get_addons_by_name(){
686
+	public function get_addons_by_name() {
687 687
 		$addons = array();
688
-		foreach($this->addons as $addon){
689
-			$addons[ $addon->name() ] = $addon;
688
+		foreach ($this->addons as $addon) {
689
+			$addons[$addon->name()] = $addon;
690 690
 		}
691 691
 		return $addons;
692 692
 	}
@@ -701,14 +701,14 @@  discard block
 block discarded – undo
701 701
 	 * @return EEM_Base
702 702
 	 * @throws EE_Error
703 703
 	 */
704
-	public function reset_model( $model_name ){
705
-		$model = $this->load_model( $model_name );
706
-		$model_class_name = get_class( $model );
704
+	public function reset_model($model_name) {
705
+		$model = $this->load_model($model_name);
706
+		$model_class_name = get_class($model);
707 707
 		//get that model reset it and make sure we nuke the old reference to it
708
-		if ( $model instanceof $model_class_name && is_callable( array( $model_class_name, 'reset' ))) {
708
+		if ($model instanceof $model_class_name && is_callable(array($model_class_name, 'reset'))) {
709 709
 			$this->LIB->$model_class_name = $model::reset();
710
-		}else{
711
-			throw new EE_Error( sprintf( __( 'Model %s does not have a method "reset"', 'event_espresso' ), $model_name ) );
710
+		} else {
711
+			throw new EE_Error(sprintf(__('Model %s does not have a method "reset"', 'event_espresso'), $model_name));
712 712
 		}
713 713
 		return $this->LIB->$model_class_name;
714 714
 	}
@@ -724,15 +724,15 @@  discard block
 block discarded – undo
724 724
 	 * currently reinstantiate the singletons at the moment)
725 725
 	 * @return EE_Registry
726 726
 	 */
727
-	public static function reset( $hard = FALSE, $reinstantiate = TRUE ){
727
+	public static function reset($hard = FALSE, $reinstantiate = TRUE) {
728 728
 		$instance = self::instance();
729 729
 		$instance->load_helper('Activation');
730 730
 		EEH_Activation::reset();
731
-		$instance->CFG = EE_Config::reset( $hard, $reinstantiate );
731
+		$instance->CFG = EE_Config::reset($hard, $reinstantiate);
732 732
 		$instance->LIB->EE_Data_Migration_Manager = EE_Data_Migration_Manager::reset();
733 733
 		$instance->LIB = new stdClass();
734
-		foreach( array_keys( $instance->non_abstract_db_models ) as $model_name ){
735
-			$instance->reset_model( $model_name );
734
+		foreach (array_keys($instance->non_abstract_db_models) as $model_name) {
735
+			$instance->reset_model($model_name);
736 736
 		}
737 737
 		return $instance;
738 738
 	}
@@ -743,9 +743,9 @@  discard block
 block discarded – undo
743 743
 	 */
744 744
 	public function cpt_models() {
745 745
 		$cpt_models = array();
746
-		foreach( $this->non_abstract_db_models as $shortname => $classname ) {
747
-			if( is_subclass_of(  $classname, 'EEM_CPT_Base' ) ) {
748
-				$cpt_models[ $shortname ] = $classname;
746
+		foreach ($this->non_abstract_db_models as $shortname => $classname) {
747
+			if (is_subclass_of($classname, 'EEM_CPT_Base')) {
748
+				$cpt_models[$shortname] = $classname;
749 749
 			}
750 750
 		}
751 751
 		return $cpt_models;
Please login to merge, or discard this patch.
Indentation   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -11,25 +11,25 @@  discard block
 block discarded – undo
11 11
 final class EE_Registry {
12 12
 
13 13
 	/**
14
-	* 	EE_Registry Object
15
-	* 	@var EE_Registry $_instance
16
-	* 	@access 	private
17
-	*/
14
+	 * 	EE_Registry Object
15
+	 * 	@var EE_Registry $_instance
16
+	 * 	@access 	private
17
+	 */
18 18
 	private static $_instance = NULL;
19 19
 
20 20
 
21 21
 	/**
22
-	* 	EE_Cart Object
23
-	* 	@access 	public
24
-	*	@var 	EE_Cart $CART
25
-	*/
22
+	 * 	EE_Cart Object
23
+	 * 	@access 	public
24
+	 *	@var 	EE_Cart $CART
25
+	 */
26 26
 	public $CART = NULL;
27 27
 
28 28
 	/**
29
-	* 	EE_Config Object
30
-	* 	@access 	public
31
-	*	@var 	EE_Config $CFG
32
-	*/
29
+	 * 	EE_Config Object
30
+	 * 	@access 	public
31
+	 *	@var 	EE_Config $CFG
32
+	 */
33 33
 	public $CFG = NULL;
34 34
 
35 35
 
@@ -44,9 +44,9 @@  discard block
 block discarded – undo
44 44
 
45 45
 
46 46
 	/**
47
-	* 	StdClass object for storing library classes in
48
-	* 	@public LIB
49
-	*/
47
+	 * 	StdClass object for storing library classes in
48
+	 * 	@public LIB
49
+	 */
50 50
 	public $LIB = NULL;
51 51
 
52 52
 	/**
@@ -57,10 +57,10 @@  discard block
 block discarded – undo
57 57
 	public $REQ = NULL;
58 58
 
59 59
 	/**
60
-	* 	EE_Session Object
61
-	* 	@access 	public
62
-	* 	@var 	EE_Session	 $SSN
63
-	*/
60
+	 * 	EE_Session Object
61
+	 * 	@access 	public
62
+	 * 	@var 	EE_Session	 $SSN
63
+	 */
64 64
 	public $SSN = NULL;
65 65
 
66 66
 
@@ -127,21 +127,21 @@  discard block
 block discarded – undo
127 127
 
128 128
 
129 129
 	/**
130
-	* 	$i18n_js_strings - internationalization for JS strings
131
-	*  	usage:   EE_Registry::i18n_js_strings['string_key'] = __( 'string to translate.', 'event_espresso' );
132
-	*  	in js file:  var translatedString = eei18n.string_key;
133
-	*
134
-	* 	@access 	public
135
-	*	@var 	array
136
-	*/
130
+	 * 	$i18n_js_strings - internationalization for JS strings
131
+	 *  	usage:   EE_Registry::i18n_js_strings['string_key'] = __( 'string to translate.', 'event_espresso' );
132
+	 *  	in js file:  var translatedString = eei18n.string_key;
133
+	 *
134
+	 * 	@access 	public
135
+	 *	@var 	array
136
+	 */
137 137
 	public static $i18n_js_strings = array();
138 138
 
139 139
 	/**
140
-	* 	$main_file - path to espresso.php
141
-	*
142
-	* 	@access 	public
143
-	*	@var 	array
144
-	*/
140
+	 * 	$main_file - path to espresso.php
141
+	 *
142
+	 * 	@access 	public
143
+	 *	@var 	array
144
+	 */
145 145
 	public $main_file;
146 146
 
147 147
 
Please login to merge, or discard this patch.
core/EE_Request_Handler.core.php 3 patches
Doc Comments   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -271,7 +271,7 @@  discard block
 block discarded – undo
271 271
 	 *    is_espresso_page
272 272
 	 *
273 273
 	 * @access    public
274
-	 * @param null $value
274
+	 * @param boolean $value
275 275
 	 * @return    mixed
276 276
 	 */
277 277
 	public function set_espresso_page( $value = null ) {
@@ -307,7 +307,7 @@  discard block
 block discarded – undo
307 307
 	 *    setter
308 308
 	 *
309 309
 	 * @access    public
310
-	 * @param      $key
310
+	 * @param      string $key
311 311
 	 * @param      $value
312 312
 	 * @param bool $override_ee
313 313
 	 * @return    void
@@ -352,7 +352,7 @@  discard block
 block discarded – undo
352 352
 	 *    remove param
353 353
 	 *
354 354
 	 * @access    public
355
-	 * @param $key
355
+	 * @param string $key
356 356
 	 * @return    void
357 357
 	 */
358 358
 	public function un_set( $key ) {
@@ -392,7 +392,7 @@  discard block
 block discarded – undo
392 392
 	 *    add_output
393 393
 	 *
394 394
 	 * @access    public
395
-	 * @param $string
395
+	 * @param string $string
396 396
 	 * @return    void
397 397
 	 */
398 398
 	public function add_output( $string ) {
Please login to merge, or discard this patch.
Spacing   +76 added lines, -76 removed lines patch added patch discarded remove patch
@@ -65,18 +65,18 @@  discard block
 block discarded – undo
65 65
 	 * @param WP $wp
66 66
 	 * @return \EE_Request_Handler
67 67
 	 */
68
-	public function __construct( $wp = null ) {
68
+	public function __construct($wp = null) {
69 69
 		//if somebody forgot to provide us with WP, that's ok because its global
70
-		if ( ! $wp instanceof WP ){
70
+		if ( ! $wp instanceof WP) {
71 71
 			global $wp;
72 72
 		}
73 73
 		// grab request vars
74 74
 		$this->_params = $_REQUEST;
75 75
 		// AJAX ???
76
-		$this->ajax = defined( 'DOING_AJAX' ) ? true : false;
77
-		$this->front_ajax = $this->is_set( 'ee_front_ajax' ) && $this->get( 'ee_front_ajax' ) == 1 ? true : false;
78
-		$this->set_request_vars( $wp );
79
-		do_action( 'AHEE__EE_Request_Handler__construct__complete' );
76
+		$this->ajax = defined('DOING_AJAX') ? true : false;
77
+		$this->front_ajax = $this->is_set('ee_front_ajax') && $this->get('ee_front_ajax') == 1 ? true : false;
78
+		$this->set_request_vars($wp);
79
+		do_action('AHEE__EE_Request_Handler__construct__complete');
80 80
 	}
81 81
 
82 82
 
@@ -88,14 +88,14 @@  discard block
 block discarded – undo
88 88
 	 * @param WP $wp
89 89
 	 * @return void
90 90
 	 */
91
-	public function set_request_vars( $wp = null ) {
92
-		if ( ! is_admin() ) {
91
+	public function set_request_vars($wp = null) {
92
+		if ( ! is_admin()) {
93 93
 			// set request post_id
94
-			$this->set( 'post_id', $this->get_post_id_from_request( $wp ));
94
+			$this->set('post_id', $this->get_post_id_from_request($wp));
95 95
 			// set request post name
96
-			$this->set( 'post_name', $this->get_post_name_from_request( $wp ));
96
+			$this->set('post_name', $this->get_post_name_from_request($wp));
97 97
 			// set request post_type
98
-			$this->set( 'post_type', $this->get_post_type_from_request( $wp ));
98
+			$this->set('post_type', $this->get_post_type_from_request($wp));
99 99
 			// true or false ? is this page being used by EE ?
100 100
 			$this->set_espresso_page();
101 101
 		}
@@ -110,20 +110,20 @@  discard block
 block discarded – undo
110 110
 	 * @param WP $wp
111 111
 	 * @return int
112 112
 	 */
113
-	public function get_post_id_from_request( $wp = null ) {
114
-		if ( ! $wp instanceof WP ){
113
+	public function get_post_id_from_request($wp = null) {
114
+		if ( ! $wp instanceof WP) {
115 115
 			global $wp;
116 116
 		}
117 117
 		$post_id = null;
118
-		if ( isset( $wp->query_vars['p'] )) {
118
+		if (isset($wp->query_vars['p'])) {
119 119
 			$post_id = $wp->query_vars['p'];
120 120
 		}
121
-		if ( ! $post_id && isset( $wp->query_vars['page_id'] )) {
121
+		if ( ! $post_id && isset($wp->query_vars['page_id'])) {
122 122
 			$post_id = $wp->query_vars['page_id'];
123 123
 		}
124
-		if ( ! $post_id && isset( $wp->request )) {
125
-			if ( is_numeric( basename( $wp->request ))) {
126
-				$post_id = basename( $wp->request );
124
+		if ( ! $post_id && isset($wp->request)) {
125
+			if (is_numeric(basename($wp->request))) {
126
+				$post_id = basename($wp->request);
127 127
 			}
128 128
 		}
129 129
 		return $post_id;
@@ -138,35 +138,35 @@  discard block
 block discarded – undo
138 138
 	 * @param WP $wp
139 139
 	 * @return string
140 140
 	 */
141
-	public function get_post_name_from_request( $wp = null ) {
142
-		if ( ! $wp instanceof WP ){
141
+	public function get_post_name_from_request($wp = null) {
142
+		if ( ! $wp instanceof WP) {
143 143
 			global $wp;
144 144
 		}
145 145
 		$post_name = null;
146
-		if ( isset( $wp->query_vars['name'] ) && ! empty( $wp->query_vars['name'] )) {
146
+		if (isset($wp->query_vars['name']) && ! empty($wp->query_vars['name'])) {
147 147
 			$post_name = $wp->query_vars['name'];
148 148
 		}
149
-		if ( ! $post_name && isset( $wp->query_vars['pagename'] ) && ! empty( $wp->query_vars['pagename'] )) {
149
+		if ( ! $post_name && isset($wp->query_vars['pagename']) && ! empty($wp->query_vars['pagename'])) {
150 150
 			$post_name = $wp->query_vars['pagename'];
151 151
 		}
152
-		if ( ! $post_name && isset( $wp->request ) && ! empty( $wp->request )) {
153
-			$possible_post_name = basename( $wp->request );
154
-			if ( ! is_numeric( $possible_post_name )) {
152
+		if ( ! $post_name && isset($wp->request) && ! empty($wp->request)) {
153
+			$possible_post_name = basename($wp->request);
154
+			if ( ! is_numeric($possible_post_name)) {
155 155
 				/** @type WPDB $wpdb */
156 156
 				global $wpdb;
157 157
 				$SQL = "SELECT ID from $wpdb->posts WHERE post_status='publish' AND post_name=%s";
158
-				$possible_post_name = $wpdb->get_var( $wpdb->prepare( $SQL, $possible_post_name ));
159
-				if ( $possible_post_name ) {
158
+				$possible_post_name = $wpdb->get_var($wpdb->prepare($SQL, $possible_post_name));
159
+				if ($possible_post_name) {
160 160
 					$post_name = $possible_post_name;
161 161
 				}
162 162
 			}
163 163
 		}
164
-		if ( ! $post_name && $this->get( 'post_id' )) {
164
+		if ( ! $post_name && $this->get('post_id')) {
165 165
 			/** @type WPDB $wpdb */
166 166
 			global $wpdb;
167 167
 			$SQL = "SELECT post_name from $wpdb->posts WHERE post_status='publish' AND ID=%d";
168
-			$possible_post_name = $wpdb->get_var( $wpdb->prepare( $SQL, $this->get( 'post_id' )));
169
-			if( $possible_post_name ) {
168
+			$possible_post_name = $wpdb->get_var($wpdb->prepare($SQL, $this->get('post_id')));
169
+			if ($possible_post_name) {
170 170
 				$post_name = $possible_post_name;
171 171
 			}
172 172
 		}
@@ -182,11 +182,11 @@  discard block
 block discarded – undo
182 182
 	 * @param WP $wp
183 183
 	 * @return mixed
184 184
 	 */
185
-	public function get_post_type_from_request( $wp = null ) {
186
-		if ( ! $wp instanceof WP ){
185
+	public function get_post_type_from_request($wp = null) {
186
+		if ( ! $wp instanceof WP) {
187 187
 			global $wp;
188 188
 		}
189
-		return isset( $wp->query_vars['post_type'] ) ? $wp->query_vars['post_type'] : null;
189
+		return isset($wp->query_vars['post_type']) ? $wp->query_vars['post_type'] : null;
190 190
 	}
191 191
 
192 192
 
@@ -196,18 +196,18 @@  discard block
 block discarded – undo
196 196
 	 * @param  WP $wp
197 197
 	 * @return bool|string|void
198 198
 	 */
199
-	public function get_current_page_permalink( $wp = null ) {
200
-		$post_id = $this->get_post_id_from_request( $wp );
201
-		if ( $post_id ) {
202
-			$current_page_permalink = get_permalink( $post_id );
199
+	public function get_current_page_permalink($wp = null) {
200
+		$post_id = $this->get_post_id_from_request($wp);
201
+		if ($post_id) {
202
+			$current_page_permalink = get_permalink($post_id);
203 203
 		} else {
204
-			if ( ! $wp instanceof WP ) {
204
+			if ( ! $wp instanceof WP) {
205 205
 				global $wp;
206 206
 			}
207
-			if ( $wp->request ) {
208
-				$current_page_permalink = site_url( $wp->request );
207
+			if ($wp->request) {
208
+				$current_page_permalink = site_url($wp->request);
209 209
 			} else {
210
-				$current_page_permalink = esc_url( site_url( $_SERVER[ 'REQUEST_URI' ] ) );
210
+				$current_page_permalink = esc_url(site_url($_SERVER['REQUEST_URI']));
211 211
 			}
212 212
 		}
213 213
 		return $current_page_permalink;
@@ -224,41 +224,41 @@  discard block
 block discarded – undo
224 224
 	public function test_for_espresso_page() {
225 225
 		global $wp;
226 226
 		/** @type EE_CPT_Strategy $EE_CPT_Strategy */
227
-		$EE_CPT_Strategy = EE_Registry::instance()->load_core( 'CPT_Strategy' );
227
+		$EE_CPT_Strategy = EE_Registry::instance()->load_core('CPT_Strategy');
228 228
 		$espresso_CPT_taxonomies = $EE_CPT_Strategy->get_CPT_taxonomies();
229
-		if ( is_array( $espresso_CPT_taxonomies ) ) {
230
-			foreach ( $espresso_CPT_taxonomies as $espresso_CPT_taxonomy =>$details ) {
231
-				if ( isset( $wp->query_vars, $wp->query_vars[ $espresso_CPT_taxonomy ] ) ) {
229
+		if (is_array($espresso_CPT_taxonomies)) {
230
+			foreach ($espresso_CPT_taxonomies as $espresso_CPT_taxonomy =>$details) {
231
+				if (isset($wp->query_vars, $wp->query_vars[$espresso_CPT_taxonomy])) {
232 232
 					return true;
233 233
 				}
234 234
 			}
235 235
 		}
236 236
 		// load espresso CPT endpoints
237 237
 		$espresso_CPT_endpoints = $EE_CPT_Strategy->get_CPT_endpoints();
238
-		$post_type_CPT_endpoints = array_flip( $espresso_CPT_endpoints );
239
-		$post_types = (array)$this->get( 'post_type' );
240
-		foreach ( $post_types as $post_type ) {
238
+		$post_type_CPT_endpoints = array_flip($espresso_CPT_endpoints);
239
+		$post_types = (array) $this->get('post_type');
240
+		foreach ($post_types as $post_type) {
241 241
 			// was a post name passed ?
242
-			if ( isset( $post_type_CPT_endpoints[ $post_type ] ) ) {
242
+			if (isset($post_type_CPT_endpoints[$post_type])) {
243 243
 				// kk we know this is an espresso page, but is it a specific post ?
244
-				if ( ! $this->get( 'post_name' ) ) {
244
+				if ( ! $this->get('post_name')) {
245 245
 					// there's no specific post name set, so maybe it's one of our endpoints like www.domain.com/events
246
-					$post_name = isset( $post_type_CPT_endpoints[ $this->get( 'post_type' ) ] ) ? $post_type_CPT_endpoints[ $this->get( 'post_type' ) ] : null;
246
+					$post_name = isset($post_type_CPT_endpoints[$this->get('post_type')]) ? $post_type_CPT_endpoints[$this->get('post_type')] : null;
247 247
 					// if the post type matches on of our then set the endpoint
248
-					if ( $post_name ) {
249
-						$this->set( 'post_name', $post_name );
248
+					if ($post_name) {
249
+						$this->set('post_name', $post_name);
250 250
 					}
251 251
 				}
252 252
 				return true;
253 253
 			}
254 254
 		}
255
-		if ( $this->get( 'post_name' )) {
255
+		if ($this->get('post_name')) {
256 256
 			// load all pages using espresso shortcodes
257
-			$post_shortcodes = isset( EE_Registry::instance()->CFG->core->post_shortcodes ) ? EE_Registry::instance()->CFG->core->post_shortcodes : array();
257
+			$post_shortcodes = isset(EE_Registry::instance()->CFG->core->post_shortcodes) ? EE_Registry::instance()->CFG->core->post_shortcodes : array();
258 258
 			// make sure core pages are included
259
-			$espresso_pages = array_merge( $espresso_CPT_endpoints, $post_shortcodes );
259
+			$espresso_pages = array_merge($espresso_CPT_endpoints, $post_shortcodes);
260 260
 			// was a post name passed ?
261
-			if (  isset( $espresso_pages[ $this->get( 'post_name' ) ] )) {
261
+			if (isset($espresso_pages[$this->get('post_name')])) {
262 262
 				 return true;
263 263
 			}
264 264
 		}
@@ -274,7 +274,7 @@  discard block
 block discarded – undo
274 274
 	 * @param null $value
275 275
 	 * @return    mixed
276 276
 	 */
277
-	public function set_espresso_page( $value = null ) {
277
+	public function set_espresso_page($value = null) {
278 278
 		$value = $value ? $value : $this->test_for_espresso_page();
279 279
 		$this->_params['is_espresso_page'] = $value;
280 280
 	}
@@ -288,7 +288,7 @@  discard block
 block discarded – undo
288 288
 	 *  @return 	mixed
289 289
 	 */
290 290
 	public function is_espresso_page() {
291
-		return isset( $this->_params['is_espresso_page'] ) ? $this->_params['is_espresso_page'] : false;
291
+		return isset($this->_params['is_espresso_page']) ? $this->_params['is_espresso_page'] : false;
292 292
 	}
293 293
 
294 294
 
@@ -312,10 +312,10 @@  discard block
 block discarded – undo
312 312
 	 * @param bool $override_ee
313 313
 	 * @return    void
314 314
 	 */
315
-	public function set( $key, $value, $override_ee = false ) {
315
+	public function set($key, $value, $override_ee = false) {
316 316
 		// don't allow "ee" to be overwritten unless explicitly instructed to do so
317
-		if ( $key != 'ee' || ( $key == 'ee' && empty( $this->_params['ee'] )) || ( $key == 'ee' && ! empty( $this->_params['ee'] ) && $override_ee )) {
318
-			$this->_params[ $key ] = $value;
317
+		if ($key != 'ee' || ($key == 'ee' && empty($this->_params['ee'])) || ($key == 'ee' && ! empty($this->_params['ee']) && $override_ee)) {
318
+			$this->_params[$key] = $value;
319 319
 		}
320 320
 	}
321 321
 
@@ -329,8 +329,8 @@  discard block
 block discarded – undo
329 329
 	 * @param null $default
330 330
 	 * @return    mixed
331 331
 	 */
332
-	public function get( $key, $default = null ) {
333
-		return isset( $this->_params[ $key ] ) ? $this->_params[ $key ] : $default;
332
+	public function get($key, $default = null) {
333
+		return isset($this->_params[$key]) ? $this->_params[$key] : $default;
334 334
 	}
335 335
 
336 336
 
@@ -342,8 +342,8 @@  discard block
 block discarded – undo
342 342
 	 * @param $key
343 343
 	 * @return    boolean
344 344
 	 */
345
-	public function is_set( $key ) {
346
-		return isset( $this->_params[ $key ] ) ? true : false;
345
+	public function is_set($key) {
346
+		return isset($this->_params[$key]) ? true : false;
347 347
 	}
348 348
 
349 349
 
@@ -355,8 +355,8 @@  discard block
 block discarded – undo
355 355
 	 * @param $key
356 356
 	 * @return    void
357 357
 	 */
358
-	public function un_set( $key ) {
359
-		unset( $this->_params[ $key ] );
358
+	public function un_set($key) {
359
+		unset($this->_params[$key]);
360 360
 	}
361 361
 
362 362
 
@@ -369,8 +369,8 @@  discard block
 block discarded – undo
369 369
 	 * @param $value
370 370
 	 * @return    void
371 371
 	 */
372
-	public function set_notice( $key, $value ) {
373
-		$this->_notice[ $key ] = $value;
372
+	public function set_notice($key, $value) {
373
+		$this->_notice[$key] = $value;
374 374
 	}
375 375
 
376 376
 
@@ -382,8 +382,8 @@  discard block
 block discarded – undo
382 382
 	 * @param $key
383 383
 	 * @return    mixed
384 384
 	 */
385
-	public function get_notice( $key ) {
386
-		return isset( $this->_notice[ $key ] ) ? $this->_notice[ $key ] : null;
385
+	public function get_notice($key) {
386
+		return isset($this->_notice[$key]) ? $this->_notice[$key] : null;
387 387
 	}
388 388
 
389 389
 
@@ -395,7 +395,7 @@  discard block
 block discarded – undo
395 395
 	 * @param $string
396 396
 	 * @return    void
397 397
 	 */
398
-	public function add_output( $string ) {
398
+	public function add_output($string) {
399 399
 		$this->_output .= $string;
400 400
 	}
401 401
 
@@ -417,8 +417,8 @@  discard block
 block discarded – undo
417 417
 	 * @param $item
418 418
 	 * @param $key
419 419
 	 */
420
-	function sanitize_text_field_for_array_walk( &$item, &$key ) {
421
-		$item = strpos( $item, 'email' ) !== false ? sanitize_email( $item ) : sanitize_text_field( $item );
420
+	function sanitize_text_field_for_array_walk(&$item, &$key) {
421
+		$item = strpos($item, 'email') !== false ? sanitize_email($item) : sanitize_text_field($item);
422 422
 	}
423 423
 
424 424
 
@@ -428,7 +428,7 @@  discard block
 block discarded – undo
428 428
 	 * @param $b
429 429
 	 * @return bool
430 430
 	 */
431
-	public function __set($a,$b) { return false; }
431
+	public function __set($a, $b) { return false; }
432 432
 
433 433
 
434 434
 
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,4 +1,6 @@
 block discarded – undo
1
-<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) exit('No direct script access allowed');
1
+<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) {
2
+	exit('No direct script access allowed');
3
+}
2 4
 /**
3 5
  * Event Espresso
4 6
  *
Please login to merge, or discard this patch.
core/EE_Session.core.php 4 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.
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -137,11 +137,11 @@
 block discarded – undo
137 137
 
138 138
 
139 139
 	/**
140
-	* 	private constructor to prevent direct creation
141
-	* 	@Constructor
142
-	* 	@access private
143
-	* 	@return EE_Session
144
-	*/
140
+	 * 	private constructor to prevent direct creation
141
+	 * 	@Constructor
142
+	 * 	@access private
143
+	 * 	@return EE_Session
144
+	 */
145 145
 	private function __construct() {
146 146
 
147 147
 		// 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' );
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   +148 added lines, -148 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,
@@ -126,9 +126,9 @@  discard block
 block discarded – undo
126 126
 	 *		@access public
127 127
 	 *		@return EE_Session
128 128
 	 */
129
-	public static function instance ( ) {
129
+	public static function instance( ) {
130 130
 		// check if class object is instantiated
131
-		if ( ! self::$_instance instanceof EE_Session ) {
131
+		if ( ! self::$_instance instanceof EE_Session) {
132 132
 			self::$_instance = new self();
133 133
 		}
134 134
 		return self::$_instance;
@@ -145,11 +145,11 @@  discard block
 block discarded – undo
145 145
 	private function __construct() {
146 146
 
147 147
 		// 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' );
148
-		if ( ! apply_filters( 'FHEE_load_EE_Session', TRUE ) ) {
148
+		if ( ! apply_filters('FHEE_load_EE_Session', TRUE)) {
149 149
 			return NULL;
150 150
 		}
151
-		do_action( 'AHEE_log', __CLASS__, __FUNCTION__, '' );
152
-		define( 'ESPRESSO_SESSION', TRUE );
151
+		do_action('AHEE_log', __CLASS__, __FUNCTION__, '');
152
+		define('ESPRESSO_SESSION', TRUE);
153 153
 		// default session lifespan in seconds
154 154
 		$this->_lifespan = apply_filters(
155 155
 			'FHEE__EE_Session__construct___lifespan',
@@ -162,35 +162,35 @@  discard block
 block discarded – undo
162 162
 		 * 		}
163 163
 		 */
164 164
 		// retrieve session options from db
165
-		$session_settings = get_option( 'ee_session_settings' );
166
-		if ( $session_settings !== FALSE ) {
165
+		$session_settings = get_option('ee_session_settings');
166
+		if ($session_settings !== FALSE) {
167 167
 			// cycle though existing session options
168
-			foreach ( $session_settings as $var_name => $session_setting ) {
168
+			foreach ($session_settings as $var_name => $session_setting) {
169 169
 				// set values for class properties
170
-				$var_name = '_' . $var_name;
170
+				$var_name = '_'.$var_name;
171 171
 				$this->{$var_name} = $session_setting;
172 172
 			}
173 173
 		}
174 174
 		// are we using encryption?
175
-		if ( $this->_use_encryption ) {
175
+		if ($this->_use_encryption) {
176 176
 			// instantiate the class object making all properties and methods accessible via $this->encryption ex: $this->encryption->encrypt();
177
-			$this->encryption = EE_Registry::instance()->load_core( 'Encryption' );
177
+			$this->encryption = EE_Registry::instance()->load_core('Encryption');
178 178
 		}
179 179
 		// filter hook allows outside functions/classes/plugins to change default empty cart
180
-		$extra_default_session_vars = apply_filters( 'FHEE__EE_Session__construct__extra_default_session_vars', array() );
181
-		array_merge( $this->_default_session_vars, $extra_default_session_vars );
180
+		$extra_default_session_vars = apply_filters('FHEE__EE_Session__construct__extra_default_session_vars', array());
181
+		array_merge($this->_default_session_vars, $extra_default_session_vars);
182 182
 		// apply default session vars
183 183
 		$this->_set_defaults();
184 184
 		// check for existing session and retrieve it from db
185
-		if ( ! $this->_espresso_session() ) {
185
+		if ( ! $this->_espresso_session()) {
186 186
 			// or just start a new one
187 187
 			$this->_create_espresso_session();
188 188
 		}
189 189
 		// check request for 'clear_session' param
190
-		add_action( 'AHEE__EE_Request_Handler__construct__complete', array( $this, 'wp_loaded' ));
190
+		add_action('AHEE__EE_Request_Handler__construct__complete', array($this, 'wp_loaded'));
191 191
 		// once everything is all said and done,
192
-		add_action( 'shutdown', array( $this, 'update' ), 100 );
193
-		add_action( 'shutdown', array( $this, 'garbage_collection' ), 999 );
192
+		add_action('shutdown', array($this, 'update'), 100);
193
+		add_action('shutdown', array($this, 'garbage_collection'), 999);
194 194
 
195 195
 	}
196 196
 
@@ -222,11 +222,11 @@  discard block
 block discarded – undo
222 222
 	 */
223 223
 	private function _set_defaults() {
224 224
 		// set some defaults
225
-		foreach ( $this->_default_session_vars as $key => $default_var ) {
226
-			if ( is_array( $default_var )) {
227
-				$this->_session_data[ $key ] = array();
225
+		foreach ($this->_default_session_vars as $key => $default_var) {
226
+			if (is_array($default_var)) {
227
+				$this->_session_data[$key] = array();
228 228
 			} else {
229
-				$this->_session_data[ $key ] = '';
229
+				$this->_session_data[$key] = '';
230 230
 			}
231 231
 		}
232 232
 	}
@@ -248,7 +248,7 @@  discard block
 block discarded – undo
248 248
 	  * @param \EE_Cart $cart
249 249
 	  * @return bool
250 250
 	  */
251
-	 public function set_cart( EE_Cart $cart ) {
251
+	 public function set_cart(EE_Cart $cart) {
252 252
 		 $this->_session_data['cart'] = $cart;
253 253
 		 return TRUE;
254 254
 	 }
@@ -268,7 +268,7 @@  discard block
 block discarded – undo
268 268
 	  * @return \EE_Cart
269 269
 	  */
270 270
 	 public function cart() {
271
-		 return isset( $this->_session_data['cart'] ) ? $this->_session_data['cart'] : NULL;
271
+		 return isset($this->_session_data['cart']) ? $this->_session_data['cart'] : NULL;
272 272
 	 }
273 273
 
274 274
 
@@ -277,7 +277,7 @@  discard block
 block discarded – undo
277 277
 	  * @param \EE_Checkout $checkout
278 278
 	  * @return bool
279 279
 	  */
280
-	 public function set_checkout( EE_Checkout $checkout ) {
280
+	 public function set_checkout(EE_Checkout $checkout) {
281 281
 		 $this->_session_data['checkout'] = $checkout;
282 282
 		 return TRUE;
283 283
 	 }
@@ -297,7 +297,7 @@  discard block
 block discarded – undo
297 297
 	  * @return \EE_Checkout
298 298
 	  */
299 299
 	 public function checkout() {
300
-		 return isset( $this->_session_data['checkout'] ) ? $this->_session_data['checkout'] : NULL;
300
+		 return isset($this->_session_data['checkout']) ? $this->_session_data['checkout'] : NULL;
301 301
 	 }
302 302
 
303 303
 
@@ -306,9 +306,9 @@  discard block
 block discarded – undo
306 306
 	  * @param \EE_Transaction $transaction
307 307
 	  * @return bool
308 308
 	  */
309
-	 public function set_transaction( EE_Transaction $transaction ) {
309
+	 public function set_transaction(EE_Transaction $transaction) {
310 310
 		 // first remove the session from the transaction before we save the transaction in the session
311
-		 $transaction->set_txn_session_data( NULL );
311
+		 $transaction->set_txn_session_data(NULL);
312 312
 		 $this->_session_data['transaction'] = $transaction;
313 313
 		 return TRUE;
314 314
 	 }
@@ -328,7 +328,7 @@  discard block
 block discarded – undo
328 328
 	  * @return \EE_Transaction
329 329
 	  */
330 330
 	 public function transaction() {
331
-		 return isset( $this->_session_data['transaction'] ) ? $this->_session_data['transaction'] : NULL;
331
+		 return isset($this->_session_data['transaction']) ? $this->_session_data['transaction'] : NULL;
332 332
 	 }
333 333
 
334 334
 
@@ -340,15 +340,15 @@  discard block
 block discarded – undo
340 340
 	  * @param bool $reset_cache
341 341
 	  * @return    array
342 342
 	  */
343
-	public function get_session_data( $key = NULL, $reset_cache = FALSE ) {
344
-		if ( $reset_cache ) {
343
+	public function get_session_data($key = NULL, $reset_cache = FALSE) {
344
+		if ($reset_cache) {
345 345
 			$this->reset_cart();
346 346
 			$this->reset_checkout();
347 347
 			$this->reset_transaction();
348 348
 		}
349
-		 if ( ! empty( $key ))  {
350
-			return  isset( $this->_session_data[ $key ] ) ? $this->_session_data[ $key ] : NULL;
351
-		}  else  {
349
+		 if ( ! empty($key)) {
350
+			return  isset($this->_session_data[$key]) ? $this->_session_data[$key] : NULL;
351
+		} else {
352 352
 			return $this->_session_data;
353 353
 		}
354 354
 	}
@@ -361,20 +361,20 @@  discard block
 block discarded – undo
361 361
 	  * @param 	array $data
362 362
 	  * @return 	TRUE on success, FALSE on fail
363 363
 	  */
364
-	public function set_session_data( $data ) {
364
+	public function set_session_data($data) {
365 365
 
366 366
 		// nothing ??? bad data ??? go home!
367
-		if ( empty( $data ) || ! is_array( $data )) {
368
-			EE_Error::add_error( __( 'No session data or invalid session data was provided.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__ );
367
+		if (empty($data) || ! is_array($data)) {
368
+			EE_Error::add_error(__('No session data or invalid session data was provided.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
369 369
 			return FALSE;
370 370
 		}
371 371
 
372
-		foreach ( $data as $key =>$value ) {
373
-			if ( isset( $this->_default_session_vars[ $key ] )) {
374
-				EE_Error::add_error( sprintf( __( 'Sorry! %s is a default session datum and can not be reset.', 'event_espresso' ), $key ), __FILE__, __FUNCTION__, __LINE__ );
372
+		foreach ($data as $key =>$value) {
373
+			if (isset($this->_default_session_vars[$key])) {
374
+				EE_Error::add_error(sprintf(__('Sorry! %s is a default session datum and can not be reset.', 'event_espresso'), $key), __FILE__, __FUNCTION__, __LINE__);
375 375
 				return FALSE;
376 376
 			} else {
377
-				$this->_session_data[ $key ] = $value;
377
+				$this->_session_data[$key] = $value;
378 378
 			}
379 379
 		}
380 380
 
@@ -391,9 +391,9 @@  discard block
 block discarded – undo
391 391
 	  * @throws \EE_Error
392 392
 	  */
393 393
 	private function _espresso_session() {
394
-		do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' );
394
+		do_action('AHEE_log', __FILE__, __FUNCTION__, '');
395 395
 		// check that session has started
396
-		if ( session_id() === '' ) {
396
+		if (session_id() === '') {
397 397
 			//starts a new session if one doesn't already exist, or re-initiates an existing one
398 398
 			session_start();
399 399
 		}
@@ -402,57 +402,57 @@  discard block
 block discarded – undo
402 402
 		// and the visitors IP
403 403
 		$this->_ip_address = $this->_visitor_ip();
404 404
 		// set the "user agent"
405
-		$this->_user_agent = ( isset($_SERVER['HTTP_USER_AGENT'])) ? esc_attr( $_SERVER['HTTP_USER_AGENT'] ) : FALSE;
405
+		$this->_user_agent = (isset($_SERVER['HTTP_USER_AGENT'])) ? esc_attr($_SERVER['HTTP_USER_AGENT']) : FALSE;
406 406
 		// now let's retrieve what's in the db
407 407
 		// we're using WP's Transient API to store session data using the PHP session ID as the option name
408
-		$session_data = get_transient( EE_Session::session_id_prefix . $this->_sid );
409
-		if ( $session_data ) {
410
-			if ( apply_filters( 'FHEE__EE_Session___perform_session_id_hash_check', WP_DEBUG ) ) {
411
-				$hash_check = get_transient( EE_Session::hash_check_prefix . $this->_sid );
412
-				if ( $hash_check && $hash_check !== md5( $session_data ) ) {
408
+		$session_data = get_transient(EE_Session::session_id_prefix.$this->_sid);
409
+		if ($session_data) {
410
+			if (apply_filters('FHEE__EE_Session___perform_session_id_hash_check', WP_DEBUG)) {
411
+				$hash_check = get_transient(EE_Session::hash_check_prefix.$this->_sid);
412
+				if ($hash_check && $hash_check !== md5($session_data)) {
413 413
 					EE_Error::add_error(
414 414
 						sprintf(
415
-							__( 'The stored data for session %1$s failed to pass a hash check and therefore appears to be invalid.', 'event_espresso' ),
416
-							EE_Session::session_id_prefix . $this->_sid
415
+							__('The stored data for session %1$s failed to pass a hash check and therefore appears to be invalid.', 'event_espresso'),
416
+							EE_Session::session_id_prefix.$this->_sid
417 417
 						),
418 418
 						__FILE__, __FUNCTION__, __LINE__
419 419
 					);
420 420
 				}
421 421
 			}
422 422
 			// un-encrypt the data
423
-			$session_data = $this->_use_encryption ? $this->encryption->decrypt( $session_data ) : $session_data;
423
+			$session_data = $this->_use_encryption ? $this->encryption->decrypt($session_data) : $session_data;
424 424
 			// unserialize
425
-			$session_data = maybe_unserialize( $session_data );
425
+			$session_data = maybe_unserialize($session_data);
426 426
 			// just a check to make sure the session array is indeed an array
427
-			if ( ! is_array( $session_data ) ) {
427
+			if ( ! is_array($session_data)) {
428 428
 				// no?!?! then something is wrong
429 429
 				return FALSE;
430 430
 			}
431 431
 			// get the current time in UTC
432
-			$this->_time = isset( $this->_time ) ? $this->_time : time();
432
+			$this->_time = isset($this->_time) ? $this->_time : time();
433 433
 			// and reset the session expiration
434
-			$this->_expiration = isset( $session_data['expiration'] ) ? $session_data['expiration'] : $this->_time + $this->_lifespan;
434
+			$this->_expiration = isset($session_data['expiration']) ? $session_data['expiration'] : $this->_time + $this->_lifespan;
435 435
 
436 436
 		} else {
437 437
 			// set initial site access time and the session expiration
438 438
 			$this->_set_init_access_and_expiration();
439 439
 			// set referer
440
-			$this->_session_data[ 'pages_visited' ][ $this->_session_data['init_access'] ] = isset( $_SERVER['HTTP_REFERER'] ) ? esc_attr( $_SERVER['HTTP_REFERER'] ) : '';
440
+			$this->_session_data['pages_visited'][$this->_session_data['init_access']] = isset($_SERVER['HTTP_REFERER']) ? esc_attr($_SERVER['HTTP_REFERER']) : '';
441 441
 			// no previous session = go back and create one (on top of the data above)
442 442
 			return FALSE;
443 443
 		}
444 444
 		// now the user agent
445
-		if ( $session_data['user_agent'] != $this->_user_agent ) {
445
+		if ($session_data['user_agent'] != $this->_user_agent) {
446 446
 			return FALSE;
447 447
 		}
448 448
 		// wait a minute... how old are you?
449
-		if ( $this->_time > $this->_expiration ) {
449
+		if ($this->_time > $this->_expiration) {
450 450
 			// yer too old fer me!
451 451
 			// wipe out everything that isn't a default session datum
452
-			$this->clear_session( __CLASS__, __FUNCTION__ );
452
+			$this->clear_session(__CLASS__, __FUNCTION__);
453 453
 		}
454 454
 		// make event espresso session data available to plugin
455
-		$this->_session_data = array_merge( $this->_session_data, $session_data );
455
+		$this->_session_data = array_merge($this->_session_data, $session_data);
456 456
 		return TRUE;
457 457
 
458 458
 	}
@@ -470,12 +470,12 @@  discard block
 block discarded – undo
470 470
 	  */
471 471
 	protected function _generate_session_id() {
472 472
 		// check if the SID was passed explicitly, otherwise get from session, then add salt and hash it to reduce length
473
-		if ( isset( $_REQUEST[ 'EESID' ] ) ) {
474
-			$session_id = sanitize_text_field( $_REQUEST[ 'EESID' ] );
473
+		if (isset($_REQUEST['EESID'])) {
474
+			$session_id = sanitize_text_field($_REQUEST['EESID']);
475 475
 		} else {
476
-			$session_id = md5( session_id() . get_current_blog_id() . $this->_get_sid_salt() );
476
+			$session_id = md5(session_id().get_current_blog_id().$this->_get_sid_salt());
477 477
 		}
478
-		return apply_filters( 'FHEE__EE_Session___generate_session_id__session_id', $session_id );
478
+		return apply_filters('FHEE__EE_Session___generate_session_id__session_id', $session_id);
479 479
 	}
480 480
 
481 481
 
@@ -487,20 +487,20 @@  discard block
 block discarded – undo
487 487
 	  */
488 488
 	protected function _get_sid_salt() {
489 489
 		// was session id salt already saved to db ?
490
-		if ( empty( $this->_sid_salt ) ) {
490
+		if (empty($this->_sid_salt)) {
491 491
 			// no?  then maybe use WP defined constant
492
-			if ( defined( 'AUTH_SALT' ) ) {
492
+			if (defined('AUTH_SALT')) {
493 493
 				$this->_sid_salt = AUTH_SALT;
494 494
 			}
495 495
 			// if salt doesn't exist or is too short
496
-			if ( empty( $this->_sid_salt ) || strlen( $this->_sid_salt ) < 32 ) {
496
+			if (empty($this->_sid_salt) || strlen($this->_sid_salt) < 32) {
497 497
 				// create a new one
498
-				$this->_sid_salt = wp_generate_password( 64 );
498
+				$this->_sid_salt = wp_generate_password(64);
499 499
 			}
500 500
 			// and save it as a permanent session setting
501
-			$session_settings = get_option( 'ee_session_settings' );
502
-			$session_settings[ 'sid_salt' ] = $this->_sid_salt;
503
-			update_option( 'ee_session_settings', $session_settings );
501
+			$session_settings = get_option('ee_session_settings');
502
+			$session_settings['sid_salt'] = $this->_sid_salt;
503
+			update_option('ee_session_settings', $session_settings);
504 504
 		}
505 505
 		return $this->_sid_salt;
506 506
 	}
@@ -528,19 +528,19 @@  discard block
 block discarded – undo
528 528
 	  * @param bool $new_session
529 529
 	  * @return TRUE on success, FALSE on fail
530 530
 	  */
531
-	public function update( $new_session = FALSE ) {
532
-		$this->_session_data = isset( $this->_session_data )
533
-			&& is_array( $this->_session_data )
534
-			&& isset( $this->_session_data['id'])
531
+	public function update($new_session = FALSE) {
532
+		$this->_session_data = isset($this->_session_data)
533
+			&& is_array($this->_session_data)
534
+			&& isset($this->_session_data['id'])
535 535
 			? $this->_session_data
536 536
 			: NULL;
537
-		if ( empty( $this->_session_data )) {
537
+		if (empty($this->_session_data)) {
538 538
 			$this->_set_defaults();
539 539
 		}
540 540
 		$session_data = array();
541
-		foreach ( $this->_session_data as $key => $value ) {
541
+		foreach ($this->_session_data as $key => $value) {
542 542
 
543
-			switch( $key ) {
543
+			switch ($key) {
544 544
 
545 545
 				case 'id' :
546 546
 					// session ID
@@ -558,7 +558,7 @@  discard block
 block discarded – undo
558 558
 				break;
559 559
 
560 560
 				case 'init_access' :
561
-					$session_data['init_access'] = absint( $value );
561
+					$session_data['init_access'] = absint($value);
562 562
 				break;
563 563
 
564 564
 				case 'last_access' :
@@ -568,7 +568,7 @@  discard block
 block discarded – undo
568 568
 
569 569
 				case 'expiration' :
570 570
 					// when the session expires
571
-					$session_data['expiration'] = ! empty( $this->_expiration )
571
+					$session_data['expiration'] = ! empty($this->_expiration)
572 572
 						? $this->_expiration
573 573
 						: $session_data['init_access'] + $this->_lifespan;
574 574
 				break;
@@ -580,11 +580,11 @@  discard block
 block discarded – undo
580 580
 
581 581
 				case 'pages_visited' :
582 582
 					$page_visit = $this->_get_page_visit();
583
-					if ( $page_visit ) {
583
+					if ($page_visit) {
584 584
 						// set pages visited where the first will be the http referrer
585
-						$this->_session_data[ 'pages_visited' ][ $this->_time ] = $page_visit;
585
+						$this->_session_data['pages_visited'][$this->_time] = $page_visit;
586 586
 						// we'll only save the last 10 page visits.
587
-						$session_data[ 'pages_visited' ] = array_slice( $this->_session_data['pages_visited'], -10 );
587
+						$session_data['pages_visited'] = array_slice($this->_session_data['pages_visited'], -10);
588 588
 					}
589 589
 				break;
590 590
 
@@ -598,9 +598,9 @@  discard block
 block discarded – undo
598 598
 
599 599
 		$this->_session_data = $session_data;
600 600
 		// creating a new session does not require saving to the db just yet
601
-		if ( ! $new_session ) {
601
+		if ( ! $new_session) {
602 602
 			// ready? let's save
603
-			if ( $this->_save_session_to_db() ) {
603
+			if ($this->_save_session_to_db()) {
604 604
 				return TRUE;
605 605
 			} else {
606 606
 				return FALSE;
@@ -621,9 +621,9 @@  discard block
 block discarded – undo
621 621
 	 * 	@return bool
622 622
 	 */
623 623
 	private function _create_espresso_session( ) {
624
-		do_action( 'AHEE_log', __CLASS__, __FUNCTION__, '' );
624
+		do_action('AHEE_log', __CLASS__, __FUNCTION__, '');
625 625
 		// use the update function for now with $new_session arg set to TRUE
626
-		return  $this->update( TRUE ) ? TRUE : FALSE;
626
+		return  $this->update(TRUE) ? TRUE : FALSE;
627 627
 	}
628 628
 
629 629
 
@@ -647,15 +647,15 @@  discard block
 block discarded – undo
647 647
 			return FALSE;
648 648
 		}
649 649
 		// first serialize all of our session data
650
-		$session_data = serialize( $this->_session_data );
650
+		$session_data = serialize($this->_session_data);
651 651
 		// encrypt it if we are using encryption
652
-		$session_data = $this->_use_encryption ? $this->encryption->encrypt( $session_data ) : $session_data;
652
+		$session_data = $this->_use_encryption ? $this->encryption->encrypt($session_data) : $session_data;
653 653
 		// maybe save hash check
654
-		if ( apply_filters( 'FHEE__EE_Session___perform_session_id_hash_check', WP_DEBUG ) ) {
655
-			set_transient( EE_Session::hash_check_prefix . $this->_sid, md5( $session_data ), $this->_lifespan );
654
+		if (apply_filters('FHEE__EE_Session___perform_session_id_hash_check', WP_DEBUG)) {
655
+			set_transient(EE_Session::hash_check_prefix.$this->_sid, md5($session_data), $this->_lifespan);
656 656
 		}
657 657
 		// we're using the Transient API for storing session data, cuz it's so damn simple -> set_transient(  transient ID, data, expiry )
658
-		return set_transient( EE_Session::session_id_prefix . $this->_sid, $session_data, $this->_lifespan );
658
+		return set_transient(EE_Session::session_id_prefix.$this->_sid, $session_data, $this->_lifespan);
659 659
 	}
660 660
 
661 661
 
@@ -681,10 +681,10 @@  discard block
 block discarded – undo
681 681
 			'HTTP_FORWARDED',
682 682
 			'REMOTE_ADDR'
683 683
 		);
684
-		foreach ( $server_keys as $key ){
685
-			if ( isset( $_SERVER[ $key ] )) {
686
-				foreach ( array_map( 'trim', explode( ',', $_SERVER[ $key ] )) as $ip ) {
687
-					if ( $ip === '127.0.0.1' || filter_var( $ip, FILTER_VALIDATE_IP ) !== FALSE ) {
684
+		foreach ($server_keys as $key) {
685
+			if (isset($_SERVER[$key])) {
686
+				foreach (array_map('trim', explode(',', $_SERVER[$key])) as $ip) {
687
+					if ($ip === '127.0.0.1' || filter_var($ip, FILTER_VALIDATE_IP) !== FALSE) {
688 688
 						$visitor_ip = $ip;
689 689
 					}
690 690
 				}
@@ -705,45 +705,45 @@  discard block
 block discarded – undo
705 705
 	public function _get_page_visit() {
706 706
 
707 707
 //		echo '<h3>'. __CLASS__ .'->'.__FUNCTION__.'  ( line no: ' . __LINE__ . ' )</h3>';
708
-		$page_visit = home_url('/') . 'wp-admin/admin-ajax.php';
708
+		$page_visit = home_url('/').'wp-admin/admin-ajax.php';
709 709
 
710 710
 		// check for request url
711
-		if ( isset( $_SERVER['REQUEST_URI'] )) {
711
+		if (isset($_SERVER['REQUEST_URI'])) {
712 712
 
713
-			$request_uri = esc_url( $_SERVER['REQUEST_URI'] );
713
+			$request_uri = esc_url($_SERVER['REQUEST_URI']);
714 714
 
715
-			$ru_bits = explode( '?', $request_uri );
715
+			$ru_bits = explode('?', $request_uri);
716 716
 			$request_uri = $ru_bits[0];
717 717
 			//echo '<h1>$request_uri   ' . $request_uri . '</h1>';
718 718
 
719 719
 			// check for and grab host as well
720
-			if ( isset( $_SERVER['HTTP_HOST'] )) {
721
-				$http_host = esc_url( $_SERVER['HTTP_HOST'] );
720
+			if (isset($_SERVER['HTTP_HOST'])) {
721
+				$http_host = esc_url($_SERVER['HTTP_HOST']);
722 722
 			} else {
723 723
 				$http_host = '';
724 724
 			}
725 725
 			//echo '<h1>$http_host   ' . $http_host . '</h1>';
726 726
 
727 727
 			// check for page_id in SERVER REQUEST
728
-			if ( isset( $_REQUEST['page_id'] )) {
728
+			if (isset($_REQUEST['page_id'])) {
729 729
 				// rebuild $e_reg without any of the extra parameters
730
-				$page_id = '?page_id=' . esc_attr( $_REQUEST['page_id'] ) . '&amp;';
730
+				$page_id = '?page_id='.esc_attr($_REQUEST['page_id']).'&amp;';
731 731
 			} else {
732 732
 				$page_id = '?';
733 733
 			}
734 734
 			// check for $e_reg in SERVER REQUEST
735
-			if ( isset( $_REQUEST['ee'] )) {
735
+			if (isset($_REQUEST['ee'])) {
736 736
 				// rebuild $e_reg without any of the extra parameters
737
-				$e_reg = 'ee=' . esc_attr( $_REQUEST['ee'] );
737
+				$e_reg = 'ee='.esc_attr($_REQUEST['ee']);
738 738
 			} else {
739 739
 				$e_reg = '';
740 740
 			}
741 741
 
742
-			$page_visit = rtrim( $http_host . $request_uri . $page_id . $e_reg, '?' );
742
+			$page_visit = rtrim($http_host.$request_uri.$page_id.$e_reg, '?');
743 743
 
744 744
 		}
745 745
 
746
-		return $page_visit != home_url( '/wp-admin/admin-ajax.php' ) ? $page_visit : '';
746
+		return $page_visit != home_url('/wp-admin/admin-ajax.php') ? $page_visit : '';
747 747
 
748 748
 	}
749 749
 
@@ -772,14 +772,14 @@  discard block
 block discarded – undo
772 772
 	  * @param string $function
773 773
 	  * @return void
774 774
 	  */
775
-	public function clear_session( $class = '', $function = '' ) {
775
+	public function clear_session($class = '', $function = '') {
776 776
 		//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>';
777
-		do_action( 'AHEE_log', __FILE__, __FUNCTION__, 'session cleared by : ' . $class . '::' .  $function . '()' );
777
+		do_action('AHEE_log', __FILE__, __FUNCTION__, 'session cleared by : '.$class.'::'.$function.'()');
778 778
 		$this->reset_cart();
779 779
 		$this->reset_checkout();
780 780
 		$this->reset_transaction();
781 781
 		// wipe out everything that isn't a default session datum
782
-		$this->reset_data( array_keys( $this->_session_data ));
782
+		$this->reset_data(array_keys($this->_session_data));
783 783
 		// reset initial site access time and the session expiration
784 784
 		$this->_set_init_access_and_expiration();
785 785
 		$this->_save_session_to_db();
@@ -794,42 +794,42 @@  discard block
 block discarded – undo
794 794
 	  * @param bool  $show_all_notices
795 795
 	  * @return TRUE on success, FALSE on fail
796 796
 	  */
797
-	public function reset_data( $data_to_reset = array(), $show_all_notices = FALSE ) {
797
+	public function reset_data($data_to_reset = array(), $show_all_notices = FALSE) {
798 798
 		// if $data_to_reset is not in an array, then put it in one
799
-		if ( ! is_array( $data_to_reset ) ) {
800
-			$data_to_reset = array ( $data_to_reset );
799
+		if ( ! is_array($data_to_reset)) {
800
+			$data_to_reset = array($data_to_reset);
801 801
 		}
802 802
 		// nothing ??? go home!
803
-		if ( empty( $data_to_reset )) {
804
-			EE_Error::add_error( __( 'No session data could be reset, because no session var name was provided.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__ );
803
+		if (empty($data_to_reset)) {
804
+			EE_Error::add_error(__('No session data could be reset, because no session var name was provided.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
805 805
 			return FALSE;
806 806
 		}
807 807
 		$return_value = TRUE;
808 808
 		// since $data_to_reset is an array, cycle through the values
809
-		foreach ( $data_to_reset as $reset ) {
809
+		foreach ($data_to_reset as $reset) {
810 810
 
811 811
 			// first check to make sure it is a valid session var
812
-			if ( isset( $this->_session_data[ $reset ] )) {
812
+			if (isset($this->_session_data[$reset])) {
813 813
 				// then check to make sure it is not a default var
814
-				if ( ! array_key_exists( $reset, $this->_default_session_vars )) {
814
+				if ( ! array_key_exists($reset, $this->_default_session_vars)) {
815 815
 					// remove session var
816
-					unset( $this->_session_data[ $reset ] );
817
-					if ( $show_all_notices ) {
818
-						EE_Error::add_success( sprintf( __( 'The session variable %s was removed.', 'event_espresso' ), $reset ), __FILE__, __FUNCTION__, __LINE__ );
816
+					unset($this->_session_data[$reset]);
817
+					if ($show_all_notices) {
818
+						EE_Error::add_success(sprintf(__('The session variable %s was removed.', 'event_espresso'), $reset), __FILE__, __FUNCTION__, __LINE__);
819 819
 					}
820
-					$return_value = !isset($return_value) ? TRUE : $return_value;
820
+					$return_value = ! isset($return_value) ? TRUE : $return_value;
821 821
 
822 822
 				} else {
823 823
 					// yeeeeeeeeerrrrrrrrrrr OUT !!!!
824
-					if ( $show_all_notices ) {
825
-						EE_Error::add_error( sprintf( __( 'Sorry! %s is a default session datum and can not be reset.', 'event_espresso' ), $reset ), __FILE__, __FUNCTION__, __LINE__ );
824
+					if ($show_all_notices) {
825
+						EE_Error::add_error(sprintf(__('Sorry! %s is a default session datum and can not be reset.', 'event_espresso'), $reset), __FILE__, __FUNCTION__, __LINE__);
826 826
 					}
827 827
 					$return_value = FALSE;
828 828
 				}
829 829
 
830
-			} else if ( $show_all_notices ) {
830
+			} else if ($show_all_notices) {
831 831
 				// oops! that session var does not exist!
832
-				EE_Error::add_error( sprintf( __( 'The session item provided, %s, is invalid or does not exist.', 'event_espresso' ), $reset ), __FILE__, __FUNCTION__, __LINE__ );
832
+				EE_Error::add_error(sprintf(__('The session item provided, %s, is invalid or does not exist.', 'event_espresso'), $reset), __FILE__, __FUNCTION__, __LINE__);
833 833
 				$return_value = FALSE;
834 834
 			}
835 835
 
@@ -850,8 +850,8 @@  discard block
 block discarded – undo
850 850
 	 *   @return	 string
851 851
 	 */
852 852
 	public function wp_loaded() {
853
-		if ( isset(  EE_Registry::instance()->REQ ) && EE_Registry::instance()->REQ->is_set( 'clear_session' )) {
854
-			$this->clear_session( __CLASS__, __FUNCTION__ );
853
+		if (isset(EE_Registry::instance()->REQ) && EE_Registry::instance()->REQ->is_set('clear_session')) {
854
+			$this->clear_session(__CLASS__, __FUNCTION__);
855 855
 		}
856 856
 	}
857 857
 
@@ -876,24 +876,24 @@  discard block
 block discarded – undo
876 876
 	  */
877 877
 	 public function garbage_collection() {
878 878
 		 // only perform during regular requests
879
-		 if ( ! defined( 'DOING_AJAX') || ! DOING_AJAX ) {
879
+		 if ( ! defined('DOING_AJAX') || ! DOING_AJAX) {
880 880
 			 /** @type WPDB $wpdb */
881 881
 			 global $wpdb;
882 882
 			 // since transient expiration timestamps are set in the future, we can compare against NOW
883 883
 			 $expiration = time();
884
-			 $too_far_in_the_the_future = $expiration + ( $this->_lifespan * 2 );
884
+			 $too_far_in_the_the_future = $expiration + ($this->_lifespan * 2);
885 885
 			 // filter the query limit. Set to 0 to turn off garbage collection
886
-			 $expired_session_transient_delete_query_limit = absint( apply_filters( 'FHEE__EE_Session__garbage_collection___expired_session_transient_delete_query_limit', 50 ));
886
+			 $expired_session_transient_delete_query_limit = absint(apply_filters('FHEE__EE_Session__garbage_collection___expired_session_transient_delete_query_limit', 50));
887 887
 			 // non-zero LIMIT means take out the trash
888
-			 if ( $expired_session_transient_delete_query_limit ) {
888
+			 if ($expired_session_transient_delete_query_limit) {
889 889
 				 //array of transient keys that require garbage collection
890 890
 				 $session_keys = array(
891 891
 					 EE_Session::session_id_prefix,
892 892
 					 EE_Session::hash_check_prefix,
893 893
 				 );
894
-				 foreach ( $session_keys as $session_key ) {
895
-					 $session_key = str_replace( '_', '\_', $session_key );
896
-					 $session_key = '\_transient\_timeout\_' . $session_key . '%';
894
+				 foreach ($session_keys as $session_key) {
895
+					 $session_key = str_replace('_', '\_', $session_key);
896
+					 $session_key = '\_transient\_timeout\_'.$session_key.'%';
897 897
 					 $SQL = "
898 898
 					SELECT option_name
899 899
 					FROM {$wpdb->options}
@@ -903,28 +903,28 @@  discard block
 block discarded – undo
903 903
 					OR option_value > {$too_far_in_the_the_future} )
904 904
 					LIMIT {$expired_session_transient_delete_query_limit}
905 905
 				";
906
-					 $expired_sessions = $wpdb->get_col( $SQL );
906
+					 $expired_sessions = $wpdb->get_col($SQL);
907 907
 					 // valid results?
908
-					 if ( ! $expired_sessions instanceof WP_Error && ! empty( $expired_sessions ) ) {
908
+					 if ( ! $expired_sessions instanceof WP_Error && ! empty($expired_sessions)) {
909 909
 						 // format array of results into something usable within the actual DELETE query's IN clause
910 910
 						 $expired = array();
911
-						 foreach ( $expired_sessions as $expired_session ) {
912
-							 $expired[ ] = "'" . $expired_session . "'";
913
-							 $expired[ ] = "'" . str_replace( 'timeout_', '', $expired_session ) . "'";
911
+						 foreach ($expired_sessions as $expired_session) {
912
+							 $expired[] = "'".$expired_session."'";
913
+							 $expired[] = "'".str_replace('timeout_', '', $expired_session)."'";
914 914
 						 }
915
-						 $expired = implode( ', ', $expired );
915
+						 $expired = implode(', ', $expired);
916 916
 						 $SQL = "
917 917
 						DELETE FROM {$wpdb->options}
918 918
 						WHERE option_name
919 919
 						IN ( $expired );
920 920
 					 ";
921
-						 $results = $wpdb->query( $SQL );
921
+						 $results = $wpdb->query($SQL);
922 922
 						 // if something went wrong, then notify the admin
923
-						 if ( $results instanceof WP_Error && is_admin() ) {
924
-							 EE_Error::add_error( $results->get_error_message(), __FILE__, __FUNCTION__, __LINE__ );
923
+						 if ($results instanceof WP_Error && is_admin()) {
924
+							 EE_Error::add_error($results->get_error_message(), __FILE__, __FUNCTION__, __LINE__);
925 925
 						 }
926 926
 					 }
927
-					 do_action( 'FHEE__EE_Session__garbage_collection___end', $expired_session_transient_delete_query_limit );
927
+					 do_action('FHEE__EE_Session__garbage_collection___end', $expired_session_transient_delete_query_limit);
928 928
 				 }
929 929
 			 }
930 930
 		 }
Please login to merge, or discard this patch.
core/EE_System.core.php 4 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -613,7 +613,7 @@
 block discarded – undo
613 613
 	 * so that it will be done when migrations are finished
614 614
 	 * @param boolean $initialize_addons_too if true, we double-check addons' database tables etc too;
615 615
 	 *		however,
616
-	 * @param boolean $verify_db_schema if true will re-check the database tables have the correct schema. This is a resource-intensive job
616
+	 * @param boolean $verify_schema if true will re-check the database tables have the correct schema. This is a resource-intensive job
617 617
 	 * so we prefer to only do it when necessary
618 618
 	 * @return void
619 619
 	 */
Please login to merge, or discard this patch.
Braces   +11 added lines, -9 removed lines patch added patch discarded remove patch
@@ -1,4 +1,6 @@  discard block
 block discarded – undo
1
-<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) exit('No direct script access allowed');
1
+<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) {
2
+	exit('No direct script access allowed');
3
+}
2 4
 /**
3 5
  * Event Espresso
4 6
  *
@@ -578,7 +580,7 @@  discard block
 block discarded – undo
578 580
 				$espresso_db_update =  array( $espresso_db_update=>array() );
579 581
 				update_option( 'espresso_db_update', $espresso_db_update );
580 582
 			}
581
-		}else{
583
+		} else{
582 584
 			$corrected_db_update = array();
583 585
 			//if IS an array, but is it an array where KEYS are version numbers, and values are arrays?
584 586
 			foreach($espresso_db_update as $should_be_version_string => $should_be_array){
@@ -588,7 +590,7 @@  discard block
 block discarded – undo
588 590
 					//fix it!
589 591
 					$version_string = $should_be_array;
590 592
 					$corrected_db_update[$version_string] = array('unknown-date');
591
-				}else{
593
+				} else{
592 594
 					//ok it checks out
593 595
 					$corrected_db_update[$should_be_version_string] = $should_be_array;
594 596
 				}
@@ -633,7 +635,7 @@  discard block
 block discarded – undo
633 635
 					$addon->initialize_db_if_no_migrations_required();
634 636
 				}
635 637
 			}
636
-		}else{
638
+		} else{
637 639
 			EE_Data_Migration_Manager::instance()->enqueue_db_initialization_for( 'Core' );
638 640
 		}
639 641
 		if ( $request_type == EE_System::req_type_new_activation || $request_type == EE_System::req_type_reactivation || $request_type == EE_System::req_type_upgrade ) {
@@ -703,7 +705,7 @@  discard block
 block discarded – undo
703 705
 				//it a version we haven't seen before
704 706
 				if( $version_is_higher === 1 ){
705 707
 					$req_type = EE_System::req_type_upgrade;
706
-				}else{
708
+				} else{
707 709
 					$req_type = EE_System::req_type_downgrade;
708 710
 				}
709 711
 				delete_option( $activation_indicator_option_name );
@@ -712,10 +714,10 @@  discard block
 block discarded – undo
712 714
 				if( get_option( $activation_indicator_option_name, FALSE ) ){
713 715
 					if ( $version_is_higher === -1 ){
714 716
 						$req_type = EE_System::req_type_downgrade;
715
-					}elseif( $version_is_higher === 0 ){
717
+					} elseif( $version_is_higher === 0 ){
716 718
 						//we've seen this version before, but it's an activation. must be a reactivation
717 719
 						$req_type = EE_System::req_type_reactivation;
718
-					}else{//$version_is_higher === 1
720
+					} else{//$version_is_higher === 1
719 721
 						$req_type = EE_System::req_type_upgrade;
720 722
 					}
721 723
 					delete_option( $activation_indicator_option_name );
@@ -723,10 +725,10 @@  discard block
 block discarded – undo
723 725
 					//we've seen this version before and the activation indicate doesn't show it was just activated
724 726
 					if ( $version_is_higher === -1 ){
725 727
 						$req_type = EE_System::req_type_downgrade;
726
-					}elseif( $version_is_higher === 0 ){
728
+					} elseif( $version_is_higher === 0 ){
727 729
 						//we've seen this version before and it's not an activation. its normal request
728 730
 						$req_type = EE_System::req_type_normal;
729
-					}else{//$version_is_higher === 1
731
+					} else{//$version_is_higher === 1
730 732
 						$req_type = EE_System::req_type_upgrade;
731 733
 					}
732 734
 				}
Please login to merge, or discard this patch.
Indentation   +60 added lines, -60 removed lines patch added patch discarded remove patch
@@ -203,14 +203,14 @@  discard block
 block discarded – undo
203 203
 
204 204
 
205 205
 	/**
206
-	* detect_if_activation_or_upgrade
207
-	*
208
-	* Takes care of detecting whether this is a brand new install or code upgrade,
209
-	* and either setting up the DB or setting up maintenance mode etc.
210
-	*
211
-	* @access public
212
-	* @return void
213
-	*/
206
+	 * detect_if_activation_or_upgrade
207
+	 *
208
+	 * Takes care of detecting whether this is a brand new install or code upgrade,
209
+	 * and either setting up the DB or setting up maintenance mode etc.
210
+	 *
211
+	 * @access public
212
+	 * @return void
213
+	 */
214 214
 	public function detect_if_activation_or_upgrade() {
215 215
 		do_action('AHEE__EE_System___detect_if_activation_or_upgrade__begin');
216 216
 
@@ -514,11 +514,11 @@  discard block
 block discarded – undo
514 514
 			$query_params =  array( 'page' => 'espresso_about' );
515 515
 
516 516
 			if ( EE_System::instance()->detect_req_type() == EE_System::req_type_new_activation ) {
517
-			    $query_params['new_activation'] = TRUE;
517
+				$query_params['new_activation'] = TRUE;
518 518
 			}
519 519
 
520 520
 			if ( EE_System::instance()->detect_req_type() == EE_System::req_type_reactivation ) {
521
-			    $query_params['reactivation'] = TRUE;
521
+				$query_params['reactivation'] = TRUE;
522 522
 			}
523 523
 			$url = add_query_arg( $query_params, admin_url( 'admin.php' ) );
524 524
 			wp_safe_redirect( $url );
@@ -621,11 +621,11 @@  discard block
 block discarded – undo
621 621
 
622 622
 
623 623
 	/**
624
-	* _incompatible_addon_error
625
-	*
626
-	* @access public
627
-	* @return void
628
-	*/
624
+	 * _incompatible_addon_error
625
+	 *
626
+	 * @access public
627
+	 * @return void
628
+	 */
629 629
 	private function _incompatible_addon_error() {
630 630
 		// get array of classes hooking into here
631 631
 		$class_names = EEH_Class_Tools::get_class_names_for_all_callbacks_on_hook( 'AHEE__EE_System__register_shortcodes_modules_and_addons' );
@@ -747,14 +747,14 @@  discard block
 block discarded – undo
747 747
 
748 748
 
749 749
 	/**
750
-	* load_controllers
751
-	*
752
-	* this is the best place to load any additional controllers that needs access to EE core.
753
-	* it is expected that all basic core EE systems, that are not dependant on the current request are loaded at this time
754
-	*
755
-	* @access public
756
-	* @return void
757
-	*/
750
+	 * load_controllers
751
+	 *
752
+	 * this is the best place to load any additional controllers that needs access to EE core.
753
+	 * it is expected that all basic core EE systems, that are not dependant on the current request are loaded at this time
754
+	 *
755
+	 * @access public
756
+	 * @return void
757
+	 */
758 758
 	public function load_controllers() {
759 759
 		do_action( 'AHEE__EE_System__load_controllers__start' );
760 760
 		// let's get it started
@@ -771,13 +771,13 @@  discard block
 block discarded – undo
771 771
 
772 772
 
773 773
 	/**
774
-	* core_loaded_and_ready
775
-	*
776
-	* all of the basic EE core should be loaded at this point and available regardless of M-Mode
777
-	*
778
-	* @access public
779
-	* @return void
780
-	*/
774
+	 * core_loaded_and_ready
775
+	 *
776
+	 * all of the basic EE core should be loaded at this point and available regardless of M-Mode
777
+	 *
778
+	 * @access public
779
+	 * @return void
780
+	 */
781 781
 	public function core_loaded_and_ready() {
782 782
 		do_action( 'AHEE__EE_System__core_loaded_and_ready' );
783 783
 		do_action( 'AHEE__EE_System__set_hooks_for_shortcodes_modules_and_addons' );
@@ -788,13 +788,13 @@  discard block
 block discarded – undo
788 788
 
789 789
 
790 790
 	/**
791
-	* initialize
792
-	*
793
-	* this is the best place to begin initializing client code
794
-	*
795
-	* @access public
796
-	* @return void
797
-	*/
791
+	 * initialize
792
+	 *
793
+	 * this is the best place to begin initializing client code
794
+	 *
795
+	 * @access public
796
+	 * @return void
797
+	 */
798 798
 	public function initialize() {
799 799
 		do_action( 'AHEE__EE_System__initialize' );
800 800
 	}
@@ -802,13 +802,13 @@  discard block
 block discarded – undo
802 802
 
803 803
 
804 804
 	/**
805
-	* initialize_last
806
-	*
807
-	* this is run really late during the WP init hookpoint, and ensures that mostly everything else that needs to initialize has done so
808
-	*
809
-	* @access public
810
-	* @return void
811
-	*/
805
+	 * initialize_last
806
+	 *
807
+	 * this is run really late during the WP init hookpoint, and ensures that mostly everything else that needs to initialize has done so
808
+	 *
809
+	 * @access public
810
+	 * @return void
811
+	 */
812 812
 	public function initialize_last() {
813 813
 		do_action( 'AHEE__EE_System__initialize_last' );
814 814
 	}
@@ -817,14 +817,14 @@  discard block
 block discarded – undo
817 817
 
818 818
 
819 819
 	/**
820
-	* set_hooks_for_shortcodes_modules_and_addons
821
-	*
822
-	* this is the best place for other systems to set callbacks for hooking into other parts of EE
823
-	* this happens at the very beginning of the wp_loaded hookpoint
824
-	*
825
-	* @access public
826
-	* @return void
827
-	*/
820
+	 * set_hooks_for_shortcodes_modules_and_addons
821
+	 *
822
+	 * this is the best place for other systems to set callbacks for hooking into other parts of EE
823
+	 * this happens at the very beginning of the wp_loaded hookpoint
824
+	 *
825
+	 * @access public
826
+	 * @return void
827
+	 */
828 828
 	public function set_hooks_for_shortcodes_modules_and_addons() {
829 829
 //		do_action( 'AHEE__EE_System__set_hooks_for_shortcodes_modules_and_addons' );
830 830
 	}
@@ -833,13 +833,13 @@  discard block
 block discarded – undo
833 833
 
834 834
 
835 835
 	/**
836
-	* do_not_cache
837
-	*
838
-	* sets no cache headers and defines no cache constants for WP plugins
839
-	*
840
-	* @access public
841
-	* @return void
842
-	*/
836
+	 * do_not_cache
837
+	 *
838
+	 * sets no cache headers and defines no cache constants for WP plugins
839
+	 *
840
+	 * @access public
841
+	 * @return void
842
+	 */
843 843
 	public static function do_not_cache() {
844 844
 		// set no cache constants
845 845
 		if ( ! defined( 'DONOTCACHEPAGE' ) ) {
@@ -957,7 +957,7 @@  discard block
 block discarded – undo
957 957
 			//Current post
958 958
 			global $post;		
959 959
     	
960
-	    	if ( EE_Registry::instance()->CAP->current_user_can( 'ee_edit_event', 'ee_admin_bar_menu_espresso-toolbar-events-edit', $post->ID ) ) {
960
+			if ( EE_Registry::instance()->CAP->current_user_can( 'ee_edit_event', 'ee_admin_bar_menu_espresso-toolbar-events-edit', $post->ID ) ) {
961 961
 				//Events Edit Current Event
962 962
 				$admin_bar->add_menu(array(
963 963
 						'id' => 'espresso-toolbar-events-edit',
Please login to merge, or discard this patch.
Spacing   +255 added lines, -255 removed lines patch added patch discarded remove patch
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
 	 */
103 103
 	public static function instance() {
104 104
 		// check if class object is instantiated
105
-		if ( ! self::$_instance instanceof EE_System ) {
105
+		if ( ! self::$_instance instanceof EE_System) {
106 106
 			self::$_instance = new self();
107 107
 		}
108 108
 		return self::$_instance;
@@ -113,12 +113,12 @@  discard block
 block discarded – undo
113 113
 	 * resets the instance and returns it
114 114
 	 * @return EE_System
115 115
 	 */
116
-	public static function reset(){
116
+	public static function reset() {
117 117
 		self::$_instance->_req_type = NULL;
118 118
 		//we need to reset the migration manager in order for it to detect DMSs properly
119 119
 		EE_Data_Migration_Manager::reset();
120 120
 		//make sure none of the old hooks are left hanging around
121
-		remove_all_actions( 'AHEE__EE_System__perform_activations_upgrades_and_migrations');
121
+		remove_all_actions('AHEE__EE_System__perform_activations_upgrades_and_migrations');
122 122
 		self::instance()->detect_activations_or_upgrades();
123 123
 		self::instance()->perform_activations_upgrades_and_migrations();
124 124
 		return self::instance();
@@ -134,26 +134,26 @@  discard block
 block discarded – undo
134 134
 	 * @access    private
135 135
 	 */
136 136
 	private function __construct() {
137
-		do_action( 'AHEE__EE_System__construct__begin', $this );
137
+		do_action('AHEE__EE_System__construct__begin', $this);
138 138
 		// allow addons to load first so that they can register autoloaders, set hooks for running DMS's, etc
139
-		add_action( 'AHEE__EE_Bootstrap__load_espresso_addons', array( $this, 'load_espresso_addons' ) );
139
+		add_action('AHEE__EE_Bootstrap__load_espresso_addons', array($this, 'load_espresso_addons'));
140 140
 		// when an ee addon is activated, we want to call the core hook(s) again
141 141
 		// because the newly-activated addon didn't get a chance to run at all
142
-		add_action( 'activate_plugin', array( $this, 'load_espresso_addons' ), 1 );
142
+		add_action('activate_plugin', array($this, 'load_espresso_addons'), 1);
143 143
 		// detect whether install or upgrade
144
-		add_action( 'AHEE__EE_Bootstrap__detect_activations_or_upgrades', array( $this, 'detect_activations_or_upgrades' ), 3 );
144
+		add_action('AHEE__EE_Bootstrap__detect_activations_or_upgrades', array($this, 'detect_activations_or_upgrades'), 3);
145 145
 		// load EE_Config, EE_Textdomain, etc
146
-		add_action( 'AHEE__EE_Bootstrap__load_core_configuration', array( $this, 'load_core_configuration' ), 5 );
146
+		add_action('AHEE__EE_Bootstrap__load_core_configuration', array($this, 'load_core_configuration'), 5);
147 147
 		// load EE_Config, EE_Textdomain, etc
148
-		add_action( 'AHEE__EE_Bootstrap__register_shortcodes_modules_and_widgets', array( $this, 'register_shortcodes_modules_and_widgets' ), 7 );
148
+		add_action('AHEE__EE_Bootstrap__register_shortcodes_modules_and_widgets', array($this, 'register_shortcodes_modules_and_widgets'), 7);
149 149
 		// you wanna get going? I wanna get going... let's get going!
150
-		add_action( 'AHEE__EE_Bootstrap__brew_espresso', array( $this, 'brew_espresso' ), 9 );
150
+		add_action('AHEE__EE_Bootstrap__brew_espresso', array($this, 'brew_espresso'), 9);
151 151
 		//other housekeeping
152 152
 		//exclude EE critical pages from wp_list_pages
153
-		add_filter( 'wp_list_pages_excludes', array( $this, 'remove_pages_from_wp_list_pages' ), 10 );
153
+		add_filter('wp_list_pages_excludes', array($this, 'remove_pages_from_wp_list_pages'), 10);
154 154
 		// ALL EE Addons should use the following hook point to attach their initial setup too
155 155
 		// it's extremely important for EE Addons to register any class autoloaders so that they can be available when the EE_Config loads
156
-		do_action( 'AHEE__EE_System__construct__complete', $this );
156
+		do_action('AHEE__EE_System__construct__complete', $this);
157 157
 	}
158 158
 
159 159
 
@@ -173,10 +173,10 @@  discard block
 block discarded – undo
173 173
 	public function load_espresso_addons() {
174 174
 		// set autoloaders for all of the classes implementing EEI_Plugin_API
175 175
 		// which provide helpers for EE plugin authors to more easily register certain components with EE.
176
-		EEH_Autoloader::instance()->register_autoloaders_for_each_file_in_folder( EE_LIBRARIES . 'plugin_api' );
176
+		EEH_Autoloader::instance()->register_autoloaders_for_each_file_in_folder(EE_LIBRARIES.'plugin_api');
177 177
 		//load and setup EE_Capabilities
178
-		EE_Registry::instance()->load_core( 'Capabilities' );
179
-		do_action( 'AHEE__EE_System__load_espresso_addons' );
178
+		EE_Registry::instance()->load_core('Capabilities');
179
+		do_action('AHEE__EE_System__load_espresso_addons');
180 180
 	}
181 181
 
182 182
 
@@ -191,10 +191,10 @@  discard block
 block discarded – undo
191 191
 	 * @access public
192 192
 	 * @return void
193 193
 	 */
194
-	public function detect_activations_or_upgrades(){
194
+	public function detect_activations_or_upgrades() {
195 195
 		//first off: let's make sure to handle core
196 196
 		$this->detect_if_activation_or_upgrade();
197
-		foreach(EE_Registry::instance()->addons as $addon){
197
+		foreach (EE_Registry::instance()->addons as $addon) {
198 198
 			//detect teh request type for that addon
199 199
 			$addon->detect_activation_or_upgrade();
200 200
 		}
@@ -215,44 +215,44 @@  discard block
 block discarded – undo
215 215
 		do_action('AHEE__EE_System___detect_if_activation_or_upgrade__begin');
216 216
 
217 217
 		// load M-Mode class
218
-		EE_Registry::instance()->load_core( 'Maintenance_Mode' );
218
+		EE_Registry::instance()->load_core('Maintenance_Mode');
219 219
 		// check if db has been updated, or if its a brand-new installation
220 220
 
221 221
 		$espresso_db_update = $this->fix_espresso_db_upgrade_option();
222
-		$request_type =  $this->detect_req_type($espresso_db_update);
222
+		$request_type = $this->detect_req_type($espresso_db_update);
223 223
 		//EEH_Debug_Tools::printr( $request_type, '$request_type', __FILE__, __LINE__ );
224
-		if( $request_type != EE_System::req_type_normal){
224
+		if ($request_type != EE_System::req_type_normal) {
225 225
 			EE_Registry::instance()->load_helper('Activation');
226 226
 		}
227 227
 
228
-		switch($request_type){
228
+		switch ($request_type) {
229 229
 			case EE_System::req_type_new_activation:
230
-				do_action( 'AHEE__EE_System__detect_if_activation_or_upgrade__new_activation' );
231
-				$this->_handle_core_version_change( $espresso_db_update );
230
+				do_action('AHEE__EE_System__detect_if_activation_or_upgrade__new_activation');
231
+				$this->_handle_core_version_change($espresso_db_update);
232 232
 				break;
233 233
 			case EE_System::req_type_reactivation:
234
-				do_action( 'AHEE__EE_System__detect_if_activation_or_upgrade__reactivation' );
235
-				$this->_handle_core_version_change( $espresso_db_update );
234
+				do_action('AHEE__EE_System__detect_if_activation_or_upgrade__reactivation');
235
+				$this->_handle_core_version_change($espresso_db_update);
236 236
 				break;
237 237
 			case EE_System::req_type_upgrade:
238
-				do_action( 'AHEE__EE_System__detect_if_activation_or_upgrade__upgrade' );
238
+				do_action('AHEE__EE_System__detect_if_activation_or_upgrade__upgrade');
239 239
 				//migrations may be required now that we've upgraded
240 240
 				EE_Maintenance_Mode::instance()->set_maintenance_mode_if_db_old();
241
-				$this->_handle_core_version_change( $espresso_db_update );
241
+				$this->_handle_core_version_change($espresso_db_update);
242 242
 //				echo "done upgrade";die;
243 243
 				break;
244 244
 			case EE_System::req_type_downgrade:
245
-				do_action( 'AHEE__EE_System__detect_if_activation_or_upgrade__downgrade' );
245
+				do_action('AHEE__EE_System__detect_if_activation_or_upgrade__downgrade');
246 246
 				//its possible migrations are no longer required
247 247
 				EE_Maintenance_Mode::instance()->set_maintenance_mode_if_db_old();
248
-				$this->_handle_core_version_change( $espresso_db_update );
248
+				$this->_handle_core_version_change($espresso_db_update);
249 249
 				break;
250 250
 			case EE_System::req_type_normal:
251 251
 			default:
252 252
 //				$this->_maybe_redirect_to_ee_about();
253 253
 				break;
254 254
 		}
255
-		do_action( 'AHEE__EE_System__detect_if_activation_or_upgrade__complete' );
255
+		do_action('AHEE__EE_System__detect_if_activation_or_upgrade__complete');
256 256
 	}
257 257
 
258 258
 	/**
@@ -260,10 +260,10 @@  discard block
 block discarded – undo
260 260
 	 * initializing the database later during the request
261 261
 	 * @param array $espresso_db_update
262 262
 	 */
263
-	protected function _handle_core_version_change( $espresso_db_update ){
264
-		$this->update_list_of_installed_versions( $espresso_db_update );
263
+	protected function _handle_core_version_change($espresso_db_update) {
264
+		$this->update_list_of_installed_versions($espresso_db_update);
265 265
 		//get ready to verify the DB is ok (provided we aren't in maintenance mode, of course)
266
-		add_action( 'AHEE__EE_System__perform_activations_upgrades_and_migrations', array( $this, 'initialize_db_if_no_migrations_required' ));
266
+		add_action('AHEE__EE_System__perform_activations_upgrades_and_migrations', array($this, 'initialize_db_if_no_migrations_required'));
267 267
 	}
268 268
 
269 269
 
@@ -278,44 +278,44 @@  discard block
 block discarded – undo
278 278
 	 * @internal param array $espresso_db_update_value the value of the WordPress option. If not supplied, fetches it from the options table
279 279
 	 * @return array the correct value of 'espresso_db_upgrade', after saving it, if it needed correction
280 280
 	 */
281
-	private function fix_espresso_db_upgrade_option($espresso_db_update = null){
282
-		do_action( 'FHEE__EE_System__manage_fix_espresso_db_upgrade_option__begin', $espresso_db_update );
283
-		if( ! $espresso_db_update){
284
-			$espresso_db_update = get_option( 'espresso_db_update' );
281
+	private function fix_espresso_db_upgrade_option($espresso_db_update = null) {
282
+		do_action('FHEE__EE_System__manage_fix_espresso_db_upgrade_option__begin', $espresso_db_update);
283
+		if ( ! $espresso_db_update) {
284
+			$espresso_db_update = get_option('espresso_db_update');
285 285
 		}
286 286
 		// check that option is an array
287
-		if( ! is_array( $espresso_db_update )) {
287
+		if ( ! is_array($espresso_db_update)) {
288 288
 			// if option is FALSE, then it never existed
289
-			if ( $espresso_db_update === FALSE ) {
289
+			if ($espresso_db_update === FALSE) {
290 290
 				// make $espresso_db_update an array and save option with autoload OFF
291
-				$espresso_db_update =  array();
292
-				add_option( 'espresso_db_update', $espresso_db_update, '', 'no' );
291
+				$espresso_db_update = array();
292
+				add_option('espresso_db_update', $espresso_db_update, '', 'no');
293 293
 			} else {
294 294
 				// option is NOT FALSE but also is NOT an array, so make it an array and save it
295
-				$espresso_db_update =  array( $espresso_db_update=>array() );
296
-				update_option( 'espresso_db_update', $espresso_db_update );
295
+				$espresso_db_update = array($espresso_db_update=>array());
296
+				update_option('espresso_db_update', $espresso_db_update);
297 297
 			}
298
-		}else{
298
+		} else {
299 299
 			$corrected_db_update = array();
300 300
 			//if IS an array, but is it an array where KEYS are version numbers, and values are arrays?
301
-			foreach($espresso_db_update as $should_be_version_string => $should_be_array){
302
-				if(is_int($should_be_version_string) && ! is_array($should_be_array)){
301
+			foreach ($espresso_db_update as $should_be_version_string => $should_be_array) {
302
+				if (is_int($should_be_version_string) && ! is_array($should_be_array)) {
303 303
 					//the key is an int, and the value IS NOT an array
304 304
 					//so it must be numerically-indexed, where values are versions installed...
305 305
 					//fix it!
306 306
 					$version_string = $should_be_array;
307 307
 					$corrected_db_update[$version_string] = array('unknown-date');
308
-				}else{
308
+				} else {
309 309
 					//ok it checks out
310 310
 					$corrected_db_update[$should_be_version_string] = $should_be_array;
311 311
 				}
312 312
 			}
313 313
 			$espresso_db_update = $corrected_db_update;
314
-			update_option( 'espresso_db_update', $espresso_db_update );
314
+			update_option('espresso_db_update', $espresso_db_update);
315 315
 
316 316
 		}
317 317
 
318
-		do_action( 'FHEE__EE_System__manage_fix_espresso_db_upgrade_option__complete', $espresso_db_update );
318
+		do_action('FHEE__EE_System__manage_fix_espresso_db_upgrade_option__complete', $espresso_db_update);
319 319
 		return $espresso_db_update;
320 320
 	}
321 321
 
@@ -334,33 +334,33 @@  discard block
 block discarded – undo
334 334
 	 * so we prefer to only do it when necessary
335 335
 	 * @return void
336 336
 	 */
337
-	public function initialize_db_if_no_migrations_required( $initialize_addons_too = FALSE, $verify_schema = true ){
337
+	public function initialize_db_if_no_migrations_required($initialize_addons_too = FALSE, $verify_schema = true) {
338 338
 		$request_type = $this->detect_req_type();
339 339
 		//only initialize system if we're not in maintenance mode.
340
-		if( EE_Maintenance_Mode::instance()->level() != EE_Maintenance_Mode::level_2_complete_maintenance ){
341
-			update_option( 'ee_flush_rewrite_rules', TRUE );
340
+		if (EE_Maintenance_Mode::instance()->level() != EE_Maintenance_Mode::level_2_complete_maintenance) {
341
+			update_option('ee_flush_rewrite_rules', TRUE);
342 342
 			EEH_Activation::system_initialization();
343
-			if( $verify_schema ) {
343
+			if ($verify_schema) {
344 344
 				EEH_Activation::initialize_db_and_folders();
345 345
 			}
346 346
 			EEH_Activation::initialize_db_content();
347
-			if( $initialize_addons_too ) {
347
+			if ($initialize_addons_too) {
348 348
 				$this->initialize_addons();
349 349
 			}
350
-		}else{
351
-			EE_Data_Migration_Manager::instance()->enqueue_db_initialization_for( 'Core' );
350
+		} else {
351
+			EE_Data_Migration_Manager::instance()->enqueue_db_initialization_for('Core');
352 352
 		}
353
-		if ( $request_type == EE_System::req_type_new_activation || $request_type == EE_System::req_type_reactivation || $request_type == EE_System::req_type_upgrade ) {
354
-			add_action( 'AHEE__EE_System__load_CPTs_and_session__start', array( $this, 'redirect_to_about_ee' ), 9 );
353
+		if ($request_type == EE_System::req_type_new_activation || $request_type == EE_System::req_type_reactivation || $request_type == EE_System::req_type_upgrade) {
354
+			add_action('AHEE__EE_System__load_CPTs_and_session__start', array($this, 'redirect_to_about_ee'), 9);
355 355
 		}
356 356
 	}
357 357
 
358 358
 	/**
359 359
 	 * Initializes the db for all registered addons
360 360
 	 */
361
-	public function initialize_addons(){
361
+	public function initialize_addons() {
362 362
 		//foreach registered addon, make sure its db is up-to-date too
363
-		foreach(EE_Registry::instance()->addons as $addon){
363
+		foreach (EE_Registry::instance()->addons as $addon) {
364 364
 			$addon->initialize_db_if_no_migrations_required();
365 365
 		}
366 366
 	}
@@ -372,16 +372,16 @@  discard block
 block discarded – undo
372 372
 	 * @param 	string 	$current_version_to_add 	version to be added to the version history
373 373
 	 * @return 	boolean success as to whether or not this option was changed
374 374
 	 */
375
-	public function update_list_of_installed_versions($version_history = NULL,$current_version_to_add = NULL) {
376
-		if( ! $version_history ) {
375
+	public function update_list_of_installed_versions($version_history = NULL, $current_version_to_add = NULL) {
376
+		if ( ! $version_history) {
377 377
 			$version_history = $this->fix_espresso_db_upgrade_option($version_history);
378 378
 		}
379
-		if( $current_version_to_add == NULL){
379
+		if ($current_version_to_add == NULL) {
380 380
 			$current_version_to_add = espresso_version();
381 381
 		}
382
-		$version_history[ $current_version_to_add ][] = date( 'Y-m-d H:i:s',time() );
382
+		$version_history[$current_version_to_add][] = date('Y-m-d H:i:s', time());
383 383
 		// re-save
384
-		return update_option( 'espresso_db_update', $version_history );
384
+		return update_option('espresso_db_update', $version_history);
385 385
 	}
386 386
 
387 387
 
@@ -398,10 +398,10 @@  discard block
 block discarded – undo
398 398
 	 *                            but still know if this is a new install or not
399 399
 	 * @return int one of the constants on EE_System::req_type_
400 400
 	 */
401
-	public function detect_req_type( $espresso_db_update = NULL ){
402
-		if ( $this->_req_type === NULL ){
403
-			$espresso_db_update = ! empty( $espresso_db_update ) ? $espresso_db_update : $this->fix_espresso_db_upgrade_option();
404
-			$this->_req_type = $this->detect_req_type_given_activation_history( $espresso_db_update, 'ee_espresso_activation', espresso_version() );
401
+	public function detect_req_type($espresso_db_update = NULL) {
402
+		if ($this->_req_type === NULL) {
403
+			$espresso_db_update = ! empty($espresso_db_update) ? $espresso_db_update : $this->fix_espresso_db_upgrade_option();
404
+			$this->_req_type = $this->detect_req_type_given_activation_history($espresso_db_update, 'ee_espresso_activation', espresso_version());
405 405
 		}
406 406
 		return $this->_req_type;
407 407
 	}
@@ -417,39 +417,39 @@  discard block
 block discarded – undo
417 417
 	 * @param string $version_to_upgrade_to the version that was just upgraded to (for core that will be espresso_version())
418 418
 	 * @return int one of the constants on EE_System::req_type_*
419 419
 	 */
420
-	public static function detect_req_type_given_activation_history( $activation_history_for_addon, $activation_indicator_option_name, $version_to_upgrade_to ){
421
-		$version_is_higher = self::_new_version_is_higher( $activation_history_for_addon, $version_to_upgrade_to );
422
-		if( $activation_history_for_addon ){
420
+	public static function detect_req_type_given_activation_history($activation_history_for_addon, $activation_indicator_option_name, $version_to_upgrade_to) {
421
+		$version_is_higher = self::_new_version_is_higher($activation_history_for_addon, $version_to_upgrade_to);
422
+		if ($activation_history_for_addon) {
423 423
 			//it exists, so this isn't a completely new install
424 424
 			//check if this version already in that list of previously installed versions
425
-			if ( ! isset( $activation_history_for_addon[ $version_to_upgrade_to ] )) {
425
+			if ( ! isset($activation_history_for_addon[$version_to_upgrade_to])) {
426 426
 				//it a version we haven't seen before
427
-				if( $version_is_higher === 1 ){
427
+				if ($version_is_higher === 1) {
428 428
 					$req_type = EE_System::req_type_upgrade;
429
-				}else{
429
+				} else {
430 430
 					$req_type = EE_System::req_type_downgrade;
431 431
 				}
432
-				delete_option( $activation_indicator_option_name );
432
+				delete_option($activation_indicator_option_name);
433 433
 			} else {
434 434
 				// its not an update. maybe a reactivation?
435
-				if( get_option( $activation_indicator_option_name, FALSE ) ){
436
-					if ( $version_is_higher === -1 ){
435
+				if (get_option($activation_indicator_option_name, FALSE)) {
436
+					if ($version_is_higher === -1) {
437 437
 						$req_type = EE_System::req_type_downgrade;
438
-					}elseif( $version_is_higher === 0 ){
438
+					}elseif ($version_is_higher === 0) {
439 439
 						//we've seen this version before, but it's an activation. must be a reactivation
440 440
 						$req_type = EE_System::req_type_reactivation;
441
-					}else{//$version_is_higher === 1
441
+					} else {//$version_is_higher === 1
442 442
 						$req_type = EE_System::req_type_upgrade;
443 443
 					}
444
-					delete_option( $activation_indicator_option_name );
444
+					delete_option($activation_indicator_option_name);
445 445
 				} else {
446 446
 					//we've seen this version before and the activation indicate doesn't show it was just activated
447
-					if ( $version_is_higher === -1 ){
447
+					if ($version_is_higher === -1) {
448 448
 						$req_type = EE_System::req_type_downgrade;
449
-					}elseif( $version_is_higher === 0 ){
449
+					}elseif ($version_is_higher === 0) {
450 450
 						//we've seen this version before and it's not an activation. its normal request
451 451
 						$req_type = EE_System::req_type_normal;
452
-					}else{//$version_is_higher === 1
452
+					} else {//$version_is_higher === 1
453 453
 						$req_type = EE_System::req_type_upgrade;
454 454
 					}
455 455
 				}
@@ -457,7 +457,7 @@  discard block
 block discarded – undo
457 457
 		} else {
458 458
 			//brand new install
459 459
 			$req_type = EE_System::req_type_new_activation;
460
-			delete_option( $activation_indicator_option_name );
460
+			delete_option($activation_indicator_option_name);
461 461
 		}
462 462
 		return $req_type;
463 463
 	}
@@ -475,30 +475,30 @@  discard block
 block discarded – undo
475 475
 	 *		0 if $version_to_upgrade_to MATCHES (reactivation or normal request);
476 476
 	 *		1 if $version_to_upgrade_to is HIGHER (upgrade) ;
477 477
 	 */
478
-	protected static function _new_version_is_higher( $activation_history_for_addon, $version_to_upgrade_to ){
478
+	protected static function _new_version_is_higher($activation_history_for_addon, $version_to_upgrade_to) {
479 479
 		//find the most recently-activated version
480 480
 		$most_recently_active_version_activation = '1970-01-01 00:00:00';
481 481
 		$most_recently_active_version = '0.0.0.dev.000';
482
-		if( is_array( $activation_history_for_addon ) ){
483
-			foreach( $activation_history_for_addon as $version => $times_activated ){
482
+		if (is_array($activation_history_for_addon)) {
483
+			foreach ($activation_history_for_addon as $version => $times_activated) {
484 484
 				//check there is a record of when this version was activated. Otherwise,
485 485
 				//mark it as unknown
486
-				if( ! $times_activated ){
487
-					$times_activated = array( 'unknown-date');
486
+				if ( ! $times_activated) {
487
+					$times_activated = array('unknown-date');
488 488
 				}
489
-				if( is_string( $times_activated ) ){
490
-					$times_activated = array( $times_activated );
489
+				if (is_string($times_activated)) {
490
+					$times_activated = array($times_activated);
491 491
 				}
492
-				foreach( $times_activated as $an_activation ){
493
-					if( $an_activation != 'unknown-date' &&
494
-							$an_activation > $most_recently_active_version_activation  ){
492
+				foreach ($times_activated as $an_activation) {
493
+					if ($an_activation != 'unknown-date' &&
494
+							$an_activation > $most_recently_active_version_activation) {
495 495
 						$most_recently_active_version = $version;
496 496
 						$most_recently_active_version_activation = $an_activation == 'unknown-date' ? '1970-01-01 00:00:00' : $an_activation;
497 497
 					}
498 498
 				}
499 499
 			}
500 500
 		}
501
-		return version_compare( $version_to_upgrade_to, $most_recently_active_version );
501
+		return version_compare($version_to_upgrade_to, $most_recently_active_version);
502 502
 	}
503 503
 
504 504
 
@@ -508,20 +508,20 @@  discard block
 block discarded – undo
508 508
 	 * @return void
509 509
 	 */
510 510
 	public function redirect_to_about_ee() {
511
-		$notices = EE_Error::get_notices( FALSE );
511
+		$notices = EE_Error::get_notices(FALSE);
512 512
 		//if current user is an admin and it's not an ajax request
513
-		if(EE_Registry::instance()->CAP->current_user_can( 'manage_options', 'espresso_about_default' ) && ! ( defined('DOING_AJAX') && DOING_AJAX  ) && ! isset( $notices[ 'errors' ] ) ){
514
-			$query_params =  array( 'page' => 'espresso_about' );
513
+		if (EE_Registry::instance()->CAP->current_user_can('manage_options', 'espresso_about_default') && ! (defined('DOING_AJAX') && DOING_AJAX) && ! isset($notices['errors'])) {
514
+			$query_params = array('page' => 'espresso_about');
515 515
 
516
-			if ( EE_System::instance()->detect_req_type() == EE_System::req_type_new_activation ) {
516
+			if (EE_System::instance()->detect_req_type() == EE_System::req_type_new_activation) {
517 517
 			    $query_params['new_activation'] = TRUE;
518 518
 			}
519 519
 
520
-			if ( EE_System::instance()->detect_req_type() == EE_System::req_type_reactivation ) {
520
+			if (EE_System::instance()->detect_req_type() == EE_System::req_type_reactivation) {
521 521
 			    $query_params['reactivation'] = TRUE;
522 522
 			}
523
-			$url = add_query_arg( $query_params, admin_url( 'admin.php' ) );
524
-			wp_safe_redirect( $url );
523
+			$url = add_query_arg($query_params, admin_url('admin.php'));
524
+			wp_safe_redirect($url);
525 525
 			exit();
526 526
 		}
527 527
 	}
@@ -535,31 +535,31 @@  discard block
 block discarded – undo
535 535
 	 *
536 536
 	 * @return void
537 537
 	 */
538
-	public function load_core_configuration(){
539
-		do_action( 'AHEE__EE_System__load_core_configuration__begin', $this );
540
-		EE_Registry::instance()->load_core( 'EE_Load_Textdomain' );
538
+	public function load_core_configuration() {
539
+		do_action('AHEE__EE_System__load_core_configuration__begin', $this);
540
+		EE_Registry::instance()->load_core('EE_Load_Textdomain');
541 541
 		//load textdomain
542 542
 		EE_Load_Textdomain::load_textdomain();
543 543
 		// load and setup EE_Config and EE_Network_Config
544
-		EE_Registry::instance()->load_core( 'Config' );
545
-		EE_Registry::instance()->load_core( 'Network_Config' );
544
+		EE_Registry::instance()->load_core('Config');
545
+		EE_Registry::instance()->load_core('Network_Config');
546 546
 		// setup autoloaders
547 547
 		// enable logging?
548
-		if ( EE_Registry::instance()->CFG->admin->use_full_logging ) {
549
-			EE_Registry::instance()->load_core( 'Log' );
548
+		if (EE_Registry::instance()->CFG->admin->use_full_logging) {
549
+			EE_Registry::instance()->load_core('Log');
550 550
 		}
551 551
 		// check for activation errors
552
-		$activation_errors = get_option( 'ee_plugin_activation_errors', FALSE );
553
-		if ( $activation_errors ) {
554
-			EE_Error::add_error( $activation_errors, __FILE__, __FUNCTION__, __LINE__ );
555
-			update_option( 'ee_plugin_activation_errors', FALSE );
552
+		$activation_errors = get_option('ee_plugin_activation_errors', FALSE);
553
+		if ($activation_errors) {
554
+			EE_Error::add_error($activation_errors, __FILE__, __FUNCTION__, __LINE__);
555
+			update_option('ee_plugin_activation_errors', FALSE);
556 556
 		}
557 557
 		// get model names
558 558
 		$this->_parse_model_names();
559 559
 
560 560
 		//load caf stuff a chance to play during the activation process too.
561 561
 		$this->_maybe_brew_regular();
562
-		do_action( 'AHEE__EE_System__load_core_configuration__complete', $this );
562
+		do_action('AHEE__EE_System__load_core_configuration__complete', $this);
563 563
 	}
564 564
 
565 565
 
@@ -568,23 +568,23 @@  discard block
 block discarded – undo
568 568
 	 *
569 569
 	 * @return void
570 570
 	 */
571
-	private function _parse_model_names(){
571
+	private function _parse_model_names() {
572 572
 		//get all the files in the EE_MODELS folder that end in .model.php
573
-		$models = glob( EE_MODELS.'*.model.php');
573
+		$models = glob(EE_MODELS.'*.model.php');
574 574
 		$model_names = array();
575 575
 		$non_abstract_db_models = array();
576
-		foreach( $models as $model ){
576
+		foreach ($models as $model) {
577 577
 			// get model classname
578
-			$classname = EEH_File::get_classname_from_filepath_with_standard_filename( $model );
579
-			$shortname = str_replace( 'EEM_', '', $classname );
578
+			$classname = EEH_File::get_classname_from_filepath_with_standard_filename($model);
579
+			$shortname = str_replace('EEM_', '', $classname);
580 580
 			$reflectionClass = new ReflectionClass($classname);
581
-			if( $reflectionClass->isSubclassOf('EEM_Base') && ! $reflectionClass->isAbstract()){
581
+			if ($reflectionClass->isSubclassOf('EEM_Base') && ! $reflectionClass->isAbstract()) {
582 582
 				$non_abstract_db_models[$shortname] = $classname;
583 583
 			}
584
-			$model_names[ $shortname ] = $classname;
584
+			$model_names[$shortname] = $classname;
585 585
 		}
586
-		EE_Registry::instance()->models = apply_filters( 'FHEE__EE_System__parse_model_names', $model_names );
587
-		EE_Registry::instance()->non_abstract_db_models = apply_filters( 'FHEE__EE_System__parse_implemented_model_names', $non_abstract_db_models );
586
+		EE_Registry::instance()->models = apply_filters('FHEE__EE_System__parse_model_names', $model_names);
587
+		EE_Registry::instance()->non_abstract_db_models = apply_filters('FHEE__EE_System__parse_implemented_model_names', $non_abstract_db_models);
588 588
 	}
589 589
 
590 590
 
@@ -594,8 +594,8 @@  discard block
 block discarded – undo
594 594
 	 * @return void
595 595
 	 */
596 596
 	private function _maybe_brew_regular() {
597
-		if (( ! defined( 'EE_DECAF' ) ||  EE_DECAF !== TRUE ) && is_readable( EE_CAFF_PATH . 'brewing_regular.php' )) {
598
-			require_once EE_CAFF_PATH . 'brewing_regular.php';
597
+		if (( ! defined('EE_DECAF') || EE_DECAF !== TRUE) && is_readable(EE_CAFF_PATH.'brewing_regular.php')) {
598
+			require_once EE_CAFF_PATH.'brewing_regular.php';
599 599
 		}
600 600
 	}
601 601
 
@@ -612,9 +612,9 @@  discard block
 block discarded – undo
612 612
 	 * @return void
613 613
 	 */
614 614
 	public function register_shortcodes_modules_and_widgets() {
615
-		do_action( 'AHEE__EE_System__register_shortcodes_modules_and_widgets' );
615
+		do_action('AHEE__EE_System__register_shortcodes_modules_and_widgets');
616 616
 		// check for addons using old hookpoint
617
-		if ( has_action( 'AHEE__EE_System__register_shortcodes_modules_and_addons' )) {
617
+		if (has_action('AHEE__EE_System__register_shortcodes_modules_and_addons')) {
618 618
 			$this->_incompatible_addon_error();
619 619
 		}
620 620
 	}
@@ -628,19 +628,19 @@  discard block
 block discarded – undo
628 628
 	*/
629 629
 	private function _incompatible_addon_error() {
630 630
 		// get array of classes hooking into here
631
-		$class_names = EEH_Class_Tools::get_class_names_for_all_callbacks_on_hook( 'AHEE__EE_System__register_shortcodes_modules_and_addons' );
632
-		if ( ! empty( $class_names )) {
633
-			$msg = __( 'The following plugins, addons, or modules appear to be incompatible with this version of Event Espresso and were automatically deactivated to avoid fatal errors:', 'event_espresso' );
631
+		$class_names = EEH_Class_Tools::get_class_names_for_all_callbacks_on_hook('AHEE__EE_System__register_shortcodes_modules_and_addons');
632
+		if ( ! empty($class_names)) {
633
+			$msg = __('The following plugins, addons, or modules appear to be incompatible with this version of Event Espresso and were automatically deactivated to avoid fatal errors:', 'event_espresso');
634 634
 			$msg .= '<ul>';
635
-			foreach ( $class_names as $class_name ) {
636
-				$msg .= '<li><b>Event Espresso - ' . str_replace( array( 'EE_', 'EEM_', 'EED_', 'EES_', 'EEW_' ), '', $class_name ) . '</b></li>';
635
+			foreach ($class_names as $class_name) {
636
+				$msg .= '<li><b>Event Espresso - '.str_replace(array('EE_', 'EEM_', 'EED_', 'EES_', 'EEW_'), '', $class_name).'</b></li>';
637 637
 			}
638 638
 			$msg .= '</ul>';
639
-			$msg .= __( 'Compatibility issues can be avoided and/or resolved by keeping addons and plugins updated to the latest version.', 'event_espresso' );
639
+			$msg .= __('Compatibility issues can be avoided and/or resolved by keeping addons and plugins updated to the latest version.', 'event_espresso');
640 640
 			// save list of incompatible addons to wp-options for later use
641
-			add_option( 'ee_incompatible_addons', $class_names, '', 'no' );
642
-			if ( is_admin() ) {
643
-				EE_Error::add_error( $msg, __FILE__, __FUNCTION__, __LINE__ );
641
+			add_option('ee_incompatible_addons', $class_names, '', 'no');
642
+			if (is_admin()) {
643
+				EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
644 644
 			}
645 645
 		}
646 646
 	}
@@ -657,25 +657,25 @@  discard block
 block discarded – undo
657 657
 	 *
658 658
 	 * @return void
659 659
 	 */
660
-	public function brew_espresso(){
661
-		do_action( 'AHEE__EE_System__brew_espresso__begin', $this );
660
+	public function brew_espresso() {
661
+		do_action('AHEE__EE_System__brew_espresso__begin', $this);
662 662
 		// load some final core systems
663
-		add_action( 'init', array( $this, 'set_hooks_for_core' ), 1 );
664
-		add_action( 'init', array( $this, 'perform_activations_upgrades_and_migrations' ), 3 );
665
-		add_action( 'init', array( $this, 'load_CPTs_and_session' ), 5 );
666
-		add_action( 'init', array( $this, 'load_controllers' ), 7 );
667
-		add_action( 'init', array( $this, 'core_loaded_and_ready' ), 9 );
668
-		add_action( 'init', array( $this, 'initialize' ), 10 );
669
-		add_action( 'init', array( $this, 'initialize_last' ), 100 );
670
-		add_action('wp_enqueue_scripts', array( $this, 'wp_enqueue_scripts' ), 25 );
671
-		add_action( 'admin_bar_menu', array( $this, 'espresso_toolbar_items' ), 100 );
672
-
673
-		if ( is_admin() && apply_filters( 'FHEE__EE_System__brew_espresso__load_pue', TRUE )  ) {
663
+		add_action('init', array($this, 'set_hooks_for_core'), 1);
664
+		add_action('init', array($this, 'perform_activations_upgrades_and_migrations'), 3);
665
+		add_action('init', array($this, 'load_CPTs_and_session'), 5);
666
+		add_action('init', array($this, 'load_controllers'), 7);
667
+		add_action('init', array($this, 'core_loaded_and_ready'), 9);
668
+		add_action('init', array($this, 'initialize'), 10);
669
+		add_action('init', array($this, 'initialize_last'), 100);
670
+		add_action('wp_enqueue_scripts', array($this, 'wp_enqueue_scripts'), 25);
671
+		add_action('admin_bar_menu', array($this, 'espresso_toolbar_items'), 100);
672
+
673
+		if (is_admin() && apply_filters('FHEE__EE_System__brew_espresso__load_pue', TRUE)) {
674 674
 			// pew pew pew
675
-			EE_Registry::instance()->load_core( 'PUE' );
676
-			do_action( 'AHEE__EE_System__brew_espresso__after_pue_init' );
675
+			EE_Registry::instance()->load_core('PUE');
676
+			do_action('AHEE__EE_System__brew_espresso__after_pue_init');
677 677
 		}
678
-		do_action( 'AHEE__EE_System__brew_espresso__complete', $this );
678
+		do_action('AHEE__EE_System__brew_espresso__complete', $this);
679 679
 	}
680 680
 
681 681
 
@@ -689,7 +689,7 @@  discard block
 block discarded – undo
689 689
 	 */
690 690
 	public function set_hooks_for_core() {
691 691
 		$this->_deactivate_incompatible_addons();
692
-		do_action( 'AHEE__EE_System__set_hooks_for_core' );
692
+		do_action('AHEE__EE_System__set_hooks_for_core');
693 693
 	}
694 694
 
695 695
 
@@ -698,15 +698,15 @@  discard block
 block discarded – undo
698 698
 	 * Using the information gathered in EE_System::_incompatible_addon_error,
699 699
 	 * deactivates any addons considered incompatible with the current version of EE
700 700
 	 */
701
-	private function _deactivate_incompatible_addons(){
702
-		$incompatible_addons = get_option( 'ee_incompatible_addons', array() );
703
-		if ( ! empty( $incompatible_addons )) {
704
-			$active_plugins = get_option( 'active_plugins', array() );
705
-			foreach ( $active_plugins as $active_plugin ) {
706
-				foreach ( $incompatible_addons as $incompatible_addon ) {
707
-					if ( strpos( $active_plugin,  $incompatible_addon ) !== FALSE ) {
708
-						unset( $_GET['activate'] );
709
-						espresso_deactivate_plugin( $active_plugin );
701
+	private function _deactivate_incompatible_addons() {
702
+		$incompatible_addons = get_option('ee_incompatible_addons', array());
703
+		if ( ! empty($incompatible_addons)) {
704
+			$active_plugins = get_option('active_plugins', array());
705
+			foreach ($active_plugins as $active_plugin) {
706
+				foreach ($incompatible_addons as $incompatible_addon) {
707
+					if (strpos($active_plugin, $incompatible_addon) !== FALSE) {
708
+						unset($_GET['activate']);
709
+						espresso_deactivate_plugin($active_plugin);
710 710
 					}
711 711
 				}
712 712
 			}
@@ -723,10 +723,10 @@  discard block
 block discarded – undo
723 723
 	 */
724 724
 	public function perform_activations_upgrades_and_migrations() {
725 725
 		//first check if we had previously attempted to setup EE's directories but failed
726
-		if( EEH_Activation::upload_directories_incomplete() ) {
726
+		if (EEH_Activation::upload_directories_incomplete()) {
727 727
 			EEH_Activation::create_upload_directories();
728 728
 		}
729
-		do_action( 'AHEE__EE_System__perform_activations_upgrades_and_migrations' );
729
+		do_action('AHEE__EE_System__perform_activations_upgrades_and_migrations');
730 730
 	}
731 731
 
732 732
 
@@ -738,10 +738,10 @@  discard block
 block discarded – undo
738 738
 	 *  	@return 	void
739 739
 	 */
740 740
 	public function load_CPTs_and_session() {
741
-		do_action( 'AHEE__EE_System__load_CPTs_and_session__start' );
741
+		do_action('AHEE__EE_System__load_CPTs_and_session__start');
742 742
 		// register Custom Post Types
743
-		EE_Registry::instance()->load_core( 'Register_CPTs' );
744
-		do_action( 'AHEE__EE_System__load_CPTs_and_session__complete' );
743
+		EE_Registry::instance()->load_core('Register_CPTs');
744
+		do_action('AHEE__EE_System__load_CPTs_and_session__complete');
745 745
 	}
746 746
 
747 747
 
@@ -756,16 +756,16 @@  discard block
 block discarded – undo
756 756
 	* @return void
757 757
 	*/
758 758
 	public function load_controllers() {
759
-		do_action( 'AHEE__EE_System__load_controllers__start' );
759
+		do_action('AHEE__EE_System__load_controllers__start');
760 760
 		// let's get it started
761
-		if ( ! is_admin() && !  EE_Maintenance_Mode::instance()->level() ) {
762
-			do_action( 'AHEE__EE_System__load_controllers__load_front_controllers' );
763
-			EE_Registry::instance()->load_core( 'Front_Controller' );
764
-		} else if ( ! EE_FRONT_AJAX ) {
765
-			do_action( 'AHEE__EE_System__load_controllers__load_admin_controllers' );
766
-			EE_Registry::instance()->load_core( 'Admin' );
761
+		if ( ! is_admin() && ! EE_Maintenance_Mode::instance()->level()) {
762
+			do_action('AHEE__EE_System__load_controllers__load_front_controllers');
763
+			EE_Registry::instance()->load_core('Front_Controller');
764
+		} else if ( ! EE_FRONT_AJAX) {
765
+			do_action('AHEE__EE_System__load_controllers__load_admin_controllers');
766
+			EE_Registry::instance()->load_core('Admin');
767 767
 		}
768
-		do_action( 'AHEE__EE_System__load_controllers__complete' );
768
+		do_action('AHEE__EE_System__load_controllers__complete');
769 769
 	}
770 770
 
771 771
 
@@ -779,10 +779,10 @@  discard block
 block discarded – undo
779 779
 	* @return void
780 780
 	*/
781 781
 	public function core_loaded_and_ready() {
782
-		do_action( 'AHEE__EE_System__core_loaded_and_ready' );
783
-		do_action( 'AHEE__EE_System__set_hooks_for_shortcodes_modules_and_addons' );
782
+		do_action('AHEE__EE_System__core_loaded_and_ready');
783
+		do_action('AHEE__EE_System__set_hooks_for_shortcodes_modules_and_addons');
784 784
 //		add_action( 'wp_loaded', array( $this, 'set_hooks_for_shortcodes_modules_and_addons' ), 1 );
785
-		EE_Registry::instance()->load_core( 'Session' );
785
+		EE_Registry::instance()->load_core('Session');
786 786
 	}
787 787
 
788 788
 
@@ -796,7 +796,7 @@  discard block
 block discarded – undo
796 796
 	* @return void
797 797
 	*/
798 798
 	public function initialize() {
799
-		do_action( 'AHEE__EE_System__initialize' );
799
+		do_action('AHEE__EE_System__initialize');
800 800
 	}
801 801
 
802 802
 
@@ -810,7 +810,7 @@  discard block
 block discarded – undo
810 810
 	* @return void
811 811
 	*/
812 812
 	public function initialize_last() {
813
-		do_action( 'AHEE__EE_System__initialize_last' );
813
+		do_action('AHEE__EE_System__initialize_last');
814 814
 	}
815 815
 
816 816
 
@@ -842,21 +842,21 @@  discard block
 block discarded – undo
842 842
 	*/
843 843
 	public static function do_not_cache() {
844 844
 		// set no cache constants
845
-		if ( ! defined( 'DONOTCACHEPAGE' ) ) {
846
-			define( 'DONOTCACHEPAGE', true );
845
+		if ( ! defined('DONOTCACHEPAGE')) {
846
+			define('DONOTCACHEPAGE', true);
847 847
 		}
848
-		if ( ! defined( 'DONOTCACHCEOBJECT' ) ) {
849
-			define( 'DONOTCACHCEOBJECT', true );
848
+		if ( ! defined('DONOTCACHCEOBJECT')) {
849
+			define('DONOTCACHCEOBJECT', true);
850 850
 		}
851
-		if ( ! defined( 'DONOTCACHEDB' ) ) {
852
-			define( 'DONOTCACHEDB', true );
851
+		if ( ! defined('DONOTCACHEDB')) {
852
+			define('DONOTCACHEDB', true);
853 853
 		}
854 854
 		// add no cache headers
855
-		add_action( 'send_headers' , array( 'EE_System', 'nocache_headers' ), 10 );
855
+		add_action('send_headers', array('EE_System', 'nocache_headers'), 10);
856 856
 		// plus a little extra for nginx
857
-		add_filter( 'nocache_headers', array( 'EE_System', 'nocache_headers_nginx' ), 10, 1 );
857
+		add_filter('nocache_headers', array('EE_System', 'nocache_headers_nginx'), 10, 1);
858 858
 		// prevent browsers from prefetching of the rel='next' link, because it may contain content that interferes with the registration process
859
-		remove_action( 'wp_head', 'adjacent_posts_rel_link_wp_head' );
859
+		remove_action('wp_head', 'adjacent_posts_rel_link_wp_head');
860 860
 	}
861 861
 
862 862
 
@@ -868,7 +868,7 @@  discard block
 block discarded – undo
868 868
 	 * @param $headers
869 869
 	 * @return    array
870 870
 	 */
871
-	public static function nocache_headers_nginx ( $headers ) {
871
+	public static function nocache_headers_nginx($headers) {
872 872
 		$headers['X-Accel-Expires'] = 0;
873 873
 		return $headers;
874 874
 	}
@@ -894,15 +894,15 @@  discard block
 block discarded – undo
894 894
 	 * @param $admin_bar
895 895
 	 * @return    void
896 896
 	 */
897
-	public function espresso_toolbar_items( $admin_bar ) {
897
+	public function espresso_toolbar_items($admin_bar) {
898 898
 
899 899
 		// if in full M-Mode, or its an AJAX request, or user is NOT an admin
900
-		if ( EE_Maintenance_Mode::instance()->level() == EE_Maintenance_Mode::level_2_complete_maintenance || defined( 'DOING_AJAX' ) || ! EE_Registry::instance()->CAP->current_user_can( 'ee_read_ee', 'ee_admin_bar_menu_top_level' )) {
900
+		if (EE_Maintenance_Mode::instance()->level() == EE_Maintenance_Mode::level_2_complete_maintenance || defined('DOING_AJAX') || ! EE_Registry::instance()->CAP->current_user_can('ee_read_ee', 'ee_admin_bar_menu_top_level')) {
901 901
 			return;
902 902
 		}
903 903
 
904
-		do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' );
905
-		EE_Registry::instance()->load_helper( 'URL' );
904
+		do_action('AHEE_log', __FILE__, __FUNCTION__, '');
905
+		EE_Registry::instance()->load_helper('URL');
906 906
 		$menu_class = 'espresso_menu_item_class';
907 907
 		//we don't use the constants EVENTS_ADMIN_URL or REG_ADMIN_URL
908 908
 		//because they're only defined in each of their respective constructors
@@ -914,20 +914,20 @@  discard block
 block discarded – undo
914 914
 		//Top Level
915 915
 		$admin_bar->add_menu(array(
916 916
 				'id' => 'espresso-toolbar',
917
-				'title' => '<span class="ee-icon ee-icon-ee-cup-thick ee-icon-size-20"></span><span class="ab-label">' . _x('Event Espresso', 'admin bar menu group label', 'event_espresso') . '</span>',
917
+				'title' => '<span class="ee-icon ee-icon-ee-cup-thick ee-icon-size-20"></span><span class="ab-label">'._x('Event Espresso', 'admin bar menu group label', 'event_espresso').'</span>',
918 918
 				'href' => $events_admin_url,
919 919
 				'meta' => array(
920 920
 						'title' => __('Event Espresso', 'event_espresso'),
921
-						'class' => $menu_class . 'first'
921
+						'class' => $menu_class.'first'
922 922
 				),
923 923
 		));
924 924
 
925 925
 		//Events
926
-		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_read_events', 'ee_admin_bar_menu_espresso-toolbar-events' ) ) {
926
+		if (EE_Registry::instance()->CAP->current_user_can('ee_read_events', 'ee_admin_bar_menu_espresso-toolbar-events')) {
927 927
 			$admin_bar->add_menu(array(
928 928
 					'id' => 'espresso-toolbar-events',
929 929
 					'parent' => 'espresso-toolbar',
930
-					'title' => __( 'Events', 'event_espresso' ),
930
+					'title' => __('Events', 'event_espresso'),
931 931
 					'href' => $events_admin_url,
932 932
 					'meta' => array(
933 933
 							'title' => __('Events', 'event_espresso'),
@@ -938,13 +938,13 @@  discard block
 block discarded – undo
938 938
 		}
939 939
 
940 940
 
941
-		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_edit_events', 'ee_admin_bar_menu_espresso-toolbar-events-new' ) ) {
941
+		if (EE_Registry::instance()->CAP->current_user_can('ee_edit_events', 'ee_admin_bar_menu_espresso-toolbar-events-new')) {
942 942
 			//Events Add New
943 943
 			$admin_bar->add_menu(array(
944 944
 					'id' => 'espresso-toolbar-events-new',
945 945
 					'parent' => 'espresso-toolbar-events',
946 946
 					'title' => __('Add New', 'event_espresso'),
947
-					'href' => EEH_URL::add_query_args_and_nonce( array( 'action'=>'create_new' ), $events_admin_url ),
947
+					'href' => EEH_URL::add_query_args_and_nonce(array('action'=>'create_new'), $events_admin_url),
948 948
 					'meta' => array(
949 949
 							'title' => __('Add New', 'event_espresso'),
950 950
 							'target' => '',
@@ -953,18 +953,18 @@  discard block
 block discarded – undo
953 953
 			));
954 954
 		}
955 955
 
956
-		if ( is_single() && ( get_post_type() == 'espresso_events' ) ) {
956
+		if (is_single() && (get_post_type() == 'espresso_events')) {
957 957
 
958 958
 			//Current post
959 959
 			global $post;		
960 960
     	
961
-	    	if ( EE_Registry::instance()->CAP->current_user_can( 'ee_edit_event', 'ee_admin_bar_menu_espresso-toolbar-events-edit', $post->ID ) ) {
961
+	    	if (EE_Registry::instance()->CAP->current_user_can('ee_edit_event', 'ee_admin_bar_menu_espresso-toolbar-events-edit', $post->ID)) {
962 962
 				//Events Edit Current Event
963 963
 				$admin_bar->add_menu(array(
964 964
 						'id' => 'espresso-toolbar-events-edit',
965 965
 						'parent' => 'espresso-toolbar-events',
966 966
 						'title' => __('Edit Event', 'event_espresso'),
967
-						'href' => EEH_URL::add_query_args_and_nonce( array( 'action'=>'edit', 'post'=>$post->ID ), $events_admin_url ),
967
+						'href' => EEH_URL::add_query_args_and_nonce(array('action'=>'edit', 'post'=>$post->ID), $events_admin_url),
968 968
 						'meta' => array(
969 969
 								'title' => __('Edit Event', 'event_espresso'),
970 970
 								'target' => '',
@@ -976,11 +976,11 @@  discard block
 block discarded – undo
976 976
 		}
977 977
 
978 978
 		//Events View
979
-		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_read_events', 'ee_admin_bar_menu_espresso-toolbar-events-view' ) ) {
979
+		if (EE_Registry::instance()->CAP->current_user_can('ee_read_events', 'ee_admin_bar_menu_espresso-toolbar-events-view')) {
980 980
 			$admin_bar->add_menu(array(
981 981
 					'id' => 'espresso-toolbar-events-view',
982 982
 					'parent' => 'espresso-toolbar-events',
983
-					'title' => __( 'View', 'event_espresso' ),
983
+					'title' => __('View', 'event_espresso'),
984 984
 					'href' => $events_admin_url,
985 985
 					'meta' => array(
986 986
 							'title' => __('View', 'event_espresso'),
@@ -990,12 +990,12 @@  discard block
 block discarded – undo
990 990
 			));
991 991
 		}
992 992
 
993
-		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_read_events', 'ee_admin_bar_menu_espresso-toolbar-events-all' ) ) {
993
+		if (EE_Registry::instance()->CAP->current_user_can('ee_read_events', 'ee_admin_bar_menu_espresso-toolbar-events-all')) {
994 994
 			//Events View All
995 995
 			$admin_bar->add_menu(array(
996 996
 					'id' => 'espresso-toolbar-events-all',
997 997
 					'parent' => 'espresso-toolbar-events-view',
998
-					'title' => __( 'All', 'event_espresso' ),
998
+					'title' => __('All', 'event_espresso'),
999 999
 					'href' => $events_admin_url,
1000 1000
 					'meta' => array(
1001 1001
 							'title' => __('All', 'event_espresso'),
@@ -1006,13 +1006,13 @@  discard block
 block discarded – undo
1006 1006
 		}
1007 1007
 
1008 1008
 
1009
-		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_read_events', 'ee_admin_bar_menu_espresso-toolbar-events-today' ) ) {
1009
+		if (EE_Registry::instance()->CAP->current_user_can('ee_read_events', 'ee_admin_bar_menu_espresso-toolbar-events-today')) {
1010 1010
 			//Events View Today
1011 1011
 			$admin_bar->add_menu(array(
1012 1012
 					'id' => 'espresso-toolbar-events-today',
1013 1013
 					'parent' => 'espresso-toolbar-events-view',
1014 1014
 					'title' => __('Today', 'event_espresso'),
1015
-					'href' => EEH_URL::add_query_args_and_nonce( array( 'action'=>'default', 'status'=>'today' ), $events_admin_url ),
1015
+					'href' => EEH_URL::add_query_args_and_nonce(array('action'=>'default', 'status'=>'today'), $events_admin_url),
1016 1016
 					'meta' => array(
1017 1017
 							'title' => __('Today', 'event_espresso'),
1018 1018
 							'target' => '',
@@ -1022,13 +1022,13 @@  discard block
 block discarded – undo
1022 1022
 		}
1023 1023
 
1024 1024
 
1025
-		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_read_events', 'ee_admin_bar_menu_espresso-toolbar-events-month' ) ) {
1025
+		if (EE_Registry::instance()->CAP->current_user_can('ee_read_events', 'ee_admin_bar_menu_espresso-toolbar-events-month')) {
1026 1026
 			//Events View This Month
1027 1027
 			$admin_bar->add_menu(array(
1028 1028
 					'id' => 'espresso-toolbar-events-month',
1029 1029
 					'parent' => 'espresso-toolbar-events-view',
1030
-					'title' => __( 'This Month', 'event_espresso'),
1031
-					'href' => EEH_URL::add_query_args_and_nonce( array( 'action'=>'default', 'status'=>'month' ), $events_admin_url ),
1030
+					'title' => __('This Month', 'event_espresso'),
1031
+					'href' => EEH_URL::add_query_args_and_nonce(array('action'=>'default', 'status'=>'month'), $events_admin_url),
1032 1032
 					'meta' => array(
1033 1033
 							'title' => __('This Month', 'event_espresso'),
1034 1034
 							'target' => '',
@@ -1038,11 +1038,11 @@  discard block
 block discarded – undo
1038 1038
 		}
1039 1039
 
1040 1040
 		//Registration Overview
1041
-		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_read_registrations', 'ee_admin_bar_menu_espresso-toolbar-registrations' ) ) {
1041
+		if (EE_Registry::instance()->CAP->current_user_can('ee_read_registrations', 'ee_admin_bar_menu_espresso-toolbar-registrations')) {
1042 1042
 			$admin_bar->add_menu(array(
1043 1043
 					'id' => 'espresso-toolbar-registrations',
1044 1044
 					'parent' => 'espresso-toolbar',
1045
-					'title' => __( 'Registrations', 'event_espresso' ),
1045
+					'title' => __('Registrations', 'event_espresso'),
1046 1046
 					'href' => $reg_admin_url,
1047 1047
 					'meta' => array(
1048 1048
 							'title' => __('Registrations', 'event_espresso'),
@@ -1053,12 +1053,12 @@  discard block
 block discarded – undo
1053 1053
 		}
1054 1054
 
1055 1055
 		//Registration Overview Today
1056
-		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_read_registrations', 'ee_admin_bar_menu_espresso-toolbar-registrations-today' ) ) {
1056
+		if (EE_Registry::instance()->CAP->current_user_can('ee_read_registrations', 'ee_admin_bar_menu_espresso-toolbar-registrations-today')) {
1057 1057
 			$admin_bar->add_menu(array(
1058 1058
 					'id' => 'espresso-toolbar-registrations-today',
1059 1059
 					'parent' => 'espresso-toolbar-registrations',
1060
-					'title' => __( 'Today', 'event_espresso'),
1061
-					'href' => EEH_URL::add_query_args_and_nonce( array( 'action'=>'default', 'status'=>'today' ), $reg_admin_url ),
1060
+					'title' => __('Today', 'event_espresso'),
1061
+					'href' => EEH_URL::add_query_args_and_nonce(array('action'=>'default', 'status'=>'today'), $reg_admin_url),
1062 1062
 					'meta' => array(
1063 1063
 							'title' => __('Today', 'event_espresso'),
1064 1064
 							'target' => '',
@@ -1068,14 +1068,14 @@  discard block
 block discarded – undo
1068 1068
 		}
1069 1069
 
1070 1070
 		//Registration Overview Today Completed
1071
-		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_read_registrations', 'ee_admin_bar_menu_espresso-toolbar-registrations-today-approved' ) ) {
1071
+		if (EE_Registry::instance()->CAP->current_user_can('ee_read_registrations', 'ee_admin_bar_menu_espresso-toolbar-registrations-today-approved')) {
1072 1072
 			$admin_bar->add_menu(array(
1073 1073
 					'id' => 'espresso-toolbar-registrations-today-approved',
1074 1074
 					'parent' => 'espresso-toolbar-registrations-today',
1075
-					'title' => __( 'Approved', 'event_espresso' ),
1076
-					'href' => EEH_URL::add_query_args_and_nonce( array( 'action'=>'default', 'status'=>'today', '_reg_status'=>EEM_Registration::status_id_approved ), $reg_admin_url ),
1075
+					'title' => __('Approved', 'event_espresso'),
1076
+					'href' => EEH_URL::add_query_args_and_nonce(array('action'=>'default', 'status'=>'today', '_reg_status'=>EEM_Registration::status_id_approved), $reg_admin_url),
1077 1077
 					'meta' => array(
1078
-							'title' => __('Approved', 'event_espresso' ),
1078
+							'title' => __('Approved', 'event_espresso'),
1079 1079
 							'target' => '',
1080 1080
 							'class' => $menu_class
1081 1081
 					),
@@ -1083,14 +1083,14 @@  discard block
 block discarded – undo
1083 1083
 		}
1084 1084
 
1085 1085
 		//Registration Overview Today Pending\
1086
-		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_read_registrations', 'ee_admin_bar_menu_espresso-toolbar-registrations-today-pending' ) ) {
1086
+		if (EE_Registry::instance()->CAP->current_user_can('ee_read_registrations', 'ee_admin_bar_menu_espresso-toolbar-registrations-today-pending')) {
1087 1087
 			$admin_bar->add_menu(array(
1088 1088
 					'id' => 'espresso-toolbar-registrations-today-pending',
1089 1089
 					'parent' => 'espresso-toolbar-registrations-today',
1090
-					'title' => __( 'Pending', 'event_espresso' ),
1091
-					'href' => EEH_URL::add_query_args_and_nonce( array( 'action'=>'default', 'status'=>'today', 'reg_status'=>EEM_Registration::status_id_pending_payment ), $reg_admin_url ),
1090
+					'title' => __('Pending', 'event_espresso'),
1091
+					'href' => EEH_URL::add_query_args_and_nonce(array('action'=>'default', 'status'=>'today', 'reg_status'=>EEM_Registration::status_id_pending_payment), $reg_admin_url),
1092 1092
 					'meta' => array(
1093
-							'title' => __('Pending Payment', 'event_espresso' ),
1093
+							'title' => __('Pending Payment', 'event_espresso'),
1094 1094
 							'target' => '',
1095 1095
 							'class' => $menu_class
1096 1096
 					),
@@ -1098,14 +1098,14 @@  discard block
 block discarded – undo
1098 1098
 		}
1099 1099
 
1100 1100
 		//Registration Overview Today Incomplete
1101
-		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_read_registrations', 'ee_admin_bar_menu_espresso-toolbar-registrations-today-not-approved' ) ) {
1101
+		if (EE_Registry::instance()->CAP->current_user_can('ee_read_registrations', 'ee_admin_bar_menu_espresso-toolbar-registrations-today-not-approved')) {
1102 1102
 			$admin_bar->add_menu(array(
1103 1103
 					'id' => 'espresso-toolbar-registrations-today-not-approved',
1104 1104
 					'parent' => 'espresso-toolbar-registrations-today',
1105
-					'title' => __( 'Not Approved', 'event_espresso' ),
1106
-					'href' => EEH_URL::add_query_args_and_nonce( array( 'action'=>'default', 'status'=>'today', '_reg_status'=>EEM_Registration::status_id_not_approved ), $reg_admin_url ),
1105
+					'title' => __('Not Approved', 'event_espresso'),
1106
+					'href' => EEH_URL::add_query_args_and_nonce(array('action'=>'default', 'status'=>'today', '_reg_status'=>EEM_Registration::status_id_not_approved), $reg_admin_url),
1107 1107
 					'meta' => array(
1108
-							'title' => __('Not Approved', 'event_espresso' ),
1108
+							'title' => __('Not Approved', 'event_espresso'),
1109 1109
 							'target' => '',
1110 1110
 							'class' => $menu_class
1111 1111
 					),
@@ -1113,12 +1113,12 @@  discard block
 block discarded – undo
1113 1113
 		}
1114 1114
 
1115 1115
 		//Registration Overview Today Incomplete
1116
-		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_read_registrations', 'ee_admin_bar_menu_espresso-toolbar-registrations-today-cancelled' ) ) {
1116
+		if (EE_Registry::instance()->CAP->current_user_can('ee_read_registrations', 'ee_admin_bar_menu_espresso-toolbar-registrations-today-cancelled')) {
1117 1117
 			$admin_bar->add_menu(array(
1118 1118
 					'id' => 'espresso-toolbar-registrations-today-cancelled',
1119 1119
 					'parent' => 'espresso-toolbar-registrations-today',
1120
-					'title' => __( 'Cancelled', 'event_espresso'),
1121
-					'href' => EEH_URL::add_query_args_and_nonce( array( 'action'=>'default', 'status'=>'today', '_reg_status'=>EEM_Registration::status_id_cancelled ), $reg_admin_url ),
1120
+					'title' => __('Cancelled', 'event_espresso'),
1121
+					'href' => EEH_URL::add_query_args_and_nonce(array('action'=>'default', 'status'=>'today', '_reg_status'=>EEM_Registration::status_id_cancelled), $reg_admin_url),
1122 1122
 					'meta' => array(
1123 1123
 							'title' => __('Cancelled', 'event_espresso'),
1124 1124
 							'target' => '',
@@ -1128,12 +1128,12 @@  discard block
 block discarded – undo
1128 1128
 		}
1129 1129
 
1130 1130
 		//Registration Overview This Month
1131
-		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_read_registrations', 'ee_admin_bar_menu_espresso-toolbar-registrations-month' ) ) {
1131
+		if (EE_Registry::instance()->CAP->current_user_can('ee_read_registrations', 'ee_admin_bar_menu_espresso-toolbar-registrations-month')) {
1132 1132
 			$admin_bar->add_menu(array(
1133 1133
 					'id' => 'espresso-toolbar-registrations-month',
1134 1134
 					'parent' => 'espresso-toolbar-registrations',
1135
-					'title' => __( 'This Month', 'event_espresso' ),
1136
-					'href' => EEH_URL::add_query_args_and_nonce( array( 'action'=>'default', 'status'=>'month' ), $reg_admin_url ),
1135
+					'title' => __('This Month', 'event_espresso'),
1136
+					'href' => EEH_URL::add_query_args_and_nonce(array('action'=>'default', 'status'=>'month'), $reg_admin_url),
1137 1137
 					'meta' => array(
1138 1138
 							'title' => __('This Month', 'event_espresso'),
1139 1139
 							'target' => '',
@@ -1143,12 +1143,12 @@  discard block
 block discarded – undo
1143 1143
 		}
1144 1144
 
1145 1145
 		//Registration Overview This Month Approved
1146
-		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_read_registrations', 'ee_admin_bar_menu_espresso-toolbar-registrations-month-approved' ) ) {
1146
+		if (EE_Registry::instance()->CAP->current_user_can('ee_read_registrations', 'ee_admin_bar_menu_espresso-toolbar-registrations-month-approved')) {
1147 1147
 			$admin_bar->add_menu(array(
1148 1148
 					'id' => 'espresso-toolbar-registrations-month-approved',
1149 1149
 					'parent' => 'espresso-toolbar-registrations-month',
1150
-					'title' => __( 'Approved', 'event_espresso' ),
1151
-					'href' => EEH_URL::add_query_args_and_nonce( array( 'action'=>'default', 'status'=>'month', '_reg_status'=>EEM_Registration::status_id_approved ), $reg_admin_url ),
1150
+					'title' => __('Approved', 'event_espresso'),
1151
+					'href' => EEH_URL::add_query_args_and_nonce(array('action'=>'default', 'status'=>'month', '_reg_status'=>EEM_Registration::status_id_approved), $reg_admin_url),
1152 1152
 					'meta' => array(
1153 1153
 							'title' => __('Approved', 'event_espresso'),
1154 1154
 							'target' => '',
@@ -1158,12 +1158,12 @@  discard block
 block discarded – undo
1158 1158
 		}
1159 1159
 
1160 1160
 		//Registration Overview This Month Pending
1161
-		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_read_registrations', 'ee_admin_bar_menu_espresso-toolbar-registrations-month-pending' ) ) {
1161
+		if (EE_Registry::instance()->CAP->current_user_can('ee_read_registrations', 'ee_admin_bar_menu_espresso-toolbar-registrations-month-pending')) {
1162 1162
 			$admin_bar->add_menu(array(
1163 1163
 					'id' => 'espresso-toolbar-registrations-month-pending',
1164 1164
 					'parent' => 'espresso-toolbar-registrations-month',
1165
-					'title' => __( 'Pending', 'event_espresso'),
1166
-					'href' => EEH_URL::add_query_args_and_nonce( array( 'action'=>'default', 'status'=>'month', '_reg_status'=>EEM_Registration::status_id_pending_payment ), $reg_admin_url ),
1165
+					'title' => __('Pending', 'event_espresso'),
1166
+					'href' => EEH_URL::add_query_args_and_nonce(array('action'=>'default', 'status'=>'month', '_reg_status'=>EEM_Registration::status_id_pending_payment), $reg_admin_url),
1167 1167
 					'meta' => array(
1168 1168
 							'title' => __('Pending', 'event_espresso'),
1169 1169
 							'target' => '',
@@ -1173,14 +1173,14 @@  discard block
 block discarded – undo
1173 1173
 		}
1174 1174
 
1175 1175
 		//Registration Overview This Month Not Approved
1176
-		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_read_registrations', 'ee_admin_bar_menu_espresso-toolbar-registrations-month-not-approved' ) ) {
1176
+		if (EE_Registry::instance()->CAP->current_user_can('ee_read_registrations', 'ee_admin_bar_menu_espresso-toolbar-registrations-month-not-approved')) {
1177 1177
 			$admin_bar->add_menu(array(
1178 1178
 					'id' => 'espresso-toolbar-registrations-month-not-approved',
1179 1179
 					'parent' => 'espresso-toolbar-registrations-month',
1180
-					'title' => __( 'Not Approved', 'event_espresso'),
1181
-					'href' => EEH_URL::add_query_args_and_nonce( array( 'action'=>'default', 'status'=>'month', '_reg_status'=>EEM_Registration::status_id_not_approved ), $reg_admin_url ),
1180
+					'title' => __('Not Approved', 'event_espresso'),
1181
+					'href' => EEH_URL::add_query_args_and_nonce(array('action'=>'default', 'status'=>'month', '_reg_status'=>EEM_Registration::status_id_not_approved), $reg_admin_url),
1182 1182
 					'meta' => array(
1183
-							'title' => __('Not Approved', 'event_espresso' ),
1183
+							'title' => __('Not Approved', 'event_espresso'),
1184 1184
 							'target' => '',
1185 1185
 							'class' => $menu_class
1186 1186
 					),
@@ -1189,12 +1189,12 @@  discard block
 block discarded – undo
1189 1189
 
1190 1190
 
1191 1191
 		//Registration Overview This Month Cancelled
1192
-		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_read_registrations', 'ee_admin_bar_menu_espresso-toolbar-registrations-month-cancelled' ) ) {
1192
+		if (EE_Registry::instance()->CAP->current_user_can('ee_read_registrations', 'ee_admin_bar_menu_espresso-toolbar-registrations-month-cancelled')) {
1193 1193
 			$admin_bar->add_menu(array(
1194 1194
 					'id' => 'espresso-toolbar-registrations-month-cancelled',
1195 1195
 					'parent' => 'espresso-toolbar-registrations-month',
1196 1196
 					'title' => __('Cancelled', 'event_espresso'),
1197
-					'href' => EEH_URL::add_query_args_and_nonce( array( 'action'=>'default', 'status'=>'month', '_reg_status'=>EEM_Registration::status_id_cancelled ), $reg_admin_url ),
1197
+					'href' => EEH_URL::add_query_args_and_nonce(array('action'=>'default', 'status'=>'month', '_reg_status'=>EEM_Registration::status_id_cancelled), $reg_admin_url),
1198 1198
 					'meta' => array(
1199 1199
 							'title' => __('Cancelled', 'event_espresso'),
1200 1200
 							'target' => '',
@@ -1204,11 +1204,11 @@  discard block
 block discarded – undo
1204 1204
 		}
1205 1205
 
1206 1206
 		//Extensions & Services
1207
-		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_read_ee', 'ee_admin_bar_menu_espresso-toolbar-extensions-and-services' ) ) {
1207
+		if (EE_Registry::instance()->CAP->current_user_can('ee_read_ee', 'ee_admin_bar_menu_espresso-toolbar-extensions-and-services')) {
1208 1208
 			$admin_bar->add_menu(array(
1209 1209
 					'id' => 'espresso-toolbar-extensions-and-services',
1210 1210
 					'parent' => 'espresso-toolbar',
1211
-					'title' => __( 'Extensions & Services', 'event_espresso' ),
1211
+					'title' => __('Extensions & Services', 'event_espresso'),
1212 1212
 					'href' => $extensions_admin_url,
1213 1213
 					'meta' => array(
1214 1214
 							'title' => __('Extensions & Services', 'event_espresso'),
@@ -1230,8 +1230,8 @@  discard block
 block discarded – undo
1230 1230
 	 * @param  array  $exclude_array any existing pages being excluded are in this array.
1231 1231
 	 * @return array
1232 1232
 	 */
1233
-	public function remove_pages_from_wp_list_pages( $exclude_array ) {
1234
-		return  array_merge( $exclude_array, EE_Registry::instance()->CFG->core->get_critical_pages_array() );
1233
+	public function remove_pages_from_wp_list_pages($exclude_array) {
1234
+		return  array_merge($exclude_array, EE_Registry::instance()->CFG->core->get_critical_pages_array());
1235 1235
 	}
1236 1236
 
1237 1237
 
@@ -1251,11 +1251,11 @@  discard block
 block discarded – undo
1251 1251
 	 */
1252 1252
 	public function wp_enqueue_scripts() {
1253 1253
 		// unlike other systems, EE_System_scripts loading is turned ON by default, but prior to the init hook, can be turned off via: add_filter( 'FHEE_load_EE_System_scripts', '__return_false' );
1254
-		if ( apply_filters( 'FHEE_load_EE_System_scripts', TRUE ) ) {
1254
+		if (apply_filters('FHEE_load_EE_System_scripts', TRUE)) {
1255 1255
 			// jquery_validate loading is turned OFF by default, but prior to the wp_enqueue_scripts hook, can be turned back on again via:  add_filter( 'FHEE_load_jquery_validate', '__return_true' );
1256
-			if ( apply_filters( 'FHEE_load_jquery_validate', FALSE ) ) {
1256
+			if (apply_filters('FHEE_load_jquery_validate', FALSE)) {
1257 1257
 				// register jQuery Validate
1258
-				wp_register_script( 'jquery-validate', EE_GLOBAL_ASSETS_URL . 'scripts/jquery.validate.min.js', array('jquery'), '1.11.1', TRUE );
1258
+				wp_register_script('jquery-validate', EE_GLOBAL_ASSETS_URL.'scripts/jquery.validate.min.js', array('jquery'), '1.11.1', TRUE);
1259 1259
 			}
1260 1260
 		}
1261 1261
 	}
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.
Spacing   +378 added lines, -378 removed lines patch added patch discarded remove patch
@@ -58,10 +58,10 @@  discard block
 block discarded – undo
58 58
 	 * 	@return string
59 59
 	 * 	@todo: at some point we can break this down into other static methods to abstract it a bit better.
60 60
 	 */
61
-	static public function get_form_fields( $input_vars = array(), $id = FALSE ) {
61
+	static public function get_form_fields($input_vars = array(), $id = FALSE) {
62 62
 
63
-		if ( empty($input_vars) ) {
64
-			EE_Error::add_error( __('missing required variables for the form field generator', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
63
+		if (empty($input_vars)) {
64
+			EE_Error::add_error(__('missing required variables for the form field generator', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
65 65
 			return FALSE;
66 66
 		}
67 67
 
@@ -87,25 +87,25 @@  discard block
 block discarded – undo
87 87
 				'append_content' => ''
88 88
 				);
89 89
 
90
-			$input_value = wp_parse_args( $input_value, $defaults );
90
+			$input_value = wp_parse_args($input_value, $defaults);
91 91
 
92 92
 			// required fields get a *
93 93
 			$required = isset($input_value['required']) && $input_value['required'] ? ' <span>*</span>: ' : ': ';
94 94
 			// and the css class "required"
95
-			$css_class = isset( $input_value['css_class'] ) ? $input_value['css_class'] : '';
96
-			$styles = $input_value['required'] ? 'required ' . $css_class : $css_class;
95
+			$css_class = isset($input_value['css_class']) ? $input_value['css_class'] : '';
96
+			$styles = $input_value['required'] ? 'required '.$css_class : $css_class;
97 97
 
98
-			$field_id = ($id) ? $id . '-' . $input_key : $input_key;
99
-			$tabindex = !empty($input_value['tabindex']) ? ' tabindex="' . $input_value['tabindex'] . '"' : '';
98
+			$field_id = ($id) ? $id.'-'.$input_key : $input_key;
99
+			$tabindex = ! empty($input_value['tabindex']) ? ' tabindex="'.$input_value['tabindex'].'"' : '';
100 100
 
101 101
 			//rows or cols?
102
-			$rows = isset($input_value['rows'] ) ? $input_value['rows'] : '10';
103
-			$cols = isset($input_value['cols'] ) ? $input_value['cols'] : '80';
102
+			$rows = isset($input_value['rows']) ? $input_value['rows'] : '10';
103
+			$cols = isset($input_value['cols']) ? $input_value['cols'] : '80';
104 104
 
105 105
 			//any content?
106 106
 			$append_content = $input_value['append_content'];
107 107
 
108
-			$output .= (!$close) ? '<ul>' : '';
108
+			$output .= ( ! $close) ? '<ul>' : '';
109 109
 			$output .= '<li>';
110 110
 
111 111
 			// what type of input are we dealing with ?
@@ -113,15 +113,15 @@  discard block
 block discarded – undo
113 113
 
114 114
 				// text inputs
115 115
 				case 'text' :
116
-					$output .= "\n\t\t\t" . '<label for="' . $field_id . '">' . $input_value['label'] . $required . '</label>';
117
-					$output .= "\n\t\t\t" . '<input id="' . $field_id . '" class="' . $styles . '" type="text" value="' . $input_value['value'] . '" name="' . $input_value['name'] . '"' . $tabindex . '>';
116
+					$output .= "\n\t\t\t".'<label for="'.$field_id.'">'.$input_value['label'].$required.'</label>';
117
+					$output .= "\n\t\t\t".'<input id="'.$field_id.'" class="'.$styles.'" type="text" value="'.$input_value['value'].'" name="'.$input_value['name'].'"'.$tabindex.'>';
118 118
 					break;
119 119
 
120 120
 				// dropdowns
121 121
 				case 'select' :
122 122
 
123
-					$output .= "\n\t\t\t" . '<label for="' . $field_id . '">' . $input_value['label'] . $required . '</label>';
124
-					$output .= "\n\t\t\t" . '<select id="' . $field_id . '" class="' . $styles . '" name="' . $input_value['name'] . '"' . $tabindex . '>';
123
+					$output .= "\n\t\t\t".'<label for="'.$field_id.'">'.$input_value['label'].$required.'</label>';
124
+					$output .= "\n\t\t\t".'<select id="'.$field_id.'" class="'.$styles.'" name="'.$input_value['name'].'"'.$tabindex.'>';
125 125
 
126 126
 					if (is_array($input_value['options'])) {
127 127
 						$options = $input_value['options'];
@@ -130,30 +130,30 @@  discard block
 block discarded – undo
130 130
 					}
131 131
 
132 132
 					foreach ($options as $key => $value) {
133
-						$selected = isset( $input_value['value'] ) && $input_value['value'] == $key ? 'selected=selected' : '';
133
+						$selected = isset($input_value['value']) && $input_value['value'] == $key ? 'selected=selected' : '';
134 134
 						//$key = str_replace( ' ', '_', sanitize_key( $value ));
135
-						$output .= "\n\t\t\t\t" . '<option '. $selected . ' value="' . $key . '">' . $value . '</option>';
135
+						$output .= "\n\t\t\t\t".'<option '.$selected.' value="'.$key.'">'.$value.'</option>';
136 136
 					}
137
-					$output .= "\n\t\t\t" . '</select>';
137
+					$output .= "\n\t\t\t".'</select>';
138 138
 
139 139
 					break;
140 140
 
141 141
 				case 'textarea' :
142 142
 
143
-					$output .= "\n\t\t\t" . '<label for="' . $field_id . '">' . $input_value['label'] . $required . '</label>';
144
-					$output .= "\n\t\t\t" . '<textarea id="' . $field_id . '" class="' . $styles . '" rows="'.$rows.'" cols="'.$cols.'" name="' . $input_value['name'] . '"' . $tabindex . '>' . $input_value['value'] . '</textarea>';
143
+					$output .= "\n\t\t\t".'<label for="'.$field_id.'">'.$input_value['label'].$required.'</label>';
144
+					$output .= "\n\t\t\t".'<textarea id="'.$field_id.'" class="'.$styles.'" rows="'.$rows.'" cols="'.$cols.'" name="'.$input_value['name'].'"'.$tabindex.'>'.$input_value['value'].'</textarea>';
145 145
 					break;
146 146
 
147 147
 				case 'hidden' :
148 148
 					$close = false;
149 149
 					$output .= "</li></ul>";
150
-					$output .= "\n\t\t\t" . '<input id="' . $field_id . '" type="hidden" name="' . $input_value['name'] . '" value="' . $input_value['value'] . '">';
150
+					$output .= "\n\t\t\t".'<input id="'.$field_id.'" type="hidden" name="'.$input_value['name'].'" value="'.$input_value['value'].'">';
151 151
 					break;
152 152
 
153 153
 				case 'checkbox' :
154
-					$checked = ( $input_value['value'] == 1 ) ? 'checked="checked"' : '';
155
-					$output .= "\n\t\t\t" . '<label for="' . $field_id . '">' . $input_value['label'] . $required . '</label>';
156
-					$output .= "\n\t\t\t" . '<input id="' . $field_id. '" type="checkbox" name="' . $input_value['name'] . '" value="1"' . $checked . $tabindex . ' />';
154
+					$checked = ($input_value['value'] == 1) ? 'checked="checked"' : '';
155
+					$output .= "\n\t\t\t".'<label for="'.$field_id.'">'.$input_value['label'].$required.'</label>';
156
+					$output .= "\n\t\t\t".'<input id="'.$field_id.'" type="checkbox" name="'.$input_value['name'].'" value="1"'.$checked.$tabindex.' />';
157 157
 					break;
158 158
 
159 159
 				case 'wp_editor' :
@@ -166,19 +166,19 @@  discard block
 block discarded – undo
166 166
 					);
167 167
 					$output .= '</li>';
168 168
 					$output .= '</ul>';
169
-					$output .= '<h4>' . $input_value['label'] . '</h4>';
170
-					if ( $append_content ) {
169
+					$output .= '<h4>'.$input_value['label'].'</h4>';
170
+					if ($append_content) {
171 171
 						$output .= $append_content;
172 172
 					}
173 173
 					ob_start();
174
-					wp_editor( $input_value['value'], $field_id, $editor_settings);
174
+					wp_editor($input_value['value'], $field_id, $editor_settings);
175 175
 					$editor = ob_get_contents();
176 176
 					ob_end_clean();
177 177
 					$output .= $editor;
178 178
 					break;
179 179
 
180 180
 				}
181
-				if ( $append_content && $input_value['input'] !== 'wp_editor' ) {
181
+				if ($append_content && $input_value['input'] !== 'wp_editor') {
182 182
 					$output .= $append_content;
183 183
 				}
184 184
 				$output .= ($close) ? '</li>' : '';
@@ -219,7 +219,7 @@  discard block
 block discarded – undo
219 219
 		$form_fields = array();
220 220
 		$fields = (array) $fields;
221 221
 
222
-		foreach ( $fields as $field_name => $field_atts ) {
222
+		foreach ($fields as $field_name => $field_atts) {
223 223
 			//defaults:
224 224
 			$defaults = array(
225 225
 				'label' => '',
@@ -237,67 +237,67 @@  discard block
 block discarded – undo
237 237
 				'wpeditor_args' => array()
238 238
 				);
239 239
 			// merge defaults with passed arguments
240
-			$_fields = wp_parse_args( $field_atts, $defaults);
241
-			extract( $_fields );
240
+			$_fields = wp_parse_args($field_atts, $defaults);
241
+			extract($_fields);
242 242
 			// generate label
243
-			$label = empty($label) ? '' : '<label for="' . $id . '">' . $label . '</label>';
243
+			$label = empty($label) ? '' : '<label for="'.$id.'">'.$label.'</label>';
244 244
 			// generate field name
245
-			$f_name = !empty($unique_id) ? $field_name . '[' . $unique_id . ']' : $field_name;
245
+			$f_name = ! empty($unique_id) ? $field_name.'['.$unique_id.']' : $field_name;
246 246
 
247 247
 			//tabindex
248
-			$tabindex_str = !empty( $tabindex ) ? ' tabindex="' . $tabindex . '"' : '';
248
+			$tabindex_str = ! empty($tabindex) ? ' tabindex="'.$tabindex.'"' : '';
249 249
 
250 250
 			//we determine what we're building based on the type
251
-			switch ( $type ) {
251
+			switch ($type) {
252 252
 
253 253
 				case 'textarea' :
254
-						$fld = '<textarea id="' . $id . '" class="' . $class . '" rows="' . $dimensions[1] . '" cols="' . $dimensions[0] . '" name="' . $f_name . '"' . $tabindex_str . '>' . $value . '</textarea>';
254
+						$fld = '<textarea id="'.$id.'" class="'.$class.'" rows="'.$dimensions[1].'" cols="'.$dimensions[0].'" name="'.$f_name.'"'.$tabindex_str.'>'.$value.'</textarea>';
255 255
 						$fld .= $extra_desc;
256 256
 					break;
257 257
 
258 258
 				case 'checkbox' :
259 259
 						$c_input = '';
260
-						if ( is_array($value) ) {
261
-							foreach ( $value as $key => $val ) {
262
-								$c_id = $field_name . '_' . $value;
263
-								$c_class = isset($classes[$key]) ? ' class="' . $classes[$key] . '" ' : '';
264
-								$c_label = isset($labels[$key]) ? '<label for="' . $c_id . '">' . $labels[$key] . '</label>' : '';
265
-								$checked = !empty($default) && $default == $val ? ' checked="checked" ' : '';
266
-								$c_input .= '<input name="' . $f_name . '[]" type="checkbox" id="' . $c_id . '"' . $c_class . 'value="' . $val . '"' . $checked . $tabindex_str . ' />' . "\n" . $c_label;
260
+						if (is_array($value)) {
261
+							foreach ($value as $key => $val) {
262
+								$c_id = $field_name.'_'.$value;
263
+								$c_class = isset($classes[$key]) ? ' class="'.$classes[$key].'" ' : '';
264
+								$c_label = isset($labels[$key]) ? '<label for="'.$c_id.'">'.$labels[$key].'</label>' : '';
265
+								$checked = ! empty($default) && $default == $val ? ' checked="checked" ' : '';
266
+								$c_input .= '<input name="'.$f_name.'[]" type="checkbox" id="'.$c_id.'"'.$c_class.'value="'.$val.'"'.$checked.$tabindex_str.' />'."\n".$c_label;
267 267
 							}
268 268
 							$fld = $c_input;
269 269
 						} else {
270
-							$checked = !empty($default) && $default == $val ? 'checked="checked" ' : '';
271
-							$fld = '<input name="'. $f_name . '" type="checkbox" id="' . $id . '" class="' . $class . '" value="' . $value . '"' . $checked . $tabindex_str . ' />' . "\n";
270
+							$checked = ! empty($default) && $default == $val ? 'checked="checked" ' : '';
271
+							$fld = '<input name="'.$f_name.'" type="checkbox" id="'.$id.'" class="'.$class.'" value="'.$value.'"'.$checked.$tabindex_str.' />'."\n";
272 272
 						}
273 273
 					break;
274 274
 
275 275
 				case 'radio' :
276 276
 						$c_input = '';
277
-						if ( is_array($value) ) {
278
-							foreach ( $value as $key => $val ) {
279
-								$c_id = $field_name . '_' . $value;
280
-								$c_class = isset($classes[$key]) ? 'class="' . $classes[$key] . '" ' : '';
281
-								$c_label = isset($labels[$key]) ? '<label for="' . $c_id . '">' . $labels[$key] . '</label>' : '';
282
-								$checked = !empty($default) && $default == $val ? ' checked="checked" ' : '';
283
-								$c_input .= '<input name="' . $f_name . '" type="checkbox" id="' . $c_id . '"' . $c_class . 'value="' . $val . '"' . $checked . $tabindex_str . ' />' . "\n" . $c_label;
277
+						if (is_array($value)) {
278
+							foreach ($value as $key => $val) {
279
+								$c_id = $field_name.'_'.$value;
280
+								$c_class = isset($classes[$key]) ? 'class="'.$classes[$key].'" ' : '';
281
+								$c_label = isset($labels[$key]) ? '<label for="'.$c_id.'">'.$labels[$key].'</label>' : '';
282
+								$checked = ! empty($default) && $default == $val ? ' checked="checked" ' : '';
283
+								$c_input .= '<input name="'.$f_name.'" type="checkbox" id="'.$c_id.'"'.$c_class.'value="'.$val.'"'.$checked.$tabindex_str.' />'."\n".$c_label;
284 284
 							}
285 285
 							$fld = $c_input;
286 286
 						} else {
287
-							$checked = !empty($default) && $default == $val ? 'checked="checked" ' : '';
288
-							$fld = '<input name="'. $f_name . '" type="checkbox" id="' . $id . '" class="' . $class . '" value="' . $value . '"' . $checked . $tabindex_str . ' />' . "\n";
287
+							$checked = ! empty($default) && $default == $val ? 'checked="checked" ' : '';
288
+							$fld = '<input name="'.$f_name.'" type="checkbox" id="'.$id.'" class="'.$class.'" value="'.$value.'"'.$checked.$tabindex_str.' />'."\n";
289 289
 						}
290 290
 					break;
291 291
 
292 292
 				case 'hidden' :
293
-						$fld = '<input name="' . $f_name . '" type="hidden" id="' . $id . '" class="' . $class . '" value="' . $value . '" />' . "\n";
293
+						$fld = '<input name="'.$f_name.'" type="hidden" id="'.$id.'" class="'.$class.'" value="'.$value.'" />'."\n";
294 294
 					break;
295 295
 
296 296
 				case 'select' :
297
-						$fld = '<select name="' . $f_name . '" class="' . $class . '" id="' . $id . '"' . $tabindex_str . '>' . "\n";
298
-						foreach ( $value as $key => $val ) {
299
-							$checked = !empty($default) && $default == $val ? ' selected="selected"' : '';
300
-							$fld .= "\t" . '<option value="' . $val . '"' . $checked . '>' . $labels[$key] . '</option>' . "\n";
297
+						$fld = '<select name="'.$f_name.'" class="'.$class.'" id="'.$id.'"'.$tabindex_str.'>'."\n";
298
+						foreach ($value as $key => $val) {
299
+							$checked = ! empty($default) && $default == $val ? ' selected="selected"' : '';
300
+							$fld .= "\t".'<option value="'.$val.'"'.$checked.'>'.$labels[$key].'</option>'."\n";
301 301
 						}
302 302
 						$fld .= '</select>';
303 303
 					break;
@@ -309,21 +309,21 @@  discard block
 block discarded – undo
309 309
 							'editor_class' => $class,
310 310
 							'tabindex' => $tabindex
311 311
 							);
312
-						$editor_settings = array_merge( $wpeditor_args, $editor_settings );
312
+						$editor_settings = array_merge($wpeditor_args, $editor_settings);
313 313
 						ob_start();
314
-						wp_editor( $value, $id, $editor_settings );
314
+						wp_editor($value, $id, $editor_settings);
315 315
 						$editor = ob_get_contents();
316 316
 						ob_end_clean();
317 317
 						$fld = $editor;
318 318
 					break;
319 319
 
320 320
 				default : //'text fields'
321
-						$fld = '<input name="' . $f_name . '" type="text" id="' . $id . '" class="' . $class . '" value="' . $value . '"' . $tabindex_str . ' />' . "\n";
321
+						$fld = '<input name="'.$f_name.'" type="text" id="'.$id.'" class="'.$class.'" value="'.$value.'"'.$tabindex_str.' />'."\n";
322 322
 						$fld .= $extra_desc;
323 323
 
324 324
 			}
325 325
 
326
-			$form_fields[ $field_name ] = array( 'label' => $label, 'field' => $fld );
326
+			$form_fields[$field_name] = array('label' => $label, 'field' => $fld);
327 327
 		}
328 328
 
329 329
 		return $form_fields;
@@ -352,22 +352,22 @@  discard block
 block discarded – undo
352 352
 	 */
353 353
 	static public function select_input($name, $values, $default = '', $parameters = '', $class = '', $autosize = true) {
354 354
 		//if $values was submitted in the wrong format, convert it over
355
-		if(!empty($values) && (!array_key_exists(0,$values) || !is_array($values[0]))){
356
-			$converted_values=array();
357
-			foreach($values as $id=>$text){
358
-				$converted_values[]=array('id'=>$id,'text'=>$text);
355
+		if ( ! empty($values) && ( ! array_key_exists(0, $values) || ! is_array($values[0]))) {
356
+			$converted_values = array();
357
+			foreach ($values as $id=>$text) {
358
+				$converted_values[] = array('id'=>$id, 'text'=>$text);
359 359
 			}
360
-			$values=$converted_values;
360
+			$values = $converted_values;
361 361
 		}
362 362
 		//load formatter helper
363
-		EE_Registry::instance()->load_helper( 'Formatter' );
363
+		EE_Registry::instance()->load_helper('Formatter');
364 364
 		//EE_Registry::instance()->load_helper( 'Formatter' );
365 365
 
366
-		$field = '<select id="' . EEH_Formatter::ee_tep_output_string($name) . '" name="' . EEH_Formatter::ee_tep_output_string($name) . '"';
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
 		if ($autosize) {
372 372
 			$size = 'med';
373 373
 			for ($ii = 0, $ni = sizeof($values); $ii < $ni; $ii++) {
@@ -380,21 +380,21 @@  discard block
 block discarded – undo
380 380
 			$size = '';
381 381
 		}
382 382
 
383
-		$field .= ' class="' . $class . ' ' . $size . '">';
383
+		$field .= ' class="'.$class.' '.$size.'">';
384 384
 
385 385
 		if (empty($default) && isset($GLOBALS[$name]))
386 386
 			$default = stripslashes($GLOBALS[$name]);
387 387
 
388 388
 
389 389
 		for ($i = 0, $n = sizeof($values); $i < $n; $i++) {
390
-			$field .= '<option value="' . $values[$i]['id'] . '"';
390
+			$field .= '<option value="'.$values[$i]['id'].'"';
391 391
 			if ($default == $values[$i]['id']) {
392 392
 				$field .= ' selected = "selected"';
393 393
 			}
394
-			if ( isset( $values[$i]['class'] ) ) {
395
-				$field .= ' class="' . $values[$i]['class'] . '"';
394
+			if (isset($values[$i]['class'])) {
395
+				$field .= ' class="'.$values[$i]['class'].'"';
396 396
 			}
397
-			$field .= '>' . $values[$i]['text'] . '</option>';
397
+			$field .= '>'.$values[$i]['text'].'</option>';
398 398
 		}
399 399
 		$field .= '</select>';
400 400
 
@@ -412,38 +412,38 @@  discard block
 block discarded – undo
412 412
 	 * @param string $question_groups
413 413
 	 * @return string HTML
414 414
 	 */
415
-	static function generate_question_groups_html( $question_groups = array(), $group_wrapper = 'fieldset' ) {
415
+	static function generate_question_groups_html($question_groups = array(), $group_wrapper = 'fieldset') {
416 416
 
417 417
 		$html = '';
418
-		$before_question_group_questions = apply_filters( 'FHEE__EEH_Form_Fields__generate_question_groups_html__before_question_group_questions', '' );
419
-		$after_question_group_questions = apply_filters( 'FHEE__EEH_Form_Fields__generate_question_groups_html__after_question_group_questions', '' );
418
+		$before_question_group_questions = apply_filters('FHEE__EEH_Form_Fields__generate_question_groups_html__before_question_group_questions', '');
419
+		$after_question_group_questions = apply_filters('FHEE__EEH_Form_Fields__generate_question_groups_html__after_question_group_questions', '');
420 420
 
421
-		if ( ! empty( $question_groups )) {
421
+		if ( ! empty($question_groups)) {
422 422
 			//EEH_Debug_Tools::printr( $question_groups, '$question_groups  <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span>', 'auto' );
423 423
 			// loop thru question groups
424
-			foreach ( $question_groups as $QSG ) {
424
+			foreach ($question_groups as $QSG) {
425 425
 				// check that questions exist
426
-				if ( ! empty( $QSG['QSG_questions'] )) {
426
+				if ( ! empty($QSG['QSG_questions'])) {
427 427
 					// use fieldsets
428
-					$html .= "\n\t" . '<' . $group_wrapper . ' class="espresso-question-group-wrap" id="' . $QSG['QSG_identifier'] . '">';
428
+					$html .= "\n\t".'<'.$group_wrapper.' class="espresso-question-group-wrap" id="'.$QSG['QSG_identifier'].'">';
429 429
 					// group_name
430
-					$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>' : '';
430
+					$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>' : '';
431 431
 					// group_desc
432
-					$html .= $QSG['QSG_show_group_desc'] && ! empty( $QSG['QSG_desc'] ) ? '<div class="espresso-question-group-desc-pg">' . self::prep_answer( $QSG['QSG_desc'] ) . '</div>' : '';
432
+					$html .= $QSG['QSG_show_group_desc'] && ! empty($QSG['QSG_desc']) ? '<div class="espresso-question-group-desc-pg">'.self::prep_answer($QSG['QSG_desc']).'</div>' : '';
433 433
 
434 434
 					$html .= $before_question_group_questions;
435 435
 					// loop thru questions
436
-					foreach ( $QSG['QSG_questions'] as $question ) {
436
+					foreach ($QSG['QSG_questions'] as $question) {
437 437
 //						EEH_Debug_Tools::printr( $question, '$question  <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span>', 'auto' );
438 438
 						$QFI = new EE_Question_Form_Input(
439 439
 							$question['qst_obj'],
440 440
 							$question['ans_obj'],
441 441
 							$question
442 442
 						);
443
-						$html .= self::generate_form_input( $QFI );
443
+						$html .= self::generate_form_input($QFI);
444 444
 					}
445 445
 					$html .= $after_question_group_questions;
446
-					$html .= "\n\t" . '</' . $group_wrapper . '>';
446
+					$html .= "\n\t".'</'.$group_wrapper.'>';
447 447
 				}
448 448
 			}
449 449
 		}
@@ -463,11 +463,11 @@  discard block
 block discarded – undo
463 463
 	 * @param string       $group_wrapper
464 464
 	 * @return string HTML
465 465
 	 */
466
-	static function generate_question_groups_html2( $question_groups = array(), $q_meta = array(), 	$from_admin = FALSE, $group_wrapper = 'fieldset' ) {
466
+	static function generate_question_groups_html2($question_groups = array(), $q_meta = array(), $from_admin = FALSE, $group_wrapper = 'fieldset') {
467 467
 
468 468
 		$html = '';
469
-		$before_question_group_questions = apply_filters( 'FHEE__EEH_Form_Fields__generate_question_groups_html__before_question_group_questions', '' );
470
-		$after_question_group_questions = apply_filters( 'FHEE__EEH_Form_Fields__generate_question_groups_html__after_question_group_questions', '' );
469
+		$before_question_group_questions = apply_filters('FHEE__EEH_Form_Fields__generate_question_groups_html__before_question_group_questions', '');
470
+		$after_question_group_questions = apply_filters('FHEE__EEH_Form_Fields__generate_question_groups_html__after_question_group_questions', '');
471 471
 
472 472
 		$default_q_meta = array(
473 473
 				'att_nmbr' => 1,
@@ -476,55 +476,55 @@  discard block
 block discarded – undo
476 476
 				'input_id' => '',
477 477
 				'input_class' => ''
478 478
 		);
479
-		$q_meta = array_merge( $default_q_meta, $q_meta );
479
+		$q_meta = array_merge($default_q_meta, $q_meta);
480 480
 		//EEH_Debug_Tools::printr( $q_meta, '$q_meta  <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span>', 'auto' );
481 481
 
482
-		if ( ! empty( $question_groups )) {
482
+		if ( ! empty($question_groups)) {
483 483
 //			EEH_Debug_Tools::printr( $question_groups, '$question_groups  <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span>', 'auto' );
484 484
 			// loop thru question groups
485
-			foreach ( $question_groups as $QSG ) {
486
-				if ( $QSG instanceof EE_Question_Group ) {
485
+			foreach ($question_groups as $QSG) {
486
+				if ($QSG instanceof EE_Question_Group) {
487 487
 					// check that questions exist
488 488
 
489
-					$where = array( 'QST_deleted' => 0 );
490
-					if ( ! $from_admin ) {
489
+					$where = array('QST_deleted' => 0);
490
+					if ( ! $from_admin) {
491 491
 						$where['QST_admin_only'] = 0;
492 492
 					}
493
-					$questions = $QSG->questions( array( $where, 'order_by' => array( 'Question_Group_Question.QGQ_order' => 'ASC' )));
494
-					if ( ! empty( $questions )) {
493
+					$questions = $QSG->questions(array($where, 'order_by' => array('Question_Group_Question.QGQ_order' => 'ASC')));
494
+					if ( ! empty($questions)) {
495 495
 						// use fieldsets
496
-						$html .= "\n\t" . '<' . $group_wrapper . ' class="espresso-question-group-wrap" id="' . $QSG->get( 'QSG_identifier' ) . '">';
496
+						$html .= "\n\t".'<'.$group_wrapper.' class="espresso-question-group-wrap" id="'.$QSG->get('QSG_identifier').'">';
497 497
 						// group_name
498
-						if ( $QSG->show_group_name() ) {
499
-							$html .=  "\n\t\t" . '<h5 class="espresso-question-group-title-h5 section-title">' . $QSG->get_pretty( 'QSG_name' ) . '</h5>';
498
+						if ($QSG->show_group_name()) {
499
+							$html .= "\n\t\t".'<h5 class="espresso-question-group-title-h5 section-title">'.$QSG->get_pretty('QSG_name').'</h5>';
500 500
 						}
501 501
 						// group_desc
502
-						if ( $QSG->show_group_desc() ) {
503
-							$html .=  '<div class="espresso-question-group-desc-pg">' . $QSG->get_pretty( 'QSG_desc'  ) . '</div>';
502
+						if ($QSG->show_group_desc()) {
503
+							$html .= '<div class="espresso-question-group-desc-pg">'.$QSG->get_pretty('QSG_desc').'</div>';
504 504
 						}
505 505
 
506 506
 						$html .= $before_question_group_questions;
507 507
 						// loop thru questions
508
-						foreach ( $questions as $QST ) {
508
+						foreach ($questions as $QST) {
509 509
 							$qstn_id = $QST->is_system_question() ? $QST->system_ID() : $QST->ID();
510 510
 
511 511
 							$answer = NULL;
512 512
 
513
-							if (  isset( $_GET['qstn'] ) && isset( $q_meta['input_id'] ) && isset( $q_meta['att_nmbr'] )) {
513
+							if (isset($_GET['qstn']) && isset($q_meta['input_id']) && isset($q_meta['att_nmbr'])) {
514 514
 								// check for answer in $_GET in case we are reprocessing a form after an error
515
-								if ( isset( $_GET['qstn'][ $q_meta['input_id'] ][ $qstn_id ] )) {
516
-									$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 ] );
515
+								if (isset($_GET['qstn'][$q_meta['input_id']][$qstn_id])) {
516
+									$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]);
517 517
 								}
518
-							} else if ( isset( $q_meta['attendee'] ) && $q_meta['attendee'] ) {
518
+							} else if (isset($q_meta['attendee']) && $q_meta['attendee']) {
519 519
 								//attendee data from the session
520
-								$answer = isset( $q_meta['attendee'][ $qstn_id ] ) ? $q_meta['attendee'][ $qstn_id ] : NULL;
520
+								$answer = isset($q_meta['attendee'][$qstn_id]) ? $q_meta['attendee'][$qstn_id] : NULL;
521 521
 							}
522 522
 
523 523
 
524 524
 
525 525
 							$QFI = new EE_Question_Form_Input(
526 526
 									$QST,
527
-									EE_Answer::new_instance ( array(
527
+									EE_Answer::new_instance(array(
528 528
 											'ANS_ID'=> 0,
529 529
 											'QST_ID'=> 0,
530 530
 											'REG_ID'=> 0,
@@ -533,10 +533,10 @@  discard block
 block discarded – undo
533 533
 									$q_meta
534 534
 							);
535 535
 							//EEH_Debug_Tools::printr( $QFI, '$QFI  <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span>', 'auto' );
536
-							$html .= self::generate_form_input( $QFI );
536
+							$html .= self::generate_form_input($QFI);
537 537
 						}
538 538
 						$html .= $after_question_group_questions;
539
-						$html .= "\n\t" . '</' . $group_wrapper . '>';
539
+						$html .= "\n\t".'</'.$group_wrapper.'>';
540 540
 					}
541 541
 				}
542 542
 			}
@@ -556,63 +556,63 @@  discard block
 block discarded – undo
556 556
 	 * @param EE_Question_Form_Input $QFI
557 557
 	 * @return string HTML
558 558
 	 */
559
-	static function generate_form_input( EE_Question_Form_Input $QFI ) {
560
-		if ( isset( $QFI->QST_admin_only) && $QFI->QST_admin_only && ! is_admin() ) {
559
+	static function generate_form_input(EE_Question_Form_Input $QFI) {
560
+		if (isset($QFI->QST_admin_only) && $QFI->QST_admin_only && ! is_admin()) {
561 561
 			return '';
562 562
 		}
563 563
 
564
-		$QFI = self::_load_system_dropdowns( $QFI );
565
-		$QFI = self::_load_specialized_dropdowns( $QFI );
564
+		$QFI = self::_load_system_dropdowns($QFI);
565
+		$QFI = self::_load_specialized_dropdowns($QFI);
566 566
 
567 567
 		//we also need to verify
568 568
 
569 569
 		$display_text = $QFI->get('QST_display_text');
570 570
 		$input_name = $QFI->get('QST_input_name');
571
-		$answer = EE_Registry::instance()->REQ->is_set( $input_name ) ? EE_Registry::instance()->REQ->get( $input_name ) : $QFI->get('ANS_value');
571
+		$answer = EE_Registry::instance()->REQ->is_set($input_name) ? EE_Registry::instance()->REQ->get($input_name) : $QFI->get('ANS_value');
572 572
 		$input_id = $QFI->get('QST_input_id');
573 573
 		$input_class = $QFI->get('QST_input_class');
574 574
 //		$disabled = $QFI->get('QST_disabled') ? ' disabled="disabled"' : '';
575 575
 		$disabled = $QFI->get('QST_disabled') ? TRUE : FALSE;
576
-		$required_label = apply_filters(' FHEE__EEH_Form_Fields__generate_form_input__required_label', '<em>*</em>' );
576
+		$required_label = apply_filters(' FHEE__EEH_Form_Fields__generate_form_input__required_label', '<em>*</em>');
577 577
 		$QST_required = $QFI->get('QST_required');
578
-		$required = $QST_required ? array( 'label' => $required_label, 'class' => 'required needs-value', 'title' => $QST_required ) : array();
579
-		$use_html_entities = $QFI->get_meta( 'htmlentities' );
580
-		$required_text = $QFI->get('QST_required_text') != '' ? $QFI->get('QST_required_text') : __( 'This field is required', 'event_espresso' );
581
-		$required_text = $QST_required ? "\n\t\t\t" . '<div class="required-text hidden">' . self::prep_answer( $required_text, $use_html_entities ) . '</div>' : '';
578
+		$required = $QST_required ? array('label' => $required_label, 'class' => 'required needs-value', 'title' => $QST_required) : array();
579
+		$use_html_entities = $QFI->get_meta('htmlentities');
580
+		$required_text = $QFI->get('QST_required_text') != '' ? $QFI->get('QST_required_text') : __('This field is required', 'event_espresso');
581
+		$required_text = $QST_required ? "\n\t\t\t".'<div class="required-text hidden">'.self::prep_answer($required_text, $use_html_entities).'</div>' : '';
582 582
 		$label_class = 'espresso-form-input-lbl';
583
-		$QST_options = $QFI->options(true,$answer);
584
-		$options = is_array( $QST_options ) ? self::prep_answer_options( $QST_options ) : array();
583
+		$QST_options = $QFI->options(true, $answer);
584
+		$options = is_array($QST_options) ? self::prep_answer_options($QST_options) : array();
585 585
 		$system_ID = $QFI->get('QST_system');
586
-		$label_b4 = $QFI->get_meta( 'label_b4' );
587
-		$use_desc_4_label = $QFI->get_meta( 'use_desc_4_label' );
586
+		$label_b4 = $QFI->get_meta('label_b4');
587
+		$use_desc_4_label = $QFI->get_meta('use_desc_4_label');
588 588
 
589 589
 
590
-		switch ( $QFI->get('QST_type') ){
590
+		switch ($QFI->get('QST_type')) {
591 591
 
592 592
 			case 'TEXTAREA' :
593
-					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 );
593
+					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);
594 594
 				break;
595 595
 
596 596
 			case 'DROPDOWN' :
597
-					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 );
597
+					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);
598 598
 				break;
599 599
 
600 600
 
601 601
 			case 'RADIO_BTN' :
602
-					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 );
602
+					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);
603 603
 				break;
604 604
 
605 605
 			case 'CHECKBOX' :
606
-					return EEH_Form_Fields::checkbox( $display_text, $answer, $options, $input_name, $input_id, $input_class, $required, $required_text, $label_class, $disabled, $system_ID, $use_html_entities );
606
+					return EEH_Form_Fields::checkbox($display_text, $answer, $options, $input_name, $input_id, $input_class, $required, $required_text, $label_class, $disabled, $system_ID, $use_html_entities);
607 607
 				break;
608 608
 
609 609
 			case 'DATE' :
610
-					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 );
610
+					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);
611 611
 				break;
612 612
 
613 613
 			case 'TEXT' :
614 614
 			default:
615
-					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 );
615
+					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);
616 616
 				break;
617 617
 
618 618
 		}
@@ -638,31 +638,31 @@  discard block
 block discarded – undo
638 638
 	 * @param string $disabled 		disabled="disabled" or null
639 639
 	 * @return string HTML
640 640
 	 */
641
-	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 ) {
641
+	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) {
642 642
 		// need these
643
-		if ( ! $question || ! $name ) {
643
+		if ( ! $question || ! $name) {
644 644
 			return NULL;
645 645
 		}
646 646
 		// prep the answer
647
-		$answer = is_array( $answer ) ? '' : self::prep_answer( $answer, $use_html_entities );
647
+		$answer = is_array($answer) ? '' : self::prep_answer($answer, $use_html_entities);
648 648
 		// prep the required array
649
-		$required = self::prep_required( $required );
649
+		$required = self::prep_required($required);
650 650
 		// set disabled tag
651
-		$disabled = $answer === NULL || ! $disabled  ? '' : ' disabled="disabled"';
651
+		$disabled = $answer === NULL || ! $disabled ? '' : ' disabled="disabled"';
652 652
 		// ya gots ta have style man!!!
653 653
 		$txt_class = is_admin() ? 'regular-text' : 'espresso-text-inp';
654
-		$class = empty( $class ) ? $txt_class : $class;
655
-		$class .= ! empty( $system_ID ) ? ' ' . $system_ID : '';
656
-		$extra = apply_filters( 'FHEE__EEH_Form_Fields__additional_form_field_attributes', '' );
654
+		$class = empty($class) ? $txt_class : $class;
655
+		$class .= ! empty($system_ID) ? ' '.$system_ID : '';
656
+		$extra = apply_filters('FHEE__EEH_Form_Fields__additional_form_field_attributes', '');
657 657
 
658
-		$label_html = $required_text . "\n\t\t\t" . '<label for="' . $name . '" class="' . $label_class . '">' . self::prep_question( $question ) . $required['label'] . '</label><br/>';
658
+		$label_html = $required_text."\n\t\t\t".'<label for="'.$name.'" class="'.$label_class.'">'.self::prep_question($question).$required['label'].'</label><br/>';
659 659
 		// filter label but ensure required text comes before it
660
-		$label_html = apply_filters( 'FHEE__EEH_Form_Fields__label_html', $label_html, $required_text );
660
+		$label_html = apply_filters('FHEE__EEH_Form_Fields__label_html', $label_html, $required_text);
661 661
 
662
-		$input_html = "\n\t\t\t" . '<input type="text" name="' . $name . '" id="' . $id . '" class="' . $class . ' ' . $required['class'] . '" value="' . $answer . '"  title="' . esc_attr( $required['msg'] ) . '" ' . $disabled .' ' . $extra . '/>';
662
+		$input_html = "\n\t\t\t".'<input type="text" name="'.$name.'" id="'.$id.'" class="'.$class.' '.$required['class'].'" value="'.$answer.'"  title="'.esc_attr($required['msg']).'" '.$disabled.' '.$extra.'/>';
663 663
 
664
-		$input_html =  apply_filters( 'FHEE__EEH_Form_Fields__input_html', $input_html, $label_html, $id );
665
-		return  $label_html . $input_html;
664
+		$input_html = apply_filters('FHEE__EEH_Form_Fields__input_html', $input_html, $label_html, $id);
665
+		return  $label_html.$input_html;
666 666
 
667 667
 	}
668 668
 
@@ -684,35 +684,35 @@  discard block
 block discarded – undo
684 684
 	 * @param string $disabled 		disabled="disabled" or null
685 685
 	 * @return string HTML
686 686
 	 */
687
-	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 ) {
687
+	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) {
688 688
 		// need these
689
-		if ( ! $question || ! $name ) {
689
+		if ( ! $question || ! $name) {
690 690
 			return NULL;
691 691
 		}
692 692
 		// prep the answer
693
-		$answer = is_array( $answer ) ? '' : self::prep_answer( $answer, $use_html_entities );
693
+		$answer = is_array($answer) ? '' : self::prep_answer($answer, $use_html_entities);
694 694
 		// prep the required array
695
-		$required = self::prep_required( $required );
695
+		$required = self::prep_required($required);
696 696
 		// make sure $dimensions is an array
697
-		$dimensions = is_array( $dimensions ) ? $dimensions : array();
697
+		$dimensions = is_array($dimensions) ? $dimensions : array();
698 698
 		// and set some defaults
699
-		$dimensions = array_merge( array( 'rows' => 3, 'cols' => 40 ), $dimensions );
699
+		$dimensions = array_merge(array('rows' => 3, 'cols' => 40), $dimensions);
700 700
 		// set disabled tag
701
-		$disabled = $answer === NULL || ! $disabled  ? '' : ' disabled="disabled"';
701
+		$disabled = $answer === NULL || ! $disabled ? '' : ' disabled="disabled"';
702 702
 		// ya gots ta have style man!!!
703 703
 		$txt_class = is_admin() ? 'regular-text' : 'espresso-textarea-inp';
704
-		$class = empty( $class ) ? $txt_class : $class;
705
-		$class .= ! empty( $system_ID ) ? ' ' . $system_ID : '';
706
-		$extra = apply_filters( 'FHEE__EEH_Form_Fields__additional_form_field_attributes', '' );
704
+		$class = empty($class) ? $txt_class : $class;
705
+		$class .= ! empty($system_ID) ? ' '.$system_ID : '';
706
+		$extra = apply_filters('FHEE__EEH_Form_Fields__additional_form_field_attributes', '');
707 707
 
708
-		$label_html = $required_text . "\n\t\t\t" . '<label for="' . $name . '" class="' . $label_class . '">' . self::prep_question( $question ) . $required['label'] . '</label><br/>';
708
+		$label_html = $required_text."\n\t\t\t".'<label for="'.$name.'" class="'.$label_class.'">'.self::prep_question($question).$required['label'].'</label><br/>';
709 709
 		// filter label but ensure required text comes before it
710
-		$label_html = apply_filters( 'FHEE__EEH_Form_Fields__label_html', $label_html, $required_text );
710
+		$label_html = apply_filters('FHEE__EEH_Form_Fields__label_html', $label_html, $required_text);
711 711
 
712
-		$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>';
712
+		$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>';
713 713
 
714
-		$input_html =  apply_filters( 'FHEE__EEH_Form_Fields__input_html', $input_html, $label_html, $id );
715
-		return  $label_html . $input_html;
714
+		$input_html = apply_filters('FHEE__EEH_Form_Fields__input_html', $input_html, $label_html, $id);
715
+		return  $label_html.$input_html;
716 716
 
717 717
 	}
718 718
 
@@ -735,47 +735,47 @@  discard block
 block discarded – undo
735 735
 	 * @param string $disabled 		disabled="disabled" or null
736 736
 	 * @return string HTML
737 737
 	 */
738
-	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 ) {
738
+	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) {
739 739
 
740 740
 		// need these
741
-		if ( ! $question || ! $name || ! $options || empty( $options ) || ! is_array( $options )) {
741
+		if ( ! $question || ! $name || ! $options || empty($options) || ! is_array($options)) {
742 742
 			return NULL;
743 743
 		}
744 744
 		// prep the answer
745
-		$answer = is_array( $answer ) ? self::prep_answer( array_shift( $answer )) : self::prep_answer( $answer, $use_html_entities );
745
+		$answer = is_array($answer) ? self::prep_answer(array_shift($answer)) : self::prep_answer($answer, $use_html_entities);
746 746
 		// prep the required array
747
-		$required = self::prep_required( $required );
747
+		$required = self::prep_required($required);
748 748
 		// set disabled tag
749
-		$disabled = $answer === NULL || ! $disabled  ? '' : ' disabled="disabled"';
749
+		$disabled = $answer === NULL || ! $disabled ? '' : ' disabled="disabled"';
750 750
 		// ya gots ta have style man!!!
751 751
 		$txt_class = is_admin() ? 'wide' : 'espresso-select-inp';
752
-		$class = empty( $class ) ? $txt_class : $class;
753
-		$class .= ! empty( $system_ID ) ? ' ' . $system_ID : '';
754
-		$extra = apply_filters( 'FHEE__EEH_Form_Fields__additional_form_field_attributes', '' );
752
+		$class = empty($class) ? $txt_class : $class;
753
+		$class .= ! empty($system_ID) ? ' '.$system_ID : '';
754
+		$extra = apply_filters('FHEE__EEH_Form_Fields__additional_form_field_attributes', '');
755 755
 
756
-		$label_html = $required_text . "\n\t\t\t" . '<label for="' . $name . '" class="' . $label_class . '">' . self::prep_question( $question ) . $required['label'] . '</label><br/>';
756
+		$label_html = $required_text."\n\t\t\t".'<label for="'.$name.'" class="'.$label_class.'">'.self::prep_question($question).$required['label'].'</label><br/>';
757 757
 		// filter label but ensure required text comes before it
758
-		$label_html = apply_filters( 'FHEE__EEH_Form_Fields__label_html', $label_html, $required_text );
758
+		$label_html = apply_filters('FHEE__EEH_Form_Fields__label_html', $label_html, $required_text);
759 759
 
760
-		$input_html = "\n\t\t\t" . '<select name="' . $name . '" id="' . $id . '" class="' . $class . ' ' . $required['class'] . '" title="' . esc_attr( $required['msg'] ) . '"' . $disabled . ' ' . $extra . '>';
760
+		$input_html = "\n\t\t\t".'<select name="'.$name.'" id="'.$id.'" class="'.$class.' '.$required['class'].'" title="'.esc_attr($required['msg']).'"'.$disabled.' '.$extra.'>';
761 761
 		// recursively count array elements, to determine total number of options
762
-		$only_option = count( $options, 1 ) == 1 ? TRUE : FALSE;
763
-		if ( ! $only_option ) {
762
+		$only_option = count($options, 1) == 1 ? TRUE : FALSE;
763
+		if ( ! $only_option) {
764 764
 			// if there is NO answer set and there are multiple options to choose from, then set the "please select" message as selected
765 765
 			$selected = $answer === NULL ? ' selected="selected"' : '';
766
-			$input_html .= $add_please_select_option ? "\n\t\t\t\t" . '<option value=""' . $selected . '>' . __(' - please select - ', 'event_espresso') . '</option>' : '';
766
+			$input_html .= $add_please_select_option ? "\n\t\t\t\t".'<option value=""'.$selected.'>'.__(' - please select - ', 'event_espresso').'</option>' : '';
767 767
 		}
768
-		foreach ( $options as $key => $value ) {
768
+		foreach ($options as $key => $value) {
769 769
 			// if value is an array, then create option groups, else create regular ol' options
770
-			$input_html .= is_array( $value ) ? self::_generate_select_option_group( $key, $value, $answer ) : self::_generate_select_option( $value->value(), $value->desc(), $answer, $only_option );
770
+			$input_html .= is_array($value) ? self::_generate_select_option_group($key, $value, $answer) : self::_generate_select_option($value->value(), $value->desc(), $answer, $only_option);
771 771
 		}
772 772
 
773
-		$input_html .= "\n\t\t\t" . '</select>';
773
+		$input_html .= "\n\t\t\t".'</select>';
774 774
 
775
-		$input_html =  apply_filters( 'FHEE__EEH_Form_Fields__select__before_end_wrapper', $input_html, $question, $answer, $name, $id, $class, $system_ID );
775
+		$input_html = apply_filters('FHEE__EEH_Form_Fields__select__before_end_wrapper', $input_html, $question, $answer, $name, $id, $class, $system_ID);
776 776
 
777
-		$input_html =  apply_filters( 'FHEE__EEH_Form_Fields__input_html', $input_html, $label_html, $id );
778
-		return  $label_html . $input_html;
777
+		$input_html = apply_filters('FHEE__EEH_Form_Fields__input_html', $input_html, $label_html, $id);
778
+		return  $label_html.$input_html;
779 779
 
780 780
 	}
781 781
 
@@ -792,12 +792,12 @@  discard block
 block discarded – undo
792 792
 	 * @param mixed $answer
793 793
 	 * @return string
794 794
 	 */
795
-	private static function _generate_select_option_group( $opt_group, $QSOs, $answer ){
796
-		$html = "\n\t\t\t\t" . '<optgroup label="' . self::prep_option_value( $opt_group ) . '">';
797
-		foreach ( $QSOs as $QSO ) {
798
-			$html .= self::_generate_select_option( $QSO->value(), $QSO->desc(), $answer );
795
+	private static function _generate_select_option_group($opt_group, $QSOs, $answer) {
796
+		$html = "\n\t\t\t\t".'<optgroup label="'.self::prep_option_value($opt_group).'">';
797
+		foreach ($QSOs as $QSO) {
798
+			$html .= self::_generate_select_option($QSO->value(), $QSO->desc(), $answer);
799 799
 		}
800
-		$html .= "\n\t\t\t\t" . '</optgroup>';
800
+		$html .= "\n\t\t\t\t".'</optgroup>';
801 801
 		return $html;
802 802
 	}
803 803
 
@@ -811,12 +811,12 @@  discard block
 block discarded – undo
811 811
 	 * @param int $only_option
812 812
 	 * @return string
813 813
 	 */
814
-	private static function _generate_select_option( $key, $value, $answer, $only_option = FALSE ){
815
-		$key = self::prep_answer( $key );
816
-		$value = self::prep_answer( $value );
817
-		$value = ! empty( $value ) ? $value : $key;
818
-		$selected = ( $answer == $key || $only_option ) ? ' selected="selected"' : '';
819
-		return "\n\t\t\t\t" . '<option value="' . self::prep_option_value( $key ) . '"' . $selected . '> ' . $value . '&nbsp;&nbsp;&nbsp;</option>';
814
+	private static function _generate_select_option($key, $value, $answer, $only_option = FALSE) {
815
+		$key = self::prep_answer($key);
816
+		$value = self::prep_answer($value);
817
+		$value = ! empty($value) ? $value : $key;
818
+		$selected = ($answer == $key || $only_option) ? ' selected="selected"' : '';
819
+		return "\n\t\t\t\t".'<option value="'.self::prep_option_value($key).'"'.$selected.'> '.$value.'&nbsp;&nbsp;&nbsp;</option>';
820 820
 	}
821 821
 
822 822
 
@@ -840,56 +840,56 @@  discard block
 block discarded – undo
840 840
 	 * @param bool        $use_desc_4_label
841 841
 	 * @return string HTML
842 842
 	 */
843
-	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 ) {
843
+	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) {
844 844
 		// need these
845
-		if ( ! $question || ! $name || ! $options || empty( $options ) || ! is_array( $options )) {
845
+		if ( ! $question || ! $name || ! $options || empty($options) || ! is_array($options)) {
846 846
 			return NULL;
847 847
 		}
848 848
 		// prep the answer
849
-		$answer = is_array( $answer ) ? '' : self::prep_answer( $answer, $use_html_entities );
849
+		$answer = is_array($answer) ? '' : self::prep_answer($answer, $use_html_entities);
850 850
 		// prep the required array
851
-		$required = self::prep_required( $required );
851
+		$required = self::prep_required($required);
852 852
 		// set disabled tag
853
-		$disabled = $answer === NULL || ! $disabled  ? '' : ' disabled="disabled"';
853
+		$disabled = $answer === NULL || ! $disabled ? '' : ' disabled="disabled"';
854 854
 		// ya gots ta have style man!!!
855 855
 		$radio_class = is_admin() ? 'ee-admin-radio-lbl' : $label_class;
856
-		$class = ! empty( $class ) ? $class : 'espresso-radio-btn-inp';
857
-		$extra = apply_filters( 'FHEE__EEH_Form_Fields__additional_form_field_attributes', '' );
856
+		$class = ! empty($class) ? $class : 'espresso-radio-btn-inp';
857
+		$extra = apply_filters('FHEE__EEH_Form_Fields__additional_form_field_attributes', '');
858 858
 
859
-		$label_html = $required_text . "\n\t\t\t" . '<label class="' . $label_class . '">' . self::prep_question( $question ) . $required['label'] . '</label> ';
859
+		$label_html = $required_text."\n\t\t\t".'<label class="'.$label_class.'">'.self::prep_question($question).$required['label'].'</label> ';
860 860
 		// filter label but ensure required text comes before it
861
-		$label_html = apply_filters( 'FHEE__EEH_Form_Fields__label_html', $label_html, $required_text );
861
+		$label_html = apply_filters('FHEE__EEH_Form_Fields__label_html', $label_html, $required_text);
862 862
 
863
-		$input_html = "\n\t\t\t" . '<ul id="' . $id . '-ul" class="espresso-radio-btn-options-ul ' . $label_class . ' ' . $class . '-ul">';
863
+		$input_html = "\n\t\t\t".'<ul id="'.$id.'-ul" class="espresso-radio-btn-options-ul '.$label_class.' '.$class.'-ul">';
864 864
 
865
-		$class .= ! empty( $system_ID ) ? ' ' . $system_ID : '';
866
-		$class .= ! empty( $required['class'] ) ? ' ' . $required['class'] : '';
865
+		$class .= ! empty($system_ID) ? ' '.$system_ID : '';
866
+		$class .= ! empty($required['class']) ? ' '.$required['class'] : '';
867 867
 
868
-		foreach ( $options as $OPT ) {
869
-			if ( $OPT instanceof EE_Question_Option ) {
870
-				$value = self::prep_option_value( $OPT->value() );
868
+		foreach ($options as $OPT) {
869
+			if ($OPT instanceof EE_Question_Option) {
870
+				$value = self::prep_option_value($OPT->value());
871 871
 				$label = $use_desc_4_label ? $OPT->desc() : $OPT->value();
872
-				$size = $use_desc_4_label ? self::get_label_size_class( $OPT->value() . ' ' . $OPT->desc() ) : self::get_label_size_class( $OPT->value() );
873
-				$desc = $OPT->desc();//no self::prep_answer
874
-				$answer = is_numeric( $value ) && empty( $answer ) ? 0 : $answer;
875
-				$checked = (string)$value == (string)$answer ? ' checked="checked"' : '';
876
-				$opt = '-' . sanitize_key( $value );
877
-
878
-				$input_html .= "\n\t\t\t\t" . '<li' . $size . '>';
879
-				$input_html .= "\n\t\t\t\t\t" . '<label class="' . $radio_class . ' espresso-radio-btn-lbl">';
880
-				$input_html .= $label_b4  ? "\n\t\t\t\t\t\t" . '<span>' . $label . '</span>' : '';
881
-				$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 . '/>';
882
-				$input_html .= ! $label_b4  ? "\n\t\t\t\t\t\t" . '<span class="espresso-radio-btn-desc">' . $label . '</span>' : '';
883
-				$input_html .= "\n\t\t\t\t\t" . '</label>';
884
-				$input_html .= $use_desc_4_label ? '' : '<span class="espresso-radio-btn-option-desc small-text grey-text">' . $desc . '</span>';
885
-				$input_html .= "\n\t\t\t\t" . '</li>';
872
+				$size = $use_desc_4_label ? self::get_label_size_class($OPT->value().' '.$OPT->desc()) : self::get_label_size_class($OPT->value());
873
+				$desc = $OPT->desc(); //no self::prep_answer
874
+				$answer = is_numeric($value) && empty($answer) ? 0 : $answer;
875
+				$checked = (string) $value == (string) $answer ? ' checked="checked"' : '';
876
+				$opt = '-'.sanitize_key($value);
877
+
878
+				$input_html .= "\n\t\t\t\t".'<li'.$size.'>';
879
+				$input_html .= "\n\t\t\t\t\t".'<label class="'.$radio_class.' espresso-radio-btn-lbl">';
880
+				$input_html .= $label_b4 ? "\n\t\t\t\t\t\t".'<span>'.$label.'</span>' : '';
881
+				$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.'/>';
882
+				$input_html .= ! $label_b4 ? "\n\t\t\t\t\t\t".'<span class="espresso-radio-btn-desc">'.$label.'</span>' : '';
883
+				$input_html .= "\n\t\t\t\t\t".'</label>';
884
+				$input_html .= $use_desc_4_label ? '' : '<span class="espresso-radio-btn-option-desc small-text grey-text">'.$desc.'</span>';
885
+				$input_html .= "\n\t\t\t\t".'</li>';
886 886
 			}
887 887
 		}
888 888
 
889
-		$input_html .= "\n\t\t\t" . '</ul>';
889
+		$input_html .= "\n\t\t\t".'</ul>';
890 890
 
891
-		$input_html =  apply_filters( 'FHEE__EEH_Form_Fields__input_html', $input_html, $label_html, $id );
892
-		return  $label_html . $input_html;
891
+		$input_html = apply_filters('FHEE__EEH_Form_Fields__input_html', $input_html, $label_html, $id);
892
+		return  $label_html.$input_html;
893 893
 
894 894
 	}
895 895
 
@@ -912,65 +912,65 @@  discard block
 block discarded – undo
912 912
 	 * @param string $disabled 		disabled="disabled" or null
913 913
 	 * @return string HTML
914 914
 	 */
915
-	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 ) {
915
+	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) {
916 916
 		// need these
917
-		if ( ! $question || ! $name || ! $options || empty( $options ) || ! is_array( $options )) {
917
+		if ( ! $question || ! $name || ! $options || empty($options) || ! is_array($options)) {
918 918
 			return NULL;
919 919
 		}
920
-		$answer = maybe_unserialize( $answer );
920
+		$answer = maybe_unserialize($answer);
921 921
 
922 922
 		// prep the answer(s)
923
-		$answer = is_array( $answer ) ? $answer : array( sanitize_key( $answer ) => $answer );
923
+		$answer = is_array($answer) ? $answer : array(sanitize_key($answer) => $answer);
924 924
 
925
-		foreach ( $answer as $key => $value ) {
926
-			$key = self::prep_option_value( $key );
927
-			$answer[$key] = self::prep_answer( $value );
925
+		foreach ($answer as $key => $value) {
926
+			$key = self::prep_option_value($key);
927
+			$answer[$key] = self::prep_answer($value);
928 928
 		}
929 929
 
930 930
 		// prep the required array
931
-		$required = self::prep_required( $required );
931
+		$required = self::prep_required($required);
932 932
 		// set disabled tag
933
-		$disabled = $answer === NULL || ! $disabled  ? '' : ' disabled="disabled"';
933
+		$disabled = $answer === NULL || ! $disabled ? '' : ' disabled="disabled"';
934 934
 		// ya gots ta have style man!!!
935 935
 		$radio_class = is_admin() ? 'ee-admin-radio-lbl' : $label_class;
936
-		$class = empty( $class ) ? 'espresso-radio-btn-inp' : $class;
937
-		$extra = apply_filters( 'FHEE__EEH_Form_Fields__additional_form_field_attributes', '' );
936
+		$class = empty($class) ? 'espresso-radio-btn-inp' : $class;
937
+		$extra = apply_filters('FHEE__EEH_Form_Fields__additional_form_field_attributes', '');
938 938
 
939
-		$label_html = $required_text . "\n\t\t\t" . '<label class="' . $label_class . '">' . self::prep_question( $question ) . $required['label'] . '</label> ';
939
+		$label_html = $required_text."\n\t\t\t".'<label class="'.$label_class.'">'.self::prep_question($question).$required['label'].'</label> ';
940 940
 		// filter label but ensure required text comes before it
941
-		$label_html = apply_filters( 'FHEE__EEH_Form_Fields__label_html', $label_html, $required_text );
942
-
943
-		$input_html = "\n\t\t\t" . '<ul id="' . $id . '-ul" class="espresso-checkbox-options-ul ' . $label_class . ' ' . $class . '-ul">';
944
-
945
-		$class .= ! empty( $system_ID ) ? ' ' . $system_ID : '';
946
-		$class .= ! empty( $required['class'] ) ? ' ' . $required['class'] : '';
947
-
948
-		foreach ( $options as $OPT ) {
949
-			$value = $OPT->value();//self::prep_option_value( $OPT->value() );
950
-			$size = self::get_label_size_class(  $OPT->value() . ' ' . $OPT->desc() );
951
-			$text = self::prep_answer( $OPT->value() );
952
-			$desc = $OPT->desc() ;
953
-			$opt = '-' . sanitize_key( $value );
954
-
955
-			$checked = is_array( $answer ) && in_array( $text, $answer ) ? ' checked="checked"' : '';
956
-
957
-			$input_html .= "\n\t\t\t\t" . '<li' . $size . '>';
958
-			$input_html .= "\n\t\t\t\t\t" . '<label class="' . $radio_class . ' espresso-checkbox-lbl">';
959
-			$input_html .= $label_b4  ? "\n\t\t\t\t\t\t" . '<span>' . $text . '</span>' : '';
960
-			$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 . '/>';
961
-			$input_html .= ! $label_b4  ? "\n\t\t\t\t\t\t" . '<span>' . $text . '</span>' : '';
962
- 			$input_html .= "\n\t\t\t\t\t" . '</label>';
963
-			if ( ! empty( $desc ) && $desc != $text ) {
964
-	 			$input_html .= "\n\t\t\t\t\t" . ' &nbsp; <br/><div class="espresso-checkbox-option-desc small-text grey-text">' . $desc . '</div>';
941
+		$label_html = apply_filters('FHEE__EEH_Form_Fields__label_html', $label_html, $required_text);
942
+
943
+		$input_html = "\n\t\t\t".'<ul id="'.$id.'-ul" class="espresso-checkbox-options-ul '.$label_class.' '.$class.'-ul">';
944
+
945
+		$class .= ! empty($system_ID) ? ' '.$system_ID : '';
946
+		$class .= ! empty($required['class']) ? ' '.$required['class'] : '';
947
+
948
+		foreach ($options as $OPT) {
949
+			$value = $OPT->value(); //self::prep_option_value( $OPT->value() );
950
+			$size = self::get_label_size_class($OPT->value().' '.$OPT->desc());
951
+			$text = self::prep_answer($OPT->value());
952
+			$desc = $OPT->desc();
953
+			$opt = '-'.sanitize_key($value);
954
+
955
+			$checked = is_array($answer) && in_array($text, $answer) ? ' checked="checked"' : '';
956
+
957
+			$input_html .= "\n\t\t\t\t".'<li'.$size.'>';
958
+			$input_html .= "\n\t\t\t\t\t".'<label class="'.$radio_class.' espresso-checkbox-lbl">';
959
+			$input_html .= $label_b4 ? "\n\t\t\t\t\t\t".'<span>'.$text.'</span>' : '';
960
+			$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.'/>';
961
+			$input_html .= ! $label_b4 ? "\n\t\t\t\t\t\t".'<span>'.$text.'</span>' : '';
962
+ 			$input_html .= "\n\t\t\t\t\t".'</label>';
963
+			if ( ! empty($desc) && $desc != $text) {
964
+	 			$input_html .= "\n\t\t\t\t\t".' &nbsp; <br/><div class="espresso-checkbox-option-desc small-text grey-text">'.$desc.'</div>';
965 965
 			}
966
-			$input_html .= "\n\t\t\t\t" . '</li>';
966
+			$input_html .= "\n\t\t\t\t".'</li>';
967 967
 
968 968
 		}
969 969
 
970
-		$input_html .= "\n\t\t\t" . '</ul>';
970
+		$input_html .= "\n\t\t\t".'</ul>';
971 971
 
972
-		$input_html =  apply_filters( 'FHEE__EEH_Form_Fields__input_html', $input_html, $label_html, $id );
973
-		return  $label_html . $input_html;
972
+		$input_html = apply_filters('FHEE__EEH_Form_Fields__input_html', $input_html, $label_html, $id);
973
+		return  $label_html.$input_html;
974 974
 
975 975
 	}
976 976
 
@@ -992,36 +992,36 @@  discard block
 block discarded – undo
992 992
 	 * @param string $disabled 		disabled="disabled" or null
993 993
 	 * @return string HTML
994 994
 	 */
995
-	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 ) {
995
+	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) {
996 996
 		// need these
997
-		if ( ! $question || ! $name ) {
997
+		if ( ! $question || ! $name) {
998 998
 			return NULL;
999 999
 		}
1000 1000
 		// prep the answer
1001
-		$answer = is_array( $answer ) ? '' : self::prep_answer( $answer, $use_html_entities );
1001
+		$answer = is_array($answer) ? '' : self::prep_answer($answer, $use_html_entities);
1002 1002
 		// prep the required array
1003
-		$required = self::prep_required( $required );
1003
+		$required = self::prep_required($required);
1004 1004
 		// set disabled tag
1005
-		$disabled = $answer === NULL || ! $disabled  ? '' : ' disabled="disabled"';
1005
+		$disabled = $answer === NULL || ! $disabled ? '' : ' disabled="disabled"';
1006 1006
 		// ya gots ta have style man!!!
1007 1007
 		$txt_class = is_admin() ? 'regular-text' : 'espresso-datepicker-inp';
1008
-		$class = empty( $class ) ? $txt_class : $class;
1009
-		$class .= ! empty( $system_ID ) ? ' ' . $system_ID : '';
1010
-		$extra = apply_filters( 'FHEE__EEH_Form_Fields__additional_form_field_attributes', '' );
1008
+		$class = empty($class) ? $txt_class : $class;
1009
+		$class .= ! empty($system_ID) ? ' '.$system_ID : '';
1010
+		$extra = apply_filters('FHEE__EEH_Form_Fields__additional_form_field_attributes', '');
1011 1011
 
1012
-		$label_html = $required_text . "\n\t\t\t" . '<label for="' . $name . '" class="' . $label_class . '">' . self::prep_question( $question ) . $required['label'] . '</label><br/>';
1012
+		$label_html = $required_text."\n\t\t\t".'<label for="'.$name.'" class="'.$label_class.'">'.self::prep_question($question).$required['label'].'</label><br/>';
1013 1013
 		// filter label but ensure required text comes before it
1014
-		$label_html = apply_filters( 'FHEE__EEH_Form_Fields__label_html', $label_html, $required_text );
1014
+		$label_html = apply_filters('FHEE__EEH_Form_Fields__label_html', $label_html, $required_text);
1015 1015
 
1016
-		$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 . '/>';
1016
+		$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.'/>';
1017 1017
 
1018 1018
 		// enqueue scripts
1019
-		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 );
1020
-		wp_enqueue_style( 'espresso-ui-theme');
1021
-		wp_enqueue_script( 'jquery-ui-datepicker' );
1019
+		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);
1020
+		wp_enqueue_style('espresso-ui-theme');
1021
+		wp_enqueue_script('jquery-ui-datepicker');
1022 1022
 
1023
-		$input_html =  apply_filters( 'FHEE__EEH_Form_Fields__input_html', $input_html, $label_html, $id );
1024
-		return  $label_html . $input_html;
1023
+		$input_html = apply_filters('FHEE__EEH_Form_Fields__input_html', $input_html, $label_html, $id);
1024
+		return  $label_html.$input_html;
1025 1025
 
1026 1026
 	}
1027 1027
 
@@ -1033,7 +1033,7 @@  discard block
 block discarded – undo
1033 1033
 	 * 	@access public
1034 1034
 	 * 	@return 	string
1035 1035
 	 */
1036
-	public static function remove_label_keep_required_msg( $label_html, $required_text ) {
1036
+	public static function remove_label_keep_required_msg($label_html, $required_text) {
1037 1037
 		return $required_text;
1038 1038
 	}
1039 1039
 
@@ -1047,9 +1047,9 @@  discard block
 block discarded – undo
1047 1047
 	 * @param string $value
1048 1048
 	 * @return string HTML
1049 1049
 	 */
1050
-	static function hidden_input( $name, $value, $id = '' ){
1051
-		$id = ! empty( $id ) ? $id : $name;
1052
-		return '<input id="' . $id . '" type="hidden" name="'.$name.'" value="' .  $value . '"/>';
1050
+	static function hidden_input($name, $value, $id = '') {
1051
+		$id = ! empty($id) ? $id : $name;
1052
+		return '<input id="'.$id.'" type="hidden" name="'.$name.'" value="'.$value.'"/>';
1053 1053
 	}
1054 1054
 
1055 1055
 
@@ -1061,7 +1061,7 @@  discard block
 block discarded – undo
1061 1061
 	 * @param string $question
1062 1062
 	 * @return string
1063 1063
 	 */
1064
-	static function prep_question( $question ){
1064
+	static function prep_question($question) {
1065 1065
 		return $question;
1066 1066
 //		$link = '';
1067 1067
 //		// does this label have a help link attached ?
@@ -1084,13 +1084,13 @@  discard block
 block discarded – undo
1084 1084
 	 * @param mixed $answer
1085 1085
 	 * @return string
1086 1086
 	 */
1087
-	static function prep_answer( $answer, $use_html_entities = TRUE ){
1087
+	static function prep_answer($answer, $use_html_entities = TRUE) {
1088 1088
 		//make sure we convert bools first.  Otherwise (bool) false becomes an empty string which is NOT desired, we want "0".
1089
-		if ( is_bool( $answer ) ) {
1089
+		if (is_bool($answer)) {
1090 1090
 			$answer = $answer ? 1 : 0;
1091 1091
 		}
1092
-		$answer = trim( stripslashes( str_replace( '&#039;', "'", $answer )));
1093
-		return $use_html_entities ? htmlentities( $answer, ENT_QUOTES, 'UTF-8' ) : $answer;
1092
+		$answer = trim(stripslashes(str_replace('&#039;', "'", $answer)));
1093
+		return $use_html_entities ? htmlentities($answer, ENT_QUOTES, 'UTF-8') : $answer;
1094 1094
 	}
1095 1095
 
1096 1096
 
@@ -1100,18 +1100,18 @@  discard block
 block discarded – undo
1100 1100
 	 * 	@param array $QSOs  array of EE_Question_Option objects
1101 1101
 	 * 	@return array
1102 1102
 	 */
1103
-	public static function prep_answer_options( $QSOs = array() ){
1103
+	public static function prep_answer_options($QSOs = array()) {
1104 1104
 		$prepped_answer_options = array();
1105
-		if ( is_array( $QSOs ) && ! empty( $QSOs )) {
1106
-			foreach( $QSOs as $key => $QSO ) {
1107
-				if ( ! $QSO instanceof EE_Question_Option ) {
1108
-					$QSO = EE_Question_Option::new_instance( array(
1109
-						'QSO_value' => is_array( $QSO ) && isset( $QSO['id'] ) ? (string)$QSO['id'] : (string)$key,
1110
-						'QSO_desc' => is_array( $QSO ) && isset( $QSO['text'] ) ? (string)$QSO['text'] : (string)$QSO
1105
+		if (is_array($QSOs) && ! empty($QSOs)) {
1106
+			foreach ($QSOs as $key => $QSO) {
1107
+				if ( ! $QSO instanceof EE_Question_Option) {
1108
+					$QSO = EE_Question_Option::new_instance(array(
1109
+						'QSO_value' => is_array($QSO) && isset($QSO['id']) ? (string) $QSO['id'] : (string) $key,
1110
+						'QSO_desc' => is_array($QSO) && isset($QSO['text']) ? (string) $QSO['text'] : (string) $QSO
1111 1111
 					));
1112 1112
 				}
1113
-				if ( $QSO->opt_group() ) {
1114
-					$prepped_answer_options[ $QSO->opt_group() ][] = $QSO;
1113
+				if ($QSO->opt_group()) {
1114
+					$prepped_answer_options[$QSO->opt_group()][] = $QSO;
1115 1115
 				} else {
1116 1116
 					$prepped_answer_options[] = $QSO;
1117 1117
 				}
@@ -1127,8 +1127,8 @@  discard block
 block discarded – undo
1127 1127
 	 * @param string $option_value
1128 1128
 	 * @return string
1129 1129
 	 */
1130
-	static function prep_option_value( $option_value ){
1131
-		return trim( stripslashes( $option_value ));
1130
+	static function prep_option_value($option_value) {
1131
+		return trim(stripslashes($option_value));
1132 1132
 	}
1133 1133
 
1134 1134
 
@@ -1139,11 +1139,11 @@  discard block
 block discarded – undo
1139 1139
 	 * @param string|array 	$required
1140 1140
 	 * @return array
1141 1141
 	 */
1142
-	static function prep_required( $required = array() ){
1142
+	static function prep_required($required = array()) {
1143 1143
 		// make sure required is an array
1144
-		$required = is_array( $required ) ? $required : array();
1144
+		$required = is_array($required) ? $required : array();
1145 1145
 		// and set some defaults
1146
-		$required = array_merge( array( 'label' => '', 'class' => '', 'msg' => '' ), $required );
1146
+		$required = array_merge(array('label' => '', 'class' => '', 'msg' => ''), $required);
1147 1147
 		return $required;
1148 1148
 	}
1149 1149
 
@@ -1154,30 +1154,30 @@  discard block
 block discarded – undo
1154 1154
 	 * @param string 	$value
1155 1155
 	 * @return string
1156 1156
 	 */
1157
-	static function get_label_size_class( $value = FALSE ){
1158
-			if ( $value === FALSE || $value == '' ) {
1157
+	static function get_label_size_class($value = FALSE) {
1158
+			if ($value === FALSE || $value == '') {
1159 1159
 				return ' class="medium-lbl"';
1160 1160
 			}
1161 1161
 			// determine length of option value
1162
-			$val_size = strlen( $value );
1163
-			switch( $val_size ){
1162
+			$val_size = strlen($value);
1163
+			switch ($val_size) {
1164 1164
 				case $val_size < 3 :
1165
-					$size =  ' class="nano-lbl"';
1165
+					$size = ' class="nano-lbl"';
1166 1166
 					break;
1167 1167
 				case $val_size < 6 :
1168
-					$size =  ' class="micro-lbl"';
1168
+					$size = ' class="micro-lbl"';
1169 1169
 					break;
1170 1170
 				case $val_size < 12 :
1171
-					$size =  ' class="tiny-lbl"';
1171
+					$size = ' class="tiny-lbl"';
1172 1172
 					break;
1173 1173
 				case $val_size < 25 :
1174
-					$size =  ' class="small-lbl"';
1174
+					$size = ' class="small-lbl"';
1175 1175
 					break;
1176 1176
 				case $val_size > 100 :
1177
-					$size =  ' class="big-lbl"';
1177
+					$size = ' class="big-lbl"';
1178 1178
 					break;
1179 1179
 				default:
1180
-					$size =  ' class="medium-lbl"';
1180
+					$size = ' class="medium-lbl"';
1181 1181
 					break;
1182 1182
 			}
1183 1183
 		return $size;
@@ -1191,20 +1191,20 @@  discard block
 block discarded – undo
1191 1191
 	 * @param array 	$QFI
1192 1192
 	 * @return array
1193 1193
 	 */
1194
-	private static function _load_system_dropdowns( $QFI ){
1194
+	private static function _load_system_dropdowns($QFI) {
1195 1195
 		$QST_system = $QFI->get('QST_system');
1196
-		switch ( $QST_system ) {
1196
+		switch ($QST_system) {
1197 1197
 			case 'state' :
1198
-				$QFI = self::generate_state_dropdown( $QFI );
1198
+				$QFI = self::generate_state_dropdown($QFI);
1199 1199
 				break;
1200 1200
 			case 'country' :
1201
-				$QFI = self::generate_country_dropdown( $QFI );
1201
+				$QFI = self::generate_country_dropdown($QFI);
1202 1202
 				break;
1203 1203
 			case 'admin-state' :
1204
-				$QFI = self::generate_state_dropdown( $QFI, TRUE );
1204
+				$QFI = self::generate_state_dropdown($QFI, TRUE);
1205 1205
 				break;
1206 1206
 			case 'admin-country' :
1207
-				$QFI = self::generate_country_dropdown( $QFI, TRUE );
1207
+				$QFI = self::generate_country_dropdown($QFI, TRUE);
1208 1208
 				break;
1209 1209
 		}
1210 1210
 		return $QFI;
@@ -1221,13 +1221,13 @@  discard block
 block discarded – undo
1221 1221
 	 *
1222 1222
 	 * @return EE_Question_Form_Input
1223 1223
 	 */
1224
-	protected static function _load_specialized_dropdowns( $QFI ) {
1225
-		switch( $QFI->get( 'QST_type' ) ) {
1224
+	protected static function _load_specialized_dropdowns($QFI) {
1225
+		switch ($QFI->get('QST_type')) {
1226 1226
 			case 'STATE' :
1227
-				$QFI = self::generate_state_dropdown( $QFI );
1227
+				$QFI = self::generate_state_dropdown($QFI);
1228 1228
 				break;
1229 1229
 			case 'COUNTRY' :
1230
-				$QFI = self::generate_country_dropdown( $QFI );
1230
+				$QFI = self::generate_country_dropdown($QFI);
1231 1231
 				break;
1232 1232
 		}
1233 1233
 		return $QFI;
@@ -1241,23 +1241,23 @@  discard block
 block discarded – undo
1241 1241
 	 * @param bool  $get_all
1242 1242
 	 * @return array
1243 1243
 	 */
1244
-	public static function generate_state_dropdown( $QST, $get_all = FALSE ){
1244
+	public static function generate_state_dropdown($QST, $get_all = FALSE) {
1245 1245
 		$states = $get_all ? EEM_State::instance()->get_all_states() : EEM_State::instance()->get_all_states_of_active_countries();
1246
-		if ( $states && count( $states ) != count( $QST->options() )) {
1247
-			$QST->set( 'QST_type', 'DROPDOWN' );
1246
+		if ($states && count($states) != count($QST->options())) {
1247
+			$QST->set('QST_type', 'DROPDOWN');
1248 1248
 			// if multiple countries, we'll create option groups within the dropdown
1249
-			foreach ( $states as $state ) {
1250
-				if ( $state instanceof EE_State ) {
1251
-					$QSO = EE_Question_Option::new_instance ( array (
1249
+			foreach ($states as $state) {
1250
+				if ($state instanceof EE_State) {
1251
+					$QSO = EE_Question_Option::new_instance(array(
1252 1252
 						'QSO_value' => $state->ID(),
1253 1253
 						'QSO_desc' => $state->name(),
1254
-						'QST_ID' => $QST->get( 'QST_ID' ),
1254
+						'QST_ID' => $QST->get('QST_ID'),
1255 1255
 						'QSO_deleted' => FALSE
1256 1256
 					));
1257 1257
 					// set option group
1258
-					$QSO->set_opt_group( $state->country()->name() );
1258
+					$QSO->set_opt_group($state->country()->name());
1259 1259
 					// add option to question
1260
-					$QST->add_temp_option( $QSO );
1260
+					$QST->add_temp_option($QSO);
1261 1261
 				}
1262 1262
 			}
1263 1263
 		}
@@ -1273,20 +1273,20 @@  discard block
 block discarded – undo
1273 1273
 	 * @internal param array $question
1274 1274
 	 * @return array
1275 1275
 	 */
1276
-	public static function generate_country_dropdown( $QST, $get_all = FALSE ){
1276
+	public static function generate_country_dropdown($QST, $get_all = FALSE) {
1277 1277
 		$countries = $get_all ? EEM_Country::instance()->get_all_countries() : EEM_Country::instance()->get_all_active_countries();
1278
-		if ( $countries && count( $countries ) != count( $QST->options() ) ) {
1279
-			$QST->set( 'QST_type', 'DROPDOWN' );
1278
+		if ($countries && count($countries) != count($QST->options())) {
1279
+			$QST->set('QST_type', 'DROPDOWN');
1280 1280
 			// now add countries
1281
-			foreach ( $countries as $country ) {
1282
-				if ( $country instanceof EE_Country ) {
1283
-					$QSO = EE_Question_Option::new_instance ( array (
1281
+			foreach ($countries as $country) {
1282
+				if ($country instanceof EE_Country) {
1283
+					$QSO = EE_Question_Option::new_instance(array(
1284 1284
 						'QSO_value' => $country->ID(),
1285 1285
 						'QSO_desc' => $country->name(),
1286
-						'QST_ID' => $QST->get( 'QST_ID' ),
1286
+						'QST_ID' => $QST->get('QST_ID'),
1287 1287
 						'QSO_deleted' => FALSE
1288 1288
 					));
1289
-					$QST->add_temp_option( $QSO );
1289
+					$QST->add_temp_option($QSO);
1290 1290
 				}
1291 1291
 			}
1292 1292
 		}
@@ -1303,11 +1303,11 @@  discard block
 block discarded – undo
1303 1303
 	 */
1304 1304
 	public static function two_digit_months_dropdown_options() {
1305 1305
 		$options = array();
1306
-		for ( $x = 1; $x <= 12; $x++ ) {
1307
-			$mm = str_pad( $x, 2, '0', STR_PAD_LEFT );
1308
-			$options[ (string)$mm ] = (string)$mm;
1306
+		for ($x = 1; $x <= 12; $x++) {
1307
+			$mm = str_pad($x, 2, '0', STR_PAD_LEFT);
1308
+			$options[(string) $mm] = (string) $mm;
1309 1309
 		}
1310
-		return EEH_Form_Fields::prep_answer_options( $options );
1310
+		return EEH_Form_Fields::prep_answer_options($options);
1311 1311
 	}
1312 1312
 
1313 1313
 
@@ -1322,11 +1322,11 @@  discard block
 block discarded – undo
1322 1322
 		$options = array();
1323 1323
 		$current_year = date('y');
1324 1324
 		$next_decade = $current_year + 10;
1325
-		for ( $x = $current_year; $x <= $next_decade; $x++ ) {
1326
-			$yy = str_pad( $x, 2, '0', STR_PAD_LEFT );
1327
-			$options[ (string)$yy ] = (string)$yy;
1325
+		for ($x = $current_year; $x <= $next_decade; $x++) {
1326
+			$yy = str_pad($x, 2, '0', STR_PAD_LEFT);
1327
+			$options[(string) $yy] = (string) $yy;
1328 1328
 		}
1329
-		return EEH_Form_Fields::prep_answer_options( $options );
1329
+		return EEH_Form_Fields::prep_answer_options($options);
1330 1330
 	}
1331 1331
 
1332 1332
 
@@ -1340,17 +1340,17 @@  discard block
 block discarded – undo
1340 1340
 	 * @param  integer $evt_category Event Category ID if the Event Category filter is selected
1341 1341
 	 * @return string                html
1342 1342
 	 */
1343
-	public static function generate_registration_months_dropdown( $cur_date = '', $status = '', $evt_category = 0 ) {
1343
+	public static function generate_registration_months_dropdown($cur_date = '', $status = '', $evt_category = 0) {
1344 1344
 		$_where = array();
1345
-		if ( !empty( $status ) ) {
1345
+		if ( ! empty($status)) {
1346 1346
 			$_where['STS_ID'] = $status;
1347 1347
 		}
1348 1348
 
1349
-		if ( $evt_category > 0 ) {
1349
+		if ($evt_category > 0) {
1350 1350
 			$_where['Event.Term_Taxonomy.term_id'] = $evt_category;
1351 1351
 		}
1352 1352
 
1353
-		$regdtts = EEM_Registration::instance()->get_reg_months_and_years( $_where );
1353
+		$regdtts = EEM_Registration::instance()->get_reg_months_and_years($_where);
1354 1354
 
1355 1355
 		//setup vals for select input helper
1356 1356
 		$options = array(
@@ -1360,15 +1360,15 @@  discard block
 block discarded – undo
1360 1360
 				)
1361 1361
 			);
1362 1362
 
1363
-		foreach ( $regdtts as $regdtt ) {
1364
-			$date = $regdtt->reg_month. ' ' . $regdtt->reg_year;
1363
+		foreach ($regdtts as $regdtt) {
1364
+			$date = $regdtt->reg_month.' '.$regdtt->reg_year;
1365 1365
 			$options[] = array(
1366 1366
 				'text' => $date,
1367 1367
 				'id' => $date
1368 1368
 				);
1369 1369
 		}
1370 1370
 
1371
-		return self::select_input('month_range', $options, $cur_date, '', 'wide' );
1371
+		return self::select_input('month_range', $options, $cur_date, '', 'wide');
1372 1372
 	}
1373 1373
 
1374 1374
 
@@ -1382,18 +1382,18 @@  discard block
 block discarded – undo
1382 1382
 	 * @param  string $evt_active_status "upcoming", "expired", "active", or "inactive"
1383 1383
 	 * @return string                    html
1384 1384
 	 */
1385
-	public static function generate_event_months_dropdown( $cur_date = '', $status = NULL, $evt_category = NULL, $evt_active_status = NULL ) {
1385
+	public static function generate_event_months_dropdown($cur_date = '', $status = NULL, $evt_category = NULL, $evt_active_status = NULL) {
1386 1386
 		//determine what post_status our condition will have for the query.
1387
-		switch ( $status ) {
1387
+		switch ($status) {
1388 1388
 			case 'month' :
1389 1389
 			case 'today' :
1390 1390
 			case NULL :
1391 1391
 			case 'all' :
1392
-				$where['Event.status'] = array( 'NOT IN', array('trash') );
1392
+				$where['Event.status'] = array('NOT IN', array('trash'));
1393 1393
 				break;
1394 1394
 
1395 1395
 			case 'draft' :
1396
-				$where['Event.status'] = array( 'IN', array('draft', 'auto-draft') );
1396
+				$where['Event.status'] = array('IN', array('draft', 'auto-draft'));
1397 1397
 
1398 1398
 			default :
1399 1399
 				$where['Event.status'] = $status;
@@ -1402,7 +1402,7 @@  discard block
 block discarded – undo
1402 1402
 		//categories?
1403 1403
 
1404 1404
 
1405
-		if ( !empty ( $evt_category ) ) {
1405
+		if ( ! empty ($evt_category)) {
1406 1406
 			$where['Event.Term_Taxonomy.taxonomy'] = 'espresso_event_categories';
1407 1407
 			$where['Event.Term_Taxonomy.term_id'] = $evt_category;
1408 1408
 		}
@@ -1410,7 +1410,7 @@  discard block
 block discarded – undo
1410 1410
 
1411 1411
 //		$where['DTT_is_primary'] = 1;
1412 1412
 
1413
-		$DTTS = EE_Registry::instance()->load_model('Datetime')->get_dtt_months_and_years($where, $evt_active_status );
1413
+		$DTTS = EE_Registry::instance()->load_model('Datetime')->get_dtt_months_and_years($where, $evt_active_status);
1414 1414
 
1415 1415
 		//let's setup vals for select input helper
1416 1416
 		$options = array(
@@ -1423,9 +1423,9 @@  discard block
 block discarded – undo
1423 1423
 		//translate month and date
1424 1424
 		global $wp_locale;
1425 1425
 
1426
-		foreach ( $DTTS as $DTT ) {
1427
-			$localized_date = $wp_locale->get_month( date('m', strtotime($DTT->dtt_month)) ) . ' ' . $DTT->dtt_year;
1428
-			$id = $DTT->dtt_month . ' ' . $DTT->dtt_year;
1426
+		foreach ($DTTS as $DTT) {
1427
+			$localized_date = $wp_locale->get_month(date('m', strtotime($DTT->dtt_month))).' '.$DTT->dtt_year;
1428
+			$id = $DTT->dtt_month.' '.$DTT->dtt_year;
1429 1429
 			$options[] = array(
1430 1430
 				'text' => $localized_date,
1431 1431
 				'id' => $id
@@ -1433,7 +1433,7 @@  discard block
 block discarded – undo
1433 1433
 		}
1434 1434
 
1435 1435
 
1436
-		return self::select_input( 'month_range', $options, $cur_date, '', 'wide' );
1436
+		return self::select_input('month_range', $options, $cur_date, '', 'wide');
1437 1437
 	}
1438 1438
 
1439 1439
 
@@ -1444,7 +1444,7 @@  discard block
 block discarded – undo
1444 1444
 	 * @param  integer $current_cat currently selected category
1445 1445
 	 * @return string               html for dropdown
1446 1446
 	 */
1447
-	public static function generate_event_category_dropdown( $current_cat = -1 ) {
1447
+	public static function generate_event_category_dropdown($current_cat = -1) {
1448 1448
 		$categories = EEM_Term::instance()->get_all_ee_categories(TRUE);
1449 1449
 		$options = array(
1450 1450
 			'0' => array(
@@ -1454,14 +1454,14 @@  discard block
 block discarded – undo
1454 1454
 			);
1455 1455
 
1456 1456
 		//setup categories for dropdown
1457
-		foreach ( $categories as $category ) {
1457
+		foreach ($categories as $category) {
1458 1458
 			$options[] = array(
1459 1459
 				'text' => $category->get('name'),
1460 1460
 				'id' => $category->ID()
1461 1461
 				);
1462 1462
 		}
1463 1463
 
1464
-		return self::select_input( 'EVT_CAT', $options, $current_cat );
1464
+		return self::select_input('EVT_CAT', $options, $current_cat);
1465 1465
 	}
1466 1466
 
1467 1467
 
@@ -1480,20 +1480,20 @@  discard block
 block discarded – undo
1480 1480
 	 * @param    string   $extra_attributes - any extra attributes that need to be attached to the form input
1481 1481
 	 * @return    void
1482 1482
 	 */
1483
-	public static function submit_button( $url = '', $ID = '', $class = '', $text = '', $nonce_action = '', $input_only = FALSE, $extra_attributes = '' ) {
1483
+	public static function submit_button($url = '', $ID = '', $class = '', $text = '', $nonce_action = '', $input_only = FALSE, $extra_attributes = '') {
1484 1484
 		$btn = '';
1485
-		if ( empty( $url ) || empty( $ID )) {
1485
+		if (empty($url) || empty($ID)) {
1486 1486
 			return $btn;
1487 1487
 		}
1488
-		$text = ! empty( $text ) ? $text : __('Submit', 'event_espresso' );
1489
-		$btn .= '<input id="' . $ID . '-btn" class="' . $class . '" type="submit" value="' . $text . '" ' . $extra_attributes . '/>';
1490
-		if ( ! $input_only ) {
1491
-			$btn_frm = '<form id="' . $ID . '-frm" method="POST" action="' . $url . '">';
1492
-			$btn_frm .= ! empty( $nonce_action ) ? wp_nonce_field( $nonce_action, $nonce_action . '_nonce', TRUE, FALSE ) : '';
1488
+		$text = ! empty($text) ? $text : __('Submit', 'event_espresso');
1489
+		$btn .= '<input id="'.$ID.'-btn" class="'.$class.'" type="submit" value="'.$text.'" '.$extra_attributes.'/>';
1490
+		if ( ! $input_only) {
1491
+			$btn_frm = '<form id="'.$ID.'-frm" method="POST" action="'.$url.'">';
1492
+			$btn_frm .= ! empty($nonce_action) ? wp_nonce_field($nonce_action, $nonce_action.'_nonce', TRUE, FALSE) : '';
1493 1493
 			$btn_frm .= $btn;
1494 1494
 			$btn_frm .= '</form>';
1495 1495
 			$btn = $btn_frm;
1496
-			unset ( $btn_frm );
1496
+			unset ($btn_frm);
1497 1497
 		}
1498 1498
 		return $btn;
1499 1499
 	}
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.