@@ -11,41 +11,41 @@ |
||
11 | 11 | class EE_Radio_Button_Display_Strategy extends EE_Compound_Input_Display_Strategy |
12 | 12 | { |
13 | 13 | |
14 | - /** |
|
15 | - * |
|
16 | - * @throws EE_Error |
|
17 | - * @return string of html to display the field |
|
18 | - */ |
|
19 | - public function display() |
|
20 | - { |
|
21 | - $input = $this->get_input(); |
|
22 | - $input->set_label_sizes(); |
|
23 | - $label_size_class = $input->get_label_size_class(); |
|
24 | - $html = ''; |
|
25 | - foreach ($input->options() as $value => $display_text) { |
|
26 | - $value = $input->get_normalization_strategy()->unnormalize($value); |
|
14 | + /** |
|
15 | + * |
|
16 | + * @throws EE_Error |
|
17 | + * @return string of html to display the field |
|
18 | + */ |
|
19 | + public function display() |
|
20 | + { |
|
21 | + $input = $this->get_input(); |
|
22 | + $input->set_label_sizes(); |
|
23 | + $label_size_class = $input->get_label_size_class(); |
|
24 | + $html = ''; |
|
25 | + foreach ($input->options() as $value => $display_text) { |
|
26 | + $value = $input->get_normalization_strategy()->unnormalize($value); |
|
27 | 27 | |
28 | - $html_id = $this->get_sub_input_id($value); |
|
29 | - $html .= EEH_HTML::nl(0, 'radio'); |
|
30 | - $html .= '<label for="' . $html_id . '"'; |
|
31 | - $html .= ' id="' . $html_id . '-lbl"'; |
|
32 | - $html .= ' class="ee-radio-label-after' . $label_size_class . '">'; |
|
33 | - $html .= EEH_HTML::nl(1, 'radio'); |
|
34 | - $html .= '<input id="' . $html_id . '"'; |
|
35 | - $html .= ' name="' . $input->html_name() . '"'; |
|
36 | - $html .= ' class="' . $input->html_class() . '"'; |
|
37 | - $html .= ' style="' . $input->html_style() . '"'; |
|
38 | - $html .= ' type="radio"'; |
|
39 | - $html .= ' value="' . esc_attr($value) . '"'; |
|
40 | - $html .= $input->raw_value() === $value ? ' checked="checked"' : ''; |
|
41 | - $html .= ' ' . $this->_input->other_html_attributes(); |
|
42 | - $html .= ' data-question_label="'. $input->html_label_id().'"'; |
|
43 | - $html .= '> '; |
|
44 | - $html .= $display_text; |
|
45 | - $html .= EEH_HTML::nl(-1, 'radio') . '</label>'; |
|
46 | - } |
|
47 | - $html .= EEH_HTML::div('', '', 'clear-float'); |
|
48 | - $html .= EEH_HTML::divx(); |
|
49 | - return $html; |
|
50 | - } |
|
28 | + $html_id = $this->get_sub_input_id($value); |
|
29 | + $html .= EEH_HTML::nl(0, 'radio'); |
|
30 | + $html .= '<label for="' . $html_id . '"'; |
|
31 | + $html .= ' id="' . $html_id . '-lbl"'; |
|
32 | + $html .= ' class="ee-radio-label-after' . $label_size_class . '">'; |
|
33 | + $html .= EEH_HTML::nl(1, 'radio'); |
|
34 | + $html .= '<input id="' . $html_id . '"'; |
|
35 | + $html .= ' name="' . $input->html_name() . '"'; |
|
36 | + $html .= ' class="' . $input->html_class() . '"'; |
|
37 | + $html .= ' style="' . $input->html_style() . '"'; |
|
38 | + $html .= ' type="radio"'; |
|
39 | + $html .= ' value="' . esc_attr($value) . '"'; |
|
40 | + $html .= $input->raw_value() === $value ? ' checked="checked"' : ''; |
|
41 | + $html .= ' ' . $this->_input->other_html_attributes(); |
|
42 | + $html .= ' data-question_label="'. $input->html_label_id().'"'; |
|
43 | + $html .= '> '; |
|
44 | + $html .= $display_text; |
|
45 | + $html .= EEH_HTML::nl(-1, 'radio') . '</label>'; |
|
46 | + } |
|
47 | + $html .= EEH_HTML::div('', '', 'clear-float'); |
|
48 | + $html .= EEH_HTML::divx(); |
|
49 | + return $html; |
|
50 | + } |
|
51 | 51 | } |
@@ -27,22 +27,22 @@ |
||
27 | 27 | |
28 | 28 | $html_id = $this->get_sub_input_id($value); |
29 | 29 | $html .= EEH_HTML::nl(0, 'radio'); |
30 | - $html .= '<label for="' . $html_id . '"'; |
|
31 | - $html .= ' id="' . $html_id . '-lbl"'; |
|
32 | - $html .= ' class="ee-radio-label-after' . $label_size_class . '">'; |
|
30 | + $html .= '<label for="'.$html_id.'"'; |
|
31 | + $html .= ' id="'.$html_id.'-lbl"'; |
|
32 | + $html .= ' class="ee-radio-label-after'.$label_size_class.'">'; |
|
33 | 33 | $html .= EEH_HTML::nl(1, 'radio'); |
34 | - $html .= '<input id="' . $html_id . '"'; |
|
35 | - $html .= ' name="' . $input->html_name() . '"'; |
|
36 | - $html .= ' class="' . $input->html_class() . '"'; |
|
37 | - $html .= ' style="' . $input->html_style() . '"'; |
|
34 | + $html .= '<input id="'.$html_id.'"'; |
|
35 | + $html .= ' name="'.$input->html_name().'"'; |
|
36 | + $html .= ' class="'.$input->html_class().'"'; |
|
37 | + $html .= ' style="'.$input->html_style().'"'; |
|
38 | 38 | $html .= ' type="radio"'; |
39 | - $html .= ' value="' . esc_attr($value) . '"'; |
|
39 | + $html .= ' value="'.esc_attr($value).'"'; |
|
40 | 40 | $html .= $input->raw_value() === $value ? ' checked="checked"' : ''; |
41 | - $html .= ' ' . $this->_input->other_html_attributes(); |
|
42 | - $html .= ' data-question_label="'. $input->html_label_id().'"'; |
|
41 | + $html .= ' '.$this->_input->other_html_attributes(); |
|
42 | + $html .= ' data-question_label="'.$input->html_label_id().'"'; |
|
43 | 43 | $html .= '> '; |
44 | 44 | $html .= $display_text; |
45 | - $html .= EEH_HTML::nl(-1, 'radio') . '</label>'; |
|
45 | + $html .= EEH_HTML::nl(-1, 'radio').'</label>'; |
|
46 | 46 | } |
47 | 47 | $html .= EEH_HTML::div('', '', 'clear-float'); |
48 | 48 | $html .= EEH_HTML::divx(); |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | $input->set_label_sizes(); |
23 | 23 | $label_size_class = $input->get_label_size_class(); |
24 | 24 | $html = ''; |
25 | - if (! is_array($input->raw_value()) && $input->raw_value() !== null) { |
|
25 | + if ( ! is_array($input->raw_value()) && $input->raw_value() !== null) { |
|
26 | 26 | EE_Error::doing_it_wrong( |
27 | 27 | 'EE_Checkbox_Display_Strategy::display()', |
28 | 28 | sprintf( |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | ), |
36 | 36 | $input->html_id(), |
37 | 37 | var_export($input->raw_value(), true), |
38 | - $input->html_name() . '[]' |
|
38 | + $input->html_name().'[]' |
|
39 | 39 | ), |
40 | 40 | '4.8.1' |
41 | 41 | ); |
@@ -54,19 +54,19 @@ discard block |
||
54 | 54 | . '">'; |
55 | 55 | $html .= EEH_HTML::nl(1, 'checkbox'); |
56 | 56 | $html .= '<input type="checkbox"'; |
57 | - $html .= ' name="' . $input->html_name() . '[]"'; |
|
58 | - $html .= ' id="' . $html_id . '"'; |
|
59 | - $html .= ' class="' . $input->html_class() . '"'; |
|
60 | - $html .= ' style="' . $input->html_style() . '"'; |
|
61 | - $html .= ' value="' . esc_attr($value) . '"'; |
|
57 | + $html .= ' name="'.$input->html_name().'[]"'; |
|
58 | + $html .= ' id="'.$html_id.'"'; |
|
59 | + $html .= ' class="'.$input->html_class().'"'; |
|
60 | + $html .= ' style="'.$input->html_style().'"'; |
|
61 | + $html .= ' value="'.esc_attr($value).'"'; |
|
62 | 62 | $html .= ! empty($input_raw_value) && in_array($value, $input_raw_value, true) |
63 | 63 | ? ' checked="checked"' |
64 | 64 | : ''; |
65 | - $html .= ' ' . $this->_input->other_html_attributes(); |
|
66 | - $html .= ' data-question_label="' . $input->html_label_id() . '"'; |
|
65 | + $html .= ' '.$this->_input->other_html_attributes(); |
|
66 | + $html .= ' data-question_label="'.$input->html_label_id().'"'; |
|
67 | 67 | $html .= '> '; |
68 | 68 | $html .= $display_text; |
69 | - $html .= EEH_HTML::nl(-1, 'checkbox') . '</label>'; |
|
69 | + $html .= EEH_HTML::nl(-1, 'checkbox').'</label>'; |
|
70 | 70 | } |
71 | 71 | return $html; |
72 | 72 | } |
@@ -12,60 +12,60 @@ |
||
12 | 12 | class EE_Checkbox_Display_Strategy extends EE_Compound_Input_Display_Strategy |
13 | 13 | { |
14 | 14 | |
15 | - /** |
|
16 | - * @throws EE_Error |
|
17 | - * @return string of html to display the field |
|
18 | - */ |
|
19 | - public function display() |
|
20 | - { |
|
21 | - $input = $this->get_input(); |
|
22 | - $input->set_label_sizes(); |
|
23 | - $label_size_class = $input->get_label_size_class(); |
|
24 | - $html = ''; |
|
25 | - if (! is_array($input->raw_value()) && $input->raw_value() !== null) { |
|
26 | - EE_Error::doing_it_wrong( |
|
27 | - 'EE_Checkbox_Display_Strategy::display()', |
|
28 | - sprintf( |
|
29 | - esc_html_x( |
|
30 | - 'Input values for checkboxes should be an array of values, but the value for input "%1$s" is "%2$s". Please verify that the input name is exactly "%3$s"', |
|
31 | - 'Input values for checkboxes should be an array of values, but the value for input "form-input-id" is "form-input-value". Please verify that the input name is exactly "form_input_name[]"', |
|
32 | - 'event_espresso' |
|
33 | - ), |
|
34 | - $input->html_id(), |
|
35 | - var_export($input->raw_value(), true), |
|
36 | - $input->html_name() . '[]' |
|
37 | - ), |
|
38 | - '4.8.1' |
|
39 | - ); |
|
40 | - } |
|
41 | - $input_raw_value = (array) $input->raw_value(); |
|
42 | - foreach ($input->options() as $value => $display_text) { |
|
43 | - $value = $input->get_normalization_strategy()->unnormalize_one($value); |
|
44 | - $html_id = $this->get_sub_input_id($value); |
|
45 | - $html .= EEH_HTML::nl(0, 'checkbox'); |
|
46 | - $html .= '<label for="' |
|
47 | - . $html_id |
|
48 | - . '" id="' |
|
49 | - . $html_id |
|
50 | - . '-lbl" class="ee-checkbox-label-after' |
|
51 | - . $label_size_class |
|
52 | - . '">'; |
|
53 | - $html .= EEH_HTML::nl(1, 'checkbox'); |
|
54 | - $html .= '<input type="checkbox"'; |
|
55 | - $html .= ' name="' . $input->html_name() . '[]"'; |
|
56 | - $html .= ' id="' . $html_id . '"'; |
|
57 | - $html .= ' class="' . $input->html_class() . '"'; |
|
58 | - $html .= ' style="' . $input->html_style() . '"'; |
|
59 | - $html .= ' value="' . esc_attr($value) . '"'; |
|
60 | - $html .= ! empty($input_raw_value) && in_array($value, $input_raw_value, true) |
|
61 | - ? ' checked="checked"' |
|
62 | - : ''; |
|
63 | - $html .= ' ' . $this->_input->other_html_attributes(); |
|
64 | - $html .= ' data-question_label="' . $input->html_label_id() . '"'; |
|
65 | - $html .= '> '; |
|
66 | - $html .= $display_text; |
|
67 | - $html .= EEH_HTML::nl(-1, 'checkbox') . '</label>'; |
|
68 | - } |
|
69 | - return $html; |
|
70 | - } |
|
15 | + /** |
|
16 | + * @throws EE_Error |
|
17 | + * @return string of html to display the field |
|
18 | + */ |
|
19 | + public function display() |
|
20 | + { |
|
21 | + $input = $this->get_input(); |
|
22 | + $input->set_label_sizes(); |
|
23 | + $label_size_class = $input->get_label_size_class(); |
|
24 | + $html = ''; |
|
25 | + if (! is_array($input->raw_value()) && $input->raw_value() !== null) { |
|
26 | + EE_Error::doing_it_wrong( |
|
27 | + 'EE_Checkbox_Display_Strategy::display()', |
|
28 | + sprintf( |
|
29 | + esc_html_x( |
|
30 | + 'Input values for checkboxes should be an array of values, but the value for input "%1$s" is "%2$s". Please verify that the input name is exactly "%3$s"', |
|
31 | + 'Input values for checkboxes should be an array of values, but the value for input "form-input-id" is "form-input-value". Please verify that the input name is exactly "form_input_name[]"', |
|
32 | + 'event_espresso' |
|
33 | + ), |
|
34 | + $input->html_id(), |
|
35 | + var_export($input->raw_value(), true), |
|
36 | + $input->html_name() . '[]' |
|
37 | + ), |
|
38 | + '4.8.1' |
|
39 | + ); |
|
40 | + } |
|
41 | + $input_raw_value = (array) $input->raw_value(); |
|
42 | + foreach ($input->options() as $value => $display_text) { |
|
43 | + $value = $input->get_normalization_strategy()->unnormalize_one($value); |
|
44 | + $html_id = $this->get_sub_input_id($value); |
|
45 | + $html .= EEH_HTML::nl(0, 'checkbox'); |
|
46 | + $html .= '<label for="' |
|
47 | + . $html_id |
|
48 | + . '" id="' |
|
49 | + . $html_id |
|
50 | + . '-lbl" class="ee-checkbox-label-after' |
|
51 | + . $label_size_class |
|
52 | + . '">'; |
|
53 | + $html .= EEH_HTML::nl(1, 'checkbox'); |
|
54 | + $html .= '<input type="checkbox"'; |
|
55 | + $html .= ' name="' . $input->html_name() . '[]"'; |
|
56 | + $html .= ' id="' . $html_id . '"'; |
|
57 | + $html .= ' class="' . $input->html_class() . '"'; |
|
58 | + $html .= ' style="' . $input->html_style() . '"'; |
|
59 | + $html .= ' value="' . esc_attr($value) . '"'; |
|
60 | + $html .= ! empty($input_raw_value) && in_array($value, $input_raw_value, true) |
|
61 | + ? ' checked="checked"' |
|
62 | + : ''; |
|
63 | + $html .= ' ' . $this->_input->other_html_attributes(); |
|
64 | + $html .= ' data-question_label="' . $input->html_label_id() . '"'; |
|
65 | + $html .= '> '; |
|
66 | + $html .= $display_text; |
|
67 | + $html .= EEH_HTML::nl(-1, 'checkbox') . '</label>'; |
|
68 | + } |
|
69 | + return $html; |
|
70 | + } |
|
71 | 71 | } |
@@ -38,103 +38,103 @@ |
||
38 | 38 | * @since 4.0 |
39 | 39 | */ |
40 | 40 | if (function_exists('espresso_version')) { |
41 | - if (! function_exists('espresso_duplicate_plugin_error')) { |
|
42 | - /** |
|
43 | - * espresso_duplicate_plugin_error |
|
44 | - * displays if more than one version of EE is activated at the same time |
|
45 | - */ |
|
46 | - function espresso_duplicate_plugin_error() |
|
47 | - { |
|
48 | - ?> |
|
41 | + if (! function_exists('espresso_duplicate_plugin_error')) { |
|
42 | + /** |
|
43 | + * espresso_duplicate_plugin_error |
|
44 | + * displays if more than one version of EE is activated at the same time |
|
45 | + */ |
|
46 | + function espresso_duplicate_plugin_error() |
|
47 | + { |
|
48 | + ?> |
|
49 | 49 | <div class="error"> |
50 | 50 | <p> |
51 | 51 | <?php |
52 | - echo esc_html__( |
|
53 | - 'Can not run multiple versions of Event Espresso! One version has been automatically deactivated. Please verify that you have the correct version you want still active.', |
|
54 | - 'event_espresso' |
|
55 | - ); ?> |
|
52 | + echo esc_html__( |
|
53 | + 'Can not run multiple versions of Event Espresso! One version has been automatically deactivated. Please verify that you have the correct version you want still active.', |
|
54 | + 'event_espresso' |
|
55 | + ); ?> |
|
56 | 56 | </p> |
57 | 57 | </div> |
58 | 58 | <?php |
59 | - espresso_deactivate_plugin(plugin_basename(__FILE__)); |
|
60 | - } |
|
61 | - } |
|
62 | - add_action('admin_notices', 'espresso_duplicate_plugin_error', 1); |
|
59 | + espresso_deactivate_plugin(plugin_basename(__FILE__)); |
|
60 | + } |
|
61 | + } |
|
62 | + add_action('admin_notices', 'espresso_duplicate_plugin_error', 1); |
|
63 | 63 | } else { |
64 | - define('EE_MIN_PHP_VER_REQUIRED', '5.4.0'); |
|
65 | - if (! version_compare(PHP_VERSION, EE_MIN_PHP_VER_REQUIRED, '>=')) { |
|
66 | - /** |
|
67 | - * espresso_minimum_php_version_error |
|
68 | - * |
|
69 | - * @return void |
|
70 | - */ |
|
71 | - function espresso_minimum_php_version_error() |
|
72 | - { |
|
73 | - ?> |
|
64 | + define('EE_MIN_PHP_VER_REQUIRED', '5.4.0'); |
|
65 | + if (! version_compare(PHP_VERSION, EE_MIN_PHP_VER_REQUIRED, '>=')) { |
|
66 | + /** |
|
67 | + * espresso_minimum_php_version_error |
|
68 | + * |
|
69 | + * @return void |
|
70 | + */ |
|
71 | + function espresso_minimum_php_version_error() |
|
72 | + { |
|
73 | + ?> |
|
74 | 74 | <div class="error"> |
75 | 75 | <p> |
76 | 76 | <?php |
77 | - printf( |
|
78 | - esc_html__( |
|
79 | - 'We\'re sorry, but Event Espresso requires PHP version %1$s or greater in order to operate. You are currently running version %2$s.%3$sIn order to update your version of PHP, you will need to contact your current hosting provider.%3$sFor information on stable PHP versions, please go to %4$s.', |
|
80 | - 'event_espresso' |
|
81 | - ), |
|
82 | - EE_MIN_PHP_VER_REQUIRED, |
|
83 | - PHP_VERSION, |
|
84 | - '<br/>', |
|
85 | - '<a href="http://php.net/downloads.php">http://php.net/downloads.php</a>' |
|
86 | - ); |
|
87 | - ?> |
|
77 | + printf( |
|
78 | + esc_html__( |
|
79 | + 'We\'re sorry, but Event Espresso requires PHP version %1$s or greater in order to operate. You are currently running version %2$s.%3$sIn order to update your version of PHP, you will need to contact your current hosting provider.%3$sFor information on stable PHP versions, please go to %4$s.', |
|
80 | + 'event_espresso' |
|
81 | + ), |
|
82 | + EE_MIN_PHP_VER_REQUIRED, |
|
83 | + PHP_VERSION, |
|
84 | + '<br/>', |
|
85 | + '<a href="http://php.net/downloads.php">http://php.net/downloads.php</a>' |
|
86 | + ); |
|
87 | + ?> |
|
88 | 88 | </p> |
89 | 89 | </div> |
90 | 90 | <?php |
91 | - espresso_deactivate_plugin(plugin_basename(__FILE__)); |
|
92 | - } |
|
91 | + espresso_deactivate_plugin(plugin_basename(__FILE__)); |
|
92 | + } |
|
93 | 93 | |
94 | - add_action('admin_notices', 'espresso_minimum_php_version_error', 1); |
|
95 | - } else { |
|
96 | - define('EVENT_ESPRESSO_MAIN_FILE', __FILE__); |
|
97 | - /** |
|
98 | - * espresso_version |
|
99 | - * Returns the plugin version |
|
100 | - * |
|
101 | - * @return string |
|
102 | - */ |
|
103 | - function espresso_version() |
|
104 | - { |
|
105 | - return apply_filters('FHEE__espresso__espresso_version', '4.9.62.rc.073'); |
|
106 | - } |
|
94 | + add_action('admin_notices', 'espresso_minimum_php_version_error', 1); |
|
95 | + } else { |
|
96 | + define('EVENT_ESPRESSO_MAIN_FILE', __FILE__); |
|
97 | + /** |
|
98 | + * espresso_version |
|
99 | + * Returns the plugin version |
|
100 | + * |
|
101 | + * @return string |
|
102 | + */ |
|
103 | + function espresso_version() |
|
104 | + { |
|
105 | + return apply_filters('FHEE__espresso__espresso_version', '4.9.62.rc.073'); |
|
106 | + } |
|
107 | 107 | |
108 | - /** |
|
109 | - * espresso_plugin_activation |
|
110 | - * adds a wp-option to indicate that EE has been activated via the WP admin plugins page |
|
111 | - */ |
|
112 | - function espresso_plugin_activation() |
|
113 | - { |
|
114 | - update_option('ee_espresso_activation', true); |
|
115 | - } |
|
108 | + /** |
|
109 | + * espresso_plugin_activation |
|
110 | + * adds a wp-option to indicate that EE has been activated via the WP admin plugins page |
|
111 | + */ |
|
112 | + function espresso_plugin_activation() |
|
113 | + { |
|
114 | + update_option('ee_espresso_activation', true); |
|
115 | + } |
|
116 | 116 | |
117 | - register_activation_hook(EVENT_ESPRESSO_MAIN_FILE, 'espresso_plugin_activation'); |
|
117 | + register_activation_hook(EVENT_ESPRESSO_MAIN_FILE, 'espresso_plugin_activation'); |
|
118 | 118 | |
119 | - require_once __DIR__ . '/core/bootstrap_espresso.php'; |
|
120 | - bootstrap_espresso(); |
|
121 | - } |
|
119 | + require_once __DIR__ . '/core/bootstrap_espresso.php'; |
|
120 | + bootstrap_espresso(); |
|
121 | + } |
|
122 | 122 | } |
123 | 123 | if (! function_exists('espresso_deactivate_plugin')) { |
124 | - /** |
|
125 | - * deactivate_plugin |
|
126 | - * usage: espresso_deactivate_plugin( plugin_basename( __FILE__ )); |
|
127 | - * |
|
128 | - * @access public |
|
129 | - * @param string $plugin_basename - the results of plugin_basename( __FILE__ ) for the plugin's main file |
|
130 | - * @return void |
|
131 | - */ |
|
132 | - function espresso_deactivate_plugin($plugin_basename = '') |
|
133 | - { |
|
134 | - if (! function_exists('deactivate_plugins')) { |
|
135 | - require_once ABSPATH . 'wp-admin/includes/plugin.php'; |
|
136 | - } |
|
137 | - unset($_GET['activate'], $_REQUEST['activate']); |
|
138 | - deactivate_plugins($plugin_basename); |
|
139 | - } |
|
124 | + /** |
|
125 | + * deactivate_plugin |
|
126 | + * usage: espresso_deactivate_plugin( plugin_basename( __FILE__ )); |
|
127 | + * |
|
128 | + * @access public |
|
129 | + * @param string $plugin_basename - the results of plugin_basename( __FILE__ ) for the plugin's main file |
|
130 | + * @return void |
|
131 | + */ |
|
132 | + function espresso_deactivate_plugin($plugin_basename = '') |
|
133 | + { |
|
134 | + if (! function_exists('deactivate_plugins')) { |
|
135 | + require_once ABSPATH . 'wp-admin/includes/plugin.php'; |
|
136 | + } |
|
137 | + unset($_GET['activate'], $_REQUEST['activate']); |
|
138 | + deactivate_plugins($plugin_basename); |
|
139 | + } |
|
140 | 140 | } |