@@ -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 | /** |
@@ -9,7 +9,7 @@ discard block |
||
9 | 9 | * @subpackage |
10 | 10 | * @author Mike Nelson |
11 | 11 | */ |
12 | -class EE_Credit_Card_Year_Input extends EE_Year_Input{ |
|
12 | +class EE_Credit_Card_Year_Input extends EE_Year_Input { |
|
13 | 13 | |
14 | 14 | /** |
15 | 15 | * @param array $input_settings |
@@ -17,8 +17,8 @@ discard block |
||
17 | 17 | * @param int $years_behind |
18 | 18 | * @param int $years_ahead |
19 | 19 | */ |
20 | - function __construct( $input_settings = array(), $four_digit_year = true, $years_behind = 0, $years_ahead = 15 ){ |
|
21 | - $this->set_sensitive_data_removal_strategy( new EE_All_Sensitive_Data_Removal() ); |
|
22 | - parent::__construct( $input_settings, $four_digit_year, $years_behind, $years_ahead ); |
|
20 | + function __construct($input_settings = array(), $four_digit_year = true, $years_behind = 0, $years_ahead = 15) { |
|
21 | + $this->set_sensitive_data_removal_strategy(new EE_All_Sensitive_Data_Removal()); |
|
22 | + parent::__construct($input_settings, $four_digit_year, $years_behind, $years_ahead); |
|
23 | 23 | } |
24 | 24 | } |
@@ -1,6 +1,7 @@ |
||
1 | 1 | <?php |
2 | -if (!defined('EVENT_ESPRESSO_VERSION')) |
|
2 | +if (!defined('EVENT_ESPRESSO_VERSION')) { |
|
3 | 3 | exit('No direct script access allowed'); |
4 | +} |
|
4 | 5 | |
5 | 6 | /** |
6 | 7 | * EE_Credit_Card_Year_Input |
@@ -6,7 +6,7 @@ discard block |
||
6 | 6 | * @subpackage |
7 | 7 | * @author Brent Christensen |
8 | 8 | */ |
9 | -class EE_Fixed_Hidden_Input extends EE_Hidden_Input{ |
|
9 | +class EE_Fixed_Hidden_Input extends EE_Hidden_Input { |
|
10 | 10 | |
11 | 11 | |
12 | 12 | /** |
@@ -17,7 +17,7 @@ discard block |
||
17 | 17 | * @param array $req_data like $_POST |
18 | 18 | * @return boolean whether or not there was an error |
19 | 19 | */ |
20 | - protected function _normalize( $req_data ) { |
|
20 | + protected function _normalize($req_data) { |
|
21 | 21 | } |
22 | 22 | |
23 | 23 |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | } |
108 | 108 | if( $all_ints ){ |
109 | 109 | $normalization = new EE_Int_Normalization(); |
110 | - }else{ |
|
110 | + } else{ |
|
111 | 111 | $normalization = new EE_Text_Normalization(); |
112 | 112 | } |
113 | 113 | } |
@@ -258,7 +258,7 @@ discard block |
||
258 | 258 | foreach( $unnormalized_value_choices as $unnormalized_value_choice ){ |
259 | 259 | if( isset( $options[ $unnormalized_value_choice ] ) ){ |
260 | 260 | $pretty_strings[] = $options[ $unnormalized_value_choice ]; |
261 | - }else{ |
|
261 | + } else{ |
|
262 | 262 | $pretty_strings[] = $this->normalized_value(); |
263 | 263 | } |
264 | 264 | } |
@@ -7,7 +7,7 @@ discard block |
||
7 | 7 | * @subpackage |
8 | 8 | * @author Mike Nelson |
9 | 9 | */ |
10 | -class EE_Form_Input_With_Options_Base extends EE_Form_Input_Base{ |
|
10 | +class EE_Form_Input_With_Options_Base extends EE_Form_Input_Base { |
|
11 | 11 | |
12 | 12 | /** |
13 | 13 | * array of available options to choose as an answer |
@@ -57,29 +57,29 @@ discard block |
||
57 | 57 | * } |
58 | 58 | * And all the options accepted by EE_Form_Input_Base |
59 | 59 | */ |
60 | - public function __construct( $answer_options = array(), $input_settings = array() ) { |
|
61 | - if ( isset( $input_settings['label_size'] )) { |
|
62 | - $this->_set_label_size( $input_settings['label_size'] ); |
|
63 | - if ( isset( $input_settings['enforce_label_size'] ) && $input_settings['enforce_label_size'] ) { |
|
60 | + public function __construct($answer_options = array(), $input_settings = array()) { |
|
61 | + if (isset($input_settings['label_size'])) { |
|
62 | + $this->_set_label_size($input_settings['label_size']); |
|
63 | + if (isset($input_settings['enforce_label_size']) && $input_settings['enforce_label_size']) { |
|
64 | 64 | $this->_enforce_label_size = TRUE; |
65 | 65 | } |
66 | 66 | } |
67 | - if ( isset( $input_settings['display_html_label_text'] )) { |
|
68 | - $this->set_display_html_label_text( $input_settings['display_html_label_text'] ); |
|
67 | + if (isset($input_settings['display_html_label_text'])) { |
|
68 | + $this->set_display_html_label_text($input_settings['display_html_label_text']); |
|
69 | 69 | } |
70 | - $this->set_select_options( $answer_options ); |
|
70 | + $this->set_select_options($answer_options); |
|
71 | 71 | $this->_add_validation_strategy( |
72 | 72 | new EE_Many_Valued_Validation_Strategy( |
73 | 73 | array( |
74 | 74 | new EE_Enum_Validation_Strategy( |
75 | - isset( $input_settings[ 'validation_error_message' ] ) |
|
76 | - ? $input_settings[ 'validation_error_message' ] |
|
75 | + isset($input_settings['validation_error_message']) |
|
76 | + ? $input_settings['validation_error_message'] |
|
77 | 77 | : null |
78 | 78 | ) |
79 | 79 | ) |
80 | 80 | ) |
81 | 81 | ); |
82 | - parent::__construct( $input_settings ); |
|
82 | + parent::__construct($input_settings); |
|
83 | 83 | } |
84 | 84 | |
85 | 85 | |
@@ -90,47 +90,47 @@ discard block |
||
90 | 90 | * @param array $answer_options |
91 | 91 | * @return void just has the side-effect of setting the options for this input |
92 | 92 | */ |
93 | - public function set_select_options( $answer_options = array() ){ |
|
94 | - $answer_options = is_array( $answer_options ) ? $answer_options : array( $answer_options ); |
|
93 | + public function set_select_options($answer_options = array()) { |
|
94 | + $answer_options = is_array($answer_options) ? $answer_options : array($answer_options); |
|
95 | 95 | //get the first item in the select options and check it's type |
96 | - if ( reset( $answer_options ) instanceof EE_Question_Option ) { |
|
97 | - $this->_options = $this->_process_question_options( $answer_options ); |
|
96 | + if (reset($answer_options) instanceof EE_Question_Option) { |
|
97 | + $this->_options = $this->_process_question_options($answer_options); |
|
98 | 98 | } else { |
99 | 99 | $this->_options = $answer_options; |
100 | 100 | } |
101 | 101 | //d( $this->_options ); |
102 | - $select_option_keys = array_keys( $this->_options ); |
|
102 | + $select_option_keys = array_keys($this->_options); |
|
103 | 103 | // attempt to determine data type for values in order to set normalization type |
104 | 104 | if ( |
105 | - count( $this->_options ) == 2 |
|
105 | + count($this->_options) == 2 |
|
106 | 106 | && |
107 | 107 | ( |
108 | - ( in_array( TRUE, $select_option_keys, true ) && in_array( FALSE, $select_option_keys, true )) |
|
109 | - || ( in_array( 1, $select_option_keys, true ) && in_array( 0, $select_option_keys, true )) |
|
108 | + (in_array(TRUE, $select_option_keys, true) && in_array(FALSE, $select_option_keys, true)) |
|
109 | + || (in_array(1, $select_option_keys, true) && in_array(0, $select_option_keys, true)) |
|
110 | 110 | ) |
111 | - ){ |
|
111 | + ) { |
|
112 | 112 | // values appear to be boolean, like TRUE, FALSE, 1, 0 |
113 | 113 | $normalization = new EE_Boolean_Normalization(); |
114 | - } else{ |
|
114 | + } else { |
|
115 | 115 | //are ALL the options ints? If so use int validation |
116 | 116 | $all_ints = true; |
117 | - foreach($select_option_keys as $value ){ |
|
118 | - if( ! is_int( $value ) ){ |
|
117 | + foreach ($select_option_keys as $value) { |
|
118 | + if ( ! is_int($value)) { |
|
119 | 119 | $all_ints = false; |
120 | 120 | break; |
121 | 121 | } |
122 | 122 | } |
123 | - if( $all_ints ){ |
|
123 | + if ($all_ints) { |
|
124 | 124 | $normalization = new EE_Int_Normalization(); |
125 | - }else{ |
|
125 | + } else { |
|
126 | 126 | $normalization = new EE_Text_Normalization(); |
127 | 127 | } |
128 | 128 | } |
129 | 129 | // does input type have multiple options ? |
130 | - if ( $this->_multiple_selections ) { |
|
131 | - $this->_set_normalization_strategy( new EE_Many_Valued_Normalization( $normalization )); |
|
130 | + if ($this->_multiple_selections) { |
|
131 | + $this->_set_normalization_strategy(new EE_Many_Valued_Normalization($normalization)); |
|
132 | 132 | } else { |
133 | - $this->_set_normalization_strategy( $normalization ); |
|
133 | + $this->_set_normalization_strategy($normalization); |
|
134 | 134 | } |
135 | 135 | } |
136 | 136 | |
@@ -139,7 +139,7 @@ discard block |
||
139 | 139 | /** |
140 | 140 | * @return array |
141 | 141 | */ |
142 | - public function options(){ |
|
142 | + public function options() { |
|
143 | 143 | return $this->_options; |
144 | 144 | } |
145 | 145 | |
@@ -149,7 +149,7 @@ discard block |
||
149 | 149 | * Returns an array which is guaranteed to not be multidimensional |
150 | 150 | * @return array |
151 | 151 | */ |
152 | - public function flat_options(){ |
|
152 | + public function flat_options() { |
|
153 | 153 | return $this->_flatten_select_options($this->options()); |
154 | 154 | } |
155 | 155 | |
@@ -160,19 +160,19 @@ discard block |
||
160 | 160 | * @param array $arr |
161 | 161 | * @return array |
162 | 162 | */ |
163 | - protected function _flatten_select_options( $arr ){ |
|
163 | + protected function _flatten_select_options($arr) { |
|
164 | 164 | $flat_array = array(); |
165 | - if ( EEH_Array::is_multi_dimensional_array( $arr )) { |
|
166 | - foreach( $arr as $sub_array ){ |
|
167 | - foreach( $sub_array as $key => $value ) { |
|
168 | - $flat_array[ $key ] = $value; |
|
169 | - $this->_set_label_size( $value ); |
|
165 | + if (EEH_Array::is_multi_dimensional_array($arr)) { |
|
166 | + foreach ($arr as $sub_array) { |
|
167 | + foreach ($sub_array as $key => $value) { |
|
168 | + $flat_array[$key] = $value; |
|
169 | + $this->_set_label_size($value); |
|
170 | 170 | } |
171 | 171 | } |
172 | 172 | } else { |
173 | - foreach( $arr as $key => $value ) { |
|
174 | - $flat_array[ $key ] = $value; |
|
175 | - $this->_set_label_size( $value ); |
|
173 | + foreach ($arr as $key => $value) { |
|
174 | + $flat_array[$key] = $value; |
|
175 | + $this->_set_label_size($value); |
|
176 | 176 | } |
177 | 177 | } |
178 | 178 | return $flat_array; |
@@ -184,18 +184,18 @@ discard block |
||
184 | 184 | * @param EE_Question_Option[] $question_options_array |
185 | 185 | * @return array |
186 | 186 | */ |
187 | - protected function _process_question_options( $question_options_array = array() ) { |
|
187 | + protected function _process_question_options($question_options_array = array()) { |
|
188 | 188 | $flat_array = array(); |
189 | - foreach( $question_options_array as $question_option ) { |
|
190 | - if ( $question_option instanceof EE_Question_Option ) { |
|
189 | + foreach ($question_options_array as $question_option) { |
|
190 | + if ($question_option instanceof EE_Question_Option) { |
|
191 | 191 | $desc = ''; |
192 | - if ( $this->_use_desc_in_label ) { |
|
192 | + if ($this->_use_desc_in_label) { |
|
193 | 193 | $desc = $question_option->desc(); |
194 | - $desc = ! empty( $desc ) ? '<span class="ee-question-option-desc"> - ' . $desc . '</span>' : ''; |
|
194 | + $desc = ! empty($desc) ? '<span class="ee-question-option-desc"> - '.$desc.'</span>' : ''; |
|
195 | 195 | } |
196 | - $flat_array[ $question_option->value() ] = $question_option->value() . $desc; |
|
197 | - } elseif ( is_array( $question_option )) { |
|
198 | - $non_question_option = $this->_flatten_select_options( $question_option ); |
|
196 | + $flat_array[$question_option->value()] = $question_option->value().$desc; |
|
197 | + } elseif (is_array($question_option)) { |
|
198 | + $non_question_option = $this->_flatten_select_options($question_option); |
|
199 | 199 | $flat_array = $flat_array + $non_question_option; |
200 | 200 | } |
201 | 201 | } |
@@ -208,12 +208,12 @@ discard block |
||
208 | 208 | * set_label_sizes |
209 | 209 | * @return void |
210 | 210 | */ |
211 | - public function set_label_sizes(){ |
|
211 | + public function set_label_sizes() { |
|
212 | 212 | // did the input settings specifically say to NOT set the label size dynamically ? |
213 | - if ( ! $this->_enforce_label_size ) { |
|
214 | - foreach( $this->_options as $option ) { |
|
213 | + if ( ! $this->_enforce_label_size) { |
|
214 | + foreach ($this->_options as $option) { |
|
215 | 215 | // calculate the strlen of the label |
216 | - $this->_set_label_size( $option ); |
|
216 | + $this->_set_label_size($option); |
|
217 | 217 | } |
218 | 218 | } |
219 | 219 | } |
@@ -225,9 +225,9 @@ discard block |
||
225 | 225 | * @param int|string $value |
226 | 226 | * @return void |
227 | 227 | */ |
228 | - private function _set_label_size( $value = '' ){ |
|
228 | + private function _set_label_size($value = '') { |
|
229 | 229 | // determine length of option value |
230 | - $val_size = is_int( $value ) ? $value : strlen( $value ); |
|
230 | + $val_size = is_int($value) ? $value : strlen($value); |
|
231 | 231 | // use new value if bigger than existing |
232 | 232 | $this->_label_size = $val_size > $this->_label_size ? $val_size : $this->_label_size; |
233 | 233 | } |
@@ -238,22 +238,22 @@ discard block |
||
238 | 238 | * get_label_size_class |
239 | 239 | * @return string |
240 | 240 | */ |
241 | - function get_label_size_class(){ |
|
241 | + function get_label_size_class() { |
|
242 | 242 | // use maximum option value length to determine label size |
243 | - if( $this->_label_size < 3 ) { |
|
243 | + if ($this->_label_size < 3) { |
|
244 | 244 | $size = ' nano-lbl'; |
245 | - } else if ( $this->_label_size < 6 ) { |
|
246 | - $size = ' micro-lbl'; |
|
247 | - } else if ( $this->_label_size < 12 ) { |
|
248 | - $size = ' tiny-lbl'; |
|
249 | - } else if ( $this->_label_size < 25 ) { |
|
250 | - $size = ' small-lbl'; |
|
251 | - } else if ( $this->_label_size < 50 ) { |
|
252 | - $size = ' medium-lbl'; |
|
253 | - } else if ( $this->_label_size >= 100 ) { |
|
254 | - $size = ' big-lbl'; |
|
245 | + } else if ($this->_label_size < 6) { |
|
246 | + $size = ' micro-lbl'; |
|
247 | + } else if ($this->_label_size < 12) { |
|
248 | + $size = ' tiny-lbl'; |
|
249 | + } else if ($this->_label_size < 25) { |
|
250 | + $size = ' small-lbl'; |
|
251 | + } else if ($this->_label_size < 50) { |
|
252 | + $size = ' medium-lbl'; |
|
253 | + } else if ($this->_label_size >= 100) { |
|
254 | + $size = ' big-lbl'; |
|
255 | 255 | } else { |
256 | - $size = ' medium-lbl'; |
|
256 | + $size = ' medium-lbl'; |
|
257 | 257 | } |
258 | 258 | return $size; |
259 | 259 | } |
@@ -262,21 +262,21 @@ discard block |
||
262 | 262 | * Returns the pretty value for the normalized value |
263 | 263 | * @return string |
264 | 264 | */ |
265 | - function pretty_value(){ |
|
265 | + function pretty_value() { |
|
266 | 266 | $options = $this->flat_options(); |
267 | - $unnormalized_value_choices = $this->get_normalization_strategy()->unnormalize( $this->_normalized_value ); |
|
268 | - if( ! $this->_multiple_selections ){ |
|
269 | - $unnormalized_value_choices = array( $unnormalized_value_choices ); |
|
267 | + $unnormalized_value_choices = $this->get_normalization_strategy()->unnormalize($this->_normalized_value); |
|
268 | + if ( ! $this->_multiple_selections) { |
|
269 | + $unnormalized_value_choices = array($unnormalized_value_choices); |
|
270 | 270 | } |
271 | 271 | $pretty_strings = array(); |
272 | - foreach( $unnormalized_value_choices as $unnormalized_value_choice ){ |
|
273 | - if( isset( $options[ $unnormalized_value_choice ] ) ){ |
|
274 | - $pretty_strings[] = $options[ $unnormalized_value_choice ]; |
|
275 | - }else{ |
|
272 | + foreach ($unnormalized_value_choices as $unnormalized_value_choice) { |
|
273 | + if (isset($options[$unnormalized_value_choice])) { |
|
274 | + $pretty_strings[] = $options[$unnormalized_value_choice]; |
|
275 | + } else { |
|
276 | 276 | $pretty_strings[] = $this->normalized_value(); |
277 | 277 | } |
278 | 278 | } |
279 | - return implode(", ", $pretty_strings ); |
|
279 | + return implode(", ", $pretty_strings); |
|
280 | 280 | } |
281 | 281 | |
282 | 282 | |
@@ -293,8 +293,8 @@ discard block |
||
293 | 293 | /** |
294 | 294 | * @param boolean $display_html_label_text |
295 | 295 | */ |
296 | - public function set_display_html_label_text( $display_html_label_text ) { |
|
297 | - $this->_display_html_label_text = filter_var( $display_html_label_text, FILTER_VALIDATE_BOOLEAN ); |
|
296 | + public function set_display_html_label_text($display_html_label_text) { |
|
297 | + $this->_display_html_label_text = filter_var($display_html_label_text, FILTER_VALIDATE_BOOLEAN); |
|
298 | 298 | } |
299 | 299 | |
300 | 300 |
@@ -70,7 +70,7 @@ |
||
70 | 70 | $results = wp_remote_head( $src ); |
71 | 71 | if( is_array( $results) && ! $results instanceof WP_Error){ |
72 | 72 | return strpos($results['headers']['content-type'], "image" ) !== FALSE; |
73 | - }else{ |
|
73 | + } else{ |
|
74 | 74 | return FALSE; |
75 | 75 | } |
76 | 76 | } |
@@ -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 | * Its important this media only get enqueued AFTER init, but before the footer... where the |
@@ -20,11 +20,11 @@ discard block |
||
20 | 20 | * this input displayed. |
21 | 21 | * @deprecated. enqueue_js should be called automatically now |
22 | 22 | */ |
23 | - static function enqueue_scripts(){ |
|
24 | - EE_Error::doing_it_wrong( __FUNCTION__, __( 'EE_Admin_File_Uploader_Display_Strategy::enqueue_scripts() no longer needs to be called in order to display the admin uploader input correctly. This is handled now by EE_Admin_File_Uploader_Display_Strategy::enqueue_js() which is called automatically when enqueueing JS and CSS for the form'), '4.9.8.rc.015' ); |
|
23 | + static function enqueue_scripts() { |
|
24 | + EE_Error::doing_it_wrong(__FUNCTION__, __('EE_Admin_File_Uploader_Display_Strategy::enqueue_scripts() no longer needs to be called in order to display the admin uploader input correctly. This is handled now by EE_Admin_File_Uploader_Display_Strategy::enqueue_js() which is called automatically when enqueueing JS and CSS for the form'), '4.9.8.rc.015'); |
|
25 | 25 | wp_enqueue_media(); |
26 | 26 | wp_enqueue_script('media-upload'); |
27 | - wp_enqueue_script('ee-payments',EE_GLOBAL_ASSETS_URL.'scripts/ee-media-uploader.js'); |
|
27 | + wp_enqueue_script('ee-payments', EE_GLOBAL_ASSETS_URL.'scripts/ee-media-uploader.js'); |
|
28 | 28 | } |
29 | 29 | |
30 | 30 | /** |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | public function enqueue_js() { |
34 | 34 | wp_enqueue_media(); |
35 | 35 | wp_enqueue_script('media-upload'); |
36 | - wp_enqueue_script('ee-payments',EE_GLOBAL_ASSETS_URL.'scripts/ee-media-uploader.js'); |
|
36 | + wp_enqueue_script('ee-payments', EE_GLOBAL_ASSETS_URL.'scripts/ee-media-uploader.js'); |
|
37 | 37 | parent::enqueue_js(); |
38 | 38 | } |
39 | 39 | |
@@ -44,19 +44,19 @@ discard block |
||
44 | 44 | * @return string of html to display the field |
45 | 45 | */ |
46 | 46 | |
47 | - function display(){ |
|
47 | + function display() { |
|
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() . '" '; |
|
53 | - $input .= $this->_input->other_html_attributes() . '>'; |
|
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 | + $input .= $this->_input->other_html_attributes().'>'; |
|
54 | 54 | // image uploader |
55 | - $uploader = EEH_HTML::link( '#', '<img src="' . admin_url( 'images/media-button-image.gif' ) . '" >', __( 'click to add an image', 'event_espresso' ), '', 'ee_media_upload' ); |
|
55 | + $uploader = EEH_HTML::link('#', '<img src="'.admin_url('images/media-button-image.gif').'" >', __('click to add an image', 'event_espresso'), '', 'ee_media_upload'); |
|
56 | 56 | //only attempt to show the image if it at least exists |
57 | - $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 | + $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') : ''; |
|
58 | 58 | // html string |
59 | - return EEH_HTML::div( $input . EEH_HTML::nbsp() . $uploader . $image, '', 'ee_media_uploader_area' ); |
|
59 | + return EEH_HTML::div($input.EEH_HTML::nbsp().$uploader.$image, '', 'ee_media_uploader_area'); |
|
60 | 60 | } |
61 | 61 | |
62 | 62 | |
@@ -67,11 +67,11 @@ discard block |
||
67 | 67 | * @param string $src |
68 | 68 | * @return boolean |
69 | 69 | */ |
70 | - protected function src_exists( $src ){ |
|
71 | - $results = wp_remote_head( $src ); |
|
72 | - if( is_array( $results) && ! $results instanceof WP_Error){ |
|
73 | - return strpos($results['headers']['content-type'], "image" ) !== FALSE; |
|
74 | - }else{ |
|
70 | + protected function src_exists($src) { |
|
71 | + $results = wp_remote_head($src); |
|
72 | + if (is_array($results) && ! $results instanceof WP_Error) { |
|
73 | + return strpos($results['headers']['content-type'], "image") !== FALSE; |
|
74 | + } else { |
|
75 | 75 | return FALSE; |
76 | 76 | } |
77 | 77 | } |
@@ -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 |
@@ -1,6 +1,6 @@ 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 | /** |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | * |
26 | 26 | * ------------------------------------------------------------------------ |
27 | 27 | */ |
28 | -class EE_Select_Multiple_Display_Strategy extends EE_Select_Display_Strategy{ |
|
28 | +class EE_Select_Multiple_Display_Strategy extends EE_Select_Display_Strategy { |
|
29 | 29 | |
30 | 30 | /** |
31 | 31 | * |
@@ -34,30 +34,30 @@ discard block |
||
34 | 34 | */ |
35 | 35 | public function display() { |
36 | 36 | |
37 | - if( ! $this->_input instanceof EE_Form_Input_With_Options_Base){ |
|
37 | + if ( ! $this->_input instanceof EE_Form_Input_With_Options_Base) { |
|
38 | 38 | throw new EE_Error(sprintf(__('Cannot use Select Multiple Display Strategy with an input that doesn\'t have options', "event_espresso"))); |
39 | 39 | } |
40 | 40 | |
41 | - $html = EEH_HTML::nl( 0, 'select' ); |
|
41 | + $html = EEH_HTML::nl(0, 'select'); |
|
42 | 42 | $html .= '<select multiple'; |
43 | - $html .= ' id="' . $this->_input->html_id() . '"'; |
|
44 | - $html .= ' name="' . $this->_input->html_name() . '[]"'; |
|
45 | - $class = $this->_input->required() ? $this->_input->required_css_class() . ' ' . $this->_input->html_class() : $this->_input->html_class(); |
|
46 | - $html .= ' class="' . $class . '"'; |
|
43 | + $html .= ' id="'.$this->_input->html_id().'"'; |
|
44 | + $html .= ' name="'.$this->_input->html_name().'[]"'; |
|
45 | + $class = $this->_input->required() ? $this->_input->required_css_class().' '.$this->_input->html_class() : $this->_input->html_class(); |
|
46 | + $html .= ' class="'.$class.'"'; |
|
47 | 47 | // add html5 required |
48 | 48 | $html .= $this->_input->required() ? ' required' : ''; |
49 | - $html .= ' style="' . $this->_input->html_style() . '"'; |
|
50 | - $html .= ' ' . $this->_input->other_html_attributes(); |
|
49 | + $html .= ' style="'.$this->_input->html_style().'"'; |
|
50 | + $html .= ' '.$this->_input->other_html_attributes(); |
|
51 | 51 | $html .= '>'; |
52 | 52 | |
53 | - EEH_HTML::indent( 1, 'select' ); |
|
54 | - if( EEH_Array::is_multi_dimensional_array( $this->_input->options() )){ |
|
53 | + EEH_HTML::indent(1, 'select'); |
|
54 | + if (EEH_Array::is_multi_dimensional_array($this->_input->options())) { |
|
55 | 55 | throw new EE_Error(sprintf(__("Select multiple display strategy does not allow for nested arrays of options.", "event_espresso"))); |
56 | - }else{ |
|
57 | - $html.=$this->_display_options( $this->_input->options() ); |
|
56 | + } else { |
|
57 | + $html .= $this->_display_options($this->_input->options()); |
|
58 | 58 | } |
59 | 59 | |
60 | - $html.= EEH_HTML::nl( -1, 'select' ) . "</select>"; |
|
60 | + $html .= EEH_HTML::nl( -1, 'select' )."</select>"; |
|
61 | 61 | return $html; |
62 | 62 | } |
63 | 63 | |
@@ -68,12 +68,12 @@ discard block |
||
68 | 68 | * @param string|int $value unnormalized value option (string) |
69 | 69 | * @return boolean |
70 | 70 | */ |
71 | - protected function _check_if_option_selected( $value ){ |
|
71 | + protected function _check_if_option_selected($value) { |
|
72 | 72 | $selected_options = $this->_input->raw_value(); |
73 | - if ( empty( $selected_options )){ |
|
73 | + if (empty($selected_options)) { |
|
74 | 74 | return FALSE; |
75 | 75 | } |
76 | - return in_array( $value, $selected_options ) ? TRUE : FALSE; |
|
76 | + return in_array($value, $selected_options) ? TRUE : FALSE; |
|
77 | 77 | } |
78 | 78 | |
79 | 79 |
@@ -10,7 +10,7 @@ |
||
10 | 10 | if( $input instanceof EE_Text_Area_Input ) { |
11 | 11 | $rows = $input->get_rows(); |
12 | 12 | $cols = $input->get_cols(); |
13 | - }else{ |
|
13 | + } else{ |
|
14 | 14 | $rows = 4; |
15 | 15 | $cols = 20; |
16 | 16 | } |
@@ -4,9 +4,9 @@ |
||
4 | 4 | |
5 | 5 | |
6 | 6 | /** |
7 | - * |
|
8 | - * @return string of html to display the field |
|
9 | - */ |
|
7 | + * |
|
8 | + * @return string of html to display the field |
|
9 | + */ |
|
10 | 10 | function display(){ |
11 | 11 | $input = $this->_input; |
12 | 12 | $raw_value = maybe_serialize($input->raw_value()); |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -class EE_Text_Area_Display_Strategy extends EE_Display_Strategy_Base{ |
|
2 | +class EE_Text_Area_Display_Strategy extends EE_Display_Strategy_Base { |
|
3 | 3 | |
4 | 4 | |
5 | 5 | |
@@ -7,32 +7,32 @@ discard block |
||
7 | 7 | * |
8 | 8 | * @return string of html to display the field |
9 | 9 | */ |
10 | - function display(){ |
|
10 | + function display() { |
|
11 | 11 | $input = $this->_input; |
12 | 12 | $raw_value = maybe_serialize($input->raw_value()); |
13 | - if( $input instanceof EE_Text_Area_Input ) { |
|
13 | + if ($input instanceof EE_Text_Area_Input) { |
|
14 | 14 | $rows = $input->get_rows(); |
15 | 15 | $cols = $input->get_cols(); |
16 | - }else{ |
|
16 | + } else { |
|
17 | 17 | $rows = 4; |
18 | 18 | $cols = 20; |
19 | 19 | } |
20 | 20 | $html = '<textarea'; |
21 | - $html .= ' id="' . $input->html_id() . '"'; |
|
22 | - $html .= ' name="' . $input->html_name() . '"'; |
|
23 | - $html .= ' class="' . $input->html_class() . '"' ; |
|
24 | - $html .= ' style="' . $input->html_style() . '"'; |
|
21 | + $html .= ' id="'.$input->html_id().'"'; |
|
22 | + $html .= ' name="'.$input->html_name().'"'; |
|
23 | + $html .= ' class="'.$input->html_class().'"'; |
|
24 | + $html .= ' style="'.$input->html_style().'"'; |
|
25 | 25 | $html .= $input->other_html_attributes(); |
26 | - $html .= ' rows= "' . $rows . '" cols="' . $cols . '">'; |
|
26 | + $html .= ' rows= "'.$rows.'" cols="'.$cols.'">'; |
|
27 | 27 | $html .= $raw_value; |
28 | 28 | $html .= '</textarea>'; |
29 | - foreach ( $this->_input->get_validation_strategies() as $validation_strategy ) { |
|
29 | + foreach ($this->_input->get_validation_strategies() as $validation_strategy) { |
|
30 | 30 | if ( |
31 | 31 | $validation_strategy instanceof EE_Simple_HTML_Validation_Strategy |
32 | 32 | || $validation_strategy instanceof EE_Full_HTML_Validation_Strategy |
33 | 33 | ) { |
34 | 34 | $html .= sprintf( |
35 | - __( '%1$s(allowed tags: %2$s)%3$s', 'event_espresso' ), |
|
35 | + __('%1$s(allowed tags: %2$s)%3$s', 'event_espresso'), |
|
36 | 36 | '<p class="ee-question-desc">', |
37 | 37 | $validation_strategy->get_list_of_allowed_tags(), |
38 | 38 | '</p>' |
@@ -1,16 +1,16 @@ |
||
1 | 1 | <?php if ( ! defined('EVENT_ESPRESSO_VERSION')) { exit('No direct script access allowed'); } |
2 | 2 | /** |
3 | - * |
|
4 | - * Class EE_Fieldset_Section_Layout |
|
5 | - * |
|
6 | - * Description |
|
7 | - * |
|
8 | - * @package Event Espresso |
|
9 | - * @subpackage core |
|
10 | - * @author Brent Christensen |
|
11 | - * @since $VID:$ |
|
12 | - * |
|
13 | - */ |
|
3 | + * |
|
4 | + * Class EE_Fieldset_Section_Layout |
|
5 | + * |
|
6 | + * Description |
|
7 | + * |
|
8 | + * @package Event Espresso |
|
9 | + * @subpackage core |
|
10 | + * @author Brent Christensen |
|
11 | + * @since $VID:$ |
|
12 | + * |
|
13 | + */ |
|
14 | 14 | class EE_Fieldset_Section_Layout extends EE_Div_Per_Section_Layout{ |
15 | 15 | |
16 | 16 | /** |
@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | * @since $VID:$ |
12 | 12 | * |
13 | 13 | */ |
14 | -class EE_Fieldset_Section_Layout extends EE_Div_Per_Section_Layout{ |
|
14 | +class EE_Fieldset_Section_Layout extends EE_Div_Per_Section_Layout { |
|
15 | 15 | |
16 | 16 | /** |
17 | 17 | * legend_class |
@@ -32,10 +32,10 @@ discard block |
||
32 | 32 | * |
33 | 33 | * @param array $options |
34 | 34 | */ |
35 | - function __construct( $options = array() ){ |
|
36 | - foreach( $options as $key => $value ) { |
|
37 | - $key = '_' . $key; |
|
38 | - if ( property_exists( $this, $key )) { |
|
35 | + function __construct($options = array()) { |
|
36 | + foreach ($options as $key => $value) { |
|
37 | + $key = '_'.$key; |
|
38 | + if (property_exists($this, $key)) { |
|
39 | 39 | $this->{$key} = $value; |
40 | 40 | } |
41 | 41 | } |
@@ -47,8 +47,8 @@ discard block |
||
47 | 47 | * @return string |
48 | 48 | */ |
49 | 49 | public function layout_form_begin() { |
50 | - $html = EEH_HTML::nl(1) . '<fieldset id="' . $this->_form_section->html_id() . '" class="' . $this->_form_section->html_class() . '" style="' . $this->_form_section->html_style() . '">'; |
|
51 | - $html .= '<legend class="' . $this->legend_class() . '">' . $this->legend_text() . '</legend>'; |
|
50 | + $html = EEH_HTML::nl(1).'<fieldset id="'.$this->_form_section->html_id().'" class="'.$this->_form_section->html_class().'" style="'.$this->_form_section->html_style().'">'; |
|
51 | + $html .= '<legend class="'.$this->legend_class().'">'.$this->legend_text().'</legend>'; |
|
52 | 52 | return $html; |
53 | 53 | } |
54 | 54 | |
@@ -58,8 +58,8 @@ discard block |
||
58 | 58 | * closing div tag for a form |
59 | 59 | * @return string |
60 | 60 | */ |
61 | - public function layout_form_end(){ |
|
62 | - return EEH_HTML::nl(-1) . '</fieldset>'; |
|
61 | + public function layout_form_end() { |
|
62 | + return EEH_HTML::nl(-1).'</fieldset>'; |
|
63 | 63 | } |
64 | 64 | |
65 | 65 | |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | /** |
68 | 68 | * @param string $legend_class |
69 | 69 | */ |
70 | - public function set_legend_class( $legend_class ) { |
|
70 | + public function set_legend_class($legend_class) { |
|
71 | 71 | $this->_legend_class = $legend_class; |
72 | 72 | } |
73 | 73 | |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | /** |
86 | 86 | * @param string $legend_text |
87 | 87 | */ |
88 | - public function set_legend_text( $legend_text ) { |
|
88 | + public function set_legend_text($legend_text) { |
|
89 | 89 | $this->_legend_text = $legend_text; |
90 | 90 | } |
91 | 91 |
@@ -8,7 +8,7 @@ discard block |
||
8 | 8 | * @subpackage |
9 | 9 | * @author Mike Nelson |
10 | 10 | */ |
11 | -class EE_All_Caps_Normalization extends EE_Normalization_Strategy_Base{ |
|
11 | +class EE_All_Caps_Normalization extends EE_Normalization_Strategy_Base { |
|
12 | 12 | |
13 | 13 | /** |
14 | 14 | * @param string $value_to_normalize |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | * @param string $normalized_value |
25 | 25 | * @return string |
26 | 26 | */ |
27 | - public function unnormalize( $normalized_value ) { |
|
27 | + public function unnormalize($normalized_value) { |
|
28 | 28 | return $normalized_value; |
29 | 29 | } |
30 | 30 |
@@ -10,14 +10,14 @@ discard block |
||
10 | 10 | * @subpackage |
11 | 11 | * @author Mike Nelson |
12 | 12 | */ |
13 | -class EE_Boolean_Normalization extends EE_Normalization_Strategy_Base{ |
|
13 | +class EE_Boolean_Normalization extends EE_Normalization_Strategy_Base { |
|
14 | 14 | |
15 | 15 | /** |
16 | 16 | * @param string | int | bool $value_to_normalize |
17 | 17 | * @return boolean |
18 | 18 | */ |
19 | - public function normalize( $value_to_normalize ) { |
|
20 | - return filter_var( $value_to_normalize, FILTER_VALIDATE_BOOLEAN ); |
|
19 | + public function normalize($value_to_normalize) { |
|
20 | + return filter_var($value_to_normalize, FILTER_VALIDATE_BOOLEAN); |
|
21 | 21 | } |
22 | 22 | |
23 | 23 | |
@@ -27,10 +27,10 @@ discard block |
||
27 | 27 | * @param boolean $normalized_value |
28 | 28 | * @return string |
29 | 29 | */ |
30 | - public function unnormalize( $normalized_value ) { |
|
31 | - if( $normalized_value ){ |
|
30 | + public function unnormalize($normalized_value) { |
|
31 | + if ($normalized_value) { |
|
32 | 32 | return '1'; |
33 | - }else{ |
|
33 | + } else { |
|
34 | 34 | return '0'; |
35 | 35 | } |
36 | 36 | } |
@@ -30,7 +30,7 @@ |
||
30 | 30 | public function unnormalize( $normalized_value ) { |
31 | 31 | if( $normalized_value ){ |
32 | 32 | return '1'; |
33 | - }else{ |
|
33 | + } else{ |
|
34 | 34 | return '0'; |
35 | 35 | } |
36 | 36 | } |