@@ -9,28 +9,28 @@ |
||
9 | 9 | class EE_Hidden_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 | - // require_once('strategies/display_strategies/EE_Text_Input_Display_Strategy.strategy.php'); |
|
18 | - $this->_set_display_strategy(new EE_Hidden_Display_Strategy()); |
|
19 | - if (isset($input_settings['normalization_strategy']) && $input_settings['normalization_strategy'] instanceof EE_Normalization_Strategy_Base) { |
|
20 | - $this->_set_normalization_strategy($input_settings['normalization_strategy']); |
|
21 | - } else { |
|
22 | - $this->_set_normalization_strategy(new EE_Text_Normalization()); |
|
23 | - } |
|
24 | - parent::__construct($input_settings); |
|
25 | - } |
|
12 | + /** |
|
13 | + * @param array $input_settings |
|
14 | + */ |
|
15 | + public function __construct($input_settings = array()) |
|
16 | + { |
|
17 | + // require_once('strategies/display_strategies/EE_Text_Input_Display_Strategy.strategy.php'); |
|
18 | + $this->_set_display_strategy(new EE_Hidden_Display_Strategy()); |
|
19 | + if (isset($input_settings['normalization_strategy']) && $input_settings['normalization_strategy'] instanceof EE_Normalization_Strategy_Base) { |
|
20 | + $this->_set_normalization_strategy($input_settings['normalization_strategy']); |
|
21 | + } else { |
|
22 | + $this->_set_normalization_strategy(new EE_Text_Normalization()); |
|
23 | + } |
|
24 | + parent::__construct($input_settings); |
|
25 | + } |
|
26 | 26 | |
27 | 27 | |
28 | 28 | |
29 | - /** |
|
30 | - * @return string |
|
31 | - */ |
|
32 | - public function get_html_for_label() |
|
33 | - { |
|
34 | - return ''; |
|
35 | - } |
|
29 | + /** |
|
30 | + * @return string |
|
31 | + */ |
|
32 | + public function get_html_for_label() |
|
33 | + { |
|
34 | + return ''; |
|
35 | + } |
|
36 | 36 | } |
@@ -12,75 +12,75 @@ |
||
12 | 12 | { |
13 | 13 | |
14 | 14 | |
15 | - protected $_naming_method; |
|
15 | + protected $_naming_method; |
|
16 | 16 | |
17 | 17 | |
18 | 18 | |
19 | - /** |
|
20 | - * |
|
21 | - * @param EE_Base_Class[] $answer_options |
|
22 | - * @param array $input_settings { |
|
23 | - * @var EE_Base_Class[] or array $default |
|
24 | - * @var string $naming_method function name on the class which will be used for getting the displayed-name. |
|
25 | - * example: if the class were an EE_Event, this could be slug(), description(), name() (default) |
|
26 | - * } |
|
27 | - */ |
|
28 | - public function __construct($answer_options = array(), $input_settings = array()) |
|
29 | - { |
|
30 | - if (isset($input_settings['naming_method'])) { |
|
31 | - $this->set_option_naming_method($input_settings['naming_method']); |
|
32 | - } |
|
33 | - parent::__construct($answer_options, $input_settings); |
|
34 | - } |
|
19 | + /** |
|
20 | + * |
|
21 | + * @param EE_Base_Class[] $answer_options |
|
22 | + * @param array $input_settings { |
|
23 | + * @var EE_Base_Class[] or array $default |
|
24 | + * @var string $naming_method function name on the class which will be used for getting the displayed-name. |
|
25 | + * example: if the class were an EE_Event, this could be slug(), description(), name() (default) |
|
26 | + * } |
|
27 | + */ |
|
28 | + public function __construct($answer_options = array(), $input_settings = array()) |
|
29 | + { |
|
30 | + if (isset($input_settings['naming_method'])) { |
|
31 | + $this->set_option_naming_method($input_settings['naming_method']); |
|
32 | + } |
|
33 | + parent::__construct($answer_options, $input_settings); |
|
34 | + } |
|
35 | 35 | |
36 | - /** |
|
37 | - * Sets the method name which will be called when outputting the options list |
|
38 | - * @param string $method |
|
39 | - */ |
|
40 | - public function set_option_naming_method($method) |
|
41 | - { |
|
42 | - $this->_naming_method = $method; |
|
43 | - } |
|
36 | + /** |
|
37 | + * Sets the method name which will be called when outputting the options list |
|
38 | + * @param string $method |
|
39 | + */ |
|
40 | + public function set_option_naming_method($method) |
|
41 | + { |
|
42 | + $this->_naming_method = $method; |
|
43 | + } |
|
44 | 44 | |
45 | 45 | |
46 | 46 | |
47 | - /** |
|
48 | - * You CAN pass an array of model objects instead of simple values for teh options |
|
49 | - * @param EE_Base_Class[] $answer_options |
|
50 | - * @return null|void |
|
51 | - */ |
|
52 | - public function set_select_options($answer_options = array()) |
|
53 | - { |
|
54 | - // convert the model objects to select from into normal select options |
|
55 | - $select_options = array(); |
|
56 | - foreach ($answer_options as $model_obj) { |
|
57 | - if ($this->_naming_method) { |
|
58 | - $display_value = call_user_func(array( $model_obj, $this->_naming_method )); |
|
59 | - } else { |
|
60 | - $display_value = $model_obj->name(); |
|
61 | - } |
|
62 | - $select_options[ $model_obj->ID() ] = $display_value; |
|
63 | - } |
|
64 | - parent::set_select_options($select_options); |
|
65 | - } |
|
47 | + /** |
|
48 | + * You CAN pass an array of model objects instead of simple values for teh options |
|
49 | + * @param EE_Base_Class[] $answer_options |
|
50 | + * @return null|void |
|
51 | + */ |
|
52 | + public function set_select_options($answer_options = array()) |
|
53 | + { |
|
54 | + // convert the model objects to select from into normal select options |
|
55 | + $select_options = array(); |
|
56 | + foreach ($answer_options as $model_obj) { |
|
57 | + if ($this->_naming_method) { |
|
58 | + $display_value = call_user_func(array( $model_obj, $this->_naming_method )); |
|
59 | + } else { |
|
60 | + $display_value = $model_obj->name(); |
|
61 | + } |
|
62 | + $select_options[ $model_obj->ID() ] = $display_value; |
|
63 | + } |
|
64 | + parent::set_select_options($select_options); |
|
65 | + } |
|
66 | 66 | |
67 | 67 | |
68 | 68 | |
69 | - /** |
|
70 | - * if they passed in an array of model objects for the default, convert it |
|
71 | - * into the format EE_Select_Multiple expects |
|
72 | - * @param EE_Base_Class[]|array $values |
|
73 | - */ |
|
74 | - public function set_default($values) |
|
75 | - { |
|
76 | - $defaults_as_simple_ids = array(); |
|
77 | - foreach ($values as $key => $value) { |
|
78 | - if ($value instanceof EE_Base_Class) { |
|
79 | - $defaults_as_simple_ids[] = $value->ID(); |
|
80 | - } else { |
|
81 | - $defaults_as_simple_ids[] = $value; |
|
82 | - } |
|
83 | - } |
|
84 | - parent::set_default($defaults_as_simple_ids); |
|
85 | - } |
|
69 | + /** |
|
70 | + * if they passed in an array of model objects for the default, convert it |
|
71 | + * into the format EE_Select_Multiple expects |
|
72 | + * @param EE_Base_Class[]|array $values |
|
73 | + */ |
|
74 | + public function set_default($values) |
|
75 | + { |
|
76 | + $defaults_as_simple_ids = array(); |
|
77 | + foreach ($values as $key => $value) { |
|
78 | + if ($value instanceof EE_Base_Class) { |
|
79 | + $defaults_as_simple_ids[] = $value->ID(); |
|
80 | + } else { |
|
81 | + $defaults_as_simple_ids[] = $value; |
|
82 | + } |
|
83 | + } |
|
84 | + parent::set_default($defaults_as_simple_ids); |
|
85 | + } |
|
86 | 86 | } |
@@ -55,11 +55,11 @@ |
||
55 | 55 | $select_options = array(); |
56 | 56 | foreach ($answer_options as $model_obj) { |
57 | 57 | if ($this->_naming_method) { |
58 | - $display_value = call_user_func(array( $model_obj, $this->_naming_method )); |
|
58 | + $display_value = call_user_func(array($model_obj, $this->_naming_method)); |
|
59 | 59 | } else { |
60 | 60 | $display_value = $model_obj->name(); |
61 | 61 | } |
62 | - $select_options[ $model_obj->ID() ] = $display_value; |
|
62 | + $select_options[$model_obj->ID()] = $display_value; |
|
63 | 63 | } |
64 | 64 | parent::set_select_options($select_options); |
65 | 65 | } |
@@ -15,221 +15,221 @@ |
||
15 | 15 | class EE_Invisible_Recaptcha_Input extends EE_Form_Input_Base |
16 | 16 | { |
17 | 17 | |
18 | - const SCRIPT_HANDLE_GOOGLE_INVISIBLE_RECAPTCHA = 'google_invisible_recaptcha'; |
|
19 | - |
|
20 | - const SCRIPT_HANDLE_ESPRESSO_INVISIBLE_RECAPTCHA = 'espresso_invisible_recaptcha'; |
|
21 | - |
|
22 | - /** |
|
23 | - * @var EE_Registration_Config $config |
|
24 | - */ |
|
25 | - private $config; |
|
26 | - |
|
27 | - /** |
|
28 | - * @var string $recaptcha_id |
|
29 | - */ |
|
30 | - private $recaptcha_id; |
|
31 | - |
|
32 | - /** |
|
33 | - * @var string $submit_button_id |
|
34 | - */ |
|
35 | - private $submit_button_id; |
|
36 | - |
|
37 | - |
|
38 | - /** |
|
39 | - * @param array $input_settings |
|
40 | - * @param EE_Registration_Config $registration_config |
|
41 | - * @throws InvalidArgumentException |
|
42 | - * @throws InvalidDataTypeException |
|
43 | - * @throws InvalidInterfaceException |
|
44 | - * @throws DomainException |
|
45 | - */ |
|
46 | - public function __construct(array $input_settings = array(), EE_Registration_Config $registration_config = null) |
|
47 | - { |
|
48 | - $this->_set_display_strategy(new EE_Invisible_Recaptcha_Display_Strategy()); |
|
49 | - parent::__construct($input_settings); |
|
50 | - $registration_config = $registration_config instanceof EE_Registration_Config |
|
51 | - ? $registration_config |
|
52 | - : EE_Registry::instance()->CFG->registration; |
|
53 | - $this->config = $registration_config; |
|
54 | - $this->recaptcha_id = isset($input_settings['recaptcha_id']) |
|
55 | - ? $input_settings['recaptcha_id'] |
|
56 | - : substr(spl_object_hash($this), 8, 8); |
|
57 | - $this->submit_button_id = isset($input_settings['submit_button_id']) |
|
58 | - ? $input_settings['submit_button_id'] |
|
59 | - : ''; |
|
60 | - if (isset($input_settings['localized_vars']) |
|
61 | - && filter_var($input_settings['iframe'], FILTER_VALIDATE_BOOLEAN) |
|
62 | - ) { |
|
63 | - $this->addIframeAssets($input_settings['localized_vars']); |
|
64 | - } else { |
|
65 | - $this->registerScripts(); |
|
66 | - } |
|
67 | - } |
|
68 | - |
|
69 | - |
|
70 | - /** |
|
71 | - * @return bool |
|
72 | - */ |
|
73 | - public function useCaptcha() |
|
74 | - { |
|
75 | - return $this->config->use_captcha && $this->config->recaptcha_theme === 'invisible'; |
|
76 | - } |
|
77 | - |
|
78 | - |
|
79 | - /** |
|
80 | - * @return string |
|
81 | - */ |
|
82 | - public function badge() |
|
83 | - { |
|
84 | - return $this->config->recaptcha_badge; |
|
85 | - } |
|
86 | - |
|
87 | - |
|
88 | - /** |
|
89 | - * @return string |
|
90 | - */ |
|
91 | - public function language() |
|
92 | - { |
|
93 | - return $this->config->recaptcha_language; |
|
94 | - } |
|
95 | - |
|
96 | - |
|
97 | - /** |
|
98 | - * @return string |
|
99 | - */ |
|
100 | - public function siteKey() |
|
101 | - { |
|
102 | - return $this->config->recaptcha_publickey; |
|
103 | - } |
|
104 | - |
|
105 | - |
|
106 | - /** |
|
107 | - * @return string |
|
108 | - */ |
|
109 | - public function secretKey() |
|
110 | - { |
|
111 | - return $this->config->recaptcha_privatekey; |
|
112 | - } |
|
113 | - |
|
114 | - |
|
115 | - /** |
|
116 | - * @return string |
|
117 | - */ |
|
118 | - public function recaptchaId() |
|
119 | - { |
|
120 | - return $this->recaptcha_id; |
|
121 | - } |
|
122 | - |
|
123 | - |
|
124 | - /** |
|
125 | - * @return string |
|
126 | - */ |
|
127 | - public function submitButtonId() |
|
128 | - { |
|
129 | - return $this->submit_button_id; |
|
130 | - } |
|
131 | - |
|
132 | - |
|
133 | - /** |
|
134 | - * @param array $localized_vars |
|
135 | - * @throws DomainException |
|
136 | - */ |
|
137 | - private function addIframeAssets(array $localized_vars) |
|
138 | - { |
|
139 | - if (! $this->useCaptcha()) { |
|
140 | - return; |
|
141 | - } |
|
142 | - add_filter( |
|
143 | - 'FHEE__EED_Ticket_Selector__ticket_selector_iframe__js', |
|
144 | - function (array $iframe_assets) { |
|
145 | - $iframe_assets[ EE_Invisible_Recaptcha_Input::SCRIPT_HANDLE_ESPRESSO_INVISIBLE_RECAPTCHA ] = |
|
146 | - EED_Recaptcha_Invisible::assetsUrl() |
|
147 | - . 'espresso_invisible_recaptcha.js?ver=' |
|
148 | - . EVENT_ESPRESSO_VERSION; |
|
149 | - $iframe_assets[ EE_Invisible_Recaptcha_Input::SCRIPT_HANDLE_GOOGLE_INVISIBLE_RECAPTCHA ] = |
|
150 | - add_query_arg( |
|
151 | - array( |
|
152 | - 'onload' => 'espressoLoadRecaptcha', |
|
153 | - 'render' => 'explicit', |
|
154 | - 'hl' => $this->language(), |
|
155 | - ), |
|
156 | - 'https://www.google.com/recaptcha/api.js?' |
|
157 | - ); |
|
158 | - return $iframe_assets; |
|
159 | - } |
|
160 | - ); |
|
161 | - add_filter( |
|
162 | - 'FHEE__EventEspresso_modules_ticket_selector_TicketSelectorIframe__construct__js_attributes', |
|
163 | - function (array $iframe_asset_attributes) { |
|
164 | - $iframe_asset_attributes[ EE_Invisible_Recaptcha_Input::SCRIPT_HANDLE_GOOGLE_INVISIBLE_RECAPTCHA ] |
|
165 | - = ' async="async" defer="defer"'; |
|
166 | - return $iframe_asset_attributes; |
|
167 | - } |
|
168 | - ); |
|
169 | - add_action( |
|
170 | - 'AHEE__EventEspresso_modules_ticket_selector_TicketSelectorIframe__construct__complete', |
|
171 | - function (EventEspresso\modules\ticket_selector\TicketSelectorIframe $ticket_selector_iframe) use ($localized_vars) { |
|
172 | - $ticket_selector_iframe->addLocalizedVars($localized_vars, 'eeRecaptcha'); |
|
173 | - } |
|
174 | - ); |
|
175 | - } |
|
176 | - |
|
177 | - |
|
178 | - /** |
|
179 | - * @return void |
|
180 | - */ |
|
181 | - private function registerScripts() |
|
182 | - { |
|
183 | - if (! $this->useCaptcha()) { |
|
184 | - return; |
|
185 | - } |
|
186 | - add_filter('script_loader_tag', array($this, 'addScriptAttributes'), 10, 2); |
|
187 | - wp_register_script( |
|
188 | - EE_Invisible_Recaptcha_Input::SCRIPT_HANDLE_ESPRESSO_INVISIBLE_RECAPTCHA, |
|
189 | - EED_Recaptcha_Invisible::assetsUrl() . 'espresso_invisible_recaptcha.js', |
|
190 | - array('espresso_core'), |
|
191 | - EVENT_ESPRESSO_VERSION, |
|
192 | - true |
|
193 | - ); |
|
194 | - wp_register_script( |
|
195 | - EE_Invisible_Recaptcha_Input::SCRIPT_HANDLE_GOOGLE_INVISIBLE_RECAPTCHA, |
|
196 | - add_query_arg( |
|
197 | - array( |
|
198 | - 'onload' => 'espressoLoadRecaptcha', |
|
199 | - 'render' => 'explicit', |
|
200 | - 'hl' => $this->language(), |
|
201 | - ), |
|
202 | - 'https://www.google.com/recaptcha/api.js?' |
|
203 | - ), |
|
204 | - array(EE_Invisible_Recaptcha_Input::SCRIPT_HANDLE_ESPRESSO_INVISIBLE_RECAPTCHA), |
|
205 | - false, |
|
206 | - true |
|
207 | - ); |
|
208 | - } |
|
209 | - |
|
210 | - |
|
211 | - /** |
|
212 | - * @param string $tag |
|
213 | - * @param string $handle |
|
214 | - * @return string |
|
215 | - */ |
|
216 | - public function addScriptAttributes($tag, $handle) |
|
217 | - { |
|
218 | - if ($handle === EE_Invisible_Recaptcha_Input::SCRIPT_HANDLE_GOOGLE_INVISIBLE_RECAPTCHA) { |
|
219 | - $tag = str_replace('></script>', ' async="async" defer="defer"></script>', $tag); |
|
220 | - } |
|
221 | - return $tag; |
|
222 | - } |
|
223 | - |
|
224 | - |
|
225 | - /** |
|
226 | - * Gets the HTML for displaying the label for this form input |
|
227 | - * according to the form section's layout strategy |
|
228 | - * |
|
229 | - * @return string |
|
230 | - */ |
|
231 | - public function get_html_for_label() |
|
232 | - { |
|
233 | - return ''; |
|
234 | - } |
|
18 | + const SCRIPT_HANDLE_GOOGLE_INVISIBLE_RECAPTCHA = 'google_invisible_recaptcha'; |
|
19 | + |
|
20 | + const SCRIPT_HANDLE_ESPRESSO_INVISIBLE_RECAPTCHA = 'espresso_invisible_recaptcha'; |
|
21 | + |
|
22 | + /** |
|
23 | + * @var EE_Registration_Config $config |
|
24 | + */ |
|
25 | + private $config; |
|
26 | + |
|
27 | + /** |
|
28 | + * @var string $recaptcha_id |
|
29 | + */ |
|
30 | + private $recaptcha_id; |
|
31 | + |
|
32 | + /** |
|
33 | + * @var string $submit_button_id |
|
34 | + */ |
|
35 | + private $submit_button_id; |
|
36 | + |
|
37 | + |
|
38 | + /** |
|
39 | + * @param array $input_settings |
|
40 | + * @param EE_Registration_Config $registration_config |
|
41 | + * @throws InvalidArgumentException |
|
42 | + * @throws InvalidDataTypeException |
|
43 | + * @throws InvalidInterfaceException |
|
44 | + * @throws DomainException |
|
45 | + */ |
|
46 | + public function __construct(array $input_settings = array(), EE_Registration_Config $registration_config = null) |
|
47 | + { |
|
48 | + $this->_set_display_strategy(new EE_Invisible_Recaptcha_Display_Strategy()); |
|
49 | + parent::__construct($input_settings); |
|
50 | + $registration_config = $registration_config instanceof EE_Registration_Config |
|
51 | + ? $registration_config |
|
52 | + : EE_Registry::instance()->CFG->registration; |
|
53 | + $this->config = $registration_config; |
|
54 | + $this->recaptcha_id = isset($input_settings['recaptcha_id']) |
|
55 | + ? $input_settings['recaptcha_id'] |
|
56 | + : substr(spl_object_hash($this), 8, 8); |
|
57 | + $this->submit_button_id = isset($input_settings['submit_button_id']) |
|
58 | + ? $input_settings['submit_button_id'] |
|
59 | + : ''; |
|
60 | + if (isset($input_settings['localized_vars']) |
|
61 | + && filter_var($input_settings['iframe'], FILTER_VALIDATE_BOOLEAN) |
|
62 | + ) { |
|
63 | + $this->addIframeAssets($input_settings['localized_vars']); |
|
64 | + } else { |
|
65 | + $this->registerScripts(); |
|
66 | + } |
|
67 | + } |
|
68 | + |
|
69 | + |
|
70 | + /** |
|
71 | + * @return bool |
|
72 | + */ |
|
73 | + public function useCaptcha() |
|
74 | + { |
|
75 | + return $this->config->use_captcha && $this->config->recaptcha_theme === 'invisible'; |
|
76 | + } |
|
77 | + |
|
78 | + |
|
79 | + /** |
|
80 | + * @return string |
|
81 | + */ |
|
82 | + public function badge() |
|
83 | + { |
|
84 | + return $this->config->recaptcha_badge; |
|
85 | + } |
|
86 | + |
|
87 | + |
|
88 | + /** |
|
89 | + * @return string |
|
90 | + */ |
|
91 | + public function language() |
|
92 | + { |
|
93 | + return $this->config->recaptcha_language; |
|
94 | + } |
|
95 | + |
|
96 | + |
|
97 | + /** |
|
98 | + * @return string |
|
99 | + */ |
|
100 | + public function siteKey() |
|
101 | + { |
|
102 | + return $this->config->recaptcha_publickey; |
|
103 | + } |
|
104 | + |
|
105 | + |
|
106 | + /** |
|
107 | + * @return string |
|
108 | + */ |
|
109 | + public function secretKey() |
|
110 | + { |
|
111 | + return $this->config->recaptcha_privatekey; |
|
112 | + } |
|
113 | + |
|
114 | + |
|
115 | + /** |
|
116 | + * @return string |
|
117 | + */ |
|
118 | + public function recaptchaId() |
|
119 | + { |
|
120 | + return $this->recaptcha_id; |
|
121 | + } |
|
122 | + |
|
123 | + |
|
124 | + /** |
|
125 | + * @return string |
|
126 | + */ |
|
127 | + public function submitButtonId() |
|
128 | + { |
|
129 | + return $this->submit_button_id; |
|
130 | + } |
|
131 | + |
|
132 | + |
|
133 | + /** |
|
134 | + * @param array $localized_vars |
|
135 | + * @throws DomainException |
|
136 | + */ |
|
137 | + private function addIframeAssets(array $localized_vars) |
|
138 | + { |
|
139 | + if (! $this->useCaptcha()) { |
|
140 | + return; |
|
141 | + } |
|
142 | + add_filter( |
|
143 | + 'FHEE__EED_Ticket_Selector__ticket_selector_iframe__js', |
|
144 | + function (array $iframe_assets) { |
|
145 | + $iframe_assets[ EE_Invisible_Recaptcha_Input::SCRIPT_HANDLE_ESPRESSO_INVISIBLE_RECAPTCHA ] = |
|
146 | + EED_Recaptcha_Invisible::assetsUrl() |
|
147 | + . 'espresso_invisible_recaptcha.js?ver=' |
|
148 | + . EVENT_ESPRESSO_VERSION; |
|
149 | + $iframe_assets[ EE_Invisible_Recaptcha_Input::SCRIPT_HANDLE_GOOGLE_INVISIBLE_RECAPTCHA ] = |
|
150 | + add_query_arg( |
|
151 | + array( |
|
152 | + 'onload' => 'espressoLoadRecaptcha', |
|
153 | + 'render' => 'explicit', |
|
154 | + 'hl' => $this->language(), |
|
155 | + ), |
|
156 | + 'https://www.google.com/recaptcha/api.js?' |
|
157 | + ); |
|
158 | + return $iframe_assets; |
|
159 | + } |
|
160 | + ); |
|
161 | + add_filter( |
|
162 | + 'FHEE__EventEspresso_modules_ticket_selector_TicketSelectorIframe__construct__js_attributes', |
|
163 | + function (array $iframe_asset_attributes) { |
|
164 | + $iframe_asset_attributes[ EE_Invisible_Recaptcha_Input::SCRIPT_HANDLE_GOOGLE_INVISIBLE_RECAPTCHA ] |
|
165 | + = ' async="async" defer="defer"'; |
|
166 | + return $iframe_asset_attributes; |
|
167 | + } |
|
168 | + ); |
|
169 | + add_action( |
|
170 | + 'AHEE__EventEspresso_modules_ticket_selector_TicketSelectorIframe__construct__complete', |
|
171 | + function (EventEspresso\modules\ticket_selector\TicketSelectorIframe $ticket_selector_iframe) use ($localized_vars) { |
|
172 | + $ticket_selector_iframe->addLocalizedVars($localized_vars, 'eeRecaptcha'); |
|
173 | + } |
|
174 | + ); |
|
175 | + } |
|
176 | + |
|
177 | + |
|
178 | + /** |
|
179 | + * @return void |
|
180 | + */ |
|
181 | + private function registerScripts() |
|
182 | + { |
|
183 | + if (! $this->useCaptcha()) { |
|
184 | + return; |
|
185 | + } |
|
186 | + add_filter('script_loader_tag', array($this, 'addScriptAttributes'), 10, 2); |
|
187 | + wp_register_script( |
|
188 | + EE_Invisible_Recaptcha_Input::SCRIPT_HANDLE_ESPRESSO_INVISIBLE_RECAPTCHA, |
|
189 | + EED_Recaptcha_Invisible::assetsUrl() . 'espresso_invisible_recaptcha.js', |
|
190 | + array('espresso_core'), |
|
191 | + EVENT_ESPRESSO_VERSION, |
|
192 | + true |
|
193 | + ); |
|
194 | + wp_register_script( |
|
195 | + EE_Invisible_Recaptcha_Input::SCRIPT_HANDLE_GOOGLE_INVISIBLE_RECAPTCHA, |
|
196 | + add_query_arg( |
|
197 | + array( |
|
198 | + 'onload' => 'espressoLoadRecaptcha', |
|
199 | + 'render' => 'explicit', |
|
200 | + 'hl' => $this->language(), |
|
201 | + ), |
|
202 | + 'https://www.google.com/recaptcha/api.js?' |
|
203 | + ), |
|
204 | + array(EE_Invisible_Recaptcha_Input::SCRIPT_HANDLE_ESPRESSO_INVISIBLE_RECAPTCHA), |
|
205 | + false, |
|
206 | + true |
|
207 | + ); |
|
208 | + } |
|
209 | + |
|
210 | + |
|
211 | + /** |
|
212 | + * @param string $tag |
|
213 | + * @param string $handle |
|
214 | + * @return string |
|
215 | + */ |
|
216 | + public function addScriptAttributes($tag, $handle) |
|
217 | + { |
|
218 | + if ($handle === EE_Invisible_Recaptcha_Input::SCRIPT_HANDLE_GOOGLE_INVISIBLE_RECAPTCHA) { |
|
219 | + $tag = str_replace('></script>', ' async="async" defer="defer"></script>', $tag); |
|
220 | + } |
|
221 | + return $tag; |
|
222 | + } |
|
223 | + |
|
224 | + |
|
225 | + /** |
|
226 | + * Gets the HTML for displaying the label for this form input |
|
227 | + * according to the form section's layout strategy |
|
228 | + * |
|
229 | + * @return string |
|
230 | + */ |
|
231 | + public function get_html_for_label() |
|
232 | + { |
|
233 | + return ''; |
|
234 | + } |
|
235 | 235 | } |
@@ -136,17 +136,17 @@ discard block |
||
136 | 136 | */ |
137 | 137 | private function addIframeAssets(array $localized_vars) |
138 | 138 | { |
139 | - if (! $this->useCaptcha()) { |
|
139 | + if ( ! $this->useCaptcha()) { |
|
140 | 140 | return; |
141 | 141 | } |
142 | 142 | add_filter( |
143 | 143 | 'FHEE__EED_Ticket_Selector__ticket_selector_iframe__js', |
144 | - function (array $iframe_assets) { |
|
145 | - $iframe_assets[ EE_Invisible_Recaptcha_Input::SCRIPT_HANDLE_ESPRESSO_INVISIBLE_RECAPTCHA ] = |
|
144 | + function(array $iframe_assets) { |
|
145 | + $iframe_assets[EE_Invisible_Recaptcha_Input::SCRIPT_HANDLE_ESPRESSO_INVISIBLE_RECAPTCHA] = |
|
146 | 146 | EED_Recaptcha_Invisible::assetsUrl() |
147 | 147 | . 'espresso_invisible_recaptcha.js?ver=' |
148 | 148 | . EVENT_ESPRESSO_VERSION; |
149 | - $iframe_assets[ EE_Invisible_Recaptcha_Input::SCRIPT_HANDLE_GOOGLE_INVISIBLE_RECAPTCHA ] = |
|
149 | + $iframe_assets[EE_Invisible_Recaptcha_Input::SCRIPT_HANDLE_GOOGLE_INVISIBLE_RECAPTCHA] = |
|
150 | 150 | add_query_arg( |
151 | 151 | array( |
152 | 152 | 'onload' => 'espressoLoadRecaptcha', |
@@ -160,15 +160,15 @@ discard block |
||
160 | 160 | ); |
161 | 161 | add_filter( |
162 | 162 | 'FHEE__EventEspresso_modules_ticket_selector_TicketSelectorIframe__construct__js_attributes', |
163 | - function (array $iframe_asset_attributes) { |
|
164 | - $iframe_asset_attributes[ EE_Invisible_Recaptcha_Input::SCRIPT_HANDLE_GOOGLE_INVISIBLE_RECAPTCHA ] |
|
163 | + function(array $iframe_asset_attributes) { |
|
164 | + $iframe_asset_attributes[EE_Invisible_Recaptcha_Input::SCRIPT_HANDLE_GOOGLE_INVISIBLE_RECAPTCHA] |
|
165 | 165 | = ' async="async" defer="defer"'; |
166 | 166 | return $iframe_asset_attributes; |
167 | 167 | } |
168 | 168 | ); |
169 | 169 | add_action( |
170 | 170 | 'AHEE__EventEspresso_modules_ticket_selector_TicketSelectorIframe__construct__complete', |
171 | - function (EventEspresso\modules\ticket_selector\TicketSelectorIframe $ticket_selector_iframe) use ($localized_vars) { |
|
171 | + function(EventEspresso\modules\ticket_selector\TicketSelectorIframe $ticket_selector_iframe) use ($localized_vars) { |
|
172 | 172 | $ticket_selector_iframe->addLocalizedVars($localized_vars, 'eeRecaptcha'); |
173 | 173 | } |
174 | 174 | ); |
@@ -180,13 +180,13 @@ discard block |
||
180 | 180 | */ |
181 | 181 | private function registerScripts() |
182 | 182 | { |
183 | - if (! $this->useCaptcha()) { |
|
183 | + if ( ! $this->useCaptcha()) { |
|
184 | 184 | return; |
185 | 185 | } |
186 | 186 | add_filter('script_loader_tag', array($this, 'addScriptAttributes'), 10, 2); |
187 | 187 | wp_register_script( |
188 | 188 | EE_Invisible_Recaptcha_Input::SCRIPT_HANDLE_ESPRESSO_INVISIBLE_RECAPTCHA, |
189 | - EED_Recaptcha_Invisible::assetsUrl() . 'espresso_invisible_recaptcha.js', |
|
189 | + EED_Recaptcha_Invisible::assetsUrl().'espresso_invisible_recaptcha.js', |
|
190 | 190 | array('espresso_core'), |
191 | 191 | EVENT_ESPRESSO_VERSION, |
192 | 192 | true |
@@ -14,17 +14,17 @@ |
||
14 | 14 | */ |
15 | 15 | class EE_Phone_Input extends EE_Text_Input |
16 | 16 | { |
17 | - /** |
|
18 | - * @param array $options |
|
19 | - */ |
|
20 | - public function __construct($options = array()) |
|
21 | - { |
|
22 | - $this->_add_validation_strategy( |
|
23 | - new EE_Text_Validation_Strategy( |
|
24 | - __('Please enter a valid phone number. Eg 123-456-7890 or 1234567890', 'event_espresso'), |
|
25 | - '~^(([\d]{10})|(^[\d]{3}-[\d]{3}-[\d]{4}))$~' |
|
26 | - ) |
|
27 | - ); |
|
28 | - parent::__construct($options); |
|
29 | - } |
|
17 | + /** |
|
18 | + * @param array $options |
|
19 | + */ |
|
20 | + public function __construct($options = array()) |
|
21 | + { |
|
22 | + $this->_add_validation_strategy( |
|
23 | + new EE_Text_Validation_Strategy( |
|
24 | + __('Please enter a valid phone number. Eg 123-456-7890 or 1234567890', 'event_espresso'), |
|
25 | + '~^(([\d]{10})|(^[\d]{3}-[\d]{3}-[\d]{4}))$~' |
|
26 | + ) |
|
27 | + ); |
|
28 | + parent::__construct($options); |
|
29 | + } |
|
30 | 30 | } |
@@ -9,15 +9,15 @@ |
||
9 | 9 | class EE_Select_Multiple_Input extends EE_Form_Input_With_Options_Base |
10 | 10 | { |
11 | 11 | |
12 | - /** |
|
13 | - * @param array | EE_Question_Option[] $answer_options |
|
14 | - * @param array $input_settings |
|
15 | - */ |
|
16 | - public function __construct($answer_options, $input_settings = array()) |
|
17 | - { |
|
18 | - $this->_set_display_strategy(new EE_Select_Multiple_Display_Strategy()); |
|
19 | - $this->_add_validation_strategy(new EE_Many_Valued_Validation_Strategy(array( new EE_Enum_Validation_Strategy(isset($input_settings['validation_error_message']) ? $input_settings['validation_error_message'] : null) ))); |
|
20 | - $this->_multiple_selections = true; |
|
21 | - parent::__construct($answer_options, $input_settings); |
|
22 | - } |
|
12 | + /** |
|
13 | + * @param array | EE_Question_Option[] $answer_options |
|
14 | + * @param array $input_settings |
|
15 | + */ |
|
16 | + public function __construct($answer_options, $input_settings = array()) |
|
17 | + { |
|
18 | + $this->_set_display_strategy(new EE_Select_Multiple_Display_Strategy()); |
|
19 | + $this->_add_validation_strategy(new EE_Many_Valued_Validation_Strategy(array( new EE_Enum_Validation_Strategy(isset($input_settings['validation_error_message']) ? $input_settings['validation_error_message'] : null) ))); |
|
20 | + $this->_multiple_selections = true; |
|
21 | + parent::__construct($answer_options, $input_settings); |
|
22 | + } |
|
23 | 23 | } |
@@ -16,7 +16,7 @@ |
||
16 | 16 | public function __construct($answer_options, $input_settings = array()) |
17 | 17 | { |
18 | 18 | $this->_set_display_strategy(new EE_Select_Multiple_Display_Strategy()); |
19 | - $this->_add_validation_strategy(new EE_Many_Valued_Validation_Strategy(array( new EE_Enum_Validation_Strategy(isset($input_settings['validation_error_message']) ? $input_settings['validation_error_message'] : null) ))); |
|
19 | + $this->_add_validation_strategy(new EE_Many_Valued_Validation_Strategy(array(new EE_Enum_Validation_Strategy(isset($input_settings['validation_error_message']) ? $input_settings['validation_error_message'] : null)))); |
|
20 | 20 | $this->_multiple_selections = true; |
21 | 21 | parent::__construct($answer_options, $input_settings); |
22 | 22 | } |
@@ -14,64 +14,64 @@ |
||
14 | 14 | class EE_Select_Reveal_Input extends EE_Select_Input |
15 | 15 | { |
16 | 16 | |
17 | - /** |
|
18 | - * @param array $answer_options Array keys which match a sibling section's name |
|
19 | - * will show/unhide that sibling subsection. Otherwise, siblings whose names |
|
20 | - * match array keys of $answer_options are hidden. |
|
21 | - * Note: internally each array key is considered a relative form input path |
|
22 | - * (see EE_Form_Section_Base::find_section_from_path) but relative |
|
23 | - * to THIS INPUT's PARENT section, not this input itself. ie, |
|
24 | - * a '../' is automatically added onto each each array key, to produce |
|
25 | - * the relative form input path. |
|
26 | - * Note however: array keys which are an EMPTY STRING are left as-is |
|
27 | - * |
|
28 | - * @param array $input_settings |
|
29 | - */ |
|
30 | - public function __construct($answer_options, $input_settings = array()) |
|
31 | - { |
|
32 | - parent::__construct($answer_options, $input_settings); |
|
33 | - } |
|
17 | + /** |
|
18 | + * @param array $answer_options Array keys which match a sibling section's name |
|
19 | + * will show/unhide that sibling subsection. Otherwise, siblings whose names |
|
20 | + * match array keys of $answer_options are hidden. |
|
21 | + * Note: internally each array key is considered a relative form input path |
|
22 | + * (see EE_Form_Section_Base::find_section_from_path) but relative |
|
23 | + * to THIS INPUT's PARENT section, not this input itself. ie, |
|
24 | + * a '../' is automatically added onto each each array key, to produce |
|
25 | + * the relative form input path. |
|
26 | + * Note however: array keys which are an EMPTY STRING are left as-is |
|
27 | + * |
|
28 | + * @param array $input_settings |
|
29 | + */ |
|
30 | + public function __construct($answer_options, $input_settings = array()) |
|
31 | + { |
|
32 | + parent::__construct($answer_options, $input_settings); |
|
33 | + } |
|
34 | 34 | |
35 | - /** |
|
36 | - * Gets all the sibling sections controlled by this reveal select input |
|
37 | - * @return \EE_Form_Section_Base[] keys are their form section paths |
|
38 | - */ |
|
39 | - public function sibling_sections_controlled() |
|
40 | - { |
|
41 | - $sibling_sections = array(); |
|
42 | - foreach ($this->options() as $sibling_section_name => $sibling_section) { |
|
43 | - // if it's an empty string just leave it alone |
|
44 | - if (empty($sibling_section_name)) { |
|
45 | - continue; |
|
46 | - } |
|
47 | - $sibling_section = $this->find_section_from_path('../' . $sibling_section_name); |
|
48 | - if ($sibling_section instanceof EE_Form_Section_Base |
|
49 | - && ! empty($sibling_section_name) |
|
50 | - ) { |
|
51 | - $sibling_sections[ $sibling_section_name ] = $sibling_section; |
|
52 | - } |
|
53 | - } |
|
54 | - return $sibling_sections; |
|
55 | - } |
|
35 | + /** |
|
36 | + * Gets all the sibling sections controlled by this reveal select input |
|
37 | + * @return \EE_Form_Section_Base[] keys are their form section paths |
|
38 | + */ |
|
39 | + public function sibling_sections_controlled() |
|
40 | + { |
|
41 | + $sibling_sections = array(); |
|
42 | + foreach ($this->options() as $sibling_section_name => $sibling_section) { |
|
43 | + // if it's an empty string just leave it alone |
|
44 | + if (empty($sibling_section_name)) { |
|
45 | + continue; |
|
46 | + } |
|
47 | + $sibling_section = $this->find_section_from_path('../' . $sibling_section_name); |
|
48 | + if ($sibling_section instanceof EE_Form_Section_Base |
|
49 | + && ! empty($sibling_section_name) |
|
50 | + ) { |
|
51 | + $sibling_sections[ $sibling_section_name ] = $sibling_section; |
|
52 | + } |
|
53 | + } |
|
54 | + return $sibling_sections; |
|
55 | + } |
|
56 | 56 | |
57 | - /** |
|
58 | - * Adds an entry of 'select_reveal_inputs' to the js data, which is an array |
|
59 | - * whose top-level keys are select reveal input html ids; values are arrays |
|
60 | - * whose keys are select option values and values are the sections they reveal |
|
61 | - * @param array $form_other_js_data |
|
62 | - * @return array |
|
63 | - */ |
|
64 | - public function get_other_js_data($form_other_js_data = array()) |
|
65 | - { |
|
66 | - $form_other_js_data = parent::get_other_js_data($form_other_js_data); |
|
67 | - if (! isset($form_other_js_data['select_reveal_inputs'])) { |
|
68 | - $form_other_js_data['select_reveal_inputs'] = array(); |
|
69 | - } |
|
70 | - $sibling_input_to_html_id_map = array(); |
|
71 | - foreach ($this->sibling_sections_controlled() as $sibling_section_path => $sibling_section) { |
|
72 | - $sibling_input_to_html_id_map[ $sibling_section_path ] = $sibling_section->html_id(); |
|
73 | - } |
|
74 | - $form_other_js_data['select_reveal_inputs'][ $this->html_id() ] = $sibling_input_to_html_id_map; |
|
75 | - return $form_other_js_data; |
|
76 | - } |
|
57 | + /** |
|
58 | + * Adds an entry of 'select_reveal_inputs' to the js data, which is an array |
|
59 | + * whose top-level keys are select reveal input html ids; values are arrays |
|
60 | + * whose keys are select option values and values are the sections they reveal |
|
61 | + * @param array $form_other_js_data |
|
62 | + * @return array |
|
63 | + */ |
|
64 | + public function get_other_js_data($form_other_js_data = array()) |
|
65 | + { |
|
66 | + $form_other_js_data = parent::get_other_js_data($form_other_js_data); |
|
67 | + if (! isset($form_other_js_data['select_reveal_inputs'])) { |
|
68 | + $form_other_js_data['select_reveal_inputs'] = array(); |
|
69 | + } |
|
70 | + $sibling_input_to_html_id_map = array(); |
|
71 | + foreach ($this->sibling_sections_controlled() as $sibling_section_path => $sibling_section) { |
|
72 | + $sibling_input_to_html_id_map[ $sibling_section_path ] = $sibling_section->html_id(); |
|
73 | + } |
|
74 | + $form_other_js_data['select_reveal_inputs'][ $this->html_id() ] = $sibling_input_to_html_id_map; |
|
75 | + return $form_other_js_data; |
|
76 | + } |
|
77 | 77 | } |
@@ -44,11 +44,11 @@ discard block |
||
44 | 44 | if (empty($sibling_section_name)) { |
45 | 45 | continue; |
46 | 46 | } |
47 | - $sibling_section = $this->find_section_from_path('../' . $sibling_section_name); |
|
47 | + $sibling_section = $this->find_section_from_path('../'.$sibling_section_name); |
|
48 | 48 | if ($sibling_section instanceof EE_Form_Section_Base |
49 | 49 | && ! empty($sibling_section_name) |
50 | 50 | ) { |
51 | - $sibling_sections[ $sibling_section_name ] = $sibling_section; |
|
51 | + $sibling_sections[$sibling_section_name] = $sibling_section; |
|
52 | 52 | } |
53 | 53 | } |
54 | 54 | return $sibling_sections; |
@@ -64,14 +64,14 @@ discard block |
||
64 | 64 | public function get_other_js_data($form_other_js_data = array()) |
65 | 65 | { |
66 | 66 | $form_other_js_data = parent::get_other_js_data($form_other_js_data); |
67 | - if (! isset($form_other_js_data['select_reveal_inputs'])) { |
|
67 | + if ( ! isset($form_other_js_data['select_reveal_inputs'])) { |
|
68 | 68 | $form_other_js_data['select_reveal_inputs'] = array(); |
69 | 69 | } |
70 | 70 | $sibling_input_to_html_id_map = array(); |
71 | 71 | foreach ($this->sibling_sections_controlled() as $sibling_section_path => $sibling_section) { |
72 | - $sibling_input_to_html_id_map[ $sibling_section_path ] = $sibling_section->html_id(); |
|
72 | + $sibling_input_to_html_id_map[$sibling_section_path] = $sibling_section->html_id(); |
|
73 | 73 | } |
74 | - $form_other_js_data['select_reveal_inputs'][ $this->html_id() ] = $sibling_input_to_html_id_map; |
|
74 | + $form_other_js_data['select_reveal_inputs'][$this->html_id()] = $sibling_input_to_html_id_map; |
|
75 | 75 | return $form_other_js_data; |
76 | 76 | } |
77 | 77 | } |
@@ -12,17 +12,17 @@ |
||
12 | 12 | class EE_Year_Input extends EE_Select_Input |
13 | 13 | { |
14 | 14 | |
15 | - public function __construct($input_settings = array(), $four_digit_year = true, $years_behind = 100, $years_ahead = 0) |
|
16 | - { |
|
17 | - if ($four_digit_year) { |
|
18 | - $current_year_int = intval(date('Y')); |
|
19 | - } else { |
|
20 | - $current_year_int = intval(date('y')); |
|
21 | - } |
|
22 | - $answer_options = array(); |
|
23 | - for ($start = $current_year_int - $years_behind; $start <= ($current_year_int + $years_ahead); $start++) { |
|
24 | - $answer_options[ $start ] = $start; |
|
25 | - } |
|
26 | - parent::__construct($answer_options, $input_settings); |
|
27 | - } |
|
15 | + public function __construct($input_settings = array(), $four_digit_year = true, $years_behind = 100, $years_ahead = 0) |
|
16 | + { |
|
17 | + if ($four_digit_year) { |
|
18 | + $current_year_int = intval(date('Y')); |
|
19 | + } else { |
|
20 | + $current_year_int = intval(date('y')); |
|
21 | + } |
|
22 | + $answer_options = array(); |
|
23 | + for ($start = $current_year_int - $years_behind; $start <= ($current_year_int + $years_ahead); $start++) { |
|
24 | + $answer_options[ $start ] = $start; |
|
25 | + } |
|
26 | + parent::__construct($answer_options, $input_settings); |
|
27 | + } |
|
28 | 28 | } |
@@ -21,7 +21,7 @@ |
||
21 | 21 | } |
22 | 22 | $answer_options = array(); |
23 | 23 | for ($start = $current_year_int - $years_behind; $start <= ($current_year_int + $years_ahead); $start++) { |
24 | - $answer_options[ $start ] = $start; |
|
24 | + $answer_options[$start] = $start; |
|
25 | 25 | } |
26 | 26 | parent::__construct($answer_options, $input_settings); |
27 | 27 | } |
@@ -11,23 +11,23 @@ |
||
11 | 11 | class EE_Currency_Input extends EE_Select_Input |
12 | 12 | { |
13 | 13 | |
14 | - /** |
|
15 | - * |
|
16 | - * @param array $only_specific_currency_codes numerically-indexed array of allowed currency codes. By default, all are allowed |
|
17 | - * @param array $input_settings |
|
18 | - */ |
|
19 | - public function __construct($only_specific_currency_codes = array(), $input_settings = array()) |
|
20 | - { |
|
21 | - $query_params = array('order_by'=>array('CNT_name'=>'asc')); |
|
22 | - if ($only_specific_currency_codes) { |
|
23 | - $query_params[0]['CNT_cur_code'] = array('IN',$only_specific_currency_codes); |
|
24 | - } |
|
25 | - $all_countries = EEM_Country::instance()->get_all($query_params); |
|
26 | - $country_options = array(); |
|
27 | - foreach ($all_countries as $country) { |
|
28 | - /* @var $country EE_Country */ |
|
29 | - $country_options[ $country->currency_code() ] = $country->name().": ".$country->currency_name_single() ." (".$country->currency_sign().")"; |
|
30 | - } |
|
31 | - parent::__construct($country_options, 'int', $input_settings); |
|
32 | - } |
|
14 | + /** |
|
15 | + * |
|
16 | + * @param array $only_specific_currency_codes numerically-indexed array of allowed currency codes. By default, all are allowed |
|
17 | + * @param array $input_settings |
|
18 | + */ |
|
19 | + public function __construct($only_specific_currency_codes = array(), $input_settings = array()) |
|
20 | + { |
|
21 | + $query_params = array('order_by'=>array('CNT_name'=>'asc')); |
|
22 | + if ($only_specific_currency_codes) { |
|
23 | + $query_params[0]['CNT_cur_code'] = array('IN',$only_specific_currency_codes); |
|
24 | + } |
|
25 | + $all_countries = EEM_Country::instance()->get_all($query_params); |
|
26 | + $country_options = array(); |
|
27 | + foreach ($all_countries as $country) { |
|
28 | + /* @var $country EE_Country */ |
|
29 | + $country_options[ $country->currency_code() ] = $country->name().": ".$country->currency_name_single() ." (".$country->currency_sign().")"; |
|
30 | + } |
|
31 | + parent::__construct($country_options, 'int', $input_settings); |
|
32 | + } |
|
33 | 33 | } |
@@ -20,13 +20,13 @@ |
||
20 | 20 | { |
21 | 21 | $query_params = array('order_by'=>array('CNT_name'=>'asc')); |
22 | 22 | if ($only_specific_currency_codes) { |
23 | - $query_params[0]['CNT_cur_code'] = array('IN',$only_specific_currency_codes); |
|
23 | + $query_params[0]['CNT_cur_code'] = array('IN', $only_specific_currency_codes); |
|
24 | 24 | } |
25 | 25 | $all_countries = EEM_Country::instance()->get_all($query_params); |
26 | 26 | $country_options = array(); |
27 | 27 | foreach ($all_countries as $country) { |
28 | 28 | /* @var $country EE_Country */ |
29 | - $country_options[ $country->currency_code() ] = $country->name().": ".$country->currency_name_single() ." (".$country->currency_sign().")"; |
|
29 | + $country_options[$country->currency_code()] = $country->name().": ".$country->currency_name_single()." (".$country->currency_sign().")"; |
|
30 | 30 | } |
31 | 31 | parent::__construct($country_options, 'int', $input_settings); |
32 | 32 | } |
@@ -10,14 +10,14 @@ |
||
10 | 10 | { |
11 | 11 | |
12 | 12 | |
13 | - /** |
|
14 | - * @param array $input_settings |
|
15 | - */ |
|
16 | - public function __construct($input_settings = array()) |
|
17 | - { |
|
18 | - $this->_set_display_strategy(new EE_Text_Input_Display_Strategy('password')); |
|
19 | - $this->_set_normalization_strategy(new EE_Text_Normalization()); |
|
20 | - parent::__construct($input_settings); |
|
21 | - $this->set_html_class($this->html_class() . 'password'); |
|
22 | - } |
|
13 | + /** |
|
14 | + * @param array $input_settings |
|
15 | + */ |
|
16 | + public function __construct($input_settings = array()) |
|
17 | + { |
|
18 | + $this->_set_display_strategy(new EE_Text_Input_Display_Strategy('password')); |
|
19 | + $this->_set_normalization_strategy(new EE_Text_Normalization()); |
|
20 | + parent::__construct($input_settings); |
|
21 | + $this->set_html_class($this->html_class() . 'password'); |
|
22 | + } |
|
23 | 23 | } |
@@ -18,6 +18,6 @@ |
||
18 | 18 | $this->_set_display_strategy(new EE_Text_Input_Display_Strategy('password')); |
19 | 19 | $this->_set_normalization_strategy(new EE_Text_Normalization()); |
20 | 20 | parent::__construct($input_settings); |
21 | - $this->set_html_class($this->html_class() . 'password'); |
|
21 | + $this->set_html_class($this->html_class().'password'); |
|
22 | 22 | } |
23 | 23 | } |