@@ -9,21 +9,21 @@ |
||
9 | 9 | class EE_Email_Input extends EE_Form_Input_Base |
10 | 10 | { |
11 | 11 | |
12 | - /** |
|
13 | - * @param array $input_settings |
|
14 | - */ |
|
15 | - public function __construct($input_settings = array()) |
|
16 | - { |
|
17 | - $this->_set_display_strategy(new EE_Text_Input_Display_Strategy('email')); |
|
18 | - $this->_set_normalization_strategy(new EE_Text_Normalization()); |
|
19 | - $this->_add_validation_strategy( |
|
20 | - new EE_Email_Validation_Strategy( |
|
21 | - isset($input_settings['validation_error_message']) |
|
22 | - ? $input_settings['validation_error_message'] |
|
23 | - : null |
|
24 | - ) |
|
25 | - ); |
|
26 | - parent::__construct($input_settings); |
|
27 | - $this->set_html_class($this->html_class() . ' email'); |
|
28 | - } |
|
12 | + /** |
|
13 | + * @param array $input_settings |
|
14 | + */ |
|
15 | + public function __construct($input_settings = array()) |
|
16 | + { |
|
17 | + $this->_set_display_strategy(new EE_Text_Input_Display_Strategy('email')); |
|
18 | + $this->_set_normalization_strategy(new EE_Text_Normalization()); |
|
19 | + $this->_add_validation_strategy( |
|
20 | + new EE_Email_Validation_Strategy( |
|
21 | + isset($input_settings['validation_error_message']) |
|
22 | + ? $input_settings['validation_error_message'] |
|
23 | + : null |
|
24 | + ) |
|
25 | + ); |
|
26 | + parent::__construct($input_settings); |
|
27 | + $this->set_html_class($this->html_class() . ' email'); |
|
28 | + } |
|
29 | 29 | } |
@@ -24,6 +24,6 @@ |
||
24 | 24 | ) |
25 | 25 | ); |
26 | 26 | parent::__construct($input_settings); |
27 | - $this->set_html_class($this->html_class() . ' email'); |
|
27 | + $this->set_html_class($this->html_class().' email'); |
|
28 | 28 | } |
29 | 29 | } |
@@ -12,67 +12,67 @@ |
||
12 | 12 | { |
13 | 13 | |
14 | 14 | |
15 | - protected $_rows = 2; |
|
16 | - protected $_cols = 20; |
|
15 | + protected $_rows = 2; |
|
16 | + protected $_cols = 20; |
|
17 | 17 | |
18 | - /** |
|
19 | - * sets the rows property on this input |
|
20 | - * @param int $rows |
|
21 | - */ |
|
22 | - public function set_rows($rows) |
|
23 | - { |
|
24 | - $this->_rows = $rows; |
|
25 | - } |
|
26 | - /** |
|
27 | - * sets the cols html property on this input |
|
28 | - * @param int $cols |
|
29 | - */ |
|
30 | - public function set_cols($cols) |
|
31 | - { |
|
32 | - $this->_cols = $cols; |
|
33 | - } |
|
34 | - /** |
|
35 | - * |
|
36 | - * @return int |
|
37 | - */ |
|
38 | - public function get_rows() |
|
39 | - { |
|
40 | - return $this->_rows; |
|
41 | - } |
|
42 | - /** |
|
43 | - * |
|
44 | - * @return int |
|
45 | - */ |
|
46 | - public function get_cols() |
|
47 | - { |
|
48 | - return $this->_cols; |
|
49 | - } |
|
18 | + /** |
|
19 | + * sets the rows property on this input |
|
20 | + * @param int $rows |
|
21 | + */ |
|
22 | + public function set_rows($rows) |
|
23 | + { |
|
24 | + $this->_rows = $rows; |
|
25 | + } |
|
26 | + /** |
|
27 | + * sets the cols html property on this input |
|
28 | + * @param int $cols |
|
29 | + */ |
|
30 | + public function set_cols($cols) |
|
31 | + { |
|
32 | + $this->_cols = $cols; |
|
33 | + } |
|
34 | + /** |
|
35 | + * |
|
36 | + * @return int |
|
37 | + */ |
|
38 | + public function get_rows() |
|
39 | + { |
|
40 | + return $this->_rows; |
|
41 | + } |
|
42 | + /** |
|
43 | + * |
|
44 | + * @return int |
|
45 | + */ |
|
46 | + public function get_cols() |
|
47 | + { |
|
48 | + return $this->_cols; |
|
49 | + } |
|
50 | 50 | |
51 | 51 | |
52 | 52 | |
53 | - /** |
|
54 | - * @param array $options_array |
|
55 | - */ |
|
56 | - public function __construct($options_array = array()) |
|
57 | - { |
|
58 | - $this->_set_display_strategy(new EE_Text_Area_Display_Strategy()); |
|
59 | - $this->_set_normalization_strategy(new EE_Text_Normalization()); |
|
53 | + /** |
|
54 | + * @param array $options_array |
|
55 | + */ |
|
56 | + public function __construct($options_array = array()) |
|
57 | + { |
|
58 | + $this->_set_display_strategy(new EE_Text_Area_Display_Strategy()); |
|
59 | + $this->_set_normalization_strategy(new EE_Text_Normalization()); |
|
60 | 60 | |
61 | 61 | |
62 | - parent::__construct($options_array); |
|
62 | + parent::__construct($options_array); |
|
63 | 63 | |
64 | - // if the input hasn't specifically mentioned a more lenient validation strategy, |
|
65 | - // apply plaintext validation strategy |
|
66 | - if (! $this->has_validation_strategy( |
|
67 | - array( |
|
68 | - 'EE_Full_HTML_Validation_Strategy', |
|
69 | - 'EE_Simple_HTML_Validation_Strategy' |
|
70 | - ) |
|
71 | - ) |
|
72 | - ) { |
|
73 | - // by default we use the plaintext validation. If you want something else, |
|
74 | - // just remove it after the input is constructed :P using EE_Form_Input_Base::remove_validation_strategy() |
|
75 | - $this->_add_validation_strategy(new EE_Plaintext_Validation_Strategy()); |
|
76 | - } |
|
77 | - } |
|
64 | + // if the input hasn't specifically mentioned a more lenient validation strategy, |
|
65 | + // apply plaintext validation strategy |
|
66 | + if (! $this->has_validation_strategy( |
|
67 | + array( |
|
68 | + 'EE_Full_HTML_Validation_Strategy', |
|
69 | + 'EE_Simple_HTML_Validation_Strategy' |
|
70 | + ) |
|
71 | + ) |
|
72 | + ) { |
|
73 | + // by default we use the plaintext validation. If you want something else, |
|
74 | + // just remove it after the input is constructed :P using EE_Form_Input_Base::remove_validation_strategy() |
|
75 | + $this->_add_validation_strategy(new EE_Plaintext_Validation_Strategy()); |
|
76 | + } |
|
77 | + } |
|
78 | 78 | } |
@@ -63,7 +63,7 @@ |
||
63 | 63 | |
64 | 64 | // if the input hasn't specifically mentioned a more lenient validation strategy, |
65 | 65 | // apply plaintext validation strategy |
66 | - if (! $this->has_validation_strategy( |
|
66 | + if ( ! $this->has_validation_strategy( |
|
67 | 67 | array( |
68 | 68 | 'EE_Full_HTML_Validation_Strategy', |
69 | 69 | 'EE_Simple_HTML_Validation_Strategy' |
@@ -13,20 +13,20 @@ |
||
13 | 13 | class EE_Select_Input extends EE_Form_Input_With_Options_Base |
14 | 14 | { |
15 | 15 | |
16 | - /** |
|
17 | - * @param array $answer_options |
|
18 | - * @param array $input_settings |
|
19 | - */ |
|
20 | - public function __construct($answer_options, $input_settings = array()) |
|
21 | - { |
|
22 | - $this->_set_display_strategy(new EE_Select_Display_Strategy($answer_options)); |
|
23 | - $this->_add_validation_strategy( |
|
24 | - new EE_Enum_Validation_Strategy( |
|
25 | - isset($input_settings['validation_error_message']) |
|
26 | - ? $input_settings['validation_error_message'] |
|
27 | - : null |
|
28 | - ) |
|
29 | - ); |
|
30 | - parent::__construct($answer_options, $input_settings); |
|
31 | - } |
|
16 | + /** |
|
17 | + * @param array $answer_options |
|
18 | + * @param array $input_settings |
|
19 | + */ |
|
20 | + public function __construct($answer_options, $input_settings = array()) |
|
21 | + { |
|
22 | + $this->_set_display_strategy(new EE_Select_Display_Strategy($answer_options)); |
|
23 | + $this->_add_validation_strategy( |
|
24 | + new EE_Enum_Validation_Strategy( |
|
25 | + isset($input_settings['validation_error_message']) |
|
26 | + ? $input_settings['validation_error_message'] |
|
27 | + : null |
|
28 | + ) |
|
29 | + ); |
|
30 | + parent::__construct($answer_options, $input_settings); |
|
31 | + } |
|
32 | 32 | } |
@@ -9,40 +9,40 @@ |
||
9 | 9 | abstract class EE_Form_Input_Strategy_Base |
10 | 10 | { |
11 | 11 | |
12 | - /** |
|
13 | - * Form Input to display |
|
14 | - * |
|
15 | - * @var EE_Form_Input_Base |
|
16 | - */ |
|
17 | - protected $_input; |
|
12 | + /** |
|
13 | + * Form Input to display |
|
14 | + * |
|
15 | + * @var EE_Form_Input_Base |
|
16 | + */ |
|
17 | + protected $_input; |
|
18 | 18 | |
19 | 19 | |
20 | 20 | |
21 | - public function __construct() |
|
22 | - { |
|
23 | - } |
|
21 | + public function __construct() |
|
22 | + { |
|
23 | + } |
|
24 | 24 | |
25 | 25 | |
26 | 26 | |
27 | - /** |
|
28 | - * The form input on which this strategy is to perform |
|
29 | - * |
|
30 | - * @param EE_Form_Input_Base $form_input |
|
31 | - */ |
|
32 | - public function _construct_finalize(EE_Form_Input_Base $form_input) |
|
33 | - { |
|
34 | - $this->_input = $form_input; |
|
35 | - } |
|
27 | + /** |
|
28 | + * The form input on which this strategy is to perform |
|
29 | + * |
|
30 | + * @param EE_Form_Input_Base $form_input |
|
31 | + */ |
|
32 | + public function _construct_finalize(EE_Form_Input_Base $form_input) |
|
33 | + { |
|
34 | + $this->_input = $form_input; |
|
35 | + } |
|
36 | 36 | |
37 | 37 | |
38 | 38 | |
39 | - /** |
|
40 | - * Gets this strategy's input |
|
41 | - * |
|
42 | - * @return EE_Form_Input_Base |
|
43 | - */ |
|
44 | - public function get_input() |
|
45 | - { |
|
46 | - return $this->_input; |
|
47 | - } |
|
39 | + /** |
|
40 | + * Gets this strategy's input |
|
41 | + * |
|
42 | + * @return EE_Form_Input_Base |
|
43 | + */ |
|
44 | + public function get_input() |
|
45 | + { |
|
46 | + return $this->_input; |
|
47 | + } |
|
48 | 48 | } |
@@ -12,29 +12,29 @@ |
||
12 | 12 | class EE_Submit_Input_Display_Strategy extends EE_Display_Strategy_Base |
13 | 13 | { |
14 | 14 | |
15 | - /** |
|
16 | - * @return string of html to display the input |
|
17 | - */ |
|
18 | - public function display() |
|
19 | - { |
|
20 | - $default_value = $this->_input->get_default(); |
|
21 | - if ($this->_input->get_normalization_strategy() instanceof EE_Normalization_Strategy_Base) { |
|
22 | - $default_value = $this->_input->get_normalization_strategy()->unnormalize($default_value); |
|
23 | - } |
|
24 | - $html = $this->_opening_tag('input'); |
|
25 | - $html .= $this->_attributes_string( |
|
26 | - array_merge( |
|
27 | - $this->_standard_attributes_array(), |
|
28 | - array( |
|
29 | - 'type' => 'submit', |
|
30 | - 'value' => $default_value, |
|
31 | - // overwrite the standard id with the backwards compatible one |
|
32 | - 'id' => $this->_input->html_id() . '-submit', |
|
33 | - 'class' => $this->_input->html_class() . ' ' . $this->_input->button_css_attributes() |
|
34 | - ) |
|
35 | - ) |
|
36 | - ); |
|
37 | - $html .= $this->_close_tag(); |
|
38 | - return $html; |
|
39 | - } |
|
15 | + /** |
|
16 | + * @return string of html to display the input |
|
17 | + */ |
|
18 | + public function display() |
|
19 | + { |
|
20 | + $default_value = $this->_input->get_default(); |
|
21 | + if ($this->_input->get_normalization_strategy() instanceof EE_Normalization_Strategy_Base) { |
|
22 | + $default_value = $this->_input->get_normalization_strategy()->unnormalize($default_value); |
|
23 | + } |
|
24 | + $html = $this->_opening_tag('input'); |
|
25 | + $html .= $this->_attributes_string( |
|
26 | + array_merge( |
|
27 | + $this->_standard_attributes_array(), |
|
28 | + array( |
|
29 | + 'type' => 'submit', |
|
30 | + 'value' => $default_value, |
|
31 | + // overwrite the standard id with the backwards compatible one |
|
32 | + 'id' => $this->_input->html_id() . '-submit', |
|
33 | + 'class' => $this->_input->html_class() . ' ' . $this->_input->button_css_attributes() |
|
34 | + ) |
|
35 | + ) |
|
36 | + ); |
|
37 | + $html .= $this->_close_tag(); |
|
38 | + return $html; |
|
39 | + } |
|
40 | 40 | } |
@@ -29,8 +29,8 @@ |
||
29 | 29 | 'type' => 'submit', |
30 | 30 | 'value' => $default_value, |
31 | 31 | // overwrite the standard id with the backwards compatible one |
32 | - 'id' => $this->_input->html_id() . '-submit', |
|
33 | - 'class' => $this->_input->html_class() . ' ' . $this->_input->button_css_attributes() |
|
32 | + 'id' => $this->_input->html_id().'-submit', |
|
33 | + 'class' => $this->_input->html_class().' '.$this->_input->button_css_attributes() |
|
34 | 34 | ) |
35 | 35 | ) |
36 | 36 | ); |
@@ -11,13 +11,13 @@ |
||
11 | 11 | */ |
12 | 12 | class EE_Hidden_Display_Strategy extends EE_Display_Strategy_Base |
13 | 13 | { |
14 | - /** |
|
15 | - * |
|
16 | - * @return string of html to display the HIDDEN field |
|
17 | - */ |
|
18 | - public function display() |
|
19 | - { |
|
20 | - $input = $this->_input; |
|
21 | - return "<input type='hidden' id='{$input->html_id()}' name='{$input->html_name()}' class='{$input->html_class()}' style='{$input->html_style()}' value='{$input->raw_value_in_form()}' {$input->other_html_attributes()}/>"; |
|
22 | - } |
|
14 | + /** |
|
15 | + * |
|
16 | + * @return string of html to display the HIDDEN field |
|
17 | + */ |
|
18 | + public function display() |
|
19 | + { |
|
20 | + $input = $this->_input; |
|
21 | + return "<input type='hidden' id='{$input->html_id()}' name='{$input->html_name()}' class='{$input->html_class()}' style='{$input->html_style()}' value='{$input->raw_value_in_form()}' {$input->other_html_attributes()}/>"; |
|
22 | + } |
|
23 | 23 | } |
@@ -12,54 +12,54 @@ |
||
12 | 12 | class EE_Select_Multiple_Display_Strategy extends EE_Select_Display_Strategy |
13 | 13 | { |
14 | 14 | |
15 | - /** |
|
16 | - * |
|
17 | - * @throws EE_Error |
|
18 | - * @return string of html to display the field |
|
19 | - */ |
|
20 | - public function display() |
|
21 | - { |
|
15 | + /** |
|
16 | + * |
|
17 | + * @throws EE_Error |
|
18 | + * @return string of html to display the field |
|
19 | + */ |
|
20 | + public function display() |
|
21 | + { |
|
22 | 22 | |
23 | - if (! $this->_input instanceof EE_Form_Input_With_Options_Base) { |
|
24 | - throw new EE_Error(sprintf(__('Cannot use Select Multiple Display Strategy with an input that doesn\'t have options', "event_espresso"))); |
|
25 | - } |
|
23 | + if (! $this->_input instanceof EE_Form_Input_With_Options_Base) { |
|
24 | + throw new EE_Error(sprintf(__('Cannot use Select Multiple Display Strategy with an input that doesn\'t have options', "event_espresso"))); |
|
25 | + } |
|
26 | 26 | |
27 | - $html = EEH_HTML::nl(0, 'select'); |
|
28 | - $html .= '<select multiple'; |
|
29 | - $html .= ' id="' . $this->_input->html_id() . '"'; |
|
30 | - $html .= ' name="' . $this->_input->html_name() . '[]"'; |
|
31 | - $class = $this->_input->required() ? $this->_input->required_css_class() . ' ' . $this->_input->html_class() : $this->_input->html_class(); |
|
32 | - $html .= ' class="' . $class . '"'; |
|
33 | - // add html5 required |
|
34 | - $html .= $this->_input->required() ? ' required' : ''; |
|
35 | - $html .= ' style="' . $this->_input->html_style() . '"'; |
|
36 | - $html .= ' ' . $this->_input->other_html_attributes(); |
|
37 | - $html .= '>'; |
|
27 | + $html = EEH_HTML::nl(0, 'select'); |
|
28 | + $html .= '<select multiple'; |
|
29 | + $html .= ' id="' . $this->_input->html_id() . '"'; |
|
30 | + $html .= ' name="' . $this->_input->html_name() . '[]"'; |
|
31 | + $class = $this->_input->required() ? $this->_input->required_css_class() . ' ' . $this->_input->html_class() : $this->_input->html_class(); |
|
32 | + $html .= ' class="' . $class . '"'; |
|
33 | + // add html5 required |
|
34 | + $html .= $this->_input->required() ? ' required' : ''; |
|
35 | + $html .= ' style="' . $this->_input->html_style() . '"'; |
|
36 | + $html .= ' ' . $this->_input->other_html_attributes(); |
|
37 | + $html .= '>'; |
|
38 | 38 | |
39 | - EEH_HTML::indent(1, 'select'); |
|
40 | - if (EEH_Array::is_multi_dimensional_array($this->_input->options())) { |
|
41 | - throw new EE_Error(sprintf(__("Select multiple display strategy does not allow for nested arrays of options.", "event_espresso"))); |
|
42 | - } else { |
|
43 | - $html.=$this->_display_options($this->_input->options()); |
|
44 | - } |
|
39 | + EEH_HTML::indent(1, 'select'); |
|
40 | + if (EEH_Array::is_multi_dimensional_array($this->_input->options())) { |
|
41 | + throw new EE_Error(sprintf(__("Select multiple display strategy does not allow for nested arrays of options.", "event_espresso"))); |
|
42 | + } else { |
|
43 | + $html.=$this->_display_options($this->_input->options()); |
|
44 | + } |
|
45 | 45 | |
46 | - $html.= EEH_HTML::nl(-1, 'select') . "</select>"; |
|
47 | - return $html; |
|
48 | - } |
|
46 | + $html.= EEH_HTML::nl(-1, 'select') . "</select>"; |
|
47 | + return $html; |
|
48 | + } |
|
49 | 49 | |
50 | 50 | |
51 | 51 | |
52 | - /** |
|
53 | - * Checks if that $value is one of the selected ones |
|
54 | - * @param string|int $value unnormalized value option (string) |
|
55 | - * @return boolean |
|
56 | - */ |
|
57 | - protected function _check_if_option_selected($value) |
|
58 | - { |
|
59 | - $selected_options = $this->_input->raw_value(); |
|
60 | - if (empty($selected_options)) { |
|
61 | - return false; |
|
62 | - } |
|
63 | - return in_array($value, $selected_options) ? true : false; |
|
64 | - } |
|
52 | + /** |
|
53 | + * Checks if that $value is one of the selected ones |
|
54 | + * @param string|int $value unnormalized value option (string) |
|
55 | + * @return boolean |
|
56 | + */ |
|
57 | + protected function _check_if_option_selected($value) |
|
58 | + { |
|
59 | + $selected_options = $this->_input->raw_value(); |
|
60 | + if (empty($selected_options)) { |
|
61 | + return false; |
|
62 | + } |
|
63 | + return in_array($value, $selected_options) ? true : false; |
|
64 | + } |
|
65 | 65 | } |
@@ -20,30 +20,30 @@ |
||
20 | 20 | public function display() |
21 | 21 | { |
22 | 22 | |
23 | - if (! $this->_input instanceof EE_Form_Input_With_Options_Base) { |
|
23 | + if ( ! $this->_input instanceof EE_Form_Input_With_Options_Base) { |
|
24 | 24 | throw new EE_Error(sprintf(__('Cannot use Select Multiple Display Strategy with an input that doesn\'t have options', "event_espresso"))); |
25 | 25 | } |
26 | 26 | |
27 | 27 | $html = EEH_HTML::nl(0, 'select'); |
28 | 28 | $html .= '<select multiple'; |
29 | - $html .= ' id="' . $this->_input->html_id() . '"'; |
|
30 | - $html .= ' name="' . $this->_input->html_name() . '[]"'; |
|
31 | - $class = $this->_input->required() ? $this->_input->required_css_class() . ' ' . $this->_input->html_class() : $this->_input->html_class(); |
|
32 | - $html .= ' class="' . $class . '"'; |
|
29 | + $html .= ' id="'.$this->_input->html_id().'"'; |
|
30 | + $html .= ' name="'.$this->_input->html_name().'[]"'; |
|
31 | + $class = $this->_input->required() ? $this->_input->required_css_class().' '.$this->_input->html_class() : $this->_input->html_class(); |
|
32 | + $html .= ' class="'.$class.'"'; |
|
33 | 33 | // add html5 required |
34 | 34 | $html .= $this->_input->required() ? ' required' : ''; |
35 | - $html .= ' style="' . $this->_input->html_style() . '"'; |
|
36 | - $html .= ' ' . $this->_input->other_html_attributes(); |
|
35 | + $html .= ' style="'.$this->_input->html_style().'"'; |
|
36 | + $html .= ' '.$this->_input->other_html_attributes(); |
|
37 | 37 | $html .= '>'; |
38 | 38 | |
39 | 39 | EEH_HTML::indent(1, 'select'); |
40 | 40 | if (EEH_Array::is_multi_dimensional_array($this->_input->options())) { |
41 | 41 | throw new EE_Error(sprintf(__("Select multiple display strategy does not allow for nested arrays of options.", "event_espresso"))); |
42 | 42 | } else { |
43 | - $html.=$this->_display_options($this->_input->options()); |
|
43 | + $html .= $this->_display_options($this->_input->options()); |
|
44 | 44 | } |
45 | 45 | |
46 | - $html.= EEH_HTML::nl(-1, 'select') . "</select>"; |
|
46 | + $html .= EEH_HTML::nl(-1, 'select')."</select>"; |
|
47 | 47 | return $html; |
48 | 48 | } |
49 | 49 |
@@ -13,58 +13,58 @@ |
||
13 | 13 | */ |
14 | 14 | class EE_Text_Input_Display_Strategy extends EE_Display_Strategy_Base |
15 | 15 | { |
16 | - /** |
|
17 | - * The html "type" attribute value. default is "text" |
|
18 | - * @var string |
|
19 | - */ |
|
20 | - protected $_type; |
|
16 | + /** |
|
17 | + * The html "type" attribute value. default is "text" |
|
18 | + * @var string |
|
19 | + */ |
|
20 | + protected $_type; |
|
21 | 21 | |
22 | 22 | |
23 | 23 | |
24 | - /** |
|
25 | - * @param string $type |
|
26 | - */ |
|
27 | - public function __construct($type = 'text') |
|
28 | - { |
|
29 | - $this->_type = $type; |
|
30 | - parent::__construct(); |
|
31 | - } |
|
24 | + /** |
|
25 | + * @param string $type |
|
26 | + */ |
|
27 | + public function __construct($type = 'text') |
|
28 | + { |
|
29 | + $this->_type = $type; |
|
30 | + parent::__construct(); |
|
31 | + } |
|
32 | 32 | |
33 | 33 | |
34 | 34 | |
35 | - /** |
|
36 | - * Gets the html "type" attribute's value |
|
37 | - * @return string |
|
38 | - */ |
|
39 | - public function get_type() |
|
40 | - { |
|
41 | - if ($this->_type === 'email' |
|
42 | - && ! apply_filters('FHEE__EE_Text_Input_Display_Strategy__use_html5_email', false) |
|
43 | - ) { |
|
44 | - return 'text'; |
|
45 | - } |
|
46 | - return $this->_type; |
|
47 | - } |
|
35 | + /** |
|
36 | + * Gets the html "type" attribute's value |
|
37 | + * @return string |
|
38 | + */ |
|
39 | + public function get_type() |
|
40 | + { |
|
41 | + if ($this->_type === 'email' |
|
42 | + && ! apply_filters('FHEE__EE_Text_Input_Display_Strategy__use_html5_email', false) |
|
43 | + ) { |
|
44 | + return 'text'; |
|
45 | + } |
|
46 | + return $this->_type; |
|
47 | + } |
|
48 | 48 | |
49 | 49 | |
50 | 50 | |
51 | - /** |
|
52 | - * |
|
53 | - * @return string of html to display the field |
|
54 | - */ |
|
55 | - public function display() |
|
56 | - { |
|
57 | - $input = '<input type="'. $this->get_type() .'"'; |
|
58 | - $input .= ' name="' . $this->_input->html_name() . '"'; |
|
59 | - $input .= ' id="' . $this->_input->html_id() . '"'; |
|
60 | - $class = $this->_input->required() ? $this->_input->required_css_class() . ' ' . $this->_input->html_class() : $this->_input->html_class(); |
|
61 | - $input .= ' class="' . $class . '"'; |
|
62 | - // add html5 required |
|
63 | - $input .= $this->_input->required() ? ' required' : ''; |
|
64 | - $input .= ' value="' . $this->_input->raw_value_in_form() . '"'; |
|
65 | - $input .= ' style="' . $this->_input->html_style() . '"'; |
|
66 | - $input .= $this->_input->other_html_attributes(); |
|
67 | - $input .= '/>'; |
|
68 | - return $input; |
|
69 | - } |
|
51 | + /** |
|
52 | + * |
|
53 | + * @return string of html to display the field |
|
54 | + */ |
|
55 | + public function display() |
|
56 | + { |
|
57 | + $input = '<input type="'. $this->get_type() .'"'; |
|
58 | + $input .= ' name="' . $this->_input->html_name() . '"'; |
|
59 | + $input .= ' id="' . $this->_input->html_id() . '"'; |
|
60 | + $class = $this->_input->required() ? $this->_input->required_css_class() . ' ' . $this->_input->html_class() : $this->_input->html_class(); |
|
61 | + $input .= ' class="' . $class . '"'; |
|
62 | + // add html5 required |
|
63 | + $input .= $this->_input->required() ? ' required' : ''; |
|
64 | + $input .= ' value="' . $this->_input->raw_value_in_form() . '"'; |
|
65 | + $input .= ' style="' . $this->_input->html_style() . '"'; |
|
66 | + $input .= $this->_input->other_html_attributes(); |
|
67 | + $input .= '/>'; |
|
68 | + return $input; |
|
69 | + } |
|
70 | 70 | } |
@@ -54,15 +54,15 @@ |
||
54 | 54 | */ |
55 | 55 | public function display() |
56 | 56 | { |
57 | - $input = '<input type="'. $this->get_type() .'"'; |
|
58 | - $input .= ' name="' . $this->_input->html_name() . '"'; |
|
59 | - $input .= ' id="' . $this->_input->html_id() . '"'; |
|
60 | - $class = $this->_input->required() ? $this->_input->required_css_class() . ' ' . $this->_input->html_class() : $this->_input->html_class(); |
|
61 | - $input .= ' class="' . $class . '"'; |
|
57 | + $input = '<input type="'.$this->get_type().'"'; |
|
58 | + $input .= ' name="'.$this->_input->html_name().'"'; |
|
59 | + $input .= ' id="'.$this->_input->html_id().'"'; |
|
60 | + $class = $this->_input->required() ? $this->_input->required_css_class().' '.$this->_input->html_class() : $this->_input->html_class(); |
|
61 | + $input .= ' class="'.$class.'"'; |
|
62 | 62 | // add html5 required |
63 | 63 | $input .= $this->_input->required() ? ' required' : ''; |
64 | - $input .= ' value="' . $this->_input->raw_value_in_form() . '"'; |
|
65 | - $input .= ' style="' . $this->_input->html_style() . '"'; |
|
64 | + $input .= ' value="'.$this->_input->raw_value_in_form().'"'; |
|
65 | + $input .= ' style="'.$this->_input->html_style().'"'; |
|
66 | 66 | $input .= $this->_input->other_html_attributes(); |
67 | 67 | $input .= '/>'; |
68 | 68 | return $input; |
@@ -12,158 +12,158 @@ |
||
12 | 12 | { |
13 | 13 | |
14 | 14 | |
15 | - /** |
|
16 | - * enqueues css and js, so that this can be called statically |
|
17 | - */ |
|
18 | - public static function enqueue_styles_and_scripts() |
|
19 | - { |
|
20 | - wp_register_style( |
|
21 | - 'checkbox_dropdown_selector', |
|
22 | - EE_GLOBAL_ASSETS_URL . 'css/checkbox_dropdown_selector.css', |
|
23 | - array('espresso_default'), |
|
24 | - EVENT_ESPRESSO_VERSION |
|
25 | - ); |
|
26 | - wp_register_style( |
|
27 | - 'espresso_default', |
|
28 | - EE_GLOBAL_ASSETS_URL . 'css/espresso_default.css', |
|
29 | - array('dashicons'), |
|
30 | - EVENT_ESPRESSO_VERSION |
|
31 | - ); |
|
32 | - wp_enqueue_style('checkbox_dropdown_selector'); |
|
33 | - wp_register_script( |
|
34 | - 'checkbox_dropdown_selector', |
|
35 | - EE_GLOBAL_ASSETS_URL . 'scripts/checkbox_dropdown_selector.js', |
|
36 | - array('jquery'), |
|
37 | - EVENT_ESPRESSO_VERSION, |
|
38 | - true |
|
39 | - ); |
|
40 | - wp_enqueue_script('checkbox_dropdown_selector'); |
|
41 | - } |
|
15 | + /** |
|
16 | + * enqueues css and js, so that this can be called statically |
|
17 | + */ |
|
18 | + public static function enqueue_styles_and_scripts() |
|
19 | + { |
|
20 | + wp_register_style( |
|
21 | + 'checkbox_dropdown_selector', |
|
22 | + EE_GLOBAL_ASSETS_URL . 'css/checkbox_dropdown_selector.css', |
|
23 | + array('espresso_default'), |
|
24 | + EVENT_ESPRESSO_VERSION |
|
25 | + ); |
|
26 | + wp_register_style( |
|
27 | + 'espresso_default', |
|
28 | + EE_GLOBAL_ASSETS_URL . 'css/espresso_default.css', |
|
29 | + array('dashicons'), |
|
30 | + EVENT_ESPRESSO_VERSION |
|
31 | + ); |
|
32 | + wp_enqueue_style('checkbox_dropdown_selector'); |
|
33 | + wp_register_script( |
|
34 | + 'checkbox_dropdown_selector', |
|
35 | + EE_GLOBAL_ASSETS_URL . 'scripts/checkbox_dropdown_selector.js', |
|
36 | + array('jquery'), |
|
37 | + EVENT_ESPRESSO_VERSION, |
|
38 | + true |
|
39 | + ); |
|
40 | + wp_enqueue_script('checkbox_dropdown_selector'); |
|
41 | + } |
|
42 | 42 | |
43 | 43 | |
44 | 44 | |
45 | - /** |
|
46 | - * Informs the rest of the forms system what CSS and JS is needed to display the input |
|
47 | - */ |
|
48 | - public function enqueue_js() |
|
49 | - { |
|
50 | - EE_Checkbox_Dropdown_Selector_Display_Strategy::enqueue_styles_and_scripts(); |
|
51 | - } |
|
45 | + /** |
|
46 | + * Informs the rest of the forms system what CSS and JS is needed to display the input |
|
47 | + */ |
|
48 | + public function enqueue_js() |
|
49 | + { |
|
50 | + EE_Checkbox_Dropdown_Selector_Display_Strategy::enqueue_styles_and_scripts(); |
|
51 | + } |
|
52 | 52 | |
53 | 53 | |
54 | 54 | |
55 | - /** |
|
56 | - * callback for Iframe::addStylesheets() child class methods |
|
57 | - * |
|
58 | - * @param array $iframe_css |
|
59 | - * @return array |
|
60 | - */ |
|
61 | - public function iframe_css(array $iframe_css) |
|
62 | - { |
|
63 | - $iframe_css['checkbox_dropdown_selector'] = EE_GLOBAL_ASSETS_URL . 'css/checkbox_dropdown_selector.css'; |
|
64 | - return $iframe_css; |
|
65 | - } |
|
55 | + /** |
|
56 | + * callback for Iframe::addStylesheets() child class methods |
|
57 | + * |
|
58 | + * @param array $iframe_css |
|
59 | + * @return array |
|
60 | + */ |
|
61 | + public function iframe_css(array $iframe_css) |
|
62 | + { |
|
63 | + $iframe_css['checkbox_dropdown_selector'] = EE_GLOBAL_ASSETS_URL . 'css/checkbox_dropdown_selector.css'; |
|
64 | + return $iframe_css; |
|
65 | + } |
|
66 | 66 | |
67 | 67 | |
68 | 68 | |
69 | - /** |
|
70 | - * callback for Iframe::addScripts() child class methods |
|
71 | - * |
|
72 | - * @param array $iframe_js |
|
73 | - * @return array |
|
74 | - */ |
|
75 | - public function iframe_js(array $iframe_js) |
|
76 | - { |
|
77 | - $iframe_js['checkbox_dropdown_selector'] = EE_GLOBAL_ASSETS_URL . 'scripts/checkbox_dropdown_selector.js'; |
|
78 | - return $iframe_js; |
|
79 | - } |
|
69 | + /** |
|
70 | + * callback for Iframe::addScripts() child class methods |
|
71 | + * |
|
72 | + * @param array $iframe_js |
|
73 | + * @return array |
|
74 | + */ |
|
75 | + public function iframe_js(array $iframe_js) |
|
76 | + { |
|
77 | + $iframe_js['checkbox_dropdown_selector'] = EE_GLOBAL_ASSETS_URL . 'scripts/checkbox_dropdown_selector.js'; |
|
78 | + return $iframe_js; |
|
79 | + } |
|
80 | 80 | |
81 | 81 | |
82 | - /** |
|
83 | - * @throws EE_Error |
|
84 | - * @return string of html to display the field |
|
85 | - */ |
|
86 | - public function display() |
|
87 | - { |
|
88 | - $input = $this->get_input(); |
|
89 | - $select_button_text = $input instanceof EE_Checkbox_Dropdown_Selector_Input ? $input->select_button_text() : ''; |
|
90 | - // $multi = count( $input->options() ) > 1 ? TRUE : FALSE; |
|
91 | - $input->set_label_sizes(); |
|
92 | - $label_size_class = $input->get_label_size_class(); |
|
93 | - if (! is_array($input->raw_value()) && $input->raw_value() !== null) { |
|
94 | - EE_Error::doing_it_wrong( |
|
95 | - 'EE_Checkbox_Display_Strategy::display()', |
|
96 | - sprintf( |
|
97 | - esc_html__( |
|
98 | - '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"', |
|
99 | - 'event_espresso' |
|
100 | - ), |
|
101 | - $input->html_id(), |
|
102 | - var_export($input->raw_value(), true), |
|
103 | - $input->html_name() . '[]' |
|
104 | - ), |
|
105 | - '4.8.1' |
|
106 | - ); |
|
107 | - } |
|
82 | + /** |
|
83 | + * @throws EE_Error |
|
84 | + * @return string of html to display the field |
|
85 | + */ |
|
86 | + public function display() |
|
87 | + { |
|
88 | + $input = $this->get_input(); |
|
89 | + $select_button_text = $input instanceof EE_Checkbox_Dropdown_Selector_Input ? $input->select_button_text() : ''; |
|
90 | + // $multi = count( $input->options() ) > 1 ? TRUE : FALSE; |
|
91 | + $input->set_label_sizes(); |
|
92 | + $label_size_class = $input->get_label_size_class(); |
|
93 | + if (! is_array($input->raw_value()) && $input->raw_value() !== null) { |
|
94 | + EE_Error::doing_it_wrong( |
|
95 | + 'EE_Checkbox_Display_Strategy::display()', |
|
96 | + sprintf( |
|
97 | + esc_html__( |
|
98 | + '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"', |
|
99 | + 'event_espresso' |
|
100 | + ), |
|
101 | + $input->html_id(), |
|
102 | + var_export($input->raw_value(), true), |
|
103 | + $input->html_name() . '[]' |
|
104 | + ), |
|
105 | + '4.8.1' |
|
106 | + ); |
|
107 | + } |
|
108 | 108 | |
109 | 109 | |
110 | - $html = \EEH_HTML::div('', '', 'checkbox-dropdown-selector-wrap-dv'); |
|
111 | - $html .= '<button id="' . $input->html_id() . '-btn"'; |
|
112 | - // $html .= ' name="' . $input->html_name() . '"'; |
|
113 | - $html .= ' class="' . $input->html_class() . ' checkbox-dropdown-selector-btn button-secondary button"'; |
|
114 | - $html .= ' style="' . $input->html_style() . '"'; |
|
115 | - $html .= ' data-target="' . $input->html_id() . '-options-dv"'; |
|
116 | - $html .= ' ' . $input->html_other_attributes() . '>'; |
|
117 | - $html .= '<span class="checkbox-dropdown-selector-selected-spn">'; |
|
118 | - $html .= $select_button_text; |
|
119 | - $html .= '</span> <span class="dashicons dashicons-arrow-down"></span>'; |
|
120 | - $html .= '</button>'; |
|
121 | - $html .= EEH_HTML::div( |
|
122 | - '', |
|
123 | - $input->html_id() . '-options-dv', |
|
124 | - 'checkbox-dropdown-selector' |
|
125 | - ); |
|
126 | - $html .= EEH_HTML::link( |
|
127 | - '', |
|
128 | - '<span class="dashicons dashicons-no"></span>', |
|
129 | - esc_html__('close datetime selector', 'event_espresso'), |
|
130 | - '', |
|
131 | - 'close-espresso-notice' |
|
132 | - ); |
|
133 | - $html .= EEH_HTML::ul(); |
|
134 | - $input_raw_value = (array) $input->raw_value(); |
|
135 | - foreach ($input->options() as $value => $display_text) { |
|
136 | - $html .= EEH_HTML::li(); |
|
137 | - $value = $input->get_normalization_strategy()->unnormalize_one($value); |
|
138 | - $html_id = $this->get_sub_input_id($value); |
|
139 | - $html .= EEH_HTML::nl(0, 'checkbox'); |
|
140 | - $html .= '<label for="' |
|
141 | - . $html_id |
|
142 | - . '" id="' |
|
143 | - . $html_id |
|
144 | - . '-lbl" class="ee-checkbox-label-after' |
|
145 | - . $label_size_class |
|
146 | - . '">'; |
|
147 | - $html .= EEH_HTML::nl(1, 'checkbox'); |
|
148 | - $html .= '<input type="checkbox"'; |
|
149 | - $html .= ' name="' . $input->html_name() . '[]"'; |
|
150 | - $html .= ' id="' . $html_id . '"'; |
|
151 | - $html .= ' class="' . $input->html_class() . '-option"'; |
|
152 | - $html .= ' style="' . $input->html_style() . '"'; |
|
153 | - $html .= ' value="' . esc_attr($value) . '"'; |
|
154 | - $html .= ! empty($input_raw_value) && in_array($value, $input_raw_value, true) |
|
155 | - ? ' checked="checked"' |
|
156 | - : ''; |
|
157 | - $html .= ' ' . $this->_input->other_html_attributes(); |
|
158 | - $html .= '>'; |
|
159 | - $html .= '<span class="datetime-selector-option-text-spn">' . $display_text . '</span>'; |
|
160 | - $html .= EEH_HTML::nl(-1, 'checkbox') . '</label>'; |
|
161 | - $html .= EEH_HTML::lix(); |
|
162 | - } |
|
163 | - $html .= EEH_HTML::ulx(); |
|
164 | - $html .= EEH_HTML::divx(); |
|
165 | - $html .= EEH_HTML::divx(); |
|
166 | - $html .= \EEH_HTML::br(); |
|
167 | - return $html; |
|
168 | - } |
|
110 | + $html = \EEH_HTML::div('', '', 'checkbox-dropdown-selector-wrap-dv'); |
|
111 | + $html .= '<button id="' . $input->html_id() . '-btn"'; |
|
112 | + // $html .= ' name="' . $input->html_name() . '"'; |
|
113 | + $html .= ' class="' . $input->html_class() . ' checkbox-dropdown-selector-btn button-secondary button"'; |
|
114 | + $html .= ' style="' . $input->html_style() . '"'; |
|
115 | + $html .= ' data-target="' . $input->html_id() . '-options-dv"'; |
|
116 | + $html .= ' ' . $input->html_other_attributes() . '>'; |
|
117 | + $html .= '<span class="checkbox-dropdown-selector-selected-spn">'; |
|
118 | + $html .= $select_button_text; |
|
119 | + $html .= '</span> <span class="dashicons dashicons-arrow-down"></span>'; |
|
120 | + $html .= '</button>'; |
|
121 | + $html .= EEH_HTML::div( |
|
122 | + '', |
|
123 | + $input->html_id() . '-options-dv', |
|
124 | + 'checkbox-dropdown-selector' |
|
125 | + ); |
|
126 | + $html .= EEH_HTML::link( |
|
127 | + '', |
|
128 | + '<span class="dashicons dashicons-no"></span>', |
|
129 | + esc_html__('close datetime selector', 'event_espresso'), |
|
130 | + '', |
|
131 | + 'close-espresso-notice' |
|
132 | + ); |
|
133 | + $html .= EEH_HTML::ul(); |
|
134 | + $input_raw_value = (array) $input->raw_value(); |
|
135 | + foreach ($input->options() as $value => $display_text) { |
|
136 | + $html .= EEH_HTML::li(); |
|
137 | + $value = $input->get_normalization_strategy()->unnormalize_one($value); |
|
138 | + $html_id = $this->get_sub_input_id($value); |
|
139 | + $html .= EEH_HTML::nl(0, 'checkbox'); |
|
140 | + $html .= '<label for="' |
|
141 | + . $html_id |
|
142 | + . '" id="' |
|
143 | + . $html_id |
|
144 | + . '-lbl" class="ee-checkbox-label-after' |
|
145 | + . $label_size_class |
|
146 | + . '">'; |
|
147 | + $html .= EEH_HTML::nl(1, 'checkbox'); |
|
148 | + $html .= '<input type="checkbox"'; |
|
149 | + $html .= ' name="' . $input->html_name() . '[]"'; |
|
150 | + $html .= ' id="' . $html_id . '"'; |
|
151 | + $html .= ' class="' . $input->html_class() . '-option"'; |
|
152 | + $html .= ' style="' . $input->html_style() . '"'; |
|
153 | + $html .= ' value="' . esc_attr($value) . '"'; |
|
154 | + $html .= ! empty($input_raw_value) && in_array($value, $input_raw_value, true) |
|
155 | + ? ' checked="checked"' |
|
156 | + : ''; |
|
157 | + $html .= ' ' . $this->_input->other_html_attributes(); |
|
158 | + $html .= '>'; |
|
159 | + $html .= '<span class="datetime-selector-option-text-spn">' . $display_text . '</span>'; |
|
160 | + $html .= EEH_HTML::nl(-1, 'checkbox') . '</label>'; |
|
161 | + $html .= EEH_HTML::lix(); |
|
162 | + } |
|
163 | + $html .= EEH_HTML::ulx(); |
|
164 | + $html .= EEH_HTML::divx(); |
|
165 | + $html .= EEH_HTML::divx(); |
|
166 | + $html .= \EEH_HTML::br(); |
|
167 | + return $html; |
|
168 | + } |
|
169 | 169 | } |
@@ -19,20 +19,20 @@ discard block |
||
19 | 19 | { |
20 | 20 | wp_register_style( |
21 | 21 | 'checkbox_dropdown_selector', |
22 | - EE_GLOBAL_ASSETS_URL . 'css/checkbox_dropdown_selector.css', |
|
22 | + EE_GLOBAL_ASSETS_URL.'css/checkbox_dropdown_selector.css', |
|
23 | 23 | array('espresso_default'), |
24 | 24 | EVENT_ESPRESSO_VERSION |
25 | 25 | ); |
26 | 26 | wp_register_style( |
27 | 27 | 'espresso_default', |
28 | - EE_GLOBAL_ASSETS_URL . 'css/espresso_default.css', |
|
28 | + EE_GLOBAL_ASSETS_URL.'css/espresso_default.css', |
|
29 | 29 | array('dashicons'), |
30 | 30 | EVENT_ESPRESSO_VERSION |
31 | 31 | ); |
32 | 32 | wp_enqueue_style('checkbox_dropdown_selector'); |
33 | 33 | wp_register_script( |
34 | 34 | 'checkbox_dropdown_selector', |
35 | - EE_GLOBAL_ASSETS_URL . 'scripts/checkbox_dropdown_selector.js', |
|
35 | + EE_GLOBAL_ASSETS_URL.'scripts/checkbox_dropdown_selector.js', |
|
36 | 36 | array('jquery'), |
37 | 37 | EVENT_ESPRESSO_VERSION, |
38 | 38 | true |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | */ |
61 | 61 | public function iframe_css(array $iframe_css) |
62 | 62 | { |
63 | - $iframe_css['checkbox_dropdown_selector'] = EE_GLOBAL_ASSETS_URL . 'css/checkbox_dropdown_selector.css'; |
|
63 | + $iframe_css['checkbox_dropdown_selector'] = EE_GLOBAL_ASSETS_URL.'css/checkbox_dropdown_selector.css'; |
|
64 | 64 | return $iframe_css; |
65 | 65 | } |
66 | 66 | |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | */ |
75 | 75 | public function iframe_js(array $iframe_js) |
76 | 76 | { |
77 | - $iframe_js['checkbox_dropdown_selector'] = EE_GLOBAL_ASSETS_URL . 'scripts/checkbox_dropdown_selector.js'; |
|
77 | + $iframe_js['checkbox_dropdown_selector'] = EE_GLOBAL_ASSETS_URL.'scripts/checkbox_dropdown_selector.js'; |
|
78 | 78 | return $iframe_js; |
79 | 79 | } |
80 | 80 | |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | // $multi = count( $input->options() ) > 1 ? TRUE : FALSE; |
91 | 91 | $input->set_label_sizes(); |
92 | 92 | $label_size_class = $input->get_label_size_class(); |
93 | - if (! is_array($input->raw_value()) && $input->raw_value() !== null) { |
|
93 | + if ( ! is_array($input->raw_value()) && $input->raw_value() !== null) { |
|
94 | 94 | EE_Error::doing_it_wrong( |
95 | 95 | 'EE_Checkbox_Display_Strategy::display()', |
96 | 96 | sprintf( |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | ), |
101 | 101 | $input->html_id(), |
102 | 102 | var_export($input->raw_value(), true), |
103 | - $input->html_name() . '[]' |
|
103 | + $input->html_name().'[]' |
|
104 | 104 | ), |
105 | 105 | '4.8.1' |
106 | 106 | ); |
@@ -108,19 +108,19 @@ discard block |
||
108 | 108 | |
109 | 109 | |
110 | 110 | $html = \EEH_HTML::div('', '', 'checkbox-dropdown-selector-wrap-dv'); |
111 | - $html .= '<button id="' . $input->html_id() . '-btn"'; |
|
111 | + $html .= '<button id="'.$input->html_id().'-btn"'; |
|
112 | 112 | // $html .= ' name="' . $input->html_name() . '"'; |
113 | - $html .= ' class="' . $input->html_class() . ' checkbox-dropdown-selector-btn button-secondary button"'; |
|
114 | - $html .= ' style="' . $input->html_style() . '"'; |
|
115 | - $html .= ' data-target="' . $input->html_id() . '-options-dv"'; |
|
116 | - $html .= ' ' . $input->html_other_attributes() . '>'; |
|
113 | + $html .= ' class="'.$input->html_class().' checkbox-dropdown-selector-btn button-secondary button"'; |
|
114 | + $html .= ' style="'.$input->html_style().'"'; |
|
115 | + $html .= ' data-target="'.$input->html_id().'-options-dv"'; |
|
116 | + $html .= ' '.$input->html_other_attributes().'>'; |
|
117 | 117 | $html .= '<span class="checkbox-dropdown-selector-selected-spn">'; |
118 | 118 | $html .= $select_button_text; |
119 | 119 | $html .= '</span> <span class="dashicons dashicons-arrow-down"></span>'; |
120 | 120 | $html .= '</button>'; |
121 | 121 | $html .= EEH_HTML::div( |
122 | 122 | '', |
123 | - $input->html_id() . '-options-dv', |
|
123 | + $input->html_id().'-options-dv', |
|
124 | 124 | 'checkbox-dropdown-selector' |
125 | 125 | ); |
126 | 126 | $html .= EEH_HTML::link( |
@@ -146,18 +146,18 @@ discard block |
||
146 | 146 | . '">'; |
147 | 147 | $html .= EEH_HTML::nl(1, 'checkbox'); |
148 | 148 | $html .= '<input type="checkbox"'; |
149 | - $html .= ' name="' . $input->html_name() . '[]"'; |
|
150 | - $html .= ' id="' . $html_id . '"'; |
|
151 | - $html .= ' class="' . $input->html_class() . '-option"'; |
|
152 | - $html .= ' style="' . $input->html_style() . '"'; |
|
153 | - $html .= ' value="' . esc_attr($value) . '"'; |
|
149 | + $html .= ' name="'.$input->html_name().'[]"'; |
|
150 | + $html .= ' id="'.$html_id.'"'; |
|
151 | + $html .= ' class="'.$input->html_class().'-option"'; |
|
152 | + $html .= ' style="'.$input->html_style().'"'; |
|
153 | + $html .= ' value="'.esc_attr($value).'"'; |
|
154 | 154 | $html .= ! empty($input_raw_value) && in_array($value, $input_raw_value, true) |
155 | 155 | ? ' checked="checked"' |
156 | 156 | : ''; |
157 | - $html .= ' ' . $this->_input->other_html_attributes(); |
|
157 | + $html .= ' '.$this->_input->other_html_attributes(); |
|
158 | 158 | $html .= '>'; |
159 | - $html .= '<span class="datetime-selector-option-text-spn">' . $display_text . '</span>'; |
|
160 | - $html .= EEH_HTML::nl(-1, 'checkbox') . '</label>'; |
|
159 | + $html .= '<span class="datetime-selector-option-text-spn">'.$display_text.'</span>'; |
|
160 | + $html .= EEH_HTML::nl(-1, 'checkbox').'</label>'; |
|
161 | 161 | $html .= EEH_HTML::lix(); |
162 | 162 | } |
163 | 163 | $html .= EEH_HTML::ulx(); |