Completed
Branch BUG-9804-double-click-spco-sub... (c2cac1)
by
unknown
42:11 queued 32:59
created
templates/thank-you-page-registration-details.template.php 1 patch
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -5,75 +5,75 @@  discard block
 block discarded – undo
5 5
 /** @type string $SPCO_attendee_information_url */
6 6
 ?>
7 7
 <h3 class="ee-registration-details-h3"><?php _e('Registration Details', 'event_espresso'); ?></h3>
8
-<?php  do_action( 'AHEE__thank_you_page_registration_details_template__after_heading' ); ?>
8
+<?php  do_action('AHEE__thank_you_page_registration_details_template__after_heading'); ?>
9 9
 
10 10
 <div class="ee-registration-details-dv">
11 11
 <?php
12 12
 $registrations = $transaction->registrations();
13
-$registrations = is_array( $registrations ) ? $registrations : array();
14
-$reg_count = count( $registrations );
13
+$registrations = is_array($registrations) ? $registrations : array();
14
+$reg_count = count($registrations);
15 15
 $reg_cntr = 0;
16 16
 $event_name = '';
17
-foreach ( $registrations as $registration ) {
18
-	if ( $registration instanceof EE_Registration ) {
19
-		if ( $event_name != $registration->event_name() && ! empty( $event_name )) { ?>
17
+foreach ($registrations as $registration) {
18
+	if ($registration instanceof EE_Registration) {
19
+		if ($event_name != $registration->event_name() && ! empty($event_name)) { ?>
20 20
 		</tbody>
21 21
 	</table>
22 22
 		<?php
23 23
 		}
24 24
 		$reg_cntr++;
25
-		if ( $event_name != $registration->event_name() ) {
25
+		if ($event_name != $registration->event_name()) {
26 26
 	?>
27 27
 	<h5>
28
-		<span class="smaller-text grey-text"><?php _e('for','event_espresso');?>: </span> <?php echo htmlentities( $registration->event_name(), ENT_QUOTES, 'UTF-8' );?>
28
+		<span class="smaller-text grey-text"><?php _e('for', 'event_espresso'); ?>: </span> <?php echo htmlentities($registration->event_name(), ENT_QUOTES, 'UTF-8'); ?>
29 29
 	</h5>
30 30
 	<table class='ee-table ee-registrations-list'>
31 31
 		<thead>
32 32
 			<tr>
33 33
 				<th width="40%">
34
-					<?php _e("Registrant Name",'event_espresso')?>
34
+					<?php _e("Registrant Name", 'event_espresso')?>
35 35
 				</th>
36 36
 				<th width="25%" class="jst-left">
37
-					<?php _e("REG Code",'event_espresso');?>
37
+					<?php _e("REG Code", 'event_espresso'); ?>
38 38
 				</th>
39 39
 				<th width="35%" class="jst-left">
40
-					<?php _e("REG Status",'event_espresso');?>
40
+					<?php _e("REG Status", 'event_espresso'); ?>
41 41
 				</th>
42 42
 			</tr>
43 43
 		</thead>
44 44
 		<tbody>
45 45
 	<?php
46 46
 		}
47
-		if ( $is_primary || ( ! $is_primary && $reg_url_link == $registration->reg_url_link() )) { ?>
47
+		if ($is_primary || ( ! $is_primary && $reg_url_link == $registration->reg_url_link())) { ?>
48 48
 			<tr>
49 49
 				<td width="40%">
50 50
 				<?php
51
-					if ( $registration->attendee() instanceof EE_Attendee ) {
52
-						echo $registration->attendee()->full_name( TRUE );
51
+					if ($registration->attendee() instanceof EE_Attendee) {
52
+						echo $registration->attendee()->full_name(TRUE);
53 53
 					}
54 54
 				?>
55 55
 					<p class="tiny-text" style="margin: .75em 0 0;">
56 56
 					<?php
57
-					if ( $registration->count_question_groups() ) {
57
+					if ($registration->count_question_groups()) {
58 58
 					?>
59
-						<a class="ee-icon-only-lnk" href="<?php echo $registration->edit_attendee_information_url();?>" title="<?php esc_attr_e('Click here to edit Attendee Information', 'event_espresso');?>"><span class="ee-icon ee-icon-user-edit"></span><?php _e('edit info', 'event_espresso');?></a>
59
+						<a class="ee-icon-only-lnk" href="<?php echo $registration->edit_attendee_information_url(); ?>" title="<?php esc_attr_e('Click here to edit Attendee Information', 'event_espresso'); ?>"><span class="ee-icon ee-icon-user-edit"></span><?php _e('edit info', 'event_espresso'); ?></a>
60 60
 					<?php } ?>
61
-						<a class="ee-resend-reg-confirmation-email ee-icon-only-lnk" href="<?php echo add_query_arg( array( 'token'=>$registration->reg_url_link(), 'resend_reg_confirmation' => 'true' ), EE_Registry::instance()->CFG->core->thank_you_page_url() );?>" title="<?php esc_attr_e('Click here to resend the Registration Confirmation email', 'event_espresso');?>" rel="<?php echo $registration->reg_url_link();?>"><span class="dashicons dashicons-email-alt"></span><?php _e('resend email', 'event_espresso');?></a>
61
+						<a class="ee-resend-reg-confirmation-email ee-icon-only-lnk" href="<?php echo add_query_arg(array('token'=>$registration->reg_url_link(), 'resend_reg_confirmation' => 'true'), EE_Registry::instance()->CFG->core->thank_you_page_url()); ?>" title="<?php esc_attr_e('Click here to resend the Registration Confirmation email', 'event_espresso'); ?>" rel="<?php echo $registration->reg_url_link(); ?>"><span class="dashicons dashicons-email-alt"></span><?php _e('resend email', 'event_espresso'); ?></a>
62 62
 					</p>
63 63
 				</td>
64 64
 				<td width="25%" class="jst-left">
65 65
 					<?php $registration->e('REG_code') ?>
66 66
 				</td>
67 67
 				<td width="35%" class="jst-left">
68
-					<?php $registration->e_pretty_status( TRUE )?>
68
+					<?php $registration->e_pretty_status(TRUE)?>
69 69
 				</td>
70 70
 			</tr>
71
-            <?php  do_action( 'AHEE__thank_you_page_registration_details_template__after_registration_table_row', $registration ); ?>
71
+            <?php  do_action('AHEE__thank_you_page_registration_details_template__after_registration_table_row', $registration); ?>
72 72
         <?php
73 73
 			$event_name = $registration->event_name();
74 74
 
75 75
 		}
76
-		if ( $reg_cntr >= $reg_count ) {
76
+		if ($reg_cntr >= $reg_count) {
77 77
 			?>
78 78
 			</tbody>
79 79
 			</table>
@@ -82,13 +82,13 @@  discard block
 block discarded – undo
82 82
 	}
83 83
 }
84 84
 ?>
85
-<?php if ( $is_primary && $SPCO_attendee_information_url ) { ?>
85
+<?php if ($is_primary && $SPCO_attendee_information_url) { ?>
86 86
 	<p class="small-text jst-rght">
87 87
 		<a href='<?php echo $SPCO_attendee_information_url?>'><?php _e("Click here to edit All Attendee Information", 'event_espresso'); ?></a>
88 88
 	</p>
89 89
 <?php } ?>
90 90
 
91
-    <?php  do_action( 'AHEE__thank_you_page_registration_details_template__after_registration_details' ); ?>
91
+    <?php  do_action('AHEE__thank_you_page_registration_details_template__after_registration_details'); ?>
92 92
 
93 93
 </div>
94 94
 <!-- end of .registration-details -->
Please login to merge, or discard this patch.
payment_methods/Paypal_Standard/EE_Paypal_Standard_Form.form.php 1 patch
Spacing   +38 added lines, -38 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if ( !defined( 'EVENT_ESPRESSO_VERSION' ) ) {
3
-	exit( 'No direct script access allowed' );
2
+if ( ! defined('EVENT_ESPRESSO_VERSION')) {
3
+	exit('No direct script access allowed');
4 4
 }
5 5
 
6 6
 /**
@@ -21,37 +21,37 @@  discard block
 block discarded – undo
21 21
 	/**
22 22
 	 * @param EE_PMT_Paypal_Standard $payment_method_type
23 23
 	 */
24
-	public function __construct( $payment_method_type ){
24
+	public function __construct($payment_method_type) {
25 25
 		parent::__construct(
26 26
 			array(
27 27
 				'payment_method_type'          => $payment_method_type,
28 28
 				'extra_meta_inputs'            => array(
29
-					'paypal_id'        => new EE_Text_Input( array(
30
-						'html_label_text' => sprintf( __( "Paypal Email %s", 'event_espresso' ), $payment_method_type->get_help_tab_link() ),
31
-						'html_help_text'  => __( "Typically [email protected]", 'event_espresso' ),
29
+					'paypal_id'        => new EE_Text_Input(array(
30
+						'html_label_text' => sprintf(__("Paypal Email %s", 'event_espresso'), $payment_method_type->get_help_tab_link()),
31
+						'html_help_text'  => __("Typically [email protected]", 'event_espresso'),
32 32
 						'required'        => true
33
-					) ),
34
-					'image_url'        => new EE_Admin_File_Uploader_Input( array(
35
-						'html_help_text'  => __( "Used for your business/personal logo on the PayPal page", 'event_espresso' ),
36
-						'html_label_text' => __( 'Image URL', 'event_espresso' )
37
-					) ),
38
-					'paypal_taxes'     => new EE_Yes_No_Input( array(
39
-						'html_label_text' => sprintf( __( 'Paypal Calculates Taxes %s', 'event_espresso' ), $payment_method_type->get_help_tab_link() ),
40
-						'html_help_text'  => __( 'Whether Paypal should add taxes to the order', 'event_espresso' ),
33
+					)),
34
+					'image_url'        => new EE_Admin_File_Uploader_Input(array(
35
+						'html_help_text'  => __("Used for your business/personal logo on the PayPal page", 'event_espresso'),
36
+						'html_label_text' => __('Image URL', 'event_espresso')
37
+					)),
38
+					'paypal_taxes'     => new EE_Yes_No_Input(array(
39
+						'html_label_text' => sprintf(__('Paypal Calculates Taxes %s', 'event_espresso'), $payment_method_type->get_help_tab_link()),
40
+						'html_help_text'  => __('Whether Paypal should add taxes to the order', 'event_espresso'),
41 41
 						'default'         => false
42
-					) ),
43
-					'paypal_shipping'  => new EE_Yes_No_Input( array(
44
-						'html_label_text' => sprintf( __( 'Paypal Calculates Shipping %s', 'event_espresso' ), $payment_method_type->get_help_tab_link() ),
45
-						'html_help_text'  => __( 'Whether Paypal should add shipping surcharges', 'event_espresso' ),
42
+					)),
43
+					'paypal_shipping'  => new EE_Yes_No_Input(array(
44
+						'html_label_text' => sprintf(__('Paypal Calculates Shipping %s', 'event_espresso'), $payment_method_type->get_help_tab_link()),
45
+						'html_help_text'  => __('Whether Paypal should add shipping surcharges', 'event_espresso'),
46 46
 						'default'         => false
47
-					) ),
48
-					'shipping_details' => new EE_Select_Input( array(
49
-						EE_PMT_Paypal_Standard::shipping_info_none     => __( "Do not prompt for an address", 'event_espresso' ),
50
-						EE_PMT_Paypal_Standard::shipping_info_optional => __( "Prompt for an address, but do not require it", 'event_espresso' ),
51
-						EE_PMT_Paypal_Standard::shipping_info_required => __( "Prompt for an address, and require it", 'event_espresso' )
52
-					) ),
47
+					)),
48
+					'shipping_details' => new EE_Select_Input(array(
49
+						EE_PMT_Paypal_Standard::shipping_info_none     => __("Do not prompt for an address", 'event_espresso'),
50
+						EE_PMT_Paypal_Standard::shipping_info_optional => __("Prompt for an address, but do not require it", 'event_espresso'),
51
+						EE_PMT_Paypal_Standard::shipping_info_required => __("Prompt for an address, and require it", 'event_espresso')
52
+					)),
53 53
 				),
54
-				'before_form_content_template' => $payment_method_type->file_folder() . DS . 'templates' . DS . 'paypal_standard_settings_before_form.template.php',
54
+				'before_form_content_template' => $payment_method_type->file_folder().DS.'templates'.DS.'paypal_standard_settings_before_form.template.php',
55 55
 			)
56 56
 		);
57 57
 	}
@@ -61,28 +61,28 @@  discard block
 block discarded – undo
61 61
 	/**
62 62
 	 * @param array $req_data
63 63
 	 */
64
-	protected function _normalize( $req_data ) {
65
-		parent::_normalize( $req_data );
66
-		$paypal_calculates_shipping = $this->get_input_value( 'paypal_shipping' );
67
-		$paypal_calculates_taxes = $this->get_input_value( 'paypal_taxes' );
68
-		$paypal_requests_address_info = $this->get_input_value( 'shipping_details' );
64
+	protected function _normalize($req_data) {
65
+		parent::_normalize($req_data);
66
+		$paypal_calculates_shipping = $this->get_input_value('paypal_shipping');
67
+		$paypal_calculates_taxes = $this->get_input_value('paypal_taxes');
68
+		$paypal_requests_address_info = $this->get_input_value('shipping_details');
69 69
 		if (
70
-			( $paypal_calculates_shipping || $paypal_calculates_taxes ) &&
70
+			($paypal_calculates_shipping || $paypal_calculates_taxes) &&
71 71
 			$paypal_requests_address_info == EE_PMT_Paypal_Standard::shipping_info_none
72 72
 		) {
73 73
 			//they want paypal to calculate taxes or shipping. They need to ask for
74 74
 			//address info, otherwise paypal can't calculate taxes or shipping
75 75
 			/** @type EE_Select_Input $shipping_details_input */
76
-			$shipping_details_input = $this->get_input( 'shipping_details' );
77
-			$shipping_details_input->set_default( EE_PMT_Paypal_Standard::shipping_info_optional );
76
+			$shipping_details_input = $this->get_input('shipping_details');
77
+			$shipping_details_input->set_default(EE_PMT_Paypal_Standard::shipping_info_optional);
78 78
 			$shipping_details_input_options = $shipping_details_input->options();
79 79
 			EE_Error::add_attention(
80 80
 				sprintf(
81
-					__( 'Automatically set "%s" to "%s" because Paypal requires address info in order to calculate shipping or taxes.', 'event_espresso' ),
82
-					strip_tags( $shipping_details_input->html_label_text() ),
83
-					isset( $shipping_details_input_options[ EE_PMT_Paypal_Standard::shipping_info_optional ] )
84
-						? $shipping_details_input_options[ EE_PMT_Paypal_Standard::shipping_info_optional ]
85
-						: __( 'Unknown', 'event_espresso' )
81
+					__('Automatically set "%s" to "%s" because Paypal requires address info in order to calculate shipping or taxes.', 'event_espresso'),
82
+					strip_tags($shipping_details_input->html_label_text()),
83
+					isset($shipping_details_input_options[EE_PMT_Paypal_Standard::shipping_info_optional])
84
+						? $shipping_details_input_options[EE_PMT_Paypal_Standard::shipping_info_optional]
85
+						: __('Unknown', 'event_espresso')
86 86
 				),
87 87
 				__FILE__, __FUNCTION__, __LINE__
88 88
 			);
Please login to merge, or discard this patch.
admin/extend/general_settings/Extend_General_Settings_Admin_Page.core.php 2 patches
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if (!defined('EVENT_ESPRESSO_VERSION') )
2
+if ( ! defined('EVENT_ESPRESSO_VERSION'))
3 3
 	exit('NO direct script access allowed');
4 4
 
5 5
 /**
@@ -32,30 +32,30 @@  discard block
 block discarded – undo
32 32
 
33 33
 
34 34
 
35
-	public function __construct( $routing = TRUE ) {
36
-		parent::__construct( $routing );
37
-		define( 'GEN_SET_CAF_TEMPLATE_PATH', EE_CORE_CAF_ADMIN_EXTEND . 'general_settings/templates/' );
35
+	public function __construct($routing = TRUE) {
36
+		parent::__construct($routing);
37
+		define('GEN_SET_CAF_TEMPLATE_PATH', EE_CORE_CAF_ADMIN_EXTEND.'general_settings/templates/');
38 38
 	}
39 39
 
40 40
 
41 41
 
42 42
 	protected function _extend_page_config() {
43 43
 
44
-		$this->_admin_base_path = EE_CORE_CAF_ADMIN_EXTEND . 'general_settings';
44
+		$this->_admin_base_path = EE_CORE_CAF_ADMIN_EXTEND.'general_settings';
45 45
 
46 46
 		//filters and action hooks here
47
-		add_action('AHEE__admin_option_settings__template__before', array( $this, 'use_venue_and_staff_manager_settings'), 10 );
48
-		add_action( 'AHEE__admin_option_settings__template__before', array( $this, 'debug_logging_options' ), 9 );
49
-		add_filter( 'FHEE__General_Settings_Admin_Page___update_admin_option_settings__CFG_admin', array( $this, 'update_debug_logging_options' ), 10, 1 );
47
+		add_action('AHEE__admin_option_settings__template__before', array($this, 'use_venue_and_staff_manager_settings'), 10);
48
+		add_action('AHEE__admin_option_settings__template__before', array($this, 'debug_logging_options'), 9);
49
+		add_filter('FHEE__General_Settings_Admin_Page___update_admin_option_settings__CFG_admin', array($this, 'update_debug_logging_options'), 10, 1);
50 50
 
51 51
 	}
52 52
 
53 53
 
54 54
 
55
-	public function use_venue_and_staff_manager_settings( $template_args ) {
56
-		$_args['use_personnel_manager_select'] = EEH_Form_Fields::select_input('use_personnel_manager', $template_args['values'], $template_args['use_personnel_manager'] );
57
-		$template = GEN_SET_CAF_TEMPLATE_PATH . 'use_venue_and_staff_manager_settings.template.php';
58
-		EEH_Template::display_template( $template, $_args );
55
+	public function use_venue_and_staff_manager_settings($template_args) {
56
+		$_args['use_personnel_manager_select'] = EEH_Form_Fields::select_input('use_personnel_manager', $template_args['values'], $template_args['use_personnel_manager']);
57
+		$template = GEN_SET_CAF_TEMPLATE_PATH.'use_venue_and_staff_manager_settings.template.php';
58
+		EEH_Template::display_template($template, $_args);
59 59
 	}
60 60
 
61 61
 
@@ -68,12 +68,12 @@  discard block
 block discarded – undo
68 68
 	 * @param array $template_args
69 69
 	 * @return void
70 70
 	 */
71
-	public function debug_logging_options( $template_args = array() ) {
71
+	public function debug_logging_options($template_args = array()) {
72 72
 		$template_args['use_full_logging'] = EE_Registry::instance()->CFG->admin->use_full_logging;
73
-		$template_args['use_remote_logging'] = isset( EE_Registry::instance()->CFG->admin->use_remote_logging ) ? absint( EE_Registry::instance()->CFG->admin->use_remote_logging ) : FALSE;
74
-		$template_args['remote_logging_url'] = isset( EE_Registry::instance()->CFG->admin->remote_logging_url ) && ! empty( EE_Registry::instance()->CFG->admin->remote_logging_url ) ? stripslashes( EE_Registry::instance()->CFG->admin->remote_logging_url ) : '';
75
-		$template = GEN_SET_CAF_TEMPLATE_PATH . 'debug_log_settings.template.php';
76
-		EEH_Template::display_template( $template, $template_args );
73
+		$template_args['use_remote_logging'] = isset(EE_Registry::instance()->CFG->admin->use_remote_logging) ? absint(EE_Registry::instance()->CFG->admin->use_remote_logging) : FALSE;
74
+		$template_args['remote_logging_url'] = isset(EE_Registry::instance()->CFG->admin->remote_logging_url) && ! empty(EE_Registry::instance()->CFG->admin->remote_logging_url) ? stripslashes(EE_Registry::instance()->CFG->admin->remote_logging_url) : '';
75
+		$template = GEN_SET_CAF_TEMPLATE_PATH.'debug_log_settings.template.php';
76
+		EEH_Template::display_template($template, $template_args);
77 77
 	}
78 78
 
79 79
 
@@ -84,17 +84,17 @@  discard block
 block discarded – undo
84 84
 	 * @param array $admin_options
85 85
 	 * @return array
86 86
 	 */
87
-	public function update_debug_logging_options( $admin_options = array() ) {
88
-		$use_full_logging = isset( $this->_req_data['use_full_logging'] ) ? (bool)absint( $this->_req_data['use_full_logging'] ) : $admin_options->use_full_logging;
87
+	public function update_debug_logging_options($admin_options = array()) {
88
+		$use_full_logging = isset($this->_req_data['use_full_logging']) ? (bool) absint($this->_req_data['use_full_logging']) : $admin_options->use_full_logging;
89 89
 		$admin_options->use_full_logging = $use_full_logging;
90 90
 		
91
-		if ( $use_full_logging === FALSE ) {
92
-			EE_Error::get_notices( FALSE );
91
+		if ($use_full_logging === FALSE) {
92
+			EE_Error::get_notices(FALSE);
93 93
 			EE_Error::reset_notices();
94 94
 		}
95 95
 
96
-		$admin_options->use_remote_logging = isset( $this->_req_data['use_remote_logging'] ) ? absint( $this->_req_data['use_remote_logging'] ) : $admin_options->use_remote_logging;
97
-		$admin_options->remote_logging_url = isset( $this->_req_data['remote_logging_url'] ) ? esc_url_raw( $this->_req_data['remote_logging_url'] ) : $admin_options->remote_logging_url;
96
+		$admin_options->use_remote_logging = isset($this->_req_data['use_remote_logging']) ? absint($this->_req_data['use_remote_logging']) : $admin_options->use_remote_logging;
97
+		$admin_options->remote_logging_url = isset($this->_req_data['remote_logging_url']) ? esc_url_raw($this->_req_data['remote_logging_url']) : $admin_options->remote_logging_url;
98 98
 		return $admin_options;
99 99
 	}
100 100
 
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,7 @@
 block discarded – undo
1 1
 <?php
2
-if (!defined('EVENT_ESPRESSO_VERSION') )
2
+if (!defined('EVENT_ESPRESSO_VERSION') ) {
3 3
 	exit('NO direct script access allowed');
4
+}
4 5
 
5 6
 /**
6 7
  * Event Espresso
Please login to merge, or discard this patch.
caffeinated/admin/extend/events/Extend_Events_Admin_Page.core.php 2 patches
Braces   +44 added lines, -32 removed lines patch added patch discarded remove patch
@@ -1,6 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if (!defined('EVENT_ESPRESSO_VERSION') )
2
+if (!defined('EVENT_ESPRESSO_VERSION') ) {
3 3
 	exit('NO direct script access allowed');
4
+}
4 5
 
5 6
 /**
6 7
  * Event Espresso
@@ -435,8 +436,9 @@  discard block
 block discarded – undo
435 436
 		//k we've got EVT_ID so let's use that to get the event we'll duplicate
436 437
 		$orig_event = EEM_Event::instance()->get_one_by_ID( $this->_req_data['EVT_ID'] );
437 438
 
438
-		if ( ! $orig_event instanceof EE_Event )
439
-			throw new EE_Error( sprintf( __('An EE_Event object could not be retrieved for the given ID (%s)', 'event_espresso '), $this->_req_data['EVT_ID'] ) );
439
+		if ( ! $orig_event instanceof EE_Event ) {
440
+					throw new EE_Error( sprintf( __('An EE_Event object could not be retrieved for the given ID (%s)', 'event_espresso '), $this->_req_data['EVT_ID'] ) );
441
+		}
440 442
 
441 443
 		//k now let's clone the $orig_event before getting relations
442 444
 		$new_event = clone $orig_event;
@@ -510,8 +512,9 @@  discard block
 block discarded – undo
510 512
 			//now let's get the ticket relations setup.
511 513
 			foreach ( (array) $orig_tkts as $orig_tkt ) {
512 514
 				//it's possible a datetime will have no tickets so let's verify we HAVE a ticket first.
513
-				if ( ! $orig_tkt instanceof EE_Ticket )
514
-					continue;
515
+				if ( ! $orig_tkt instanceof EE_Ticket ) {
516
+									continue;
517
+				}
515 518
 
516 519
 				//is this ticket archived?  If it is then let's skip
517 520
 				if ( $orig_tkt->get( 'TKT_deleted' ) ) {
@@ -620,9 +623,9 @@  discard block
 block discarded – undo
620 623
 	protected function _events_export() {
621 624
 		if(isset($this->_req_data['EVT_ID'])){
622 625
 			$event_ids = $this->_req_data['EVT_ID'];
623
-		}elseif(isset($this->_req_data['EVT_IDs'])){
626
+		} elseif(isset($this->_req_data['EVT_IDs'])){
624 627
 			$event_ids = $this->_req_data['EVT_IDs'];
625
-		}else{
628
+		} else{
626 629
 			$event_ids = NULL;
627 630
 		}
628 631
 		//todo: I don't like doing this but it'll do until we modify EE_Export Class.
@@ -811,8 +814,9 @@  discard block
 block discarded – undo
811 814
 
812 815
 		extract( wp_parse_args($args, $defaults), EXTR_SKIP );
813 816
 
814
-		if ( empty($walker) || !is_a($walker, 'Walker') )
815
-			$walker = new Walker_Radio_Checklist;
817
+		if ( empty($walker) || !is_a($walker, 'Walker') ) {
818
+					$walker = new Walker_Radio_Checklist;
819
+		}
816 820
 
817 821
 		$descendants_and_self = (int) $descendants_and_self;
818 822
 
@@ -821,17 +825,19 @@  discard block
 block discarded – undo
821 825
 		$tax = get_taxonomy($taxonomy);
822 826
 		$args['disabled'] = !current_user_can($tax->cap->assign_terms);
823 827
 
824
-		if ( is_array( $selected_cats ) )
825
-			$args['selected_cats'] = $selected_cats;
826
-		elseif ( $post_id )
827
-			$args['selected_cats'] = wp_get_object_terms($post_id, $taxonomy, array_merge($args, array('fields' => 'ids')));
828
-		else
829
-			$args['selected_cats'] = array();
828
+		if ( is_array( $selected_cats ) ) {
829
+					$args['selected_cats'] = $selected_cats;
830
+		} elseif ( $post_id ) {
831
+					$args['selected_cats'] = wp_get_object_terms($post_id, $taxonomy, array_merge($args, array('fields' => 'ids')));
832
+		} else {
833
+					$args['selected_cats'] = array();
834
+		}
830 835
 
831
-		if ( is_array( $popular_cats ) )
832
-			$args['popular_cats'] = $popular_cats;
833
-		else
834
-			$args['popular_cats'] = get_terms( $taxonomy, array( 'fields' => 'ids', 'orderby' => 'count', 'order' => 'DESC', 'number' => 10, 'hierarchical' => false ) );
836
+		if ( is_array( $popular_cats ) ) {
837
+					$args['popular_cats'] = $popular_cats;
838
+		} else {
839
+					$args['popular_cats'] = get_terms( $taxonomy, array( 'fields' => 'ids', 'orderby' => 'count', 'order' => 'DESC', 'number' => 10, 'hierarchical' => false ) );
840
+		}
835 841
 
836 842
 		if ( $descendants_and_self ) {
837 843
 			$categories = (array) get_terms($taxonomy, array( 'child_of' => $descendants_and_self, 'hierarchical' => 0, 'hide_empty' => 0 ) );
@@ -884,8 +890,9 @@  discard block
 block discarded – undo
884 890
 		$status = isset( $this->_req_data['status'] ) ? $this->_req_data['status'] : NULL;
885 891
 
886 892
 		//active status dropdown
887
-		if ( $status !== 'draft' )
888
-			$filter[] = $this->active_status_dropdown( isset( $this->_req_data['active_status'] ) ? $this->_req_data['active_status'] : '' );
893
+		if ( $status !== 'draft' ) {
894
+					$filter[] = $this->active_status_dropdown( isset( $this->_req_data['active_status'] ) ? $this->_req_data['active_status'] : '' );
895
+		}
889 896
 
890 897
 		//category filter
891 898
 		$filters[] = $this->category_dropdown();
@@ -1064,7 +1071,7 @@  discard block
 block discarded – undo
1064 1071
 
1065 1072
 		if($count){
1066 1073
 			return EEM_Ticket::instance()->count_deleted_and_undeleted(array($_where));
1067
-		}else{
1074
+		} else{
1068 1075
 			return EEM_Ticket::instance()->get_all_deleted_and_undeleted($query_params);
1069 1076
 		}
1070 1077
 
@@ -1087,11 +1094,13 @@  discard block
 block discarded – undo
1087 1094
 			//cycle thru the boxes
1088 1095
 			while ( list( $TKT_ID, $value ) = each( $this->_req_data['checkbox'] ) ) {
1089 1096
 				if ( $trash ) {
1090
-					if ( ! $TKT->delete_by_ID( $TKT_ID ) )
1091
-						$success = 0;
1097
+					if ( ! $TKT->delete_by_ID( $TKT_ID ) ) {
1098
+											$success = 0;
1099
+					}
1092 1100
 				} else {
1093
-					if ( ! $TKT->restore_by_ID( $TKT_ID ) )
1094
-						$success = 0;
1101
+					if ( ! $TKT->restore_by_ID( $TKT_ID ) ) {
1102
+											$success = 0;
1103
+					}
1095 1104
 				}
1096 1105
 			}
1097 1106
 		} else {
@@ -1099,11 +1108,13 @@  discard block
 block discarded – undo
1099 1108
 			$TKT_ID = absint( $this->_req_data['TKT_ID'] );
1100 1109
 
1101 1110
 			if ( $trash ) {
1102
-				if ( ! $TKT->delete_by_ID( $TKT_ID ) )
1103
-					$success = 0;
1111
+				if ( ! $TKT->delete_by_ID( $TKT_ID ) ) {
1112
+									$success = 0;
1113
+				}
1104 1114
 			} else {
1105
-				if ( ! $TKT->restore_by_ID( $TKT_ID ) )
1106
-					$success = 0;
1115
+				if ( ! $TKT->restore_by_ID( $TKT_ID ) ) {
1116
+									$success = 0;
1117
+				}
1107 1118
 			}
1108 1119
 		}
1109 1120
 
@@ -1151,8 +1162,9 @@  discard block
 block discarded – undo
1151 1162
 			);
1152 1163
 
1153 1164
 		//failsafe.  If the default ticket count === 1 then we need to redirect to event overview.
1154
-		if ( EEM_Ticket::instance()->count_deleted_and_undeleted( array( array( 'TKT_is_default' => 1 ) ), 'TKT_ID', TRUE ) )
1155
-			$query_args = array();
1165
+		if ( EEM_Ticket::instance()->count_deleted_and_undeleted( array( array( 'TKT_is_default' => 1 ) ), 'TKT_ID', TRUE ) ) {
1166
+					$query_args = array();
1167
+		}
1156 1168
 		$this->_redirect_after_action( $success, 'Tickets', $action_desc, $query_args );
1157 1169
 	}
1158 1170
 
Please login to merge, or discard this patch.
Spacing   +216 added lines, -216 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if (!defined('EVENT_ESPRESSO_VERSION') )
2
+if ( ! defined('EVENT_ESPRESSO_VERSION'))
3 3
 	exit('NO direct script access allowed');
4 4
 
5 5
 /**
@@ -30,25 +30,25 @@  discard block
 block discarded – undo
30 30
 class Extend_Events_Admin_Page extends Events_Admin_Page {
31 31
 
32 32
 
33
-	public function __construct( $routing = TRUE ) {
34
-		parent::__construct( $routing );
35
-		define( 'EVENTS_CAF_TEMPLATE_PATH', EE_CORE_CAF_ADMIN_EXTEND . 'events/templates/');
36
-		define( 'EVENTS_CAF_ASSETS', EE_CORE_CAF_ADMIN_EXTEND . 'events/assets/');
37
-		define( 'EVENTS_CAF_ASSETS_URL', EE_CORE_CAF_ADMIN_EXTEND_URL . 'events/assets/');
33
+	public function __construct($routing = TRUE) {
34
+		parent::__construct($routing);
35
+		define('EVENTS_CAF_TEMPLATE_PATH', EE_CORE_CAF_ADMIN_EXTEND.'events/templates/');
36
+		define('EVENTS_CAF_ASSETS', EE_CORE_CAF_ADMIN_EXTEND.'events/assets/');
37
+		define('EVENTS_CAF_ASSETS_URL', EE_CORE_CAF_ADMIN_EXTEND_URL.'events/assets/');
38 38
 	}
39 39
 
40 40
 
41 41
 	protected function _extend_page_config() {
42 42
 
43
-		$this->_admin_base_path = EE_CORE_CAF_ADMIN_EXTEND . 'events';
43
+		$this->_admin_base_path = EE_CORE_CAF_ADMIN_EXTEND.'events';
44 44
 		$default_espresso_boxes = $this->_default_espresso_metaboxes;
45 45
 
46 46
 		//is there a evt_id in the request?
47
-		$evt_id = ! empty( $this->_req_data['EVT_ID'] ) && ! is_array( $this->_req_data['EVT_ID'] ) ? $this->_req_data['EVT_ID'] : 0;
48
-		$evt_id = ! empty( $this->_req_data['post'] ) ? $this->_req_data['post'] : $evt_id;
47
+		$evt_id = ! empty($this->_req_data['EVT_ID']) && ! is_array($this->_req_data['EVT_ID']) ? $this->_req_data['EVT_ID'] : 0;
48
+		$evt_id = ! empty($this->_req_data['post']) ? $this->_req_data['post'] : $evt_id;
49 49
 
50 50
 		//tkt_id?
51
-		$tkt_id = !empty( $this->_req_data['TKT_ID'] ) && ! is_array( $this->_req_data['TKT_ID'] ) ? $this->_req_data['TKT_ID'] : 0;
51
+		$tkt_id = ! empty($this->_req_data['TKT_ID']) && ! is_array($this->_req_data['TKT_ID']) ? $this->_req_data['TKT_ID'] : 0;
52 52
 
53 53
 		$new_page_routes = array(
54 54
 			'duplicate_event' => array(
@@ -66,13 +66,13 @@  discard block
 block discarded – undo
66 66
 				'capability' => 'ee_delete_default_ticket',
67 67
 				'obj_id' => $tkt_id,
68 68
 				'noheader' => TRUE,
69
-				'args' => array( 'trash' => TRUE )
69
+				'args' => array('trash' => TRUE)
70 70
 				),
71 71
 			'trash_tickets' => array(
72 72
 				'func' => '_trash_or_restore_ticket',
73 73
 				'capability' => 'ee_delete_default_tickets',
74 74
 				'noheader' => TRUE,
75
-				'args' => array( 'trash' => TRUE )
75
+				'args' => array('trash' => TRUE)
76 76
 				),
77 77
 			'restore_ticket' => array(
78 78
 				'func' => '_trash_or_restore_ticket',
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
 				)
133 133
 			);
134 134
 
135
-		$this->_page_routes = array_merge( $this->_page_routes, $new_page_routes );
135
+		$this->_page_routes = array_merge($this->_page_routes, $new_page_routes);
136 136
 
137 137
 
138 138
 		//partial route/config override
@@ -144,8 +144,8 @@  discard block
 block discarded – undo
144 144
 		$this->_page_config['default']['list_table'] = 'Extend_Events_Admin_List_Table';
145 145
 
146 146
 		//add tickets tab but only if there are more than one default ticket!
147
-		$tkt_count = EEM_Ticket::instance()->count_deleted_and_undeleted(array( array('TKT_is_default' => 1 ) ), 'TKT_ID', TRUE );
148
-		if ( $tkt_count > 1 ) {
147
+		$tkt_count = EEM_Ticket::instance()->count_deleted_and_undeleted(array(array('TKT_is_default' => 1)), 'TKT_ID', TRUE);
148
+		if ($tkt_count > 1) {
149 149
 			$new_page_config = array(
150 150
 				'ticket_list_table' => array(
151 151
 					'nav' => array(
@@ -164,14 +164,14 @@  discard block
 block discarded – undo
164 164
 				'label' => __('Templates'),
165 165
 				'order' => 30
166 166
 			),
167
-			'metaboxes' => array_merge( $this->_default_espresso_metaboxes, array( '_publish_post_box' ) ),
167
+			'metaboxes' => array_merge($this->_default_espresso_metaboxes, array('_publish_post_box')),
168 168
 			'help_tabs' => array(
169 169
 				'general_settings_templates_help_tab' => array(
170 170
 					'title' => __('Templates', 'event_espresso'),
171 171
 					'filename' => 'general_settings_templates'
172 172
 				)
173 173
 			),
174
-			'help_tour' => array( 'Templates_Help_Tour' ),
174
+			'help_tour' => array('Templates_Help_Tour'),
175 175
 			'require_nonce' => FALSE
176 176
 		);
177 177
 
@@ -190,26 +190,26 @@  discard block
 block discarded – undo
190 190
 //				'metaboxes' => $default_espresso_boxes,
191 191
 //				'require_nonce' => FALSE
192 192
 //		);
193
-		$this->_page_config = array_merge( $this->_page_config, $new_page_config );
193
+		$this->_page_config = array_merge($this->_page_config, $new_page_config);
194 194
 
195 195
 		//add filters and actions
196 196
 		//modifying _views
197
-		add_filter('FHEE_event_datetime_metabox_add_additional_date_time_template', array( $this, 'add_additional_datetime_button' ), 10, 2 );
198
-		add_filter('FHEE_event_datetime_metabox_clone_button_template', array( $this, 'add_datetime_clone_button' ), 10, 2 );
199
-		add_filter('FHEE_event_datetime_metabox_timezones_template', array( $this, 'datetime_timezones_template'), 10, 2 );
197
+		add_filter('FHEE_event_datetime_metabox_add_additional_date_time_template', array($this, 'add_additional_datetime_button'), 10, 2);
198
+		add_filter('FHEE_event_datetime_metabox_clone_button_template', array($this, 'add_datetime_clone_button'), 10, 2);
199
+		add_filter('FHEE_event_datetime_metabox_timezones_template', array($this, 'datetime_timezones_template'), 10, 2);
200 200
 
201 201
 
202 202
 		//filters for event list table
203
-		add_filter('FHEE__Extend_Events_Admin_List_Table__filters', array( $this, 'list_table_filters'), 10, 2);
204
-		add_filter('FHEE__Events_Admin_List_Table__column_actions__action_links', array( $this, 'extra_list_table_actions'), 10, 2 );
203
+		add_filter('FHEE__Extend_Events_Admin_List_Table__filters', array($this, 'list_table_filters'), 10, 2);
204
+		add_filter('FHEE__Events_Admin_List_Table__column_actions__action_links', array($this, 'extra_list_table_actions'), 10, 2);
205 205
 
206 206
 		//legend item
207
-		add_filter('FHEE__Events_Admin_Page___event_legend_items__items', array( $this, 'additional_legend_items') );
207
+		add_filter('FHEE__Events_Admin_Page___event_legend_items__items', array($this, 'additional_legend_items'));
208 208
 
209
-		add_action('admin_init', array( $this, 'admin_init') );
209
+		add_action('admin_init', array($this, 'admin_init'));
210 210
 
211 211
 		//heartbeat stuff
212
-		add_filter( 'heartbeat_received', array( $this, 'heartbeat_response' ), 10, 2 );
212
+		add_filter('heartbeat_received', array($this, 'heartbeat_response'), 10, 2);
213 213
 
214 214
 	}
215 215
 
@@ -222,12 +222,12 @@  discard block
 block discarded – undo
222 222
 		EE_Registry::$i18n_js_strings = array_merge(
223 223
 			EE_Registry::$i18n_js_strings,
224 224
 			array(
225
-				'image_confirm'          => __( 'Do you really want to delete this image? Please remember to update your event to complete the removal.', 'event_espresso' ),
226
-				'event_starts_on'        => __( 'Event Starts on', 'event_espresso' ),
227
-				'event_ends_on'          => __( 'Event Ends on', 'event_espresso' ),
228
-				'event_datetime_actions' => __( 'Actions', 'event_espresso' ),
229
-				'event_clone_dt_msg'     => __( 'Clone this Event Date and Time', 'event_espresso' ),
230
-				'remove_event_dt_msg'    => __( 'Remove this Event Time', 'event_espresso' )
225
+				'image_confirm'          => __('Do you really want to delete this image? Please remember to update your event to complete the removal.', 'event_espresso'),
226
+				'event_starts_on'        => __('Event Starts on', 'event_espresso'),
227
+				'event_ends_on'          => __('Event Ends on', 'event_espresso'),
228
+				'event_datetime_actions' => __('Actions', 'event_espresso'),
229
+				'event_clone_dt_msg'     => __('Clone this Event Date and Time', 'event_espresso'),
230
+				'remove_event_dt_msg'    => __('Remove this Event Time', 'event_espresso')
231 231
 			)
232 232
 		);
233 233
 	}
@@ -242,12 +242,12 @@  discard block
 block discarded – undo
242 242
 	 *
243 243
 	 * @return array  possibly appended response.
244 244
 	 */
245
-	public function heartbeat_response( $response, $data ) {
245
+	public function heartbeat_response($response, $data) {
246 246
 		/**
247 247
 		 * check whether count of tickets is approaching the potential
248 248
 		 * limits for the server.
249 249
 		 */
250
-		if ( ! empty( $data['input_count'] ) ) {
250
+		if ( ! empty($data['input_count'])) {
251 251
 			$response['max_input_vars_check'] = EE_Registry::instance()->CFG->environment->max_input_vars_limit_check($data['input_count']);
252 252
 		}
253 253
 
@@ -262,13 +262,13 @@  discard block
 block discarded – undo
262 262
 
263 263
 
264 264
 
265
-	public function extra_permalink_field_buttons( $return, $id, $new_title, $new_slug ) {
266
-		$return = parent::extra_permalink_field_buttons( $return, $id, $new_title, $new_slug );
265
+	public function extra_permalink_field_buttons($return, $id, $new_title, $new_slug) {
266
+		$return = parent::extra_permalink_field_buttons($return, $id, $new_title, $new_slug);
267 267
 		//make sure this is only when editing
268
-		if ( !empty( $id ) ) {
269
-			$href = EE_Admin_Page::add_query_args_and_nonce( array('action' => 'duplicate_event', 'EVT_ID' => $id), $this->_admin_base_url );
268
+		if ( ! empty($id)) {
269
+			$href = EE_Admin_Page::add_query_args_and_nonce(array('action' => 'duplicate_event', 'EVT_ID' => $id), $this->_admin_base_url);
270 270
 			$title = esc_attr__('Duplicate Event', 'event_espresso');
271
-			$return .= '<a href="' . $href . '" title="' . $title . '" id="ee-duplicate-event-button" class="button button-small"  value="duplicate_event">' . $title  . '</button>';
271
+			$return .= '<a href="'.$href.'" title="'.$title.'" id="ee-duplicate-event-button" class="button button-small"  value="duplicate_event">'.$title.'</button>';
272 272
 		}
273 273
 		return $return;
274 274
 	}
@@ -291,7 +291,7 @@  discard block
 block discarded – undo
291 291
 				'label' => __('Trash', 'event_espresso'),
292 292
 				'count' => 0,
293 293
 				'bulk_action' => array(
294
-					'restore_tickets' => __('Restore from Trash' , 'event_espresso'),
294
+					'restore_tickets' => __('Restore from Trash', 'event_espresso'),
295 295
 					'delete_tickets' => __('Delete Permanently', 'event_espresso')
296 296
 					)
297 297
 				)
@@ -301,7 +301,7 @@  discard block
 block discarded – undo
301 301
 
302 302
 
303 303
 	public function load_scripts_styles_edit() {
304
-		wp_register_script( 'ee-event-editor-heartbeat', EVENTS_CAF_ASSETS_URL . 'event-editor-heartbeat.js', array( 'ee_admin_js', 'heartbeat' ), EVENT_ESPRESSO_VERSION, TRUE );
304
+		wp_register_script('ee-event-editor-heartbeat', EVENTS_CAF_ASSETS_URL.'event-editor-heartbeat.js', array('ee_admin_js', 'heartbeat'), EVENT_ESPRESSO_VERSION, TRUE);
305 305
 
306 306
 		/**
307 307
 		 * load accounting js.
@@ -320,20 +320,20 @@  discard block
 block discarded – undo
320 320
 
321 321
 
322 322
 
323
-	public function add_additional_datetime_button( $template, $template_args ) {
324
-		return EEH_Template::display_template( EVENTS_CAF_TEMPLATE_PATH . 'event_datetime_add_additional_time.template.php', $template_args, TRUE);
323
+	public function add_additional_datetime_button($template, $template_args) {
324
+		return EEH_Template::display_template(EVENTS_CAF_TEMPLATE_PATH.'event_datetime_add_additional_time.template.php', $template_args, TRUE);
325 325
 	}
326 326
 
327 327
 
328 328
 
329
-	public function add_datetime_clone_button( $template, $template_args ) {
330
-		return EEH_Template::display_template( EVENTS_CAF_TEMPLATE_PATH . 'event_datetime_metabox_clone_button.template.php', $template_args, TRUE );
329
+	public function add_datetime_clone_button($template, $template_args) {
330
+		return EEH_Template::display_template(EVENTS_CAF_TEMPLATE_PATH.'event_datetime_metabox_clone_button.template.php', $template_args, TRUE);
331 331
 	}
332 332
 
333 333
 
334 334
 
335
-	public function datetime_timezones_template( $template, $template_args ) {
336
-		return EEH_Template::display_template( EVENTS_CAF_TEMPLATE_PATH . 'event_datetime_timezones.template.php', $template_args, TRUE );
335
+	public function datetime_timezones_template($template, $template_args) {
336
+		return EEH_Template::display_template(EVENTS_CAF_TEMPLATE_PATH.'event_datetime_timezones.template.php', $template_args, TRUE);
337 337
 	}
338 338
 
339 339
 
@@ -342,11 +342,11 @@  discard block
 block discarded – undo
342 342
 	protected function _set_list_table_views_default() {
343 343
 		parent::_set_list_table_views_default();
344 344
 		$export_label = __('Export Events', 'event_espresso');
345
-		if ( EE_Registry::instance()->CAP->current_user_can( 'export', 'espresso_events_export' ) ) {
345
+		if (EE_Registry::instance()->CAP->current_user_can('export', 'espresso_events_export')) {
346 346
 //			$this->_views['all']['bulk_action']['export_events'] = $export_label;
347 347
 //			$this->_views['draft']['bulk_action']['export_events'] = $export_label;
348 348
 
349
-			if ( EE_Registry::instance()->CAP->current_user_can( 'ee_delete_events', 'espresso_events_trash_events' ) ) {
349
+			if (EE_Registry::instance()->CAP->current_user_can('ee_delete_events', 'espresso_events_trash_events')) {
350 350
 //				$this->_views['trash']['bulk_action']['export_events'] = $export_label;
351 351
 			}
352 352
 		}
@@ -372,7 +372,7 @@  discard block
 block discarded – undo
372 372
 			)
373 373
 		);
374 374
 
375
-		$this->_views = array_merge( $this->_views, $new_views);
375
+		$this->_views = array_merge($this->_views, $new_views);
376 376
 	}
377 377
 
378 378
 
@@ -386,17 +386,17 @@  discard block
 block discarded – undo
386 386
 
387 387
 
388 388
 
389
-	public function extra_list_table_actions( $actionlinks, $event ) {
390
-		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_read_registrations', 'espresso_registrations_reports', $event->ID() ) ) {
389
+	public function extra_list_table_actions($actionlinks, $event) {
390
+		if (EE_Registry::instance()->CAP->current_user_can('ee_read_registrations', 'espresso_registrations_reports', $event->ID())) {
391 391
 			$reports_query_args = array(
392 392
 					'action' => 'reports',
393 393
 					'EVT_ID' => $event->ID()
394 394
 				);
395
-			$reports_link = EE_Admin_Page::add_query_args_and_nonce( $reports_query_args, REG_ADMIN_URL );
396
-			$actionlinks[] = '<a href="' . $reports_link . '" title="' .  esc_attr__('View Report', 'event_espresso') . '"><div class="dashicons dashicons-chart-bar"></div></a>' . "\n\t";
395
+			$reports_link = EE_Admin_Page::add_query_args_and_nonce($reports_query_args, REG_ADMIN_URL);
396
+			$actionlinks[] = '<a href="'.$reports_link.'" title="'.esc_attr__('View Report', 'event_espresso').'"><div class="dashicons dashicons-chart-bar"></div></a>'."\n\t";
397 397
 		}
398
-		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_read_global_messages', 'view_filtered_messages' ) ) {
399
-			EE_Registry::instance()->load_helper( 'MSG_Template' );
398
+		if (EE_Registry::instance()->CAP->current_user_can('ee_read_global_messages', 'view_filtered_messages')) {
399
+			EE_Registry::instance()->load_helper('MSG_Template');
400 400
 			$actionlinks[] = EEH_MSG_Template::get_message_action_link(
401 401
 				'see_notifications_for',
402 402
 				null,
@@ -411,15 +411,15 @@  discard block
 block discarded – undo
411 411
 
412 412
 
413 413
 	public function additional_legend_items($items) {
414
-		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_read_registrations', 'espresso_registrations_reports' ) ) {
414
+		if (EE_Registry::instance()->CAP->current_user_can('ee_read_registrations', 'espresso_registrations_reports')) {
415 415
 			$items['reports'] = array(
416 416
 					'class' => 'dashicons dashicons-chart-bar',
417 417
 					'desc' => __('Event Reports', 'event_espresso')
418 418
 				);
419 419
 		}
420
-		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_read_global_messages', 'view_filtered_messages' ) ) {
421
-			$related_for_icon = EEH_MSG_Template::get_message_action_icon( 'see_notifications_for' );
422
-			if ( isset( $related_for_icon['css_class']) && isset( $related_for_icon['label'] ) ) {
420
+		if (EE_Registry::instance()->CAP->current_user_can('ee_read_global_messages', 'view_filtered_messages')) {
421
+			$related_for_icon = EEH_MSG_Template::get_message_action_icon('see_notifications_for');
422
+			if (isset($related_for_icon['css_class']) && isset($related_for_icon['label'])) {
423 423
 				$items['view_related_messages'] = array(
424 424
 					'class' => $related_for_icon['css_class'],
425 425
 					'desc' => $related_for_icon['label'],
@@ -444,17 +444,17 @@  discard block
 block discarded – undo
444 444
 	 */
445 445
 	protected function _duplicate_event() {
446 446
 		//first make sure the ID for the event is in the request.  If it isnt' then we need to bail and redirect back to overview list table (cause how did we get here?)
447
-		if ( !isset( $this->_req_data['EVT_ID'] ) ) {
448
-			EE_Error::add_error( __('In order to duplicate an event an Event ID is required.  None was given.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__ );
449
-			$this->_redirect_after_action( FALSE, '', '', array(), TRUE );
447
+		if ( ! isset($this->_req_data['EVT_ID'])) {
448
+			EE_Error::add_error(__('In order to duplicate an event an Event ID is required.  None was given.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
449
+			$this->_redirect_after_action(FALSE, '', '', array(), TRUE);
450 450
 			return;
451 451
 		}
452 452
 
453 453
 		//k we've got EVT_ID so let's use that to get the event we'll duplicate
454
-		$orig_event = EEM_Event::instance()->get_one_by_ID( $this->_req_data['EVT_ID'] );
454
+		$orig_event = EEM_Event::instance()->get_one_by_ID($this->_req_data['EVT_ID']);
455 455
 
456
-		if ( ! $orig_event instanceof EE_Event )
457
-			throw new EE_Error( sprintf( __('An EE_Event object could not be retrieved for the given ID (%s)', 'event_espresso '), $this->_req_data['EVT_ID'] ) );
456
+		if ( ! $orig_event instanceof EE_Event)
457
+			throw new EE_Error(sprintf(__('An EE_Event object could not be retrieved for the given ID (%s)', 'event_espresso '), $this->_req_data['EVT_ID']));
458 458
 
459 459
 		//k now let's clone the $orig_event before getting relations
460 460
 		$new_event = clone $orig_event;
@@ -467,43 +467,43 @@  discard block
 block discarded – undo
467 467
 
468 468
 
469 469
 		//reset the ID and modify other details to make it clear this is a dupe
470
-		$new_event->set( 'EVT_ID', 0 );
471
-		$new_name = $new_event->name() . ' ' . __('**DUPLICATE**', 'event_espresso');
472
-		$new_event->set( 'EVT_name',  $new_name );
473
-		$new_event->set( 'EVT_slug',  wp_unique_post_slug( sanitize_title( $orig_event->name() ), 0, 'publish', 'espresso_events', 0 ) );
474
-		$new_event->set( 'status', 'draft' );
470
+		$new_event->set('EVT_ID', 0);
471
+		$new_name = $new_event->name().' '.__('**DUPLICATE**', 'event_espresso');
472
+		$new_event->set('EVT_name', $new_name);
473
+		$new_event->set('EVT_slug', wp_unique_post_slug(sanitize_title($orig_event->name()), 0, 'publish', 'espresso_events', 0));
474
+		$new_event->set('status', 'draft');
475 475
 
476 476
 		//duplicate discussion settings
477
-		$new_event->set( 'comment_status', $orig_event->get('comment_status') );
478
-		$new_event->set( 'ping_status', $orig_event->get( 'ping_status' ) );
477
+		$new_event->set('comment_status', $orig_event->get('comment_status'));
478
+		$new_event->set('ping_status', $orig_event->get('ping_status'));
479 479
 
480 480
 		//save the new event
481 481
 		$new_event->save();
482 482
 
483 483
 		//venues
484
-		foreach( $orig_ven as $ven ) {
485
-			$new_event->_add_relation_to( $ven, 'Venue' );
484
+		foreach ($orig_ven as $ven) {
485
+			$new_event->_add_relation_to($ven, 'Venue');
486 486
 		}
487 487
 		$new_event->save();
488 488
 
489 489
 
490 490
 		//now we need to get the question group relations and handle that
491 491
 		//first primary question groups
492
-		$orig_primary_qgs = $orig_event->get_many_related('Question_Group', array( array('Event_Question_Group.EQG_primary' => 1 ) ) );
493
-		if ( !empty( $orig_primary_qgs ) ) {
494
-			foreach ( $orig_primary_qgs as $id => $obj ) {
495
-				if ( $obj instanceof EE_Question_Group ) {
496
-					$new_event->_add_relation_to( $obj, 'Question_Group', array( 'EQG_primary' => 1 ) );
492
+		$orig_primary_qgs = $orig_event->get_many_related('Question_Group', array(array('Event_Question_Group.EQG_primary' => 1)));
493
+		if ( ! empty($orig_primary_qgs)) {
494
+			foreach ($orig_primary_qgs as $id => $obj) {
495
+				if ($obj instanceof EE_Question_Group) {
496
+					$new_event->_add_relation_to($obj, 'Question_Group', array('EQG_primary' => 1));
497 497
 				}
498 498
 			}
499 499
 		}
500 500
 
501 501
 		//next additional attendee question groups
502
-		$orig_additional_qgs = $orig_event->get_many_related('Question_Group', array( array('Event_Question_Group.EQG_primary' => 0 ) ) );
503
-		if ( !empty( $orig_additional_qgs ) ) {
504
-			foreach ( $orig_additional_qgs as $id => $obj ) {
505
-				if ( $obj instanceof EE_Question_Group ) {
506
-					$new_event->_add_relation_to( $obj, 'Question_Group', array( 'EQG_primary' => 0 ) );
502
+		$orig_additional_qgs = $orig_event->get_many_related('Question_Group', array(array('Event_Question_Group.EQG_primary' => 0)));
503
+		if ( ! empty($orig_additional_qgs)) {
504
+			foreach ($orig_additional_qgs as $id => $obj) {
505
+				if ($obj instanceof EE_Question_Group) {
506
+					$new_event->_add_relation_to($obj, 'Question_Group', array('EQG_primary' => 0));
507 507
 				}
508 508
 			}
509 509
 		}
@@ -514,7 +514,7 @@  discard block
 block discarded – undo
514 514
 
515 515
 		//k now that we have the new event saved we can loop through the datetimes and start adding relations.
516 516
 		$cloned_tickets = array();
517
-		foreach ( $orig_datetimes as $orig_dtt ) {
517
+		foreach ($orig_datetimes as $orig_dtt) {
518 518
 			$new_dtt = clone $orig_dtt;
519 519
 			$orig_tkts = $orig_dtt->tickets();
520 520
 
@@ -522,22 +522,22 @@  discard block
 block discarded – undo
522 522
 			$new_dtt->set('DTT_ID', 0);
523 523
 			$new_dtt->set('DTT_sold', 0);
524 524
 			$new_dtt->save();
525
-			$new_event->_add_relation_to( $new_dtt, 'Datetime');
525
+			$new_event->_add_relation_to($new_dtt, 'Datetime');
526 526
 			$new_event->save();
527 527
 
528 528
 			//now let's get the ticket relations setup.
529
-			foreach ( (array) $orig_tkts as $orig_tkt ) {
529
+			foreach ((array) $orig_tkts as $orig_tkt) {
530 530
 				//it's possible a datetime will have no tickets so let's verify we HAVE a ticket first.
531
-				if ( ! $orig_tkt instanceof EE_Ticket )
531
+				if ( ! $orig_tkt instanceof EE_Ticket)
532 532
 					continue;
533 533
 
534 534
 				//is this ticket archived?  If it is then let's skip
535
-				if ( $orig_tkt->get( 'TKT_deleted' ) ) {
535
+				if ($orig_tkt->get('TKT_deleted')) {
536 536
 					continue;
537 537
 				}
538 538
 
539 539
 				//does this original ticket already exist in the clone_tickets cache?  If so we'll just use the new ticket from it.
540
-				if ( isset( $cloned_tickets[$orig_tkt->ID()] ) ) {
540
+				if (isset($cloned_tickets[$orig_tkt->ID()])) {
541 541
 					$new_tkt = $cloned_tickets[$orig_tkt->ID()];
542 542
 				} else {
543 543
 					$new_tkt = clone $orig_tkt;
@@ -549,7 +549,7 @@  discard block
 block discarded – undo
549 549
 					$new_tkt->save(); //make sure new ticket has ID.
550 550
 
551 551
 					//price relations on new ticket need to be setup.
552
-					foreach ( $orig_prices as $orig_price ) {
552
+					foreach ($orig_prices as $orig_price) {
553 553
 						$new_price = clone $orig_price;
554 554
 						$new_price->set('PRC_ID', 0);
555 555
 						$new_price->save();
@@ -566,39 +566,39 @@  discard block
 block discarded – undo
566 566
 		}
567 567
 
568 568
 		//clone taxonomy information
569
-		$taxonomies_to_clone_with = apply_filters( 'FHEE__Extend_Events_Admin_Page___duplicate_event__taxonomies_to_clone', array( 'espresso_event_categories', 'espresso_event_type', 'post_tag' ) );
569
+		$taxonomies_to_clone_with = apply_filters('FHEE__Extend_Events_Admin_Page___duplicate_event__taxonomies_to_clone', array('espresso_event_categories', 'espresso_event_type', 'post_tag'));
570 570
 
571 571
 		//get terms for original event (notice)
572
-		$orig_terms = wp_get_object_terms( $orig_event->ID(), $taxonomies_to_clone_with );
572
+		$orig_terms = wp_get_object_terms($orig_event->ID(), $taxonomies_to_clone_with);
573 573
 
574 574
 		//loop through terms and add them to new event.
575
-		foreach ( $orig_terms as $term ) {
576
-			wp_set_object_terms( $new_event->ID(), $term->term_id, $term->taxonomy, true );
575
+		foreach ($orig_terms as $term) {
576
+			wp_set_object_terms($new_event->ID(), $term->term_id, $term->taxonomy, true);
577 577
 		}
578 578
 
579 579
 
580
-		do_action( 'AHEE__Extend_Events_Admin_Page___duplicate_event__after', $new_event, $orig_event );
580
+		do_action('AHEE__Extend_Events_Admin_Page___duplicate_event__after', $new_event, $orig_event);
581 581
 
582 582
 		//now let's redirect to the edit page for this duplicated event if we have a new event id.
583
-		if ( $new_event->ID() ) {
583
+		if ($new_event->ID()) {
584 584
 			$redirect_args = array(
585 585
 				'post' => $new_event->ID(),
586 586
 				'action' => 'edit'
587 587
 			);
588
-			EE_Error::add_success( __('Event successfully duplicated.  Please review the details below and make any necessary edits', 'event_espresso') );
588
+			EE_Error::add_success(__('Event successfully duplicated.  Please review the details below and make any necessary edits', 'event_espresso'));
589 589
 		} else {
590 590
 			$redirect_args = array(
591 591
 				'action' => 'default'
592 592
 				);
593
-			EE_Error::add_error( __('Not able to duplicate event.  Something went wrong.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__ );
593
+			EE_Error::add_error(__('Not able to duplicate event.  Something went wrong.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
594 594
 		}
595 595
 
596
-		$this->_redirect_after_action(FALSE, '', '', $redirect_args, TRUE );
596
+		$this->_redirect_after_action(FALSE, '', '', $redirect_args, TRUE);
597 597
 	}
598 598
 
599 599
 
600 600
 
601
-	protected function _import_page(){
601
+	protected function _import_page() {
602 602
 
603 603
 		$title = __('Import', 'event_espresso');
604 604
 		$intro = __('If you have a previously exported Event Espresso 4 information in a Comma Separated Value (CSV) file format, you can upload the file here: ', 'event_espresso');
@@ -606,8 +606,8 @@  discard block
 block discarded – undo
606 606
 		$action = 'import_events';
607 607
 		$type = 'csv';
608 608
 		$this->_template_args['form'] = EE_Import::instance()->upload_form($title, $intro, $form_url, $action, $type);
609
-		$this->_template_args['sample_file_link'] = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'sample_export_file'),$this->_admin_base_url);
610
-		$content = EEH_Template::display_template(EVENTS_CAF_TEMPLATE_PATH . 'import_page.template.php',$this->_template_args,true);
609
+		$this->_template_args['sample_file_link'] = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'sample_export_file'), $this->_admin_base_url);
610
+		$content = EEH_Template::display_template(EVENTS_CAF_TEMPLATE_PATH.'import_page.template.php', $this->_template_args, true);
611 611
 
612 612
 
613 613
 		$this->_template_args['admin_page_content'] = $content;
@@ -620,9 +620,9 @@  discard block
 block discarded – undo
620 620
 	 * @return string html
621 621
 	 */
622 622
 	protected function _import_events() {
623
-		require_once(EE_CLASSES . 'EE_Import.class.php');
623
+		require_once(EE_CLASSES.'EE_Import.class.php');
624 624
 		$success = EE_Import::instance()->import();
625
-		$this->_redirect_after_action($success, 'Import File', 'ran', array('action' => 'import_page'),true);
625
+		$this->_redirect_after_action($success, 'Import File', 'ran', array('action' => 'import_page'), true);
626 626
 
627 627
 	}
628 628
 
@@ -636,23 +636,23 @@  discard block
 block discarded – undo
636 636
 	 * @return file
637 637
 	 */
638 638
 	protected function _events_export() {
639
-		if(isset($this->_req_data['EVT_ID'])){
639
+		if (isset($this->_req_data['EVT_ID'])) {
640 640
 			$event_ids = $this->_req_data['EVT_ID'];
641
-		}elseif(isset($this->_req_data['EVT_IDs'])){
641
+		}elseif (isset($this->_req_data['EVT_IDs'])) {
642 642
 			$event_ids = $this->_req_data['EVT_IDs'];
643
-		}else{
643
+		} else {
644 644
 			$event_ids = NULL;
645 645
 		}
646 646
 		//todo: I don't like doing this but it'll do until we modify EE_Export Class.
647 647
 		$new_request_args = array(
648 648
 			'export' => 'report',
649 649
 			'action' => 'all_event_data',
650
-			'EVT_ID' => $event_ids ,
650
+			'EVT_ID' => $event_ids,
651 651
 		);
652 652
 		$this->_req_data = array_merge($this->_req_data, $new_request_args);
653 653
 
654
-		if ( is_readable(EE_CLASSES . 'EE_Export.class.php')) {
655
-			require_once(EE_CLASSES . 'EE_Export.class.php');
654
+		if (is_readable(EE_CLASSES.'EE_Export.class.php')) {
655
+			require_once(EE_CLASSES.'EE_Export.class.php');
656 656
 			$EE_Export = EE_Export::instance($this->_req_data);
657 657
 			$EE_Export->export();
658 658
 		}
@@ -674,11 +674,11 @@  discard block
 block discarded – undo
674 674
 			'category_ids' => $this->_req_data['EVT_CAT_ID']
675 675
 			);
676 676
 
677
-		$this->_req_data = array_merge( $this->_req_data, $new_request_args );
677
+		$this->_req_data = array_merge($this->_req_data, $new_request_args);
678 678
 
679
-		if ( is_readable( EE_CLASSES . 'EE_Export.class.php') ) {
680
-			require_once( EE_CLASSES . 'EE_Export.class.php');
681
-			$EE_Export = EE_Export::instance( $this->_req_data );
679
+		if (is_readable(EE_CLASSES.'EE_Export.class.php')) {
680
+			require_once(EE_CLASSES.'EE_Export.class.php');
681
+			$EE_Export = EE_Export::instance($this->_req_data);
682 682
 			$EE_Export->export();
683 683
 		}
684 684
 
@@ -689,7 +689,7 @@  discard block
 block discarded – undo
689 689
 	/**
690 690
 	 * Creates a sample CSV file for importing
691 691
 	 */
692
-	protected function _sample_export_file(){
692
+	protected function _sample_export_file() {
693 693
 //		require_once(EE_CLASSES . 'EE_Export.class.php');
694 694
 		EE_Export::instance()->export_sample();
695 695
 	}
@@ -706,10 +706,10 @@  discard block
 block discarded – undo
706 706
 		 * Note leaving this filter in for backward compatibility this was moved in 4.6.x
707 707
 		 * from General_Settings_Admin_Page to here.
708 708
 		 */
709
-		$this->_template_args = apply_filters( 'FHEE__General_Settings_Admin_Page__template_settings__template_args', $this->_template_args );
710
-		$this->_set_add_edit_form_tags( 'update_template_settings' );
711
-		$this->_set_publish_post_box_vars( NULL, FALSE, FALSE, NULL, FALSE );
712
-		$this->_template_args['admin_page_content'] = EEH_Template::display_template( EVENTS_CAF_TEMPLATE_PATH . 'template_settings.template.php', $this->_template_args, TRUE );
709
+		$this->_template_args = apply_filters('FHEE__General_Settings_Admin_Page__template_settings__template_args', $this->_template_args);
710
+		$this->_set_add_edit_form_tags('update_template_settings');
711
+		$this->_set_publish_post_box_vars(NULL, FALSE, FALSE, NULL, FALSE);
712
+		$this->_template_args['admin_page_content'] = EEH_Template::display_template(EVENTS_CAF_TEMPLATE_PATH.'template_settings.template.php', $this->_template_args, TRUE);
713 713
 		$this->display_admin_page_with_sidebar();
714 714
 	}
715 715
 
@@ -721,24 +721,24 @@  discard block
 block discarded – undo
721 721
 		 * Note leaving this filter in for backward compatibility this was moved in 4.6.x
722 722
 		 * from General_Settings_Admin_Page to here.
723 723
 		 */
724
-		EE_Registry::instance()->CFG->template_settings = apply_filters( 'FHEE__General_Settings_Admin_Page__update_template_settings__data', EE_Registry::instance()->CFG->template_settings, $this->_req_data );
724
+		EE_Registry::instance()->CFG->template_settings = apply_filters('FHEE__General_Settings_Admin_Page__update_template_settings__data', EE_Registry::instance()->CFG->template_settings, $this->_req_data);
725 725
 
726 726
 
727 727
 		//update custom post type slugs and detect if we need to flush rewrite rules
728 728
 		$old_slug = EE_Registry::instance()->CFG->core->event_cpt_slug;
729
-		EE_Registry::instance()->CFG->core->event_cpt_slug = empty( $this->_req_data['event_cpt_slug'] ) ? EE_Registry::instance()->CFG->core->event_cpt_slug : sanitize_title_with_dashes( $this->_req_data['event_cpt_slug'] );
729
+		EE_Registry::instance()->CFG->core->event_cpt_slug = empty($this->_req_data['event_cpt_slug']) ? EE_Registry::instance()->CFG->core->event_cpt_slug : sanitize_title_with_dashes($this->_req_data['event_cpt_slug']);
730 730
 
731 731
 
732 732
 		$what = 'Template Settings';
733
-		$success = $this->_update_espresso_configuration( $what, EE_Registry::instance()->CFG->template_settings, __FILE__, __FUNCTION__, __LINE__ );
733
+		$success = $this->_update_espresso_configuration($what, EE_Registry::instance()->CFG->template_settings, __FILE__, __FUNCTION__, __LINE__);
734 734
 
735 735
 
736
-		if ( EE_Registry::instance()->CFG->core->event_cpt_slug != $old_slug ) {
737
-			update_option( 'ee_flush_rewrite_rules', true );
736
+		if (EE_Registry::instance()->CFG->core->event_cpt_slug != $old_slug) {
737
+			update_option('ee_flush_rewrite_rules', true);
738 738
 		}
739 739
 
740 740
 
741
-		$this->_redirect_after_action( $success, $what, 'updated', array( 'action' => 'template_settings' ) );
741
+		$this->_redirect_after_action($success, $what, 'updated', array('action' => 'template_settings'));
742 742
 
743 743
 	}
744 744
 
@@ -756,7 +756,7 @@  discard block
 block discarded – undo
756 756
 
757 757
 		$this->verify_cpt_object();
758 758
 
759
-		add_meta_box('espresso_event_editor_event_options', __('Event Registration Options', 'event_espresso'), array( $this, 'registration_options_meta_box' ), $this->page_slug, 'side', 'core');
759
+		add_meta_box('espresso_event_editor_event_options', __('Event Registration Options', 'event_espresso'), array($this, 'registration_options_meta_box'), $this->page_slug, 'side', 'core');
760 760
 		//add_meta_box('espresso_event_types', __('Event Type', 'event_espresso'), array( $this, 'event_type_meta_box' ), $this->page_slug, 'side', 'default' ); //add this back in when the feature is ready.
761 761
 
762 762
 		//todo feature in progress
@@ -780,16 +780,16 @@  discard block
 block discarded – undo
780 780
 			array('id' => true, 'text' => __('Yes', 'event_espresso')),
781 781
 			array('id' => false, 'text' => __('No', 'event_espresso'))
782 782
 		);
783
-		$default_reg_status_values = EEM_Registration::reg_status_array(array(EEM_Registration::status_id_cancelled, EEM_Registration::status_id_declined, EEM_Registration::status_id_incomplete ), TRUE);
783
+		$default_reg_status_values = EEM_Registration::reg_status_array(array(EEM_Registration::status_id_cancelled, EEM_Registration::status_id_declined, EEM_Registration::status_id_incomplete), TRUE);
784 784
 		$template_args['active_status'] = $this->_cpt_model_obj->pretty_active_status(FALSE);
785 785
 		$template_args['_event'] = $this->_cpt_model_obj;
786 786
 		$template_args['additional_limit'] = $this->_cpt_model_obj->additional_limit();
787 787
 		$template_args['default_registration_status'] = EEH_Form_Fields::select_input('default_reg_status', $default_reg_status_values, $this->_cpt_model_obj->default_registration_status());
788 788
 		$template_args['display_description'] = EEH_Form_Fields::select_input('display_desc', $yes_no_values, $this->_cpt_model_obj->display_description());
789 789
 		$template_args['display_ticket_selector'] = EEH_Form_Fields::select_input('display_ticket_selector', $yes_no_values, $this->_cpt_model_obj->display_ticket_selector(), '', '', false);
790
-		$template_args['EVT_default_registration_status'] = EEH_Form_Fields::select_input('EVT_default_registration_status', $default_reg_status_values, $this->_cpt_model_obj->default_registration_status() );
791
-		$template_args['additional_registration_options'] = apply_filters( 'FHEE__Events_Admin_Page__registration_options_meta_box__additional_registration_options', '', $template_args, $yes_no_values, $default_reg_status_values );
792
-		$templatepath = EVENTS_CAF_TEMPLATE_PATH . 'event_registration_options.template.php';
790
+		$template_args['EVT_default_registration_status'] = EEH_Form_Fields::select_input('EVT_default_registration_status', $default_reg_status_values, $this->_cpt_model_obj->default_registration_status());
791
+		$template_args['additional_registration_options'] = apply_filters('FHEE__Events_Admin_Page__registration_options_meta_box__additional_registration_options', '', $template_args, $yes_no_values, $default_reg_status_values);
792
+		$templatepath = EVENTS_CAF_TEMPLATE_PATH.'event_registration_options.template.php';
793 793
 		EEH_Template::display_template($templatepath, $template_args);
794 794
 	}
795 795
 
@@ -802,9 +802,9 @@  discard block
 block discarded – undo
802 802
 	 * @param  array  $box  metabox args
803 803
 	 * @return string       metabox contents
804 804
 	 */
805
-	public function event_type_meta_box( $post, $box ) {
806
-		$template_args['radio_list'] = $this->wp_terms_radio($post->ID, array( 'taxonomy' => 'espresso_event_type' ) );
807
-		$template = EVENTS_CAF_TEMPLATE_PATH . 'event_type_metabox_contents.template.php';
805
+	public function event_type_meta_box($post, $box) {
806
+		$template_args['radio_list'] = $this->wp_terms_radio($post->ID, array('taxonomy' => 'espresso_event_type'));
807
+		$template = EVENTS_CAF_TEMPLATE_PATH.'event_type_metabox_contents.template.php';
808 808
 		EEH_Template::display_template($template, $template_args);
809 809
 	}
810 810
 
@@ -814,7 +814,7 @@  discard block
 block discarded – undo
814 814
 
815 815
 
816 816
 
817
-	public function wp_terms_radio( $post_id = 0, $args = array() ) {
817
+	public function wp_terms_radio($post_id = 0, $args = array()) {
818 818
 		$defaults = array(
819 819
 			'descendants_and_self' => 0,
820 820
 			'selected_cats' => false,
@@ -823,11 +823,11 @@  discard block
 block discarded – undo
823 823
 			'taxonomy' => 'category',
824 824
 			'checked_ontop' => true
825 825
 		);
826
-		$args = apply_filters( 'wp_terms_checklist_args', $args, $post_id );
826
+		$args = apply_filters('wp_terms_checklist_args', $args, $post_id);
827 827
 
828
-		extract( wp_parse_args($args, $defaults), EXTR_SKIP );
828
+		extract(wp_parse_args($args, $defaults), EXTR_SKIP);
829 829
 
830
-		if ( empty($walker) || !is_a($walker, 'Walker') )
830
+		if (empty($walker) || ! is_a($walker, 'Walker'))
831 831
 			$walker = new Walker_Radio_Checklist;
832 832
 
833 833
 		$descendants_and_self = (int) $descendants_and_self;
@@ -835,37 +835,37 @@  discard block
 block discarded – undo
835 835
 		$args = array('taxonomy' => $taxonomy);
836 836
 
837 837
 		$tax = get_taxonomy($taxonomy);
838
-		$args['disabled'] = !current_user_can($tax->cap->assign_terms);
838
+		$args['disabled'] = ! current_user_can($tax->cap->assign_terms);
839 839
 
840
-		if ( is_array( $selected_cats ) )
840
+		if (is_array($selected_cats))
841 841
 			$args['selected_cats'] = $selected_cats;
842
-		elseif ( $post_id )
842
+		elseif ($post_id)
843 843
 			$args['selected_cats'] = wp_get_object_terms($post_id, $taxonomy, array_merge($args, array('fields' => 'ids')));
844 844
 		else
845 845
 			$args['selected_cats'] = array();
846 846
 
847
-		if ( is_array( $popular_cats ) )
847
+		if (is_array($popular_cats))
848 848
 			$args['popular_cats'] = $popular_cats;
849 849
 		else
850
-			$args['popular_cats'] = get_terms( $taxonomy, array( 'fields' => 'ids', 'orderby' => 'count', 'order' => 'DESC', 'number' => 10, 'hierarchical' => false ) );
850
+			$args['popular_cats'] = get_terms($taxonomy, array('fields' => 'ids', 'orderby' => 'count', 'order' => 'DESC', 'number' => 10, 'hierarchical' => false));
851 851
 
852
-		if ( $descendants_and_self ) {
853
-			$categories = (array) get_terms($taxonomy, array( 'child_of' => $descendants_and_self, 'hierarchical' => 0, 'hide_empty' => 0 ) );
854
-			$self = get_term( $descendants_and_self, $taxonomy );
855
-			array_unshift( $categories, $self );
852
+		if ($descendants_and_self) {
853
+			$categories = (array) get_terms($taxonomy, array('child_of' => $descendants_and_self, 'hierarchical' => 0, 'hide_empty' => 0));
854
+			$self = get_term($descendants_and_self, $taxonomy);
855
+			array_unshift($categories, $self);
856 856
 		} else {
857 857
 			$categories = (array) get_terms($taxonomy, array('get' => 'all'));
858 858
 		}
859 859
 
860
-		if ( $checked_ontop ) {
860
+		if ($checked_ontop) {
861 861
 			// Post process $categories rather than adding an exclude to the get_terms() query to keep the query the same across all posts (for any query cache)
862 862
 			$checked_categories = array();
863
-			$keys = array_keys( $categories );
863
+			$keys = array_keys($categories);
864 864
 
865
-			foreach( $keys as $k ) {
866
-				if ( in_array( $categories[$k]->term_id, $args['selected_cats'] ) ) {
865
+			foreach ($keys as $k) {
866
+				if (in_array($categories[$k]->term_id, $args['selected_cats'])) {
867 867
 					$checked_categories[] = $categories[$k];
868
-					unset( $categories[$k] );
868
+					unset($categories[$k]);
869 869
 				}
870 870
 			}
871 871
 
@@ -890,18 +890,18 @@  discard block
 block discarded – undo
890 890
 	 * @param  array  $list_table_obj the list table object
891 891
 	 * @return array                  new filters
892 892
 	 */
893
-	public function list_table_filters( $oldfilters, $list_table_obj ) {
893
+	public function list_table_filters($oldfilters, $list_table_obj) {
894 894
 		$filters = array();
895 895
 
896 896
 		//first month/year filters
897 897
 		$filters[] = $this->espresso_event_months_dropdown();
898 898
 
899 899
 
900
-		$status = isset( $this->_req_data['status'] ) ? $this->_req_data['status'] : NULL;
900
+		$status = isset($this->_req_data['status']) ? $this->_req_data['status'] : NULL;
901 901
 
902 902
 		//active status dropdown
903
-		if ( $status !== 'draft' )
904
-			$filter[] = $this->active_status_dropdown( isset( $this->_req_data['active_status'] ) ? $this->_req_data['active_status'] : '' );
903
+		if ($status !== 'draft')
904
+			$filter[] = $this->active_status_dropdown(isset($this->_req_data['active_status']) ? $this->_req_data['active_status'] : '');
905 905
 
906 906
 		//category filter
907 907
 		$filters[] = $this->category_dropdown();
@@ -923,17 +923,17 @@  discard block
 block discarded – undo
923 923
 	 */
924 924
 	public function espresso_event_months_dropdown() {
925 925
 		//what we need to do is get all PRIMARY datetimes for all events to filter on. Note we need to include any other filters that are set!
926
-		$status = isset( $this->_req_data['status'] ) ? $this->_req_data['status'] : NULL;
926
+		$status = isset($this->_req_data['status']) ? $this->_req_data['status'] : NULL;
927 927
 
928 928
 		//categories?
929
-		$category = isset( $this->_req_data['EVT_CAT'] ) && $this->_req_data['EVT_CAT'] > 0 ? $this->_req_data['EVT_CAT'] : NULL;
929
+		$category = isset($this->_req_data['EVT_CAT']) && $this->_req_data['EVT_CAT'] > 0 ? $this->_req_data['EVT_CAT'] : NULL;
930 930
 
931 931
 		//active status?
932
-		$active_status = isset( $this->_req_data['active_status'] ) ? $this->_req_data['active_status'] : NULL;
932
+		$active_status = isset($this->_req_data['active_status']) ? $this->_req_data['active_status'] : NULL;
933 933
 
934 934
 		$cur_date = isset($this->_req_data['month_range']) ? $this->_req_data['month_range'] : '';
935 935
 
936
-		return EEH_Form_Fields::generate_event_months_dropdown( $cur_date, $status, $category, $active_status );
936
+		return EEH_Form_Fields::generate_event_months_dropdown($cur_date, $status, $category, $active_status);
937 937
 	}
938 938
 
939 939
 
@@ -944,12 +944,12 @@  discard block
 block discarded – undo
944 944
 	 * @param  string $current_value whatever the ucrrent active status is
945 945
 	 * @return string                html dropdown.
946 946
 	 */
947
-	public function  active_status_dropdown( $current_value = '' ) {
947
+	public function  active_status_dropdown($current_value = '') {
948 948
 		$select_name = 'active_status';
949
-		$values = array('none' => __('Show Active/Inactive', 'event_espresso'), 'active' => __('Active', 'event_espresso'), 'upcoming' => __('Upcoming', 'event_espresso'), 'expired' => __('Expired', 'event_espresso'), 'inactive' => __('Inactive', 'event_espresso') );
949
+		$values = array('none' => __('Show Active/Inactive', 'event_espresso'), 'active' => __('Active', 'event_espresso'), 'upcoming' => __('Upcoming', 'event_espresso'), 'expired' => __('Expired', 'event_espresso'), 'inactive' => __('Inactive', 'event_espresso'));
950 950
 		$id = 'id="espresso-active-status-dropdown-filter"';
951 951
 		$class = 'wide';
952
-		echo EEH_Form_Fields::select_input( $select_name, $values, $current_value, $id, $class );
952
+		echo EEH_Form_Fields::select_input($select_name, $values, $current_value, $id, $class);
953 953
 	}
954 954
 
955 955
 
@@ -961,9 +961,9 @@  discard block
 block discarded – undo
961 961
 	 * @return string html
962 962
 	 */
963 963
 	public function category_dropdown() {
964
-		$cur_cat = isset( $this->_req_data['EVT_CAT'] ) ? $this->_req_data['EVT_CAT'] : -1;
964
+		$cur_cat = isset($this->_req_data['EVT_CAT']) ? $this->_req_data['EVT_CAT'] : -1;
965 965
 
966
-		return EEH_Form_Fields::generate_event_category_dropdown( $cur_cat );
966
+		return EEH_Form_Fields::generate_event_category_dropdown($cur_cat);
967 967
 	}
968 968
 
969 969
 
@@ -975,14 +975,14 @@  discard block
 block discarded – undo
975 975
 	 * @return int
976 976
 	 */
977 977
 	public function total_events_today() {
978
-		$start = EEM_Datetime::instance()->convert_datetime_for_query( 'DTT_EVT_start', date('Y-m-d' ) . ' 00:00:00', 'Y-m-d H:i:s', 'UTC' );
979
-		$end = EEM_Datetime::instance()->convert_datetime_for_query( 'DTT_EVT_start', date('Y-m-d' ) . ' 23:59:59', 'Y-m-d H:i:s', 'UTC' );
978
+		$start = EEM_Datetime::instance()->convert_datetime_for_query('DTT_EVT_start', date('Y-m-d').' 00:00:00', 'Y-m-d H:i:s', 'UTC');
979
+		$end = EEM_Datetime::instance()->convert_datetime_for_query('DTT_EVT_start', date('Y-m-d').' 23:59:59', 'Y-m-d H:i:s', 'UTC');
980 980
 
981 981
 		$where = array(
982
-			'Datetime.DTT_EVT_start' => array( 'BETWEEN', array($start, $end ) )
982
+			'Datetime.DTT_EVT_start' => array('BETWEEN', array($start, $end))
983 983
 			);
984 984
 
985
-		$count = EEM_Event::instance()->count( array( $where, 'caps' => 'read_admin' ), 'EVT_ID', true );
985
+		$count = EEM_Event::instance()->count(array($where, 'caps' => 'read_admin'), 'EVT_ID', true);
986 986
 		return $count;
987 987
 	}
988 988
 
@@ -997,14 +997,14 @@  discard block
 block discarded – undo
997 997
 		$this_year_r = date('Y');
998 998
 		$this_month_r = date('m');
999 999
 		$days_this_month = date('t');
1000
-		$start = EEM_Datetime::instance()->convert_datetime_for_query( 'DTT_EVT_start', $this_year_r . '-' . $this_month_r . '-01 00:00:00', 'Y-m-d H:i:s', 'UTC' );
1001
-		$end = EEM_Datetime::instance()->convert_datetime_for_query( 'DTT_EVT_start', $this_year_r . '-' . $this_month_r . '-' . $days_this_month . ' 23:59:59', 'Y-m-d H:i:s', 'UTC' );
1000
+		$start = EEM_Datetime::instance()->convert_datetime_for_query('DTT_EVT_start', $this_year_r.'-'.$this_month_r.'-01 00:00:00', 'Y-m-d H:i:s', 'UTC');
1001
+		$end = EEM_Datetime::instance()->convert_datetime_for_query('DTT_EVT_start', $this_year_r.'-'.$this_month_r.'-'.$days_this_month.' 23:59:59', 'Y-m-d H:i:s', 'UTC');
1002 1002
 
1003 1003
 		$where = array(
1004
-			'Datetime.DTT_EVT_start' => array( 'BETWEEN', array($start, $end ) )
1004
+			'Datetime.DTT_EVT_start' => array('BETWEEN', array($start, $end))
1005 1005
 			);
1006 1006
 
1007
-		$count = EEM_Event::instance()->count( array( $where, 'caps' => 'read_admin' ), 'EVT_ID', true );
1007
+		$count = EEM_Event::instance()->count(array($where, 'caps' => 'read_admin'), 'EVT_ID', true);
1008 1008
 		return $count;
1009 1009
 	}
1010 1010
 
@@ -1021,53 +1021,53 @@  discard block
 block discarded – undo
1021 1021
 
1022 1022
 
1023 1023
 
1024
-	public function get_default_tickets( $per_page = 10, $count = FALSE, $trashed = FALSE ) {
1024
+	public function get_default_tickets($per_page = 10, $count = FALSE, $trashed = FALSE) {
1025 1025
 
1026
-		$orderby= empty( $this->_req_data['orderby'] ) ? 'TKT_name' : $this->_req_data['orderby'];
1027
-		$order = empty( $this->_req_data['order'] ) ? 'ASC' : $this->_req_data['order'];
1026
+		$orderby = empty($this->_req_data['orderby']) ? 'TKT_name' : $this->_req_data['orderby'];
1027
+		$order = empty($this->_req_data['order']) ? 'ASC' : $this->_req_data['order'];
1028 1028
 
1029
-		switch ( $orderby ) {
1029
+		switch ($orderby) {
1030 1030
 			case 'TKT_name' :
1031
-				$orderby = array( 'TKT_name' => $order );
1031
+				$orderby = array('TKT_name' => $order);
1032 1032
 				break;
1033 1033
 
1034 1034
 			case 'TKT_price' :
1035
-				$orderby = array( 'TKT_price' => $order );
1035
+				$orderby = array('TKT_price' => $order);
1036 1036
 				break;
1037 1037
 
1038 1038
 			case 'TKT_uses' :
1039
-				$orderby = array( 'TKT_uses' => $order );
1039
+				$orderby = array('TKT_uses' => $order);
1040 1040
 				break;
1041 1041
 
1042 1042
 			case 'TKT_min' :
1043
-				$orderby = array( 'TKT_min' => $order );
1043
+				$orderby = array('TKT_min' => $order);
1044 1044
 				break;
1045 1045
 
1046 1046
 			case 'TKT_max' :
1047
-				$orderby = array( 'TKT_max' => $order );
1047
+				$orderby = array('TKT_max' => $order);
1048 1048
 				break;
1049 1049
 
1050 1050
 			case 'TKT_qty' :
1051
-				$orderby = array( 'TKT_qty' => $order );
1051
+				$orderby = array('TKT_qty' => $order);
1052 1052
 				break;
1053 1053
 		}
1054 1054
 
1055
-		$current_page = isset( $this->_req_data['paged'] ) && !empty( $this->_req_data['paged'] ) ? $this->_req_data['paged'] : 1;
1056
-		$per_page = isset( $this->_req_data['perpage'] ) && !empty( $this->_req_data['perpage'] ) ? $this->_req_data['perpage'] : $per_page;
1055
+		$current_page = isset($this->_req_data['paged']) && ! empty($this->_req_data['paged']) ? $this->_req_data['paged'] : 1;
1056
+		$per_page = isset($this->_req_data['perpage']) && ! empty($this->_req_data['perpage']) ? $this->_req_data['perpage'] : $per_page;
1057 1057
 
1058 1058
 		$_where = array(
1059 1059
 			'TKT_is_default' => 1,
1060 1060
 			'TKT_deleted' => $trashed
1061 1061
 			);
1062 1062
 
1063
-		$offset = ($current_page-1)*$per_page;
1064
-		$limit = array( $offset, $per_page );
1063
+		$offset = ($current_page - 1) * $per_page;
1064
+		$limit = array($offset, $per_page);
1065 1065
 
1066
-		if ( isset( $this->_req_data['s'] ) ) {
1067
-			$sstr = '%' . $this->_req_data['s'] . '%';
1066
+		if (isset($this->_req_data['s'])) {
1067
+			$sstr = '%'.$this->_req_data['s'].'%';
1068 1068
 			$_where['OR'] = array(
1069
-				'TKT_name' => array('LIKE',$sstr ),
1070
-				'TKT_description' => array('LIKE',$sstr )
1069
+				'TKT_name' => array('LIKE', $sstr),
1070
+				'TKT_description' => array('LIKE', $sstr)
1071 1071
 				);
1072 1072
 		}
1073 1073
 
@@ -1078,9 +1078,9 @@  discard block
 block discarded – undo
1078 1078
 			'group_by'=>'TKT_ID'
1079 1079
 			);
1080 1080
 
1081
-		if($count){
1081
+		if ($count) {
1082 1082
 			return EEM_Ticket::instance()->count_deleted_and_undeleted(array($_where));
1083
-		}else{
1083
+		} else {
1084 1084
 			return EEM_Ticket::instance()->get_all_deleted_and_undeleted($query_params);
1085 1085
 		}
1086 1086
 
@@ -1090,35 +1090,35 @@  discard block
 block discarded – undo
1090 1090
 
1091 1091
 
1092 1092
 
1093
-	protected function _trash_or_restore_ticket(  $trash = FALSE ) {
1093
+	protected function _trash_or_restore_ticket($trash = FALSE) {
1094 1094
 		$success = 1;
1095 1095
 
1096 1096
 		$TKT = EEM_Ticket::instance();
1097 1097
 
1098 1098
 		//checkboxes?
1099
-		if ( !empty( $this->_req_data['checkbox'] ) && is_array( $this->_req_data['checkbox'] ) ) {
1099
+		if ( ! empty($this->_req_data['checkbox']) && is_array($this->_req_data['checkbox'])) {
1100 1100
 			//if array has more than one element then success message should be plural
1101
-			$success = count( $this->_req_data['checkbox'] ) > 1 ? 2 : 1;
1101
+			$success = count($this->_req_data['checkbox']) > 1 ? 2 : 1;
1102 1102
 
1103 1103
 			//cycle thru the boxes
1104
-			while ( list( $TKT_ID, $value ) = each( $this->_req_data['checkbox'] ) ) {
1105
-				if ( $trash ) {
1106
-					if ( ! $TKT->delete_by_ID( $TKT_ID ) )
1104
+			while (list($TKT_ID, $value) = each($this->_req_data['checkbox'])) {
1105
+				if ($trash) {
1106
+					if ( ! $TKT->delete_by_ID($TKT_ID))
1107 1107
 						$success = 0;
1108 1108
 				} else {
1109
-					if ( ! $TKT->restore_by_ID( $TKT_ID ) )
1109
+					if ( ! $TKT->restore_by_ID($TKT_ID))
1110 1110
 						$success = 0;
1111 1111
 				}
1112 1112
 			}
1113 1113
 		} else {
1114 1114
 			//grab single id and trash
1115
-			$TKT_ID = absint( $this->_req_data['TKT_ID'] );
1115
+			$TKT_ID = absint($this->_req_data['TKT_ID']);
1116 1116
 
1117
-			if ( $trash ) {
1118
-				if ( ! $TKT->delete_by_ID( $TKT_ID ) )
1117
+			if ($trash) {
1118
+				if ( ! $TKT->delete_by_ID($TKT_ID))
1119 1119
 					$success = 0;
1120 1120
 			} else {
1121
-				if ( ! $TKT->restore_by_ID( $TKT_ID ) )
1121
+				if ( ! $TKT->restore_by_ID($TKT_ID))
1122 1122
 					$success = 0;
1123 1123
 			}
1124 1124
 		}
@@ -1128,7 +1128,7 @@  discard block
 block discarded – undo
1128 1128
 			'action' => 'ticket_list_table',
1129 1129
 			'status' => $trash ? '' : 'trashed'
1130 1130
 			);
1131
-		$this->_redirect_after_action( $success, 'Tickets', $action_desc, $query_args );
1131
+		$this->_redirect_after_action($success, 'Tickets', $action_desc, $query_args);
1132 1132
 	}
1133 1133
 
1134 1134
 
@@ -1141,21 +1141,21 @@  discard block
 block discarded – undo
1141 1141
 		$TKT = EEM_Ticket::instance();
1142 1142
 
1143 1143
 		//checkboxes?
1144
-		if ( !empty( $this->_req_data['checkbox'] ) && is_array( $this->_req_data['checkbox'] ) ) {
1144
+		if ( ! empty($this->_req_data['checkbox']) && is_array($this->_req_data['checkbox'])) {
1145 1145
 			//if array has more than one element then success message should be plural
1146
-			$success = count( $this->_req_data['checkbox'] ) > 1 ? 2 : 1;
1146
+			$success = count($this->_req_data['checkbox']) > 1 ? 2 : 1;
1147 1147
 
1148 1148
 			//cycle thru the boxes
1149
-			while ( list( $TKT_ID, $value ) = each( $this->_req_data['checkbox'] ) ) {
1149
+			while (list($TKT_ID, $value) = each($this->_req_data['checkbox'])) {
1150 1150
 				//delete
1151
-				if ( ! $this->_delete_the_ticket( $TKT_ID ) ) {
1151
+				if ( ! $this->_delete_the_ticket($TKT_ID)) {
1152 1152
 					$success = 0;
1153 1153
 				}
1154 1154
 			}
1155 1155
 		} else {
1156 1156
 			//grab single id and trash
1157
-			$TKT_ID = absint( $this->_req_data['TKT_ID'] );
1158
-			if ( ! $this->_delete_the_ticket( $TKT_ID ) ) {
1157
+			$TKT_ID = absint($this->_req_data['TKT_ID']);
1158
+			if ( ! $this->_delete_the_ticket($TKT_ID)) {
1159 1159
 					$success = 0;
1160 1160
 				}
1161 1161
 		}
@@ -1167,16 +1167,16 @@  discard block
 block discarded – undo
1167 1167
 			);
1168 1168
 
1169 1169
 		//failsafe.  If the default ticket count === 1 then we need to redirect to event overview.
1170
-		if ( EEM_Ticket::instance()->count_deleted_and_undeleted( array( array( 'TKT_is_default' => 1 ) ), 'TKT_ID', TRUE ) )
1170
+		if (EEM_Ticket::instance()->count_deleted_and_undeleted(array(array('TKT_is_default' => 1)), 'TKT_ID', TRUE))
1171 1171
 			$query_args = array();
1172
-		$this->_redirect_after_action( $success, 'Tickets', $action_desc, $query_args );
1172
+		$this->_redirect_after_action($success, 'Tickets', $action_desc, $query_args);
1173 1173
 	}
1174 1174
 
1175 1175
 
1176 1176
 
1177 1177
 
1178
-	protected function _delete_the_ticket( $TKT_ID ) {
1179
-		$tkt = EEM_Ticket::instance()->get_one_by_ID( $TKT_ID );
1178
+	protected function _delete_the_ticket($TKT_ID) {
1179
+		$tkt = EEM_Ticket::instance()->get_one_by_ID($TKT_ID);
1180 1180
 		$tkt->_remove_relations('Datetime');
1181 1181
 		//delete all related prices first
1182 1182
 		$tkt->delete_related_permanently('Price');
Please login to merge, or discard this patch.
modules/ical/EED_Ical.module.php 3 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -220,8 +220,8 @@
 block discarded – undo
220 220
 			//Escape spcial chars within the decription
221 221
 			$description = EED_Ical::_escape_ICal_data( $description );
222 222
 
223
-		    //Remove line breaks and output in iCal format
224
-		    $description = str_replace( array( "\r\n", "\n"), '\n', $description );
223
+			//Remove line breaks and output in iCal format
224
+			$description = str_replace( array( "\r\n", "\n"), '\n', $description );
225 225
 
226 226
 		return $description;
227 227
 	}
Please login to merge, or discard this patch.
Spacing   +69 added lines, -69 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
 	 * @return EED_Ical
33 33
 	 */
34 34
 	public static function instance() {
35
-		return parent::get_instance( __CLASS__ );
35
+		return parent::get_instance(__CLASS__);
36 36
 	}
37 37
 
38 38
 
@@ -45,9 +45,9 @@  discard block
 block discarded – undo
45 45
 	 */
46 46
 	public static function set_hooks() {
47 47
 		// create download buttons
48
-		add_filter( 'FHEE__espresso_list_of_event_dates__datetime_html', array( 'EED_Ical', 'generate_add_to_iCal_button' ), 10, 2 );
48
+		add_filter('FHEE__espresso_list_of_event_dates__datetime_html', array('EED_Ical', 'generate_add_to_iCal_button'), 10, 2);
49 49
 		 // process ics download request
50
-		EE_Config::register_route( 'download_ics_file', 'EED_Ical', 'download_ics_file' );
50
+		EE_Config::register_route('download_ics_file', 'EED_Ical', 'download_ics_file');
51 51
 	}
52 52
 
53 53
 
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
 	 * @param    WP $WP
71 71
 	 * @return    void
72 72
 	 */
73
-	public function run( $WP ) {}
73
+	public function run($WP) {}
74 74
 
75 75
 
76 76
 
@@ -82,30 +82,30 @@  discard block
 block discarded – undo
82 82
 	 * @param $datetime
83 83
 	 * @return    string
84 84
 	 */
85
-	public static function generate_add_to_iCal_button( $html, $datetime ) {
85
+	public static function generate_add_to_iCal_button($html, $datetime) {
86 86
 		// first verify a proper datetime object has been received
87
-		if ( $datetime instanceof EE_Datetime ) {
87
+		if ($datetime instanceof EE_Datetime) {
88 88
 			// set whether a link or submit button is shown
89
-			$iCal_type = apply_filters( 'FHEE__EED_Ical__generate_add_to_iCal_button__iCal_type', 'submit' );
89
+			$iCal_type = apply_filters('FHEE__EED_Ical__generate_add_to_iCal_button__iCal_type', 'submit');
90 90
 			// generate a link to the route we registered in set_hooks()
91
-			$URL = add_query_arg( array( 'ee' => 'download_ics_file', 'ics_id' => $datetime->ID() ), site_url() );
91
+			$URL = add_query_arg(array('ee' => 'download_ics_file', 'ics_id' => $datetime->ID()), site_url());
92 92
 			// what type ?
93
-			switch ( $iCal_type ) {
93
+			switch ($iCal_type) {
94 94
 				// submit buttons appear as buttons and are very compatible with a theme's style
95 95
 				case 'submit' :
96
-					$html .= '<form id="download-iCal-frm-' . $datetime->ID() . '" class="download-iCal-frm" action="' . $URL . '" method="post" >';
97
-					$html .= '<input type="submit" class="ee-ical-sbmt" value="&#xf145;" title="' . __( 'Add to iCal Calendar', 'event_espresso' ) . '"/>';
96
+					$html .= '<form id="download-iCal-frm-'.$datetime->ID().'" class="download-iCal-frm" action="'.$URL.'" method="post" >';
97
+					$html .= '<input type="submit" class="ee-ical-sbmt" value="&#xf145;" title="'.__('Add to iCal Calendar', 'event_espresso').'"/>';
98 98
 					$html .= '</form>';
99 99
 					break;
100 100
 				// buttons are just links that have been styled to appear as buttons, but may not be blend with a theme as well as submit buttons
101 101
 				case 'button' :
102
-					$html .= '<a class="ee-ical-btn small ee-button ee-roundish" href="' . $URL . '" title="' . __( 'Add to iCal Calendar', 'event_espresso' ) . '">';
102
+					$html .= '<a class="ee-ical-btn small ee-button ee-roundish" href="'.$URL.'" title="'.__('Add to iCal Calendar', 'event_espresso').'">';
103 103
 					$html .= ' <span class="dashicons dashicons-calendar"></span>';
104 104
 					$html .= '</a>';
105 105
 					break;
106 106
 				// links are just links that use the calendar dashicon
107 107
 				case 'icon' :
108
-					$html .= '<a class="ee-ical-lnk" href="' . $URL . '" title="' . __( 'Add to iCal Calendar', 'event_espresso' ) . '">';
108
+					$html .= '<a class="ee-ical-lnk" href="'.$URL.'" title="'.__('Add to iCal Calendar', 'event_espresso').'">';
109 109
 					$html .= ' <span class="dashicons dashicons-calendar"></span>';
110 110
 					$html .= '</a>';
111 111
 					break;
@@ -123,72 +123,72 @@  discard block
 block discarded – undo
123 123
 	 *  @return 	void
124 124
 	 */
125 125
 	public static function download_ics_file() {
126
-		if ( EE_Registry::instance()->REQ->is_set( 'ics_id' )) {
127
-			$DTT_ID = absint( EE_Registry::instance()->REQ->get( 'ics_id' ));
128
-			$datetime = EE_Registry::instance()->load_model( 'Datetime' )->get_one_by_ID( $DTT_ID );
129
-			if ( $datetime instanceof EE_Datetime ) {
126
+		if (EE_Registry::instance()->REQ->is_set('ics_id')) {
127
+			$DTT_ID = absint(EE_Registry::instance()->REQ->get('ics_id'));
128
+			$datetime = EE_Registry::instance()->load_model('Datetime')->get_one_by_ID($DTT_ID);
129
+			if ($datetime instanceof EE_Datetime) {
130 130
 				// get related event, venues, and event categories
131 131
 				$event = $datetime->event();
132 132
 				// get related category Term object and it's name
133 133
 				$category = $event->first_event_category();
134
-				if ( $category instanceof EE_Term ) {
134
+				if ($category instanceof EE_Term) {
135 135
 					$category = $category->name();
136 136
 				}
137 137
 				$location = '';
138 138
 				// get first related venue and convert to CSV string
139
-				$venue = $event->venues(array( 'limit'=>1 ));
140
-				if ( is_array( $venue ) && ! empty( $venue )) {
141
-					$venue = array_shift( $venue );
142
-					if ( $venue instanceof EE_Venue ) {
143
-						$location = espresso_venue_raw_address( 'inline', $venue->ID(), FALSE );
139
+				$venue = $event->venues(array('limit'=>1));
140
+				if (is_array($venue) && ! empty($venue)) {
141
+					$venue = array_shift($venue);
142
+					if ($venue instanceof EE_Venue) {
143
+						$location = espresso_venue_raw_address('inline', $venue->ID(), FALSE);
144 144
 					}
145 145
 				}
146 146
 				// set variables, escape strings, convert timestamps to ics format, etc
147
-				$filename = $event->slug() . '-' . $datetime->start_date( 'Y-m-d' ) . '.ics';
148
-				$organizer = EED_Ical::_escape_ICal_data( EE_Registry::instance()->CFG->organization->name );
149
-				$UID = EED_Ical::_escape_ICal_data( md5( $event->name() . $event->ID() . $datetime->ID() ));
150
-				$org_email = EED_Ical::_escape_ICal_data( $datetime->ID() );
151
-				$timestamp = date( EED_Ical::iCal_datetime_format );
152
-				$location = EED_Ical::_escape_ICal_data( $location );
153
-				$summary = EED_Ical::_escape_ICal_data( $event->name() );
154
-				$description = EED_Ical::_escape_ICal_description( wp_strip_all_tags( $event->description() ));
147
+				$filename = $event->slug().'-'.$datetime->start_date('Y-m-d').'.ics';
148
+				$organizer = EED_Ical::_escape_ICal_data(EE_Registry::instance()->CFG->organization->name);
149
+				$UID = EED_Ical::_escape_ICal_data(md5($event->name().$event->ID().$datetime->ID()));
150
+				$org_email = EED_Ical::_escape_ICal_data($datetime->ID());
151
+				$timestamp = date(EED_Ical::iCal_datetime_format);
152
+				$location = EED_Ical::_escape_ICal_data($location);
153
+				$summary = EED_Ical::_escape_ICal_data($event->name());
154
+				$description = EED_Ical::_escape_ICal_description(wp_strip_all_tags($event->description()));
155 155
 				$status = $datetime->get_active_status();
156 156
 				$status = $status == EE_Datetime::cancelled ? 'Cancelled' : 'Confirmed';
157
-				$status = EED_Ical::_escape_ICal_data( $status );
158
-				$categories = EED_Ical::_escape_ICal_data( $category );
159
-				$url = EED_Ical::_escape_ICal_data( get_permalink( $event->ID() ));
160
-				$dtt_start = EED_Ical::_escape_ICal_data( date( EED_Ical::iCal_datetime_format, $datetime->start() ));
161
-				$dtt_end = EED_Ical::_escape_ICal_data( date( EED_Ical::iCal_datetime_format, $datetime->end() ));
157
+				$status = EED_Ical::_escape_ICal_data($status);
158
+				$categories = EED_Ical::_escape_ICal_data($category);
159
+				$url = EED_Ical::_escape_ICal_data(get_permalink($event->ID()));
160
+				$dtt_start = EED_Ical::_escape_ICal_data(date(EED_Ical::iCal_datetime_format, $datetime->start()));
161
+				$dtt_end = EED_Ical::_escape_ICal_data(date(EED_Ical::iCal_datetime_format, $datetime->end()));
162 162
 				// set headers
163
-				header( 'Content-type: text/calendar; charset=utf-8' );
164
-				header( 'Content-Disposition: attachment; filename="' . $filename . '"' );
165
-				header( 'Cache-Control: private, max-age=0, must-revalidate' );
166
-				header( 'Pragma: public' );
167
-				header( 'Content-Type: application/octet-stream' );
168
-				header( 'Content-Type: application/force-download' );
169
-				header( 'Cache-Control: no-cache, must-revalidate' );
170
-				header( 'Content-Transfer-Encoding: binary' );
171
-				header( 'Expires: Sat, 26 Jul 1997 05:00:00 GMT' ); // past date
172
-				ini_set( 'zlib.output_compression', '0' );
163
+				header('Content-type: text/calendar; charset=utf-8');
164
+				header('Content-Disposition: attachment; filename="'.$filename.'"');
165
+				header('Cache-Control: private, max-age=0, must-revalidate');
166
+				header('Pragma: public');
167
+				header('Content-Type: application/octet-stream');
168
+				header('Content-Type: application/force-download');
169
+				header('Cache-Control: no-cache, must-revalidate');
170
+				header('Content-Transfer-Encoding: binary');
171
+				header('Expires: Sat, 26 Jul 1997 05:00:00 GMT'); // past date
172
+				ini_set('zlib.output_compression', '0');
173 173
 				// echo the output
174
-				echo "BEGIN:VCALENDAR" . PHP_EOL;
175
-				echo "VERSION:2.0" . PHP_EOL;
176
-				echo "PRODID:-//{$organizer}//NONSGML PDA Calendar Version 1.0//EN" . PHP_EOL;
177
-				echo "CALSCALE:GREGORIAN" . PHP_EOL;
178
-				echo "BEGIN:VEVENT" . PHP_EOL;
179
-				echo "UID:{$UID}" . PHP_EOL;
180
-				echo "ORGANIZER:MAILTO:{$org_email}" . PHP_EOL;
181
-				echo "DTSTAMP:{$timestamp}" . PHP_EOL;
182
-				echo "LOCATION:{$location}" . PHP_EOL;
183
-				echo "SUMMARY:{$summary}" . PHP_EOL;
184
-				echo "DESCRIPTION:{$description}" . PHP_EOL;
185
-				echo "STATUS:{$status}" . PHP_EOL;
186
-				echo "CATEGORIES:{$categories}" . PHP_EOL;
187
-				echo "URL;VALUE=URI:{$url}" . PHP_EOL;
188
-				echo "DTSTART:{$dtt_start}" . PHP_EOL;
189
-				echo "DTEND:{$dtt_end}" . PHP_EOL;
190
-				echo "END:VEVENT" . PHP_EOL;
191
-				echo "END:VCALENDAR" . PHP_EOL;
174
+				echo "BEGIN:VCALENDAR".PHP_EOL;
175
+				echo "VERSION:2.0".PHP_EOL;
176
+				echo "PRODID:-//{$organizer}//NONSGML PDA Calendar Version 1.0//EN".PHP_EOL;
177
+				echo "CALSCALE:GREGORIAN".PHP_EOL;
178
+				echo "BEGIN:VEVENT".PHP_EOL;
179
+				echo "UID:{$UID}".PHP_EOL;
180
+				echo "ORGANIZER:MAILTO:{$org_email}".PHP_EOL;
181
+				echo "DTSTAMP:{$timestamp}".PHP_EOL;
182
+				echo "LOCATION:{$location}".PHP_EOL;
183
+				echo "SUMMARY:{$summary}".PHP_EOL;
184
+				echo "DESCRIPTION:{$description}".PHP_EOL;
185
+				echo "STATUS:{$status}".PHP_EOL;
186
+				echo "CATEGORIES:{$categories}".PHP_EOL;
187
+				echo "URL;VALUE=URI:{$url}".PHP_EOL;
188
+				echo "DTSTART:{$dtt_start}".PHP_EOL;
189
+				echo "DTEND:{$dtt_end}".PHP_EOL;
190
+				echo "END:VEVENT".PHP_EOL;
191
+				echo "END:VCALENDAR".PHP_EOL;
192 192
 			}
193 193
 		}
194 194
 		die();
@@ -203,8 +203,8 @@  discard block
 block discarded – undo
203 203
 	 *  	@param	string $string
204 204
 	 *  	@return	string
205 205
 	 */
206
-	private static function _escape_ICal_data( $string = '' ) {
207
-		return preg_replace( '/([\,;])/', '\\\$1', $string );
206
+	private static function _escape_ICal_data($string = '') {
207
+		return preg_replace('/([\,;])/', '\\\$1', $string);
208 208
 	}
209 209
 
210 210
 	/**
@@ -214,13 +214,13 @@  discard block
 block discarded – undo
214 214
 	 *  	@param	string $description
215 215
 	 *  	@return	string
216 216
 	 */
217
-	private static function _escape_ICal_description( $description = '' ) {
217
+	private static function _escape_ICal_description($description = '') {
218 218
 			
219 219
 			//Escape spcial chars within the decription
220
-			$description = EED_Ical::_escape_ICal_data( $description );
220
+			$description = EED_Ical::_escape_ICal_data($description);
221 221
 
222 222
 		    //Remove line breaks and output in iCal format
223
-		    $description = str_replace( array( "\r\n", "\n"), '\n', $description );
223
+		    $description = str_replace(array("\r\n", "\n"), '\n', $description);
224 224
 
225 225
 		return $description;
226 226
 	}
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.
admin_pages/support/Support_Admin_Page_Init.core.php 2 patches
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if (!defined('EVENT_ESPRESSO_VERSION') )
2
+if ( ! defined('EVENT_ESPRESSO_VERSION'))
3 3
 	exit('NO direct script access allowed');
4 4
 
5 5
 /**
@@ -32,11 +32,11 @@  discard block
 block discarded – undo
32 32
 
33 33
 	public function __construct() {
34 34
 		//define some help/support page related constants
35
-		define( 'EE_SUPPORT_PG_SLUG', 'espresso_support' );
36
-		define( 'EE_SUPPORT_ADMIN_URL', admin_url('admin.php?page=' . EE_SUPPORT_PG_SLUG ));
37
-		define( 'EE_SUPPORT_ADMIN_TEMPLATE_PATH', EE_ADMIN_PAGES . 'support/templates/');
38
-		define( 'EE_SUPPORT_ADMIN', EE_ADMIN_PAGES . 'support/' );
39
-		define( 'EE_SUPPORT_ASSETS_URL', EE_ADMIN_PAGES_URL . 'support/assets/' );
35
+		define('EE_SUPPORT_PG_SLUG', 'espresso_support');
36
+		define('EE_SUPPORT_ADMIN_URL', admin_url('admin.php?page='.EE_SUPPORT_PG_SLUG));
37
+		define('EE_SUPPORT_ADMIN_TEMPLATE_PATH', EE_ADMIN_PAGES.'support/templates/');
38
+		define('EE_SUPPORT_ADMIN', EE_ADMIN_PAGES.'support/');
39
+		define('EE_SUPPORT_ASSETS_URL', EE_ADMIN_PAGES_URL.'support/assets/');
40 40
 		parent::__construct();
41 41
 	}
42 42
 
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
 	}
46 46
 
47 47
 	protected function _set_menu_map() {
48
-		$this->_menu_map = new EE_Admin_Page_Sub_Menu( array(
48
+		$this->_menu_map = new EE_Admin_Page_Sub_Menu(array(
49 49
 			'menu_group' => 'extras',
50 50
 			'menu_order' => 30,
51 51
 			'show_on_menu' => EE_Admin_Page_Menu_Map::BLOG_AND_NETWORK_ADMIN,
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,7 @@
 block discarded – undo
1 1
 <?php
2
-if (!defined('EVENT_ESPRESSO_VERSION') )
2
+if (!defined('EVENT_ESPRESSO_VERSION') ) {
3 3
 	exit('NO direct script access allowed');
4
+}
4 5
 
5 6
 /**
6 7
  * Event Espresso
Please login to merge, or discard this patch.
admin/extend/registrations/Extend_EE_Attendee_Contact_List_Table.class.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if (!defined('EVENT_ESPRESSO_VERSION') )
2
+if ( ! defined('EVENT_ESPRESSO_VERSION'))
3 3
 	exit('NO direct script access allowed');
4 4
 
5 5
 /**
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
 				'route' => 'contact_list_report',
37 37
 				'extra_request' =>  
38 38
 						array( 
39
-							'return_url' => urlencode( "//{$_SERVER['HTTP_HOST']}{$_SERVER['REQUEST_URI']}" ) ) 
39
+							'return_url' => urlencode("//{$_SERVER['HTTP_HOST']}{$_SERVER['REQUEST_URI']}") ) 
40 40
 			),
41 41
 //			'contact_list_export'=> array(
42 42
 //				'route' => 'contact_list_export'
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,7 @@
 block discarded – undo
1 1
 <?php
2
-if (!defined('EVENT_ESPRESSO_VERSION') )
2
+if (!defined('EVENT_ESPRESSO_VERSION') ) {
3 3
 	exit('NO direct script access allowed');
4
+}
4 5
 
5 6
 /**
6 7
  * Event Espresso
Please login to merge, or discard this patch.
core/EE_Psr4AutoloaderInit.core.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -24,15 +24,15 @@
 block discarded – undo
24 24
 	 */
25 25
 	public function __construct() {
26 26
 		static $initialized = false;
27
-		if ( ! $initialized ) {
27
+		if ( ! $initialized) {
28 28
 			// instantiate PSR4 autoloader
29
-			espresso_load_required( 'Psr4Autoloader', EE_CORE . 'Psr4Autoloader.php' );
29
+			espresso_load_required('Psr4Autoloader', EE_CORE.'Psr4Autoloader.php');
30 30
 			EE_Psr4AutoloaderInit::$psr4_loader = new \EventEspresso\Core\Psr4Autoloader();
31 31
 			// register the autoloader
32 32
 			EE_Psr4AutoloaderInit::$psr4_loader->register();
33 33
 			// register the base directories for the namespace prefix
34
-			EE_Psr4AutoloaderInit::$psr4_loader->addNamespace( 'EventEspresso', EE_PLUGIN_DIR_PATH );
35
-			EE_Psr4AutoloaderInit::$psr4_loader->addNamespace( 'EventEspressoBatchRequest', EE_LIBRARIES . 'batch' );
34
+			EE_Psr4AutoloaderInit::$psr4_loader->addNamespace('EventEspresso', EE_PLUGIN_DIR_PATH);
35
+			EE_Psr4AutoloaderInit::$psr4_loader->addNamespace('EventEspressoBatchRequest', EE_LIBRARIES.'batch');
36 36
 			$initialized = true;
37 37
 		}
38 38
 	}
Please login to merge, or discard this patch.
core/helpers/EEH_Export.helper.php 3 patches
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -87,13 +87,13 @@
 block discarded – undo
87 87
 
88 88
 	 /**
89 89
 	  *
90
-	 *	Writes a row to the csv file
91
-	 *	@param array $row - individual row of csv data
92
-	 *	@param string $delimiter - csv delimiter
93
-	 *	@param string $enclosure - csv enclosure
94
-	 *	@param bool $mysql_null - allows php NULL to be overridden with MySQl's insertable NULL value
95
-	 *	@return string of text for teh csv file
96
-	 */
90
+	  *	Writes a row to the csv file
91
+	  *	@param array $row - individual row of csv data
92
+	  *	@param string $delimiter - csv delimiter
93
+	  *	@param string $enclosure - csv enclosure
94
+	  *	@param bool $mysql_null - allows php NULL to be overridden with MySQl's insertable NULL value
95
+	  *	@return string of text for teh csv file
96
+	  */
97 97
 	public static function get_csv_row ( array $row, $delimiter = ',', $enclosure = '"', $mysql_null = false ) {
98 98
 		//Allow user to filter the csv delimiter and enclosure for other countries csv standards
99 99
 		$delimiter = apply_filters( 'FHEE__EE_CSV__fputcsv2__delimiter', $delimiter );
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
  * Event Espresso
4 6
  *
@@ -77,7 +79,7 @@  discard block
 block discarded – undo
77 79
 				$new_file_contents .= EEH_Export::get_csv_row( $data_row);
78 80
 			}
79 81
 			return EEH_File::write_to_file( $filepath, EEH_File::get_file_contents( $filepath ) . $new_file_contents );
80
-		}else{
82
+		} else{
81 83
 			//no data TO write... so we can assume that's a success
82 84
 			return true;
83 85
 		}
@@ -138,9 +140,9 @@  discard block
 block discarded – undo
138 140
 		}
139 141
 		if( $pretty_schema === true){
140 142
 			return $field_obj->prepare_for_pretty_echoing( $value_on_model_obj );
141
-		}elseif( is_string( $pretty_schema ) ) {
143
+		} elseif( is_string( $pretty_schema ) ) {
142 144
 			return $field_obj->prepare_for_pretty_echoing($value_on_model_obj, $pretty_schema );
143
-		}else{
145
+		} else{
144 146
 			return $field_obj->prepare_for_get( $value_on_model_obj );
145 147
 		}
146 148
 	}
Please login to merge, or discard this patch.
Spacing   +35 added lines, -35 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
 	 * @param EE_Model_Field_Base $field
31 31
 	 * @return string
32 32
 	 */
33
-	public static function get_column_name_for_field(EE_Model_Field_Base $field){
33
+	public static function get_column_name_for_field(EE_Model_Field_Base $field) {
34 34
 		return $field->get_nicename()."[".$field->get_name()."]";
35 35
 	}
36 36
 
@@ -52,31 +52,31 @@  discard block
 block discarded – undo
52 52
 	 * 						we consider that a success (because we wrote everything there was...nothing)
53 53
 	 * @throws EE_Error
54 54
 	 */
55
-	public static function write_data_array_to_csv( $filepath, $data, $write_column_headers = true ){
55
+	public static function write_data_array_to_csv($filepath, $data, $write_column_headers = true) {
56 56
 
57 57
 		$new_file_contents = '';
58 58
 		//determine if $data is actually a 2d array
59
-		if ( $data && is_array($data) && is_array(EEH_Array::get_one_item_from_array($data))){
59
+		if ($data && is_array($data) && is_array(EEH_Array::get_one_item_from_array($data))) {
60 60
 			//make sure top level is numerically indexed,
61 61
 
62
-			if( EEH_Array::is_associative_array($data)){
63
-				throw new EE_Error(sprintf(__("top-level array must be numerically indexed. Does these look like numbers to you? %s","event_espresso"),implode(",",array_keys($data))));
62
+			if (EEH_Array::is_associative_array($data)) {
63
+				throw new EE_Error(sprintf(__("top-level array must be numerically indexed. Does these look like numbers to you? %s", "event_espresso"), implode(",", array_keys($data))));
64 64
 			}
65 65
 			$item_in_top_level_array = EEH_Array::get_one_item_from_array($data);
66 66
 			//now, is the last item in the top-level array of $data an associative or numeric array?
67
-			if( $write_column_headers &&
68
-					EEH_Array::is_associative_array($item_in_top_level_array)){
67
+			if ($write_column_headers &&
68
+					EEH_Array::is_associative_array($item_in_top_level_array)) {
69 69
 				//its associative, so we want to output its keys as column headers
70 70
 				$keys = array_keys($item_in_top_level_array);
71
-				$new_file_contents .=  EEH_Export::get_csv_row( $keys );
71
+				$new_file_contents .= EEH_Export::get_csv_row($keys);
72 72
 
73 73
 			}
74 74
 			//start writing data
75
-			foreach($data as $data_row){
76
-				$new_file_contents .= EEH_Export::get_csv_row( $data_row);
75
+			foreach ($data as $data_row) {
76
+				$new_file_contents .= EEH_Export::get_csv_row($data_row);
77 77
 			}
78
-			return EEH_File::write_to_file( $filepath, EEH_File::get_file_contents( $filepath ) . $new_file_contents );
79
-		}else{
78
+			return EEH_File::write_to_file($filepath, EEH_File::get_file_contents($filepath).$new_file_contents);
79
+		} else {
80 80
 			//no data TO write... so we can assume that's a success
81 81
 			return true;
82 82
 		}
@@ -93,29 +93,29 @@  discard block
 block discarded – undo
93 93
 	 *	@param bool $mysql_null - allows php NULL to be overridden with MySQl's insertable NULL value
94 94
 	 *	@return string of text for teh csv file
95 95
 	 */
96
-	public static function get_csv_row ( array $row, $delimiter = ',', $enclosure = '"', $mysql_null = false ) {
96
+	public static function get_csv_row(array $row, $delimiter = ',', $enclosure = '"', $mysql_null = false) {
97 97
 		//Allow user to filter the csv delimiter and enclosure for other countries csv standards
98
-		$delimiter = apply_filters( 'FHEE__EE_CSV__fputcsv2__delimiter', $delimiter );
99
-		$enclosure = apply_filters( 'FHEE__EE_CSV__fputcsv2__enclosure', $enclosure );
98
+		$delimiter = apply_filters('FHEE__EE_CSV__fputcsv2__delimiter', $delimiter);
99
+		$enclosure = apply_filters('FHEE__EE_CSV__fputcsv2__enclosure', $enclosure);
100 100
 
101 101
 		$delimiter_esc = preg_quote($delimiter, '/');
102 102
 		$enclosure_esc = preg_quote($enclosure, '/');
103 103
 
104 104
 		$output = array();
105 105
 		foreach ($row as $field_value) {
106
-			if(is_object($field_value) || is_array($field_value)){
106
+			if (is_object($field_value) || is_array($field_value)) {
107 107
 				$field_value = serialize($field_value);
108 108
 			}
109
-			if ($field_value === null && $mysql_null ) {
109
+			if ($field_value === null && $mysql_null) {
110 110
 				$output[] = 'NULL';
111 111
 				continue;
112 112
 			}
113 113
 
114 114
 			$output[] = preg_match("/(?:${delimiter_esc}|${enclosure_esc}|\s)/", $field_value) ?
115
-				( $enclosure . str_replace($enclosure, $enclosure . $enclosure, $field_value) . $enclosure ) : $field_value;
115
+				($enclosure.str_replace($enclosure, $enclosure.$enclosure, $field_value).$enclosure) : $field_value;
116 116
 		}
117 117
 
118
-		return  implode($delimiter, $output) . PHP_EOL;
118
+		return  implode($delimiter, $output).PHP_EOL;
119 119
 	}
120 120
 
121 121
 
@@ -128,19 +128,19 @@  discard block
 block discarded – undo
128 128
 	 * @param boolean|string $pretty_schema true to display pretty, a string to use a specific "Schema", or false to NOT display pretty
129 129
 	 * @return string
130 130
 	 */
131
-	public static function prepare_value_from_db_for_display( $model, $field_name,  $raw_db_value, $pretty_schema = true ) {
132
-		$field_obj = $model->field_settings_for( $field_name );
133
-		$value_on_model_obj = $field_obj->prepare_for_set_from_db( $raw_db_value );
134
-		if( $field_obj instanceof EE_Datetime_Field ) {
135
-			$field_obj->set_date_format( EEH_Export::get_date_format_for_export( $field_obj->get_date_format( $pretty_schema ) ), $pretty_schema );
136
-			$field_obj->set_time_format( EEH_Export::get_time_format_for_export( $field_obj->get_time_format( $pretty_schema ) ), $pretty_schema );
131
+	public static function prepare_value_from_db_for_display($model, $field_name, $raw_db_value, $pretty_schema = true) {
132
+		$field_obj = $model->field_settings_for($field_name);
133
+		$value_on_model_obj = $field_obj->prepare_for_set_from_db($raw_db_value);
134
+		if ($field_obj instanceof EE_Datetime_Field) {
135
+			$field_obj->set_date_format(EEH_Export::get_date_format_for_export($field_obj->get_date_format($pretty_schema)), $pretty_schema);
136
+			$field_obj->set_time_format(EEH_Export::get_time_format_for_export($field_obj->get_time_format($pretty_schema)), $pretty_schema);
137 137
 		}
138
-		if( $pretty_schema === true){
139
-			return $field_obj->prepare_for_pretty_echoing( $value_on_model_obj );
140
-		}elseif( is_string( $pretty_schema ) ) {
141
-			return $field_obj->prepare_for_pretty_echoing($value_on_model_obj, $pretty_schema );
142
-		}else{
143
-			return $field_obj->prepare_for_get( $value_on_model_obj );
138
+		if ($pretty_schema === true) {
139
+			return $field_obj->prepare_for_pretty_echoing($value_on_model_obj);
140
+		}elseif (is_string($pretty_schema)) {
141
+			return $field_obj->prepare_for_pretty_echoing($value_on_model_obj, $pretty_schema);
142
+		} else {
143
+			return $field_obj->prepare_for_get($value_on_model_obj);
144 144
 		}
145 145
 	}
146 146
 
@@ -151,8 +151,8 @@  discard block
 block discarded – undo
151 151
 	 * @param string $current_format
152 152
 	 * @return string
153 153
 	 */
154
-	public static function get_date_format_for_export( $current_format = null ) {
155
-		return apply_filters( 'FHEE__EE_CSV__get_date_format_for_csv__format', 'Y-m-d', $current_format );
154
+	public static function get_date_format_for_export($current_format = null) {
155
+		return apply_filters('FHEE__EE_CSV__get_date_format_for_csv__format', 'Y-m-d', $current_format);
156 156
 	}
157 157
 
158 158
 
@@ -162,8 +162,8 @@  discard block
 block discarded – undo
162 162
 	 * @param string $current_format
163 163
 	 * @return string
164 164
 	 */
165
-	public static function get_time_format_for_export( $current_format = null ) {
166
-		return apply_filters( 'FHEE__EE_CSV__get_time_format_for_csv__format', 'H:i:s', $current_format );
165
+	public static function get_time_format_for_export($current_format = null) {
166
+		return apply_filters('FHEE__EE_CSV__get_time_format_for_csv__format', 'H:i:s', $current_format);
167 167
 	}
168 168
 
169 169
 
Please login to merge, or discard this patch.