@@ -41,8 +41,8 @@ |
||
41 | 41 | </div> |
42 | 42 | <span data-context="datetime" data-datetime-row="<?php echo $dtt_row; ?>" class="<?php echo $clone_icon; ?> clickable"></span> |
43 | 43 | <span data-context="datetime" data-datetime-row="<?php echo $dtt_row; ?>" class="<?php echo $trash_icon; ?> clickable"<?php echo $show_trash; ?>></span> |
44 | - <?php if ( $reg_list_url !== '' ) : ?> |
|
45 | - <a href="<?php echo $reg_list_url; ?>" title="<?php _e( 'View registrations for this datetime.', 'event_espresso' );?>" style="text-decoration: none;"> |
|
44 | + <?php if ($reg_list_url !== '') : ?> |
|
45 | + <a href="<?php echo $reg_list_url; ?>" title="<?php _e('View registrations for this datetime.', 'event_espresso'); ?>" style="text-decoration: none;"> |
|
46 | 46 | <span data-context="datetime" data-datetime-row="<?php echo $dtt_row; ?>" class="dashicons dashicons-groups clickable"></span> |
47 | 47 | </a> |
48 | 48 | <?php endif; ?> |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | |
31 | 31 | /** |
32 | 32 | * REG_date |
33 | - */ |
|
33 | + */ |
|
34 | 34 | function column_REG_date(EE_Registration $item){ |
35 | 35 | |
36 | 36 | //Build row actions |
@@ -60,60 +60,60 @@ discard block |
||
60 | 60 | $remove_defaults = array('default_where_conditions' => 'none'); |
61 | 61 | $ticket = $item->ticket(); |
62 | 62 | $datetimes = $ticket instanceof EE_Ticket ? $ticket->datetimes($remove_defaults) : array(); |
63 | - $EVT_ID = $item->event_ID(); |
|
64 | - $datetime_string = ''; |
|
65 | - foreach( $datetimes as $datetime ){ |
|
66 | - if ( |
|
67 | - EE_Registry::instance()->CAP->current_user_can( |
|
68 | - 'ee_read_checkin', |
|
69 | - 'espresso_registrations_registration_checkins', |
|
70 | - $item->ID() |
|
71 | - ) |
|
72 | - ) { |
|
73 | - // open "a" tag and "href" |
|
74 | - $datetime_string .= '<a href="'; |
|
75 | - // checkin URL |
|
76 | - $datetime_string .= EE_Admin_Page::add_query_args_and_nonce( |
|
77 | - array( |
|
78 | - 'action' => 'event_registrations', |
|
79 | - 'event_id' => $EVT_ID, |
|
80 | - 'DTT_ID' => $datetime->ID(), |
|
81 | - ), |
|
82 | - REG_ADMIN_URL |
|
83 | - ); |
|
84 | - // close "href" |
|
85 | - $datetime_string .= '"'; |
|
86 | - // open "title" tag |
|
87 | - $datetime_string .= ' title="'; |
|
88 | - // link title text |
|
89 | - $datetime_string .= esc_attr__( 'View Checkins for this Event', 'event_espresso' ); |
|
90 | - // close "title" tag and end of "a" tag opening |
|
91 | - $datetime_string .= '">'; |
|
92 | - // link text |
|
93 | - $datetime_string .= $datetime->get_i18n_datetime( 'DTT_EVT_start' ); |
|
94 | - // close "a" tag |
|
95 | - $datetime_string .= '</a>'; |
|
96 | - } else { |
|
97 | - $datetime_string .= $datetime->get_i18n_datetime( 'DTT_EVT_start' ); |
|
98 | - } |
|
99 | - // add a "View Registrations" link that filters list by event AND datetime |
|
100 | - $datetime_string .= $this->row_actions( |
|
101 | - array( |
|
102 | - 'event_datetime_filter' => '<a href="' . EE_Admin_Page::add_query_args_and_nonce( |
|
103 | - array( 'event_id' => $EVT_ID, 'datetime_id' => $datetime->ID() ), |
|
104 | - REG_ADMIN_URL |
|
105 | - ) . '" title="' . sprintf( |
|
106 | - esc_attr__( |
|
107 | - 'Filter this list to only show registrations for this datetime %s', |
|
108 | - 'event_espresso' |
|
109 | - ), |
|
110 | - $datetime->name() |
|
111 | - ) . '">' . __( 'View Registrations', 'event_espresso' ) . '</a>' |
|
112 | - ) |
|
113 | - ); |
|
63 | + $EVT_ID = $item->event_ID(); |
|
64 | + $datetime_string = ''; |
|
65 | + foreach( $datetimes as $datetime ){ |
|
66 | + if ( |
|
67 | + EE_Registry::instance()->CAP->current_user_can( |
|
68 | + 'ee_read_checkin', |
|
69 | + 'espresso_registrations_registration_checkins', |
|
70 | + $item->ID() |
|
71 | + ) |
|
72 | + ) { |
|
73 | + // open "a" tag and "href" |
|
74 | + $datetime_string .= '<a href="'; |
|
75 | + // checkin URL |
|
76 | + $datetime_string .= EE_Admin_Page::add_query_args_and_nonce( |
|
77 | + array( |
|
78 | + 'action' => 'event_registrations', |
|
79 | + 'event_id' => $EVT_ID, |
|
80 | + 'DTT_ID' => $datetime->ID(), |
|
81 | + ), |
|
82 | + REG_ADMIN_URL |
|
83 | + ); |
|
84 | + // close "href" |
|
85 | + $datetime_string .= '"'; |
|
86 | + // open "title" tag |
|
87 | + $datetime_string .= ' title="'; |
|
88 | + // link title text |
|
89 | + $datetime_string .= esc_attr__( 'View Checkins for this Event', 'event_espresso' ); |
|
90 | + // close "title" tag and end of "a" tag opening |
|
91 | + $datetime_string .= '">'; |
|
92 | + // link text |
|
93 | + $datetime_string .= $datetime->get_i18n_datetime( 'DTT_EVT_start' ); |
|
94 | + // close "a" tag |
|
95 | + $datetime_string .= '</a>'; |
|
96 | + } else { |
|
97 | + $datetime_string .= $datetime->get_i18n_datetime( 'DTT_EVT_start' ); |
|
98 | + } |
|
99 | + // add a "View Registrations" link that filters list by event AND datetime |
|
100 | + $datetime_string .= $this->row_actions( |
|
101 | + array( |
|
102 | + 'event_datetime_filter' => '<a href="' . EE_Admin_Page::add_query_args_and_nonce( |
|
103 | + array( 'event_id' => $EVT_ID, 'datetime_id' => $datetime->ID() ), |
|
104 | + REG_ADMIN_URL |
|
105 | + ) . '" title="' . sprintf( |
|
106 | + esc_attr__( |
|
107 | + 'Filter this list to only show registrations for this datetime %s', |
|
108 | + 'event_espresso' |
|
109 | + ), |
|
110 | + $datetime->name() |
|
111 | + ) . '">' . __( 'View Registrations', 'event_espresso' ) . '</a>' |
|
112 | + ) |
|
113 | + ); |
|
114 | 114 | } |
115 | 115 | return $datetime_string; |
116 | - } |
|
116 | + } |
|
117 | 117 | |
118 | 118 | |
119 | 119 |
@@ -31,20 +31,20 @@ discard block |
||
31 | 31 | /** |
32 | 32 | * REG_date |
33 | 33 | */ |
34 | - function column_REG_date(EE_Registration $item){ |
|
34 | + function column_REG_date(EE_Registration $item) { |
|
35 | 35 | |
36 | 36 | //Build row actions |
37 | 37 | $actions = array(); |
38 | 38 | |
39 | 39 | //Build row actions |
40 | - $check_in_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'event_registrations', 'event_id'=>$item->event_ID() ), REG_ADMIN_URL ); |
|
41 | - $actions['check_in'] = EE_Registry::instance()->CAP->current_user_can( 'ee_read_checkin', 'espresso_registrations_registration_checkins', $item->ID() ) ? ' |
|
42 | - <a href="'.$check_in_url.'" title="' . esc_attr__( 'The Check-In List allows you to easily toggle check-in status for this event', 'event_espresso' ) . '">' . __( 'View Check-ins', 'event_espresso' ) . '</a>' : __( 'View Check-ins', 'event_espresso' ); |
|
40 | + $check_in_url = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'event_registrations', 'event_id'=>$item->event_ID()), REG_ADMIN_URL); |
|
41 | + $actions['check_in'] = EE_Registry::instance()->CAP->current_user_can('ee_read_checkin', 'espresso_registrations_registration_checkins', $item->ID()) ? ' |
|
42 | + <a href="'.$check_in_url.'" title="'.esc_attr__('The Check-In List allows you to easily toggle check-in status for this event', 'event_espresso').'">'.__('View Check-ins', 'event_espresso').'</a>' : __('View Check-ins', 'event_espresso'); |
|
43 | 43 | |
44 | - $view_lnk_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'view_transaction', 'TXN_ID'=>$item->transaction()->ID() ), TXN_ADMIN_URL ); |
|
45 | - $REG_date = EE_Regisry::instance()->CAP->current_user_can( 'ee_read_transaction', 'espresso_transactions_view_transaction' ) ? '<a href="'.$view_lnk_url.'" title="' . esc_attr__( 'View Transaction Details', 'event_espresso' ) . '">' . $item->get_i18n_datetime( 'REG_date' ) . '</a>' : $item->get_i18n_datetime( 'REG_date' ); |
|
44 | + $view_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'view_transaction', 'TXN_ID'=>$item->transaction()->ID()), TXN_ADMIN_URL); |
|
45 | + $REG_date = EE_Regisry::instance()->CAP->current_user_can('ee_read_transaction', 'espresso_transactions_view_transaction') ? '<a href="'.$view_lnk_url.'" title="'.esc_attr__('View Transaction Details', 'event_espresso').'">'.$item->get_i18n_datetime('REG_date').'</a>' : $item->get_i18n_datetime('REG_date'); |
|
46 | 46 | |
47 | - return sprintf('%1$s %2$s', $REG_date, $this->row_actions($actions) ); |
|
47 | + return sprintf('%1$s %2$s', $REG_date, $this->row_actions($actions)); |
|
48 | 48 | |
49 | 49 | } |
50 | 50 | |
@@ -56,13 +56,13 @@ discard block |
||
56 | 56 | * @param \EE_Registration $item |
57 | 57 | * @return string |
58 | 58 | */ |
59 | - public function column_DTT_EVT_start(EE_Registration $item){ |
|
59 | + public function column_DTT_EVT_start(EE_Registration $item) { |
|
60 | 60 | $remove_defaults = array('default_where_conditions' => 'none'); |
61 | 61 | $ticket = $item->ticket(); |
62 | 62 | $datetimes = $ticket instanceof EE_Ticket ? $ticket->datetimes($remove_defaults) : array(); |
63 | 63 | $EVT_ID = $item->event_ID(); |
64 | 64 | $datetime_string = ''; |
65 | - foreach( $datetimes as $datetime ){ |
|
65 | + foreach ($datetimes as $datetime) { |
|
66 | 66 | if ( |
67 | 67 | EE_Registry::instance()->CAP->current_user_can( |
68 | 68 | 'ee_read_checkin', |
@@ -86,29 +86,29 @@ discard block |
||
86 | 86 | // open "title" tag |
87 | 87 | $datetime_string .= ' title="'; |
88 | 88 | // link title text |
89 | - $datetime_string .= esc_attr__( 'View Checkins for this Event', 'event_espresso' ); |
|
89 | + $datetime_string .= esc_attr__('View Checkins for this Event', 'event_espresso'); |
|
90 | 90 | // close "title" tag and end of "a" tag opening |
91 | 91 | $datetime_string .= '">'; |
92 | 92 | // link text |
93 | - $datetime_string .= $datetime->get_i18n_datetime( 'DTT_EVT_start' ); |
|
93 | + $datetime_string .= $datetime->get_i18n_datetime('DTT_EVT_start'); |
|
94 | 94 | // close "a" tag |
95 | 95 | $datetime_string .= '</a>'; |
96 | 96 | } else { |
97 | - $datetime_string .= $datetime->get_i18n_datetime( 'DTT_EVT_start' ); |
|
97 | + $datetime_string .= $datetime->get_i18n_datetime('DTT_EVT_start'); |
|
98 | 98 | } |
99 | 99 | // add a "View Registrations" link that filters list by event AND datetime |
100 | 100 | $datetime_string .= $this->row_actions( |
101 | 101 | array( |
102 | - 'event_datetime_filter' => '<a href="' . EE_Admin_Page::add_query_args_and_nonce( |
|
103 | - array( 'event_id' => $EVT_ID, 'datetime_id' => $datetime->ID() ), |
|
102 | + 'event_datetime_filter' => '<a href="'.EE_Admin_Page::add_query_args_and_nonce( |
|
103 | + array('event_id' => $EVT_ID, 'datetime_id' => $datetime->ID()), |
|
104 | 104 | REG_ADMIN_URL |
105 | - ) . '" title="' . sprintf( |
|
105 | + ).'" title="'.sprintf( |
|
106 | 106 | esc_attr__( |
107 | 107 | 'Filter this list to only show registrations for this datetime %s', |
108 | 108 | 'event_espresso' |
109 | 109 | ), |
110 | 110 | $datetime->name() |
111 | - ) . '">' . __( 'View Registrations', 'event_espresso' ) . '</a>' |
|
111 | + ).'">'.__('View Registrations', 'event_espresso').'</a>' |
|
112 | 112 | ) |
113 | 113 | ); |
114 | 114 | } |
@@ -1,4 +1,6 @@ |
||
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 | * |
@@ -10,17 +10,17 @@ discard block |
||
10 | 10 | * @since 4.6 |
11 | 11 | * |
12 | 12 | */ |
13 | -class EE_Simple_HTML_Validation_Strategy extends EE_Validation_Strategy_Base{ |
|
13 | +class EE_Simple_HTML_Validation_Strategy extends EE_Validation_Strategy_Base { |
|
14 | 14 | |
15 | 15 | /** |
16 | 16 | * @param null $validation_error_message |
17 | 17 | */ |
18 | - public function __construct( $validation_error_message = NULL ) { |
|
19 | - if( ! $validation_error_message ){ |
|
18 | + public function __construct($validation_error_message = NULL) { |
|
19 | + if ( ! $validation_error_message) { |
|
20 | 20 | $allowedtags = $this->_get_allowed_tags(); |
21 | - $validation_error_message = sprintf( __( "Only simple HTML tags are allowed. Eg, %s", "event_espresso" ), implode( ",", array_keys( $allowedtags ) ) ); |
|
21 | + $validation_error_message = sprintf(__("Only simple HTML tags are allowed. Eg, %s", "event_espresso"), implode(",", array_keys($allowedtags))); |
|
22 | 22 | } |
23 | - parent::__construct( $validation_error_message ); |
|
23 | + parent::__construct($validation_error_message); |
|
24 | 24 | } |
25 | 25 | |
26 | 26 | |
@@ -43,8 +43,8 @@ discard block |
||
43 | 43 | */ |
44 | 44 | public function get_list_of_allowed_tags() { |
45 | 45 | $allowed_tags = $this->_get_allowed_tags(); |
46 | - ksort( $allowed_tags ); |
|
47 | - return implode( ', ', array_keys( $allowed_tags ) ); |
|
46 | + ksort($allowed_tags); |
|
47 | + return implode(', ', array_keys($allowed_tags)); |
|
48 | 48 | } |
49 | 49 | |
50 | 50 | |
@@ -55,10 +55,10 @@ discard block |
||
55 | 55 | */ |
56 | 56 | public function validate($normalized_value) { |
57 | 57 | $allowedtags = $this->_get_allowed_tags(); |
58 | - parent::validate( $normalized_value ); |
|
59 | - $normalized_value_sans_tags = wp_kses( "$normalized_value",$allowedtags ); |
|
60 | - if ( strlen( $normalized_value ) > strlen( $normalized_value_sans_tags ) ) { |
|
61 | - throw new EE_Validation_Error( $this->get_validation_error_message(), 'complex_html_tags' ); |
|
58 | + parent::validate($normalized_value); |
|
59 | + $normalized_value_sans_tags = wp_kses("$normalized_value", $allowedtags); |
|
60 | + if (strlen($normalized_value) > strlen($normalized_value_sans_tags)) { |
|
61 | + throw new EE_Validation_Error($this->get_validation_error_message(), 'complex_html_tags'); |
|
62 | 62 | } |
63 | 63 | } |
64 | 64 | } |
65 | 65 | \ No newline at end of file |
@@ -96,7 +96,7 @@ |
||
96 | 96 | $gateway = $payment_method->type_obj()->get_gateway(); |
97 | 97 | if ( |
98 | 98 | $gateway instanceof EE_Offsite_Gateway |
99 | - && $gateway->handle_IPN_in_this_request( |
|
99 | + && $gateway->handle_IPN_in_this_request( |
|
100 | 100 | \EE_Registry::instance()->REQ->params(), |
101 | 101 | true |
102 | 102 | ) |
@@ -1,4 +1,4 @@ discard block |
||
1 | -<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) {exit('No direct script access allowed');} |
|
1 | +<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) {exit('No direct script access allowed'); } |
|
2 | 2 | /** |
3 | 3 | * EES_Espresso_Txn_Page |
4 | 4 | * |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | * @return void |
28 | 28 | */ |
29 | 29 | public static function set_hooks() { |
30 | - add_action( 'wp_loaded', array( 'EES_Espresso_Txn_Page', 'set_definitions' ), 2 ); |
|
30 | + add_action('wp_loaded', array('EES_Espresso_Txn_Page', 'set_definitions'), 2); |
|
31 | 31 | } |
32 | 32 | |
33 | 33 | /** |
@@ -48,8 +48,8 @@ discard block |
||
48 | 48 | * @return void |
49 | 49 | */ |
50 | 50 | public static function set_definitions() { |
51 | - define( 'TXN_PAGE_ASSETS_URL', plugin_dir_url( __FILE__ ) . 'assets' . DS ); |
|
52 | - define( 'TXN_PAGE_TEMPLATES_PATH', str_replace( '\\', DS, plugin_dir_path( __FILE__ )) . 'templates' . DS ); |
|
51 | + define('TXN_PAGE_ASSETS_URL', plugin_dir_url(__FILE__).'assets'.DS); |
|
52 | + define('TXN_PAGE_TEMPLATES_PATH', str_replace('\\', DS, plugin_dir_path(__FILE__)).'templates'.DS); |
|
53 | 53 | } |
54 | 54 | |
55 | 55 | |
@@ -66,21 +66,21 @@ discard block |
||
66 | 66 | * @throws \Exception |
67 | 67 | * @throws \EE_Error |
68 | 68 | */ |
69 | - public function run( WP $WP ) { |
|
69 | + public function run(WP $WP) { |
|
70 | 70 | $this->_current_txn = null; |
71 | - if ( EE_Registry::instance()->REQ->is_set('e_reg_url_link' )){ |
|
71 | + if (EE_Registry::instance()->REQ->is_set('e_reg_url_link')) { |
|
72 | 72 | /** @var EEM_Transaction $EEM_Transaction */ |
73 | - $EEM_Transaction = EE_Registry::instance()->load_model( 'Transaction' ); |
|
73 | + $EEM_Transaction = EE_Registry::instance()->load_model('Transaction'); |
|
74 | 74 | $this->_current_txn = $EEM_Transaction->get_transaction_from_reg_url_link(); |
75 | 75 | } |
76 | - if ( $this->_current_txn instanceof EE_Transaction ) { |
|
76 | + if ($this->_current_txn instanceof EE_Transaction) { |
|
77 | 77 | $payment_method = null; |
78 | - $payment_method_slug = EE_Registry::instance()->REQ->get( 'ee_payment_method', null ); |
|
79 | - if( $payment_method_slug ) { |
|
80 | - $payment_method = EEM_Payment_Method::instance()->get_one_by_slug( $payment_method_slug ); |
|
78 | + $payment_method_slug = EE_Registry::instance()->REQ->get('ee_payment_method', null); |
|
79 | + if ($payment_method_slug) { |
|
80 | + $payment_method = EEM_Payment_Method::instance()->get_one_by_slug($payment_method_slug); |
|
81 | 81 | } |
82 | 82 | |
83 | - if ( $payment_method instanceof EE_Payment_Method && $payment_method->is_off_site() ) { |
|
83 | + if ($payment_method instanceof EE_Payment_Method && $payment_method->is_off_site()) { |
|
84 | 84 | $gateway = $payment_method->type_obj()->get_gateway(); |
85 | 85 | if ( |
86 | 86 | $gateway instanceof EE_Offsite_Gateway |
@@ -90,12 +90,12 @@ discard block |
||
90 | 90 | ) |
91 | 91 | ) { |
92 | 92 | /** @type EE_Payment_Processor $payment_processor */ |
93 | - $payment_processor = EE_Registry::instance()->load_core( 'Payment_Processor' ); |
|
94 | - $payment_processor->process_ipn( $_REQUEST, $this->_current_txn, $payment_method ); |
|
93 | + $payment_processor = EE_Registry::instance()->load_core('Payment_Processor'); |
|
94 | + $payment_processor->process_ipn($_REQUEST, $this->_current_txn, $payment_method); |
|
95 | 95 | } |
96 | 96 | } |
97 | 97 | //allow gateways to add a filter to stop rendering the page |
98 | - if( apply_filters( 'FHEE__EES_Espresso_Txn_Page__run__exit', FALSE ) ){ |
|
98 | + if (apply_filters('FHEE__EES_Espresso_Txn_Page__run__exit', FALSE)) { |
|
99 | 99 | exit; |
100 | 100 | } |
101 | 101 | } |
@@ -112,8 +112,8 @@ discard block |
||
112 | 112 | * @param array $attributes |
113 | 113 | * @return string |
114 | 114 | */ |
115 | - public function process_shortcode( $attributes = array() ) { |
|
116 | - return __( 'This is the Event Espresso Transactions page. This page receives instant payment notification (IPN) requests and should have a status of published, but should not be easily accessible by site visitors. Do not add it to your website\'s navigation menu or link to it from another page. Also, do not delete it or change its status to private.', 'event_espresso' ); |
|
115 | + public function process_shortcode($attributes = array()) { |
|
116 | + return __('This is the Event Espresso Transactions page. This page receives instant payment notification (IPN) requests and should have a status of published, but should not be easily accessible by site visitors. Do not add it to your website\'s navigation menu or link to it from another page. Also, do not delete it or change its status to private.', 'event_espresso'); |
|
117 | 117 | } |
118 | 118 | |
119 | 119 |
@@ -1,6 +1,6 @@ discard block |
||
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 | /** |
@@ -14,31 +14,31 @@ discard block |
||
14 | 14 | * @author Mike Nelson |
15 | 15 | * |
16 | 16 | */ |
17 | -class EE_Billing_Attendee_Info_Form extends EE_Billing_Info_Form{ |
|
17 | +class EE_Billing_Attendee_Info_Form extends EE_Billing_Info_Form { |
|
18 | 18 | |
19 | 19 | /** |
20 | 20 | * |
21 | 21 | * @param EE_Payment_Method $payment_method |
22 | 22 | * @param array $options_array @see EE_Form_Section_Proper::__construct() |
23 | 23 | */ |
24 | - public function __construct( EE_Payment_Method $payment_method, $options_array= array()){ |
|
24 | + public function __construct(EE_Payment_Method $payment_method, $options_array = array()) { |
|
25 | 25 | $options_array['subsections'] = array_merge( |
26 | 26 | array( |
27 | - 'first_name' => new EE_Text_Input( array( 'required'=>TRUE, 'html_class' => 'ee-billing-qstn ee-billing-qstn-fname', 'html_label_text' => __( 'First Name', 'event_espresso' ) ) ), |
|
28 | - 'last_name' => new EE_Text_Input( array( 'required'=>TRUE, 'html_class' => 'ee-billing-qstn ee-billing-qstn-lname', 'html_label_text' => __( 'Last Name', 'event_espresso' ) ) ), |
|
29 | - 'email' => new EE_Email_Input( array( 'required'=>TRUE, 'html_class' => 'ee-billing-qstn ee-billing-qstn-email', 'html_label_text' => __( 'Email', 'event_espresso' ) ) ), |
|
30 | - 'address' => new EE_Text_Input( array( 'html_label_text'=> __( 'Address', 'event_espresso'), 'required'=>TRUE, 'html_class' => 'ee-billing-qstn ee-billing-qstn-address' )), |
|
31 | - 'address2' => new EE_Text_Input( array( 'html_label_text'=> __( 'Address 2', 'event_espresso'), 'html_class' => 'ee-billing-qstn ee-billing-qstn-address2' )), |
|
32 | - 'city' => new EE_Text_Input( array( 'required'=>TRUE, 'html_class' => 'ee-billing-qstn ee-billing-qstn-city', 'html_label_text' => __( 'City', 'event_espresso' ) ) ), |
|
33 | - 'state' => apply_filters( 'FHEE__EE_Billing_Attendee_Info_Form__state_field', new EE_State_Select_Input( NULL, array( 'required'=>TRUE, 'html_class' => 'ee-billing-qstn ee-billing-qstn-state', 'html_label_text' => __( 'State', 'event_espresso' ) ) ) ), |
|
34 | - 'country' => apply_filters( 'FHEE__EE_Billing_Attendee_Info_Form__country_field', new EE_Country_Select_Input( NULL, array( 'required'=>TRUE, 'html_class' => 'ee-billing-qstn ee-billing-qstn-country', 'html_label_text' => __( 'Country', 'event_espresso' ) ) ) ), |
|
35 | - 'zip' => new EE_Text_Input( array( 'required'=>TRUE, 'html_class' => 'ee-billing-qstn ee-billing-qstn-zip', 'html_label_text' => __( 'Zip', 'event_espresso' ) ) ), |
|
36 | - 'phone' => new EE_Text_Input( array( 'html_class' => 'ee-billing-qstn ee-billing-qstn-phone', 'html_label_text' => __( 'Phone', 'event_espresso' ) )), |
|
27 | + 'first_name' => new EE_Text_Input(array('required'=>TRUE, 'html_class' => 'ee-billing-qstn ee-billing-qstn-fname', 'html_label_text' => __('First Name', 'event_espresso'))), |
|
28 | + 'last_name' => new EE_Text_Input(array('required'=>TRUE, 'html_class' => 'ee-billing-qstn ee-billing-qstn-lname', 'html_label_text' => __('Last Name', 'event_espresso'))), |
|
29 | + 'email' => new EE_Email_Input(array('required'=>TRUE, 'html_class' => 'ee-billing-qstn ee-billing-qstn-email', 'html_label_text' => __('Email', 'event_espresso'))), |
|
30 | + 'address' => new EE_Text_Input(array('html_label_text'=> __('Address', 'event_espresso'), 'required'=>TRUE, 'html_class' => 'ee-billing-qstn ee-billing-qstn-address')), |
|
31 | + 'address2' => new EE_Text_Input(array('html_label_text'=> __('Address 2', 'event_espresso'), 'html_class' => 'ee-billing-qstn ee-billing-qstn-address2')), |
|
32 | + 'city' => new EE_Text_Input(array('required'=>TRUE, 'html_class' => 'ee-billing-qstn ee-billing-qstn-city', 'html_label_text' => __('City', 'event_espresso'))), |
|
33 | + 'state' => apply_filters('FHEE__EE_Billing_Attendee_Info_Form__state_field', new EE_State_Select_Input(NULL, array('required'=>TRUE, 'html_class' => 'ee-billing-qstn ee-billing-qstn-state', 'html_label_text' => __('State', 'event_espresso')))), |
|
34 | + 'country' => apply_filters('FHEE__EE_Billing_Attendee_Info_Form__country_field', new EE_Country_Select_Input(NULL, array('required'=>TRUE, 'html_class' => 'ee-billing-qstn ee-billing-qstn-country', 'html_label_text' => __('Country', 'event_espresso')))), |
|
35 | + 'zip' => new EE_Text_Input(array('required'=>TRUE, 'html_class' => 'ee-billing-qstn ee-billing-qstn-zip', 'html_label_text' => __('Zip', 'event_espresso'))), |
|
36 | + 'phone' => new EE_Text_Input(array('html_class' => 'ee-billing-qstn ee-billing-qstn-phone', 'html_label_text' => __('Phone', 'event_espresso'))), |
|
37 | 37 | ), |
38 | - isset( $options_array['subsections'] ) ? $options_array['subsections'] : array() |
|
38 | + isset($options_array['subsections']) ? $options_array['subsections'] : array() |
|
39 | 39 | ); |
40 | 40 | |
41 | - parent::__construct( $payment_method, $options_array ); |
|
41 | + parent::__construct($payment_method, $options_array); |
|
42 | 42 | |
43 | 43 | } |
44 | 44 | |
@@ -46,11 +46,11 @@ discard block |
||
46 | 46 | * Sets the defaults for the billing form according to the attendee's details |
47 | 47 | * @param EE_Attendee $attendee |
48 | 48 | */ |
49 | - public function populate_from_attendee( $attendee ){ |
|
49 | + public function populate_from_attendee($attendee) { |
|
50 | 50 | $attendee = EEM_Attendee::instance()->ensure_is_obj($attendee); |
51 | 51 | /** @var $attendee EE_Attendee */ |
52 | 52 | $this->populate_defaults( |
53 | - apply_filters( 'FHEE__EE_Billing_Attendee_Info_Form__populate_from_attendee', |
|
53 | + apply_filters('FHEE__EE_Billing_Attendee_Info_Form__populate_from_attendee', |
|
54 | 54 | array( |
55 | 55 | 'first_name'=>$attendee->fname(), |
56 | 56 | 'last_name'=>$attendee->lname(), |
@@ -78,48 +78,48 @@ discard block |
||
78 | 78 | * @param \EE_Attendee $attendee - the attendee object to copy details to |
79 | 79 | * @return \EE_Attendee |
80 | 80 | */ |
81 | - public function copy_billing_form_data_to_attendee( EE_Attendee $attendee ){ |
|
81 | + public function copy_billing_form_data_to_attendee(EE_Attendee $attendee) { |
|
82 | 82 | // grab billing form data |
83 | 83 | $data = $this->valid_data(); |
84 | 84 | // copy first_name |
85 | - if ( ! empty( $data['first_name'] )) { |
|
86 | - $attendee->set_fname( $data['first_name'] ); |
|
85 | + if ( ! empty($data['first_name'])) { |
|
86 | + $attendee->set_fname($data['first_name']); |
|
87 | 87 | } |
88 | 88 | // copy last_name |
89 | - if ( ! empty( $data['last_name'] )) { |
|
90 | - $attendee->set_lname( $data['last_name'] ); |
|
89 | + if ( ! empty($data['last_name'])) { |
|
90 | + $attendee->set_lname($data['last_name']); |
|
91 | 91 | } |
92 | 92 | // copy email |
93 | - if ( ! empty( $data['email'] )) { |
|
94 | - $attendee->set_email( $data['email'] ); |
|
93 | + if ( ! empty($data['email'])) { |
|
94 | + $attendee->set_email($data['email']); |
|
95 | 95 | } |
96 | 96 | // copy address |
97 | - if ( ! empty( $data['address'] )) { |
|
98 | - $attendee->set_address( $data['address'] ); |
|
97 | + if ( ! empty($data['address'])) { |
|
98 | + $attendee->set_address($data['address']); |
|
99 | 99 | } |
100 | 100 | // copy address2 |
101 | - if ( ! empty( $data['address2'] )) { |
|
102 | - $attendee->set_address2( $data['address2'] ); |
|
101 | + if ( ! empty($data['address2'])) { |
|
102 | + $attendee->set_address2($data['address2']); |
|
103 | 103 | } |
104 | 104 | // copy city |
105 | - if ( ! empty( $data['city'] )) { |
|
106 | - $attendee->set_city( $data['city'] ); |
|
105 | + if ( ! empty($data['city'])) { |
|
106 | + $attendee->set_city($data['city']); |
|
107 | 107 | } |
108 | 108 | // copy state |
109 | - if ( ! empty( $data['state'] )) { |
|
110 | - $attendee->set_state( $data['state'] ); |
|
109 | + if ( ! empty($data['state'])) { |
|
110 | + $attendee->set_state($data['state']); |
|
111 | 111 | } |
112 | 112 | // copy country |
113 | - if ( ! empty( $data['country'] )) { |
|
114 | - $attendee->set_country( $data['country'] ); |
|
113 | + if ( ! empty($data['country'])) { |
|
114 | + $attendee->set_country($data['country']); |
|
115 | 115 | } |
116 | 116 | // copy zip |
117 | - if ( ! empty( $data['zip'] )) { |
|
118 | - $attendee->set_zip( $data['zip'] ); |
|
117 | + if ( ! empty($data['zip'])) { |
|
118 | + $attendee->set_zip($data['zip']); |
|
119 | 119 | } |
120 | 120 | // copy phone |
121 | - if ( ! empty( $data['phone'] )) { |
|
122 | - $attendee->set_phone( $data['phone'] ); |
|
121 | + if ( ! empty($data['phone'])) { |
|
122 | + $attendee->set_phone($data['phone']); |
|
123 | 123 | } |
124 | 124 | return $attendee; |
125 | 125 | } |
@@ -130,20 +130,20 @@ discard block |
||
130 | 130 | * uses info from the billing form to create a new attendee |
131 | 131 | * @return \EE_Attendee |
132 | 132 | */ |
133 | - public function create_attendee_from_billing_form_data(){ |
|
133 | + public function create_attendee_from_billing_form_data() { |
|
134 | 134 | // grab billing form data |
135 | 135 | $data = $this->valid_data(); |
136 | - return EE_Attendee::new_instance( array( |
|
137 | - 'ATT_fname' => ! empty( $data['first_name'] ) ? $data['first_name'] : '', |
|
138 | - 'ATT_lname' => ! empty( $data['last_name'] ) ? $data['last_name'] : '', |
|
139 | - 'ATT_email' => ! empty( $data['email'] ) ? $data['email'] : '', |
|
140 | - 'ATT_address' => ! empty( $data['address'] ) ? $data['address'] : '', |
|
141 | - 'ATT_address2' => ! empty( $data['address2'] ) ? $data['address2'] : '', |
|
142 | - 'ATT_city' => ! empty( $data['city'] ) ? $data['city'] : '', |
|
143 | - 'STA_ID' => ! empty( $data['state'] ) ? $data['state'] : '', |
|
144 | - 'CNT_ISO' => ! empty( $data['country'] ) ? $data['country'] : '', |
|
145 | - 'ATT_zip' => ! empty( $data['zip'] ) ? $data['zip'] : '', |
|
146 | - 'ATT_phone' => ! empty( $data['phone'] ) ? $data['phone'] : '', |
|
136 | + return EE_Attendee::new_instance(array( |
|
137 | + 'ATT_fname' => ! empty($data['first_name']) ? $data['first_name'] : '', |
|
138 | + 'ATT_lname' => ! empty($data['last_name']) ? $data['last_name'] : '', |
|
139 | + 'ATT_email' => ! empty($data['email']) ? $data['email'] : '', |
|
140 | + 'ATT_address' => ! empty($data['address']) ? $data['address'] : '', |
|
141 | + 'ATT_address2' => ! empty($data['address2']) ? $data['address2'] : '', |
|
142 | + 'ATT_city' => ! empty($data['city']) ? $data['city'] : '', |
|
143 | + 'STA_ID' => ! empty($data['state']) ? $data['state'] : '', |
|
144 | + 'CNT_ISO' => ! empty($data['country']) ? $data['country'] : '', |
|
145 | + 'ATT_zip' => ! empty($data['zip']) ? $data['zip'] : '', |
|
146 | + 'ATT_phone' => ! empty($data['phone']) ? $data['phone'] : '', |
|
147 | 147 | )); |
148 | 148 | } |
149 | 149 | } |
@@ -8,7 +8,7 @@ discard block |
||
8 | 8 | * @since 4.6 |
9 | 9 | * |
10 | 10 | */ |
11 | -class EE_Conditionally_Required_Validation_Strategy extends EE_Validation_Strategy_Base{ |
|
11 | +class EE_Conditionally_Required_Validation_Strategy extends EE_Validation_Strategy_Base { |
|
12 | 12 | |
13 | 13 | /** |
14 | 14 | * Array describing conditions necessary to make the input required. |
@@ -24,12 +24,12 @@ discard block |
||
24 | 24 | * @param string $validation_error_message |
25 | 25 | * @param array $requirement_conditions |
26 | 26 | */ |
27 | - public function __construct( $validation_error_message = null, $requirement_conditions = array() ) { |
|
28 | - if( ! $validation_error_message ){ |
|
27 | + public function __construct($validation_error_message = null, $requirement_conditions = array()) { |
|
28 | + if ( ! $validation_error_message) { |
|
29 | 29 | $validation_error_message = __("This field is required.", "event_espresso"); |
30 | 30 | } |
31 | - $this->set_requirement_conditions( $requirement_conditions ); |
|
32 | - parent::__construct( $validation_error_message ); |
|
31 | + $this->set_requirement_conditions($requirement_conditions); |
|
32 | + parent::__construct($validation_error_message); |
|
33 | 33 | } |
34 | 34 | |
35 | 35 | |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | * @throws \EE_Validation_Error |
45 | 45 | */ |
46 | 46 | public function validate($normalized_value) { |
47 | - if( |
|
47 | + if ( |
|
48 | 48 | ( |
49 | 49 | $normalized_value === '' |
50 | 50 | || $normalized_value === null |
@@ -52,8 +52,8 @@ discard block |
||
52 | 52 | ) |
53 | 53 | && $this->_input_is_required_server_side() |
54 | 54 | ) { |
55 | - throw new EE_Validation_Error( $this->get_validation_error_message(), 'required'); |
|
56 | - }else{ |
|
55 | + throw new EE_Validation_Error($this->get_validation_error_message(), 'required'); |
|
56 | + } else { |
|
57 | 57 | return true; |
58 | 58 | } |
59 | 59 | } |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | * @return array |
65 | 65 | * @throws \EE_Error |
66 | 66 | */ |
67 | - public function get_jquery_validation_rule_array(){ |
|
67 | + public function get_jquery_validation_rule_array() { |
|
68 | 68 | return array( |
69 | 69 | 'required'=> $this->_get_jquery_requirement_value(), |
70 | 70 | 'messages' => array( |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | * |
83 | 83 | * @param array $requirement_conditions |
84 | 84 | */ |
85 | - public function set_requirement_conditions( $requirement_conditions ) { |
|
85 | + public function set_requirement_conditions($requirement_conditions) { |
|
86 | 86 | $this->requirement_conditions = (array) $requirement_conditions; |
87 | 87 | } |
88 | 88 | |
@@ -108,10 +108,10 @@ discard block |
||
108 | 108 | protected function _get_jquery_requirement_value() { |
109 | 109 | $requirement_value = ''; |
110 | 110 | $conditions = $this->get_requirement_conditions(); |
111 | - if( ! is_array( $conditions ) ){ |
|
111 | + if ( ! is_array($conditions)) { |
|
112 | 112 | EE_Error::throw_exception_if_debugging( |
113 | 113 | sprintf( |
114 | - __( 'Input requirement conditions must be an array. You provided %1$s', 'event_espresso' ), |
|
114 | + __('Input requirement conditions must be an array. You provided %1$s', 'event_espresso'), |
|
115 | 115 | $this->_input->name() |
116 | 116 | ), |
117 | 117 | __FILE__, |
@@ -120,10 +120,10 @@ discard block |
||
120 | 120 | ); |
121 | 121 | return true; |
122 | 122 | } |
123 | - if( count( $conditions ) > 1 ) { |
|
123 | + if (count($conditions) > 1) { |
|
124 | 124 | EE_Error::throw_exception_if_debugging( |
125 | 125 | sprintf( |
126 | - __( 'Required Validation Strategy does not yet support multiple conditions. You should add it! The related input is %1$s', 'event_espresso' ), |
|
126 | + __('Required Validation Strategy does not yet support multiple conditions. You should add it! The related input is %1$s', 'event_espresso'), |
|
127 | 127 | $this->_input->name() |
128 | 128 | ), |
129 | 129 | __FILE__, |
@@ -131,12 +131,12 @@ discard block |
||
131 | 131 | __LINE__ |
132 | 132 | ); |
133 | 133 | } |
134 | - foreach( $conditions as $input_path => $op_and_value ) { |
|
135 | - $input = $this->_input->find_section_from_path( $input_path ); |
|
136 | - if( ! $input instanceof EE_Form_Input_Base ) { |
|
134 | + foreach ($conditions as $input_path => $op_and_value) { |
|
135 | + $input = $this->_input->find_section_from_path($input_path); |
|
136 | + if ( ! $input instanceof EE_Form_Input_Base) { |
|
137 | 137 | EE_Error::throw_exception_if_debugging( |
138 | 138 | sprintf( |
139 | - __( 'Error encountered while setting requirement condition for input %1$s. The path %2$s does not correspond to a valid input'), |
|
139 | + __('Error encountered while setting requirement condition for input %1$s. The path %2$s does not correspond to a valid input'), |
|
140 | 140 | $this->_input->name(), |
141 | 141 | $input_path |
142 | 142 | ), |
@@ -146,14 +146,14 @@ discard block |
||
146 | 146 | ); |
147 | 147 | return false; |
148 | 148 | } |
149 | - list( $op, $value ) = $this->_validate_op_and_value( $op_and_value ); |
|
149 | + list($op, $value) = $this->_validate_op_and_value($op_and_value); |
|
150 | 150 | //ok now the jquery dependency expression depends on the input's display strategy. |
151 | - if( ! $input->get_display_strategy() instanceof EE_Select_Display_Strategy ) { |
|
151 | + if ( ! $input->get_display_strategy() instanceof EE_Select_Display_Strategy) { |
|
152 | 152 | EE_Error::throw_exception_if_debugging( |
153 | 153 | sprintf( |
154 | - __( 'Required Validation Strategy can only depend on another input which uses the EE_Select_Display_Strategy, but you specified a field "%1$s" that uses display strategy "%2$s". If you need others, please add support for it! The related input is %3$s', 'event_espresso' ), |
|
154 | + __('Required Validation Strategy can only depend on another input which uses the EE_Select_Display_Strategy, but you specified a field "%1$s" that uses display strategy "%2$s". If you need others, please add support for it! The related input is %3$s', 'event_espresso'), |
|
155 | 155 | $input->name(), |
156 | - get_class( $input->get_display_strategy() ), |
|
156 | + get_class($input->get_display_strategy()), |
|
157 | 157 | $this->_input->name() |
158 | 158 | ), |
159 | 159 | __FILE__, |
@@ -161,7 +161,7 @@ discard block |
||
161 | 161 | __LINE__ |
162 | 162 | ); |
163 | 163 | } |
164 | - $requirement_value = $input->html_id( true ) . ' option[value="' . $value . '"]:selected'; |
|
164 | + $requirement_value = $input->html_id(true).' option[value="'.$value.'"]:selected'; |
|
165 | 165 | } |
166 | 166 | return $requirement_value; |
167 | 167 | } |
@@ -179,12 +179,12 @@ discard block |
||
179 | 179 | protected function _input_is_required_server_side() { |
180 | 180 | $meets_all_requirements = true; |
181 | 181 | $conditions = $this->get_requirement_conditions(); |
182 | - foreach( $conditions as $input_path => $op_and_value ) { |
|
183 | - $input = $this->_input->find_section_from_path( $input_path ); |
|
184 | - if( ! $input instanceof EE_Form_Input_Base ) { |
|
182 | + foreach ($conditions as $input_path => $op_and_value) { |
|
183 | + $input = $this->_input->find_section_from_path($input_path); |
|
184 | + if ( ! $input instanceof EE_Form_Input_Base) { |
|
185 | 185 | EE_Error::throw_exception_if_debugging( |
186 | 186 | sprintf( |
187 | - __( 'Error encountered while setting requirement condition for input %1$s. The path %2$s does not correspond to a valid input'), |
|
187 | + __('Error encountered while setting requirement condition for input %1$s. The path %2$s does not correspond to a valid input'), |
|
188 | 188 | $this->_input->name(), |
189 | 189 | $input_path |
190 | 190 | ), |
@@ -194,13 +194,13 @@ discard block |
||
194 | 194 | ); |
195 | 195 | return false; |
196 | 196 | } |
197 | - list( $op, $value ) = $this->_validate_op_and_value( $op_and_value ); |
|
198 | - switch( $op ) { |
|
197 | + list($op, $value) = $this->_validate_op_and_value($op_and_value); |
|
198 | + switch ($op) { |
|
199 | 199 | case '=': |
200 | 200 | default: |
201 | 201 | $meets_all_requirements = $input->normalized_value() === $value; |
202 | 202 | } |
203 | - if( ! $meets_all_requirements ) { |
|
203 | + if ( ! $meets_all_requirements) { |
|
204 | 204 | break; |
205 | 205 | } |
206 | 206 | } |
@@ -217,11 +217,11 @@ discard block |
||
217 | 217 | * @return array |
218 | 218 | * @throws \EE_Error |
219 | 219 | */ |
220 | - protected function _validate_op_and_value( $op_and_value ) { |
|
221 | - if( ! isset( $op_and_value[ 0 ], $op_and_value[ 1 ] ) ) { |
|
220 | + protected function _validate_op_and_value($op_and_value) { |
|
221 | + if ( ! isset($op_and_value[0], $op_and_value[1])) { |
|
222 | 222 | EE_Error::throw_exception_if_debugging( |
223 | 223 | sprintf( |
224 | - __( 'Required Validation Strategy conditions array\'s value must be an array with two elements: an operator, and a value. It didn\'t. The related input is %1$s', 'event_espresso' ), |
|
224 | + __('Required Validation Strategy conditions array\'s value must be an array with two elements: an operator, and a value. It didn\'t. The related input is %1$s', 'event_espresso'), |
|
225 | 225 | $this->_input->name() |
226 | 226 | ), |
227 | 227 | __FILE__, |
@@ -229,12 +229,12 @@ discard block |
||
229 | 229 | __LINE__ |
230 | 230 | ); |
231 | 231 | } |
232 | - $operator = $op_and_value[ 0 ]; |
|
233 | - $value = (string) $op_and_value[ 1 ]; |
|
234 | - if( $operator !== '=' ) { |
|
232 | + $operator = $op_and_value[0]; |
|
233 | + $value = (string) $op_and_value[1]; |
|
234 | + if ($operator !== '=') { |
|
235 | 235 | EE_Error::throw_exception_if_debugging( |
236 | 236 | sprintf( |
237 | - __( 'Required Validation Strategy conditions can currently only use the equals operator. If you need others, please add support for it! The related input is %1$s', 'event_espresso' ), |
|
237 | + __('Required Validation Strategy conditions can currently only use the equals operator. If you need others, please add support for it! The related input is %1$s', 'event_espresso'), |
|
238 | 238 | $this->_input->name() |
239 | 239 | ), |
240 | 240 | __FILE__, |
@@ -242,7 +242,7 @@ discard block |
||
242 | 242 | __LINE__ |
243 | 243 | ); |
244 | 244 | } |
245 | - return array( $operator, $value ); |
|
245 | + return array($operator, $value); |
|
246 | 246 | |
247 | 247 | } |
248 | 248 | } |
@@ -53,7 +53,7 @@ |
||
53 | 53 | && $this->_input_is_required_server_side() |
54 | 54 | ) { |
55 | 55 | throw new EE_Validation_Error( $this->get_validation_error_message(), 'required'); |
56 | - }else{ |
|
56 | + } else{ |
|
57 | 57 | return true; |
58 | 58 | } |
59 | 59 | } |
@@ -33,7 +33,7 @@ |
||
33 | 33 | ! isset( $input_settings['include_whats_this_link'] ) |
34 | 34 | || ( |
35 | 35 | isset( $input_settings['include_whats_this_link'] ) |
36 | - && $input_settings['include_whats_this_link'] === true |
|
36 | + && $input_settings['include_whats_this_link'] === true |
|
37 | 37 | ) |
38 | 38 | ) { |
39 | 39 | $this->_html_label_text = sprintf( |
@@ -8,7 +8,7 @@ discard block |
||
8 | 8 | * @subpackage |
9 | 9 | * @author Mike Nelson |
10 | 10 | */ |
11 | -class EE_CVV_Input extends EE_Text_Input{ |
|
11 | +class EE_CVV_Input extends EE_Text_Input { |
|
12 | 12 | |
13 | 13 | /** |
14 | 14 | * @param array $input_settings { |
@@ -19,8 +19,8 @@ discard block |
||
19 | 19 | $this->set_sensitive_data_removal_strategy(new EE_CCV_Sensitive_Data_Removal()); |
20 | 20 | $this->_add_validation_strategy( |
21 | 21 | new EE_Text_Validation_Strategy( |
22 | - isset( $input_settings[ 'validation_error_message' ] ) |
|
23 | - ? $input_settings[ 'validation_error_message' ] |
|
22 | + isset($input_settings['validation_error_message']) |
|
23 | + ? $input_settings['validation_error_message'] |
|
24 | 24 | : __( |
25 | 25 | 'The CVV is either a 3 digit number on the back of your card, or 4 digit number on the front', |
26 | 26 | 'event_espresso' |
@@ -29,10 +29,10 @@ discard block |
||
29 | 29 | ) |
30 | 30 | ); |
31 | 31 | parent::__construct($input_settings); |
32 | - if( |
|
33 | - ! isset( $input_settings['include_whats_this_link'] ) |
|
32 | + if ( |
|
33 | + ! isset($input_settings['include_whats_this_link']) |
|
34 | 34 | || ( |
35 | - isset( $input_settings['include_whats_this_link'] ) |
|
35 | + isset($input_settings['include_whats_this_link']) |
|
36 | 36 | && $input_settings['include_whats_this_link'] === true |
37 | 37 | ) |
38 | 38 | ) { |
@@ -1,8 +1,8 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | namespace EventEspresso\shortcodes\espresso_events; |
3 | 3 | |
4 | -if ( ! defined( 'EVENT_ESPRESSO_VERSION' ) ) { |
|
5 | - exit( 'No direct script access allowed' ); |
|
4 | +if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
|
5 | + exit('No direct script access allowed'); |
|
6 | 6 | } |
7 | 7 | |
8 | 8 | |
@@ -42,16 +42,16 @@ discard block |
||
42 | 42 | * |
43 | 43 | * @param array $args |
44 | 44 | */ |
45 | - public function __construct( $args = array() ) { |
|
45 | + public function __construct($args = array()) { |
|
46 | 46 | // incoming args could be a mix of WP query args + EE shortcode args |
47 | - foreach ( $args as $key => $value ) { |
|
48 | - $property = '_' . $key; |
|
47 | + foreach ($args as $key => $value) { |
|
48 | + $property = '_'.$key; |
|
49 | 49 | // if the arg is a property of this class, then it's an EE shortcode arg |
50 | - if ( property_exists( $this, $property ) ) { |
|
50 | + if (property_exists($this, $property)) { |
|
51 | 51 | // set the property value |
52 | 52 | $this->{$property} = $value; |
53 | 53 | // then remove it from the array of args that will later be passed to WP_Query() |
54 | - unset( $args[ $key ] ); |
|
54 | + unset($args[$key]); |
|
55 | 55 | } |
56 | 56 | } |
57 | 57 | //add query filters |
@@ -67,20 +67,20 @@ discard block |
||
67 | 67 | // first off, let's remove any filters from previous queries |
68 | 68 | remove_filter( |
69 | 69 | 'FHEE__archive_espresso_events_template__upcoming_events_h1', |
70 | - array( $this, 'event_list_title' ) |
|
70 | + array($this, 'event_list_title') |
|
71 | 71 | ); |
72 | - remove_all_filters( 'FHEE__content_espresso_events__event_class' ); |
|
72 | + remove_all_filters('FHEE__content_espresso_events__event_class'); |
|
73 | 73 | // Event List Title ? |
74 | 74 | add_filter( |
75 | 75 | 'FHEE__archive_espresso_events_template__upcoming_events_h1', |
76 | - array( $this, 'event_list_title' ), |
|
76 | + array($this, 'event_list_title'), |
|
77 | 77 | 10, |
78 | 78 | 1 |
79 | 79 | ); |
80 | 80 | // add the css class |
81 | - add_filter( 'FHEE__content_espresso_events__event_class', array( $this, 'event_list_css' ), 10, 1 ); |
|
81 | + add_filter('FHEE__content_espresso_events__event_class', array($this, 'event_list_css'), 10, 1); |
|
82 | 82 | // the current "page" we are viewing |
83 | - $paged = max( 1, get_query_var( 'paged' ) ); |
|
83 | + $paged = max(1, get_query_var('paged')); |
|
84 | 84 | // Force these args |
85 | 85 | $args = array_merge( |
86 | 86 | $args, |
@@ -90,11 +90,11 @@ discard block |
||
90 | 90 | 'update_post_term_cache' => false, |
91 | 91 | 'update_post_meta_cache' => false, |
92 | 92 | 'paged' => $paged, |
93 | - 'offset' => ( $paged - 1 ) * $this->_limit |
|
93 | + 'offset' => ($paged - 1) * $this->_limit |
|
94 | 94 | ) |
95 | 95 | ); |
96 | 96 | // run the query |
97 | - parent::__construct( $args ); |
|
97 | + parent::__construct($args); |
|
98 | 98 | } |
99 | 99 | |
100 | 100 | |
@@ -106,8 +106,8 @@ discard block |
||
106 | 106 | * @param string $event_list_title |
107 | 107 | * @return string |
108 | 108 | */ |
109 | - public function event_list_title( $event_list_title = '' ) { |
|
110 | - if ( ! empty( $this->_title ) ) { |
|
109 | + public function event_list_title($event_list_title = '') { |
|
110 | + if ( ! empty($this->_title)) { |
|
111 | 111 | return $this->_title; |
112 | 112 | } |
113 | 113 | return $event_list_title; |
@@ -122,11 +122,11 @@ discard block |
||
122 | 122 | * @param string $event_list_css |
123 | 123 | * @return array |
124 | 124 | */ |
125 | - public function event_list_css( $event_list_css = '' ) { |
|
126 | - $event_list_css .= ! empty( $event_list_css ) ? ' ' : ''; |
|
127 | - $event_list_css .= ! empty( $this->_css_class ) ? $this->_css_class : ''; |
|
128 | - $event_list_css .= ! empty( $event_list_css ) ? ' ' : ''; |
|
129 | - $event_list_css .= ! empty( $this->_category_slug ) ? $this->_category_slug : ''; |
|
125 | + public function event_list_css($event_list_css = '') { |
|
126 | + $event_list_css .= ! empty($event_list_css) ? ' ' : ''; |
|
127 | + $event_list_css .= ! empty($this->_css_class) ? $this->_css_class : ''; |
|
128 | + $event_list_css .= ! empty($event_list_css) ? ' ' : ''; |
|
129 | + $event_list_css .= ! empty($this->_category_slug) ? $this->_category_slug : ''; |
|
130 | 130 | return $event_list_css; |
131 | 131 | } |
132 | 132 |
@@ -21,9 +21,12 @@ |
||
21 | 21 | <title><?php echo $title; ?></title> |
22 | 22 | <?php if ( $enqueue_wp_assets ) : ?> |
23 | 23 | <?php wp_head(); ?> |
24 | -<?php else : ?> |
|
24 | +<?php else { |
|
25 | + : ?> |
|
25 | 26 | <?php foreach ( $css as $url ) : ?> |
26 | - <link rel="stylesheet" type="text/css" href="<?php echo $url;?>"> |
|
27 | + <link rel="stylesheet" type="text/css" href="<?php echo $url; |
|
28 | +} |
|
29 | +?>"> |
|
27 | 30 | <?php endforeach; ?> |
28 | 31 | <script type="text/javascript"> |
29 | 32 | <?php echo $eei18n; ?> |
@@ -19,16 +19,16 @@ discard block |
||
19 | 19 | <html> |
20 | 20 | <head> |
21 | 21 | <title><?php echo $title; ?></title> |
22 | -<?php if ( $enqueue_wp_assets ) : ?> |
|
22 | +<?php if ($enqueue_wp_assets) : ?> |
|
23 | 23 | <?php wp_head(); ?> |
24 | 24 | <?php else : ?> |
25 | - <?php foreach ( $css as $url ) : ?> |
|
26 | - <link rel="stylesheet" type="text/css" href="<?php echo $url;?>"> |
|
25 | + <?php foreach ($css as $url) : ?> |
|
26 | + <link rel="stylesheet" type="text/css" href="<?php echo $url; ?>"> |
|
27 | 27 | <?php endforeach; ?> |
28 | 28 | <script type="text/javascript"> |
29 | 29 | <?php echo $eei18n; ?> |
30 | 30 | </script> |
31 | - <?php foreach ( $header_js as $url ) : ?> |
|
31 | + <?php foreach ($header_js as $url) : ?> |
|
32 | 32 | <script type="text/javascript" src="<?php echo $url; ?>"></script> |
33 | 33 | <?php endforeach; ?> |
34 | 34 | <?php endif; ?> |
@@ -38,10 +38,10 @@ discard block |
||
38 | 38 | <div style="padding: 1em;"> |
39 | 39 | <?php echo $content; ?> |
40 | 40 | </div> |
41 | - <?php foreach ( $footer_js as $url ) : ?> |
|
41 | + <?php foreach ($footer_js as $url) : ?> |
|
42 | 42 | <script type="text/javascript" src="<?php echo $url; ?>"></script> |
43 | 43 | <?php endforeach; ?> |
44 | -<?php if ( $enqueue_wp_assets ) : ?> |
|
44 | +<?php if ($enqueue_wp_assets) : ?> |
|
45 | 45 | <?php wp_footer(); ?> |
46 | 46 | <?php endif; ?> |
47 | 47 | </body> |