@@ -12,26 +12,26 @@ |
||
12 | 12 | { |
13 | 13 | |
14 | 14 | |
15 | - /** |
|
16 | - * @param array $options |
|
17 | - */ |
|
18 | - public function __construct($options = array()) |
|
19 | - { |
|
20 | - $this->_set_display_strategy(new EE_Text_Input_Display_Strategy()); |
|
21 | - $this->_set_normalization_strategy(new EE_Text_Normalization()); |
|
22 | - parent::__construct($options); |
|
23 | - // if the input hasn't specifically mentioned a more lenient validation strategy, |
|
24 | - // apply plaintext validation strategy |
|
25 | - if (! $this->has_validation_strategy( |
|
26 | - array( |
|
27 | - 'EE_Full_HTML_Validation_Strategy', |
|
28 | - 'EE_Simple_HTML_Validation_Strategy' |
|
29 | - ) |
|
30 | - ) |
|
31 | - ) { |
|
32 | - // by default we use the plaintext validation. If you want something else, |
|
33 | - // just remove it after the input is constructed :P using EE_Form_Input_Base::remove_validation_strategy() |
|
34 | - $this->_add_validation_strategy(new EE_Plaintext_Validation_Strategy()); |
|
35 | - } |
|
36 | - } |
|
15 | + /** |
|
16 | + * @param array $options |
|
17 | + */ |
|
18 | + public function __construct($options = array()) |
|
19 | + { |
|
20 | + $this->_set_display_strategy(new EE_Text_Input_Display_Strategy()); |
|
21 | + $this->_set_normalization_strategy(new EE_Text_Normalization()); |
|
22 | + parent::__construct($options); |
|
23 | + // if the input hasn't specifically mentioned a more lenient validation strategy, |
|
24 | + // apply plaintext validation strategy |
|
25 | + if (! $this->has_validation_strategy( |
|
26 | + array( |
|
27 | + 'EE_Full_HTML_Validation_Strategy', |
|
28 | + 'EE_Simple_HTML_Validation_Strategy' |
|
29 | + ) |
|
30 | + ) |
|
31 | + ) { |
|
32 | + // by default we use the plaintext validation. If you want something else, |
|
33 | + // just remove it after the input is constructed :P using EE_Form_Input_Base::remove_validation_strategy() |
|
34 | + $this->_add_validation_strategy(new EE_Plaintext_Validation_Strategy()); |
|
35 | + } |
|
36 | + } |
|
37 | 37 | } |
@@ -22,7 +22,7 @@ |
||
22 | 22 | parent::__construct($options); |
23 | 23 | // if the input hasn't specifically mentioned a more lenient validation strategy, |
24 | 24 | // apply plaintext validation strategy |
25 | - if (! $this->has_validation_strategy( |
|
25 | + if ( ! $this->has_validation_strategy( |
|
26 | 26 | array( |
27 | 27 | 'EE_Full_HTML_Validation_Strategy', |
28 | 28 | 'EE_Simple_HTML_Validation_Strategy' |
@@ -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; |