@@ -12,117 +12,117 @@ |
||
12 | 12 | { |
13 | 13 | |
14 | 14 | |
15 | - /** |
|
16 | - * This is a flag indicating whether to use '<br>' tags after each input in the layout |
|
17 | - * strategy. |
|
18 | - * |
|
19 | - * @var bool |
|
20 | - */ |
|
21 | - protected $_use_break_tags = true; |
|
22 | - |
|
23 | - |
|
24 | - |
|
25 | - /** |
|
26 | - * EE_No_Layout constructor. |
|
27 | - * |
|
28 | - * @param array $options Currently if this has a 'use_break_tags' key that is used to set the _use_break_tags |
|
29 | - * property on the class. |
|
30 | - */ |
|
31 | - public function __construct($options = array()) |
|
32 | - { |
|
33 | - $this->_use_break_tags = is_array($options) && isset($options['use_break_tags']) |
|
34 | - ? filter_var($options['use_break_tags'], FILTER_VALIDATE_BOOLEAN) |
|
35 | - : $this->_use_break_tags; |
|
36 | - parent::__construct(); |
|
37 | - } |
|
38 | - |
|
39 | - |
|
40 | - |
|
41 | - /** |
|
42 | - * Add line break at beginning of form |
|
43 | - * |
|
44 | - * @return string |
|
45 | - */ |
|
46 | - public function layout_form_begin() |
|
47 | - { |
|
48 | - return EEH_HTML::nl(1); |
|
49 | - } |
|
50 | - |
|
51 | - |
|
52 | - |
|
53 | - /** |
|
54 | - * Lays out the row for the input, including label and errors |
|
55 | - * |
|
56 | - * @param EE_Form_Input_Base $input |
|
57 | - * @return string |
|
58 | - * @throws \EE_Error |
|
59 | - */ |
|
60 | - public function layout_input($input) |
|
61 | - { |
|
62 | - $html = ''; |
|
63 | - if ($input instanceof EE_Hidden_Input) { |
|
64 | - $html .= EEH_HTML::nl() . $input->get_html_for_input(); |
|
65 | - } elseif ($input instanceof EE_Submit_Input) { |
|
66 | - $html .= $this->br(); |
|
67 | - $html .= $input->get_html_for_input(); |
|
68 | - } elseif ($input instanceof EE_Select_Input) { |
|
69 | - $html .= $this->br(); |
|
70 | - $html .= EEH_HTML::nl(1) . $input->get_html_for_label(); |
|
71 | - $html .= EEH_HTML::nl() . $input->get_html_for_errors(); |
|
72 | - $html .= EEH_HTML::nl() . $input->get_html_for_input(); |
|
73 | - $html .= EEH_HTML::nl() . $input->get_html_for_help(); |
|
74 | - $html .= $this->br(); |
|
75 | - } elseif ($input instanceof EE_Form_Input_With_Options_Base) { |
|
76 | - $html .= $this->br(); |
|
77 | - $html .= EEH_HTML::nl() . $input->get_html_for_errors(); |
|
78 | - $html .= EEH_HTML::nl() . $input->get_html_for_input(); |
|
79 | - $html .= EEH_HTML::nl() . $input->get_html_for_help(); |
|
80 | - } else { |
|
81 | - $html .= $this->br(); |
|
82 | - $html .= EEH_HTML::nl(1) . $input->get_html_for_label(); |
|
83 | - $html .= EEH_HTML::nl() . $input->get_html_for_errors(); |
|
84 | - $html .= EEH_HTML::nl() . $input->get_html_for_input(); |
|
85 | - $html .= EEH_HTML::nl() . $input->get_html_for_help(); |
|
86 | - } |
|
87 | - $html .= EEH_HTML::nl(-1); |
|
88 | - return $html; |
|
89 | - } |
|
90 | - |
|
91 | - |
|
92 | - |
|
93 | - /** |
|
94 | - * Lays out a row for the subsection |
|
95 | - * |
|
96 | - * @param EE_Form_Section_Proper $form_section |
|
97 | - * @return string |
|
98 | - */ |
|
99 | - public function layout_subsection($form_section) |
|
100 | - { |
|
101 | - // d( $form_section ); |
|
102 | - return EEH_HTML::nl(1) . $form_section->get_html() . EEH_HTML::nl(-1); |
|
103 | - } |
|
104 | - |
|
105 | - |
|
106 | - |
|
107 | - /** |
|
108 | - * Add line break at end of form. |
|
109 | - * |
|
110 | - * @return string |
|
111 | - */ |
|
112 | - public function layout_form_end() |
|
113 | - { |
|
114 | - return EEH_HTML::nl(-1); |
|
115 | - } |
|
116 | - |
|
117 | - |
|
118 | - |
|
119 | - /** |
|
120 | - * This returns a break tag or an empty string depending on the value of the `_use_break_tags` property. |
|
121 | - * |
|
122 | - * @return string |
|
123 | - */ |
|
124 | - protected function br() |
|
125 | - { |
|
126 | - return $this->_use_break_tags ? EEH_HTML::br() : ''; |
|
127 | - } |
|
15 | + /** |
|
16 | + * This is a flag indicating whether to use '<br>' tags after each input in the layout |
|
17 | + * strategy. |
|
18 | + * |
|
19 | + * @var bool |
|
20 | + */ |
|
21 | + protected $_use_break_tags = true; |
|
22 | + |
|
23 | + |
|
24 | + |
|
25 | + /** |
|
26 | + * EE_No_Layout constructor. |
|
27 | + * |
|
28 | + * @param array $options Currently if this has a 'use_break_tags' key that is used to set the _use_break_tags |
|
29 | + * property on the class. |
|
30 | + */ |
|
31 | + public function __construct($options = array()) |
|
32 | + { |
|
33 | + $this->_use_break_tags = is_array($options) && isset($options['use_break_tags']) |
|
34 | + ? filter_var($options['use_break_tags'], FILTER_VALIDATE_BOOLEAN) |
|
35 | + : $this->_use_break_tags; |
|
36 | + parent::__construct(); |
|
37 | + } |
|
38 | + |
|
39 | + |
|
40 | + |
|
41 | + /** |
|
42 | + * Add line break at beginning of form |
|
43 | + * |
|
44 | + * @return string |
|
45 | + */ |
|
46 | + public function layout_form_begin() |
|
47 | + { |
|
48 | + return EEH_HTML::nl(1); |
|
49 | + } |
|
50 | + |
|
51 | + |
|
52 | + |
|
53 | + /** |
|
54 | + * Lays out the row for the input, including label and errors |
|
55 | + * |
|
56 | + * @param EE_Form_Input_Base $input |
|
57 | + * @return string |
|
58 | + * @throws \EE_Error |
|
59 | + */ |
|
60 | + public function layout_input($input) |
|
61 | + { |
|
62 | + $html = ''; |
|
63 | + if ($input instanceof EE_Hidden_Input) { |
|
64 | + $html .= EEH_HTML::nl() . $input->get_html_for_input(); |
|
65 | + } elseif ($input instanceof EE_Submit_Input) { |
|
66 | + $html .= $this->br(); |
|
67 | + $html .= $input->get_html_for_input(); |
|
68 | + } elseif ($input instanceof EE_Select_Input) { |
|
69 | + $html .= $this->br(); |
|
70 | + $html .= EEH_HTML::nl(1) . $input->get_html_for_label(); |
|
71 | + $html .= EEH_HTML::nl() . $input->get_html_for_errors(); |
|
72 | + $html .= EEH_HTML::nl() . $input->get_html_for_input(); |
|
73 | + $html .= EEH_HTML::nl() . $input->get_html_for_help(); |
|
74 | + $html .= $this->br(); |
|
75 | + } elseif ($input instanceof EE_Form_Input_With_Options_Base) { |
|
76 | + $html .= $this->br(); |
|
77 | + $html .= EEH_HTML::nl() . $input->get_html_for_errors(); |
|
78 | + $html .= EEH_HTML::nl() . $input->get_html_for_input(); |
|
79 | + $html .= EEH_HTML::nl() . $input->get_html_for_help(); |
|
80 | + } else { |
|
81 | + $html .= $this->br(); |
|
82 | + $html .= EEH_HTML::nl(1) . $input->get_html_for_label(); |
|
83 | + $html .= EEH_HTML::nl() . $input->get_html_for_errors(); |
|
84 | + $html .= EEH_HTML::nl() . $input->get_html_for_input(); |
|
85 | + $html .= EEH_HTML::nl() . $input->get_html_for_help(); |
|
86 | + } |
|
87 | + $html .= EEH_HTML::nl(-1); |
|
88 | + return $html; |
|
89 | + } |
|
90 | + |
|
91 | + |
|
92 | + |
|
93 | + /** |
|
94 | + * Lays out a row for the subsection |
|
95 | + * |
|
96 | + * @param EE_Form_Section_Proper $form_section |
|
97 | + * @return string |
|
98 | + */ |
|
99 | + public function layout_subsection($form_section) |
|
100 | + { |
|
101 | + // d( $form_section ); |
|
102 | + return EEH_HTML::nl(1) . $form_section->get_html() . EEH_HTML::nl(-1); |
|
103 | + } |
|
104 | + |
|
105 | + |
|
106 | + |
|
107 | + /** |
|
108 | + * Add line break at end of form. |
|
109 | + * |
|
110 | + * @return string |
|
111 | + */ |
|
112 | + public function layout_form_end() |
|
113 | + { |
|
114 | + return EEH_HTML::nl(-1); |
|
115 | + } |
|
116 | + |
|
117 | + |
|
118 | + |
|
119 | + /** |
|
120 | + * This returns a break tag or an empty string depending on the value of the `_use_break_tags` property. |
|
121 | + * |
|
122 | + * @return string |
|
123 | + */ |
|
124 | + protected function br() |
|
125 | + { |
|
126 | + return $this->_use_break_tags ? EEH_HTML::br() : ''; |
|
127 | + } |
|
128 | 128 | } |
@@ -61,28 +61,28 @@ discard block |
||
61 | 61 | { |
62 | 62 | $html = ''; |
63 | 63 | if ($input instanceof EE_Hidden_Input) { |
64 | - $html .= EEH_HTML::nl() . $input->get_html_for_input(); |
|
64 | + $html .= EEH_HTML::nl().$input->get_html_for_input(); |
|
65 | 65 | } elseif ($input instanceof EE_Submit_Input) { |
66 | 66 | $html .= $this->br(); |
67 | 67 | $html .= $input->get_html_for_input(); |
68 | 68 | } elseif ($input instanceof EE_Select_Input) { |
69 | 69 | $html .= $this->br(); |
70 | - $html .= EEH_HTML::nl(1) . $input->get_html_for_label(); |
|
71 | - $html .= EEH_HTML::nl() . $input->get_html_for_errors(); |
|
72 | - $html .= EEH_HTML::nl() . $input->get_html_for_input(); |
|
73 | - $html .= EEH_HTML::nl() . $input->get_html_for_help(); |
|
70 | + $html .= EEH_HTML::nl(1).$input->get_html_for_label(); |
|
71 | + $html .= EEH_HTML::nl().$input->get_html_for_errors(); |
|
72 | + $html .= EEH_HTML::nl().$input->get_html_for_input(); |
|
73 | + $html .= EEH_HTML::nl().$input->get_html_for_help(); |
|
74 | 74 | $html .= $this->br(); |
75 | 75 | } elseif ($input instanceof EE_Form_Input_With_Options_Base) { |
76 | 76 | $html .= $this->br(); |
77 | - $html .= EEH_HTML::nl() . $input->get_html_for_errors(); |
|
78 | - $html .= EEH_HTML::nl() . $input->get_html_for_input(); |
|
79 | - $html .= EEH_HTML::nl() . $input->get_html_for_help(); |
|
77 | + $html .= EEH_HTML::nl().$input->get_html_for_errors(); |
|
78 | + $html .= EEH_HTML::nl().$input->get_html_for_input(); |
|
79 | + $html .= EEH_HTML::nl().$input->get_html_for_help(); |
|
80 | 80 | } else { |
81 | 81 | $html .= $this->br(); |
82 | - $html .= EEH_HTML::nl(1) . $input->get_html_for_label(); |
|
83 | - $html .= EEH_HTML::nl() . $input->get_html_for_errors(); |
|
84 | - $html .= EEH_HTML::nl() . $input->get_html_for_input(); |
|
85 | - $html .= EEH_HTML::nl() . $input->get_html_for_help(); |
|
82 | + $html .= EEH_HTML::nl(1).$input->get_html_for_label(); |
|
83 | + $html .= EEH_HTML::nl().$input->get_html_for_errors(); |
|
84 | + $html .= EEH_HTML::nl().$input->get_html_for_input(); |
|
85 | + $html .= EEH_HTML::nl().$input->get_html_for_help(); |
|
86 | 86 | } |
87 | 87 | $html .= EEH_HTML::nl(-1); |
88 | 88 | return $html; |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | public function layout_subsection($form_section) |
100 | 100 | { |
101 | 101 | // d( $form_section ); |
102 | - return EEH_HTML::nl(1) . $form_section->get_html() . EEH_HTML::nl(-1); |
|
102 | + return EEH_HTML::nl(1).$form_section->get_html().EEH_HTML::nl(-1); |
|
103 | 103 | } |
104 | 104 | |
105 | 105 |
@@ -13,58 +13,58 @@ |
||
13 | 13 | */ |
14 | 14 | class EE_Many_Valued_Validation_Strategy extends EE_Validation_Strategy_Base |
15 | 15 | { |
16 | - protected $_individual_item_validation_strategies = array(); |
|
17 | - /** |
|
18 | - * |
|
19 | - * @param EE_Validation_Strategy_Base[] $individual_item_validation_strategies (or a single EE_Validation_Strategy_Base) |
|
20 | - */ |
|
21 | - public function __construct($individual_item_validation_strategies) |
|
22 | - { |
|
23 | - if (! is_array($individual_item_validation_strategies)) { |
|
24 | - $individual_item_validation_strategies = array($individual_item_validation_strategies); |
|
25 | - } |
|
26 | - $this->_individual_item_validation_strategies = $individual_item_validation_strategies; |
|
27 | - parent::__construct(); |
|
28 | - } |
|
16 | + protected $_individual_item_validation_strategies = array(); |
|
17 | + /** |
|
18 | + * |
|
19 | + * @param EE_Validation_Strategy_Base[] $individual_item_validation_strategies (or a single EE_Validation_Strategy_Base) |
|
20 | + */ |
|
21 | + public function __construct($individual_item_validation_strategies) |
|
22 | + { |
|
23 | + if (! is_array($individual_item_validation_strategies)) { |
|
24 | + $individual_item_validation_strategies = array($individual_item_validation_strategies); |
|
25 | + } |
|
26 | + $this->_individual_item_validation_strategies = $individual_item_validation_strategies; |
|
27 | + parent::__construct(); |
|
28 | + } |
|
29 | 29 | |
30 | 30 | |
31 | 31 | |
32 | - /** |
|
33 | - * Applies all teh individual item validation strategies on each item in the array |
|
34 | - * @param array $normalized_value |
|
35 | - * @return boolean |
|
36 | - */ |
|
37 | - public function validate($normalized_value) |
|
38 | - { |
|
39 | - if (is_array($normalized_value)) { |
|
40 | - $items_to_validate = $normalized_value; |
|
41 | - } else { |
|
42 | - $items_to_validate = array($normalized_value); |
|
43 | - } |
|
44 | - foreach ($items_to_validate as $individual_item) { |
|
45 | - foreach ($this->_individual_item_validation_strategies as $validation_strategy) { |
|
46 | - if ($validation_strategy instanceof EE_Validation_Strategy_Base) { |
|
47 | - $validation_strategy->validate($individual_item); |
|
48 | - } |
|
49 | - } |
|
50 | - } |
|
51 | - return true; |
|
52 | - } |
|
32 | + /** |
|
33 | + * Applies all teh individual item validation strategies on each item in the array |
|
34 | + * @param array $normalized_value |
|
35 | + * @return boolean |
|
36 | + */ |
|
37 | + public function validate($normalized_value) |
|
38 | + { |
|
39 | + if (is_array($normalized_value)) { |
|
40 | + $items_to_validate = $normalized_value; |
|
41 | + } else { |
|
42 | + $items_to_validate = array($normalized_value); |
|
43 | + } |
|
44 | + foreach ($items_to_validate as $individual_item) { |
|
45 | + foreach ($this->_individual_item_validation_strategies as $validation_strategy) { |
|
46 | + if ($validation_strategy instanceof EE_Validation_Strategy_Base) { |
|
47 | + $validation_strategy->validate($individual_item); |
|
48 | + } |
|
49 | + } |
|
50 | + } |
|
51 | + return true; |
|
52 | + } |
|
53 | 53 | |
54 | 54 | |
55 | 55 | |
56 | - /** |
|
57 | - * Extends parent's _construct_finalize so we ALSO set the input |
|
58 | - * on each sub-validation-strategy |
|
59 | - * @param \EE_Form_Input_Base $form_input |
|
60 | - */ |
|
61 | - public function _construct_finalize(\EE_Form_Input_Base $form_input) |
|
62 | - { |
|
63 | - parent::_construct_finalize($form_input); |
|
64 | - foreach ($this->_individual_item_validation_strategies as $item_validation_strategy) { |
|
65 | - if ($item_validation_strategy instanceof EE_Validation_Strategy_Base) { |
|
66 | - $item_validation_strategy->_construct_finalize($form_input); |
|
67 | - } |
|
68 | - } |
|
69 | - } |
|
56 | + /** |
|
57 | + * Extends parent's _construct_finalize so we ALSO set the input |
|
58 | + * on each sub-validation-strategy |
|
59 | + * @param \EE_Form_Input_Base $form_input |
|
60 | + */ |
|
61 | + public function _construct_finalize(\EE_Form_Input_Base $form_input) |
|
62 | + { |
|
63 | + parent::_construct_finalize($form_input); |
|
64 | + foreach ($this->_individual_item_validation_strategies as $item_validation_strategy) { |
|
65 | + if ($item_validation_strategy instanceof EE_Validation_Strategy_Base) { |
|
66 | + $item_validation_strategy->_construct_finalize($form_input); |
|
67 | + } |
|
68 | + } |
|
69 | + } |
|
70 | 70 | } |
@@ -20,7 +20,7 @@ |
||
20 | 20 | */ |
21 | 21 | public function __construct($individual_item_validation_strategies) |
22 | 22 | { |
23 | - if (! is_array($individual_item_validation_strategies)) { |
|
23 | + if ( ! is_array($individual_item_validation_strategies)) { |
|
24 | 24 | $individual_item_validation_strategies = array($individual_item_validation_strategies); |
25 | 25 | } |
26 | 26 | $this->_individual_item_validation_strategies = $individual_item_validation_strategies; |
@@ -11,16 +11,16 @@ |
||
11 | 11 | */ |
12 | 12 | abstract class EE_Sensitive_Data_Removal_Base extends EE_Form_Input_Strategy_Base |
13 | 13 | { |
14 | - /** |
|
15 | - * Removes all the sensitive data from this normalized value. |
|
16 | - * For example, should could 'mask' a credit card from |
|
17 | - * '1234 1234 1234 1234' TO '**** **** **** 1234'. |
|
18 | - * Or turn a ccv number from |
|
19 | - * '123' to '***', |
|
20 | - * or turn a password from |
|
21 | - * 'CantHac7Th15' to '*************', |
|
22 | - * or just leave htevalue as-is |
|
23 | - * @return mixed |
|
24 | - */ |
|
25 | - abstract public function remove_sensitive_data($normalized_value); |
|
14 | + /** |
|
15 | + * Removes all the sensitive data from this normalized value. |
|
16 | + * For example, should could 'mask' a credit card from |
|
17 | + * '1234 1234 1234 1234' TO '**** **** **** 1234'. |
|
18 | + * Or turn a ccv number from |
|
19 | + * '123' to '***', |
|
20 | + * or turn a password from |
|
21 | + * 'CantHac7Th15' to '*************', |
|
22 | + * or just leave htevalue as-is |
|
23 | + * @return mixed |
|
24 | + */ |
|
25 | + abstract public function remove_sensitive_data($normalized_value); |
|
26 | 26 | } |
@@ -11,23 +11,23 @@ |
||
11 | 11 | */ |
12 | 12 | class EE_All_Sensitive_Data_Removal extends EE_Sensitive_Data_Removal_Base |
13 | 13 | { |
14 | - public function remove_sensitive_data($normalized_value) |
|
15 | - { |
|
16 | - switch (gettype($normalized_value)) { |
|
17 | - case "boolean": |
|
18 | - return false; |
|
19 | - case "integer": |
|
20 | - case "double": |
|
21 | - return 0; |
|
22 | - case "string": |
|
23 | - return ''; |
|
24 | - case "array": |
|
25 | - return array(); |
|
26 | - case "object": |
|
27 | - case "resource": |
|
28 | - case "NULL": |
|
29 | - default: |
|
30 | - return null; |
|
31 | - } |
|
32 | - } |
|
14 | + public function remove_sensitive_data($normalized_value) |
|
15 | + { |
|
16 | + switch (gettype($normalized_value)) { |
|
17 | + case "boolean": |
|
18 | + return false; |
|
19 | + case "integer": |
|
20 | + case "double": |
|
21 | + return 0; |
|
22 | + case "string": |
|
23 | + return ''; |
|
24 | + case "array": |
|
25 | + return array(); |
|
26 | + case "object": |
|
27 | + case "resource": |
|
28 | + case "NULL": |
|
29 | + default: |
|
30 | + return null; |
|
31 | + } |
|
32 | + } |
|
33 | 33 | } |
@@ -11,8 +11,8 @@ |
||
11 | 11 | */ |
12 | 12 | class EE_No_Sensitive_Data_Removal extends EE_Sensitive_Data_Removal_Base |
13 | 13 | { |
14 | - public function remove_sensitive_data($normalized_value) |
|
15 | - { |
|
16 | - return $normalized_value; |
|
17 | - } |
|
14 | + public function remove_sensitive_data($normalized_value) |
|
15 | + { |
|
16 | + return $normalized_value; |
|
17 | + } |
|
18 | 18 | } |
@@ -14,30 +14,30 @@ |
||
14 | 14 | class EE_Form_Section_HTML extends EE_Form_Section_Base |
15 | 15 | { |
16 | 16 | |
17 | - protected $_html = ''; |
|
17 | + protected $_html = ''; |
|
18 | 18 | |
19 | 19 | |
20 | 20 | |
21 | - /** |
|
22 | - * @param string $html |
|
23 | - * @param array $options_array |
|
24 | - */ |
|
25 | - public function __construct($html = '', $options_array = array()) |
|
26 | - { |
|
27 | - $this->_html = $html; |
|
28 | - parent::__construct($options_array); |
|
29 | - } |
|
21 | + /** |
|
22 | + * @param string $html |
|
23 | + * @param array $options_array |
|
24 | + */ |
|
25 | + public function __construct($html = '', $options_array = array()) |
|
26 | + { |
|
27 | + $this->_html = $html; |
|
28 | + parent::__construct($options_array); |
|
29 | + } |
|
30 | 30 | |
31 | 31 | |
32 | 32 | |
33 | - /** |
|
34 | - * Returns the HTML |
|
35 | - * @return string |
|
36 | - */ |
|
37 | - public function get_html() |
|
38 | - { |
|
39 | - return $this->_html; |
|
40 | - } |
|
33 | + /** |
|
34 | + * Returns the HTML |
|
35 | + * @return string |
|
36 | + */ |
|
37 | + public function get_html() |
|
38 | + { |
|
39 | + return $this->_html; |
|
40 | + } |
|
41 | 41 | } |
42 | 42 | |
43 | 43 | // End of file EE_Form_Section_HTML.form.php |
@@ -11,11 +11,11 @@ |
||
11 | 11 | */ |
12 | 12 | class EE_Form_Section_HTML_From_Template extends EE_Form_Section_HTML |
13 | 13 | { |
14 | - public function __construct($template_file, $args = array(), $options_array = array()) |
|
15 | - { |
|
16 | - $html = EEH_Template::locate_template($template_file, $args); |
|
14 | + public function __construct($template_file, $args = array(), $options_array = array()) |
|
15 | + { |
|
16 | + $html = EEH_Template::locate_template($template_file, $args); |
|
17 | 17 | |
18 | 18 | // echo " filepath:$template_file html $html"; |
19 | - parent::__construct($html, $options_array); |
|
20 | - } |
|
19 | + parent::__construct($html, $options_array); |
|
20 | + } |
|
21 | 21 | } |
@@ -81,7 +81,7 @@ |
||
81 | 81 | */ |
82 | 82 | public function html_class() |
83 | 83 | { |
84 | - return ! empty($this->_html_class) ? $this->_html_class . ' ee-billing-form' : 'ee-billing-form'; |
|
84 | + return ! empty($this->_html_class) ? $this->_html_class.' ee-billing-form' : 'ee-billing-form'; |
|
85 | 85 | } |
86 | 86 | } |
87 | 87 | // End of file EE_Billing_Info_Form.form.php |
@@ -15,74 +15,74 @@ |
||
15 | 15 | class EE_Billing_Info_Form extends EE_Form_Section_Proper |
16 | 16 | { |
17 | 17 | |
18 | - /** |
|
19 | - * The payment method this billing form is for |
|
20 | - * @var EE_Payment_Method |
|
21 | - */ |
|
22 | - protected $_pm_instance; |
|
23 | - |
|
24 | - |
|
25 | - |
|
26 | - /** |
|
27 | - * |
|
28 | - * @param EE_Payment_Method $payment_method |
|
29 | - * @param array $options_array @see EE_Form_Section_Proper::__construct() |
|
30 | - */ |
|
31 | - public function __construct(EE_Payment_Method $payment_method, $options_array = array()) |
|
32 | - { |
|
33 | - $this->_pm_instance = $payment_method; |
|
34 | - $this->_layout_strategy = new EE_Div_Per_Section_Layout(); |
|
35 | - parent::__construct($options_array); |
|
36 | - } |
|
37 | - |
|
38 | - |
|
39 | - |
|
40 | - /** |
|
41 | - * Sets the payment method for this billing form |
|
42 | - * @param EE_Payment_Method $payment_method |
|
43 | - * @return void |
|
44 | - */ |
|
45 | - public function set_payment_method(EE_Payment_Method $payment_method) |
|
46 | - { |
|
47 | - $this->_pm_instance = $payment_method; |
|
48 | - } |
|
49 | - |
|
50 | - |
|
51 | - |
|
52 | - /** |
|
53 | - * Returns the instance of the payment method this billing form is for |
|
54 | - * @return EE_Payment_Method |
|
55 | - */ |
|
56 | - public function payment_method() |
|
57 | - { |
|
58 | - return $this->_pm_instance; |
|
59 | - } |
|
60 | - |
|
61 | - |
|
62 | - |
|
63 | - /** |
|
64 | - * payment_fields_autofilled_notice_html |
|
65 | - * @return string |
|
66 | - */ |
|
67 | - public function payment_fields_autofilled_notice_html() |
|
68 | - { |
|
69 | - return new EE_Form_Section_HTML( |
|
70 | - EEH_HTML::p( |
|
71 | - apply_filters('FHEE__EE_Billing_Info_Form__payment_fields_autofilled_notice_html_text', esc_html__('Payment fields have been autofilled because you are in debug mode', 'event_espresso')), |
|
72 | - '', |
|
73 | - 'important-notice' |
|
74 | - ) |
|
75 | - ); |
|
76 | - } |
|
77 | - |
|
78 | - |
|
79 | - |
|
80 | - /** |
|
81 | - * @return string |
|
82 | - */ |
|
83 | - public function html_class() |
|
84 | - { |
|
85 | - return ! empty($this->_html_class) ? $this->_html_class . ' ee-billing-form' : 'ee-billing-form'; |
|
86 | - } |
|
18 | + /** |
|
19 | + * The payment method this billing form is for |
|
20 | + * @var EE_Payment_Method |
|
21 | + */ |
|
22 | + protected $_pm_instance; |
|
23 | + |
|
24 | + |
|
25 | + |
|
26 | + /** |
|
27 | + * |
|
28 | + * @param EE_Payment_Method $payment_method |
|
29 | + * @param array $options_array @see EE_Form_Section_Proper::__construct() |
|
30 | + */ |
|
31 | + public function __construct(EE_Payment_Method $payment_method, $options_array = array()) |
|
32 | + { |
|
33 | + $this->_pm_instance = $payment_method; |
|
34 | + $this->_layout_strategy = new EE_Div_Per_Section_Layout(); |
|
35 | + parent::__construct($options_array); |
|
36 | + } |
|
37 | + |
|
38 | + |
|
39 | + |
|
40 | + /** |
|
41 | + * Sets the payment method for this billing form |
|
42 | + * @param EE_Payment_Method $payment_method |
|
43 | + * @return void |
|
44 | + */ |
|
45 | + public function set_payment_method(EE_Payment_Method $payment_method) |
|
46 | + { |
|
47 | + $this->_pm_instance = $payment_method; |
|
48 | + } |
|
49 | + |
|
50 | + |
|
51 | + |
|
52 | + /** |
|
53 | + * Returns the instance of the payment method this billing form is for |
|
54 | + * @return EE_Payment_Method |
|
55 | + */ |
|
56 | + public function payment_method() |
|
57 | + { |
|
58 | + return $this->_pm_instance; |
|
59 | + } |
|
60 | + |
|
61 | + |
|
62 | + |
|
63 | + /** |
|
64 | + * payment_fields_autofilled_notice_html |
|
65 | + * @return string |
|
66 | + */ |
|
67 | + public function payment_fields_autofilled_notice_html() |
|
68 | + { |
|
69 | + return new EE_Form_Section_HTML( |
|
70 | + EEH_HTML::p( |
|
71 | + apply_filters('FHEE__EE_Billing_Info_Form__payment_fields_autofilled_notice_html_text', esc_html__('Payment fields have been autofilled because you are in debug mode', 'event_espresso')), |
|
72 | + '', |
|
73 | + 'important-notice' |
|
74 | + ) |
|
75 | + ); |
|
76 | + } |
|
77 | + |
|
78 | + |
|
79 | + |
|
80 | + /** |
|
81 | + * @return string |
|
82 | + */ |
|
83 | + public function html_class() |
|
84 | + { |
|
85 | + return ! empty($this->_html_class) ? $this->_html_class . ' ee-billing-form' : 'ee-billing-form'; |
|
86 | + } |
|
87 | 87 | } |
88 | 88 | // End of file EE_Billing_Info_Form.form.php |
@@ -2,47 +2,47 @@ |
||
2 | 2 | |
3 | 3 | class EE_Validation_Error extends Exception |
4 | 4 | { |
5 | - /** |
|
6 | - * Form Section from which this error originated. |
|
7 | - * @var EE_Form_Section |
|
8 | - */ |
|
9 | - protected $_form_section; |
|
10 | - /** |
|
11 | - * a short string for uniquely identifying the error, which isn't internationalized and |
|
12 | - * machines can use to identify the error |
|
13 | - * @var string |
|
14 | - */ |
|
15 | - protected $_string_code; |
|
5 | + /** |
|
6 | + * Form Section from which this error originated. |
|
7 | + * @var EE_Form_Section |
|
8 | + */ |
|
9 | + protected $_form_section; |
|
10 | + /** |
|
11 | + * a short string for uniquely identifying the error, which isn't internationalized and |
|
12 | + * machines can use to identify the error |
|
13 | + * @var string |
|
14 | + */ |
|
15 | + protected $_string_code; |
|
16 | 16 | |
17 | - /** |
|
18 | - * When creating a validation error, we need to know which field the error relates to. |
|
19 | - * @param string $message message you want to display about this error |
|
20 | - * @param string $string_code a code for uniquely identifying the exception |
|
21 | - * @param EE_Form_Section_Validatable $form_section |
|
22 | - * @param Exception $previous if there was an exception that caused this exception |
|
23 | - */ |
|
24 | - public function __construct($message = null, $string_code = null, $form_section = null, $previous = null) |
|
25 | - { |
|
26 | - $this->_form_section = $form_section; |
|
27 | - $this->_string_code = $string_code; |
|
28 | - parent::__construct($message, 500, $previous); |
|
29 | - } |
|
17 | + /** |
|
18 | + * When creating a validation error, we need to know which field the error relates to. |
|
19 | + * @param string $message message you want to display about this error |
|
20 | + * @param string $string_code a code for uniquely identifying the exception |
|
21 | + * @param EE_Form_Section_Validatable $form_section |
|
22 | + * @param Exception $previous if there was an exception that caused this exception |
|
23 | + */ |
|
24 | + public function __construct($message = null, $string_code = null, $form_section = null, $previous = null) |
|
25 | + { |
|
26 | + $this->_form_section = $form_section; |
|
27 | + $this->_string_code = $string_code; |
|
28 | + parent::__construct($message, 500, $previous); |
|
29 | + } |
|
30 | 30 | |
31 | - /** |
|
32 | - * returns teh form section which caused the error. |
|
33 | - * @return EE_Form_Section_Validatable |
|
34 | - */ |
|
35 | - public function get_form_section() |
|
36 | - { |
|
37 | - return $this->_form_section; |
|
38 | - } |
|
39 | - /** |
|
40 | - * Sets teh form seciton of the error, in case it wasnt set previously |
|
41 | - * @param EE_Form_Section_Validatable $form_section |
|
42 | - * @return void |
|
43 | - */ |
|
44 | - public function set_form_section($form_section) |
|
45 | - { |
|
46 | - $this->_form_section = $form_section; |
|
47 | - } |
|
31 | + /** |
|
32 | + * returns teh form section which caused the error. |
|
33 | + * @return EE_Form_Section_Validatable |
|
34 | + */ |
|
35 | + public function get_form_section() |
|
36 | + { |
|
37 | + return $this->_form_section; |
|
38 | + } |
|
39 | + /** |
|
40 | + * Sets teh form seciton of the error, in case it wasnt set previously |
|
41 | + * @param EE_Form_Section_Validatable $form_section |
|
42 | + * @return void |
|
43 | + */ |
|
44 | + public function set_form_section($form_section) |
|
45 | + { |
|
46 | + $this->_form_section = $form_section; |
|
47 | + } |
|
48 | 48 | } |