@@ -4,9 +4,9 @@ |
||
4 | 4 | </ul> |
5 | 5 | <div id="espresso_event_type-all" class="tabs-panel"> |
6 | 6 | <?php |
7 | - $name = 'tax_input[espresso_event_type]'; |
|
8 | - echo "<input type='hidden' name='{$name}[]' value='0' />"; // Allows for an empty term set to be sent. 0 is an invalid Term ID and will be ignored by empty() checks. |
|
9 | - ?> |
|
7 | + $name = 'tax_input[espresso_event_type]'; |
|
8 | + echo "<input type='hidden' name='{$name}[]' value='0' />"; // Allows for an empty term set to be sent. 0 is an invalid Term ID and will be ignored by empty() checks. |
|
9 | + ?> |
|
10 | 10 | <ul id="espresso_event_typechecklist" data-wp-lists="list:espresso_event_type" class="categorychecklist form-no-clear"> |
11 | 11 | <?php echo $radio_list; ?> |
12 | 12 | </ul> |
@@ -9,8 +9,8 @@ |
||
9 | 9 | /** @var string $after_list_table */ |
10 | 10 | ?> |
11 | 11 | <?php echo $before_list_table; ?> |
12 | -<form id="<?php echo $list_table_class; ?>-table-frm" action="<?php echo $table_url;?>" method="get"> |
|
13 | - <?php $list_table->search_box( $search['btn_label'], $current_page ); ?><br /> |
|
12 | +<form id="<?php echo $list_table_class; ?>-table-frm" action="<?php echo $table_url; ?>" method="get"> |
|
13 | + <?php $list_table->search_box($search['btn_label'], $current_page); ?><br /> |
|
14 | 14 | <?php echo $sortable_list_table_form_fields; ?> |
15 | 15 | <?php $list_table->display_views(); ?> |
16 | 16 | <?php $list_table->display(); ?> |
@@ -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 | * Class EE_Select_Input |
4 | 4 | * |
@@ -10,22 +10,22 @@ discard block |
||
10 | 10 | * @since 4.6 |
11 | 11 | * |
12 | 12 | */ |
13 | -class EE_Select_Input extends EE_Form_Input_With_Options_Base{ |
|
13 | +class EE_Select_Input extends EE_Form_Input_With_Options_Base { |
|
14 | 14 | |
15 | 15 | /** |
16 | 16 | * @param array $answer_options |
17 | 17 | * @param array $input_settings |
18 | 18 | */ |
19 | - public function __construct( $answer_options, $input_settings = array() ) { |
|
20 | - $this->_set_display_strategy( new EE_Select_Display_Strategy( $answer_options ) ); |
|
19 | + public function __construct($answer_options, $input_settings = array()) { |
|
20 | + $this->_set_display_strategy(new EE_Select_Display_Strategy($answer_options)); |
|
21 | 21 | $this->_add_validation_strategy( |
22 | 22 | new EE_Enum_Validation_Strategy( |
23 | - isset( $input_settings['validation_error_message'] ) |
|
23 | + isset($input_settings['validation_error_message']) |
|
24 | 24 | ? $input_settings['validation_error_message'] |
25 | 25 | : null |
26 | 26 | ) |
27 | 27 | ); |
28 | - parent::__construct( $answer_options, $input_settings ); |
|
28 | + parent::__construct($answer_options, $input_settings); |
|
29 | 29 | } |
30 | 30 | |
31 | 31 | } |
32 | 32 | \ No newline at end of file |
@@ -8,18 +8,18 @@ discard block |
||
8 | 8 | * @since 4.6 |
9 | 9 | * |
10 | 10 | */ |
11 | -class EE_Required_Validation_Strategy extends EE_Validation_Strategy_Base{ |
|
11 | +class EE_Required_Validation_Strategy extends EE_Validation_Strategy_Base { |
|
12 | 12 | |
13 | 13 | |
14 | 14 | |
15 | 15 | /** |
16 | 16 | * @param string $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 | $validation_error_message = __("This field is required.", "event_espresso"); |
21 | 21 | } |
22 | - parent::__construct( $validation_error_message ); |
|
22 | + parent::__construct($validation_error_message); |
|
23 | 23 | } |
24 | 24 | |
25 | 25 | |
@@ -34,13 +34,13 @@ discard block |
||
34 | 34 | * @throws \EE_Validation_Error |
35 | 35 | */ |
36 | 36 | public function validate($normalized_value) { |
37 | - if( |
|
37 | + if ( |
|
38 | 38 | $normalized_value === '' |
39 | 39 | || $normalized_value === null |
40 | 40 | || $normalized_value === array() |
41 | 41 | ) { |
42 | - throw new EE_Validation_Error( $this->get_validation_error_message(), 'required'); |
|
43 | - }else{ |
|
42 | + throw new EE_Validation_Error($this->get_validation_error_message(), 'required'); |
|
43 | + } else { |
|
44 | 44 | return true; |
45 | 45 | } |
46 | 46 | } |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | * @return array |
52 | 52 | * @throws \EE_Error |
53 | 53 | */ |
54 | - public function get_jquery_validation_rule_array(){ |
|
54 | + public function get_jquery_validation_rule_array() { |
|
55 | 55 | return array( |
56 | 56 | 'required'=> true, |
57 | 57 | 'messages' => array( |
@@ -40,7 +40,7 @@ |
||
40 | 40 | || $normalized_value === array() |
41 | 41 | ) { |
42 | 42 | throw new EE_Validation_Error( $this->get_validation_error_message(), 'required'); |
43 | - }else{ |
|
43 | + } else{ |
|
44 | 44 | return true; |
45 | 45 | } |
46 | 46 | } |
@@ -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; ?> |
@@ -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 |
@@ -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 | ) { |