@@ -8,15 +8,15 @@ |
||
8 | 8 | * |
9 | 9 | * This input has a default validation strategy of plaintext (which can be removed after construction) |
10 | 10 | */ |
11 | -class EE_Submit_Input extends EE_Form_Input_Base{ |
|
11 | +class EE_Submit_Input extends EE_Form_Input_Base { |
|
12 | 12 | |
13 | 13 | /** |
14 | 14 | * @param array $options |
15 | 15 | */ |
16 | - function __construct($options = array()){ |
|
16 | + function __construct($options = array()) { |
|
17 | 17 | $this->_set_display_strategy(new EE_Submit_Input_Display_Strategy()); |
18 | 18 | $this->_set_normalization_strategy(new EE_Text_Normalization()); |
19 | - $this->_add_validation_strategy( new EE_Plaintext_Validation_Strategy() ); |
|
19 | + $this->_add_validation_strategy(new EE_Plaintext_Validation_Strategy()); |
|
20 | 20 | parent::__construct($options); |
21 | 21 | } |
22 | 22 | } |
23 | 23 | \ No newline at end of file |
@@ -8,7 +8,7 @@ discard block |
||
8 | 8 | * |
9 | 9 | * This input has a default validation strategy of plaintext (which can be removed after construction) |
10 | 10 | */ |
11 | -class EE_Text_Area_Input extends EE_Form_Input_Base{ |
|
11 | +class EE_Text_Area_Input extends EE_Form_Input_Base { |
|
12 | 12 | |
13 | 13 | |
14 | 14 | protected $_rows = 2; |
@@ -18,28 +18,28 @@ discard block |
||
18 | 18 | * sets the rows property on this input |
19 | 19 | * @param int $rows |
20 | 20 | */ |
21 | - public function set_rows( $rows ) { |
|
21 | + public function set_rows($rows) { |
|
22 | 22 | $this->_rows = $rows; |
23 | 23 | } |
24 | 24 | /** |
25 | 25 | * sets the cols html property on this input |
26 | 26 | * @param int $cols |
27 | 27 | */ |
28 | - public function set_cols( $cols ) { |
|
28 | + public function set_cols($cols) { |
|
29 | 29 | $this->_cols = $cols; |
30 | 30 | } |
31 | 31 | /** |
32 | 32 | * |
33 | 33 | * @return int |
34 | 34 | */ |
35 | - public function get_rows(){ |
|
35 | + public function get_rows() { |
|
36 | 36 | return $this->_rows; |
37 | 37 | } |
38 | 38 | /** |
39 | 39 | * |
40 | 40 | * @return int |
41 | 41 | */ |
42 | - public function get_cols(){ |
|
42 | + public function get_cols() { |
|
43 | 43 | return $this->_cols; |
44 | 44 | } |
45 | 45 | |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | $this->_set_normalization_strategy(new EE_Text_Normalization()); |
54 | 54 | //by default we use the plaintext validation. If you want something else, |
55 | 55 | //just remove it after the input is constructed :P using EE_Form_Input_Base::remove_validation_strategy() |
56 | - $this->_add_validation_strategy( new EE_Plaintext_Validation_Strategy() ); |
|
56 | + $this->_add_validation_strategy(new EE_Plaintext_Validation_Strategy()); |
|
57 | 57 | parent::__construct($options_array); |
58 | 58 | } |
59 | 59 | } |
@@ -8,18 +8,18 @@ |
||
8 | 8 | * |
9 | 9 | * This input has a default validation strategy of plaintext (which can be removed after construction) |
10 | 10 | */ |
11 | -class EE_Text_Input extends EE_Form_Input_Base{ |
|
11 | +class EE_Text_Input extends EE_Form_Input_Base { |
|
12 | 12 | |
13 | 13 | |
14 | 14 | /** |
15 | 15 | * @param array $options |
16 | 16 | */ |
17 | - function __construct($options = array()){ |
|
17 | + function __construct($options = array()) { |
|
18 | 18 | $this->_set_display_strategy(new EE_Text_Input_Display_Strategy()); |
19 | 19 | $this->_set_normalization_strategy(new EE_Text_Normalization()); |
20 | 20 | //by default we use the plaintext validation. If you want something else, |
21 | 21 | //just remove it after the input is constructed :P using EE_Form_Input_Base::remove_validation_strategy() |
22 | - $this->_add_validation_strategy( new EE_Plaintext_Validation_Strategy() ); |
|
22 | + $this->_add_validation_strategy(new EE_Plaintext_Validation_Strategy()); |
|
23 | 23 | parent::__construct($options); |
24 | 24 | } |
25 | 25 |
@@ -1,5 +1,5 @@ discard block |
||
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 | /** |
@@ -24,18 +24,18 @@ discard block |
||
24 | 24 | * |
25 | 25 | * ------------------------------------------------------------------------ |
26 | 26 | */ |
27 | -class EE_Year_Input extends EE_Select_Input{ |
|
27 | +class EE_Year_Input extends EE_Select_Input { |
|
28 | 28 | |
29 | - function __construct( $input_settings = array(), $four_digit_year = true, $years_behind = 1, $years_ahead = 15 ){ |
|
30 | - if($four_digit_year){ |
|
29 | + function __construct($input_settings = array(), $four_digit_year = true, $years_behind = 1, $years_ahead = 15) { |
|
30 | + if ($four_digit_year) { |
|
31 | 31 | $current_year_int = intval(date('Y')); |
32 | - }else{ |
|
32 | + } else { |
|
33 | 33 | $current_year_int = intval(date('y')); |
34 | 34 | } |
35 | 35 | $answer_options = array(); |
36 | - for( $start = $current_year_int - $years_behind; $start <= ($current_year_int + $years_ahead); $start++){ |
|
36 | + for ($start = $current_year_int - $years_behind; $start <= ($current_year_int + $years_ahead); $start++) { |
|
37 | 37 | $answer_options[$start] = $start; |
38 | 38 | } |
39 | - parent::__construct( $answer_options, $input_settings ); |
|
39 | + parent::__construct($answer_options, $input_settings); |
|
40 | 40 | } |
41 | 41 | } |
@@ -1,7 +1,8 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -if (!defined('EVENT_ESPRESSO_VERSION')) |
|
3 | +if (!defined('EVENT_ESPRESSO_VERSION')) { |
|
4 | 4 | exit('No direct script access allowed'); |
5 | +} |
|
5 | 6 | |
6 | 7 | /** |
7 | 8 | * Event Espresso |
@@ -53,7 +54,7 @@ discard block |
||
53 | 54 | EEH_HTML::indent( 1, 'select' ); |
54 | 55 | if( EEH_Array::is_multi_dimensional_array( $this->_input->options() )){ |
55 | 56 | throw new EE_Error(sprintf(__("Select multiple display strategy does not allow for nested arrays of options.", "event_espresso"))); |
56 | - }else{ |
|
57 | + } else{ |
|
57 | 58 | $html.=$this->_display_options( $this->_input->options() ); |
58 | 59 | } |
59 | 60 |
@@ -6,14 +6,14 @@ |
||
6 | 6 | * @subpackage |
7 | 7 | * @author Mike Nelson |
8 | 8 | */ |
9 | -class EE_Yes_No_Input extends EE_Select_Input{ |
|
9 | +class EE_Yes_No_Input extends EE_Select_Input { |
|
10 | 10 | |
11 | 11 | /** |
12 | 12 | * @param array $options |
13 | 13 | */ |
14 | - function __construct( $options = array()){ |
|
15 | - $select_options = array(true=> __("Yes", "event_espresso"),false=> __("No", "event_espresso")); |
|
14 | + function __construct($options = array()) { |
|
15 | + $select_options = array(true=> __("Yes", "event_espresso"), false=> __("No", "event_espresso")); |
|
16 | 16 | |
17 | - parent::__construct($select_options,$options); |
|
17 | + parent::__construct($select_options, $options); |
|
18 | 18 | } |
19 | 19 | } |
@@ -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,7 +46,7 @@ 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(array( |
@@ -71,48 +71,48 @@ discard block |
||
71 | 71 | * @param \EE_Attendee $attendee - the attendee object to copy details to |
72 | 72 | * @return \EE_Attendee |
73 | 73 | */ |
74 | - public function copy_billing_form_data_to_attendee( EE_Attendee $attendee ){ |
|
74 | + public function copy_billing_form_data_to_attendee(EE_Attendee $attendee) { |
|
75 | 75 | // grab billing form data |
76 | 76 | $data = $this->valid_data(); |
77 | 77 | // copy first_name |
78 | - if ( ! empty( $data['first_name'] )) { |
|
79 | - $attendee->set_fname( $data['first_name'] ); |
|
78 | + if ( ! empty($data['first_name'])) { |
|
79 | + $attendee->set_fname($data['first_name']); |
|
80 | 80 | } |
81 | 81 | // copy last_name |
82 | - if ( ! empty( $data['last_name'] )) { |
|
83 | - $attendee->set_lname( $data['last_name'] ); |
|
82 | + if ( ! empty($data['last_name'])) { |
|
83 | + $attendee->set_lname($data['last_name']); |
|
84 | 84 | } |
85 | 85 | // copy email |
86 | - if ( ! empty( $data['email'] )) { |
|
87 | - $attendee->set_email( $data['email'] ); |
|
86 | + if ( ! empty($data['email'])) { |
|
87 | + $attendee->set_email($data['email']); |
|
88 | 88 | } |
89 | 89 | // copy address |
90 | - if ( ! empty( $data['address'] )) { |
|
91 | - $attendee->set_address( $data['address'] ); |
|
90 | + if ( ! empty($data['address'])) { |
|
91 | + $attendee->set_address($data['address']); |
|
92 | 92 | } |
93 | 93 | // copy address2 |
94 | - if ( ! empty( $data['address2'] )) { |
|
95 | - $attendee->set_address2( $data['address2'] ); |
|
94 | + if ( ! empty($data['address2'])) { |
|
95 | + $attendee->set_address2($data['address2']); |
|
96 | 96 | } |
97 | 97 | // copy city |
98 | - if ( ! empty( $data['city'] )) { |
|
99 | - $attendee->set_city( $data['city'] ); |
|
98 | + if ( ! empty($data['city'])) { |
|
99 | + $attendee->set_city($data['city']); |
|
100 | 100 | } |
101 | 101 | // copy state |
102 | - if ( ! empty( $data['state'] )) { |
|
103 | - $attendee->set_state( $data['state'] ); |
|
102 | + if ( ! empty($data['state'])) { |
|
103 | + $attendee->set_state($data['state']); |
|
104 | 104 | } |
105 | 105 | // copy country |
106 | - if ( ! empty( $data['country'] )) { |
|
107 | - $attendee->set_country( $data['country'] ); |
|
106 | + if ( ! empty($data['country'])) { |
|
107 | + $attendee->set_country($data['country']); |
|
108 | 108 | } |
109 | 109 | // copy zip |
110 | - if ( ! empty( $data['zip'] )) { |
|
111 | - $attendee->set_zip( $data['zip'] ); |
|
110 | + if ( ! empty($data['zip'])) { |
|
111 | + $attendee->set_zip($data['zip']); |
|
112 | 112 | } |
113 | 113 | // copy phone |
114 | - if ( ! empty( $data['phone'] )) { |
|
115 | - $attendee->set_phone( $data['phone'] ); |
|
114 | + if ( ! empty($data['phone'])) { |
|
115 | + $attendee->set_phone($data['phone']); |
|
116 | 116 | } |
117 | 117 | return $attendee; |
118 | 118 | } |
@@ -123,20 +123,20 @@ discard block |
||
123 | 123 | * uses info from the billing form to create a new attendee |
124 | 124 | * @return \EE_Attendee |
125 | 125 | */ |
126 | - public function create_attendee_from_billing_form_data(){ |
|
126 | + public function create_attendee_from_billing_form_data() { |
|
127 | 127 | // grab billing form data |
128 | 128 | $data = $this->valid_data(); |
129 | - return EE_Attendee::new_instance( array( |
|
130 | - 'ATT_fname' => ! empty( $data['first_name'] ) ? $data['first_name'] : '', |
|
131 | - 'ATT_lname' => ! empty( $data['last_name'] ) ? $data['last_name'] : '', |
|
132 | - 'ATT_email' => ! empty( $data['email'] ) ? $data['email'] : '', |
|
133 | - 'ATT_address' => ! empty( $data['address'] ) ? $data['address'] : '', |
|
134 | - 'ATT_address2' => ! empty( $data['address2'] ) ? $data['address2'] : '', |
|
135 | - 'ATT_city' => ! empty( $data['city'] ) ? $data['city'] : '', |
|
136 | - 'STA_ID' => ! empty( $data['state'] ) ? $data['state'] : '', |
|
137 | - 'CNT_ISO' => ! empty( $data['country'] ) ? $data['country'] : '', |
|
138 | - 'ATT_zip' => ! empty( $data['zip'] ) ? $data['zip'] : '', |
|
139 | - 'ATT_phone' => ! empty( $data['phone'] ) ? $data['phone'] : '', |
|
129 | + return EE_Attendee::new_instance(array( |
|
130 | + 'ATT_fname' => ! empty($data['first_name']) ? $data['first_name'] : '', |
|
131 | + 'ATT_lname' => ! empty($data['last_name']) ? $data['last_name'] : '', |
|
132 | + 'ATT_email' => ! empty($data['email']) ? $data['email'] : '', |
|
133 | + 'ATT_address' => ! empty($data['address']) ? $data['address'] : '', |
|
134 | + 'ATT_address2' => ! empty($data['address2']) ? $data['address2'] : '', |
|
135 | + 'ATT_city' => ! empty($data['city']) ? $data['city'] : '', |
|
136 | + 'STA_ID' => ! empty($data['state']) ? $data['state'] : '', |
|
137 | + 'CNT_ISO' => ! empty($data['country']) ? $data['country'] : '', |
|
138 | + 'ATT_zip' => ! empty($data['zip']) ? $data['zip'] : '', |
|
139 | + 'ATT_phone' => ! empty($data['phone']) ? $data['phone'] : '', |
|
140 | 140 | )); |
141 | 141 | } |
142 | 142 | } |
@@ -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 | * |
4 | 4 | * EE_Billing_Info_Form |
@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | * @author Mike Nelson |
12 | 12 | * |
13 | 13 | */ |
14 | -class EE_Billing_Info_Form extends EE_Form_Section_Proper{ |
|
14 | +class EE_Billing_Info_Form extends EE_Form_Section_Proper { |
|
15 | 15 | |
16 | 16 | /** |
17 | 17 | * The payment method this billing form is for |
@@ -26,10 +26,10 @@ discard block |
||
26 | 26 | * @param EE_Payment_Method $payment_method |
27 | 27 | * @param array $options_array @see EE_Form_Section_Proper::__construct() |
28 | 28 | */ |
29 | - public function __construct( EE_Payment_Method $payment_method, $options_array= array()){ |
|
29 | + public function __construct(EE_Payment_Method $payment_method, $options_array = array()) { |
|
30 | 30 | $this->_pm_instance = $payment_method; |
31 | 31 | $this->_layout_strategy = new EE_Div_Per_Section_Layout(); |
32 | - parent::__construct( $options_array ); |
|
32 | + parent::__construct($options_array); |
|
33 | 33 | |
34 | 34 | } |
35 | 35 | |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | * @param EE_Payment_Method $payment_method |
41 | 41 | * @return void |
42 | 42 | */ |
43 | - public function set_payment_method( EE_Payment_Method $payment_method ){ |
|
43 | + public function set_payment_method(EE_Payment_Method $payment_method) { |
|
44 | 44 | $this->_pm_instance = $payment_method; |
45 | 45 | } |
46 | 46 | |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | * Returns the instance of the payment method this billing form is for |
51 | 51 | * @return EE_Payment_Method |
52 | 52 | */ |
53 | - public function payment_method(){ |
|
53 | + public function payment_method() { |
|
54 | 54 | return $this->_pm_instance; |
55 | 55 | } |
56 | 56 | |
@@ -60,11 +60,11 @@ discard block |
||
60 | 60 | * payment_fields_autofilled_notice_html |
61 | 61 | * @return string |
62 | 62 | */ |
63 | - public function payment_fields_autofilled_notice_html(){ |
|
64 | - EE_Registry::instance()->load_helper( 'HTML' ); |
|
63 | + public function payment_fields_autofilled_notice_html() { |
|
64 | + EE_Registry::instance()->load_helper('HTML'); |
|
65 | 65 | return new EE_Form_Section_HTML( |
66 | 66 | EEH_HTML::p( |
67 | - apply_filters( 'FHEE__EE_Billing_Info_Form__payment_fields_autofilled_notice_html_text', __( 'Payment fields have been autofilled because you are in debug mode', 'event_espresso' )), |
|
67 | + apply_filters('FHEE__EE_Billing_Info_Form__payment_fields_autofilled_notice_html_text', __('Payment fields have been autofilled because you are in debug mode', 'event_espresso')), |
|
68 | 68 | '', |
69 | 69 | 'important-notice' |
70 | 70 | ) |
@@ -76,8 +76,8 @@ discard block |
||
76 | 76 | /** |
77 | 77 | * @return string |
78 | 78 | */ |
79 | - public function html_class(){ |
|
80 | - return ! empty( $this->_html_class ) ? $this->_html_class . ' ee-billing-form' : 'ee-billing-form'; |
|
79 | + public function html_class() { |
|
80 | + return ! empty($this->_html_class) ? $this->_html_class.' ee-billing-form' : 'ee-billing-form'; |
|
81 | 81 | } |
82 | 82 | |
83 | 83 |
@@ -3,14 +3,14 @@ discard block |
||
3 | 3 | * base class for all strategies which operate on form inputs. Generally, they |
4 | 4 | * all need to know about the form input they are operating on. |
5 | 5 | */ |
6 | -abstract class EE_Form_Input_Strategy_Base{ |
|
6 | +abstract class EE_Form_Input_Strategy_Base { |
|
7 | 7 | /** |
8 | 8 | * Form Input to display |
9 | 9 | * @var EE_Form_Input_Base |
10 | 10 | */ |
11 | 11 | protected $_input; |
12 | 12 | |
13 | - function __construct(){ |
|
13 | + function __construct() { |
|
14 | 14 | |
15 | 15 | } |
16 | 16 | |
@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | * The form input on which this strategy is to perform |
19 | 19 | * @param EE_Form_Input_Base $form_input |
20 | 20 | */ |
21 | - function _construct_finalize(EE_Form_Input_Base $form_input){ |
|
21 | + function _construct_finalize(EE_Form_Input_Base $form_input) { |
|
22 | 22 | $this->_input = $form_input; |
23 | 23 | } |
24 | 24 | } |
25 | 25 | \ No newline at end of file |
@@ -8,7 +8,7 @@ discard block |
||
8 | 8 | * @since 4.6 |
9 | 9 | * |
10 | 10 | */ |
11 | -class EE_Admin_File_Uploader_Display_Strategy extends EE_Display_Strategy_Base{ |
|
11 | +class EE_Admin_File_Uploader_Display_Strategy extends EE_Display_Strategy_Base { |
|
12 | 12 | |
13 | 13 | /** |
14 | 14 | * return EE_Admin_File_Uploader_Display_Strategy |
@@ -29,10 +29,10 @@ discard block |
||
29 | 29 | * Besides that, no special consideration should be required to make the media uploader appear, besides having |
30 | 30 | * this input displayed. |
31 | 31 | */ |
32 | - static function enqueue_scripts(){ |
|
32 | + static function enqueue_scripts() { |
|
33 | 33 | wp_enqueue_media(); |
34 | 34 | wp_enqueue_script('media-upload'); |
35 | - wp_enqueue_script('ee-payments',EE_GLOBAL_ASSETS_URL.'scripts/ee-media-uploader.js'); |
|
35 | + wp_enqueue_script('ee-payments', EE_GLOBAL_ASSETS_URL.'scripts/ee-media-uploader.js'); |
|
36 | 36 | } |
37 | 37 | |
38 | 38 | |
@@ -42,20 +42,20 @@ discard block |
||
42 | 42 | * @return string of html to display the field |
43 | 43 | */ |
44 | 44 | |
45 | - function display(){ |
|
45 | + function display() { |
|
46 | 46 | |
47 | - EE_Registry::instance()->load_helper( 'HTML' ); |
|
47 | + EE_Registry::instance()->load_helper('HTML'); |
|
48 | 48 | // the actual input |
49 | 49 | $input = '<input type="text" size="34" '; |
50 | - $input .= 'name="' . $this->_input->html_name() . '" '; |
|
51 | - $input .= $this->_input->html_class() != '' ? 'class="large-text ee_media_url ' . $this->_input->html_class() . '" ' : 'class="large-text ee_media_url" '; |
|
52 | - $input .= 'value="' . $this->_input->raw_value_in_form() . '">'; |
|
50 | + $input .= 'name="'.$this->_input->html_name().'" '; |
|
51 | + $input .= $this->_input->html_class() != '' ? 'class="large-text ee_media_url '.$this->_input->html_class().'" ' : 'class="large-text ee_media_url" '; |
|
52 | + $input .= 'value="'.$this->_input->raw_value_in_form().'">'; |
|
53 | 53 | // image uploader |
54 | - $uploader = EEH_HTML::link( '#', '<img src="' . admin_url( 'images/media-button-image.gif' ) . '" >', __( 'click to add an image', 'event_espresso' ), '', 'ee_media_upload' ); |
|
54 | + $uploader = EEH_HTML::link('#', '<img src="'.admin_url('images/media-button-image.gif').'" >', __('click to add an image', 'event_espresso'), '', 'ee_media_upload'); |
|
55 | 55 | //only attempt to show the image if it at least exists |
56 | - $image = $this->src_exists( $this->_input->raw_value() ) ? EEH_HTML::br(2) . EEH_HTML::img( $this->_input->raw_value(), __( 'logo', 'event_espresso' ), '', 'ee_media_image' ) : ''; |
|
56 | + $image = $this->src_exists($this->_input->raw_value()) ? EEH_HTML::br(2).EEH_HTML::img($this->_input->raw_value(), __('logo', 'event_espresso'), '', 'ee_media_image') : ''; |
|
57 | 57 | // html string |
58 | - return EEH_HTML::div( $input . EEH_HTML::nbsp() . $uploader . $image, '', 'ee_media_uploader_area' ); |
|
58 | + return EEH_HTML::div($input.EEH_HTML::nbsp().$uploader.$image, '', 'ee_media_uploader_area'); |
|
59 | 59 | } |
60 | 60 | |
61 | 61 | |
@@ -66,11 +66,11 @@ discard block |
||
66 | 66 | * @param string $src |
67 | 67 | * @return boolean |
68 | 68 | */ |
69 | - protected function src_exists( $src ){ |
|
70 | - $results = wp_remote_head( $src ); |
|
71 | - if( is_array( $results) && ! $results instanceof WP_Error){ |
|
72 | - return strpos($results['headers']['content-type'], "image" ) !== FALSE; |
|
73 | - }else{ |
|
69 | + protected function src_exists($src) { |
|
70 | + $results = wp_remote_head($src); |
|
71 | + if (is_array($results) && ! $results instanceof WP_Error) { |
|
72 | + return strpos($results['headers']['content-type'], "image") !== FALSE; |
|
73 | + } else { |
|
74 | 74 | return FALSE; |
75 | 75 | } |
76 | 76 | } |
@@ -90,7 +90,7 @@ |
||
90 | 90 | //so in case teh IPN is arriving later, let's try to process an IPN! |
91 | 91 | if($_SERVER['REQUEST_METHOD'] == 'POST'){ |
92 | 92 | return $this->handle_ipn($_POST, $transaction ); |
93 | - }else{ |
|
93 | + } else{ |
|
94 | 94 | return parent::finalize_payment_for( $transaction ); |
95 | 95 | } |
96 | 96 | } |