@@ -14,1528 +14,1528 @@ |
||
14 | 14 | class EE_Form_Section_Proper extends EE_Form_Section_Validatable |
15 | 15 | { |
16 | 16 | |
17 | - const SUBMITTED_FORM_DATA_SSN_KEY = 'submitted_form_data'; |
|
18 | - |
|
19 | - /** |
|
20 | - * Subsections |
|
21 | - * |
|
22 | - * @var EE_Form_Section_Validatable[] |
|
23 | - */ |
|
24 | - protected $_subsections = array(); |
|
25 | - |
|
26 | - /** |
|
27 | - * Strategy for laying out the form |
|
28 | - * |
|
29 | - * @var EE_Form_Section_Layout_Base |
|
30 | - */ |
|
31 | - protected $_layout_strategy; |
|
32 | - |
|
33 | - /** |
|
34 | - * Whether or not this form has received and validated a form submission yet |
|
35 | - * |
|
36 | - * @var boolean |
|
37 | - */ |
|
38 | - protected $_received_submission = false; |
|
39 | - |
|
40 | - /** |
|
41 | - * message displayed to users upon successful form submission |
|
42 | - * |
|
43 | - * @var string |
|
44 | - */ |
|
45 | - protected $_form_submission_success_message = ''; |
|
46 | - |
|
47 | - /** |
|
48 | - * message displayed to users upon unsuccessful form submission |
|
49 | - * |
|
50 | - * @var string |
|
51 | - */ |
|
52 | - protected $_form_submission_error_message = ''; |
|
53 | - |
|
54 | - /** |
|
55 | - * @var array like $_REQUEST |
|
56 | - */ |
|
57 | - protected $cached_request_data; |
|
58 | - |
|
59 | - /** |
|
60 | - * Stores whether this form (and its sub-sections) were found to be valid or not. |
|
61 | - * Starts off as null, but once the form is validated, it set to either true or false |
|
62 | - * @var boolean|null |
|
63 | - */ |
|
64 | - protected $is_valid; |
|
65 | - |
|
66 | - /** |
|
67 | - * Stores all the data that will localized for form validation |
|
68 | - * |
|
69 | - * @var array |
|
70 | - */ |
|
71 | - protected static $_js_localization = array(); |
|
72 | - |
|
73 | - /** |
|
74 | - * whether or not the form's localized validation JS vars have been set |
|
75 | - * |
|
76 | - * @type boolean |
|
77 | - */ |
|
78 | - protected static $_scripts_localized = false; |
|
79 | - |
|
80 | - |
|
81 | - /** |
|
82 | - * when constructing a proper form section, calls _construct_finalize on children |
|
83 | - * so that they know who their parent is, and what name they've been given. |
|
84 | - * |
|
85 | - * @param array[] $options_array { |
|
86 | - * @type $subsections EE_Form_Section_Validatable[] where keys are the section's name |
|
87 | - * @type $include string[] numerically-indexed where values are section names to be included, |
|
88 | - * and in that order. This is handy if you want |
|
89 | - * the subsections to be ordered differently than the default, and if you override |
|
90 | - * which fields are shown |
|
91 | - * @type $exclude string[] values are subsections to be excluded. This is handy if you want |
|
92 | - * to remove certain default subsections (note: if you specify BOTH 'include' AND |
|
93 | - * 'exclude', the inclusions will be applied first, and the exclusions will exclude |
|
94 | - * items from that list of inclusions) |
|
95 | - * @type $layout_strategy EE_Form_Section_Layout_Base strategy for laying out the form |
|
96 | - * } @see EE_Form_Section_Validatable::__construct() |
|
97 | - * @throws EE_Error |
|
98 | - */ |
|
99 | - public function __construct($options_array = array()) |
|
100 | - { |
|
101 | - $options_array = (array) apply_filters( |
|
102 | - 'FHEE__EE_Form_Section_Proper___construct__options_array', |
|
103 | - $options_array, |
|
104 | - $this |
|
105 | - ); |
|
106 | - // call parent first, as it may be setting the name |
|
107 | - parent::__construct($options_array); |
|
108 | - // if they've included subsections in the constructor, add them now |
|
109 | - if (isset($options_array['include'])) { |
|
110 | - // we are going to make sure we ONLY have those subsections to include |
|
111 | - // AND we are going to make sure they're in that specified order |
|
112 | - $reordered_subsections = array(); |
|
113 | - foreach ($options_array['include'] as $input_name) { |
|
114 | - if (isset($this->_subsections[ $input_name ])) { |
|
115 | - $reordered_subsections[ $input_name ] = $this->_subsections[ $input_name ]; |
|
116 | - } |
|
117 | - } |
|
118 | - $this->_subsections = $reordered_subsections; |
|
119 | - } |
|
120 | - if (isset($options_array['exclude'])) { |
|
121 | - $exclude = $options_array['exclude']; |
|
122 | - $this->_subsections = array_diff_key($this->_subsections, array_flip($exclude)); |
|
123 | - } |
|
124 | - if (isset($options_array['layout_strategy'])) { |
|
125 | - $this->_layout_strategy = $options_array['layout_strategy']; |
|
126 | - } |
|
127 | - if (! $this->_layout_strategy) { |
|
128 | - $this->_layout_strategy = is_admin() ? new EE_Admin_Two_Column_Layout() : new EE_Two_Column_Layout(); |
|
129 | - } |
|
130 | - $this->_layout_strategy->_construct_finalize($this); |
|
131 | - // ok so we are definitely going to want the forms JS, |
|
132 | - // so enqueue it or remember to enqueue it during wp_enqueue_scripts |
|
133 | - if (did_action('wp_enqueue_scripts') || did_action('admin_enqueue_scripts')) { |
|
134 | - // ok so they've constructed this object after when they should have. |
|
135 | - // just enqueue the generic form scripts and initialize the form immediately in the JS |
|
136 | - EE_Form_Section_Proper::wp_enqueue_scripts(true); |
|
137 | - } else { |
|
138 | - add_action('wp_enqueue_scripts', array('EE_Form_Section_Proper', 'wp_enqueue_scripts')); |
|
139 | - add_action('admin_enqueue_scripts', array('EE_Form_Section_Proper', 'wp_enqueue_scripts')); |
|
140 | - } |
|
141 | - add_action('wp_footer', array($this, 'ensure_scripts_localized'), 1); |
|
142 | - /** |
|
143 | - * Gives other plugins a chance to hook in before construct finalize is called. |
|
144 | - * The form probably doesn't yet have a parent form section. |
|
145 | - * Since 4.9.32, when this action was introduced, this is the best place to add a subsection onto a form, |
|
146 | - * assuming you don't care what the form section's name, HTML ID, or HTML name etc are. |
|
147 | - * Also see AHEE__EE_Form_Section_Proper___construct_finalize__end |
|
148 | - * |
|
149 | - * @since 4.9.32 |
|
150 | - * @param EE_Form_Section_Proper $this before __construct is done, but all of its logic, |
|
151 | - * except maybe calling _construct_finalize has been done |
|
152 | - * @param array $options_array options passed into the constructor |
|
153 | - */ |
|
154 | - do_action( |
|
155 | - 'AHEE__EE_Form_Input_Base___construct__before_construct_finalize_called', |
|
156 | - $this, |
|
157 | - $options_array |
|
158 | - ); |
|
159 | - if (isset($options_array['name'])) { |
|
160 | - $this->_construct_finalize(null, $options_array['name']); |
|
161 | - } |
|
162 | - } |
|
163 | - |
|
164 | - |
|
165 | - /** |
|
166 | - * Finishes construction given the parent form section and this form section's name |
|
167 | - * |
|
168 | - * @param EE_Form_Section_Proper $parent_form_section |
|
169 | - * @param string $name |
|
170 | - * @throws EE_Error |
|
171 | - */ |
|
172 | - public function _construct_finalize($parent_form_section, $name) |
|
173 | - { |
|
174 | - parent::_construct_finalize($parent_form_section, $name); |
|
175 | - $this->_set_default_name_if_empty(); |
|
176 | - $this->_set_default_html_id_if_empty(); |
|
177 | - foreach ($this->_subsections as $subsection_name => $subsection) { |
|
178 | - if ($subsection instanceof EE_Form_Section_Base) { |
|
179 | - $subsection->_construct_finalize($this, $subsection_name); |
|
180 | - } else { |
|
181 | - throw new EE_Error( |
|
182 | - sprintf( |
|
183 | - esc_html__( |
|
184 | - 'Subsection "%s" is not an instanceof EE_Form_Section_Base on form "%s". It is a "%s"', |
|
185 | - 'event_espresso' |
|
186 | - ), |
|
187 | - $subsection_name, |
|
188 | - get_class($this), |
|
189 | - $subsection ? get_class($subsection) : esc_html__('NULL', 'event_espresso') |
|
190 | - ) |
|
191 | - ); |
|
192 | - } |
|
193 | - } |
|
194 | - /** |
|
195 | - * Action performed just after form has been given a name (and HTML ID etc) and is fully constructed. |
|
196 | - * If you have code that should modify the form and needs it and its subsections to have a name, HTML ID |
|
197 | - * (or other attributes derived from the name like the HTML label id, etc), this is where it should be done. |
|
198 | - * This might only happen just before displaying the form, or just before it receives form submission data. |
|
199 | - * If you need to modify the form or its subsections before _construct_finalize is called on it (and we've |
|
200 | - * ensured it has a name, HTML IDs, etc |
|
201 | - * |
|
202 | - * @param EE_Form_Section_Proper $this |
|
203 | - * @param EE_Form_Section_Proper|null $parent_form_section |
|
204 | - * @param string $name |
|
205 | - */ |
|
206 | - do_action( |
|
207 | - 'AHEE__EE_Form_Section_Proper___construct_finalize__end', |
|
208 | - $this, |
|
209 | - $parent_form_section, |
|
210 | - $name |
|
211 | - ); |
|
212 | - } |
|
213 | - |
|
214 | - |
|
215 | - /** |
|
216 | - * Gets the layout strategy for this form section |
|
217 | - * |
|
218 | - * @return EE_Form_Section_Layout_Base |
|
219 | - */ |
|
220 | - public function get_layout_strategy() |
|
221 | - { |
|
222 | - return $this->_layout_strategy; |
|
223 | - } |
|
224 | - |
|
225 | - |
|
226 | - /** |
|
227 | - * Gets the HTML for a single input for this form section according |
|
228 | - * to the layout strategy |
|
229 | - * |
|
230 | - * @param EE_Form_Input_Base $input |
|
231 | - * @return string |
|
232 | - */ |
|
233 | - public function get_html_for_input($input) |
|
234 | - { |
|
235 | - return $this->_layout_strategy->layout_input($input); |
|
236 | - } |
|
237 | - |
|
238 | - |
|
239 | - /** |
|
240 | - * was_submitted - checks if form inputs are present in request data |
|
241 | - * Basically an alias for form_data_present_in() (which is used by both |
|
242 | - * proper form sections and form inputs) |
|
243 | - * |
|
244 | - * @param null $form_data |
|
245 | - * @return boolean |
|
246 | - * @throws EE_Error |
|
247 | - */ |
|
248 | - public function was_submitted($form_data = null) |
|
249 | - { |
|
250 | - return $this->form_data_present_in($form_data); |
|
251 | - } |
|
252 | - |
|
253 | - /** |
|
254 | - * Gets the cached request data; but if there is none, or $req_data was set with |
|
255 | - * something different, refresh the cache, and then return it |
|
256 | - * @param null $req_data |
|
257 | - * @return array |
|
258 | - */ |
|
259 | - protected function getCachedRequest($req_data = null) |
|
260 | - { |
|
261 | - if ($this->cached_request_data === null |
|
262 | - || ( |
|
263 | - $req_data !== null && |
|
264 | - $req_data !== $this->cached_request_data |
|
265 | - ) |
|
266 | - ) { |
|
267 | - $req_data = apply_filters( |
|
268 | - 'FHEE__EE_Form_Section_Proper__receive_form_submission__req_data', |
|
269 | - $req_data, |
|
270 | - $this |
|
271 | - ); |
|
272 | - if ($req_data === null) { |
|
273 | - $req_data = array_merge($_GET, $_POST); |
|
274 | - } |
|
275 | - $req_data = apply_filters( |
|
276 | - 'FHEE__EE_Form_Section_Proper__receive_form_submission__request_data', |
|
277 | - $req_data, |
|
278 | - $this |
|
279 | - ); |
|
280 | - $this->cached_request_data = (array) $req_data; |
|
281 | - } |
|
282 | - return $this->cached_request_data; |
|
283 | - } |
|
284 | - |
|
285 | - |
|
286 | - /** |
|
287 | - * After the form section is initially created, call this to sanitize the data in the submission |
|
288 | - * which relates to this form section, validate it, and set it as properties on the form. |
|
289 | - * |
|
290 | - * @param array|null $req_data should usually be $_POST (the default). |
|
291 | - * However, you CAN supply a different array. |
|
292 | - * Consider using set_defaults() instead however. |
|
293 | - * (If you rendered the form in the page using echo $form_x->get_html() |
|
294 | - * the inputs will have the correct name in the request data for this function |
|
295 | - * to find them and populate the form with them. |
|
296 | - * If you have a flat form (with only input subsections), |
|
297 | - * you can supply a flat array where keys |
|
298 | - * are the form input names and values are their values) |
|
299 | - * @param boolean $validate whether or not to perform validation on this data. Default is, |
|
300 | - * of course, to validate that data, and set errors on the invalid values. |
|
301 | - * But if the data has already been validated |
|
302 | - * (eg you validated the data then stored it in the DB) |
|
303 | - * you may want to skip this step. |
|
304 | - * @throws InvalidArgumentException |
|
305 | - * @throws InvalidInterfaceException |
|
306 | - * @throws InvalidDataTypeException |
|
307 | - * @throws EE_Error |
|
308 | - */ |
|
309 | - public function receive_form_submission($req_data = null, $validate = true) |
|
310 | - { |
|
311 | - $req_data = $this->getCachedRequest($req_data); |
|
312 | - $this->_normalize($req_data); |
|
313 | - if ($validate) { |
|
314 | - $this->_validate(); |
|
315 | - // if it's invalid, we're going to want to re-display so remember what they submitted |
|
316 | - if (! $this->is_valid()) { |
|
317 | - $this->store_submitted_form_data_in_session(); |
|
318 | - } |
|
319 | - } |
|
320 | - if ($this->submission_error_message() === '' && ! $this->is_valid()) { |
|
321 | - $this->set_submission_error_message(); |
|
322 | - } |
|
323 | - do_action( |
|
324 | - 'AHEE__EE_Form_Section_Proper__receive_form_submission__end', |
|
325 | - $req_data, |
|
326 | - $this, |
|
327 | - $validate |
|
328 | - ); |
|
329 | - } |
|
330 | - |
|
331 | - |
|
332 | - /** |
|
333 | - * caches the originally submitted input values in the session |
|
334 | - * so that they can be used to repopulate the form if it failed validation |
|
335 | - * |
|
336 | - * @return boolean whether or not the data was successfully stored in the session |
|
337 | - * @throws InvalidArgumentException |
|
338 | - * @throws InvalidInterfaceException |
|
339 | - * @throws InvalidDataTypeException |
|
340 | - * @throws EE_Error |
|
341 | - */ |
|
342 | - protected function store_submitted_form_data_in_session() |
|
343 | - { |
|
344 | - return EE_Registry::instance()->SSN->set_session_data( |
|
345 | - array( |
|
346 | - EE_Form_Section_Proper::SUBMITTED_FORM_DATA_SSN_KEY => $this->submitted_values(true), |
|
347 | - ) |
|
348 | - ); |
|
349 | - } |
|
350 | - |
|
351 | - |
|
352 | - /** |
|
353 | - * retrieves the originally submitted input values in the session |
|
354 | - * so that they can be used to repopulate the form if it failed validation |
|
355 | - * |
|
356 | - * @return array |
|
357 | - * @throws InvalidArgumentException |
|
358 | - * @throws InvalidInterfaceException |
|
359 | - * @throws InvalidDataTypeException |
|
360 | - */ |
|
361 | - protected function get_submitted_form_data_from_session() |
|
362 | - { |
|
363 | - $session = EE_Registry::instance()->SSN; |
|
364 | - if ($session instanceof EE_Session) { |
|
365 | - return $session->get_session_data( |
|
366 | - EE_Form_Section_Proper::SUBMITTED_FORM_DATA_SSN_KEY |
|
367 | - ); |
|
368 | - } |
|
369 | - return array(); |
|
370 | - } |
|
371 | - |
|
372 | - |
|
373 | - /** |
|
374 | - * flushed the originally submitted input values from the session |
|
375 | - * |
|
376 | - * @return boolean whether or not the data was successfully removed from the session |
|
377 | - * @throws InvalidArgumentException |
|
378 | - * @throws InvalidInterfaceException |
|
379 | - * @throws InvalidDataTypeException |
|
380 | - */ |
|
381 | - public static function flush_submitted_form_data_from_session() |
|
382 | - { |
|
383 | - return EE_Registry::instance()->SSN->reset_data( |
|
384 | - array(EE_Form_Section_Proper::SUBMITTED_FORM_DATA_SSN_KEY) |
|
385 | - ); |
|
386 | - } |
|
387 | - |
|
388 | - |
|
389 | - /** |
|
390 | - * Populates this form and its subsections with data from the session. |
|
391 | - * (Wrapper for EE_Form_Section_Proper::receive_form_submission, so it shows |
|
392 | - * validation errors when displaying too) |
|
393 | - * Returns true if the form was populated from the session, false otherwise |
|
394 | - * |
|
395 | - * @return boolean |
|
396 | - * @throws InvalidArgumentException |
|
397 | - * @throws InvalidInterfaceException |
|
398 | - * @throws InvalidDataTypeException |
|
399 | - * @throws EE_Error |
|
400 | - */ |
|
401 | - public function populate_from_session() |
|
402 | - { |
|
403 | - $form_data_in_session = $this->get_submitted_form_data_from_session(); |
|
404 | - if (empty($form_data_in_session)) { |
|
405 | - return false; |
|
406 | - } |
|
407 | - $this->receive_form_submission($form_data_in_session); |
|
408 | - add_action('shutdown', array('EE_Form_Section_Proper', 'flush_submitted_form_data_from_session')); |
|
409 | - if ($this->form_data_present_in($form_data_in_session)) { |
|
410 | - return true; |
|
411 | - } |
|
412 | - return false; |
|
413 | - } |
|
414 | - |
|
415 | - |
|
416 | - /** |
|
417 | - * Populates the default data for the form, given an array where keys are |
|
418 | - * the input names, and values are their values (preferably normalized to be their |
|
419 | - * proper PHP types, not all strings... although that should be ok too). |
|
420 | - * Proper subsections are sub-arrays, the key being the subsection's name, and |
|
421 | - * the value being an array formatted in teh same way |
|
422 | - * |
|
423 | - * @param array $default_data |
|
424 | - * @throws EE_Error |
|
425 | - */ |
|
426 | - public function populate_defaults($default_data) |
|
427 | - { |
|
428 | - foreach ($this->subsections(false) as $subsection_name => $subsection) { |
|
429 | - if (isset($default_data[ $subsection_name ])) { |
|
430 | - if ($subsection instanceof EE_Form_Input_Base) { |
|
431 | - $subsection->set_default($default_data[ $subsection_name ]); |
|
432 | - } elseif ($subsection instanceof EE_Form_Section_Proper) { |
|
433 | - $subsection->populate_defaults($default_data[ $subsection_name ]); |
|
434 | - } |
|
435 | - } |
|
436 | - } |
|
437 | - } |
|
438 | - |
|
439 | - |
|
440 | - /** |
|
441 | - * returns true if subsection exists |
|
442 | - * |
|
443 | - * @param string $name |
|
444 | - * @return boolean |
|
445 | - */ |
|
446 | - public function subsection_exists($name) |
|
447 | - { |
|
448 | - return isset($this->_subsections[ $name ]) ? true : false; |
|
449 | - } |
|
450 | - |
|
451 | - |
|
452 | - /** |
|
453 | - * Gets the subsection specified by its name |
|
454 | - * |
|
455 | - * @param string $name |
|
456 | - * @param boolean $require_construction_to_be_finalized most client code should leave this as TRUE |
|
457 | - * so that the inputs will be properly configured. |
|
458 | - * However, some client code may be ok |
|
459 | - * with construction finalize being called later |
|
460 | - * (realizing that the subsections' html names |
|
461 | - * might not be set yet, etc.) |
|
462 | - * @return EE_Form_Section_Base |
|
463 | - * @throws EE_Error |
|
464 | - */ |
|
465 | - public function get_subsection($name, $require_construction_to_be_finalized = true) |
|
466 | - { |
|
467 | - if ($require_construction_to_be_finalized) { |
|
468 | - $this->ensure_construct_finalized_called(); |
|
469 | - } |
|
470 | - return $this->subsection_exists($name) ? $this->_subsections[ $name ] : null; |
|
471 | - } |
|
472 | - |
|
473 | - |
|
474 | - /** |
|
475 | - * Gets all the validatable subsections of this form section |
|
476 | - * |
|
477 | - * @return EE_Form_Section_Validatable[] |
|
478 | - * @throws EE_Error |
|
479 | - */ |
|
480 | - public function get_validatable_subsections() |
|
481 | - { |
|
482 | - $validatable_subsections = array(); |
|
483 | - foreach ($this->subsections() as $name => $obj) { |
|
484 | - if ($obj instanceof EE_Form_Section_Validatable) { |
|
485 | - $validatable_subsections[ $name ] = $obj; |
|
486 | - } |
|
487 | - } |
|
488 | - return $validatable_subsections; |
|
489 | - } |
|
490 | - |
|
491 | - |
|
492 | - /** |
|
493 | - * Gets an input by the given name. If not found, or if its not an EE_FOrm_Input_Base child, |
|
494 | - * throw an EE_Error. |
|
495 | - * |
|
496 | - * @param string $name |
|
497 | - * @param boolean $require_construction_to_be_finalized most client code should |
|
498 | - * leave this as TRUE so that the inputs will be properly |
|
499 | - * configured. However, some client code may be ok with |
|
500 | - * construction finalize being called later |
|
501 | - * (realizing that the subsections' html names might not be |
|
502 | - * set yet, etc.) |
|
503 | - * @return EE_Form_Input_Base |
|
504 | - * @throws EE_Error |
|
505 | - */ |
|
506 | - public function get_input($name, $require_construction_to_be_finalized = true) |
|
507 | - { |
|
508 | - $subsection = $this->get_subsection( |
|
509 | - $name, |
|
510 | - $require_construction_to_be_finalized |
|
511 | - ); |
|
512 | - if (! $subsection instanceof EE_Form_Input_Base) { |
|
513 | - throw new EE_Error( |
|
514 | - sprintf( |
|
515 | - esc_html__( |
|
516 | - "Subsection '%s' is not an instanceof EE_Form_Input_Base on form '%s'. It is a '%s'", |
|
517 | - 'event_espresso' |
|
518 | - ), |
|
519 | - $name, |
|
520 | - get_class($this), |
|
521 | - $subsection ? get_class($subsection) : esc_html__('NULL', 'event_espresso') |
|
522 | - ) |
|
523 | - ); |
|
524 | - } |
|
525 | - return $subsection; |
|
526 | - } |
|
527 | - |
|
528 | - |
|
529 | - /** |
|
530 | - * Like get_input(), gets the proper subsection of the form given the name, |
|
531 | - * otherwise throws an EE_Error |
|
532 | - * |
|
533 | - * @param string $name |
|
534 | - * @param boolean $require_construction_to_be_finalized most client code should |
|
535 | - * leave this as TRUE so that the inputs will be properly |
|
536 | - * configured. However, some client code may be ok with |
|
537 | - * construction finalize being called later |
|
538 | - * (realizing that the subsections' html names might not be |
|
539 | - * set yet, etc.) |
|
540 | - * @return EE_Form_Section_Proper |
|
541 | - * @throws EE_Error |
|
542 | - */ |
|
543 | - public function get_proper_subsection($name, $require_construction_to_be_finalized = true) |
|
544 | - { |
|
545 | - $subsection = $this->get_subsection( |
|
546 | - $name, |
|
547 | - $require_construction_to_be_finalized |
|
548 | - ); |
|
549 | - if (! $subsection instanceof EE_Form_Section_Proper) { |
|
550 | - throw new EE_Error( |
|
551 | - sprintf( |
|
552 | - esc_html__( |
|
553 | - "Subsection '%'s is not an instanceof EE_Form_Section_Proper on form '%s'", |
|
554 | - 'event_espresso' |
|
555 | - ), |
|
556 | - $name, |
|
557 | - get_class($this) |
|
558 | - ) |
|
559 | - ); |
|
560 | - } |
|
561 | - return $subsection; |
|
562 | - } |
|
563 | - |
|
564 | - |
|
565 | - /** |
|
566 | - * Gets the value of the specified input. Should be called after receive_form_submission() |
|
567 | - * or populate_defaults() on the form, where the normalized value on the input is set. |
|
568 | - * |
|
569 | - * @param string $name |
|
570 | - * @return mixed depending on the input's type and its normalization strategy |
|
571 | - * @throws EE_Error |
|
572 | - */ |
|
573 | - public function get_input_value($name) |
|
574 | - { |
|
575 | - $input = $this->get_input($name); |
|
576 | - return $input->normalized_value(); |
|
577 | - } |
|
578 | - |
|
579 | - |
|
580 | - /** |
|
581 | - * Checks if this form section itself is valid, and then checks its subsections |
|
582 | - * |
|
583 | - * @throws EE_Error |
|
584 | - * @return boolean |
|
585 | - */ |
|
586 | - public function is_valid() |
|
587 | - { |
|
588 | - if ($this->is_valid === null) { |
|
589 | - if (! $this->has_received_submission()) { |
|
590 | - throw new EE_Error( |
|
591 | - sprintf( |
|
592 | - esc_html__( |
|
593 | - 'You cannot check if a form is valid before receiving the form submission using receive_form_submission', |
|
594 | - 'event_espresso' |
|
595 | - ) |
|
596 | - ) |
|
597 | - ); |
|
598 | - } |
|
599 | - if (! parent::is_valid()) { |
|
600 | - $this->is_valid = false; |
|
601 | - } else { |
|
602 | - // ok so no general errors to this entire form section. |
|
603 | - // so let's check the subsections, but only set errors if that hasn't been done yet |
|
604 | - $this->is_valid = true; |
|
605 | - foreach ($this->get_validatable_subsections() as $subsection) { |
|
606 | - if (! $subsection->is_valid()) { |
|
607 | - $this->is_valid = false; |
|
608 | - } |
|
609 | - } |
|
610 | - } |
|
611 | - } |
|
612 | - return $this->is_valid; |
|
613 | - } |
|
614 | - |
|
615 | - |
|
616 | - /** |
|
617 | - * gets the default name of this form section if none is specified |
|
618 | - * |
|
619 | - * @return void |
|
620 | - */ |
|
621 | - protected function _set_default_name_if_empty() |
|
622 | - { |
|
623 | - if (! $this->_name) { |
|
624 | - $classname = get_class($this); |
|
625 | - $default_name = str_replace('EE_', '', $classname); |
|
626 | - $this->_name = $default_name; |
|
627 | - } |
|
628 | - } |
|
629 | - |
|
630 | - |
|
631 | - /** |
|
632 | - * Returns the HTML for the form, except for the form opening and closing tags |
|
633 | - * (as the form section doesn't know where you necessarily want to send the information to), |
|
634 | - * and except for a submit button. Enqueues JS and CSS; if called early enough we will |
|
635 | - * try to enqueue them in the header, otherwise they'll be enqueued in the footer. |
|
636 | - * Not doing_it_wrong because theoretically this CAN be used properly, |
|
637 | - * provided its used during "wp_enqueue_scripts", or it doesn't need to enqueue |
|
638 | - * any CSS. |
|
639 | - * |
|
640 | - * @throws InvalidArgumentException |
|
641 | - * @throws InvalidInterfaceException |
|
642 | - * @throws InvalidDataTypeException |
|
643 | - * @throws EE_Error |
|
644 | - */ |
|
645 | - public function get_html_and_js() |
|
646 | - { |
|
647 | - $this->enqueue_js(); |
|
648 | - return $this->get_html(); |
|
649 | - } |
|
650 | - |
|
651 | - |
|
652 | - /** |
|
653 | - * returns HTML for displaying this form section. recursively calls display_section() on all subsections |
|
654 | - * |
|
655 | - * @param bool $display_previously_submitted_data |
|
656 | - * @return string |
|
657 | - * @throws InvalidArgumentException |
|
658 | - * @throws InvalidInterfaceException |
|
659 | - * @throws InvalidDataTypeException |
|
660 | - * @throws EE_Error |
|
661 | - * @throws EE_Error |
|
662 | - * @throws EE_Error |
|
663 | - */ |
|
664 | - public function get_html($display_previously_submitted_data = true) |
|
665 | - { |
|
666 | - $this->ensure_construct_finalized_called(); |
|
667 | - if ($display_previously_submitted_data) { |
|
668 | - $this->populate_from_session(); |
|
669 | - } |
|
670 | - return $this->_form_html_filter |
|
671 | - ? $this->_form_html_filter->filterHtml($this->_layout_strategy->layout_form(), $this) |
|
672 | - : $this->_layout_strategy->layout_form(); |
|
673 | - } |
|
674 | - |
|
675 | - |
|
676 | - /** |
|
677 | - * enqueues JS and CSS for the form. |
|
678 | - * It is preferred to call this before wp_enqueue_scripts so the |
|
679 | - * scripts and styles can be put in the header, but if called later |
|
680 | - * they will be put in the footer (which is OK for JS, but in HTML4 CSS should |
|
681 | - * only be in the header; but in HTML5 its ok in the body. |
|
682 | - * See http://stackoverflow.com/questions/4957446/load-external-css-file-in-body-tag. |
|
683 | - * So if your form enqueues CSS, it's preferred to call this before wp_enqueue_scripts.) |
|
684 | - * |
|
685 | - * @return void |
|
686 | - * @throws EE_Error |
|
687 | - */ |
|
688 | - public function enqueue_js() |
|
689 | - { |
|
690 | - $this->_enqueue_and_localize_form_js(); |
|
691 | - foreach ($this->subsections() as $subsection) { |
|
692 | - $subsection->enqueue_js(); |
|
693 | - } |
|
694 | - } |
|
695 | - |
|
696 | - |
|
697 | - /** |
|
698 | - * adds a filter so that jquery validate gets enqueued in EE_System::wp_enqueue_scripts(). |
|
699 | - * This must be done BEFORE wp_enqueue_scripts() gets called, which is on |
|
700 | - * the wp_enqueue_scripts hook. |
|
701 | - * However, registering the form js and localizing it can happen when we |
|
702 | - * actually output the form (which is preferred, seeing how teh form's fields |
|
703 | - * could change until it's actually outputted) |
|
704 | - * |
|
705 | - * @param boolean $init_form_validation_automatically whether or not we want the form validation |
|
706 | - * to be triggered automatically or not |
|
707 | - * @return void |
|
708 | - */ |
|
709 | - public static function wp_enqueue_scripts($init_form_validation_automatically = true) |
|
710 | - { |
|
711 | - wp_register_script( |
|
712 | - 'ee_form_section_validation', |
|
713 | - EE_GLOBAL_ASSETS_URL . 'scripts' . '/form_section_validation.js', |
|
714 | - array('jquery-validate', 'jquery-ui-datepicker', 'jquery-validate-extra-methods'), |
|
715 | - EVENT_ESPRESSO_VERSION, |
|
716 | - true |
|
717 | - ); |
|
718 | - wp_localize_script( |
|
719 | - 'ee_form_section_validation', |
|
720 | - 'ee_form_section_validation_init', |
|
721 | - array('init' => $init_form_validation_automatically ? '1' : '0') |
|
722 | - ); |
|
723 | - } |
|
724 | - |
|
725 | - |
|
726 | - /** |
|
727 | - * gets the variables used by form_section_validation.js. |
|
728 | - * This needs to be called AFTER we've called $this->_enqueue_jquery_validate_script, |
|
729 | - * but before the wordpress hook wp_loaded |
|
730 | - * |
|
731 | - * @throws EE_Error |
|
732 | - */ |
|
733 | - public function _enqueue_and_localize_form_js() |
|
734 | - { |
|
735 | - $this->ensure_construct_finalized_called(); |
|
736 | - // actually, we don't want to localize just yet. There may be other forms on the page. |
|
737 | - // so we need to add our form section data to a static variable accessible by all form sections |
|
738 | - // and localize it just before the footer |
|
739 | - $this->localize_validation_rules(); |
|
740 | - add_action('wp_footer', array('EE_Form_Section_Proper', 'localize_script_for_all_forms'), 2); |
|
741 | - add_action('admin_footer', array('EE_Form_Section_Proper', 'localize_script_for_all_forms')); |
|
742 | - } |
|
743 | - |
|
744 | - |
|
745 | - /** |
|
746 | - * add our form section data to a static variable accessible by all form sections |
|
747 | - * |
|
748 | - * @param bool $return_for_subsection |
|
749 | - * @return void |
|
750 | - * @throws EE_Error |
|
751 | - */ |
|
752 | - public function localize_validation_rules($return_for_subsection = false) |
|
753 | - { |
|
754 | - // we only want to localize vars ONCE for the entire form, |
|
755 | - // so if the form section doesn't have a parent, then it must be the top dog |
|
756 | - if ($return_for_subsection || ! $this->parent_section()) { |
|
757 | - EE_Form_Section_Proper::$_js_localization['form_data'][ $this->html_id() ] = array( |
|
758 | - 'form_section_id' => $this->html_id(true), |
|
759 | - 'validation_rules' => $this->get_jquery_validation_rules(), |
|
760 | - 'other_data' => $this->get_other_js_data(), |
|
761 | - 'errors' => $this->subsection_validation_errors_by_html_name(), |
|
762 | - ); |
|
763 | - EE_Form_Section_Proper::$_scripts_localized = true; |
|
764 | - } |
|
765 | - } |
|
766 | - |
|
767 | - |
|
768 | - /** |
|
769 | - * Gets an array of extra data that will be useful for client-side javascript. |
|
770 | - * This is primarily data added by inputs and forms in addition to any |
|
771 | - * scripts they might enqueue |
|
772 | - * |
|
773 | - * @param array $form_other_js_data |
|
774 | - * @return array |
|
775 | - * @throws EE_Error |
|
776 | - */ |
|
777 | - public function get_other_js_data($form_other_js_data = array()) |
|
778 | - { |
|
779 | - foreach ($this->subsections() as $subsection) { |
|
780 | - $form_other_js_data = $subsection->get_other_js_data($form_other_js_data); |
|
781 | - } |
|
782 | - return $form_other_js_data; |
|
783 | - } |
|
784 | - |
|
785 | - |
|
786 | - /** |
|
787 | - * Gets a flat array of inputs for this form section and its subsections. |
|
788 | - * Keys are their form names, and values are the inputs themselves |
|
789 | - * |
|
790 | - * @return EE_Form_Input_Base |
|
791 | - * @throws EE_Error |
|
792 | - */ |
|
793 | - public function inputs_in_subsections() |
|
794 | - { |
|
795 | - $inputs = array(); |
|
796 | - foreach ($this->subsections() as $subsection) { |
|
797 | - if ($subsection instanceof EE_Form_Input_Base) { |
|
798 | - $inputs[ $subsection->html_name() ] = $subsection; |
|
799 | - } elseif ($subsection instanceof EE_Form_Section_Proper) { |
|
800 | - $inputs += $subsection->inputs_in_subsections(); |
|
801 | - } |
|
802 | - } |
|
803 | - return $inputs; |
|
804 | - } |
|
805 | - |
|
806 | - |
|
807 | - /** |
|
808 | - * Gets a flat array of all the validation errors. |
|
809 | - * Keys are html names (because those should be unique) |
|
810 | - * and values are a string of all their validation errors |
|
811 | - * |
|
812 | - * @return string[] |
|
813 | - * @throws EE_Error |
|
814 | - */ |
|
815 | - public function subsection_validation_errors_by_html_name() |
|
816 | - { |
|
817 | - $inputs = $this->inputs(); |
|
818 | - $errors = array(); |
|
819 | - foreach ($inputs as $form_input) { |
|
820 | - if ($form_input instanceof EE_Form_Input_Base && $form_input->get_validation_errors()) { |
|
821 | - $errors[ $form_input->html_name() ] = $form_input->get_validation_error_string(); |
|
822 | - } |
|
823 | - } |
|
824 | - return $errors; |
|
825 | - } |
|
826 | - |
|
827 | - |
|
828 | - /** |
|
829 | - * passes all the form data required by the JS to the JS, and enqueues the few required JS files. |
|
830 | - * Should be setup by each form during the _enqueues_and_localize_form_js |
|
831 | - * |
|
832 | - * @throws InvalidArgumentException |
|
833 | - * @throws InvalidInterfaceException |
|
834 | - * @throws InvalidDataTypeException |
|
835 | - */ |
|
836 | - public static function localize_script_for_all_forms() |
|
837 | - { |
|
838 | - // allow inputs and stuff to hook in their JS and stuff here |
|
839 | - do_action('AHEE__EE_Form_Section_Proper__localize_script_for_all_forms__begin'); |
|
840 | - EE_Form_Section_Proper::$_js_localization['localized_error_messages'] = EE_Form_Section_Proper::_get_localized_error_messages(); |
|
841 | - $email_validation_level = isset(EE_Registry::instance()->CFG->registration->email_validation_level) |
|
842 | - ? EE_Registry::instance()->CFG->registration->email_validation_level |
|
843 | - : 'wp_default'; |
|
844 | - EE_Form_Section_Proper::$_js_localization['email_validation_level'] = $email_validation_level; |
|
845 | - wp_enqueue_script('ee_form_section_validation'); |
|
846 | - wp_localize_script( |
|
847 | - 'ee_form_section_validation', |
|
848 | - 'ee_form_section_vars', |
|
849 | - EE_Form_Section_Proper::$_js_localization |
|
850 | - ); |
|
851 | - } |
|
852 | - |
|
853 | - |
|
854 | - /** |
|
855 | - * ensure_scripts_localized |
|
856 | - * |
|
857 | - * @throws EE_Error |
|
858 | - */ |
|
859 | - public function ensure_scripts_localized() |
|
860 | - { |
|
861 | - if (! EE_Form_Section_Proper::$_scripts_localized) { |
|
862 | - $this->_enqueue_and_localize_form_js(); |
|
863 | - } |
|
864 | - } |
|
865 | - |
|
866 | - |
|
867 | - /** |
|
868 | - * Gets the hard-coded validation error messages to be used in the JS. The convention |
|
869 | - * is that the key here should be the same as the custom validation rule put in the JS file |
|
870 | - * |
|
871 | - * @return array keys are custom validation rules, and values are internationalized strings |
|
872 | - */ |
|
873 | - private static function _get_localized_error_messages() |
|
874 | - { |
|
875 | - return array( |
|
876 | - 'validUrl' => esc_html__('This is not a valid absolute URL. Eg, http://domain.com/monkey.jpg', 'event_espresso'), |
|
877 | - 'regex' => esc_html__('Please check your input', 'event_espresso'), |
|
878 | - ); |
|
879 | - } |
|
880 | - |
|
881 | - |
|
882 | - /** |
|
883 | - * @return array |
|
884 | - */ |
|
885 | - public static function js_localization() |
|
886 | - { |
|
887 | - return self::$_js_localization; |
|
888 | - } |
|
889 | - |
|
890 | - |
|
891 | - /** |
|
892 | - * @return void |
|
893 | - */ |
|
894 | - public static function reset_js_localization() |
|
895 | - { |
|
896 | - self::$_js_localization = array(); |
|
897 | - } |
|
898 | - |
|
899 | - |
|
900 | - /** |
|
901 | - * Gets the JS to put inside the jquery validation rules for subsection of this form section. |
|
902 | - * See parent function for more... |
|
903 | - * |
|
904 | - * @return array |
|
905 | - * @throws EE_Error |
|
906 | - */ |
|
907 | - public function get_jquery_validation_rules() |
|
908 | - { |
|
909 | - $jquery_validation_rules = array(); |
|
910 | - foreach ($this->get_validatable_subsections() as $subsection) { |
|
911 | - $jquery_validation_rules = array_merge( |
|
912 | - $jquery_validation_rules, |
|
913 | - $subsection->get_jquery_validation_rules() |
|
914 | - ); |
|
915 | - } |
|
916 | - return $jquery_validation_rules; |
|
917 | - } |
|
918 | - |
|
919 | - |
|
920 | - /** |
|
921 | - * Sanitizes all the data and sets the sanitized value of each field |
|
922 | - * |
|
923 | - * @param array $req_data like $_POST |
|
924 | - * @return void |
|
925 | - * @throws EE_Error |
|
926 | - */ |
|
927 | - protected function _normalize($req_data) |
|
928 | - { |
|
929 | - $this->_received_submission = true; |
|
930 | - $this->_validation_errors = array(); |
|
931 | - foreach ($this->get_validatable_subsections() as $subsection) { |
|
932 | - try { |
|
933 | - $subsection->_normalize($req_data); |
|
934 | - } catch (EE_Validation_Error $e) { |
|
935 | - $subsection->add_validation_error($e); |
|
936 | - } |
|
937 | - } |
|
938 | - } |
|
939 | - |
|
940 | - |
|
941 | - /** |
|
942 | - * Performs validation on this form section and its subsections. |
|
943 | - * For each subsection, |
|
944 | - * calls _validate_{subsection_name} on THIS form (if the function exists) |
|
945 | - * and passes it the subsection, then calls _validate on that subsection. |
|
946 | - * If you need to perform validation on the form as a whole (considering multiple) |
|
947 | - * you would be best to override this _validate method, |
|
948 | - * calling parent::_validate() first. |
|
949 | - * |
|
950 | - * @throws EE_Error |
|
951 | - */ |
|
952 | - protected function _validate() |
|
953 | - { |
|
954 | - // reset the cache of whether this form is valid or not- we're re-validating it now |
|
955 | - $this->is_valid = null; |
|
956 | - foreach ($this->get_validatable_subsections() as $subsection_name => $subsection) { |
|
957 | - if (method_exists($this, '_validate_' . $subsection_name)) { |
|
958 | - call_user_func_array(array($this, '_validate_' . $subsection_name), array($subsection)); |
|
959 | - } |
|
960 | - $subsection->_validate(); |
|
961 | - } |
|
962 | - } |
|
963 | - |
|
964 | - |
|
965 | - /** |
|
966 | - * Gets all the validated inputs for the form section |
|
967 | - * |
|
968 | - * @return array |
|
969 | - * @throws EE_Error |
|
970 | - */ |
|
971 | - public function valid_data() |
|
972 | - { |
|
973 | - $inputs = array(); |
|
974 | - foreach ($this->subsections() as $subsection_name => $subsection) { |
|
975 | - if ($subsection instanceof EE_Form_Section_Proper) { |
|
976 | - $inputs[ $subsection_name ] = $subsection->valid_data(); |
|
977 | - } elseif ($subsection instanceof EE_Form_Input_Base) { |
|
978 | - $inputs[ $subsection_name ] = $subsection->normalized_value(); |
|
979 | - } |
|
980 | - } |
|
981 | - return $inputs; |
|
982 | - } |
|
983 | - |
|
984 | - |
|
985 | - /** |
|
986 | - * Gets all the inputs on this form section |
|
987 | - * |
|
988 | - * @return EE_Form_Input_Base[] |
|
989 | - * @throws EE_Error |
|
990 | - */ |
|
991 | - public function inputs() |
|
992 | - { |
|
993 | - $inputs = array(); |
|
994 | - foreach ($this->subsections() as $subsection_name => $subsection) { |
|
995 | - if ($subsection instanceof EE_Form_Input_Base) { |
|
996 | - $inputs[ $subsection_name ] = $subsection; |
|
997 | - } |
|
998 | - } |
|
999 | - return $inputs; |
|
1000 | - } |
|
1001 | - |
|
1002 | - |
|
1003 | - /** |
|
1004 | - * Gets all the subsections which are a proper form |
|
1005 | - * |
|
1006 | - * @return EE_Form_Section_Proper[] |
|
1007 | - * @throws EE_Error |
|
1008 | - */ |
|
1009 | - public function subforms() |
|
1010 | - { |
|
1011 | - $form_sections = array(); |
|
1012 | - foreach ($this->subsections() as $name => $obj) { |
|
1013 | - if ($obj instanceof EE_Form_Section_Proper) { |
|
1014 | - $form_sections[ $name ] = $obj; |
|
1015 | - } |
|
1016 | - } |
|
1017 | - return $form_sections; |
|
1018 | - } |
|
1019 | - |
|
1020 | - |
|
1021 | - /** |
|
1022 | - * Gets all the subsections (inputs, proper subsections, or html-only sections). |
|
1023 | - * Consider using inputs() or subforms() |
|
1024 | - * if you only want form inputs or proper form sections. |
|
1025 | - * |
|
1026 | - * @param boolean $require_construction_to_be_finalized most client code should |
|
1027 | - * leave this as TRUE so that the inputs will be properly |
|
1028 | - * configured. However, some client code may be ok with |
|
1029 | - * construction finalize being called later |
|
1030 | - * (realizing that the subsections' html names might not be |
|
1031 | - * set yet, etc.) |
|
1032 | - * @return EE_Form_Section_Proper[] |
|
1033 | - * @throws EE_Error |
|
1034 | - */ |
|
1035 | - public function subsections($require_construction_to_be_finalized = true) |
|
1036 | - { |
|
1037 | - if ($require_construction_to_be_finalized) { |
|
1038 | - $this->ensure_construct_finalized_called(); |
|
1039 | - } |
|
1040 | - return $this->_subsections; |
|
1041 | - } |
|
1042 | - |
|
1043 | - |
|
1044 | - /** |
|
1045 | - * Returns whether this form has any subforms or inputs |
|
1046 | - * @return bool |
|
1047 | - */ |
|
1048 | - public function hasSubsections() |
|
1049 | - { |
|
1050 | - return ! empty($this->_subsections); |
|
1051 | - } |
|
1052 | - |
|
1053 | - |
|
1054 | - /** |
|
1055 | - * Returns a simple array where keys are input names, and values are their normalized |
|
1056 | - * values. (Similar to calling get_input_value on inputs) |
|
1057 | - * |
|
1058 | - * @param boolean $include_subform_inputs Whether to include inputs from subforms, |
|
1059 | - * or just this forms' direct children inputs |
|
1060 | - * @param boolean $flatten Whether to force the results into 1-dimensional array, |
|
1061 | - * or allow multidimensional array |
|
1062 | - * @return array if $flatten is TRUE it will always be a 1-dimensional array |
|
1063 | - * with array keys being input names |
|
1064 | - * (regardless of whether they are from a subsection or not), |
|
1065 | - * and if $flatten is FALSE it can be a multidimensional array |
|
1066 | - * where keys are always subsection names and values are either |
|
1067 | - * the input's normalized value, or an array like the top-level array |
|
1068 | - * @throws EE_Error |
|
1069 | - */ |
|
1070 | - public function input_values($include_subform_inputs = false, $flatten = false) |
|
1071 | - { |
|
1072 | - return $this->_input_values(false, $include_subform_inputs, $flatten); |
|
1073 | - } |
|
1074 | - |
|
1075 | - |
|
1076 | - /** |
|
1077 | - * Similar to EE_Form_Section_Proper::input_values(), except this returns the 'display_value' |
|
1078 | - * of each input. On some inputs (especially radio boxes or checkboxes), the value stored |
|
1079 | - * is not necessarily the value we want to display to users. This creates an array |
|
1080 | - * where keys are the input names, and values are their display values |
|
1081 | - * |
|
1082 | - * @param boolean $include_subform_inputs Whether to include inputs from subforms, |
|
1083 | - * or just this forms' direct children inputs |
|
1084 | - * @param boolean $flatten Whether to force the results into 1-dimensional array, |
|
1085 | - * or allow multidimensional array |
|
1086 | - * @return array if $flatten is TRUE it will always be a 1-dimensional array |
|
1087 | - * with array keys being input names |
|
1088 | - * (regardless of whether they are from a subsection or not), |
|
1089 | - * and if $flatten is FALSE it can be a multidimensional array |
|
1090 | - * where keys are always subsection names and values are either |
|
1091 | - * the input's normalized value, or an array like the top-level array |
|
1092 | - * @throws EE_Error |
|
1093 | - */ |
|
1094 | - public function input_pretty_values($include_subform_inputs = false, $flatten = false) |
|
1095 | - { |
|
1096 | - return $this->_input_values(true, $include_subform_inputs, $flatten); |
|
1097 | - } |
|
1098 | - |
|
1099 | - |
|
1100 | - /** |
|
1101 | - * Gets the input values from the form |
|
1102 | - * |
|
1103 | - * @param boolean $pretty Whether to retrieve the pretty value, |
|
1104 | - * or just the normalized value |
|
1105 | - * @param boolean $include_subform_inputs Whether to include inputs from subforms, |
|
1106 | - * or just this forms' direct children inputs |
|
1107 | - * @param boolean $flatten Whether to force the results into 1-dimensional array, |
|
1108 | - * or allow multidimensional array |
|
1109 | - * @return array if $flatten is TRUE it will always be a 1-dimensional array with array keys being |
|
1110 | - * input names (regardless of whether they are from a subsection or not), |
|
1111 | - * and if $flatten is FALSE it can be a multidimensional array |
|
1112 | - * where keys are always subsection names and values are either |
|
1113 | - * the input's normalized value, or an array like the top-level array |
|
1114 | - * @throws EE_Error |
|
1115 | - */ |
|
1116 | - public function _input_values($pretty = false, $include_subform_inputs = false, $flatten = false) |
|
1117 | - { |
|
1118 | - $input_values = array(); |
|
1119 | - foreach ($this->subsections() as $subsection_name => $subsection) { |
|
1120 | - if ($subsection instanceof EE_Form_Input_Base) { |
|
1121 | - $input_values[ $subsection_name ] = $pretty |
|
1122 | - ? $subsection->pretty_value() |
|
1123 | - : $subsection->normalized_value(); |
|
1124 | - } elseif ($subsection instanceof EE_Form_Section_Proper && $include_subform_inputs) { |
|
1125 | - $subform_input_values = $subsection->_input_values( |
|
1126 | - $pretty, |
|
1127 | - $include_subform_inputs, |
|
1128 | - $flatten |
|
1129 | - ); |
|
1130 | - if ($flatten) { |
|
1131 | - $input_values = array_merge($input_values, $subform_input_values); |
|
1132 | - } else { |
|
1133 | - $input_values[ $subsection_name ] = $subform_input_values; |
|
1134 | - } |
|
1135 | - } |
|
1136 | - } |
|
1137 | - return $input_values; |
|
1138 | - } |
|
1139 | - |
|
1140 | - |
|
1141 | - /** |
|
1142 | - * Gets the originally submitted input values from the form |
|
1143 | - * |
|
1144 | - * @param boolean $include_subforms Whether to include inputs from subforms, |
|
1145 | - * or just this forms' direct children inputs |
|
1146 | - * @return array if $flatten is TRUE it will always be a 1-dimensional array |
|
1147 | - * with array keys being input names |
|
1148 | - * (regardless of whether they are from a subsection or not), |
|
1149 | - * and if $flatten is FALSE it can be a multidimensional array |
|
1150 | - * where keys are always subsection names and values are either |
|
1151 | - * the input's normalized value, or an array like the top-level array |
|
1152 | - * @throws EE_Error |
|
1153 | - */ |
|
1154 | - public function submitted_values($include_subforms = false) |
|
1155 | - { |
|
1156 | - $submitted_values = array(); |
|
1157 | - foreach ($this->subsections() as $subsection) { |
|
1158 | - if ($subsection instanceof EE_Form_Input_Base) { |
|
1159 | - // is this input part of an array of inputs? |
|
1160 | - if (strpos($subsection->html_name(), '[') !== false) { |
|
1161 | - $full_input_name = EEH_Array::convert_array_values_to_keys( |
|
1162 | - explode( |
|
1163 | - '[', |
|
1164 | - str_replace(']', '', $subsection->html_name()) |
|
1165 | - ), |
|
1166 | - $subsection->raw_value() |
|
1167 | - ); |
|
1168 | - $submitted_values = array_replace_recursive($submitted_values, $full_input_name); |
|
1169 | - } else { |
|
1170 | - $submitted_values[ $subsection->html_name() ] = $subsection->raw_value(); |
|
1171 | - } |
|
1172 | - } elseif ($subsection instanceof EE_Form_Section_Proper && $include_subforms) { |
|
1173 | - $subform_input_values = $subsection->submitted_values($include_subforms); |
|
1174 | - $submitted_values = array_replace_recursive($submitted_values, $subform_input_values); |
|
1175 | - } |
|
1176 | - } |
|
1177 | - return $submitted_values; |
|
1178 | - } |
|
1179 | - |
|
1180 | - |
|
1181 | - /** |
|
1182 | - * Indicates whether or not this form has received a submission yet |
|
1183 | - * (ie, had receive_form_submission called on it yet) |
|
1184 | - * |
|
1185 | - * @return boolean |
|
1186 | - * @throws EE_Error |
|
1187 | - */ |
|
1188 | - public function has_received_submission() |
|
1189 | - { |
|
1190 | - $this->ensure_construct_finalized_called(); |
|
1191 | - return $this->_received_submission; |
|
1192 | - } |
|
1193 | - |
|
1194 | - |
|
1195 | - /** |
|
1196 | - * Equivalent to passing 'exclude' in the constructor's options array. |
|
1197 | - * Removes the listed inputs from the form |
|
1198 | - * |
|
1199 | - * @param array $inputs_to_exclude values are the input names |
|
1200 | - * @return void |
|
1201 | - */ |
|
1202 | - public function exclude(array $inputs_to_exclude = array()) |
|
1203 | - { |
|
1204 | - foreach ($inputs_to_exclude as $input_to_exclude_name) { |
|
1205 | - unset($this->_subsections[ $input_to_exclude_name ]); |
|
1206 | - } |
|
1207 | - } |
|
1208 | - |
|
1209 | - |
|
1210 | - /** |
|
1211 | - * Changes these inputs' display strategy to be EE_Hidden_Display_Strategy. |
|
1212 | - * @param array $inputs_to_hide |
|
1213 | - * @throws EE_Error |
|
1214 | - */ |
|
1215 | - public function hide(array $inputs_to_hide = array()) |
|
1216 | - { |
|
1217 | - foreach ($inputs_to_hide as $input_to_hide) { |
|
1218 | - $input = $this->get_input($input_to_hide); |
|
1219 | - $input->set_display_strategy(new EE_Hidden_Display_Strategy()); |
|
1220 | - } |
|
1221 | - } |
|
1222 | - |
|
1223 | - |
|
1224 | - /** |
|
1225 | - * add_subsections |
|
1226 | - * Adds the listed subsections to the form section. |
|
1227 | - * If $subsection_name_to_target is provided, |
|
1228 | - * then new subsections are added before or after that subsection, |
|
1229 | - * otherwise to the start or end of the entire subsections array. |
|
1230 | - * |
|
1231 | - * @param EE_Form_Section_Base[] $new_subsections array of new form subsections |
|
1232 | - * where keys are their names |
|
1233 | - * @param string $subsection_name_to_target an existing for section that $new_subsections |
|
1234 | - * should be added before or after |
|
1235 | - * IF $subsection_name_to_target is null, |
|
1236 | - * then $new_subsections will be added to |
|
1237 | - * the beginning or end of the entire subsections array |
|
1238 | - * @param boolean $add_before whether to add $new_subsections, before or after |
|
1239 | - * $subsection_name_to_target, |
|
1240 | - * or if $subsection_name_to_target is null, |
|
1241 | - * before or after entire subsections array |
|
1242 | - * @return void |
|
1243 | - * @throws EE_Error |
|
1244 | - */ |
|
1245 | - public function add_subsections($new_subsections, $subsection_name_to_target = null, $add_before = true) |
|
1246 | - { |
|
1247 | - foreach ($new_subsections as $subsection_name => $subsection) { |
|
1248 | - if (! $subsection instanceof EE_Form_Section_Base) { |
|
1249 | - EE_Error::add_error( |
|
1250 | - sprintf( |
|
1251 | - esc_html__( |
|
1252 | - "Trying to add a %s as a subsection (it was named '%s') to the form section '%s'. It was removed.", |
|
1253 | - 'event_espresso' |
|
1254 | - ), |
|
1255 | - get_class($subsection), |
|
1256 | - $subsection_name, |
|
1257 | - $this->name() |
|
1258 | - ) |
|
1259 | - ); |
|
1260 | - unset($new_subsections[ $subsection_name ]); |
|
1261 | - } |
|
1262 | - } |
|
1263 | - $this->_subsections = EEH_Array::insert_into_array( |
|
1264 | - $this->_subsections, |
|
1265 | - $new_subsections, |
|
1266 | - $subsection_name_to_target, |
|
1267 | - $add_before |
|
1268 | - ); |
|
1269 | - if ($this->_construction_finalized) { |
|
1270 | - foreach ($this->_subsections as $name => $subsection) { |
|
1271 | - $subsection->_construct_finalize($this, $name); |
|
1272 | - } |
|
1273 | - } |
|
1274 | - } |
|
1275 | - |
|
1276 | - |
|
1277 | - /** |
|
1278 | - * @param string $subsection_name |
|
1279 | - * @param bool $recursive |
|
1280 | - * @return bool |
|
1281 | - */ |
|
1282 | - public function has_subsection($subsection_name, $recursive = false) |
|
1283 | - { |
|
1284 | - foreach ($this->_subsections as $name => $subsection) { |
|
1285 | - if ($name === $subsection_name |
|
1286 | - || ( |
|
1287 | - $recursive |
|
1288 | - && $subsection instanceof EE_Form_Section_Proper |
|
1289 | - && $subsection->has_subsection($subsection_name, $recursive) |
|
1290 | - ) |
|
1291 | - ) { |
|
1292 | - return true; |
|
1293 | - } |
|
1294 | - } |
|
1295 | - return false; |
|
1296 | - } |
|
1297 | - |
|
1298 | - |
|
1299 | - |
|
1300 | - /** |
|
1301 | - * Just gets all validatable subsections to clean their sensitive data |
|
1302 | - * |
|
1303 | - * @throws EE_Error |
|
1304 | - */ |
|
1305 | - public function clean_sensitive_data() |
|
1306 | - { |
|
1307 | - foreach ($this->get_validatable_subsections() as $subsection) { |
|
1308 | - $subsection->clean_sensitive_data(); |
|
1309 | - } |
|
1310 | - } |
|
1311 | - |
|
1312 | - |
|
1313 | - /** |
|
1314 | - * Sets the submission error message (aka validation error message for this form section and all sub-sections) |
|
1315 | - * @param string $form_submission_error_message |
|
1316 | - * @param EE_Form_Section_Validatable $form_section unused |
|
1317 | - * @throws EE_Error |
|
1318 | - */ |
|
1319 | - public function set_submission_error_message( |
|
1320 | - $form_submission_error_message = '' |
|
1321 | - ) { |
|
1322 | - $this->_form_submission_error_message = ! empty($form_submission_error_message) |
|
1323 | - ? $form_submission_error_message |
|
1324 | - : $this->getAllValidationErrorsString(); |
|
1325 | - } |
|
1326 | - |
|
1327 | - |
|
1328 | - /** |
|
1329 | - * Returns the cached error message. A default value is set for this during _validate(), |
|
1330 | - * (called during receive_form_submission) but it can be explicitly set using |
|
1331 | - * set_submission_error_message |
|
1332 | - * |
|
1333 | - * @return string |
|
1334 | - */ |
|
1335 | - public function submission_error_message() |
|
1336 | - { |
|
1337 | - return $this->_form_submission_error_message; |
|
1338 | - } |
|
1339 | - |
|
1340 | - |
|
1341 | - /** |
|
1342 | - * Sets a message to display if the data submitted to the form was valid. |
|
1343 | - * @param string $form_submission_success_message |
|
1344 | - */ |
|
1345 | - public function set_submission_success_message($form_submission_success_message = '') |
|
1346 | - { |
|
1347 | - $this->_form_submission_success_message = ! empty($form_submission_success_message) |
|
1348 | - ? $form_submission_success_message |
|
1349 | - : esc_html__('Form submitted successfully', 'event_espresso'); |
|
1350 | - } |
|
1351 | - |
|
1352 | - |
|
1353 | - /** |
|
1354 | - * Gets a message appropriate for display when the form is correctly submitted |
|
1355 | - * @return string |
|
1356 | - */ |
|
1357 | - public function submission_success_message() |
|
1358 | - { |
|
1359 | - return $this->_form_submission_success_message; |
|
1360 | - } |
|
1361 | - |
|
1362 | - |
|
1363 | - /** |
|
1364 | - * Returns the prefix that should be used on child of this form section for |
|
1365 | - * their html names. If this form section itself has a parent, prepends ITS |
|
1366 | - * prefix onto this form section's prefix. Used primarily by |
|
1367 | - * EE_Form_Input_Base::_set_default_html_name_if_empty |
|
1368 | - * |
|
1369 | - * @return string |
|
1370 | - * @throws EE_Error |
|
1371 | - */ |
|
1372 | - public function html_name_prefix() |
|
1373 | - { |
|
1374 | - if ($this->parent_section() instanceof EE_Form_Section_Proper) { |
|
1375 | - return $this->parent_section()->html_name_prefix() . '[' . $this->name() . ']'; |
|
1376 | - } |
|
1377 | - return $this->name(); |
|
1378 | - } |
|
1379 | - |
|
1380 | - |
|
1381 | - /** |
|
1382 | - * Gets the name, but first checks _construct_finalize has been called. If not, |
|
1383 | - * calls it (assumes there is no parent and that we want the name to be whatever |
|
1384 | - * was set, which is probably nothing, or the classname) |
|
1385 | - * |
|
1386 | - * @return string |
|
1387 | - * @throws EE_Error |
|
1388 | - */ |
|
1389 | - public function name() |
|
1390 | - { |
|
1391 | - $this->ensure_construct_finalized_called(); |
|
1392 | - return parent::name(); |
|
1393 | - } |
|
1394 | - |
|
1395 | - |
|
1396 | - /** |
|
1397 | - * @return EE_Form_Section_Proper |
|
1398 | - * @throws EE_Error |
|
1399 | - */ |
|
1400 | - public function parent_section() |
|
1401 | - { |
|
1402 | - $this->ensure_construct_finalized_called(); |
|
1403 | - return parent::parent_section(); |
|
1404 | - } |
|
1405 | - |
|
1406 | - |
|
1407 | - /** |
|
1408 | - * make sure construction finalized was called, otherwise children might not be ready |
|
1409 | - * |
|
1410 | - * @return void |
|
1411 | - * @throws EE_Error |
|
1412 | - */ |
|
1413 | - public function ensure_construct_finalized_called() |
|
1414 | - { |
|
1415 | - if (! $this->_construction_finalized) { |
|
1416 | - $this->_construct_finalize($this->_parent_section, $this->_name); |
|
1417 | - } |
|
1418 | - } |
|
1419 | - |
|
1420 | - |
|
1421 | - /** |
|
1422 | - * Checks if any of this form section's inputs, or any of its children's inputs, |
|
1423 | - * are in teh form data. If any are found, returns true. Else false |
|
1424 | - * |
|
1425 | - * @param array $req_data |
|
1426 | - * @return boolean |
|
1427 | - * @throws EE_Error |
|
1428 | - */ |
|
1429 | - public function form_data_present_in($req_data = null) |
|
1430 | - { |
|
1431 | - $req_data = $this->getCachedRequest($req_data); |
|
1432 | - foreach ($this->subsections() as $subsection) { |
|
1433 | - if ($subsection instanceof EE_Form_Input_Base) { |
|
1434 | - if ($subsection->form_data_present_in($req_data)) { |
|
1435 | - return true; |
|
1436 | - } |
|
1437 | - } elseif ($subsection instanceof EE_Form_Section_Proper) { |
|
1438 | - if ($subsection->form_data_present_in($req_data)) { |
|
1439 | - return true; |
|
1440 | - } |
|
1441 | - } |
|
1442 | - } |
|
1443 | - return false; |
|
1444 | - } |
|
1445 | - |
|
1446 | - |
|
1447 | - /** |
|
1448 | - * Gets validation errors for this form section and subsections |
|
1449 | - * Similar to EE_Form_Section_Validatable::get_validation_errors() except this |
|
1450 | - * gets the validation errors for ALL subsection |
|
1451 | - * |
|
1452 | - * @return EE_Validation_Error[] |
|
1453 | - * @throws EE_Error |
|
1454 | - */ |
|
1455 | - public function get_validation_errors_accumulated() |
|
1456 | - { |
|
1457 | - $validation_errors = $this->get_validation_errors(); |
|
1458 | - foreach ($this->get_validatable_subsections() as $subsection) { |
|
1459 | - if ($subsection instanceof EE_Form_Section_Proper) { |
|
1460 | - $validation_errors_on_this_subsection = $subsection->get_validation_errors_accumulated(); |
|
1461 | - } else { |
|
1462 | - $validation_errors_on_this_subsection = $subsection->get_validation_errors(); |
|
1463 | - } |
|
1464 | - if ($validation_errors_on_this_subsection) { |
|
1465 | - $validation_errors = array_merge($validation_errors, $validation_errors_on_this_subsection); |
|
1466 | - } |
|
1467 | - } |
|
1468 | - return $validation_errors; |
|
1469 | - } |
|
1470 | - |
|
1471 | - /** |
|
1472 | - * Fetch validation errors from children and grandchildren and puts them in a single string. |
|
1473 | - * This traverses the form section tree to generate this, but you probably want to instead use |
|
1474 | - * get_form_submission_error_message() which is usually this message cached (or a custom validation error message) |
|
1475 | - * |
|
1476 | - * @return string |
|
1477 | - * @since 4.9.59.p |
|
1478 | - */ |
|
1479 | - protected function getAllValidationErrorsString() |
|
1480 | - { |
|
1481 | - $submission_error_messages = array(); |
|
1482 | - // bad, bad, bad registrant |
|
1483 | - foreach ($this->get_validation_errors_accumulated() as $validation_error) { |
|
1484 | - if ($validation_error instanceof EE_Validation_Error) { |
|
1485 | - $form_section = $validation_error->get_form_section(); |
|
1486 | - if ($form_section instanceof EE_Form_Input_Base) { |
|
1487 | - $label = $validation_error->get_form_section()->html_label_text(); |
|
1488 | - } elseif ($form_section instanceof EE_Form_Section_Validatable) { |
|
1489 | - $label = $validation_error->get_form_section()->name(); |
|
1490 | - } else { |
|
1491 | - $label = esc_html__('Unknown', 'event_espresso'); |
|
1492 | - } |
|
1493 | - $submission_error_messages[] = sprintf( |
|
1494 | - __('%s : %s', 'event_espresso'), |
|
1495 | - $label, |
|
1496 | - $validation_error->getMessage() |
|
1497 | - ); |
|
1498 | - } |
|
1499 | - } |
|
1500 | - return implode('<br', $submission_error_messages); |
|
1501 | - } |
|
1502 | - |
|
1503 | - |
|
1504 | - /** |
|
1505 | - * This isn't just the name of an input, it's a path pointing to an input. The |
|
1506 | - * path is similar to a folder path: slash (/) means to descend into a subsection, |
|
1507 | - * dot-dot-slash (../) means to ascend into the parent section. |
|
1508 | - * After a series of slashes and dot-dot-slashes, there should be the name of an input, |
|
1509 | - * which will be returned. |
|
1510 | - * Eg, if you want the related input to be conditional on a sibling input name 'foobar' |
|
1511 | - * just use 'foobar'. If you want it to be conditional on an aunt/uncle input name |
|
1512 | - * 'baz', use '../baz'. If you want it to be conditional on a cousin input, |
|
1513 | - * the child of 'baz_section' named 'baz_child', use '../baz_section/baz_child'. |
|
1514 | - * Etc |
|
1515 | - * |
|
1516 | - * @param string|false $form_section_path we accept false also because substr( '../', '../' ) = false |
|
1517 | - * @return EE_Form_Section_Base |
|
1518 | - * @throws EE_Error |
|
1519 | - */ |
|
1520 | - public function find_section_from_path($form_section_path) |
|
1521 | - { |
|
1522 | - // check if we can find the input from purely going straight up the tree |
|
1523 | - $input = parent::find_section_from_path($form_section_path); |
|
1524 | - if ($input instanceof EE_Form_Section_Base) { |
|
1525 | - return $input; |
|
1526 | - } |
|
1527 | - $next_slash_pos = strpos($form_section_path, '/'); |
|
1528 | - if ($next_slash_pos !== false) { |
|
1529 | - $child_section_name = substr($form_section_path, 0, $next_slash_pos); |
|
1530 | - $subpath = substr($form_section_path, $next_slash_pos + 1); |
|
1531 | - } else { |
|
1532 | - $child_section_name = $form_section_path; |
|
1533 | - $subpath = ''; |
|
1534 | - } |
|
1535 | - $child_section = $this->get_subsection($child_section_name); |
|
1536 | - if ($child_section instanceof EE_Form_Section_Base) { |
|
1537 | - return $child_section->find_section_from_path($subpath); |
|
1538 | - } |
|
1539 | - return null; |
|
1540 | - } |
|
17 | + const SUBMITTED_FORM_DATA_SSN_KEY = 'submitted_form_data'; |
|
18 | + |
|
19 | + /** |
|
20 | + * Subsections |
|
21 | + * |
|
22 | + * @var EE_Form_Section_Validatable[] |
|
23 | + */ |
|
24 | + protected $_subsections = array(); |
|
25 | + |
|
26 | + /** |
|
27 | + * Strategy for laying out the form |
|
28 | + * |
|
29 | + * @var EE_Form_Section_Layout_Base |
|
30 | + */ |
|
31 | + protected $_layout_strategy; |
|
32 | + |
|
33 | + /** |
|
34 | + * Whether or not this form has received and validated a form submission yet |
|
35 | + * |
|
36 | + * @var boolean |
|
37 | + */ |
|
38 | + protected $_received_submission = false; |
|
39 | + |
|
40 | + /** |
|
41 | + * message displayed to users upon successful form submission |
|
42 | + * |
|
43 | + * @var string |
|
44 | + */ |
|
45 | + protected $_form_submission_success_message = ''; |
|
46 | + |
|
47 | + /** |
|
48 | + * message displayed to users upon unsuccessful form submission |
|
49 | + * |
|
50 | + * @var string |
|
51 | + */ |
|
52 | + protected $_form_submission_error_message = ''; |
|
53 | + |
|
54 | + /** |
|
55 | + * @var array like $_REQUEST |
|
56 | + */ |
|
57 | + protected $cached_request_data; |
|
58 | + |
|
59 | + /** |
|
60 | + * Stores whether this form (and its sub-sections) were found to be valid or not. |
|
61 | + * Starts off as null, but once the form is validated, it set to either true or false |
|
62 | + * @var boolean|null |
|
63 | + */ |
|
64 | + protected $is_valid; |
|
65 | + |
|
66 | + /** |
|
67 | + * Stores all the data that will localized for form validation |
|
68 | + * |
|
69 | + * @var array |
|
70 | + */ |
|
71 | + protected static $_js_localization = array(); |
|
72 | + |
|
73 | + /** |
|
74 | + * whether or not the form's localized validation JS vars have been set |
|
75 | + * |
|
76 | + * @type boolean |
|
77 | + */ |
|
78 | + protected static $_scripts_localized = false; |
|
79 | + |
|
80 | + |
|
81 | + /** |
|
82 | + * when constructing a proper form section, calls _construct_finalize on children |
|
83 | + * so that they know who their parent is, and what name they've been given. |
|
84 | + * |
|
85 | + * @param array[] $options_array { |
|
86 | + * @type $subsections EE_Form_Section_Validatable[] where keys are the section's name |
|
87 | + * @type $include string[] numerically-indexed where values are section names to be included, |
|
88 | + * and in that order. This is handy if you want |
|
89 | + * the subsections to be ordered differently than the default, and if you override |
|
90 | + * which fields are shown |
|
91 | + * @type $exclude string[] values are subsections to be excluded. This is handy if you want |
|
92 | + * to remove certain default subsections (note: if you specify BOTH 'include' AND |
|
93 | + * 'exclude', the inclusions will be applied first, and the exclusions will exclude |
|
94 | + * items from that list of inclusions) |
|
95 | + * @type $layout_strategy EE_Form_Section_Layout_Base strategy for laying out the form |
|
96 | + * } @see EE_Form_Section_Validatable::__construct() |
|
97 | + * @throws EE_Error |
|
98 | + */ |
|
99 | + public function __construct($options_array = array()) |
|
100 | + { |
|
101 | + $options_array = (array) apply_filters( |
|
102 | + 'FHEE__EE_Form_Section_Proper___construct__options_array', |
|
103 | + $options_array, |
|
104 | + $this |
|
105 | + ); |
|
106 | + // call parent first, as it may be setting the name |
|
107 | + parent::__construct($options_array); |
|
108 | + // if they've included subsections in the constructor, add them now |
|
109 | + if (isset($options_array['include'])) { |
|
110 | + // we are going to make sure we ONLY have those subsections to include |
|
111 | + // AND we are going to make sure they're in that specified order |
|
112 | + $reordered_subsections = array(); |
|
113 | + foreach ($options_array['include'] as $input_name) { |
|
114 | + if (isset($this->_subsections[ $input_name ])) { |
|
115 | + $reordered_subsections[ $input_name ] = $this->_subsections[ $input_name ]; |
|
116 | + } |
|
117 | + } |
|
118 | + $this->_subsections = $reordered_subsections; |
|
119 | + } |
|
120 | + if (isset($options_array['exclude'])) { |
|
121 | + $exclude = $options_array['exclude']; |
|
122 | + $this->_subsections = array_diff_key($this->_subsections, array_flip($exclude)); |
|
123 | + } |
|
124 | + if (isset($options_array['layout_strategy'])) { |
|
125 | + $this->_layout_strategy = $options_array['layout_strategy']; |
|
126 | + } |
|
127 | + if (! $this->_layout_strategy) { |
|
128 | + $this->_layout_strategy = is_admin() ? new EE_Admin_Two_Column_Layout() : new EE_Two_Column_Layout(); |
|
129 | + } |
|
130 | + $this->_layout_strategy->_construct_finalize($this); |
|
131 | + // ok so we are definitely going to want the forms JS, |
|
132 | + // so enqueue it or remember to enqueue it during wp_enqueue_scripts |
|
133 | + if (did_action('wp_enqueue_scripts') || did_action('admin_enqueue_scripts')) { |
|
134 | + // ok so they've constructed this object after when they should have. |
|
135 | + // just enqueue the generic form scripts and initialize the form immediately in the JS |
|
136 | + EE_Form_Section_Proper::wp_enqueue_scripts(true); |
|
137 | + } else { |
|
138 | + add_action('wp_enqueue_scripts', array('EE_Form_Section_Proper', 'wp_enqueue_scripts')); |
|
139 | + add_action('admin_enqueue_scripts', array('EE_Form_Section_Proper', 'wp_enqueue_scripts')); |
|
140 | + } |
|
141 | + add_action('wp_footer', array($this, 'ensure_scripts_localized'), 1); |
|
142 | + /** |
|
143 | + * Gives other plugins a chance to hook in before construct finalize is called. |
|
144 | + * The form probably doesn't yet have a parent form section. |
|
145 | + * Since 4.9.32, when this action was introduced, this is the best place to add a subsection onto a form, |
|
146 | + * assuming you don't care what the form section's name, HTML ID, or HTML name etc are. |
|
147 | + * Also see AHEE__EE_Form_Section_Proper___construct_finalize__end |
|
148 | + * |
|
149 | + * @since 4.9.32 |
|
150 | + * @param EE_Form_Section_Proper $this before __construct is done, but all of its logic, |
|
151 | + * except maybe calling _construct_finalize has been done |
|
152 | + * @param array $options_array options passed into the constructor |
|
153 | + */ |
|
154 | + do_action( |
|
155 | + 'AHEE__EE_Form_Input_Base___construct__before_construct_finalize_called', |
|
156 | + $this, |
|
157 | + $options_array |
|
158 | + ); |
|
159 | + if (isset($options_array['name'])) { |
|
160 | + $this->_construct_finalize(null, $options_array['name']); |
|
161 | + } |
|
162 | + } |
|
163 | + |
|
164 | + |
|
165 | + /** |
|
166 | + * Finishes construction given the parent form section and this form section's name |
|
167 | + * |
|
168 | + * @param EE_Form_Section_Proper $parent_form_section |
|
169 | + * @param string $name |
|
170 | + * @throws EE_Error |
|
171 | + */ |
|
172 | + public function _construct_finalize($parent_form_section, $name) |
|
173 | + { |
|
174 | + parent::_construct_finalize($parent_form_section, $name); |
|
175 | + $this->_set_default_name_if_empty(); |
|
176 | + $this->_set_default_html_id_if_empty(); |
|
177 | + foreach ($this->_subsections as $subsection_name => $subsection) { |
|
178 | + if ($subsection instanceof EE_Form_Section_Base) { |
|
179 | + $subsection->_construct_finalize($this, $subsection_name); |
|
180 | + } else { |
|
181 | + throw new EE_Error( |
|
182 | + sprintf( |
|
183 | + esc_html__( |
|
184 | + 'Subsection "%s" is not an instanceof EE_Form_Section_Base on form "%s". It is a "%s"', |
|
185 | + 'event_espresso' |
|
186 | + ), |
|
187 | + $subsection_name, |
|
188 | + get_class($this), |
|
189 | + $subsection ? get_class($subsection) : esc_html__('NULL', 'event_espresso') |
|
190 | + ) |
|
191 | + ); |
|
192 | + } |
|
193 | + } |
|
194 | + /** |
|
195 | + * Action performed just after form has been given a name (and HTML ID etc) and is fully constructed. |
|
196 | + * If you have code that should modify the form and needs it and its subsections to have a name, HTML ID |
|
197 | + * (or other attributes derived from the name like the HTML label id, etc), this is where it should be done. |
|
198 | + * This might only happen just before displaying the form, or just before it receives form submission data. |
|
199 | + * If you need to modify the form or its subsections before _construct_finalize is called on it (and we've |
|
200 | + * ensured it has a name, HTML IDs, etc |
|
201 | + * |
|
202 | + * @param EE_Form_Section_Proper $this |
|
203 | + * @param EE_Form_Section_Proper|null $parent_form_section |
|
204 | + * @param string $name |
|
205 | + */ |
|
206 | + do_action( |
|
207 | + 'AHEE__EE_Form_Section_Proper___construct_finalize__end', |
|
208 | + $this, |
|
209 | + $parent_form_section, |
|
210 | + $name |
|
211 | + ); |
|
212 | + } |
|
213 | + |
|
214 | + |
|
215 | + /** |
|
216 | + * Gets the layout strategy for this form section |
|
217 | + * |
|
218 | + * @return EE_Form_Section_Layout_Base |
|
219 | + */ |
|
220 | + public function get_layout_strategy() |
|
221 | + { |
|
222 | + return $this->_layout_strategy; |
|
223 | + } |
|
224 | + |
|
225 | + |
|
226 | + /** |
|
227 | + * Gets the HTML for a single input for this form section according |
|
228 | + * to the layout strategy |
|
229 | + * |
|
230 | + * @param EE_Form_Input_Base $input |
|
231 | + * @return string |
|
232 | + */ |
|
233 | + public function get_html_for_input($input) |
|
234 | + { |
|
235 | + return $this->_layout_strategy->layout_input($input); |
|
236 | + } |
|
237 | + |
|
238 | + |
|
239 | + /** |
|
240 | + * was_submitted - checks if form inputs are present in request data |
|
241 | + * Basically an alias for form_data_present_in() (which is used by both |
|
242 | + * proper form sections and form inputs) |
|
243 | + * |
|
244 | + * @param null $form_data |
|
245 | + * @return boolean |
|
246 | + * @throws EE_Error |
|
247 | + */ |
|
248 | + public function was_submitted($form_data = null) |
|
249 | + { |
|
250 | + return $this->form_data_present_in($form_data); |
|
251 | + } |
|
252 | + |
|
253 | + /** |
|
254 | + * Gets the cached request data; but if there is none, or $req_data was set with |
|
255 | + * something different, refresh the cache, and then return it |
|
256 | + * @param null $req_data |
|
257 | + * @return array |
|
258 | + */ |
|
259 | + protected function getCachedRequest($req_data = null) |
|
260 | + { |
|
261 | + if ($this->cached_request_data === null |
|
262 | + || ( |
|
263 | + $req_data !== null && |
|
264 | + $req_data !== $this->cached_request_data |
|
265 | + ) |
|
266 | + ) { |
|
267 | + $req_data = apply_filters( |
|
268 | + 'FHEE__EE_Form_Section_Proper__receive_form_submission__req_data', |
|
269 | + $req_data, |
|
270 | + $this |
|
271 | + ); |
|
272 | + if ($req_data === null) { |
|
273 | + $req_data = array_merge($_GET, $_POST); |
|
274 | + } |
|
275 | + $req_data = apply_filters( |
|
276 | + 'FHEE__EE_Form_Section_Proper__receive_form_submission__request_data', |
|
277 | + $req_data, |
|
278 | + $this |
|
279 | + ); |
|
280 | + $this->cached_request_data = (array) $req_data; |
|
281 | + } |
|
282 | + return $this->cached_request_data; |
|
283 | + } |
|
284 | + |
|
285 | + |
|
286 | + /** |
|
287 | + * After the form section is initially created, call this to sanitize the data in the submission |
|
288 | + * which relates to this form section, validate it, and set it as properties on the form. |
|
289 | + * |
|
290 | + * @param array|null $req_data should usually be $_POST (the default). |
|
291 | + * However, you CAN supply a different array. |
|
292 | + * Consider using set_defaults() instead however. |
|
293 | + * (If you rendered the form in the page using echo $form_x->get_html() |
|
294 | + * the inputs will have the correct name in the request data for this function |
|
295 | + * to find them and populate the form with them. |
|
296 | + * If you have a flat form (with only input subsections), |
|
297 | + * you can supply a flat array where keys |
|
298 | + * are the form input names and values are their values) |
|
299 | + * @param boolean $validate whether or not to perform validation on this data. Default is, |
|
300 | + * of course, to validate that data, and set errors on the invalid values. |
|
301 | + * But if the data has already been validated |
|
302 | + * (eg you validated the data then stored it in the DB) |
|
303 | + * you may want to skip this step. |
|
304 | + * @throws InvalidArgumentException |
|
305 | + * @throws InvalidInterfaceException |
|
306 | + * @throws InvalidDataTypeException |
|
307 | + * @throws EE_Error |
|
308 | + */ |
|
309 | + public function receive_form_submission($req_data = null, $validate = true) |
|
310 | + { |
|
311 | + $req_data = $this->getCachedRequest($req_data); |
|
312 | + $this->_normalize($req_data); |
|
313 | + if ($validate) { |
|
314 | + $this->_validate(); |
|
315 | + // if it's invalid, we're going to want to re-display so remember what they submitted |
|
316 | + if (! $this->is_valid()) { |
|
317 | + $this->store_submitted_form_data_in_session(); |
|
318 | + } |
|
319 | + } |
|
320 | + if ($this->submission_error_message() === '' && ! $this->is_valid()) { |
|
321 | + $this->set_submission_error_message(); |
|
322 | + } |
|
323 | + do_action( |
|
324 | + 'AHEE__EE_Form_Section_Proper__receive_form_submission__end', |
|
325 | + $req_data, |
|
326 | + $this, |
|
327 | + $validate |
|
328 | + ); |
|
329 | + } |
|
330 | + |
|
331 | + |
|
332 | + /** |
|
333 | + * caches the originally submitted input values in the session |
|
334 | + * so that they can be used to repopulate the form if it failed validation |
|
335 | + * |
|
336 | + * @return boolean whether or not the data was successfully stored in the session |
|
337 | + * @throws InvalidArgumentException |
|
338 | + * @throws InvalidInterfaceException |
|
339 | + * @throws InvalidDataTypeException |
|
340 | + * @throws EE_Error |
|
341 | + */ |
|
342 | + protected function store_submitted_form_data_in_session() |
|
343 | + { |
|
344 | + return EE_Registry::instance()->SSN->set_session_data( |
|
345 | + array( |
|
346 | + EE_Form_Section_Proper::SUBMITTED_FORM_DATA_SSN_KEY => $this->submitted_values(true), |
|
347 | + ) |
|
348 | + ); |
|
349 | + } |
|
350 | + |
|
351 | + |
|
352 | + /** |
|
353 | + * retrieves the originally submitted input values in the session |
|
354 | + * so that they can be used to repopulate the form if it failed validation |
|
355 | + * |
|
356 | + * @return array |
|
357 | + * @throws InvalidArgumentException |
|
358 | + * @throws InvalidInterfaceException |
|
359 | + * @throws InvalidDataTypeException |
|
360 | + */ |
|
361 | + protected function get_submitted_form_data_from_session() |
|
362 | + { |
|
363 | + $session = EE_Registry::instance()->SSN; |
|
364 | + if ($session instanceof EE_Session) { |
|
365 | + return $session->get_session_data( |
|
366 | + EE_Form_Section_Proper::SUBMITTED_FORM_DATA_SSN_KEY |
|
367 | + ); |
|
368 | + } |
|
369 | + return array(); |
|
370 | + } |
|
371 | + |
|
372 | + |
|
373 | + /** |
|
374 | + * flushed the originally submitted input values from the session |
|
375 | + * |
|
376 | + * @return boolean whether or not the data was successfully removed from the session |
|
377 | + * @throws InvalidArgumentException |
|
378 | + * @throws InvalidInterfaceException |
|
379 | + * @throws InvalidDataTypeException |
|
380 | + */ |
|
381 | + public static function flush_submitted_form_data_from_session() |
|
382 | + { |
|
383 | + return EE_Registry::instance()->SSN->reset_data( |
|
384 | + array(EE_Form_Section_Proper::SUBMITTED_FORM_DATA_SSN_KEY) |
|
385 | + ); |
|
386 | + } |
|
387 | + |
|
388 | + |
|
389 | + /** |
|
390 | + * Populates this form and its subsections with data from the session. |
|
391 | + * (Wrapper for EE_Form_Section_Proper::receive_form_submission, so it shows |
|
392 | + * validation errors when displaying too) |
|
393 | + * Returns true if the form was populated from the session, false otherwise |
|
394 | + * |
|
395 | + * @return boolean |
|
396 | + * @throws InvalidArgumentException |
|
397 | + * @throws InvalidInterfaceException |
|
398 | + * @throws InvalidDataTypeException |
|
399 | + * @throws EE_Error |
|
400 | + */ |
|
401 | + public function populate_from_session() |
|
402 | + { |
|
403 | + $form_data_in_session = $this->get_submitted_form_data_from_session(); |
|
404 | + if (empty($form_data_in_session)) { |
|
405 | + return false; |
|
406 | + } |
|
407 | + $this->receive_form_submission($form_data_in_session); |
|
408 | + add_action('shutdown', array('EE_Form_Section_Proper', 'flush_submitted_form_data_from_session')); |
|
409 | + if ($this->form_data_present_in($form_data_in_session)) { |
|
410 | + return true; |
|
411 | + } |
|
412 | + return false; |
|
413 | + } |
|
414 | + |
|
415 | + |
|
416 | + /** |
|
417 | + * Populates the default data for the form, given an array where keys are |
|
418 | + * the input names, and values are their values (preferably normalized to be their |
|
419 | + * proper PHP types, not all strings... although that should be ok too). |
|
420 | + * Proper subsections are sub-arrays, the key being the subsection's name, and |
|
421 | + * the value being an array formatted in teh same way |
|
422 | + * |
|
423 | + * @param array $default_data |
|
424 | + * @throws EE_Error |
|
425 | + */ |
|
426 | + public function populate_defaults($default_data) |
|
427 | + { |
|
428 | + foreach ($this->subsections(false) as $subsection_name => $subsection) { |
|
429 | + if (isset($default_data[ $subsection_name ])) { |
|
430 | + if ($subsection instanceof EE_Form_Input_Base) { |
|
431 | + $subsection->set_default($default_data[ $subsection_name ]); |
|
432 | + } elseif ($subsection instanceof EE_Form_Section_Proper) { |
|
433 | + $subsection->populate_defaults($default_data[ $subsection_name ]); |
|
434 | + } |
|
435 | + } |
|
436 | + } |
|
437 | + } |
|
438 | + |
|
439 | + |
|
440 | + /** |
|
441 | + * returns true if subsection exists |
|
442 | + * |
|
443 | + * @param string $name |
|
444 | + * @return boolean |
|
445 | + */ |
|
446 | + public function subsection_exists($name) |
|
447 | + { |
|
448 | + return isset($this->_subsections[ $name ]) ? true : false; |
|
449 | + } |
|
450 | + |
|
451 | + |
|
452 | + /** |
|
453 | + * Gets the subsection specified by its name |
|
454 | + * |
|
455 | + * @param string $name |
|
456 | + * @param boolean $require_construction_to_be_finalized most client code should leave this as TRUE |
|
457 | + * so that the inputs will be properly configured. |
|
458 | + * However, some client code may be ok |
|
459 | + * with construction finalize being called later |
|
460 | + * (realizing that the subsections' html names |
|
461 | + * might not be set yet, etc.) |
|
462 | + * @return EE_Form_Section_Base |
|
463 | + * @throws EE_Error |
|
464 | + */ |
|
465 | + public function get_subsection($name, $require_construction_to_be_finalized = true) |
|
466 | + { |
|
467 | + if ($require_construction_to_be_finalized) { |
|
468 | + $this->ensure_construct_finalized_called(); |
|
469 | + } |
|
470 | + return $this->subsection_exists($name) ? $this->_subsections[ $name ] : null; |
|
471 | + } |
|
472 | + |
|
473 | + |
|
474 | + /** |
|
475 | + * Gets all the validatable subsections of this form section |
|
476 | + * |
|
477 | + * @return EE_Form_Section_Validatable[] |
|
478 | + * @throws EE_Error |
|
479 | + */ |
|
480 | + public function get_validatable_subsections() |
|
481 | + { |
|
482 | + $validatable_subsections = array(); |
|
483 | + foreach ($this->subsections() as $name => $obj) { |
|
484 | + if ($obj instanceof EE_Form_Section_Validatable) { |
|
485 | + $validatable_subsections[ $name ] = $obj; |
|
486 | + } |
|
487 | + } |
|
488 | + return $validatable_subsections; |
|
489 | + } |
|
490 | + |
|
491 | + |
|
492 | + /** |
|
493 | + * Gets an input by the given name. If not found, or if its not an EE_FOrm_Input_Base child, |
|
494 | + * throw an EE_Error. |
|
495 | + * |
|
496 | + * @param string $name |
|
497 | + * @param boolean $require_construction_to_be_finalized most client code should |
|
498 | + * leave this as TRUE so that the inputs will be properly |
|
499 | + * configured. However, some client code may be ok with |
|
500 | + * construction finalize being called later |
|
501 | + * (realizing that the subsections' html names might not be |
|
502 | + * set yet, etc.) |
|
503 | + * @return EE_Form_Input_Base |
|
504 | + * @throws EE_Error |
|
505 | + */ |
|
506 | + public function get_input($name, $require_construction_to_be_finalized = true) |
|
507 | + { |
|
508 | + $subsection = $this->get_subsection( |
|
509 | + $name, |
|
510 | + $require_construction_to_be_finalized |
|
511 | + ); |
|
512 | + if (! $subsection instanceof EE_Form_Input_Base) { |
|
513 | + throw new EE_Error( |
|
514 | + sprintf( |
|
515 | + esc_html__( |
|
516 | + "Subsection '%s' is not an instanceof EE_Form_Input_Base on form '%s'. It is a '%s'", |
|
517 | + 'event_espresso' |
|
518 | + ), |
|
519 | + $name, |
|
520 | + get_class($this), |
|
521 | + $subsection ? get_class($subsection) : esc_html__('NULL', 'event_espresso') |
|
522 | + ) |
|
523 | + ); |
|
524 | + } |
|
525 | + return $subsection; |
|
526 | + } |
|
527 | + |
|
528 | + |
|
529 | + /** |
|
530 | + * Like get_input(), gets the proper subsection of the form given the name, |
|
531 | + * otherwise throws an EE_Error |
|
532 | + * |
|
533 | + * @param string $name |
|
534 | + * @param boolean $require_construction_to_be_finalized most client code should |
|
535 | + * leave this as TRUE so that the inputs will be properly |
|
536 | + * configured. However, some client code may be ok with |
|
537 | + * construction finalize being called later |
|
538 | + * (realizing that the subsections' html names might not be |
|
539 | + * set yet, etc.) |
|
540 | + * @return EE_Form_Section_Proper |
|
541 | + * @throws EE_Error |
|
542 | + */ |
|
543 | + public function get_proper_subsection($name, $require_construction_to_be_finalized = true) |
|
544 | + { |
|
545 | + $subsection = $this->get_subsection( |
|
546 | + $name, |
|
547 | + $require_construction_to_be_finalized |
|
548 | + ); |
|
549 | + if (! $subsection instanceof EE_Form_Section_Proper) { |
|
550 | + throw new EE_Error( |
|
551 | + sprintf( |
|
552 | + esc_html__( |
|
553 | + "Subsection '%'s is not an instanceof EE_Form_Section_Proper on form '%s'", |
|
554 | + 'event_espresso' |
|
555 | + ), |
|
556 | + $name, |
|
557 | + get_class($this) |
|
558 | + ) |
|
559 | + ); |
|
560 | + } |
|
561 | + return $subsection; |
|
562 | + } |
|
563 | + |
|
564 | + |
|
565 | + /** |
|
566 | + * Gets the value of the specified input. Should be called after receive_form_submission() |
|
567 | + * or populate_defaults() on the form, where the normalized value on the input is set. |
|
568 | + * |
|
569 | + * @param string $name |
|
570 | + * @return mixed depending on the input's type and its normalization strategy |
|
571 | + * @throws EE_Error |
|
572 | + */ |
|
573 | + public function get_input_value($name) |
|
574 | + { |
|
575 | + $input = $this->get_input($name); |
|
576 | + return $input->normalized_value(); |
|
577 | + } |
|
578 | + |
|
579 | + |
|
580 | + /** |
|
581 | + * Checks if this form section itself is valid, and then checks its subsections |
|
582 | + * |
|
583 | + * @throws EE_Error |
|
584 | + * @return boolean |
|
585 | + */ |
|
586 | + public function is_valid() |
|
587 | + { |
|
588 | + if ($this->is_valid === null) { |
|
589 | + if (! $this->has_received_submission()) { |
|
590 | + throw new EE_Error( |
|
591 | + sprintf( |
|
592 | + esc_html__( |
|
593 | + 'You cannot check if a form is valid before receiving the form submission using receive_form_submission', |
|
594 | + 'event_espresso' |
|
595 | + ) |
|
596 | + ) |
|
597 | + ); |
|
598 | + } |
|
599 | + if (! parent::is_valid()) { |
|
600 | + $this->is_valid = false; |
|
601 | + } else { |
|
602 | + // ok so no general errors to this entire form section. |
|
603 | + // so let's check the subsections, but only set errors if that hasn't been done yet |
|
604 | + $this->is_valid = true; |
|
605 | + foreach ($this->get_validatable_subsections() as $subsection) { |
|
606 | + if (! $subsection->is_valid()) { |
|
607 | + $this->is_valid = false; |
|
608 | + } |
|
609 | + } |
|
610 | + } |
|
611 | + } |
|
612 | + return $this->is_valid; |
|
613 | + } |
|
614 | + |
|
615 | + |
|
616 | + /** |
|
617 | + * gets the default name of this form section if none is specified |
|
618 | + * |
|
619 | + * @return void |
|
620 | + */ |
|
621 | + protected function _set_default_name_if_empty() |
|
622 | + { |
|
623 | + if (! $this->_name) { |
|
624 | + $classname = get_class($this); |
|
625 | + $default_name = str_replace('EE_', '', $classname); |
|
626 | + $this->_name = $default_name; |
|
627 | + } |
|
628 | + } |
|
629 | + |
|
630 | + |
|
631 | + /** |
|
632 | + * Returns the HTML for the form, except for the form opening and closing tags |
|
633 | + * (as the form section doesn't know where you necessarily want to send the information to), |
|
634 | + * and except for a submit button. Enqueues JS and CSS; if called early enough we will |
|
635 | + * try to enqueue them in the header, otherwise they'll be enqueued in the footer. |
|
636 | + * Not doing_it_wrong because theoretically this CAN be used properly, |
|
637 | + * provided its used during "wp_enqueue_scripts", or it doesn't need to enqueue |
|
638 | + * any CSS. |
|
639 | + * |
|
640 | + * @throws InvalidArgumentException |
|
641 | + * @throws InvalidInterfaceException |
|
642 | + * @throws InvalidDataTypeException |
|
643 | + * @throws EE_Error |
|
644 | + */ |
|
645 | + public function get_html_and_js() |
|
646 | + { |
|
647 | + $this->enqueue_js(); |
|
648 | + return $this->get_html(); |
|
649 | + } |
|
650 | + |
|
651 | + |
|
652 | + /** |
|
653 | + * returns HTML for displaying this form section. recursively calls display_section() on all subsections |
|
654 | + * |
|
655 | + * @param bool $display_previously_submitted_data |
|
656 | + * @return string |
|
657 | + * @throws InvalidArgumentException |
|
658 | + * @throws InvalidInterfaceException |
|
659 | + * @throws InvalidDataTypeException |
|
660 | + * @throws EE_Error |
|
661 | + * @throws EE_Error |
|
662 | + * @throws EE_Error |
|
663 | + */ |
|
664 | + public function get_html($display_previously_submitted_data = true) |
|
665 | + { |
|
666 | + $this->ensure_construct_finalized_called(); |
|
667 | + if ($display_previously_submitted_data) { |
|
668 | + $this->populate_from_session(); |
|
669 | + } |
|
670 | + return $this->_form_html_filter |
|
671 | + ? $this->_form_html_filter->filterHtml($this->_layout_strategy->layout_form(), $this) |
|
672 | + : $this->_layout_strategy->layout_form(); |
|
673 | + } |
|
674 | + |
|
675 | + |
|
676 | + /** |
|
677 | + * enqueues JS and CSS for the form. |
|
678 | + * It is preferred to call this before wp_enqueue_scripts so the |
|
679 | + * scripts and styles can be put in the header, but if called later |
|
680 | + * they will be put in the footer (which is OK for JS, but in HTML4 CSS should |
|
681 | + * only be in the header; but in HTML5 its ok in the body. |
|
682 | + * See http://stackoverflow.com/questions/4957446/load-external-css-file-in-body-tag. |
|
683 | + * So if your form enqueues CSS, it's preferred to call this before wp_enqueue_scripts.) |
|
684 | + * |
|
685 | + * @return void |
|
686 | + * @throws EE_Error |
|
687 | + */ |
|
688 | + public function enqueue_js() |
|
689 | + { |
|
690 | + $this->_enqueue_and_localize_form_js(); |
|
691 | + foreach ($this->subsections() as $subsection) { |
|
692 | + $subsection->enqueue_js(); |
|
693 | + } |
|
694 | + } |
|
695 | + |
|
696 | + |
|
697 | + /** |
|
698 | + * adds a filter so that jquery validate gets enqueued in EE_System::wp_enqueue_scripts(). |
|
699 | + * This must be done BEFORE wp_enqueue_scripts() gets called, which is on |
|
700 | + * the wp_enqueue_scripts hook. |
|
701 | + * However, registering the form js and localizing it can happen when we |
|
702 | + * actually output the form (which is preferred, seeing how teh form's fields |
|
703 | + * could change until it's actually outputted) |
|
704 | + * |
|
705 | + * @param boolean $init_form_validation_automatically whether or not we want the form validation |
|
706 | + * to be triggered automatically or not |
|
707 | + * @return void |
|
708 | + */ |
|
709 | + public static function wp_enqueue_scripts($init_form_validation_automatically = true) |
|
710 | + { |
|
711 | + wp_register_script( |
|
712 | + 'ee_form_section_validation', |
|
713 | + EE_GLOBAL_ASSETS_URL . 'scripts' . '/form_section_validation.js', |
|
714 | + array('jquery-validate', 'jquery-ui-datepicker', 'jquery-validate-extra-methods'), |
|
715 | + EVENT_ESPRESSO_VERSION, |
|
716 | + true |
|
717 | + ); |
|
718 | + wp_localize_script( |
|
719 | + 'ee_form_section_validation', |
|
720 | + 'ee_form_section_validation_init', |
|
721 | + array('init' => $init_form_validation_automatically ? '1' : '0') |
|
722 | + ); |
|
723 | + } |
|
724 | + |
|
725 | + |
|
726 | + /** |
|
727 | + * gets the variables used by form_section_validation.js. |
|
728 | + * This needs to be called AFTER we've called $this->_enqueue_jquery_validate_script, |
|
729 | + * but before the wordpress hook wp_loaded |
|
730 | + * |
|
731 | + * @throws EE_Error |
|
732 | + */ |
|
733 | + public function _enqueue_and_localize_form_js() |
|
734 | + { |
|
735 | + $this->ensure_construct_finalized_called(); |
|
736 | + // actually, we don't want to localize just yet. There may be other forms on the page. |
|
737 | + // so we need to add our form section data to a static variable accessible by all form sections |
|
738 | + // and localize it just before the footer |
|
739 | + $this->localize_validation_rules(); |
|
740 | + add_action('wp_footer', array('EE_Form_Section_Proper', 'localize_script_for_all_forms'), 2); |
|
741 | + add_action('admin_footer', array('EE_Form_Section_Proper', 'localize_script_for_all_forms')); |
|
742 | + } |
|
743 | + |
|
744 | + |
|
745 | + /** |
|
746 | + * add our form section data to a static variable accessible by all form sections |
|
747 | + * |
|
748 | + * @param bool $return_for_subsection |
|
749 | + * @return void |
|
750 | + * @throws EE_Error |
|
751 | + */ |
|
752 | + public function localize_validation_rules($return_for_subsection = false) |
|
753 | + { |
|
754 | + // we only want to localize vars ONCE for the entire form, |
|
755 | + // so if the form section doesn't have a parent, then it must be the top dog |
|
756 | + if ($return_for_subsection || ! $this->parent_section()) { |
|
757 | + EE_Form_Section_Proper::$_js_localization['form_data'][ $this->html_id() ] = array( |
|
758 | + 'form_section_id' => $this->html_id(true), |
|
759 | + 'validation_rules' => $this->get_jquery_validation_rules(), |
|
760 | + 'other_data' => $this->get_other_js_data(), |
|
761 | + 'errors' => $this->subsection_validation_errors_by_html_name(), |
|
762 | + ); |
|
763 | + EE_Form_Section_Proper::$_scripts_localized = true; |
|
764 | + } |
|
765 | + } |
|
766 | + |
|
767 | + |
|
768 | + /** |
|
769 | + * Gets an array of extra data that will be useful for client-side javascript. |
|
770 | + * This is primarily data added by inputs and forms in addition to any |
|
771 | + * scripts they might enqueue |
|
772 | + * |
|
773 | + * @param array $form_other_js_data |
|
774 | + * @return array |
|
775 | + * @throws EE_Error |
|
776 | + */ |
|
777 | + public function get_other_js_data($form_other_js_data = array()) |
|
778 | + { |
|
779 | + foreach ($this->subsections() as $subsection) { |
|
780 | + $form_other_js_data = $subsection->get_other_js_data($form_other_js_data); |
|
781 | + } |
|
782 | + return $form_other_js_data; |
|
783 | + } |
|
784 | + |
|
785 | + |
|
786 | + /** |
|
787 | + * Gets a flat array of inputs for this form section and its subsections. |
|
788 | + * Keys are their form names, and values are the inputs themselves |
|
789 | + * |
|
790 | + * @return EE_Form_Input_Base |
|
791 | + * @throws EE_Error |
|
792 | + */ |
|
793 | + public function inputs_in_subsections() |
|
794 | + { |
|
795 | + $inputs = array(); |
|
796 | + foreach ($this->subsections() as $subsection) { |
|
797 | + if ($subsection instanceof EE_Form_Input_Base) { |
|
798 | + $inputs[ $subsection->html_name() ] = $subsection; |
|
799 | + } elseif ($subsection instanceof EE_Form_Section_Proper) { |
|
800 | + $inputs += $subsection->inputs_in_subsections(); |
|
801 | + } |
|
802 | + } |
|
803 | + return $inputs; |
|
804 | + } |
|
805 | + |
|
806 | + |
|
807 | + /** |
|
808 | + * Gets a flat array of all the validation errors. |
|
809 | + * Keys are html names (because those should be unique) |
|
810 | + * and values are a string of all their validation errors |
|
811 | + * |
|
812 | + * @return string[] |
|
813 | + * @throws EE_Error |
|
814 | + */ |
|
815 | + public function subsection_validation_errors_by_html_name() |
|
816 | + { |
|
817 | + $inputs = $this->inputs(); |
|
818 | + $errors = array(); |
|
819 | + foreach ($inputs as $form_input) { |
|
820 | + if ($form_input instanceof EE_Form_Input_Base && $form_input->get_validation_errors()) { |
|
821 | + $errors[ $form_input->html_name() ] = $form_input->get_validation_error_string(); |
|
822 | + } |
|
823 | + } |
|
824 | + return $errors; |
|
825 | + } |
|
826 | + |
|
827 | + |
|
828 | + /** |
|
829 | + * passes all the form data required by the JS to the JS, and enqueues the few required JS files. |
|
830 | + * Should be setup by each form during the _enqueues_and_localize_form_js |
|
831 | + * |
|
832 | + * @throws InvalidArgumentException |
|
833 | + * @throws InvalidInterfaceException |
|
834 | + * @throws InvalidDataTypeException |
|
835 | + */ |
|
836 | + public static function localize_script_for_all_forms() |
|
837 | + { |
|
838 | + // allow inputs and stuff to hook in their JS and stuff here |
|
839 | + do_action('AHEE__EE_Form_Section_Proper__localize_script_for_all_forms__begin'); |
|
840 | + EE_Form_Section_Proper::$_js_localization['localized_error_messages'] = EE_Form_Section_Proper::_get_localized_error_messages(); |
|
841 | + $email_validation_level = isset(EE_Registry::instance()->CFG->registration->email_validation_level) |
|
842 | + ? EE_Registry::instance()->CFG->registration->email_validation_level |
|
843 | + : 'wp_default'; |
|
844 | + EE_Form_Section_Proper::$_js_localization['email_validation_level'] = $email_validation_level; |
|
845 | + wp_enqueue_script('ee_form_section_validation'); |
|
846 | + wp_localize_script( |
|
847 | + 'ee_form_section_validation', |
|
848 | + 'ee_form_section_vars', |
|
849 | + EE_Form_Section_Proper::$_js_localization |
|
850 | + ); |
|
851 | + } |
|
852 | + |
|
853 | + |
|
854 | + /** |
|
855 | + * ensure_scripts_localized |
|
856 | + * |
|
857 | + * @throws EE_Error |
|
858 | + */ |
|
859 | + public function ensure_scripts_localized() |
|
860 | + { |
|
861 | + if (! EE_Form_Section_Proper::$_scripts_localized) { |
|
862 | + $this->_enqueue_and_localize_form_js(); |
|
863 | + } |
|
864 | + } |
|
865 | + |
|
866 | + |
|
867 | + /** |
|
868 | + * Gets the hard-coded validation error messages to be used in the JS. The convention |
|
869 | + * is that the key here should be the same as the custom validation rule put in the JS file |
|
870 | + * |
|
871 | + * @return array keys are custom validation rules, and values are internationalized strings |
|
872 | + */ |
|
873 | + private static function _get_localized_error_messages() |
|
874 | + { |
|
875 | + return array( |
|
876 | + 'validUrl' => esc_html__('This is not a valid absolute URL. Eg, http://domain.com/monkey.jpg', 'event_espresso'), |
|
877 | + 'regex' => esc_html__('Please check your input', 'event_espresso'), |
|
878 | + ); |
|
879 | + } |
|
880 | + |
|
881 | + |
|
882 | + /** |
|
883 | + * @return array |
|
884 | + */ |
|
885 | + public static function js_localization() |
|
886 | + { |
|
887 | + return self::$_js_localization; |
|
888 | + } |
|
889 | + |
|
890 | + |
|
891 | + /** |
|
892 | + * @return void |
|
893 | + */ |
|
894 | + public static function reset_js_localization() |
|
895 | + { |
|
896 | + self::$_js_localization = array(); |
|
897 | + } |
|
898 | + |
|
899 | + |
|
900 | + /** |
|
901 | + * Gets the JS to put inside the jquery validation rules for subsection of this form section. |
|
902 | + * See parent function for more... |
|
903 | + * |
|
904 | + * @return array |
|
905 | + * @throws EE_Error |
|
906 | + */ |
|
907 | + public function get_jquery_validation_rules() |
|
908 | + { |
|
909 | + $jquery_validation_rules = array(); |
|
910 | + foreach ($this->get_validatable_subsections() as $subsection) { |
|
911 | + $jquery_validation_rules = array_merge( |
|
912 | + $jquery_validation_rules, |
|
913 | + $subsection->get_jquery_validation_rules() |
|
914 | + ); |
|
915 | + } |
|
916 | + return $jquery_validation_rules; |
|
917 | + } |
|
918 | + |
|
919 | + |
|
920 | + /** |
|
921 | + * Sanitizes all the data and sets the sanitized value of each field |
|
922 | + * |
|
923 | + * @param array $req_data like $_POST |
|
924 | + * @return void |
|
925 | + * @throws EE_Error |
|
926 | + */ |
|
927 | + protected function _normalize($req_data) |
|
928 | + { |
|
929 | + $this->_received_submission = true; |
|
930 | + $this->_validation_errors = array(); |
|
931 | + foreach ($this->get_validatable_subsections() as $subsection) { |
|
932 | + try { |
|
933 | + $subsection->_normalize($req_data); |
|
934 | + } catch (EE_Validation_Error $e) { |
|
935 | + $subsection->add_validation_error($e); |
|
936 | + } |
|
937 | + } |
|
938 | + } |
|
939 | + |
|
940 | + |
|
941 | + /** |
|
942 | + * Performs validation on this form section and its subsections. |
|
943 | + * For each subsection, |
|
944 | + * calls _validate_{subsection_name} on THIS form (if the function exists) |
|
945 | + * and passes it the subsection, then calls _validate on that subsection. |
|
946 | + * If you need to perform validation on the form as a whole (considering multiple) |
|
947 | + * you would be best to override this _validate method, |
|
948 | + * calling parent::_validate() first. |
|
949 | + * |
|
950 | + * @throws EE_Error |
|
951 | + */ |
|
952 | + protected function _validate() |
|
953 | + { |
|
954 | + // reset the cache of whether this form is valid or not- we're re-validating it now |
|
955 | + $this->is_valid = null; |
|
956 | + foreach ($this->get_validatable_subsections() as $subsection_name => $subsection) { |
|
957 | + if (method_exists($this, '_validate_' . $subsection_name)) { |
|
958 | + call_user_func_array(array($this, '_validate_' . $subsection_name), array($subsection)); |
|
959 | + } |
|
960 | + $subsection->_validate(); |
|
961 | + } |
|
962 | + } |
|
963 | + |
|
964 | + |
|
965 | + /** |
|
966 | + * Gets all the validated inputs for the form section |
|
967 | + * |
|
968 | + * @return array |
|
969 | + * @throws EE_Error |
|
970 | + */ |
|
971 | + public function valid_data() |
|
972 | + { |
|
973 | + $inputs = array(); |
|
974 | + foreach ($this->subsections() as $subsection_name => $subsection) { |
|
975 | + if ($subsection instanceof EE_Form_Section_Proper) { |
|
976 | + $inputs[ $subsection_name ] = $subsection->valid_data(); |
|
977 | + } elseif ($subsection instanceof EE_Form_Input_Base) { |
|
978 | + $inputs[ $subsection_name ] = $subsection->normalized_value(); |
|
979 | + } |
|
980 | + } |
|
981 | + return $inputs; |
|
982 | + } |
|
983 | + |
|
984 | + |
|
985 | + /** |
|
986 | + * Gets all the inputs on this form section |
|
987 | + * |
|
988 | + * @return EE_Form_Input_Base[] |
|
989 | + * @throws EE_Error |
|
990 | + */ |
|
991 | + public function inputs() |
|
992 | + { |
|
993 | + $inputs = array(); |
|
994 | + foreach ($this->subsections() as $subsection_name => $subsection) { |
|
995 | + if ($subsection instanceof EE_Form_Input_Base) { |
|
996 | + $inputs[ $subsection_name ] = $subsection; |
|
997 | + } |
|
998 | + } |
|
999 | + return $inputs; |
|
1000 | + } |
|
1001 | + |
|
1002 | + |
|
1003 | + /** |
|
1004 | + * Gets all the subsections which are a proper form |
|
1005 | + * |
|
1006 | + * @return EE_Form_Section_Proper[] |
|
1007 | + * @throws EE_Error |
|
1008 | + */ |
|
1009 | + public function subforms() |
|
1010 | + { |
|
1011 | + $form_sections = array(); |
|
1012 | + foreach ($this->subsections() as $name => $obj) { |
|
1013 | + if ($obj instanceof EE_Form_Section_Proper) { |
|
1014 | + $form_sections[ $name ] = $obj; |
|
1015 | + } |
|
1016 | + } |
|
1017 | + return $form_sections; |
|
1018 | + } |
|
1019 | + |
|
1020 | + |
|
1021 | + /** |
|
1022 | + * Gets all the subsections (inputs, proper subsections, or html-only sections). |
|
1023 | + * Consider using inputs() or subforms() |
|
1024 | + * if you only want form inputs or proper form sections. |
|
1025 | + * |
|
1026 | + * @param boolean $require_construction_to_be_finalized most client code should |
|
1027 | + * leave this as TRUE so that the inputs will be properly |
|
1028 | + * configured. However, some client code may be ok with |
|
1029 | + * construction finalize being called later |
|
1030 | + * (realizing that the subsections' html names might not be |
|
1031 | + * set yet, etc.) |
|
1032 | + * @return EE_Form_Section_Proper[] |
|
1033 | + * @throws EE_Error |
|
1034 | + */ |
|
1035 | + public function subsections($require_construction_to_be_finalized = true) |
|
1036 | + { |
|
1037 | + if ($require_construction_to_be_finalized) { |
|
1038 | + $this->ensure_construct_finalized_called(); |
|
1039 | + } |
|
1040 | + return $this->_subsections; |
|
1041 | + } |
|
1042 | + |
|
1043 | + |
|
1044 | + /** |
|
1045 | + * Returns whether this form has any subforms or inputs |
|
1046 | + * @return bool |
|
1047 | + */ |
|
1048 | + public function hasSubsections() |
|
1049 | + { |
|
1050 | + return ! empty($this->_subsections); |
|
1051 | + } |
|
1052 | + |
|
1053 | + |
|
1054 | + /** |
|
1055 | + * Returns a simple array where keys are input names, and values are their normalized |
|
1056 | + * values. (Similar to calling get_input_value on inputs) |
|
1057 | + * |
|
1058 | + * @param boolean $include_subform_inputs Whether to include inputs from subforms, |
|
1059 | + * or just this forms' direct children inputs |
|
1060 | + * @param boolean $flatten Whether to force the results into 1-dimensional array, |
|
1061 | + * or allow multidimensional array |
|
1062 | + * @return array if $flatten is TRUE it will always be a 1-dimensional array |
|
1063 | + * with array keys being input names |
|
1064 | + * (regardless of whether they are from a subsection or not), |
|
1065 | + * and if $flatten is FALSE it can be a multidimensional array |
|
1066 | + * where keys are always subsection names and values are either |
|
1067 | + * the input's normalized value, or an array like the top-level array |
|
1068 | + * @throws EE_Error |
|
1069 | + */ |
|
1070 | + public function input_values($include_subform_inputs = false, $flatten = false) |
|
1071 | + { |
|
1072 | + return $this->_input_values(false, $include_subform_inputs, $flatten); |
|
1073 | + } |
|
1074 | + |
|
1075 | + |
|
1076 | + /** |
|
1077 | + * Similar to EE_Form_Section_Proper::input_values(), except this returns the 'display_value' |
|
1078 | + * of each input. On some inputs (especially radio boxes or checkboxes), the value stored |
|
1079 | + * is not necessarily the value we want to display to users. This creates an array |
|
1080 | + * where keys are the input names, and values are their display values |
|
1081 | + * |
|
1082 | + * @param boolean $include_subform_inputs Whether to include inputs from subforms, |
|
1083 | + * or just this forms' direct children inputs |
|
1084 | + * @param boolean $flatten Whether to force the results into 1-dimensional array, |
|
1085 | + * or allow multidimensional array |
|
1086 | + * @return array if $flatten is TRUE it will always be a 1-dimensional array |
|
1087 | + * with array keys being input names |
|
1088 | + * (regardless of whether they are from a subsection or not), |
|
1089 | + * and if $flatten is FALSE it can be a multidimensional array |
|
1090 | + * where keys are always subsection names and values are either |
|
1091 | + * the input's normalized value, or an array like the top-level array |
|
1092 | + * @throws EE_Error |
|
1093 | + */ |
|
1094 | + public function input_pretty_values($include_subform_inputs = false, $flatten = false) |
|
1095 | + { |
|
1096 | + return $this->_input_values(true, $include_subform_inputs, $flatten); |
|
1097 | + } |
|
1098 | + |
|
1099 | + |
|
1100 | + /** |
|
1101 | + * Gets the input values from the form |
|
1102 | + * |
|
1103 | + * @param boolean $pretty Whether to retrieve the pretty value, |
|
1104 | + * or just the normalized value |
|
1105 | + * @param boolean $include_subform_inputs Whether to include inputs from subforms, |
|
1106 | + * or just this forms' direct children inputs |
|
1107 | + * @param boolean $flatten Whether to force the results into 1-dimensional array, |
|
1108 | + * or allow multidimensional array |
|
1109 | + * @return array if $flatten is TRUE it will always be a 1-dimensional array with array keys being |
|
1110 | + * input names (regardless of whether they are from a subsection or not), |
|
1111 | + * and if $flatten is FALSE it can be a multidimensional array |
|
1112 | + * where keys are always subsection names and values are either |
|
1113 | + * the input's normalized value, or an array like the top-level array |
|
1114 | + * @throws EE_Error |
|
1115 | + */ |
|
1116 | + public function _input_values($pretty = false, $include_subform_inputs = false, $flatten = false) |
|
1117 | + { |
|
1118 | + $input_values = array(); |
|
1119 | + foreach ($this->subsections() as $subsection_name => $subsection) { |
|
1120 | + if ($subsection instanceof EE_Form_Input_Base) { |
|
1121 | + $input_values[ $subsection_name ] = $pretty |
|
1122 | + ? $subsection->pretty_value() |
|
1123 | + : $subsection->normalized_value(); |
|
1124 | + } elseif ($subsection instanceof EE_Form_Section_Proper && $include_subform_inputs) { |
|
1125 | + $subform_input_values = $subsection->_input_values( |
|
1126 | + $pretty, |
|
1127 | + $include_subform_inputs, |
|
1128 | + $flatten |
|
1129 | + ); |
|
1130 | + if ($flatten) { |
|
1131 | + $input_values = array_merge($input_values, $subform_input_values); |
|
1132 | + } else { |
|
1133 | + $input_values[ $subsection_name ] = $subform_input_values; |
|
1134 | + } |
|
1135 | + } |
|
1136 | + } |
|
1137 | + return $input_values; |
|
1138 | + } |
|
1139 | + |
|
1140 | + |
|
1141 | + /** |
|
1142 | + * Gets the originally submitted input values from the form |
|
1143 | + * |
|
1144 | + * @param boolean $include_subforms Whether to include inputs from subforms, |
|
1145 | + * or just this forms' direct children inputs |
|
1146 | + * @return array if $flatten is TRUE it will always be a 1-dimensional array |
|
1147 | + * with array keys being input names |
|
1148 | + * (regardless of whether they are from a subsection or not), |
|
1149 | + * and if $flatten is FALSE it can be a multidimensional array |
|
1150 | + * where keys are always subsection names and values are either |
|
1151 | + * the input's normalized value, or an array like the top-level array |
|
1152 | + * @throws EE_Error |
|
1153 | + */ |
|
1154 | + public function submitted_values($include_subforms = false) |
|
1155 | + { |
|
1156 | + $submitted_values = array(); |
|
1157 | + foreach ($this->subsections() as $subsection) { |
|
1158 | + if ($subsection instanceof EE_Form_Input_Base) { |
|
1159 | + // is this input part of an array of inputs? |
|
1160 | + if (strpos($subsection->html_name(), '[') !== false) { |
|
1161 | + $full_input_name = EEH_Array::convert_array_values_to_keys( |
|
1162 | + explode( |
|
1163 | + '[', |
|
1164 | + str_replace(']', '', $subsection->html_name()) |
|
1165 | + ), |
|
1166 | + $subsection->raw_value() |
|
1167 | + ); |
|
1168 | + $submitted_values = array_replace_recursive($submitted_values, $full_input_name); |
|
1169 | + } else { |
|
1170 | + $submitted_values[ $subsection->html_name() ] = $subsection->raw_value(); |
|
1171 | + } |
|
1172 | + } elseif ($subsection instanceof EE_Form_Section_Proper && $include_subforms) { |
|
1173 | + $subform_input_values = $subsection->submitted_values($include_subforms); |
|
1174 | + $submitted_values = array_replace_recursive($submitted_values, $subform_input_values); |
|
1175 | + } |
|
1176 | + } |
|
1177 | + return $submitted_values; |
|
1178 | + } |
|
1179 | + |
|
1180 | + |
|
1181 | + /** |
|
1182 | + * Indicates whether or not this form has received a submission yet |
|
1183 | + * (ie, had receive_form_submission called on it yet) |
|
1184 | + * |
|
1185 | + * @return boolean |
|
1186 | + * @throws EE_Error |
|
1187 | + */ |
|
1188 | + public function has_received_submission() |
|
1189 | + { |
|
1190 | + $this->ensure_construct_finalized_called(); |
|
1191 | + return $this->_received_submission; |
|
1192 | + } |
|
1193 | + |
|
1194 | + |
|
1195 | + /** |
|
1196 | + * Equivalent to passing 'exclude' in the constructor's options array. |
|
1197 | + * Removes the listed inputs from the form |
|
1198 | + * |
|
1199 | + * @param array $inputs_to_exclude values are the input names |
|
1200 | + * @return void |
|
1201 | + */ |
|
1202 | + public function exclude(array $inputs_to_exclude = array()) |
|
1203 | + { |
|
1204 | + foreach ($inputs_to_exclude as $input_to_exclude_name) { |
|
1205 | + unset($this->_subsections[ $input_to_exclude_name ]); |
|
1206 | + } |
|
1207 | + } |
|
1208 | + |
|
1209 | + |
|
1210 | + /** |
|
1211 | + * Changes these inputs' display strategy to be EE_Hidden_Display_Strategy. |
|
1212 | + * @param array $inputs_to_hide |
|
1213 | + * @throws EE_Error |
|
1214 | + */ |
|
1215 | + public function hide(array $inputs_to_hide = array()) |
|
1216 | + { |
|
1217 | + foreach ($inputs_to_hide as $input_to_hide) { |
|
1218 | + $input = $this->get_input($input_to_hide); |
|
1219 | + $input->set_display_strategy(new EE_Hidden_Display_Strategy()); |
|
1220 | + } |
|
1221 | + } |
|
1222 | + |
|
1223 | + |
|
1224 | + /** |
|
1225 | + * add_subsections |
|
1226 | + * Adds the listed subsections to the form section. |
|
1227 | + * If $subsection_name_to_target is provided, |
|
1228 | + * then new subsections are added before or after that subsection, |
|
1229 | + * otherwise to the start or end of the entire subsections array. |
|
1230 | + * |
|
1231 | + * @param EE_Form_Section_Base[] $new_subsections array of new form subsections |
|
1232 | + * where keys are their names |
|
1233 | + * @param string $subsection_name_to_target an existing for section that $new_subsections |
|
1234 | + * should be added before or after |
|
1235 | + * IF $subsection_name_to_target is null, |
|
1236 | + * then $new_subsections will be added to |
|
1237 | + * the beginning or end of the entire subsections array |
|
1238 | + * @param boolean $add_before whether to add $new_subsections, before or after |
|
1239 | + * $subsection_name_to_target, |
|
1240 | + * or if $subsection_name_to_target is null, |
|
1241 | + * before or after entire subsections array |
|
1242 | + * @return void |
|
1243 | + * @throws EE_Error |
|
1244 | + */ |
|
1245 | + public function add_subsections($new_subsections, $subsection_name_to_target = null, $add_before = true) |
|
1246 | + { |
|
1247 | + foreach ($new_subsections as $subsection_name => $subsection) { |
|
1248 | + if (! $subsection instanceof EE_Form_Section_Base) { |
|
1249 | + EE_Error::add_error( |
|
1250 | + sprintf( |
|
1251 | + esc_html__( |
|
1252 | + "Trying to add a %s as a subsection (it was named '%s') to the form section '%s'. It was removed.", |
|
1253 | + 'event_espresso' |
|
1254 | + ), |
|
1255 | + get_class($subsection), |
|
1256 | + $subsection_name, |
|
1257 | + $this->name() |
|
1258 | + ) |
|
1259 | + ); |
|
1260 | + unset($new_subsections[ $subsection_name ]); |
|
1261 | + } |
|
1262 | + } |
|
1263 | + $this->_subsections = EEH_Array::insert_into_array( |
|
1264 | + $this->_subsections, |
|
1265 | + $new_subsections, |
|
1266 | + $subsection_name_to_target, |
|
1267 | + $add_before |
|
1268 | + ); |
|
1269 | + if ($this->_construction_finalized) { |
|
1270 | + foreach ($this->_subsections as $name => $subsection) { |
|
1271 | + $subsection->_construct_finalize($this, $name); |
|
1272 | + } |
|
1273 | + } |
|
1274 | + } |
|
1275 | + |
|
1276 | + |
|
1277 | + /** |
|
1278 | + * @param string $subsection_name |
|
1279 | + * @param bool $recursive |
|
1280 | + * @return bool |
|
1281 | + */ |
|
1282 | + public function has_subsection($subsection_name, $recursive = false) |
|
1283 | + { |
|
1284 | + foreach ($this->_subsections as $name => $subsection) { |
|
1285 | + if ($name === $subsection_name |
|
1286 | + || ( |
|
1287 | + $recursive |
|
1288 | + && $subsection instanceof EE_Form_Section_Proper |
|
1289 | + && $subsection->has_subsection($subsection_name, $recursive) |
|
1290 | + ) |
|
1291 | + ) { |
|
1292 | + return true; |
|
1293 | + } |
|
1294 | + } |
|
1295 | + return false; |
|
1296 | + } |
|
1297 | + |
|
1298 | + |
|
1299 | + |
|
1300 | + /** |
|
1301 | + * Just gets all validatable subsections to clean their sensitive data |
|
1302 | + * |
|
1303 | + * @throws EE_Error |
|
1304 | + */ |
|
1305 | + public function clean_sensitive_data() |
|
1306 | + { |
|
1307 | + foreach ($this->get_validatable_subsections() as $subsection) { |
|
1308 | + $subsection->clean_sensitive_data(); |
|
1309 | + } |
|
1310 | + } |
|
1311 | + |
|
1312 | + |
|
1313 | + /** |
|
1314 | + * Sets the submission error message (aka validation error message for this form section and all sub-sections) |
|
1315 | + * @param string $form_submission_error_message |
|
1316 | + * @param EE_Form_Section_Validatable $form_section unused |
|
1317 | + * @throws EE_Error |
|
1318 | + */ |
|
1319 | + public function set_submission_error_message( |
|
1320 | + $form_submission_error_message = '' |
|
1321 | + ) { |
|
1322 | + $this->_form_submission_error_message = ! empty($form_submission_error_message) |
|
1323 | + ? $form_submission_error_message |
|
1324 | + : $this->getAllValidationErrorsString(); |
|
1325 | + } |
|
1326 | + |
|
1327 | + |
|
1328 | + /** |
|
1329 | + * Returns the cached error message. A default value is set for this during _validate(), |
|
1330 | + * (called during receive_form_submission) but it can be explicitly set using |
|
1331 | + * set_submission_error_message |
|
1332 | + * |
|
1333 | + * @return string |
|
1334 | + */ |
|
1335 | + public function submission_error_message() |
|
1336 | + { |
|
1337 | + return $this->_form_submission_error_message; |
|
1338 | + } |
|
1339 | + |
|
1340 | + |
|
1341 | + /** |
|
1342 | + * Sets a message to display if the data submitted to the form was valid. |
|
1343 | + * @param string $form_submission_success_message |
|
1344 | + */ |
|
1345 | + public function set_submission_success_message($form_submission_success_message = '') |
|
1346 | + { |
|
1347 | + $this->_form_submission_success_message = ! empty($form_submission_success_message) |
|
1348 | + ? $form_submission_success_message |
|
1349 | + : esc_html__('Form submitted successfully', 'event_espresso'); |
|
1350 | + } |
|
1351 | + |
|
1352 | + |
|
1353 | + /** |
|
1354 | + * Gets a message appropriate for display when the form is correctly submitted |
|
1355 | + * @return string |
|
1356 | + */ |
|
1357 | + public function submission_success_message() |
|
1358 | + { |
|
1359 | + return $this->_form_submission_success_message; |
|
1360 | + } |
|
1361 | + |
|
1362 | + |
|
1363 | + /** |
|
1364 | + * Returns the prefix that should be used on child of this form section for |
|
1365 | + * their html names. If this form section itself has a parent, prepends ITS |
|
1366 | + * prefix onto this form section's prefix. Used primarily by |
|
1367 | + * EE_Form_Input_Base::_set_default_html_name_if_empty |
|
1368 | + * |
|
1369 | + * @return string |
|
1370 | + * @throws EE_Error |
|
1371 | + */ |
|
1372 | + public function html_name_prefix() |
|
1373 | + { |
|
1374 | + if ($this->parent_section() instanceof EE_Form_Section_Proper) { |
|
1375 | + return $this->parent_section()->html_name_prefix() . '[' . $this->name() . ']'; |
|
1376 | + } |
|
1377 | + return $this->name(); |
|
1378 | + } |
|
1379 | + |
|
1380 | + |
|
1381 | + /** |
|
1382 | + * Gets the name, but first checks _construct_finalize has been called. If not, |
|
1383 | + * calls it (assumes there is no parent and that we want the name to be whatever |
|
1384 | + * was set, which is probably nothing, or the classname) |
|
1385 | + * |
|
1386 | + * @return string |
|
1387 | + * @throws EE_Error |
|
1388 | + */ |
|
1389 | + public function name() |
|
1390 | + { |
|
1391 | + $this->ensure_construct_finalized_called(); |
|
1392 | + return parent::name(); |
|
1393 | + } |
|
1394 | + |
|
1395 | + |
|
1396 | + /** |
|
1397 | + * @return EE_Form_Section_Proper |
|
1398 | + * @throws EE_Error |
|
1399 | + */ |
|
1400 | + public function parent_section() |
|
1401 | + { |
|
1402 | + $this->ensure_construct_finalized_called(); |
|
1403 | + return parent::parent_section(); |
|
1404 | + } |
|
1405 | + |
|
1406 | + |
|
1407 | + /** |
|
1408 | + * make sure construction finalized was called, otherwise children might not be ready |
|
1409 | + * |
|
1410 | + * @return void |
|
1411 | + * @throws EE_Error |
|
1412 | + */ |
|
1413 | + public function ensure_construct_finalized_called() |
|
1414 | + { |
|
1415 | + if (! $this->_construction_finalized) { |
|
1416 | + $this->_construct_finalize($this->_parent_section, $this->_name); |
|
1417 | + } |
|
1418 | + } |
|
1419 | + |
|
1420 | + |
|
1421 | + /** |
|
1422 | + * Checks if any of this form section's inputs, or any of its children's inputs, |
|
1423 | + * are in teh form data. If any are found, returns true. Else false |
|
1424 | + * |
|
1425 | + * @param array $req_data |
|
1426 | + * @return boolean |
|
1427 | + * @throws EE_Error |
|
1428 | + */ |
|
1429 | + public function form_data_present_in($req_data = null) |
|
1430 | + { |
|
1431 | + $req_data = $this->getCachedRequest($req_data); |
|
1432 | + foreach ($this->subsections() as $subsection) { |
|
1433 | + if ($subsection instanceof EE_Form_Input_Base) { |
|
1434 | + if ($subsection->form_data_present_in($req_data)) { |
|
1435 | + return true; |
|
1436 | + } |
|
1437 | + } elseif ($subsection instanceof EE_Form_Section_Proper) { |
|
1438 | + if ($subsection->form_data_present_in($req_data)) { |
|
1439 | + return true; |
|
1440 | + } |
|
1441 | + } |
|
1442 | + } |
|
1443 | + return false; |
|
1444 | + } |
|
1445 | + |
|
1446 | + |
|
1447 | + /** |
|
1448 | + * Gets validation errors for this form section and subsections |
|
1449 | + * Similar to EE_Form_Section_Validatable::get_validation_errors() except this |
|
1450 | + * gets the validation errors for ALL subsection |
|
1451 | + * |
|
1452 | + * @return EE_Validation_Error[] |
|
1453 | + * @throws EE_Error |
|
1454 | + */ |
|
1455 | + public function get_validation_errors_accumulated() |
|
1456 | + { |
|
1457 | + $validation_errors = $this->get_validation_errors(); |
|
1458 | + foreach ($this->get_validatable_subsections() as $subsection) { |
|
1459 | + if ($subsection instanceof EE_Form_Section_Proper) { |
|
1460 | + $validation_errors_on_this_subsection = $subsection->get_validation_errors_accumulated(); |
|
1461 | + } else { |
|
1462 | + $validation_errors_on_this_subsection = $subsection->get_validation_errors(); |
|
1463 | + } |
|
1464 | + if ($validation_errors_on_this_subsection) { |
|
1465 | + $validation_errors = array_merge($validation_errors, $validation_errors_on_this_subsection); |
|
1466 | + } |
|
1467 | + } |
|
1468 | + return $validation_errors; |
|
1469 | + } |
|
1470 | + |
|
1471 | + /** |
|
1472 | + * Fetch validation errors from children and grandchildren and puts them in a single string. |
|
1473 | + * This traverses the form section tree to generate this, but you probably want to instead use |
|
1474 | + * get_form_submission_error_message() which is usually this message cached (or a custom validation error message) |
|
1475 | + * |
|
1476 | + * @return string |
|
1477 | + * @since 4.9.59.p |
|
1478 | + */ |
|
1479 | + protected function getAllValidationErrorsString() |
|
1480 | + { |
|
1481 | + $submission_error_messages = array(); |
|
1482 | + // bad, bad, bad registrant |
|
1483 | + foreach ($this->get_validation_errors_accumulated() as $validation_error) { |
|
1484 | + if ($validation_error instanceof EE_Validation_Error) { |
|
1485 | + $form_section = $validation_error->get_form_section(); |
|
1486 | + if ($form_section instanceof EE_Form_Input_Base) { |
|
1487 | + $label = $validation_error->get_form_section()->html_label_text(); |
|
1488 | + } elseif ($form_section instanceof EE_Form_Section_Validatable) { |
|
1489 | + $label = $validation_error->get_form_section()->name(); |
|
1490 | + } else { |
|
1491 | + $label = esc_html__('Unknown', 'event_espresso'); |
|
1492 | + } |
|
1493 | + $submission_error_messages[] = sprintf( |
|
1494 | + __('%s : %s', 'event_espresso'), |
|
1495 | + $label, |
|
1496 | + $validation_error->getMessage() |
|
1497 | + ); |
|
1498 | + } |
|
1499 | + } |
|
1500 | + return implode('<br', $submission_error_messages); |
|
1501 | + } |
|
1502 | + |
|
1503 | + |
|
1504 | + /** |
|
1505 | + * This isn't just the name of an input, it's a path pointing to an input. The |
|
1506 | + * path is similar to a folder path: slash (/) means to descend into a subsection, |
|
1507 | + * dot-dot-slash (../) means to ascend into the parent section. |
|
1508 | + * After a series of slashes and dot-dot-slashes, there should be the name of an input, |
|
1509 | + * which will be returned. |
|
1510 | + * Eg, if you want the related input to be conditional on a sibling input name 'foobar' |
|
1511 | + * just use 'foobar'. If you want it to be conditional on an aunt/uncle input name |
|
1512 | + * 'baz', use '../baz'. If you want it to be conditional on a cousin input, |
|
1513 | + * the child of 'baz_section' named 'baz_child', use '../baz_section/baz_child'. |
|
1514 | + * Etc |
|
1515 | + * |
|
1516 | + * @param string|false $form_section_path we accept false also because substr( '../', '../' ) = false |
|
1517 | + * @return EE_Form_Section_Base |
|
1518 | + * @throws EE_Error |
|
1519 | + */ |
|
1520 | + public function find_section_from_path($form_section_path) |
|
1521 | + { |
|
1522 | + // check if we can find the input from purely going straight up the tree |
|
1523 | + $input = parent::find_section_from_path($form_section_path); |
|
1524 | + if ($input instanceof EE_Form_Section_Base) { |
|
1525 | + return $input; |
|
1526 | + } |
|
1527 | + $next_slash_pos = strpos($form_section_path, '/'); |
|
1528 | + if ($next_slash_pos !== false) { |
|
1529 | + $child_section_name = substr($form_section_path, 0, $next_slash_pos); |
|
1530 | + $subpath = substr($form_section_path, $next_slash_pos + 1); |
|
1531 | + } else { |
|
1532 | + $child_section_name = $form_section_path; |
|
1533 | + $subpath = ''; |
|
1534 | + } |
|
1535 | + $child_section = $this->get_subsection($child_section_name); |
|
1536 | + if ($child_section instanceof EE_Form_Section_Base) { |
|
1537 | + return $child_section->find_section_from_path($subpath); |
|
1538 | + } |
|
1539 | + return null; |
|
1540 | + } |
|
1541 | 1541 | } |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | <?php echo $eei18n; ?> |
33 | 33 | </script> |
34 | 34 | <?php foreach ($header_js as $key => $url) :?> |
35 | - <?php $header_attributes = isset($header_js_attributes[ $key ]) ? $header_js_attributes[ $key ] : ''; ?> |
|
35 | + <?php $header_attributes = isset($header_js_attributes[$key]) ? $header_js_attributes[$key] : ''; ?> |
|
36 | 36 | <script type="text/javascript" src="<?php echo $url; ?>"<?php echo $header_attributes; ?>></script> |
37 | 37 | <?php endforeach; ?> |
38 | 38 | <?php endif; ?> |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | <?php echo $content; ?> |
44 | 44 | </div> |
45 | 45 | <?php foreach ($footer_js as $key => $url) : ?> |
46 | - <?php $footer_attributes = isset($footer_js_attributes[ $key ]) ? $footer_js_attributes[ $key ] : ''; ?> |
|
46 | + <?php $footer_attributes = isset($footer_js_attributes[$key]) ? $footer_js_attributes[$key] : ''; ?> |
|
47 | 47 | <script type="text/javascript" src="<?php echo $url; ?>"<?php echo $footer_attributes; ?>></script> |
48 | 48 | <?php endforeach; ?> |
49 | 49 | <?php if ($enqueue_wp_assets) : ?> |
@@ -38,172 +38,172 @@ |
||
38 | 38 | */ |
39 | 39 | class EE_DMS_4_1_0_line_items extends EE_Data_Migration_Script_Stage_Table |
40 | 40 | { |
41 | - private $_new_line_table; |
|
42 | - private $_new_transaction_table; |
|
43 | - private $_new_reg_table; |
|
44 | - public function __construct() |
|
45 | - { |
|
46 | - global $wpdb; |
|
47 | - $this->_pretty_name = __("Line Items", "event_espresso"); |
|
48 | - $this->_old_table = $wpdb->prefix."events_attendee"; |
|
49 | - $this->select_expression = 'att.*, e.event_status'; |
|
50 | - $this->_extra_where_sql = ' AS att |
|
41 | + private $_new_line_table; |
|
42 | + private $_new_transaction_table; |
|
43 | + private $_new_reg_table; |
|
44 | + public function __construct() |
|
45 | + { |
|
46 | + global $wpdb; |
|
47 | + $this->_pretty_name = __("Line Items", "event_espresso"); |
|
48 | + $this->_old_table = $wpdb->prefix."events_attendee"; |
|
49 | + $this->select_expression = 'att.*, e.event_status'; |
|
50 | + $this->_extra_where_sql = ' AS att |
|
51 | 51 | INNER JOIN ' . $wpdb->prefix . 'events_detail AS e ON att.event_id=e.id |
52 | 52 | WHERE e.event_status!="D"'; |
53 | - $this->_new_transaction_table = $wpdb->prefix."esp_transaction"; |
|
54 | - $this->_new_line_table = $wpdb->prefix."esp_line_item"; |
|
55 | - $this->_new_reg_table = $wpdb->prefix."esp_registration"; |
|
56 | - parent::__construct(); |
|
57 | - } |
|
53 | + $this->_new_transaction_table = $wpdb->prefix."esp_transaction"; |
|
54 | + $this->_new_line_table = $wpdb->prefix."esp_line_item"; |
|
55 | + $this->_new_reg_table = $wpdb->prefix."esp_registration"; |
|
56 | + parent::__construct(); |
|
57 | + } |
|
58 | 58 | |
59 | - protected function _migrate_old_row($old_row) |
|
60 | - { |
|
61 | - // insert line items if its a primary id |
|
62 | - if (intval($old_row['is_primary'])) { |
|
63 | - $txn_id = $this->get_migration_script()->get_mapping_new_pk($this->_old_table, $old_row['id'], $this->_new_transaction_table); |
|
64 | - if (! $txn_id) { |
|
65 | - $this->add_error(sprintf(__("Could not find the transaction for the 3.1 attendee %d from row %s", "event_espresso"), $old_row['id'], $this->_json_encode($old_row))); |
|
66 | - return; |
|
67 | - } |
|
68 | - $txn = $this->_get_txn($txn_id); |
|
69 | - $new_line_items = $this->_insert_new_line_items($txn, $old_row); |
|
70 | - $this->get_migration_script()->set_mapping($this->_old_table, $old_row['id'], $this->_new_line_table, $new_line_items); |
|
71 | - } |
|
72 | - } |
|
59 | + protected function _migrate_old_row($old_row) |
|
60 | + { |
|
61 | + // insert line items if its a primary id |
|
62 | + if (intval($old_row['is_primary'])) { |
|
63 | + $txn_id = $this->get_migration_script()->get_mapping_new_pk($this->_old_table, $old_row['id'], $this->_new_transaction_table); |
|
64 | + if (! $txn_id) { |
|
65 | + $this->add_error(sprintf(__("Could not find the transaction for the 3.1 attendee %d from row %s", "event_espresso"), $old_row['id'], $this->_json_encode($old_row))); |
|
66 | + return; |
|
67 | + } |
|
68 | + $txn = $this->_get_txn($txn_id); |
|
69 | + $new_line_items = $this->_insert_new_line_items($txn, $old_row); |
|
70 | + $this->get_migration_script()->set_mapping($this->_old_table, $old_row['id'], $this->_new_line_table, $new_line_items); |
|
71 | + } |
|
72 | + } |
|
73 | 73 | |
74 | - private function _get_txn($txn_id) |
|
75 | - { |
|
76 | - global $wpdb; |
|
77 | - $txn = $wpdb->get_row($wpdb->prepare("SELECT * FROM $this->_new_transaction_table WHERE TXN_ID=%d", $txn_id), ARRAY_A); |
|
78 | - return $txn; |
|
79 | - } |
|
74 | + private function _get_txn($txn_id) |
|
75 | + { |
|
76 | + global $wpdb; |
|
77 | + $txn = $wpdb->get_row($wpdb->prepare("SELECT * FROM $this->_new_transaction_table WHERE TXN_ID=%d", $txn_id), ARRAY_A); |
|
78 | + return $txn; |
|
79 | + } |
|
80 | 80 | |
81 | - /** |
|
82 | - * In 4.1, we'd normally need more info than just the registrations to make the line items. Ie, we'd need |
|
83 | - * the transaction, and tax prices at the time of registration. (And probably promotions and other price factors). |
|
84 | - * But seeing how these are REGs created from 3.1 attendee data, which have |
|
85 | - * @param array $transaction |
|
86 | - * @return array new line item ids |
|
87 | - */ |
|
88 | - private function _insert_new_line_items($transaction, $old_attendee) |
|
89 | - { |
|
90 | - global $wpdb; |
|
91 | - $regs_on_this_transaction = $wpdb->get_results($wpdb->prepare("SELECT * FROM ".$this->_new_reg_table." WHERE TXN_ID=%d", $transaction['TXN_ID']), ARRAY_A); |
|
92 | - $new_line_item_ids = array(); |
|
93 | - // create a totla line item |
|
94 | - $total_line_item_id = $this->_insert_new_line_item(array( |
|
95 | - 'LIN_code'=>'total', |
|
96 | - 'TXN_ID'=>$transaction['TXN_ID'], |
|
97 | - 'LIN_name'=> __("Total", "event_espresso"), |
|
98 | - 'LIN_total'=>$transaction['TXN_total'], |
|
99 | - 'LIN_type'=>'total', |
|
100 | - 'OBJ_ID'=>$transaction['TXN_ID'], |
|
101 | - 'OBJ_type'=>'Transaction' |
|
102 | - ), $old_attendee); |
|
103 | - $new_line_item_ids[] = $total_line_item_id; |
|
104 | - // create a subtotal line item |
|
105 | - $reg_total = 0; |
|
106 | - foreach ($regs_on_this_transaction as $new_reg) { |
|
107 | - $reg_total += floatval($new_reg['REG_final_price']); |
|
108 | - } |
|
109 | - $subtotal_line_item_id = $this->_insert_new_line_item(array( |
|
110 | - 'LIN_code'=>'sub-total', |
|
111 | - 'TXN_ID'=>$transaction['TXN_ID'], |
|
112 | - 'LIN_name'=> __("Subtotal", "event_espresso"), |
|
113 | - 'LIN_total'=>$reg_total, |
|
114 | - 'LIN_parent'=>$total_line_item_id, |
|
115 | - 'LIN_type'=>'sub-total', |
|
116 | - ), $old_attendee); |
|
117 | - $new_line_item_ids[] = $subtotal_line_item_id; |
|
118 | - // group REGs by TKT_ID |
|
119 | - $regs_by_tkt = array(); |
|
120 | - foreach ($regs_on_this_transaction as $new_reg) { |
|
121 | - $regs_by_tkt[ $new_reg['TKT_ID'] ][] = $new_reg; |
|
122 | - } |
|
81 | + /** |
|
82 | + * In 4.1, we'd normally need more info than just the registrations to make the line items. Ie, we'd need |
|
83 | + * the transaction, and tax prices at the time of registration. (And probably promotions and other price factors). |
|
84 | + * But seeing how these are REGs created from 3.1 attendee data, which have |
|
85 | + * @param array $transaction |
|
86 | + * @return array new line item ids |
|
87 | + */ |
|
88 | + private function _insert_new_line_items($transaction, $old_attendee) |
|
89 | + { |
|
90 | + global $wpdb; |
|
91 | + $regs_on_this_transaction = $wpdb->get_results($wpdb->prepare("SELECT * FROM ".$this->_new_reg_table." WHERE TXN_ID=%d", $transaction['TXN_ID']), ARRAY_A); |
|
92 | + $new_line_item_ids = array(); |
|
93 | + // create a totla line item |
|
94 | + $total_line_item_id = $this->_insert_new_line_item(array( |
|
95 | + 'LIN_code'=>'total', |
|
96 | + 'TXN_ID'=>$transaction['TXN_ID'], |
|
97 | + 'LIN_name'=> __("Total", "event_espresso"), |
|
98 | + 'LIN_total'=>$transaction['TXN_total'], |
|
99 | + 'LIN_type'=>'total', |
|
100 | + 'OBJ_ID'=>$transaction['TXN_ID'], |
|
101 | + 'OBJ_type'=>'Transaction' |
|
102 | + ), $old_attendee); |
|
103 | + $new_line_item_ids[] = $total_line_item_id; |
|
104 | + // create a subtotal line item |
|
105 | + $reg_total = 0; |
|
106 | + foreach ($regs_on_this_transaction as $new_reg) { |
|
107 | + $reg_total += floatval($new_reg['REG_final_price']); |
|
108 | + } |
|
109 | + $subtotal_line_item_id = $this->_insert_new_line_item(array( |
|
110 | + 'LIN_code'=>'sub-total', |
|
111 | + 'TXN_ID'=>$transaction['TXN_ID'], |
|
112 | + 'LIN_name'=> __("Subtotal", "event_espresso"), |
|
113 | + 'LIN_total'=>$reg_total, |
|
114 | + 'LIN_parent'=>$total_line_item_id, |
|
115 | + 'LIN_type'=>'sub-total', |
|
116 | + ), $old_attendee); |
|
117 | + $new_line_item_ids[] = $subtotal_line_item_id; |
|
118 | + // group REGs by TKT_ID |
|
119 | + $regs_by_tkt = array(); |
|
120 | + foreach ($regs_on_this_transaction as $new_reg) { |
|
121 | + $regs_by_tkt[ $new_reg['TKT_ID'] ][] = $new_reg; |
|
122 | + } |
|
123 | 123 | |
124 | - // create individual line items |
|
124 | + // create individual line items |
|
125 | 125 | |
126 | - foreach ($regs_by_tkt as $ticket_id => $regs) { |
|
127 | - $count = count($regs); |
|
128 | - $line_total = 0; |
|
129 | - foreach ($regs as $new_reg) { |
|
130 | - $line_total += $new_reg['REG_final_price']; |
|
131 | - } |
|
132 | - $a_reg = reset($regs); |
|
133 | - $new_ticket = $this->_get_new_ticket_row($a_reg['TKT_ID']); |
|
134 | - $reg_line_item_id = $this->_insert_new_line_item(array( |
|
135 | - 'LIN_code'=> md5('Ticket' . $ticket_id . time()), |
|
136 | - 'TXN_ID'=>$transaction['TXN_ID'], |
|
137 | - 'LIN_name'=>$new_ticket['TKT_name'], |
|
138 | - 'LIN_unit_price'=>$a_reg['REG_final_price'], |
|
139 | - 'LIN_is_taxable'=>false, |
|
140 | - 'LIN_total'=>$line_total, |
|
141 | - 'LIN_quantity'=>$count, |
|
142 | - 'LIN_parent'=>$subtotal_line_item_id, |
|
143 | - 'OBJ_ID'=>$ticket_id, |
|
144 | - 'OBJ_type'=>'Ticket' |
|
145 | - ), $old_attendee); |
|
146 | - $new_line_item_ids[] = $reg_line_item_id; |
|
147 | - } |
|
126 | + foreach ($regs_by_tkt as $ticket_id => $regs) { |
|
127 | + $count = count($regs); |
|
128 | + $line_total = 0; |
|
129 | + foreach ($regs as $new_reg) { |
|
130 | + $line_total += $new_reg['REG_final_price']; |
|
131 | + } |
|
132 | + $a_reg = reset($regs); |
|
133 | + $new_ticket = $this->_get_new_ticket_row($a_reg['TKT_ID']); |
|
134 | + $reg_line_item_id = $this->_insert_new_line_item(array( |
|
135 | + 'LIN_code'=> md5('Ticket' . $ticket_id . time()), |
|
136 | + 'TXN_ID'=>$transaction['TXN_ID'], |
|
137 | + 'LIN_name'=>$new_ticket['TKT_name'], |
|
138 | + 'LIN_unit_price'=>$a_reg['REG_final_price'], |
|
139 | + 'LIN_is_taxable'=>false, |
|
140 | + 'LIN_total'=>$line_total, |
|
141 | + 'LIN_quantity'=>$count, |
|
142 | + 'LIN_parent'=>$subtotal_line_item_id, |
|
143 | + 'OBJ_ID'=>$ticket_id, |
|
144 | + 'OBJ_type'=>'Ticket' |
|
145 | + ), $old_attendee); |
|
146 | + $new_line_item_ids[] = $reg_line_item_id; |
|
147 | + } |
|
148 | 148 | |
149 | 149 | |
150 | 150 | |
151 | - return $new_line_item_ids; |
|
152 | - } |
|
153 | - /** |
|
154 | - * Gets the full ticket by ID |
|
155 | - * @global type $wpdb |
|
156 | - * @param type $new_ticket_id |
|
157 | - * @return array |
|
158 | - */ |
|
159 | - private function _get_new_ticket_row($new_ticket_id) |
|
160 | - { |
|
161 | - global $wpdb; |
|
162 | - $ticket_row = $wpdb->get_row($wpdb->prepare("SELECT * FROM ".$wpdb->prefix."esp_ticket WHERE TKT_ID=%d", $new_ticket_id), ARRAY_A); |
|
163 | - return $ticket_row; |
|
164 | - } |
|
151 | + return $new_line_item_ids; |
|
152 | + } |
|
153 | + /** |
|
154 | + * Gets the full ticket by ID |
|
155 | + * @global type $wpdb |
|
156 | + * @param type $new_ticket_id |
|
157 | + * @return array |
|
158 | + */ |
|
159 | + private function _get_new_ticket_row($new_ticket_id) |
|
160 | + { |
|
161 | + global $wpdb; |
|
162 | + $ticket_row = $wpdb->get_row($wpdb->prepare("SELECT * FROM ".$wpdb->prefix."esp_ticket WHERE TKT_ID=%d", $new_ticket_id), ARRAY_A); |
|
163 | + return $ticket_row; |
|
164 | + } |
|
165 | 165 | |
166 | - private function _insert_new_line_item($cols_n_values, $old_attendee) |
|
167 | - { |
|
168 | - global $wpdb; |
|
169 | - $default_cols_n_values = array( |
|
170 | - 'LIN_code'=>'', |
|
171 | - 'TXN_ID'=>0, |
|
172 | - 'LIN_name'=>'', |
|
173 | - 'LIN_desc'=>'', |
|
174 | - 'LIN_unit_price'=>0, |
|
175 | - 'LIN_percent'=>0, |
|
176 | - 'LIN_is_taxable'=>false, |
|
177 | - 'LIN_order'=>0, |
|
178 | - 'LIN_total'=>0, |
|
179 | - 'LIN_quantity'=>null, |
|
180 | - 'LIN_parent'=>0, |
|
181 | - 'LIN_type'=>'line-item', |
|
182 | - 'OBJ_ID'=>null, |
|
183 | - 'OBJ_type'=>null |
|
184 | - ); |
|
185 | - $cols_n_values = array_merge($default_cols_n_values, $cols_n_values); |
|
186 | - $datatypes = array( |
|
187 | - '%s',// LIN_code |
|
188 | - '%d',// TXN_ID |
|
189 | - '%s',// LIN_name |
|
190 | - '%s',// LIN_desc |
|
191 | - '%f',// LIN_unit_price |
|
192 | - '%f',// LIN_percent |
|
193 | - '%d',// LIN_is_taxable |
|
194 | - '%d',// LIN_order |
|
195 | - '%f',// LIN_total |
|
196 | - '%d',// LIN_quantity |
|
197 | - '%d',// LIN_parent |
|
198 | - '%s',// LIN_type |
|
199 | - '%d',// OBJ_ID |
|
200 | - '%s',// OBJ_type |
|
201 | - ); |
|
202 | - $success = $wpdb->insert($this->_new_line_table, $cols_n_values, $datatypes); |
|
203 | - if (! $success) { |
|
204 | - $this->add_error($this->get_migration_script()->_create_error_message_for_db_insertion($this->_old_table, $old_attendee, $this->_new_reg_table, $cols_n_values, $datatypes)); |
|
205 | - return 0; |
|
206 | - } |
|
207 | - return $wpdb->insert_id; |
|
208 | - } |
|
166 | + private function _insert_new_line_item($cols_n_values, $old_attendee) |
|
167 | + { |
|
168 | + global $wpdb; |
|
169 | + $default_cols_n_values = array( |
|
170 | + 'LIN_code'=>'', |
|
171 | + 'TXN_ID'=>0, |
|
172 | + 'LIN_name'=>'', |
|
173 | + 'LIN_desc'=>'', |
|
174 | + 'LIN_unit_price'=>0, |
|
175 | + 'LIN_percent'=>0, |
|
176 | + 'LIN_is_taxable'=>false, |
|
177 | + 'LIN_order'=>0, |
|
178 | + 'LIN_total'=>0, |
|
179 | + 'LIN_quantity'=>null, |
|
180 | + 'LIN_parent'=>0, |
|
181 | + 'LIN_type'=>'line-item', |
|
182 | + 'OBJ_ID'=>null, |
|
183 | + 'OBJ_type'=>null |
|
184 | + ); |
|
185 | + $cols_n_values = array_merge($default_cols_n_values, $cols_n_values); |
|
186 | + $datatypes = array( |
|
187 | + '%s',// LIN_code |
|
188 | + '%d',// TXN_ID |
|
189 | + '%s',// LIN_name |
|
190 | + '%s',// LIN_desc |
|
191 | + '%f',// LIN_unit_price |
|
192 | + '%f',// LIN_percent |
|
193 | + '%d',// LIN_is_taxable |
|
194 | + '%d',// LIN_order |
|
195 | + '%f',// LIN_total |
|
196 | + '%d',// LIN_quantity |
|
197 | + '%d',// LIN_parent |
|
198 | + '%s',// LIN_type |
|
199 | + '%d',// OBJ_ID |
|
200 | + '%s',// OBJ_type |
|
201 | + ); |
|
202 | + $success = $wpdb->insert($this->_new_line_table, $cols_n_values, $datatypes); |
|
203 | + if (! $success) { |
|
204 | + $this->add_error($this->get_migration_script()->_create_error_message_for_db_insertion($this->_old_table, $old_attendee, $this->_new_reg_table, $cols_n_values, $datatypes)); |
|
205 | + return 0; |
|
206 | + } |
|
207 | + return $wpdb->insert_id; |
|
208 | + } |
|
209 | 209 | } |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | $this->_old_table = $wpdb->prefix."events_attendee"; |
49 | 49 | $this->select_expression = 'att.*, e.event_status'; |
50 | 50 | $this->_extra_where_sql = ' AS att |
51 | - INNER JOIN ' . $wpdb->prefix . 'events_detail AS e ON att.event_id=e.id |
|
51 | + INNER JOIN ' . $wpdb->prefix.'events_detail AS e ON att.event_id=e.id |
|
52 | 52 | WHERE e.event_status!="D"'; |
53 | 53 | $this->_new_transaction_table = $wpdb->prefix."esp_transaction"; |
54 | 54 | $this->_new_line_table = $wpdb->prefix."esp_line_item"; |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | // insert line items if its a primary id |
62 | 62 | if (intval($old_row['is_primary'])) { |
63 | 63 | $txn_id = $this->get_migration_script()->get_mapping_new_pk($this->_old_table, $old_row['id'], $this->_new_transaction_table); |
64 | - if (! $txn_id) { |
|
64 | + if ( ! $txn_id) { |
|
65 | 65 | $this->add_error(sprintf(__("Could not find the transaction for the 3.1 attendee %d from row %s", "event_espresso"), $old_row['id'], $this->_json_encode($old_row))); |
66 | 66 | return; |
67 | 67 | } |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | // group REGs by TKT_ID |
119 | 119 | $regs_by_tkt = array(); |
120 | 120 | foreach ($regs_on_this_transaction as $new_reg) { |
121 | - $regs_by_tkt[ $new_reg['TKT_ID'] ][] = $new_reg; |
|
121 | + $regs_by_tkt[$new_reg['TKT_ID']][] = $new_reg; |
|
122 | 122 | } |
123 | 123 | |
124 | 124 | // create individual line items |
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | $a_reg = reset($regs); |
133 | 133 | $new_ticket = $this->_get_new_ticket_row($a_reg['TKT_ID']); |
134 | 134 | $reg_line_item_id = $this->_insert_new_line_item(array( |
135 | - 'LIN_code'=> md5('Ticket' . $ticket_id . time()), |
|
135 | + 'LIN_code'=> md5('Ticket'.$ticket_id.time()), |
|
136 | 136 | 'TXN_ID'=>$transaction['TXN_ID'], |
137 | 137 | 'LIN_name'=>$new_ticket['TKT_name'], |
138 | 138 | 'LIN_unit_price'=>$a_reg['REG_final_price'], |
@@ -184,23 +184,23 @@ discard block |
||
184 | 184 | ); |
185 | 185 | $cols_n_values = array_merge($default_cols_n_values, $cols_n_values); |
186 | 186 | $datatypes = array( |
187 | - '%s',// LIN_code |
|
188 | - '%d',// TXN_ID |
|
189 | - '%s',// LIN_name |
|
190 | - '%s',// LIN_desc |
|
191 | - '%f',// LIN_unit_price |
|
192 | - '%f',// LIN_percent |
|
193 | - '%d',// LIN_is_taxable |
|
194 | - '%d',// LIN_order |
|
195 | - '%f',// LIN_total |
|
196 | - '%d',// LIN_quantity |
|
197 | - '%d',// LIN_parent |
|
198 | - '%s',// LIN_type |
|
199 | - '%d',// OBJ_ID |
|
200 | - '%s',// OBJ_type |
|
187 | + '%s', // LIN_code |
|
188 | + '%d', // TXN_ID |
|
189 | + '%s', // LIN_name |
|
190 | + '%s', // LIN_desc |
|
191 | + '%f', // LIN_unit_price |
|
192 | + '%f', // LIN_percent |
|
193 | + '%d', // LIN_is_taxable |
|
194 | + '%d', // LIN_order |
|
195 | + '%f', // LIN_total |
|
196 | + '%d', // LIN_quantity |
|
197 | + '%d', // LIN_parent |
|
198 | + '%s', // LIN_type |
|
199 | + '%d', // OBJ_ID |
|
200 | + '%s', // OBJ_type |
|
201 | 201 | ); |
202 | 202 | $success = $wpdb->insert($this->_new_line_table, $cols_n_values, $datatypes); |
203 | - if (! $success) { |
|
203 | + if ( ! $success) { |
|
204 | 204 | $this->add_error($this->get_migration_script()->_create_error_message_for_db_insertion($this->_old_table, $old_attendee, $this->_new_reg_table, $cols_n_values, $datatypes)); |
205 | 205 | return 0; |
206 | 206 | } |
@@ -12,174 +12,174 @@ |
||
12 | 12 | */ |
13 | 13 | class EE_DMS_4_6_0_payment_method_currencies extends EE_Data_Migration_Script_Stage |
14 | 14 | { |
15 | - protected $_currency_table_name; |
|
16 | - protected $_currency_payment_method_table_name; |
|
17 | - protected $_payment_method_table_name; |
|
18 | - /** |
|
19 | - * each key is the name of a 4.1-style gateway we know how to migrate to 4.6 |
|
20 | - * @var array |
|
21 | - */ |
|
22 | - protected $_gateway_currencies = array( |
|
23 | - 'Aim' => array( |
|
24 | - 'AUD', |
|
25 | - 'USD', |
|
26 | - 'CAD', |
|
27 | - 'EUR', |
|
28 | - 'GBP', |
|
29 | - 'NZD', |
|
30 | - ), |
|
31 | - 'Bank' => 'all', |
|
32 | - 'Check' => 'all', |
|
33 | - 'Invoice' => 'all', |
|
34 | - 'Mijireh' => 'all', |
|
35 | - 'Paypal_Pro' => array( |
|
36 | - 'USD', |
|
37 | - 'GBP', |
|
38 | - 'CAD', |
|
39 | - 'AUD', |
|
40 | - 'BRL', |
|
41 | - 'CHF', |
|
42 | - 'CZK', |
|
43 | - 'DKK', |
|
44 | - 'EUR', |
|
45 | - 'HKD', |
|
46 | - 'HUF', |
|
47 | - 'ILS', |
|
48 | - 'JPY', |
|
49 | - 'MXN', |
|
50 | - 'MYR', |
|
51 | - 'NOK', |
|
52 | - 'NZD', |
|
53 | - 'PHP', |
|
54 | - 'PLN', |
|
55 | - 'SEK', |
|
56 | - 'SGD', |
|
57 | - 'THB', |
|
58 | - 'TRY', |
|
59 | - 'TWD', |
|
60 | - ), |
|
61 | - 'Paypal_Standard' => array( |
|
62 | - 'USD', |
|
63 | - 'GBP', |
|
64 | - 'CAD', |
|
65 | - 'AUD', |
|
66 | - 'BRL', |
|
67 | - 'CHF', |
|
68 | - 'CZK', |
|
69 | - 'DKK', |
|
70 | - 'EUR', |
|
71 | - 'HKD', |
|
72 | - 'HUF', |
|
73 | - 'ILS', |
|
74 | - 'JPY', |
|
75 | - 'MXN', |
|
76 | - 'MYR', |
|
77 | - 'NOK', |
|
78 | - 'NZD', |
|
79 | - 'PHP', |
|
80 | - 'PLN', |
|
81 | - 'SEK', |
|
82 | - 'SGD', |
|
83 | - 'THB', |
|
84 | - 'TRY', |
|
85 | - 'TWD' |
|
86 | - ) |
|
87 | - ); |
|
88 | - public function __construct() |
|
89 | - { |
|
90 | - global $wpdb; |
|
91 | - $this->_pretty_name = __('Payment Method Currencies', 'event_espresso'); |
|
92 | - $this->_payment_method_table_name = $wpdb->prefix.'esp_payment_method'; |
|
93 | - $this->_currency_payment_method_table_name = $wpdb->prefix.'esp_currency_payment_method'; |
|
94 | - $this->_currency_table_name = $wpdb->prefix.'esp_currency'; |
|
95 | - parent::__construct(); |
|
96 | - } |
|
15 | + protected $_currency_table_name; |
|
16 | + protected $_currency_payment_method_table_name; |
|
17 | + protected $_payment_method_table_name; |
|
18 | + /** |
|
19 | + * each key is the name of a 4.1-style gateway we know how to migrate to 4.6 |
|
20 | + * @var array |
|
21 | + */ |
|
22 | + protected $_gateway_currencies = array( |
|
23 | + 'Aim' => array( |
|
24 | + 'AUD', |
|
25 | + 'USD', |
|
26 | + 'CAD', |
|
27 | + 'EUR', |
|
28 | + 'GBP', |
|
29 | + 'NZD', |
|
30 | + ), |
|
31 | + 'Bank' => 'all', |
|
32 | + 'Check' => 'all', |
|
33 | + 'Invoice' => 'all', |
|
34 | + 'Mijireh' => 'all', |
|
35 | + 'Paypal_Pro' => array( |
|
36 | + 'USD', |
|
37 | + 'GBP', |
|
38 | + 'CAD', |
|
39 | + 'AUD', |
|
40 | + 'BRL', |
|
41 | + 'CHF', |
|
42 | + 'CZK', |
|
43 | + 'DKK', |
|
44 | + 'EUR', |
|
45 | + 'HKD', |
|
46 | + 'HUF', |
|
47 | + 'ILS', |
|
48 | + 'JPY', |
|
49 | + 'MXN', |
|
50 | + 'MYR', |
|
51 | + 'NOK', |
|
52 | + 'NZD', |
|
53 | + 'PHP', |
|
54 | + 'PLN', |
|
55 | + 'SEK', |
|
56 | + 'SGD', |
|
57 | + 'THB', |
|
58 | + 'TRY', |
|
59 | + 'TWD', |
|
60 | + ), |
|
61 | + 'Paypal_Standard' => array( |
|
62 | + 'USD', |
|
63 | + 'GBP', |
|
64 | + 'CAD', |
|
65 | + 'AUD', |
|
66 | + 'BRL', |
|
67 | + 'CHF', |
|
68 | + 'CZK', |
|
69 | + 'DKK', |
|
70 | + 'EUR', |
|
71 | + 'HKD', |
|
72 | + 'HUF', |
|
73 | + 'ILS', |
|
74 | + 'JPY', |
|
75 | + 'MXN', |
|
76 | + 'MYR', |
|
77 | + 'NOK', |
|
78 | + 'NZD', |
|
79 | + 'PHP', |
|
80 | + 'PLN', |
|
81 | + 'SEK', |
|
82 | + 'SGD', |
|
83 | + 'THB', |
|
84 | + 'TRY', |
|
85 | + 'TWD' |
|
86 | + ) |
|
87 | + ); |
|
88 | + public function __construct() |
|
89 | + { |
|
90 | + global $wpdb; |
|
91 | + $this->_pretty_name = __('Payment Method Currencies', 'event_espresso'); |
|
92 | + $this->_payment_method_table_name = $wpdb->prefix.'esp_payment_method'; |
|
93 | + $this->_currency_payment_method_table_name = $wpdb->prefix.'esp_currency_payment_method'; |
|
94 | + $this->_currency_table_name = $wpdb->prefix.'esp_currency'; |
|
95 | + parent::__construct(); |
|
96 | + } |
|
97 | 97 | |
98 | - protected function _count_records_to_migrate() |
|
99 | - { |
|
100 | - $count = 0; |
|
101 | - foreach ($this->_gateway_currencies as $currencies) { |
|
102 | - if ($currencies == 'all') { |
|
103 | - $currencies = $this->_get_all_currencies(); |
|
104 | - } |
|
105 | - $count += count($currencies); |
|
106 | - } |
|
107 | - return $count; |
|
108 | - } |
|
98 | + protected function _count_records_to_migrate() |
|
99 | + { |
|
100 | + $count = 0; |
|
101 | + foreach ($this->_gateway_currencies as $currencies) { |
|
102 | + if ($currencies == 'all') { |
|
103 | + $currencies = $this->_get_all_currencies(); |
|
104 | + } |
|
105 | + $count += count($currencies); |
|
106 | + } |
|
107 | + return $count; |
|
108 | + } |
|
109 | 109 | |
110 | 110 | |
111 | 111 | |
112 | - protected function _migration_step($num_items_to_migrate = 50) |
|
113 | - { |
|
114 | - $items_actually_migrated = 0; |
|
115 | - $relations_to_add_this_step = $this->_gather_relations_to_add($num_items_to_migrate); |
|
116 | - foreach ($relations_to_add_this_step as $pm_slug => $currencies) { |
|
117 | - $id = $this->get_migration_script()->get_mapping_new_pk('EE_Gateway_Config', $pm_slug, $this->_payment_method_table_name); |
|
118 | - foreach ($currencies as $currency) { |
|
119 | - if ($id) { |
|
120 | - $this->_add_currency_relations($id, $currency); |
|
121 | - } |
|
122 | - $items_actually_migrated++; |
|
123 | - } |
|
124 | - } |
|
125 | - if ($this->count_records_migrated() + $items_actually_migrated >= $this->count_records_to_migrate()) { |
|
126 | - $this->set_completed(); |
|
127 | - } |
|
128 | - return $items_actually_migrated; |
|
129 | - } |
|
112 | + protected function _migration_step($num_items_to_migrate = 50) |
|
113 | + { |
|
114 | + $items_actually_migrated = 0; |
|
115 | + $relations_to_add_this_step = $this->_gather_relations_to_add($num_items_to_migrate); |
|
116 | + foreach ($relations_to_add_this_step as $pm_slug => $currencies) { |
|
117 | + $id = $this->get_migration_script()->get_mapping_new_pk('EE_Gateway_Config', $pm_slug, $this->_payment_method_table_name); |
|
118 | + foreach ($currencies as $currency) { |
|
119 | + if ($id) { |
|
120 | + $this->_add_currency_relations($id, $currency); |
|
121 | + } |
|
122 | + $items_actually_migrated++; |
|
123 | + } |
|
124 | + } |
|
125 | + if ($this->count_records_migrated() + $items_actually_migrated >= $this->count_records_to_migrate()) { |
|
126 | + $this->set_completed(); |
|
127 | + } |
|
128 | + return $items_actually_migrated; |
|
129 | + } |
|
130 | 130 | |
131 | - private function _gather_relations_to_add($num_items_to_migrate) |
|
132 | - { |
|
133 | - $relations_to_add_this_step = array(); |
|
134 | - $migrate_up_to_count = $this->count_records_migrated() + $num_items_to_migrate; |
|
135 | - $iterator = 0; |
|
136 | - foreach ($this->_gateway_currencies as $pm_slug => $currencies) { |
|
137 | - if ($currencies == 'all') { |
|
138 | - $currencies = $this->_get_all_currencies(); |
|
139 | - } |
|
140 | - foreach ($currencies as $currency_code) { |
|
141 | - if ($this->count_records_migrated() <= $iterator && |
|
142 | - $iterator < $migrate_up_to_count) { |
|
143 | - $relations_to_add_this_step[ $pm_slug ] [] = $currency_code; |
|
144 | - } |
|
145 | - $iterator++; |
|
146 | - } |
|
147 | - } |
|
148 | - return $relations_to_add_this_step; |
|
149 | - } |
|
150 | - /** |
|
151 | - * Gets all the currency codes in the database |
|
152 | - * @return array |
|
153 | - */ |
|
154 | - private function _get_all_currencies() |
|
155 | - { |
|
156 | - global $wpdb; |
|
157 | - $currencies = $wpdb->get_col("SELECT CUR_code FROM {$this->_currency_table_name}"); |
|
158 | - return $currencies; |
|
159 | - } |
|
131 | + private function _gather_relations_to_add($num_items_to_migrate) |
|
132 | + { |
|
133 | + $relations_to_add_this_step = array(); |
|
134 | + $migrate_up_to_count = $this->count_records_migrated() + $num_items_to_migrate; |
|
135 | + $iterator = 0; |
|
136 | + foreach ($this->_gateway_currencies as $pm_slug => $currencies) { |
|
137 | + if ($currencies == 'all') { |
|
138 | + $currencies = $this->_get_all_currencies(); |
|
139 | + } |
|
140 | + foreach ($currencies as $currency_code) { |
|
141 | + if ($this->count_records_migrated() <= $iterator && |
|
142 | + $iterator < $migrate_up_to_count) { |
|
143 | + $relations_to_add_this_step[ $pm_slug ] [] = $currency_code; |
|
144 | + } |
|
145 | + $iterator++; |
|
146 | + } |
|
147 | + } |
|
148 | + return $relations_to_add_this_step; |
|
149 | + } |
|
150 | + /** |
|
151 | + * Gets all the currency codes in the database |
|
152 | + * @return array |
|
153 | + */ |
|
154 | + private function _get_all_currencies() |
|
155 | + { |
|
156 | + global $wpdb; |
|
157 | + $currencies = $wpdb->get_col("SELECT CUR_code FROM {$this->_currency_table_name}"); |
|
158 | + return $currencies; |
|
159 | + } |
|
160 | 160 | |
161 | - /** |
|
162 | - * Adds teh relation between the payment method and the currencies it can be used for |
|
163 | - * @param int $id |
|
164 | - * @param string $gateway_slug |
|
165 | - */ |
|
166 | - private function _add_currency_relations($pm_id, $currency_code) |
|
167 | - { |
|
168 | - global $wpdb; |
|
169 | - $cur_pm_relation = array( |
|
170 | - 'CUR_code'=>$currency_code, |
|
171 | - 'PMD_ID'=>$pm_id, |
|
172 | - ); |
|
173 | - $success = $wpdb->insert( |
|
174 | - $this->_currency_payment_method_table_name, |
|
175 | - $cur_pm_relation, |
|
176 | - array( |
|
177 | - '%s',// CUR_code |
|
178 | - '%d',// PMD_ID |
|
179 | - ) |
|
180 | - ); |
|
181 | - if (! $success) { |
|
182 | - $this->add_error(sprintf(__('Could not add currency relation %s because %s', "event_espresso"), wp_json_encode($cur_pm_relation), $wpdb->last_error)); |
|
183 | - } |
|
184 | - } |
|
161 | + /** |
|
162 | + * Adds teh relation between the payment method and the currencies it can be used for |
|
163 | + * @param int $id |
|
164 | + * @param string $gateway_slug |
|
165 | + */ |
|
166 | + private function _add_currency_relations($pm_id, $currency_code) |
|
167 | + { |
|
168 | + global $wpdb; |
|
169 | + $cur_pm_relation = array( |
|
170 | + 'CUR_code'=>$currency_code, |
|
171 | + 'PMD_ID'=>$pm_id, |
|
172 | + ); |
|
173 | + $success = $wpdb->insert( |
|
174 | + $this->_currency_payment_method_table_name, |
|
175 | + $cur_pm_relation, |
|
176 | + array( |
|
177 | + '%s',// CUR_code |
|
178 | + '%d',// PMD_ID |
|
179 | + ) |
|
180 | + ); |
|
181 | + if (! $success) { |
|
182 | + $this->add_error(sprintf(__('Could not add currency relation %s because %s', "event_espresso"), wp_json_encode($cur_pm_relation), $wpdb->last_error)); |
|
183 | + } |
|
184 | + } |
|
185 | 185 | } |
@@ -140,7 +140,7 @@ discard block |
||
140 | 140 | foreach ($currencies as $currency_code) { |
141 | 141 | if ($this->count_records_migrated() <= $iterator && |
142 | 142 | $iterator < $migrate_up_to_count) { |
143 | - $relations_to_add_this_step[ $pm_slug ] [] = $currency_code; |
|
143 | + $relations_to_add_this_step[$pm_slug] [] = $currency_code; |
|
144 | 144 | } |
145 | 145 | $iterator++; |
146 | 146 | } |
@@ -174,11 +174,11 @@ discard block |
||
174 | 174 | $this->_currency_payment_method_table_name, |
175 | 175 | $cur_pm_relation, |
176 | 176 | array( |
177 | - '%s',// CUR_code |
|
178 | - '%d',// PMD_ID |
|
177 | + '%s', // CUR_code |
|
178 | + '%d', // PMD_ID |
|
179 | 179 | ) |
180 | 180 | ); |
181 | - if (! $success) { |
|
181 | + if ( ! $success) { |
|
182 | 182 | $this->add_error(sprintf(__('Could not add currency relation %s because %s', "event_espresso"), wp_json_encode($cur_pm_relation), $wpdb->last_error)); |
183 | 183 | } |
184 | 184 | } |
@@ -28,58 +28,58 @@ discard block |
||
28 | 28 | { |
29 | 29 | |
30 | 30 | |
31 | - /** |
|
32 | - * Register widget with WordPress. |
|
33 | - */ |
|
34 | - public function __construct() |
|
35 | - { |
|
36 | - parent::__construct( |
|
37 | - __('Event Espresso Upcoming Events', 'event_espresso'), |
|
38 | - array( 'description' => __('A widget to display your upcoming events.', 'event_espresso')) |
|
39 | - ); |
|
40 | - } |
|
31 | + /** |
|
32 | + * Register widget with WordPress. |
|
33 | + */ |
|
34 | + public function __construct() |
|
35 | + { |
|
36 | + parent::__construct( |
|
37 | + __('Event Espresso Upcoming Events', 'event_espresso'), |
|
38 | + array( 'description' => __('A widget to display your upcoming events.', 'event_espresso')) |
|
39 | + ); |
|
40 | + } |
|
41 | 41 | |
42 | 42 | |
43 | 43 | |
44 | - /** |
|
45 | - * Back-end widget form. |
|
46 | - * |
|
47 | - * @see WP_Widget::form() |
|
48 | - * @param array $instance Previously saved values from database. |
|
49 | - * @return string|void |
|
50 | - */ |
|
51 | - public function form($instance) |
|
52 | - { |
|
44 | + /** |
|
45 | + * Back-end widget form. |
|
46 | + * |
|
47 | + * @see WP_Widget::form() |
|
48 | + * @param array $instance Previously saved values from database. |
|
49 | + * @return string|void |
|
50 | + */ |
|
51 | + public function form($instance) |
|
52 | + { |
|
53 | 53 | |
54 | - EE_Registry::instance()->load_class('Question_Option', array(), false, false, true); |
|
55 | - // Set up some default widget settings. |
|
56 | - $defaults = array( |
|
57 | - 'title' => __('Upcoming Events', 'event_espresso'), |
|
58 | - 'category_name' => '', |
|
59 | - 'show_expired' => 0, |
|
60 | - 'show_desc' => true, |
|
61 | - 'show_dates' => true, |
|
62 | - 'show_everywhere' => false, |
|
63 | - 'date_limit' => 2, |
|
64 | - 'limit' => 10, |
|
65 | - 'sort' => 'ASC', |
|
66 | - 'date_range' => false, |
|
67 | - 'image_size' => 'medium' |
|
68 | - ); |
|
54 | + EE_Registry::instance()->load_class('Question_Option', array(), false, false, true); |
|
55 | + // Set up some default widget settings. |
|
56 | + $defaults = array( |
|
57 | + 'title' => __('Upcoming Events', 'event_espresso'), |
|
58 | + 'category_name' => '', |
|
59 | + 'show_expired' => 0, |
|
60 | + 'show_desc' => true, |
|
61 | + 'show_dates' => true, |
|
62 | + 'show_everywhere' => false, |
|
63 | + 'date_limit' => 2, |
|
64 | + 'limit' => 10, |
|
65 | + 'sort' => 'ASC', |
|
66 | + 'date_range' => false, |
|
67 | + 'image_size' => 'medium' |
|
68 | + ); |
|
69 | 69 | |
70 | - $instance = wp_parse_args((array) $instance, $defaults); |
|
71 | - // don't add HTML labels for EE_Form_Fields generated inputs |
|
72 | - add_filter('FHEE__EEH_Form_Fields__label_html', '__return_empty_string'); |
|
73 | - $yes_no_values = array( |
|
74 | - EE_Question_Option::new_instance(array( 'QSO_value' => false, 'QSO_desc' => __('No', 'event_espresso'))), |
|
75 | - EE_Question_Option::new_instance(array( 'QSO_value' => true, 'QSO_desc' => __('Yes', 'event_espresso'))) |
|
76 | - ); |
|
77 | - $sort_values = array( |
|
78 | - EE_Question_Option::new_instance(array( 'QSO_value' => 'ASC', 'QSO_desc' => __('ASC', 'event_espresso'))), |
|
79 | - EE_Question_Option::new_instance(array( 'QSO_value' => 'DESC', 'QSO_desc' => __('DESC', 'event_espresso'))) |
|
80 | - ); |
|
70 | + $instance = wp_parse_args((array) $instance, $defaults); |
|
71 | + // don't add HTML labels for EE_Form_Fields generated inputs |
|
72 | + add_filter('FHEE__EEH_Form_Fields__label_html', '__return_empty_string'); |
|
73 | + $yes_no_values = array( |
|
74 | + EE_Question_Option::new_instance(array( 'QSO_value' => false, 'QSO_desc' => __('No', 'event_espresso'))), |
|
75 | + EE_Question_Option::new_instance(array( 'QSO_value' => true, 'QSO_desc' => __('Yes', 'event_espresso'))) |
|
76 | + ); |
|
77 | + $sort_values = array( |
|
78 | + EE_Question_Option::new_instance(array( 'QSO_value' => 'ASC', 'QSO_desc' => __('ASC', 'event_espresso'))), |
|
79 | + EE_Question_Option::new_instance(array( 'QSO_value' => 'DESC', 'QSO_desc' => __('DESC', 'event_espresso'))) |
|
80 | + ); |
|
81 | 81 | |
82 | - ?> |
|
82 | + ?> |
|
83 | 83 | |
84 | 84 | <!-- Widget Title: Text Input --> |
85 | 85 | |
@@ -94,26 +94,26 @@ discard block |
||
94 | 94 | <?php _e('Event Category:', 'event_espresso'); ?> |
95 | 95 | </label> |
96 | 96 | <?php |
97 | - $event_categories = array(); |
|
98 | - /** @type EEM_Term $EEM_Term */ |
|
99 | - $EEM_Term = EE_Registry::instance()->load_model('Term'); |
|
100 | - $categories = $EEM_Term->get_all_ee_categories(true); |
|
101 | - if ($categories) { |
|
102 | - foreach ($categories as $category) { |
|
103 | - if ($category instanceof EE_Term) { |
|
104 | - $event_categories[] = EE_Question_Option::new_instance(array( 'QSO_value' => $category->get('slug'), 'QSO_desc' => $category->get('name'))); |
|
105 | - } |
|
106 | - } |
|
107 | - } |
|
108 | - array_unshift($event_categories, EE_Question_Option::new_instance(array( 'QSO_value' => '', 'QSO_desc' => __(' - display all - ', 'event_espresso')))); |
|
109 | - echo EEH_Form_Fields::select( |
|
110 | - __('Event Category:', 'event_espresso'), |
|
111 | - $instance['category_name'], |
|
112 | - $event_categories, |
|
113 | - $this->get_field_name('category_name'), |
|
114 | - $this->get_field_id('category_name') |
|
115 | - ); |
|
116 | - ?> |
|
97 | + $event_categories = array(); |
|
98 | + /** @type EEM_Term $EEM_Term */ |
|
99 | + $EEM_Term = EE_Registry::instance()->load_model('Term'); |
|
100 | + $categories = $EEM_Term->get_all_ee_categories(true); |
|
101 | + if ($categories) { |
|
102 | + foreach ($categories as $category) { |
|
103 | + if ($category instanceof EE_Term) { |
|
104 | + $event_categories[] = EE_Question_Option::new_instance(array( 'QSO_value' => $category->get('slug'), 'QSO_desc' => $category->get('name'))); |
|
105 | + } |
|
106 | + } |
|
107 | + } |
|
108 | + array_unshift($event_categories, EE_Question_Option::new_instance(array( 'QSO_value' => '', 'QSO_desc' => __(' - display all - ', 'event_espresso')))); |
|
109 | + echo EEH_Form_Fields::select( |
|
110 | + __('Event Category:', 'event_espresso'), |
|
111 | + $instance['category_name'], |
|
112 | + $event_categories, |
|
113 | + $this->get_field_name('category_name'), |
|
114 | + $this->get_field_id('category_name') |
|
115 | + ); |
|
116 | + ?> |
|
117 | 117 | </p> |
118 | 118 | <p> |
119 | 119 | <label for="<?php echo $this->get_field_id('limit'); ?>"> |
@@ -126,59 +126,59 @@ discard block |
||
126 | 126 | <?php _e('Show Expired Events:', 'event_espresso'); ?> |
127 | 127 | </label> |
128 | 128 | <?php |
129 | - echo EEH_Form_Fields::select( |
|
130 | - __('Show Expired Events:', 'event_espresso'), |
|
131 | - $instance['show_expired'], |
|
132 | - array( |
|
133 | - EE_Question_Option::new_instance(array( 'QSO_value' => 0, 'QSO_desc' => __('No', 'event_espresso'))), |
|
134 | - EE_Question_Option::new_instance(array( 'QSO_value' => 1, 'QSO_desc' => __('Yes', 'event_espresso'))), |
|
135 | - EE_Question_Option::new_instance(array( 'QSO_value' => 2, 'QSO_desc' => __('Show Only Expired', 'event_espresso'))), |
|
136 | - ), |
|
137 | - $this->get_field_name('show_expired'), |
|
138 | - $this->get_field_id('show_expired') |
|
139 | - ); |
|
140 | - ?> |
|
129 | + echo EEH_Form_Fields::select( |
|
130 | + __('Show Expired Events:', 'event_espresso'), |
|
131 | + $instance['show_expired'], |
|
132 | + array( |
|
133 | + EE_Question_Option::new_instance(array( 'QSO_value' => 0, 'QSO_desc' => __('No', 'event_espresso'))), |
|
134 | + EE_Question_Option::new_instance(array( 'QSO_value' => 1, 'QSO_desc' => __('Yes', 'event_espresso'))), |
|
135 | + EE_Question_Option::new_instance(array( 'QSO_value' => 2, 'QSO_desc' => __('Show Only Expired', 'event_espresso'))), |
|
136 | + ), |
|
137 | + $this->get_field_name('show_expired'), |
|
138 | + $this->get_field_id('show_expired') |
|
139 | + ); |
|
140 | + ?> |
|
141 | 141 | </p> |
142 | 142 | <p> |
143 | 143 | <label for="<?php echo $this->get_field_id('sort'); ?>"> |
144 | 144 | <?php _e('Sort Events:', 'event_espresso'); ?> |
145 | 145 | </label> |
146 | 146 | <?php |
147 | - echo EEH_Form_Fields::select( |
|
148 | - __('Sort Events:', 'event_espresso'), |
|
149 | - $instance['sort'], |
|
150 | - $sort_values, |
|
151 | - $this->get_field_name('sort'), |
|
152 | - $this->get_field_id('sort') |
|
153 | - ); |
|
154 | - ?> |
|
147 | + echo EEH_Form_Fields::select( |
|
148 | + __('Sort Events:', 'event_espresso'), |
|
149 | + $instance['sort'], |
|
150 | + $sort_values, |
|
151 | + $this->get_field_name('sort'), |
|
152 | + $this->get_field_id('sort') |
|
153 | + ); |
|
154 | + ?> |
|
155 | 155 | </p> |
156 | 156 | <p> |
157 | 157 | <label for="<?php echo $this->get_field_id('image_size'); ?>"> |
158 | 158 | <?php _e('Image Size:', 'event_espresso'); ?> |
159 | 159 | </label> |
160 | 160 | <?php |
161 | - $image_sizes = array(); |
|
162 | - $sizes = get_intermediate_image_sizes(); |
|
163 | - if ($sizes) { |
|
164 | - // loop thru images and create option objects out of them |
|
165 | - foreach ($sizes as $image_size) { |
|
166 | - $image_size = trim($image_size); |
|
167 | - // no big images plz |
|
168 | - if (! in_array($image_size, array( 'large', 'post-thumbnail' ))) { |
|
169 | - $image_sizes[] = EE_Question_Option::new_instance(array( 'QSO_value' => $image_size, 'QSO_desc' => $image_size )); |
|
170 | - } |
|
171 | - } |
|
172 | - $image_sizes[] = EE_Question_Option::new_instance(array( 'QSO_value' => 'none', 'QSO_desc' => __('don\'t show images', 'event_espresso') )); |
|
173 | - } |
|
174 | - echo EEH_Form_Fields::select( |
|
175 | - __('Image Size:', 'event_espresso'), |
|
176 | - $instance['image_size'], |
|
177 | - $image_sizes, |
|
178 | - $this->get_field_name('image_size'), |
|
179 | - $this->get_field_id('image_size') |
|
180 | - ); |
|
181 | - ?> |
|
161 | + $image_sizes = array(); |
|
162 | + $sizes = get_intermediate_image_sizes(); |
|
163 | + if ($sizes) { |
|
164 | + // loop thru images and create option objects out of them |
|
165 | + foreach ($sizes as $image_size) { |
|
166 | + $image_size = trim($image_size); |
|
167 | + // no big images plz |
|
168 | + if (! in_array($image_size, array( 'large', 'post-thumbnail' ))) { |
|
169 | + $image_sizes[] = EE_Question_Option::new_instance(array( 'QSO_value' => $image_size, 'QSO_desc' => $image_size )); |
|
170 | + } |
|
171 | + } |
|
172 | + $image_sizes[] = EE_Question_Option::new_instance(array( 'QSO_value' => 'none', 'QSO_desc' => __('don\'t show images', 'event_espresso') )); |
|
173 | + } |
|
174 | + echo EEH_Form_Fields::select( |
|
175 | + __('Image Size:', 'event_espresso'), |
|
176 | + $instance['image_size'], |
|
177 | + $image_sizes, |
|
178 | + $this->get_field_name('image_size'), |
|
179 | + $this->get_field_id('image_size') |
|
180 | + ); |
|
181 | + ?> |
|
182 | 182 | |
183 | 183 | </p> |
184 | 184 | <p> |
@@ -186,42 +186,42 @@ discard block |
||
186 | 186 | <?php _e('Show Description:', 'event_espresso'); ?> |
187 | 187 | </label> |
188 | 188 | <?php |
189 | - echo EEH_Form_Fields::select( |
|
190 | - __('Show Description:', 'event_espresso'), |
|
191 | - $instance['show_desc'], |
|
192 | - $yes_no_values, |
|
193 | - $this->get_field_name('show_desc'), |
|
194 | - $this->get_field_id('show_desc') |
|
195 | - ); |
|
196 | - ?> |
|
189 | + echo EEH_Form_Fields::select( |
|
190 | + __('Show Description:', 'event_espresso'), |
|
191 | + $instance['show_desc'], |
|
192 | + $yes_no_values, |
|
193 | + $this->get_field_name('show_desc'), |
|
194 | + $this->get_field_id('show_desc') |
|
195 | + ); |
|
196 | + ?> |
|
197 | 197 | </p> |
198 | 198 | <p> |
199 | 199 | <label for="<?php echo $this->get_field_id('show_dates'); ?>"> |
200 | 200 | <?php _e('Show Dates:', 'event_espresso'); ?> |
201 | 201 | </label> |
202 | 202 | <?php |
203 | - echo EEH_Form_Fields::select( |
|
204 | - __('Show Dates:', 'event_espresso'), |
|
205 | - $instance['show_dates'], |
|
206 | - $yes_no_values, |
|
207 | - $this->get_field_name('show_dates'), |
|
208 | - $this->get_field_id('show_dates') |
|
209 | - ); |
|
210 | - ?> |
|
203 | + echo EEH_Form_Fields::select( |
|
204 | + __('Show Dates:', 'event_espresso'), |
|
205 | + $instance['show_dates'], |
|
206 | + $yes_no_values, |
|
207 | + $this->get_field_name('show_dates'), |
|
208 | + $this->get_field_id('show_dates') |
|
209 | + ); |
|
210 | + ?> |
|
211 | 211 | </p> |
212 | 212 | <p> |
213 | 213 | <label for="<?php echo $this->get_field_id('show_everywhere'); ?>"> |
214 | 214 | <?php _e('Show on all Pages:', 'event_espresso'); ?> |
215 | 215 | </label> |
216 | 216 | <?php |
217 | - echo EEH_Form_Fields::select( |
|
218 | - __('Show on all Pages:', 'event_espresso'), |
|
219 | - $instance['show_everywhere'], |
|
220 | - $yes_no_values, |
|
221 | - $this->get_field_name('show_everywhere'), |
|
222 | - $this->get_field_id('show_everywhere') |
|
223 | - ); |
|
224 | - ?> |
|
217 | + echo EEH_Form_Fields::select( |
|
218 | + __('Show on all Pages:', 'event_espresso'), |
|
219 | + $instance['show_everywhere'], |
|
220 | + $yes_no_values, |
|
221 | + $this->get_field_name('show_everywhere'), |
|
222 | + $this->get_field_id('show_everywhere') |
|
223 | + ); |
|
224 | + ?> |
|
225 | 225 | </p> |
226 | 226 | <p> |
227 | 227 | <label for="<?php echo $this->get_field_id('date_limit'); ?>"> |
@@ -234,198 +234,198 @@ discard block |
||
234 | 234 | <?php _e('Show Date Range:', 'event_espresso'); ?> |
235 | 235 | </label> |
236 | 236 | <?php |
237 | - echo EEH_Form_Fields::select( |
|
238 | - __('Show Date Range:', 'event_espresso'), |
|
239 | - $instance['date_range'], |
|
240 | - $yes_no_values, |
|
241 | - $this->get_field_name('date_range'), |
|
242 | - $this->get_field_id('date_range') |
|
243 | - ); |
|
244 | - ?><span class="description"><br /><?php _e('This setting will replace the list of dates in the widget.', 'event_espresso'); ?></span> |
|
237 | + echo EEH_Form_Fields::select( |
|
238 | + __('Show Date Range:', 'event_espresso'), |
|
239 | + $instance['date_range'], |
|
240 | + $yes_no_values, |
|
241 | + $this->get_field_name('date_range'), |
|
242 | + $this->get_field_id('date_range') |
|
243 | + ); |
|
244 | + ?><span class="description"><br /><?php _e('This setting will replace the list of dates in the widget.', 'event_espresso'); ?></span> |
|
245 | 245 | </p> |
246 | 246 | |
247 | 247 | <?php |
248 | - } |
|
248 | + } |
|
249 | 249 | |
250 | 250 | |
251 | 251 | |
252 | - /** |
|
253 | - * Sanitize widget form values as they are saved. |
|
254 | - * |
|
255 | - * @see WP_Widget::update() |
|
256 | - * |
|
257 | - * @param array $new_instance Values just sent to be saved. |
|
258 | - * @param array $old_instance Previously saved values from database. |
|
259 | - * |
|
260 | - * @return array Updated safe values to be saved. |
|
261 | - */ |
|
262 | - public function update($new_instance, $old_instance) |
|
263 | - { |
|
264 | - $instance = $old_instance; |
|
265 | - $instance['title'] = ! empty($new_instance['title']) ? strip_tags($new_instance['title']) : ''; |
|
266 | - $instance['category_name'] = $new_instance['category_name']; |
|
267 | - $instance['show_expired'] = $new_instance['show_expired']; |
|
268 | - $instance['limit'] = $new_instance['limit']; |
|
269 | - $instance['sort'] = $new_instance['sort']; |
|
270 | - $instance['image_size'] = $new_instance['image_size']; |
|
271 | - $instance['show_desc'] = $new_instance['show_desc']; |
|
272 | - $instance['show_dates'] = $new_instance['show_dates']; |
|
273 | - $instance['show_everywhere'] = $new_instance['show_everywhere']; |
|
274 | - $instance['date_limit'] = $new_instance['date_limit']; |
|
275 | - $instance['date_range'] = $new_instance['date_range']; |
|
276 | - return $instance; |
|
277 | - } |
|
252 | + /** |
|
253 | + * Sanitize widget form values as they are saved. |
|
254 | + * |
|
255 | + * @see WP_Widget::update() |
|
256 | + * |
|
257 | + * @param array $new_instance Values just sent to be saved. |
|
258 | + * @param array $old_instance Previously saved values from database. |
|
259 | + * |
|
260 | + * @return array Updated safe values to be saved. |
|
261 | + */ |
|
262 | + public function update($new_instance, $old_instance) |
|
263 | + { |
|
264 | + $instance = $old_instance; |
|
265 | + $instance['title'] = ! empty($new_instance['title']) ? strip_tags($new_instance['title']) : ''; |
|
266 | + $instance['category_name'] = $new_instance['category_name']; |
|
267 | + $instance['show_expired'] = $new_instance['show_expired']; |
|
268 | + $instance['limit'] = $new_instance['limit']; |
|
269 | + $instance['sort'] = $new_instance['sort']; |
|
270 | + $instance['image_size'] = $new_instance['image_size']; |
|
271 | + $instance['show_desc'] = $new_instance['show_desc']; |
|
272 | + $instance['show_dates'] = $new_instance['show_dates']; |
|
273 | + $instance['show_everywhere'] = $new_instance['show_everywhere']; |
|
274 | + $instance['date_limit'] = $new_instance['date_limit']; |
|
275 | + $instance['date_range'] = $new_instance['date_range']; |
|
276 | + return $instance; |
|
277 | + } |
|
278 | 278 | |
279 | 279 | |
280 | 280 | |
281 | - /** |
|
282 | - * Front-end display of widget. |
|
283 | - * |
|
284 | - * @see WP_Widget::widget() |
|
285 | - * |
|
286 | - * @param array $args Widget arguments. |
|
287 | - * @param array $instance Saved values from database. |
|
288 | - */ |
|
289 | - public function widget($args, $instance) |
|
290 | - { |
|
281 | + /** |
|
282 | + * Front-end display of widget. |
|
283 | + * |
|
284 | + * @see WP_Widget::widget() |
|
285 | + * |
|
286 | + * @param array $args Widget arguments. |
|
287 | + * @param array $instance Saved values from database. |
|
288 | + */ |
|
289 | + public function widget($args, $instance) |
|
290 | + { |
|
291 | 291 | |
292 | - global $post; |
|
293 | - // make sure there is some kinda post object |
|
294 | - if ($post instanceof WP_Post) { |
|
295 | - $before_widget = ''; |
|
296 | - $before_title = ''; |
|
297 | - $after_title = ''; |
|
298 | - $after_widget = ''; |
|
299 | - // but NOT an events archives page, cuz that would be like two event lists on the same page |
|
300 | - $show_everywhere = isset($instance['show_everywhere']) ? (bool) absint($instance['show_everywhere']) : true; |
|
301 | - if ($show_everywhere || ! ( $post->post_type == 'espresso_events' && is_archive() )) { |
|
302 | - // let's use some of the event helper functions' |
|
303 | - // make separate vars out of attributes |
|
292 | + global $post; |
|
293 | + // make sure there is some kinda post object |
|
294 | + if ($post instanceof WP_Post) { |
|
295 | + $before_widget = ''; |
|
296 | + $before_title = ''; |
|
297 | + $after_title = ''; |
|
298 | + $after_widget = ''; |
|
299 | + // but NOT an events archives page, cuz that would be like two event lists on the same page |
|
300 | + $show_everywhere = isset($instance['show_everywhere']) ? (bool) absint($instance['show_everywhere']) : true; |
|
301 | + if ($show_everywhere || ! ( $post->post_type == 'espresso_events' && is_archive() )) { |
|
302 | + // let's use some of the event helper functions' |
|
303 | + // make separate vars out of attributes |
|
304 | 304 | |
305 | 305 | |
306 | - extract($args); |
|
306 | + extract($args); |
|
307 | 307 | |
308 | - // add function to make the title a link |
|
309 | - add_filter('widget_title', array($this, 'make_the_title_a_link'), 15); |
|
308 | + // add function to make the title a link |
|
309 | + add_filter('widget_title', array($this, 'make_the_title_a_link'), 15); |
|
310 | 310 | |
311 | - $title = isset($instance['title']) && ! empty($instance['title']) ? $instance['title'] : ''; |
|
312 | - // filter the title |
|
313 | - $title = apply_filters('widget_title', $title); |
|
311 | + $title = isset($instance['title']) && ! empty($instance['title']) ? $instance['title'] : ''; |
|
312 | + // filter the title |
|
313 | + $title = apply_filters('widget_title', $title); |
|
314 | 314 | |
315 | - // remove the function from the filter, so it does not affect other widgets |
|
316 | - remove_filter('widget_title', array($this, 'make_the_title_a_link'), 15); |
|
315 | + // remove the function from the filter, so it does not affect other widgets |
|
316 | + remove_filter('widget_title', array($this, 'make_the_title_a_link'), 15); |
|
317 | 317 | |
318 | - // Before widget (defined by themes). |
|
319 | - echo $before_widget; |
|
320 | - // Display the widget title if one was input (before and after defined by themes). |
|
321 | - if (! empty($title)) { |
|
322 | - echo $before_title . $title . $after_title; |
|
323 | - } |
|
324 | - // grab widget settings |
|
325 | - $category = isset($instance['category_name']) && ! empty($instance['category_name']) ? $instance['category_name'] : false; |
|
326 | - $show_expired = isset($instance['show_expired']) ? absint($instance['show_expired']) : 0; |
|
327 | - $image_size = isset($instance['image_size']) && ! empty($instance['image_size']) ? $instance['image_size'] : 'medium'; |
|
328 | - $show_desc = isset($instance['show_desc']) ? (bool) absint($instance['show_desc']) : true; |
|
329 | - $show_dates = isset($instance['show_dates']) ? (bool) absint($instance['show_dates']) : true; |
|
330 | - $date_limit = isset($instance['date_limit']) && ! empty($instance['date_limit']) ? $instance['date_limit'] : null; |
|
331 | - $date_range = isset($instance['date_range']) && ! empty($instance['date_range']) ? $instance['date_range'] : false; |
|
332 | - // start to build our where clause |
|
333 | - $where = array( |
|
318 | + // Before widget (defined by themes). |
|
319 | + echo $before_widget; |
|
320 | + // Display the widget title if one was input (before and after defined by themes). |
|
321 | + if (! empty($title)) { |
|
322 | + echo $before_title . $title . $after_title; |
|
323 | + } |
|
324 | + // grab widget settings |
|
325 | + $category = isset($instance['category_name']) && ! empty($instance['category_name']) ? $instance['category_name'] : false; |
|
326 | + $show_expired = isset($instance['show_expired']) ? absint($instance['show_expired']) : 0; |
|
327 | + $image_size = isset($instance['image_size']) && ! empty($instance['image_size']) ? $instance['image_size'] : 'medium'; |
|
328 | + $show_desc = isset($instance['show_desc']) ? (bool) absint($instance['show_desc']) : true; |
|
329 | + $show_dates = isset($instance['show_dates']) ? (bool) absint($instance['show_dates']) : true; |
|
330 | + $date_limit = isset($instance['date_limit']) && ! empty($instance['date_limit']) ? $instance['date_limit'] : null; |
|
331 | + $date_range = isset($instance['date_range']) && ! empty($instance['date_range']) ? $instance['date_range'] : false; |
|
332 | + // start to build our where clause |
|
333 | + $where = array( |
|
334 | 334 | // 'Datetime.DTT_is_primary' => 1, |
335 | - 'status' => array( 'IN', array( 'publish', 'sold_out' ) ) |
|
336 | - ); |
|
337 | - // add category |
|
338 | - if ($category) { |
|
339 | - $where['Term_Taxonomy.taxonomy'] = 'espresso_event_categories'; |
|
340 | - $where['Term_Taxonomy.Term.slug'] = $category; |
|
341 | - } |
|
342 | - // if NOT expired then we want events that start today or in the future |
|
343 | - // if NOT show expired then we want events that start today or in the future |
|
344 | - if ($show_expired == 0) { |
|
345 | - $where['Datetime.DTT_EVT_end'] = array( '>=', EEM_Datetime::instance()->current_time_for_query('DTT_EVT_end') ); |
|
346 | - } |
|
347 | - // if show ONLY expired we want events that ended prior to today |
|
348 | - if ($show_expired == 2) { |
|
349 | - $where['Datetime.DTT_EVT_end'] = array( '<=', EEM_Datetime::instance()->current_time_for_query('DTT_EVT_start') ); |
|
350 | - } |
|
351 | - // allow $where to be filtered |
|
352 | - $where = apply_filters('FHEE__EEW_Upcoming_Events__widget__where', $where, $category, $show_expired); |
|
353 | - // run the query |
|
354 | - $events = EE_Registry::instance()->load_model('Event')->get_all(array( |
|
355 | - $where, |
|
356 | - 'limit' => isset($instance['limit']) && $instance['limit'] > 0 |
|
357 | - ? '0,' . $instance['limit'] |
|
358 | - : '0,10', |
|
359 | - 'order_by' => 'Datetime.DTT_EVT_start', |
|
360 | - 'order' => isset($instance['sort']) ? $instance['sort'] : 'ASC', |
|
361 | - 'group_by' => 'EVT_ID' |
|
362 | - )); |
|
335 | + 'status' => array( 'IN', array( 'publish', 'sold_out' ) ) |
|
336 | + ); |
|
337 | + // add category |
|
338 | + if ($category) { |
|
339 | + $where['Term_Taxonomy.taxonomy'] = 'espresso_event_categories'; |
|
340 | + $where['Term_Taxonomy.Term.slug'] = $category; |
|
341 | + } |
|
342 | + // if NOT expired then we want events that start today or in the future |
|
343 | + // if NOT show expired then we want events that start today or in the future |
|
344 | + if ($show_expired == 0) { |
|
345 | + $where['Datetime.DTT_EVT_end'] = array( '>=', EEM_Datetime::instance()->current_time_for_query('DTT_EVT_end') ); |
|
346 | + } |
|
347 | + // if show ONLY expired we want events that ended prior to today |
|
348 | + if ($show_expired == 2) { |
|
349 | + $where['Datetime.DTT_EVT_end'] = array( '<=', EEM_Datetime::instance()->current_time_for_query('DTT_EVT_start') ); |
|
350 | + } |
|
351 | + // allow $where to be filtered |
|
352 | + $where = apply_filters('FHEE__EEW_Upcoming_Events__widget__where', $where, $category, $show_expired); |
|
353 | + // run the query |
|
354 | + $events = EE_Registry::instance()->load_model('Event')->get_all(array( |
|
355 | + $where, |
|
356 | + 'limit' => isset($instance['limit']) && $instance['limit'] > 0 |
|
357 | + ? '0,' . $instance['limit'] |
|
358 | + : '0,10', |
|
359 | + 'order_by' => 'Datetime.DTT_EVT_start', |
|
360 | + 'order' => isset($instance['sort']) ? $instance['sort'] : 'ASC', |
|
361 | + 'group_by' => 'EVT_ID' |
|
362 | + )); |
|
363 | 363 | |
364 | - if (! empty($events)) { |
|
365 | - echo '<ul class="ee-upcoming-events-widget-ul">'; |
|
366 | - foreach ($events as $event) { |
|
367 | - if ($event instanceof EE_Event && ( !is_single() || $post->ID != $event->ID() )) { |
|
368 | - // printr( $event, '$event <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span>', 'auto' ); |
|
369 | - echo '<li id="ee-upcoming-events-widget-li-' . $event->ID() . '" class="ee-upcoming-events-widget-li">'; |
|
370 | - // how big is the event name ? |
|
371 | - $name_length = strlen($event->name()); |
|
372 | - switch ($name_length) { |
|
373 | - case $name_length > 70: |
|
374 | - $len_class = ' three-line'; |
|
375 | - break; |
|
376 | - case $name_length > 35: |
|
377 | - $len_class = ' two-line'; |
|
378 | - break; |
|
379 | - default: |
|
380 | - $len_class = ' one-line'; |
|
381 | - } |
|
382 | - $event_url = apply_filters('FHEE_EEW_Upcoming_Events__widget__event_url', $event->get_permalink(), $event); |
|
383 | - echo '<h5 class="ee-upcoming-events-widget-title-h5"><a class="ee-widget-event-name-a' . $len_class . '" href="' . $event_url . '">' . $event->name() . '</a></h5>'; |
|
384 | - if (post_password_required($event->ID())) { |
|
385 | - $pswd_form = apply_filters('FHEE_EEW_Upcoming_Events__widget__password_form', get_the_password_form($event->ID()), $event); |
|
386 | - echo $pswd_form; |
|
387 | - } else { |
|
388 | - if (has_post_thumbnail($event->ID()) && $image_size != 'none') { |
|
389 | - echo '<div class="ee-upcoming-events-widget-img-dv"><a class="ee-upcoming-events-widget-img" href="' . $event_url . '">' . get_the_post_thumbnail($event->ID(), $image_size) . '</a></div>'; |
|
390 | - } |
|
391 | - $desc = $event->short_description(25); |
|
392 | - if ($show_dates) { |
|
393 | - $date_format = apply_filters('FHEE__espresso_event_date_range__date_format', get_option('date_format')); |
|
394 | - $time_format = apply_filters('FHEE__espresso_event_date_range__time_format', get_option('time_format')); |
|
395 | - $single_date_format = apply_filters('FHEE__espresso_event_date_range__single_date_format', get_option('date_format')); |
|
396 | - $single_time_format = apply_filters('FHEE__espresso_event_date_range__single_time_format', get_option('time_format')); |
|
397 | - if ($date_range == true) { |
|
398 | - echo espresso_event_date_range($date_format, $time_format, $single_date_format, $single_time_format, $event->ID()); |
|
399 | - } else { |
|
400 | - echo espresso_list_of_event_dates($event->ID(), $date_format, $time_format, false, null, true, true, $date_limit); |
|
401 | - } |
|
402 | - } |
|
403 | - if ($show_desc && $desc) { |
|
404 | - echo '<p style="margin-top: .5em">' . $desc . '</p>'; |
|
405 | - } |
|
406 | - } |
|
407 | - echo '</li>'; |
|
408 | - } |
|
409 | - } |
|
410 | - echo '</ul>'; |
|
411 | - } |
|
412 | - // After widget (defined by themes). |
|
413 | - echo $after_widget; |
|
414 | - } |
|
415 | - } |
|
416 | - } |
|
364 | + if (! empty($events)) { |
|
365 | + echo '<ul class="ee-upcoming-events-widget-ul">'; |
|
366 | + foreach ($events as $event) { |
|
367 | + if ($event instanceof EE_Event && ( !is_single() || $post->ID != $event->ID() )) { |
|
368 | + // printr( $event, '$event <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span>', 'auto' ); |
|
369 | + echo '<li id="ee-upcoming-events-widget-li-' . $event->ID() . '" class="ee-upcoming-events-widget-li">'; |
|
370 | + // how big is the event name ? |
|
371 | + $name_length = strlen($event->name()); |
|
372 | + switch ($name_length) { |
|
373 | + case $name_length > 70: |
|
374 | + $len_class = ' three-line'; |
|
375 | + break; |
|
376 | + case $name_length > 35: |
|
377 | + $len_class = ' two-line'; |
|
378 | + break; |
|
379 | + default: |
|
380 | + $len_class = ' one-line'; |
|
381 | + } |
|
382 | + $event_url = apply_filters('FHEE_EEW_Upcoming_Events__widget__event_url', $event->get_permalink(), $event); |
|
383 | + echo '<h5 class="ee-upcoming-events-widget-title-h5"><a class="ee-widget-event-name-a' . $len_class . '" href="' . $event_url . '">' . $event->name() . '</a></h5>'; |
|
384 | + if (post_password_required($event->ID())) { |
|
385 | + $pswd_form = apply_filters('FHEE_EEW_Upcoming_Events__widget__password_form', get_the_password_form($event->ID()), $event); |
|
386 | + echo $pswd_form; |
|
387 | + } else { |
|
388 | + if (has_post_thumbnail($event->ID()) && $image_size != 'none') { |
|
389 | + echo '<div class="ee-upcoming-events-widget-img-dv"><a class="ee-upcoming-events-widget-img" href="' . $event_url . '">' . get_the_post_thumbnail($event->ID(), $image_size) . '</a></div>'; |
|
390 | + } |
|
391 | + $desc = $event->short_description(25); |
|
392 | + if ($show_dates) { |
|
393 | + $date_format = apply_filters('FHEE__espresso_event_date_range__date_format', get_option('date_format')); |
|
394 | + $time_format = apply_filters('FHEE__espresso_event_date_range__time_format', get_option('time_format')); |
|
395 | + $single_date_format = apply_filters('FHEE__espresso_event_date_range__single_date_format', get_option('date_format')); |
|
396 | + $single_time_format = apply_filters('FHEE__espresso_event_date_range__single_time_format', get_option('time_format')); |
|
397 | + if ($date_range == true) { |
|
398 | + echo espresso_event_date_range($date_format, $time_format, $single_date_format, $single_time_format, $event->ID()); |
|
399 | + } else { |
|
400 | + echo espresso_list_of_event_dates($event->ID(), $date_format, $time_format, false, null, true, true, $date_limit); |
|
401 | + } |
|
402 | + } |
|
403 | + if ($show_desc && $desc) { |
|
404 | + echo '<p style="margin-top: .5em">' . $desc . '</p>'; |
|
405 | + } |
|
406 | + } |
|
407 | + echo '</li>'; |
|
408 | + } |
|
409 | + } |
|
410 | + echo '</ul>'; |
|
411 | + } |
|
412 | + // After widget (defined by themes). |
|
413 | + echo $after_widget; |
|
414 | + } |
|
415 | + } |
|
416 | + } |
|
417 | 417 | |
418 | 418 | |
419 | 419 | |
420 | - /** |
|
421 | - * make_the_title_a_link |
|
422 | - * callback for widget_title filter |
|
423 | - * |
|
424 | - * @param $title |
|
425 | - * @return string |
|
426 | - */ |
|
427 | - public function make_the_title_a_link($title) |
|
428 | - { |
|
429 | - return '<a href="' . EEH_Event_View::event_archive_url() . '">' . $title . '</a>'; |
|
430 | - } |
|
420 | + /** |
|
421 | + * make_the_title_a_link |
|
422 | + * callback for widget_title filter |
|
423 | + * |
|
424 | + * @param $title |
|
425 | + * @return string |
|
426 | + */ |
|
427 | + public function make_the_title_a_link($title) |
|
428 | + { |
|
429 | + return '<a href="' . EEH_Event_View::event_archive_url() . '">' . $title . '</a>'; |
|
430 | + } |
|
431 | 431 | } |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | { |
36 | 36 | parent::__construct( |
37 | 37 | __('Event Espresso Upcoming Events', 'event_espresso'), |
38 | - array( 'description' => __('A widget to display your upcoming events.', 'event_espresso')) |
|
38 | + array('description' => __('A widget to display your upcoming events.', 'event_espresso')) |
|
39 | 39 | ); |
40 | 40 | } |
41 | 41 | |
@@ -71,12 +71,12 @@ discard block |
||
71 | 71 | // don't add HTML labels for EE_Form_Fields generated inputs |
72 | 72 | add_filter('FHEE__EEH_Form_Fields__label_html', '__return_empty_string'); |
73 | 73 | $yes_no_values = array( |
74 | - EE_Question_Option::new_instance(array( 'QSO_value' => false, 'QSO_desc' => __('No', 'event_espresso'))), |
|
75 | - EE_Question_Option::new_instance(array( 'QSO_value' => true, 'QSO_desc' => __('Yes', 'event_espresso'))) |
|
74 | + EE_Question_Option::new_instance(array('QSO_value' => false, 'QSO_desc' => __('No', 'event_espresso'))), |
|
75 | + EE_Question_Option::new_instance(array('QSO_value' => true, 'QSO_desc' => __('Yes', 'event_espresso'))) |
|
76 | 76 | ); |
77 | 77 | $sort_values = array( |
78 | - EE_Question_Option::new_instance(array( 'QSO_value' => 'ASC', 'QSO_desc' => __('ASC', 'event_espresso'))), |
|
79 | - EE_Question_Option::new_instance(array( 'QSO_value' => 'DESC', 'QSO_desc' => __('DESC', 'event_espresso'))) |
|
78 | + EE_Question_Option::new_instance(array('QSO_value' => 'ASC', 'QSO_desc' => __('ASC', 'event_espresso'))), |
|
79 | + EE_Question_Option::new_instance(array('QSO_value' => 'DESC', 'QSO_desc' => __('DESC', 'event_espresso'))) |
|
80 | 80 | ); |
81 | 81 | |
82 | 82 | ?> |
@@ -101,11 +101,11 @@ discard block |
||
101 | 101 | if ($categories) { |
102 | 102 | foreach ($categories as $category) { |
103 | 103 | if ($category instanceof EE_Term) { |
104 | - $event_categories[] = EE_Question_Option::new_instance(array( 'QSO_value' => $category->get('slug'), 'QSO_desc' => $category->get('name'))); |
|
104 | + $event_categories[] = EE_Question_Option::new_instance(array('QSO_value' => $category->get('slug'), 'QSO_desc' => $category->get('name'))); |
|
105 | 105 | } |
106 | 106 | } |
107 | 107 | } |
108 | - array_unshift($event_categories, EE_Question_Option::new_instance(array( 'QSO_value' => '', 'QSO_desc' => __(' - display all - ', 'event_espresso')))); |
|
108 | + array_unshift($event_categories, EE_Question_Option::new_instance(array('QSO_value' => '', 'QSO_desc' => __(' - display all - ', 'event_espresso')))); |
|
109 | 109 | echo EEH_Form_Fields::select( |
110 | 110 | __('Event Category:', 'event_espresso'), |
111 | 111 | $instance['category_name'], |
@@ -130,9 +130,9 @@ discard block |
||
130 | 130 | __('Show Expired Events:', 'event_espresso'), |
131 | 131 | $instance['show_expired'], |
132 | 132 | array( |
133 | - EE_Question_Option::new_instance(array( 'QSO_value' => 0, 'QSO_desc' => __('No', 'event_espresso'))), |
|
134 | - EE_Question_Option::new_instance(array( 'QSO_value' => 1, 'QSO_desc' => __('Yes', 'event_espresso'))), |
|
135 | - EE_Question_Option::new_instance(array( 'QSO_value' => 2, 'QSO_desc' => __('Show Only Expired', 'event_espresso'))), |
|
133 | + EE_Question_Option::new_instance(array('QSO_value' => 0, 'QSO_desc' => __('No', 'event_espresso'))), |
|
134 | + EE_Question_Option::new_instance(array('QSO_value' => 1, 'QSO_desc' => __('Yes', 'event_espresso'))), |
|
135 | + EE_Question_Option::new_instance(array('QSO_value' => 2, 'QSO_desc' => __('Show Only Expired', 'event_espresso'))), |
|
136 | 136 | ), |
137 | 137 | $this->get_field_name('show_expired'), |
138 | 138 | $this->get_field_id('show_expired') |
@@ -165,11 +165,11 @@ discard block |
||
165 | 165 | foreach ($sizes as $image_size) { |
166 | 166 | $image_size = trim($image_size); |
167 | 167 | // no big images plz |
168 | - if (! in_array($image_size, array( 'large', 'post-thumbnail' ))) { |
|
169 | - $image_sizes[] = EE_Question_Option::new_instance(array( 'QSO_value' => $image_size, 'QSO_desc' => $image_size )); |
|
168 | + if ( ! in_array($image_size, array('large', 'post-thumbnail'))) { |
|
169 | + $image_sizes[] = EE_Question_Option::new_instance(array('QSO_value' => $image_size, 'QSO_desc' => $image_size)); |
|
170 | 170 | } |
171 | 171 | } |
172 | - $image_sizes[] = EE_Question_Option::new_instance(array( 'QSO_value' => 'none', 'QSO_desc' => __('don\'t show images', 'event_espresso') )); |
|
172 | + $image_sizes[] = EE_Question_Option::new_instance(array('QSO_value' => 'none', 'QSO_desc' => __('don\'t show images', 'event_espresso'))); |
|
173 | 173 | } |
174 | 174 | echo EEH_Form_Fields::select( |
175 | 175 | __('Image Size:', 'event_espresso'), |
@@ -298,7 +298,7 @@ discard block |
||
298 | 298 | $after_widget = ''; |
299 | 299 | // but NOT an events archives page, cuz that would be like two event lists on the same page |
300 | 300 | $show_everywhere = isset($instance['show_everywhere']) ? (bool) absint($instance['show_everywhere']) : true; |
301 | - if ($show_everywhere || ! ( $post->post_type == 'espresso_events' && is_archive() )) { |
|
301 | + if ($show_everywhere || ! ($post->post_type == 'espresso_events' && is_archive())) { |
|
302 | 302 | // let's use some of the event helper functions' |
303 | 303 | // make separate vars out of attributes |
304 | 304 | |
@@ -318,8 +318,8 @@ discard block |
||
318 | 318 | // Before widget (defined by themes). |
319 | 319 | echo $before_widget; |
320 | 320 | // Display the widget title if one was input (before and after defined by themes). |
321 | - if (! empty($title)) { |
|
322 | - echo $before_title . $title . $after_title; |
|
321 | + if ( ! empty($title)) { |
|
322 | + echo $before_title.$title.$after_title; |
|
323 | 323 | } |
324 | 324 | // grab widget settings |
325 | 325 | $category = isset($instance['category_name']) && ! empty($instance['category_name']) ? $instance['category_name'] : false; |
@@ -332,7 +332,7 @@ discard block |
||
332 | 332 | // start to build our where clause |
333 | 333 | $where = array( |
334 | 334 | // 'Datetime.DTT_is_primary' => 1, |
335 | - 'status' => array( 'IN', array( 'publish', 'sold_out' ) ) |
|
335 | + 'status' => array('IN', array('publish', 'sold_out')) |
|
336 | 336 | ); |
337 | 337 | // add category |
338 | 338 | if ($category) { |
@@ -342,11 +342,11 @@ discard block |
||
342 | 342 | // if NOT expired then we want events that start today or in the future |
343 | 343 | // if NOT show expired then we want events that start today or in the future |
344 | 344 | if ($show_expired == 0) { |
345 | - $where['Datetime.DTT_EVT_end'] = array( '>=', EEM_Datetime::instance()->current_time_for_query('DTT_EVT_end') ); |
|
345 | + $where['Datetime.DTT_EVT_end'] = array('>=', EEM_Datetime::instance()->current_time_for_query('DTT_EVT_end')); |
|
346 | 346 | } |
347 | 347 | // if show ONLY expired we want events that ended prior to today |
348 | 348 | if ($show_expired == 2) { |
349 | - $where['Datetime.DTT_EVT_end'] = array( '<=', EEM_Datetime::instance()->current_time_for_query('DTT_EVT_start') ); |
|
349 | + $where['Datetime.DTT_EVT_end'] = array('<=', EEM_Datetime::instance()->current_time_for_query('DTT_EVT_start')); |
|
350 | 350 | } |
351 | 351 | // allow $where to be filtered |
352 | 352 | $where = apply_filters('FHEE__EEW_Upcoming_Events__widget__where', $where, $category, $show_expired); |
@@ -354,39 +354,39 @@ discard block |
||
354 | 354 | $events = EE_Registry::instance()->load_model('Event')->get_all(array( |
355 | 355 | $where, |
356 | 356 | 'limit' => isset($instance['limit']) && $instance['limit'] > 0 |
357 | - ? '0,' . $instance['limit'] |
|
357 | + ? '0,'.$instance['limit'] |
|
358 | 358 | : '0,10', |
359 | 359 | 'order_by' => 'Datetime.DTT_EVT_start', |
360 | 360 | 'order' => isset($instance['sort']) ? $instance['sort'] : 'ASC', |
361 | 361 | 'group_by' => 'EVT_ID' |
362 | 362 | )); |
363 | 363 | |
364 | - if (! empty($events)) { |
|
364 | + if ( ! empty($events)) { |
|
365 | 365 | echo '<ul class="ee-upcoming-events-widget-ul">'; |
366 | 366 | foreach ($events as $event) { |
367 | - if ($event instanceof EE_Event && ( !is_single() || $post->ID != $event->ID() )) { |
|
367 | + if ($event instanceof EE_Event && ( ! is_single() || $post->ID != $event->ID())) { |
|
368 | 368 | // printr( $event, '$event <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span>', 'auto' ); |
369 | - echo '<li id="ee-upcoming-events-widget-li-' . $event->ID() . '" class="ee-upcoming-events-widget-li">'; |
|
369 | + echo '<li id="ee-upcoming-events-widget-li-'.$event->ID().'" class="ee-upcoming-events-widget-li">'; |
|
370 | 370 | // how big is the event name ? |
371 | 371 | $name_length = strlen($event->name()); |
372 | 372 | switch ($name_length) { |
373 | 373 | case $name_length > 70: |
374 | - $len_class = ' three-line'; |
|
374 | + $len_class = ' three-line'; |
|
375 | 375 | break; |
376 | 376 | case $name_length > 35: |
377 | - $len_class = ' two-line'; |
|
377 | + $len_class = ' two-line'; |
|
378 | 378 | break; |
379 | 379 | default: |
380 | - $len_class = ' one-line'; |
|
380 | + $len_class = ' one-line'; |
|
381 | 381 | } |
382 | 382 | $event_url = apply_filters('FHEE_EEW_Upcoming_Events__widget__event_url', $event->get_permalink(), $event); |
383 | - echo '<h5 class="ee-upcoming-events-widget-title-h5"><a class="ee-widget-event-name-a' . $len_class . '" href="' . $event_url . '">' . $event->name() . '</a></h5>'; |
|
383 | + echo '<h5 class="ee-upcoming-events-widget-title-h5"><a class="ee-widget-event-name-a'.$len_class.'" href="'.$event_url.'">'.$event->name().'</a></h5>'; |
|
384 | 384 | if (post_password_required($event->ID())) { |
385 | 385 | $pswd_form = apply_filters('FHEE_EEW_Upcoming_Events__widget__password_form', get_the_password_form($event->ID()), $event); |
386 | 386 | echo $pswd_form; |
387 | 387 | } else { |
388 | 388 | if (has_post_thumbnail($event->ID()) && $image_size != 'none') { |
389 | - echo '<div class="ee-upcoming-events-widget-img-dv"><a class="ee-upcoming-events-widget-img" href="' . $event_url . '">' . get_the_post_thumbnail($event->ID(), $image_size) . '</a></div>'; |
|
389 | + echo '<div class="ee-upcoming-events-widget-img-dv"><a class="ee-upcoming-events-widget-img" href="'.$event_url.'">'.get_the_post_thumbnail($event->ID(), $image_size).'</a></div>'; |
|
390 | 390 | } |
391 | 391 | $desc = $event->short_description(25); |
392 | 392 | if ($show_dates) { |
@@ -401,7 +401,7 @@ discard block |
||
401 | 401 | } |
402 | 402 | } |
403 | 403 | if ($show_desc && $desc) { |
404 | - echo '<p style="margin-top: .5em">' . $desc . '</p>'; |
|
404 | + echo '<p style="margin-top: .5em">'.$desc.'</p>'; |
|
405 | 405 | } |
406 | 406 | } |
407 | 407 | echo '</li>'; |
@@ -426,6 +426,6 @@ discard block |
||
426 | 426 | */ |
427 | 427 | public function make_the_title_a_link($title) |
428 | 428 | { |
429 | - return '<a href="' . EEH_Event_View::event_archive_url() . '">' . $title . '</a>'; |
|
429 | + return '<a href="'.EEH_Event_View::event_archive_url().'">'.$title.'</a>'; |
|
430 | 430 | } |
431 | 431 | } |
@@ -12,14 +12,14 @@ discard block |
||
12 | 12 | <input type="hidden" name="tkt-slctr-ticket-id-<?php echo $EVT_ID; ?>[]" value="<?php echo $TKT_ID; ?>"/> |
13 | 13 | <?php |
14 | 14 | if ($ticket instanceof EE_Ticket) { |
15 | - do_action('AHEE__ticket_selector_chart__template__before_ticket_selector', $event); |
|
16 | - $ticket_description .= ! empty($ticket_description) |
|
17 | - ? '<br />' . $ticket_status_display |
|
18 | - : $ticket_status_display; |
|
19 | - if (strpos($ticket_description, '<div') === false) { |
|
20 | - $ticket_description = "<p>{$ticket_description}</p>"; |
|
21 | - } |
|
22 | - ?> |
|
15 | + do_action('AHEE__ticket_selector_chart__template__before_ticket_selector', $event); |
|
16 | + $ticket_description .= ! empty($ticket_description) |
|
17 | + ? '<br />' . $ticket_status_display |
|
18 | + : $ticket_status_display; |
|
19 | + if (strpos($ticket_description, '<div') === false) { |
|
20 | + $ticket_description = "<p>{$ticket_description}</p>"; |
|
21 | + } |
|
22 | + ?> |
|
23 | 23 | <div id="no-tkt-slctr-ticket-dv-<?php echo $EVT_ID; ?>" class="no-tkt-slctr-ticket-dv"> |
24 | 24 | <div class="no-tkt-slctr-ticket-content-dv"> |
25 | 25 | <h5><?php echo $ticket->name(); ?></h5> |
@@ -28,5 +28,5 @@ discard block |
||
28 | 28 | <?php } ?> |
29 | 29 | </div><!-- .no-tkt-slctr-ticket-content-dv --> |
30 | 30 | <?php |
31 | - do_action('AHEE__ticket_selector_chart__template__after_ticket_selector', $EVT_ID, $event); |
|
31 | + do_action('AHEE__ticket_selector_chart__template__after_ticket_selector', $EVT_ID, $event); |
|
32 | 32 | } |
@@ -22,32 +22,32 @@ discard block |
||
22 | 22 | <p><?php echo $ticket->description(); ?></p> |
23 | 23 | |
24 | 24 | <?php |
25 | - do_action( |
|
26 | - 'AHEE__ticket_selector_chart_template__ticket_details__after_description', |
|
27 | - $ticket, |
|
28 | - $ticket_price, |
|
29 | - $display_ticket_price |
|
30 | - ); |
|
31 | - ?> |
|
25 | + do_action( |
|
26 | + 'AHEE__ticket_selector_chart_template__ticket_details__after_description', |
|
27 | + $ticket, |
|
28 | + $ticket_price, |
|
29 | + $display_ticket_price |
|
30 | + ); |
|
31 | + ?> |
|
32 | 32 | |
33 | 33 | <section class="tckt-slctr-tkt-sale-dates-sctn"> |
34 | 34 | <h5> |
35 | 35 | <?php echo apply_filters( |
36 | - 'FHEE__ticket_selector_chart_template__ticket_details_sales_date_heading', |
|
37 | - esc_html__('Sale Dates', 'event_espresso') |
|
38 | - ); ?> |
|
36 | + 'FHEE__ticket_selector_chart_template__ticket_details_sales_date_heading', |
|
37 | + esc_html__('Sale Dates', 'event_espresso') |
|
38 | + ); ?> |
|
39 | 39 | </h5> |
40 | 40 | <span class="drk-grey-text small-text no-bold"> - |
41 | 41 | <?php echo apply_filters( |
42 | - 'FHEE__ticket_selector_chart_template__ticket_details_dates_available_message', |
|
43 | - esc_html__('The dates when this option is available for purchase.', 'event_espresso') |
|
44 | - ); ?></span> |
|
42 | + 'FHEE__ticket_selector_chart_template__ticket_details_dates_available_message', |
|
43 | + esc_html__('The dates when this option is available for purchase.', 'event_espresso') |
|
44 | + ); ?></span> |
|
45 | 45 | <br/> |
46 | 46 | <span class="ticket-details-label-spn drk-grey-text"> |
47 | 47 | <?php echo apply_filters( |
48 | - 'FHEE__ticket_selector_chart_template__ticket_details_goes_on_sale', |
|
49 | - esc_html__('Goes On Sale:', 'event_espresso') |
|
50 | - ); ?></span> |
|
48 | + 'FHEE__ticket_selector_chart_template__ticket_details_goes_on_sale', |
|
49 | + esc_html__('Goes On Sale:', 'event_espresso') |
|
50 | + ); ?></span> |
|
51 | 51 | <span class="dashicons dashicons-calendar"></span> |
52 | 52 | <?php echo $ticket->get_i18n_datetime('TKT_start_date', $date_format) . ' '; ?> |
53 | 53 | <span class="dashicons dashicons-clock"></span> |
@@ -55,9 +55,9 @@ discard block |
||
55 | 55 | <br/> |
56 | 56 | <span class="ticket-details-label-spn drk-grey-text"> |
57 | 57 | <?php echo apply_filters( |
58 | - 'FHEE__ticket_selector_chart_template__ticket_details_sales_end', |
|
59 | - esc_html__('Sales End:', 'event_espresso') |
|
60 | - ); ?></span> |
|
58 | + 'FHEE__ticket_selector_chart_template__ticket_details_sales_end', |
|
59 | + esc_html__('Sales End:', 'event_espresso') |
|
60 | + ); ?></span> |
|
61 | 61 | <span class="dashicons dashicons-calendar"></span> |
62 | 62 | <?php echo $ticket->get_i18n_datetime('TKT_end_date', $date_format) . ' '; ?> |
63 | 63 | <span class="dashicons dashicons-clock"></span> |
@@ -72,46 +72,46 @@ discard block |
||
72 | 72 | <section class="tckt-slctr-tkt-quantities-sctn"> |
73 | 73 | <h5> |
74 | 74 | <?php echo apply_filters( |
75 | - 'FHEE__ticket_selector_chart_template__ticket_details_purchasable_quantities_heading', |
|
76 | - esc_html__('Purchasable Quantities', 'event_espresso') |
|
77 | - ); ?></h5> |
|
75 | + 'FHEE__ticket_selector_chart_template__ticket_details_purchasable_quantities_heading', |
|
76 | + esc_html__('Purchasable Quantities', 'event_espresso') |
|
77 | + ); ?></h5> |
|
78 | 78 | <span class="drk-grey-text small-text no-bold"> - |
79 | 79 | <?php echo apply_filters( |
80 | - 'FHEE__ticket_selector_chart_template__ticket_details_purchasable_quantities_message', |
|
81 | - esc_html__( |
|
82 | - 'The number of tickets that can be purchased per transaction (if available).', |
|
83 | - 'event_espresso' |
|
84 | - ) |
|
85 | - ); ?></span><br/> |
|
80 | + 'FHEE__ticket_selector_chart_template__ticket_details_purchasable_quantities_message', |
|
81 | + esc_html__( |
|
82 | + 'The number of tickets that can be purchased per transaction (if available).', |
|
83 | + 'event_espresso' |
|
84 | + ) |
|
85 | + ); ?></span><br/> |
|
86 | 86 | <span class="ticket-details-label-spn drk-grey-text"> |
87 | 87 | <?php echo apply_filters( |
88 | - 'FHEE__ticket_selector_chart_template__ticket_details_purchasable_quantities_min_qty', |
|
89 | - esc_html__('Minimum Qty:', 'event_espresso') |
|
90 | - ); ?></span><?php echo $ticket->min() > 0 ? $ticket->min() : 0; ?> |
|
88 | + 'FHEE__ticket_selector_chart_template__ticket_details_purchasable_quantities_min_qty', |
|
89 | + esc_html__('Minimum Qty:', 'event_espresso') |
|
90 | + ); ?></span><?php echo $ticket->min() > 0 ? $ticket->min() : 0; ?> |
|
91 | 91 | <?php |
92 | - if ($ticket->min() > $remaining) { |
|
93 | - ?> <span |
|
92 | + if ($ticket->min() > $remaining) { |
|
93 | + ?> <span |
|
94 | 94 | class="important-notice small-text"> |
95 | 95 | <?php echo apply_filters( |
96 | - 'FHEE__ticket_selector_chart_template__ticket_details_purchasable_quantities_min_qty_message', |
|
97 | - esc_html__( |
|
98 | - 'The Minimum Quantity purchasable for this ticket exceeds the number of spaces remaining', |
|
99 | - 'event_espresso' |
|
100 | - ) |
|
101 | - ); ?></span> |
|
96 | + 'FHEE__ticket_selector_chart_template__ticket_details_purchasable_quantities_min_qty_message', |
|
97 | + esc_html__( |
|
98 | + 'The Minimum Quantity purchasable for this ticket exceeds the number of spaces remaining', |
|
99 | + 'event_espresso' |
|
100 | + ) |
|
101 | + ); ?></span> |
|
102 | 102 | <?php |
103 | - } ?><br/> |
|
103 | + } ?><br/> |
|
104 | 104 | <?php // $max = min( $max, $max_atndz );?> |
105 | 105 | <span class="ticket-details-label-spn drk-grey-text"> |
106 | 106 | <?php echo apply_filters( |
107 | - 'FHEE__ticket_selector_chart_template__ticket_details_purchasable_quantities_max_qty', |
|
108 | - esc_html__('Maximum Qty:', 'event_espresso') |
|
109 | - ); ?></span> |
|
107 | + 'FHEE__ticket_selector_chart_template__ticket_details_purchasable_quantities_max_qty', |
|
108 | + esc_html__('Maximum Qty:', 'event_espresso') |
|
109 | + ); ?></span> |
|
110 | 110 | <?php echo $ticket->max() === EE_INF ? esc_html__( |
111 | - 'no limit', |
|
112 | - 'event_espresso' |
|
113 | - ) |
|
114 | - : max($ticket->max(), 1); ?><br/> |
|
111 | + 'no limit', |
|
112 | + 'event_espresso' |
|
113 | + ) |
|
114 | + : max($ticket->max(), 1); ?><br/> |
|
115 | 115 | </section> |
116 | 116 | <br/> |
117 | 117 | <?php } ?> |
@@ -120,50 +120,50 @@ discard block |
||
120 | 120 | <section class="tckt-slctr-tkt-uses-sctn"> |
121 | 121 | <h5> |
122 | 122 | <?php echo apply_filters( |
123 | - 'FHEE__ticket_selector_chart_template__ticket_details_event_date_ticket_uses_heading', |
|
124 | - esc_html__('Event Date Ticket Uses', 'event_espresso') |
|
125 | - ); ?></h5> |
|
123 | + 'FHEE__ticket_selector_chart_template__ticket_details_event_date_ticket_uses_heading', |
|
124 | + esc_html__('Event Date Ticket Uses', 'event_espresso') |
|
125 | + ); ?></h5> |
|
126 | 126 | <span class="drk-grey-text small-text no-bold"> - |
127 | 127 | <?php |
128 | - echo apply_filters( |
|
129 | - 'FHEE__ticket_selector_chart_template__ticket_details_event_date_ticket_uses_message', |
|
130 | - sprintf( |
|
131 | - esc_html__( |
|
132 | - 'The number of separate event datetimes (see table below) that this ticket can be used to gain admittance to.%1$s%2$sAdmission is always one person per ticket.%3$s', |
|
133 | - 'event_espresso' |
|
134 | - ), |
|
135 | - '<br/>', |
|
136 | - '<strong>', |
|
137 | - '</strong>' |
|
138 | - ) |
|
139 | - ); |
|
140 | - ?></span><br/> |
|
128 | + echo apply_filters( |
|
129 | + 'FHEE__ticket_selector_chart_template__ticket_details_event_date_ticket_uses_message', |
|
130 | + sprintf( |
|
131 | + esc_html__( |
|
132 | + 'The number of separate event datetimes (see table below) that this ticket can be used to gain admittance to.%1$s%2$sAdmission is always one person per ticket.%3$s', |
|
133 | + 'event_espresso' |
|
134 | + ), |
|
135 | + '<br/>', |
|
136 | + '<strong>', |
|
137 | + '</strong>' |
|
138 | + ) |
|
139 | + ); |
|
140 | + ?></span><br/> |
|
141 | 141 | <span class="ticket-details-label-spn drk-grey-text"> |
142 | 142 | <?php echo apply_filters( |
143 | - 'FHEE__ticket_selector_chart_template__ticket_details_event_date_number_datetimes', |
|
144 | - esc_html__('# Datetimes:', 'event_espresso') |
|
145 | - ); ?></span><?php echo $ticket->uses(); ?><br/> |
|
143 | + 'FHEE__ticket_selector_chart_template__ticket_details_event_date_number_datetimes', |
|
144 | + esc_html__('# Datetimes:', 'event_espresso') |
|
145 | + ); ?></span><?php echo $ticket->uses(); ?><br/> |
|
146 | 146 | </section> |
147 | 147 | <?php } ?> |
148 | 148 | |
149 | 149 | <?php |
150 | - $datetimes = $ticket->datetimes_ordered($event_is_expired, false); |
|
151 | - $chart_column_width = $show_ticket_sale_columns ? ' ee-fourth-width' : ' ee-half-width'; |
|
152 | - if (! empty($datetimes)) { ?> |
|
150 | + $datetimes = $ticket->datetimes_ordered($event_is_expired, false); |
|
151 | + $chart_column_width = $show_ticket_sale_columns ? ' ee-fourth-width' : ' ee-half-width'; |
|
152 | + if (! empty($datetimes)) { ?> |
|
153 | 153 | <section class="tckt-slctr-tkt-datetimes-sctn"> |
154 | 154 | <h5> |
155 | 155 | <?php echo apply_filters( |
156 | - 'FHEE__ticket_selector_chart_template__ticket_details_event_access_heading', |
|
157 | - esc_html__('Access', 'event_espresso') |
|
158 | - ); ?></h5> |
|
156 | + 'FHEE__ticket_selector_chart_template__ticket_details_event_access_heading', |
|
157 | + esc_html__('Access', 'event_espresso') |
|
158 | + ); ?></h5> |
|
159 | 159 | <span class="drk-grey-text small-text no-bold"> - |
160 | 160 | <?php echo apply_filters( |
161 | - 'FHEE__ticket_selector_chart_template__ticket_details_event_access_message', |
|
162 | - esc_html__( |
|
163 | - 'This option allows access to the following dates and times.', |
|
164 | - 'event_espresso' |
|
165 | - ) |
|
166 | - ); ?></span> |
|
161 | + 'FHEE__ticket_selector_chart_template__ticket_details_event_access_message', |
|
162 | + esc_html__( |
|
163 | + 'This option allows access to the following dates and times.', |
|
164 | + 'event_espresso' |
|
165 | + ) |
|
166 | + ); ?></span> |
|
167 | 167 | <div class="tckt-slctr-tkt-details-tbl-wrap-dv"> |
168 | 168 | <table class="tckt-slctr-tkt-details-tbl"> |
169 | 169 | <thead> |
@@ -172,122 +172,122 @@ discard block |
||
172 | 172 | <span class="dashicons dashicons-calendar"></span><span |
173 | 173 | class="small-text"> |
174 | 174 | <?php echo apply_filters( |
175 | - 'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_event_date', |
|
176 | - esc_html__('Date ', 'event_espresso') |
|
177 | - ); ?></span> |
|
175 | + 'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_event_date', |
|
176 | + esc_html__('Date ', 'event_espresso') |
|
177 | + ); ?></span> |
|
178 | 178 | </th> |
179 | 179 | <th class="tckt-slctr-tkt-details-time-th <?php echo $chart_column_width; ?>"> |
180 | 180 | <span class="dashicons dashicons-clock"></span><span |
181 | 181 | class="small-text"> |
182 | 182 | <?php esc_html_e( |
183 | - 'Time ', |
|
184 | - 'event_espresso' |
|
185 | - ); ?></span> |
|
183 | + 'Time ', |
|
184 | + 'event_espresso' |
|
185 | + ); ?></span> |
|
186 | 186 | </th> |
187 | 187 | <?php if ($show_ticket_sale_columns) : ?> |
188 | 188 | <th class="tckt-slctr-tkt-details-this-ticket-sold-th ee-fourth-width cntr"> |
189 | 189 | <span class="smaller-text"> |
190 | 190 | <?php echo apply_filters( |
191 | - 'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_this_ticket_sold', |
|
192 | - sprintf(esc_html__('Sold', 'event_espresso'), '<br/>') |
|
193 | - ); ?></span> |
|
191 | + 'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_this_ticket_sold', |
|
192 | + sprintf(esc_html__('Sold', 'event_espresso'), '<br/>') |
|
193 | + ); ?></span> |
|
194 | 194 | </th> |
195 | 195 | <th class="tckt-slctr-tkt-details-this-ticket-left-th ee-fourth-width cntr"> |
196 | 196 | <span class="smaller-text"> |
197 | 197 | <?php echo apply_filters( |
198 | - 'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_this_ticket_left', |
|
199 | - sprintf(esc_html__('Remaining', 'event_espresso'), '<br/>') |
|
200 | - ); ?></span> |
|
198 | + 'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_this_ticket_left', |
|
199 | + sprintf(esc_html__('Remaining', 'event_espresso'), '<br/>') |
|
200 | + ); ?></span> |
|
201 | 201 | </th> |
202 | 202 | <th |
203 | 203 | class="tckt-slctr-tkt-details-total-tickets-sold-th ee-fourth-width cntr"> |
204 | 204 | <span class="smaller-text"> |
205 | 205 | <?php echo apply_filters( |
206 | - 'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_total_ticket_sold', |
|
207 | - sprintf(esc_html__('Total%sSold', 'event_espresso'), '<br/>') |
|
208 | - ); ?></span> |
|
206 | + 'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_total_ticket_sold', |
|
207 | + sprintf(esc_html__('Total%sSold', 'event_espresso'), '<br/>') |
|
208 | + ); ?></span> |
|
209 | 209 | </th> |
210 | 210 | <th |
211 | 211 | class="tckt-slctr-tkt-details-total-tickets-left-th ee-fourth-width cntr"> |
212 | 212 | <span class="smaller-text"> |
213 | 213 | <?php echo apply_filters( |
214 | - 'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_total_ticket_left', |
|
215 | - sprintf(esc_html__('Total Spaces%sLeft', 'event_espresso'), '<br/>') |
|
216 | - ); ?></span> |
|
214 | + 'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_total_ticket_left', |
|
215 | + sprintf(esc_html__('Total Spaces%sLeft', 'event_espresso'), '<br/>') |
|
216 | + ); ?></span> |
|
217 | 217 | </th> |
218 | 218 | <?php endif; // end $show_ticket_sale_columns conditional ?> |
219 | 219 | </tr> |
220 | 220 | </thead> |
221 | 221 | <tbody> |
222 | 222 | <?php |
223 | - foreach ($datetimes as $datetime) { |
|
224 | - if ($datetime instanceof EE_Datetime) { |
|
225 | - ?> |
|
223 | + foreach ($datetimes as $datetime) { |
|
224 | + if ($datetime instanceof EE_Datetime) { |
|
225 | + ?> |
|
226 | 226 | |
227 | 227 | <tr> |
228 | 228 | <td data-th="<?php |
229 | - echo apply_filters( |
|
230 | - 'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_event_date', |
|
231 | - esc_html__('Event Date ', 'event_espresso') |
|
232 | - ); ?>" class="small-text"> |
|
229 | + echo apply_filters( |
|
230 | + 'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_event_date', |
|
231 | + esc_html__('Event Date ', 'event_espresso') |
|
232 | + ); ?>" class="small-text"> |
|
233 | 233 | <?php $datetime_name = $datetime->name(); ?> |
234 | 234 | <?php echo ! empty($datetime_name) ? '<b>' |
235 | - . $datetime_name |
|
236 | - . '</b><br/>' : ''; ?> |
|
235 | + . $datetime_name |
|
236 | + . '</b><br/>' : ''; ?> |
|
237 | 237 | <?php echo $datetime->date_range( |
238 | - $date_format, |
|
239 | - esc_html__(' to ', 'event_espresso') |
|
240 | - ); ?> |
|
238 | + $date_format, |
|
239 | + esc_html__(' to ', 'event_espresso') |
|
240 | + ); ?> |
|
241 | 241 | </td> |
242 | 242 | <td data-th="<?php esc_html_e('Time ', 'event_espresso'); ?>" |
243 | 243 | class="cntr small-text"> |
244 | 244 | <?php echo $datetime->time_range( |
245 | - $time_format, |
|
246 | - esc_html__(' to ', 'event_espresso') |
|
247 | - ); ?> |
|
245 | + $time_format, |
|
246 | + esc_html__(' to ', 'event_espresso') |
|
247 | + ); ?> |
|
248 | 248 | </td> |
249 | 249 | <?php if ($show_ticket_sale_columns) : ?> |
250 | 250 | <td data-th="<?php |
251 | - echo apply_filters( |
|
252 | - 'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_this_ticket_sold', |
|
253 | - esc_html__('Sold', 'event_espresso') |
|
254 | - ); ?>" class="cntr small-text"> |
|
251 | + echo apply_filters( |
|
252 | + 'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_this_ticket_sold', |
|
253 | + esc_html__('Sold', 'event_espresso') |
|
254 | + ); ?>" class="cntr small-text"> |
|
255 | 255 | <?php echo $ticket->sold(); ?> |
256 | 256 | </td> |
257 | 257 | <td data-th="<?php |
258 | - echo apply_filters( |
|
259 | - 'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_this_ticket_left', |
|
260 | - esc_html__('Remaining', 'event_espresso') |
|
261 | - ); ?>" class="cntr small-text"> |
|
258 | + echo apply_filters( |
|
259 | + 'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_this_ticket_left', |
|
260 | + esc_html__('Remaining', 'event_espresso') |
|
261 | + ); ?>" class="cntr small-text"> |
|
262 | 262 | <?php echo $remaining === EE_INF |
263 | - ? '<span class="smaller-text">' . esc_html__( |
|
264 | - 'unlimited ', |
|
265 | - 'event_espresso' |
|
266 | - ) . '</span>' : $remaining; ?> |
|
263 | + ? '<span class="smaller-text">' . esc_html__( |
|
264 | + 'unlimited ', |
|
265 | + 'event_espresso' |
|
266 | + ) . '</span>' : $remaining; ?> |
|
267 | 267 | </td> |
268 | 268 | <td data-th="<?php |
269 | - echo apply_filters( |
|
270 | - 'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_total_ticket_sold', |
|
271 | - esc_html__('Total Sold', 'event_espresso') |
|
272 | - ); ?>" class="cntr small-text"> |
|
269 | + echo apply_filters( |
|
270 | + 'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_total_ticket_sold', |
|
271 | + esc_html__('Total Sold', 'event_espresso') |
|
272 | + ); ?>" class="cntr small-text"> |
|
273 | 273 | <?php echo $datetime->sold(); ?> |
274 | 274 | </td> |
275 | 275 | <?php $tkts_left = $datetime->sold_out() |
276 | - ? '<span class="sold-out smaller-text">' . esc_html__( |
|
277 | - 'Sold Out', |
|
278 | - 'event_espresso' |
|
279 | - ) . '</span>' : $datetime->spaces_remaining(); ?> |
|
276 | + ? '<span class="sold-out smaller-text">' . esc_html__( |
|
277 | + 'Sold Out', |
|
278 | + 'event_espresso' |
|
279 | + ) . '</span>' : $datetime->spaces_remaining(); ?> |
|
280 | 280 | <td data-th="<?php |
281 | - echo apply_filters( |
|
282 | - 'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_total_ticket_left', |
|
283 | - esc_html__('Total Spaces Left', 'event_espresso') |
|
284 | - ); ?>" class="cntr small-text"> |
|
281 | + echo apply_filters( |
|
282 | + 'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_total_ticket_left', |
|
283 | + esc_html__('Total Spaces Left', 'event_espresso') |
|
284 | + ); ?>" class="cntr small-text"> |
|
285 | 285 | <?php echo $tkts_left === EE_INF ? '<span class="smaller-text">' |
286 | - . esc_html__( |
|
287 | - 'unlimited ', |
|
288 | - 'event_espresso' |
|
289 | - ) |
|
290 | - . '</span>' : $tkts_left; ?> |
|
286 | + . esc_html__( |
|
287 | + 'unlimited ', |
|
288 | + 'event_espresso' |
|
289 | + ) |
|
290 | + . '</span>' : $tkts_left; ?> |
|
291 | 291 | </td> |
292 | 292 | <?php endif; // end $show_ticket_sale_columns conditional ?> |
293 | 293 | </tr> |
@@ -17,7 +17,7 @@ discard block |
||
17 | 17 | <label><?php _e('Amount Owing: ', 'event_espresso'); ?></label> |
18 | 18 | </td> |
19 | 19 | <td class="<?php echo ($transaction->paid() == $transaction->total()) ? 'ee-transaction-paid' |
20 | - : 'ee-transaction-unpaid' ?>"> |
|
20 | + : 'ee-transaction-unpaid' ?>"> |
|
21 | 21 | <?php echo EEH_Template::format_currency($transaction->remaining()); ?> |
22 | 22 | </td> |
23 | 23 | </tr> |
@@ -27,10 +27,10 @@ discard block |
||
27 | 27 | </td> |
28 | 28 | <td> |
29 | 29 | <?php $transaction->e_pretty_status(true); |
30 | - if ($show_try_pay_again_link && ! $transaction->is_completed()) { ?> |
|
30 | + if ($show_try_pay_again_link && ! $transaction->is_completed()) { ?> |
|
31 | 31 | <span class="small-text"><a href='<?php echo $SPCO_payment_options_url ?>'><?php |
32 | - _e('View Payment Options', 'event_espresso'); |
|
33 | - ?></a></span> |
|
32 | + _e('View Payment Options', 'event_espresso'); |
|
33 | + ?></a></span> |
|
34 | 34 | <?php } ?> |
35 | 35 | </td> |
36 | 36 | </tr> |
@@ -43,16 +43,16 @@ discard block |
||
43 | 43 | </td> |
44 | 44 | </tr> |
45 | 45 | <?php do_action( |
46 | - 'AHEE__thank_you_page_transaction_details_template__after_transaction_table_row', |
|
47 | - $transaction |
|
48 | - ); ?> |
|
46 | + 'AHEE__thank_you_page_transaction_details_template__after_transaction_table_row', |
|
47 | + $transaction |
|
48 | + ); ?> |
|
49 | 49 | </tbody> |
50 | 50 | </table> |
51 | 51 | |
52 | 52 | <?php if ($show_try_pay_again_link && ! $transaction->is_completed()) { ?> |
53 | 53 | <p class="small-text jst-rght"> |
54 | 54 | <a href='<?php echo $SPCO_payment_options_url ?>'><?php |
55 | - _e("Click here to view Payment Options", 'event_espresso'); ?></a> |
|
55 | + _e("Click here to view Payment Options", 'event_espresso'); ?></a> |
|
56 | 56 | </p> |
57 | 57 | <br/> |
58 | 58 |
@@ -2,179 +2,179 @@ discard block |
||
2 | 2 | /* THIS IS A GENERATED FILE. DO NOT EDIT DIRECTLY. */ |
3 | 3 | $generated_i18n_strings = array( |
4 | 4 | // Reference: domains/blocks/src/components/AvatarImage.tsx:27 |
5 | - __( 'contact avatar', 'event_espresso' ), |
|
5 | + __('contact avatar', 'event_espresso'), |
|
6 | 6 | |
7 | 7 | // Reference: domains/blocks/src/components/OrderByControl.tsx:13 |
8 | - __( 'Order by', 'event_espresso' ), |
|
8 | + __('Order by', 'event_espresso'), |
|
9 | 9 | |
10 | 10 | // Reference: domains/blocks/src/components/RegStatusControl.tsx:18 |
11 | 11 | // Reference: domains/blocks/src/event-attendees/controls/SelectStatus.tsx:12 |
12 | - __( 'Select Registration Status', 'event_espresso' ), |
|
12 | + __('Select Registration Status', 'event_espresso'), |
|
13 | 13 | |
14 | 14 | // Reference: domains/blocks/src/components/SortOrderControl.tsx:15 |
15 | - __( 'Ascending', 'event_espresso' ), |
|
15 | + __('Ascending', 'event_espresso'), |
|
16 | 16 | |
17 | 17 | // Reference: domains/blocks/src/components/SortOrderControl.tsx:19 |
18 | - __( 'Descending', 'event_espresso' ), |
|
18 | + __('Descending', 'event_espresso'), |
|
19 | 19 | |
20 | 20 | // Reference: domains/blocks/src/components/SortOrderControl.tsx:25 |
21 | - __( 'Sort order:', 'event_espresso' ), |
|
21 | + __('Sort order:', 'event_espresso'), |
|
22 | 22 | |
23 | 23 | // Reference: domains/blocks/src/event-attendees/AttendeesDisplay.tsx:40 |
24 | - __( 'There was some error fetching attendees list', 'event_espresso' ), |
|
24 | + __('There was some error fetching attendees list', 'event_espresso'), |
|
25 | 25 | |
26 | 26 | // Reference: domains/blocks/src/event-attendees/AttendeesDisplay.tsx:46 |
27 | - __( 'To get started, select what event you want to show attendees from in the block settings.', 'event_espresso' ), |
|
27 | + __('To get started, select what event you want to show attendees from in the block settings.', 'event_espresso'), |
|
28 | 28 | |
29 | 29 | // Reference: domains/blocks/src/event-attendees/AttendeesDisplay.tsx:52 |
30 | - __( 'There are no attendees for selected options.', 'event_espresso' ), |
|
30 | + __('There are no attendees for selected options.', 'event_espresso'), |
|
31 | 31 | |
32 | 32 | // Reference: domains/blocks/src/event-attendees/controls/ArchiveSettings.tsx:11 |
33 | - __( 'Display on Archives', 'event_espresso' ), |
|
33 | + __('Display on Archives', 'event_espresso'), |
|
34 | 34 | |
35 | 35 | // Reference: domains/blocks/src/event-attendees/controls/ArchiveSettings.tsx:16 |
36 | - __( 'Attendees are shown whenever this post is listed in an archive view.', 'event_espresso' ), |
|
36 | + __('Attendees are shown whenever this post is listed in an archive view.', 'event_espresso'), |
|
37 | 37 | |
38 | 38 | // Reference: domains/blocks/src/event-attendees/controls/ArchiveSettings.tsx:17 |
39 | - __( 'Attendees are hidden whenever this post is listed in an archive view.', 'event_espresso' ), |
|
39 | + __('Attendees are hidden whenever this post is listed in an archive view.', 'event_espresso'), |
|
40 | 40 | |
41 | 41 | // Reference: domains/blocks/src/event-attendees/controls/AttendeeLimit.tsx:28 |
42 | - __( 'Number of Attendees to Display:', 'event_espresso' ), |
|
42 | + __('Number of Attendees to Display:', 'event_espresso'), |
|
43 | 43 | |
44 | 44 | // Reference: domains/blocks/src/event-attendees/controls/AttendeeLimit.tsx:32 |
45 | - _n_noop( 'Used to adjust the number of attendees displayed (There is %d total attendee for the current filter settings).', 'Used to adjust the number of attendees displayed (There are %d total attendees for the current filter settings).', 'event_espresso' ), |
|
45 | + _n_noop('Used to adjust the number of attendees displayed (There is %d total attendee for the current filter settings).', 'Used to adjust the number of attendees displayed (There are %d total attendees for the current filter settings).', 'event_espresso'), |
|
46 | 46 | |
47 | 47 | // Reference: domains/blocks/src/event-attendees/controls/GravatarSettings.tsx:26 |
48 | - __( 'Display Gravatar', 'event_espresso' ), |
|
48 | + __('Display Gravatar', 'event_espresso'), |
|
49 | 49 | |
50 | 50 | // Reference: domains/blocks/src/event-attendees/controls/GravatarSettings.tsx:31 |
51 | - __( 'Gravatar images are shown for each attendee.', 'event_espresso' ), |
|
51 | + __('Gravatar images are shown for each attendee.', 'event_espresso'), |
|
52 | 52 | |
53 | 53 | // Reference: domains/blocks/src/event-attendees/controls/GravatarSettings.tsx:32 |
54 | - __( 'No gravatar images are shown for each attendee.', 'event_espresso' ), |
|
54 | + __('No gravatar images are shown for each attendee.', 'event_espresso'), |
|
55 | 55 | |
56 | 56 | // Reference: domains/blocks/src/event-attendees/controls/GravatarSettings.tsx:37 |
57 | - __( 'Size of Gravatar', 'event_espresso' ), |
|
57 | + __('Size of Gravatar', 'event_espresso'), |
|
58 | 58 | |
59 | 59 | // Reference: domains/blocks/src/event-attendees/controls/SelectDatetime.tsx:21 |
60 | - __( 'Select Datetime', 'event_espresso' ), |
|
60 | + __('Select Datetime', 'event_espresso'), |
|
61 | 61 | |
62 | 62 | // Reference: domains/blocks/src/event-attendees/controls/SelectEvent.tsx:21 |
63 | - __( 'Select Event', 'event_espresso' ), |
|
63 | + __('Select Event', 'event_espresso'), |
|
64 | 64 | |
65 | 65 | // Reference: domains/blocks/src/event-attendees/controls/SelectOrderBy.tsx:10 |
66 | - __( 'Attendee id', 'event_espresso' ), |
|
66 | + __('Attendee id', 'event_espresso'), |
|
67 | 67 | |
68 | 68 | // Reference: domains/blocks/src/event-attendees/controls/SelectOrderBy.tsx:14 |
69 | - __( 'Last name only', 'event_espresso' ), |
|
69 | + __('Last name only', 'event_espresso'), |
|
70 | 70 | |
71 | 71 | // Reference: domains/blocks/src/event-attendees/controls/SelectOrderBy.tsx:18 |
72 | - __( 'First name only', 'event_espresso' ), |
|
72 | + __('First name only', 'event_espresso'), |
|
73 | 73 | |
74 | 74 | // Reference: domains/blocks/src/event-attendees/controls/SelectOrderBy.tsx:22 |
75 | - __( 'First, then Last name', 'event_espresso' ), |
|
75 | + __('First, then Last name', 'event_espresso'), |
|
76 | 76 | |
77 | 77 | // Reference: domains/blocks/src/event-attendees/controls/SelectOrderBy.tsx:26 |
78 | - __( 'Last, then First name', 'event_espresso' ), |
|
78 | + __('Last, then First name', 'event_espresso'), |
|
79 | 79 | |
80 | 80 | // Reference: domains/blocks/src/event-attendees/controls/SelectOrderBy.tsx:40 |
81 | - __( 'Order Attendees by:', 'event_espresso' ), |
|
81 | + __('Order Attendees by:', 'event_espresso'), |
|
82 | 82 | |
83 | 83 | // Reference: domains/blocks/src/event-attendees/controls/SelectTicket.tsx:21 |
84 | - __( 'Select Ticket', 'event_espresso' ), |
|
84 | + __('Select Ticket', 'event_espresso'), |
|
85 | 85 | |
86 | 86 | // Reference: domains/blocks/src/event-attendees/controls/index.tsx:22 |
87 | - __( 'Filter By Settings', 'event_espresso' ), |
|
87 | + __('Filter By Settings', 'event_espresso'), |
|
88 | 88 | |
89 | 89 | // Reference: domains/blocks/src/event-attendees/controls/index.tsx:37 |
90 | - __( 'Gravatar Setttings', 'event_espresso' ), |
|
90 | + __('Gravatar Setttings', 'event_espresso'), |
|
91 | 91 | |
92 | 92 | // Reference: domains/blocks/src/event-attendees/controls/index.tsx:40 |
93 | - __( 'Archive Settings', 'event_espresso' ), |
|
93 | + __('Archive Settings', 'event_espresso'), |
|
94 | 94 | |
95 | 95 | // Reference: domains/blocks/src/event-attendees/index.tsx:10 |
96 | - __( 'Event Attendees', 'event_espresso' ), |
|
96 | + __('Event Attendees', 'event_espresso'), |
|
97 | 97 | |
98 | 98 | // Reference: domains/blocks/src/event-attendees/index.tsx:11 |
99 | - __( 'Displays a list of people that have registered for the specified event', 'event_espresso' ), |
|
99 | + __('Displays a list of people that have registered for the specified event', 'event_espresso'), |
|
100 | 100 | |
101 | 101 | // Reference: domains/blocks/src/event-attendees/index.tsx:14 |
102 | - __( 'event', 'event_espresso' ), |
|
102 | + __('event', 'event_espresso'), |
|
103 | 103 | |
104 | 104 | // Reference: domains/blocks/src/event-attendees/index.tsx:14 |
105 | - __( 'attendees', 'event_espresso' ), |
|
105 | + __('attendees', 'event_espresso'), |
|
106 | 106 | |
107 | 107 | // Reference: domains/blocks/src/event-attendees/index.tsx:14 |
108 | - __( 'list', 'event_espresso' ), |
|
108 | + __('list', 'event_espresso'), |
|
109 | 109 | |
110 | 110 | // Reference: domains/blocks/src/services/utils.ts:11 |
111 | - __( 'Loading...', 'event_espresso' ), |
|
111 | + __('Loading...', 'event_espresso'), |
|
112 | 112 | |
113 | 113 | // Reference: domains/blocks/src/services/utils.ts:19 |
114 | 114 | // Reference: domains/eventEditor/src/ui/ticketAssignmentsManager/components/ErrorMessage.tsx:32 |
115 | - __( 'Error', 'event_espresso' ), |
|
115 | + __('Error', 'event_espresso'), |
|
116 | 116 | |
117 | 117 | // Reference: domains/blocks/src/services/utils.ts:26 |
118 | - __( 'Select...', 'event_espresso' ), |
|
118 | + __('Select...', 'event_espresso'), |
|
119 | 119 | |
120 | 120 | // Reference: domains/eventEditor/src/ui/datetimes/DateRegistrationsLink.tsx:17 |
121 | - __( 'view ALL registrations for this date.', 'event_espresso' ), |
|
121 | + __('view ALL registrations for this date.', 'event_espresso'), |
|
122 | 122 | |
123 | 123 | // Reference: domains/eventEditor/src/ui/datetimes/dateForm/formValidation.ts:15 |
124 | 124 | // Reference: domains/eventEditor/src/ui/tickets/ticketForm/formValidation.ts:15 |
125 | - __( 'Name is required', 'event_espresso' ), |
|
125 | + __('Name is required', 'event_espresso'), |
|
126 | 126 | |
127 | 127 | // Reference: domains/eventEditor/src/ui/datetimes/dateForm/formValidation.ts:16 |
128 | 128 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/bulkEdit/details/formValidation.ts:12 |
129 | 129 | // Reference: domains/eventEditor/src/ui/tickets/ticketForm/formValidation.ts:16 |
130 | 130 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/details/formValidation.ts:12 |
131 | - __( 'Name must be at least three characters', 'event_espresso' ), |
|
131 | + __('Name must be at least three characters', 'event_espresso'), |
|
132 | 132 | |
133 | 133 | // Reference: domains/eventEditor/src/ui/datetimes/dateForm/multiStep/Container.tsx:19 |
134 | - __( 'Edit datetime %s', 'event_espresso' ), |
|
134 | + __('Edit datetime %s', 'event_espresso'), |
|
135 | 135 | |
136 | 136 | // Reference: domains/eventEditor/src/ui/datetimes/dateForm/multiStep/Container.tsx:19 |
137 | - __( 'New Datetime', 'event_espresso' ), |
|
137 | + __('New Datetime', 'event_espresso'), |
|
138 | 138 | |
139 | 139 | // Reference: domains/eventEditor/src/ui/datetimes/dateForm/multiStep/ContentBody.tsx:40 |
140 | - __( 'Save and assign tickets', 'event_espresso' ), |
|
140 | + __('Save and assign tickets', 'event_espresso'), |
|
141 | 141 | |
142 | 142 | // Reference: domains/eventEditor/src/ui/datetimes/dateForm/multiStep/DateFormSteps.tsx:11 |
143 | - __( 'primary information about the date', 'event_espresso' ), |
|
143 | + __('primary information about the date', 'event_espresso'), |
|
144 | 144 | |
145 | 145 | // Reference: domains/eventEditor/src/ui/datetimes/dateForm/multiStep/DateFormSteps.tsx:11 |
146 | - __( 'Date Details', 'event_espresso' ), |
|
146 | + __('Date Details', 'event_espresso'), |
|
147 | 147 | |
148 | 148 | // Reference: domains/eventEditor/src/ui/datetimes/dateForm/multiStep/DateFormSteps.tsx:12 |
149 | 149 | // Reference: domains/eventEditor/src/ui/tickets/ticketForm/multiStep/TicketFormSteps.tsx:17 |
150 | - __( 'relations between tickets and dates', 'event_espresso' ), |
|
150 | + __('relations between tickets and dates', 'event_espresso'), |
|
151 | 151 | |
152 | 152 | // Reference: domains/eventEditor/src/ui/datetimes/dateForm/multiStep/DateFormSteps.tsx:12 |
153 | - __( 'Assign Tickets', 'event_espresso' ), |
|
153 | + __('Assign Tickets', 'event_espresso'), |
|
154 | 154 | |
155 | 155 | // Reference: domains/eventEditor/src/ui/datetimes/dateForm/useDateFormConfig.ts:107 |
156 | 156 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/bulkEdit/details/useBulkEditFormConfig.ts:108 |
157 | 157 | // Reference: domains/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.tsx:119 |
158 | 158 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/details/useBulkEditFormConfig.ts:108 |
159 | - __( 'Details', 'event_espresso' ), |
|
159 | + __('Details', 'event_espresso'), |
|
160 | 160 | |
161 | 161 | // Reference: domains/eventEditor/src/ui/datetimes/dateForm/useDateFormConfig.ts:111 |
162 | 162 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/bulkEdit/details/useBulkEditFormConfig.ts:112 |
163 | 163 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/tableView/useHeaderRowGenerator.tsx:74 |
164 | - __( 'Capacity', 'event_espresso' ), |
|
164 | + __('Capacity', 'event_espresso'), |
|
165 | 165 | |
166 | 166 | // Reference: domains/eventEditor/src/ui/datetimes/dateForm/useDateFormConfig.ts:116 |
167 | - __( 'The maximum number of registrants that can attend the event at this particular date.%sSet to 0 to close registration or leave blank for no limit.', 'event_espresso' ), |
|
167 | + __('The maximum number of registrants that can attend the event at this particular date.%sSet to 0 to close registration or leave blank for no limit.', 'event_espresso'), |
|
168 | 168 | |
169 | 169 | // Reference: domains/eventEditor/src/ui/datetimes/dateForm/useDateFormConfig.ts:125 |
170 | 170 | // Reference: domains/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.tsx:198 |
171 | - __( 'Trash', 'event_espresso' ), |
|
171 | + __('Trash', 'event_espresso'), |
|
172 | 172 | |
173 | 173 | // Reference: domains/eventEditor/src/ui/datetimes/dateForm/useDateFormConfig.ts:69 |
174 | 174 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/bulkEdit/details/useBulkEditFormConfig.ts:45 |
175 | 175 | // Reference: domains/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.tsx:81 |
176 | 176 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/details/useBulkEditFormConfig.ts:45 |
177 | - __( 'Basics', 'event_espresso' ), |
|
177 | + __('Basics', 'event_espresso'), |
|
178 | 178 | |
179 | 179 | // Reference: domains/eventEditor/src/ui/datetimes/dateForm/useDateFormConfig.ts:73 |
180 | 180 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/bulkEdit/details/useBulkEditFormConfig.ts:49 |
@@ -182,219 +182,219 @@ discard block |
||
182 | 182 | // Reference: domains/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.tsx:85 |
183 | 183 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/details/useBulkEditFormConfig.ts:49 |
184 | 184 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/tableView/useHeaderRowGenerator.tsx:42 |
185 | - __( 'Name', 'event_espresso' ), |
|
185 | + __('Name', 'event_espresso'), |
|
186 | 186 | |
187 | 187 | // Reference: domains/eventEditor/src/ui/datetimes/dateForm/useDateFormConfig.ts:80 |
188 | 188 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/bulkEdit/details/useBulkEditFormConfig.ts:55 |
189 | 189 | // Reference: domains/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.tsx:92 |
190 | 190 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/details/useBulkEditFormConfig.ts:55 |
191 | 191 | // Reference: packages/tpc/src/components/table/useHeaderRowGenerator.ts:41 |
192 | - __( 'Description', 'event_espresso' ), |
|
192 | + __('Description', 'event_espresso'), |
|
193 | 193 | |
194 | 194 | // Reference: domains/eventEditor/src/ui/datetimes/dateForm/useDateFormConfig.ts:88 |
195 | 195 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/bulkEdit/details/useBulkEditFormConfig.ts:63 |
196 | 196 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/details/useBulkEditFormConfig.ts:63 |
197 | - __( 'Dates', 'event_espresso' ), |
|
197 | + __('Dates', 'event_espresso'), |
|
198 | 198 | |
199 | 199 | // Reference: domains/eventEditor/src/ui/datetimes/dateForm/useDateFormConfig.ts:92 |
200 | 200 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/tableView/useHeaderRowGenerator.tsx:51 |
201 | 201 | // Reference: domains/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.tsx:104 |
202 | - __( 'Start Date', 'event_espresso' ), |
|
202 | + __('Start Date', 'event_espresso'), |
|
203 | 203 | |
204 | 204 | // Reference: domains/eventEditor/src/ui/datetimes/dateForm/useDateFormConfig.ts:98 |
205 | 205 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/tableView/useHeaderRowGenerator.tsx:62 |
206 | 206 | // Reference: domains/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.tsx:110 |
207 | - __( 'End Date', 'event_espresso' ), |
|
207 | + __('End Date', 'event_espresso'), |
|
208 | 208 | |
209 | 209 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/DatesList.tsx:34 |
210 | 210 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/tableView/TableView.tsx:34 |
211 | - __( 'Event Dates', 'event_espresso' ), |
|
211 | + __('Event Dates', 'event_espresso'), |
|
212 | 212 | |
213 | 213 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/DatesList.tsx:37 |
214 | - __( 'loading event dates...', 'event_espresso' ), |
|
214 | + __('loading event dates...', 'event_espresso'), |
|
215 | 215 | |
216 | 216 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/DatesListButtons.tsx:22 |
217 | - __( 'Ticket Assignments', 'event_espresso' ), |
|
217 | + __('Ticket Assignments', 'event_espresso'), |
|
218 | 218 | |
219 | 219 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/actionsMenu/AssignTicketsButton.tsx:27 |
220 | - __( 'Number of related tickets', 'event_espresso' ), |
|
220 | + __('Number of related tickets', 'event_espresso'), |
|
221 | 221 | |
222 | 222 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/actionsMenu/AssignTicketsButton.tsx:28 |
223 | - __( 'There are no tickets assigned to this datetime. Please click the ticket icon to update the assignments.', 'event_espresso' ), |
|
223 | + __('There are no tickets assigned to this datetime. Please click the ticket icon to update the assignments.', 'event_espresso'), |
|
224 | 224 | |
225 | 225 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/actionsMenu/AssignTicketsButton.tsx:42 |
226 | - __( 'assign tickets', 'event_espresso' ), |
|
226 | + __('assign tickets', 'event_espresso'), |
|
227 | 227 | |
228 | 228 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/actionsMenu/dropdown/DateMainMenu.tsx:18 |
229 | - __( 'Permanently delete Datetime?', 'event_espresso' ), |
|
229 | + __('Permanently delete Datetime?', 'event_espresso'), |
|
230 | 230 | |
231 | 231 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/actionsMenu/dropdown/DateMainMenu.tsx:18 |
232 | - __( 'Move Datetime to Trash?', 'event_espresso' ), |
|
232 | + __('Move Datetime to Trash?', 'event_espresso'), |
|
233 | 233 | |
234 | 234 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/actionsMenu/dropdown/DateMainMenu.tsx:20 |
235 | - __( 'Are you sure you want to permanently delete this datetime? This action is permanent and can not be undone.', 'event_espresso' ), |
|
235 | + __('Are you sure you want to permanently delete this datetime? This action is permanent and can not be undone.', 'event_espresso'), |
|
236 | 236 | |
237 | 237 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/actionsMenu/dropdown/DateMainMenu.tsx:23 |
238 | - __( 'Are you sure you want to move this datetime to the trash? You can "untrash" this datetime later if you need to.', 'event_espresso' ), |
|
238 | + __('Are you sure you want to move this datetime to the trash? You can "untrash" this datetime later if you need to.', 'event_espresso'), |
|
239 | 239 | |
240 | 240 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/actionsMenu/dropdown/DateMainMenu.tsx:33 |
241 | - __( 'event date main menu', 'event_espresso' ), |
|
241 | + __('event date main menu', 'event_espresso'), |
|
242 | 242 | |
243 | 243 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/actionsMenu/dropdown/DateMainMenu.tsx:37 |
244 | 244 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/actionsMenu/dropdown/TicketMainMenu.tsx:33 |
245 | - __( 'delete permanently', 'event_espresso' ), |
|
245 | + __('delete permanently', 'event_espresso'), |
|
246 | 246 | |
247 | 247 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/actionsMenu/dropdown/DateMainMenu.tsx:37 |
248 | - __( 'trash datetime', 'event_espresso' ), |
|
248 | + __('trash datetime', 'event_espresso'), |
|
249 | 249 | |
250 | 250 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/actionsMenu/dropdown/DateMainMenu.tsx:46 |
251 | - __( 'edit datetime', 'event_espresso' ), |
|
251 | + __('edit datetime', 'event_espresso'), |
|
252 | 252 | |
253 | 253 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/actionsMenu/dropdown/DateMainMenu.tsx:47 |
254 | - __( 'copy datetime', 'event_espresso' ), |
|
254 | + __('copy datetime', 'event_espresso'), |
|
255 | 255 | |
256 | 256 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/bulkEdit/actions/Actions.tsx:30 |
257 | - __( 'edit datetime details', 'event_espresso' ), |
|
257 | + __('edit datetime details', 'event_espresso'), |
|
258 | 258 | |
259 | 259 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/bulkEdit/actions/Actions.tsx:34 |
260 | - __( 'delete datetimes', 'event_espresso' ), |
|
260 | + __('delete datetimes', 'event_espresso'), |
|
261 | 261 | |
262 | 262 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/bulkEdit/actions/Actions.tsx:34 |
263 | - __( 'trash datetimes', 'event_espresso' ), |
|
263 | + __('trash datetimes', 'event_espresso'), |
|
264 | 264 | |
265 | 265 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/bulkEdit/delete/Delete.tsx:13 |
266 | - __( 'Are you sure you want to permanently delete these datetimes? This action can NOT be undone!', 'event_espresso' ), |
|
266 | + __('Are you sure you want to permanently delete these datetimes? This action can NOT be undone!', 'event_espresso'), |
|
267 | 267 | |
268 | 268 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/bulkEdit/delete/Delete.tsx:14 |
269 | - __( 'Are you sure you want to trash these datetimes?', 'event_espresso' ), |
|
269 | + __('Are you sure you want to trash these datetimes?', 'event_espresso'), |
|
270 | 270 | |
271 | 271 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/bulkEdit/delete/Delete.tsx:15 |
272 | - __( 'Delete datetimes permanently', 'event_espresso' ), |
|
272 | + __('Delete datetimes permanently', 'event_espresso'), |
|
273 | 273 | |
274 | 274 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/bulkEdit/delete/Delete.tsx:15 |
275 | - __( 'Trash datetimes', 'event_espresso' ), |
|
275 | + __('Trash datetimes', 'event_espresso'), |
|
276 | 276 | |
277 | 277 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/bulkEdit/details/EditDetails.tsx:22 |
278 | - __( 'Bulk edit date details', 'event_espresso' ), |
|
278 | + __('Bulk edit date details', 'event_espresso'), |
|
279 | 279 | |
280 | 280 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/bulkEdit/details/EditDetails.tsx:23 |
281 | - __( 'any changes will be applied to ALL of the selected dates.', 'event_espresso' ), |
|
281 | + __('any changes will be applied to ALL of the selected dates.', 'event_espresso'), |
|
282 | 282 | |
283 | 283 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/bulkEdit/details/useBulkEditFormConfig.ts:67 |
284 | 284 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/details/useBulkEditFormConfig.ts:67 |
285 | - __( 'Shift dates', 'event_espresso' ), |
|
285 | + __('Shift dates', 'event_espresso'), |
|
286 | 286 | |
287 | 287 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/bulkEdit/details/useBulkEditFormConfig.ts:92 |
288 | 288 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/details/useBulkEditFormConfig.ts:92 |
289 | - __( 'earlier', 'event_espresso' ), |
|
289 | + __('earlier', 'event_espresso'), |
|
290 | 290 | |
291 | 291 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/bulkEdit/details/useBulkEditFormConfig.ts:96 |
292 | 292 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/details/useBulkEditFormConfig.ts:96 |
293 | - __( 'later', 'event_espresso' ), |
|
293 | + __('later', 'event_espresso'), |
|
294 | 294 | |
295 | 295 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/cardView/DateCapacity.tsx:35 |
296 | - __( 'edit capacity (registration limit)...', 'event_espresso' ), |
|
296 | + __('edit capacity (registration limit)...', 'event_espresso'), |
|
297 | 297 | |
298 | 298 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/cardView/DateCardSidebar.tsx:37 |
299 | - __( 'Edit Event Date', 'event_espresso' ), |
|
299 | + __('Edit Event Date', 'event_espresso'), |
|
300 | 300 | |
301 | 301 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/cardView/DateCardSidebar.tsx:40 |
302 | - __( 'edit start and end dates', 'event_espresso' ), |
|
302 | + __('edit start and end dates', 'event_espresso'), |
|
303 | 303 | |
304 | 304 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/cardView/DateDetailsPanel.tsx:14 |
305 | 305 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/cardView/TicketDetailsPanel.tsx:14 |
306 | - __( 'sold', 'event_espresso' ), |
|
306 | + __('sold', 'event_espresso'), |
|
307 | 307 | |
308 | 308 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/cardView/DateDetailsPanel.tsx:27 |
309 | - __( 'capacity', 'event_espresso' ), |
|
309 | + __('capacity', 'event_espresso'), |
|
310 | 310 | |
311 | 311 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/cardView/DateDetailsPanel.tsx:33 |
312 | 312 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/cardView/TicketDetailsPanel.tsx:32 |
313 | - __( 'reg list', 'event_espresso' ), |
|
313 | + __('reg list', 'event_espresso'), |
|
314 | 314 | |
315 | 315 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/cardView/Details.tsx:40 |
316 | 316 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/cardView/Details.tsx:40 |
317 | - __( 'Edit description', 'event_espresso' ), |
|
317 | + __('Edit description', 'event_espresso'), |
|
318 | 318 | |
319 | 319 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/cardView/Details.tsx:41 |
320 | 320 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/cardView/Details.tsx:41 |
321 | - __( 'edit description...', 'event_espresso' ), |
|
321 | + __('edit description...', 'event_espresso'), |
|
322 | 322 | |
323 | 323 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/config.ts:13 |
324 | - __( 'Active', 'event_espresso' ), |
|
324 | + __('Active', 'event_espresso'), |
|
325 | 325 | |
326 | 326 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/config.ts:14 |
327 | 327 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/config.ts:13 |
328 | - __( 'Trashed', 'event_espresso' ), |
|
328 | + __('Trashed', 'event_espresso'), |
|
329 | 329 | |
330 | 330 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/config.ts:15 |
331 | 331 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/config.ts:14 |
332 | - __( 'Expired', 'event_espresso' ), |
|
332 | + __('Expired', 'event_espresso'), |
|
333 | 333 | |
334 | 334 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/config.ts:16 |
335 | 335 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/config.ts:16 |
336 | - __( 'Sold Out', 'event_espresso' ), |
|
336 | + __('Sold Out', 'event_espresso'), |
|
337 | 337 | |
338 | 338 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/config.ts:17 |
339 | - __( 'Upcoming', 'event_espresso' ), |
|
339 | + __('Upcoming', 'event_espresso'), |
|
340 | 340 | |
341 | 341 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/editable/EditableName.tsx:17 |
342 | 342 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/editable/EditableName.tsx:27 |
343 | - __( 'edit title...', 'event_espresso' ), |
|
343 | + __('edit title...', 'event_espresso'), |
|
344 | 344 | |
345 | 345 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/filterBar/ActiveDatesFilters.tsx:25 |
346 | 346 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/ActiveTicketsFilters.tsx:25 |
347 | - __( 'ON', 'event_espresso' ), |
|
347 | + __('ON', 'event_espresso'), |
|
348 | 348 | |
349 | 349 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:10 |
350 | - __( 'start and end dates', 'event_espresso' ), |
|
350 | + __('start and end dates', 'event_espresso'), |
|
351 | 351 | |
352 | 352 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:15 |
353 | - __( 'dates above 90% capacity', 'event_espresso' ), |
|
353 | + __('dates above 90% capacity', 'event_espresso'), |
|
354 | 354 | |
355 | 355 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:16 |
356 | - __( 'dates above 75% capacity', 'event_espresso' ), |
|
356 | + __('dates above 75% capacity', 'event_espresso'), |
|
357 | 357 | |
358 | 358 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:17 |
359 | - __( 'dates above 50% capacity', 'event_espresso' ), |
|
359 | + __('dates above 50% capacity', 'event_espresso'), |
|
360 | 360 | |
361 | 361 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:18 |
362 | - __( 'dates below 50% capacity', 'event_espresso' ), |
|
362 | + __('dates below 50% capacity', 'event_espresso'), |
|
363 | 363 | |
364 | 364 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:22 |
365 | - __( 'all dates', 'event_espresso' ), |
|
365 | + __('all dates', 'event_espresso'), |
|
366 | 366 | |
367 | 367 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:23 |
368 | - __( 'all active and upcoming', 'event_espresso' ), |
|
368 | + __('all active and upcoming', 'event_espresso'), |
|
369 | 369 | |
370 | 370 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:24 |
371 | - __( 'active dates only', 'event_espresso' ), |
|
371 | + __('active dates only', 'event_espresso'), |
|
372 | 372 | |
373 | 373 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:25 |
374 | - __( 'upcoming dates only', 'event_espresso' ), |
|
374 | + __('upcoming dates only', 'event_espresso'), |
|
375 | 375 | |
376 | 376 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:26 |
377 | - __( 'next active or upcoming only', 'event_espresso' ), |
|
377 | + __('next active or upcoming only', 'event_espresso'), |
|
378 | 378 | |
379 | 379 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:27 |
380 | - __( 'sold out dates only', 'event_espresso' ), |
|
380 | + __('sold out dates only', 'event_espresso'), |
|
381 | 381 | |
382 | 382 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:28 |
383 | - __( 'recently expired dates', 'event_espresso' ), |
|
383 | + __('recently expired dates', 'event_espresso'), |
|
384 | 384 | |
385 | 385 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:29 |
386 | - __( 'all expired dates', 'event_espresso' ), |
|
386 | + __('all expired dates', 'event_espresso'), |
|
387 | 387 | |
388 | 388 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:30 |
389 | - __( 'trashed dates only', 'event_espresso' ), |
|
389 | + __('trashed dates only', 'event_espresso'), |
|
390 | 390 | |
391 | 391 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:34 |
392 | 392 | // Reference: packages/dates/src/DateRangePicker/DateRangePickerLegend.tsx:10 |
393 | 393 | // Reference: packages/dates/src/DateRangePicker/index.tsx:55 |
394 | - __( 'start date', 'event_espresso' ), |
|
394 | + __('start date', 'event_espresso'), |
|
395 | 395 | |
396 | 396 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:35 |
397 | - __( 'name', 'event_espresso' ), |
|
397 | + __('name', 'event_espresso'), |
|
398 | 398 | |
399 | 399 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:36 |
400 | 400 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/tableView/useHeaderRowGenerator.tsx:37 |
@@ -402,98 +402,98 @@ discard block |
||
402 | 402 | // Reference: domains/eventEditor/src/ui/ticketAssignmentsManager/components/table/HeaderCell.tsx:20 |
403 | 403 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/tableView/useHeaderRowGenerator.tsx:36 |
404 | 404 | // Reference: packages/tpc/src/components/table/useHeaderRowGenerator.ts:23 |
405 | - __( 'ID', 'event_espresso' ), |
|
405 | + __('ID', 'event_espresso'), |
|
406 | 406 | |
407 | 407 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:37 |
408 | 408 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:46 |
409 | - __( 'custom order', 'event_espresso' ), |
|
409 | + __('custom order', 'event_espresso'), |
|
410 | 410 | |
411 | 411 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:41 |
412 | 412 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:51 |
413 | - __( 'display', 'event_espresso' ), |
|
413 | + __('display', 'event_espresso'), |
|
414 | 414 | |
415 | 415 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:42 |
416 | - __( 'recurrence', 'event_espresso' ), |
|
416 | + __('recurrence', 'event_espresso'), |
|
417 | 417 | |
418 | 418 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:43 |
419 | 419 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:53 |
420 | - __( 'sales', 'event_espresso' ), |
|
420 | + __('sales', 'event_espresso'), |
|
421 | 421 | |
422 | 422 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:44 |
423 | 423 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:55 |
424 | - __( 'sort by', 'event_espresso' ), |
|
424 | + __('sort by', 'event_espresso'), |
|
425 | 425 | |
426 | 426 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:45 |
427 | 427 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:54 |
428 | 428 | // Reference: packages/components/src/EntityList/filterBar/EntityListFilterBar.tsx:73 |
429 | - __( 'search', 'event_espresso' ), |
|
429 | + __('search', 'event_espresso'), |
|
430 | 430 | |
431 | 431 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:46 |
432 | 432 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:56 |
433 | - __( 'status', 'event_espresso' ), |
|
433 | + __('status', 'event_espresso'), |
|
434 | 434 | |
435 | 435 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:8 |
436 | - __( 'start dates only', 'event_espresso' ), |
|
436 | + __('start dates only', 'event_espresso'), |
|
437 | 437 | |
438 | 438 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:9 |
439 | - __( 'end dates only', 'event_espresso' ), |
|
439 | + __('end dates only', 'event_espresso'), |
|
440 | 440 | |
441 | 441 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/newDateOptions/AddSingleDate.tsx:20 |
442 | 442 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/newDateOptions/OptionsPopover.tsx:14 |
443 | 443 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/newDateOptions/OptionsPopoverButton.tsx:11 |
444 | - __( 'Add New Date', 'event_espresso' ), |
|
444 | + __('Add New Date', 'event_espresso'), |
|
445 | 445 | |
446 | 446 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/newDateOptions/AddSingleDate.tsx:20 |
447 | - __( 'Add Single Date', 'event_espresso' ), |
|
447 | + __('Add Single Date', 'event_espresso'), |
|
448 | 448 | |
449 | 449 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/newDateOptions/AddSingleDate.tsx:34 |
450 | - __( 'Add a single date |
|
451 | -that only occurs once', 'event_espresso' ), |
|
450 | + __('Add a single date |
|
451 | +that only occurs once', 'event_espresso'), |
|
452 | 452 | |
453 | 453 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/newDateOptions/AddSingleDate.tsx:36 |
454 | - __( 'Single Date', 'event_espresso' ), |
|
454 | + __('Single Date', 'event_espresso'), |
|
455 | 455 | |
456 | 456 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/tableView/useHeaderRowGenerator.tsx:104 |
457 | 457 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/tableView/useHeaderRowGenerator.tsx:103 |
458 | 458 | // Reference: packages/tpc/src/components/table/useHeaderRowGenerator.ts:53 |
459 | - __( 'Actions', 'event_espresso' ), |
|
459 | + __('Actions', 'event_espresso'), |
|
460 | 460 | |
461 | 461 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/tableView/useHeaderRowGenerator.tsx:52 |
462 | - __( 'Start', 'event_espresso' ), |
|
462 | + __('Start', 'event_espresso'), |
|
463 | 463 | |
464 | 464 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/tableView/useHeaderRowGenerator.tsx:63 |
465 | - __( 'End', 'event_espresso' ), |
|
465 | + __('End', 'event_espresso'), |
|
466 | 466 | |
467 | 467 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/tableView/useHeaderRowGenerator.tsx:75 |
468 | - __( 'Cap', 'event_espresso' ), |
|
468 | + __('Cap', 'event_espresso'), |
|
469 | 469 | |
470 | 470 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/tableView/useHeaderRowGenerator.tsx:83 |
471 | 471 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/tableView/useHeaderRowGenerator.tsx:85 |
472 | - __( 'Sold', 'event_espresso' ), |
|
472 | + __('Sold', 'event_espresso'), |
|
473 | 473 | |
474 | 474 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/tableView/useHeaderRowGenerator.tsx:92 |
475 | - __( 'Reg list', 'event_espresso' ), |
|
475 | + __('Reg list', 'event_espresso'), |
|
476 | 476 | |
477 | 477 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/tableView/useHeaderRowGenerator.tsx:93 |
478 | 478 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/tableView/useHeaderRowGenerator.tsx:95 |
479 | - __( 'Regs', 'event_espresso' ), |
|
479 | + __('Regs', 'event_espresso'), |
|
480 | 480 | |
481 | 481 | // Reference: domains/eventEditor/src/ui/ticketAssignmentsManager/components/ErrorMessage.tsx:18 |
482 | - __( 'Tickets must always have at least one date assigned to them but one or more of the tickets below does not have any. Please correct the assignments for the highlighted cells.', 'event_espresso' ), |
|
482 | + __('Tickets must always have at least one date assigned to them but one or more of the tickets below does not have any. Please correct the assignments for the highlighted cells.', 'event_espresso'), |
|
483 | 483 | |
484 | 484 | // Reference: domains/eventEditor/src/ui/ticketAssignmentsManager/components/ErrorMessage.tsx:22 |
485 | - __( 'Event Dates must always have at least one Ticket assigned to them but one or more of the Event Dates below does not have any. Please correct the assignments for the highlighted cells.', 'event_espresso' ), |
|
485 | + __('Event Dates must always have at least one Ticket assigned to them but one or more of the Event Dates below does not have any. Please correct the assignments for the highlighted cells.', 'event_espresso'), |
|
486 | 486 | |
487 | 487 | // Reference: domains/eventEditor/src/ui/ticketAssignmentsManager/components/ModalContainer.tsx:20 |
488 | - __( 'Ticket Assignment Manager for Datetime: %s - %s', 'event_espresso' ), |
|
488 | + __('Ticket Assignment Manager for Datetime: %s - %s', 'event_espresso'), |
|
489 | 489 | |
490 | 490 | // Reference: domains/eventEditor/src/ui/ticketAssignmentsManager/components/ModalContainer.tsx:22 |
491 | - __( 'Ticket Assignment Manager for Ticket: %s - %s', 'event_espresso' ), |
|
491 | + __('Ticket Assignment Manager for Ticket: %s - %s', 'event_espresso'), |
|
492 | 492 | |
493 | 493 | // Reference: domains/eventEditor/src/ui/ticketAssignmentsManager/components/TicketAssignmentsManagerModal/buttons/useCancelButtonProps.tsx:18 |
494 | 494 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/prices/buttons/FooterButtons.tsx:16 |
495 | 495 | // Reference: packages/components/src/Modal/useCancelButtonProps.tsx:10 |
496 | - __( 'Cancel', 'event_espresso' ), |
|
496 | + __('Cancel', 'event_espresso'), |
|
497 | 497 | |
498 | 498 | // Reference: domains/eventEditor/src/ui/ticketAssignmentsManager/components/TicketAssignmentsManagerModal/buttons/useSubmitButtonProps.tsx:25 |
499 | 499 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/prices/buttons/FooterButtons.tsx:17 |
@@ -502,767 +502,767 @@ discard block |
||
502 | 502 | // Reference: packages/components/src/bulkEdit/details/Submit.tsx:38 |
503 | 503 | // Reference: packages/form/src/Submit.tsx:26 |
504 | 504 | // Reference: packages/tpc/src/buttons/useSubmitButtonProps.tsx:25 |
505 | - __( 'Submit', 'event_espresso' ), |
|
505 | + __('Submit', 'event_espresso'), |
|
506 | 506 | |
507 | 507 | // Reference: domains/eventEditor/src/ui/ticketAssignmentsManager/components/TicketAssignmentsManagerModal/index.tsx:32 |
508 | 508 | // Reference: domains/eventEditor/src/ui/ticketAssignmentsManager/components/table/Table.tsx:14 |
509 | - __( 'Ticket Assignment Manager', 'event_espresso' ), |
|
509 | + __('Ticket Assignment Manager', 'event_espresso'), |
|
510 | 510 | |
511 | 511 | // Reference: domains/eventEditor/src/ui/ticketAssignmentsManager/components/table/BodyCell.tsx:24 |
512 | - __( 'assign ticket', 'event_espresso' ), |
|
512 | + __('assign ticket', 'event_espresso'), |
|
513 | 513 | |
514 | 514 | // Reference: domains/eventEditor/src/ui/ticketAssignmentsManager/filters/controls/DatesByMonthControl.tsx:19 |
515 | - __( 'All Dates', 'event_espresso' ), |
|
515 | + __('All Dates', 'event_espresso'), |
|
516 | 516 | |
517 | 517 | // Reference: domains/eventEditor/src/ui/ticketAssignmentsManager/filters/controls/DatesByMonthControl.tsx:26 |
518 | - __( 'dates by month', 'event_espresso' ), |
|
518 | + __('dates by month', 'event_espresso'), |
|
519 | 519 | |
520 | 520 | // Reference: domains/eventEditor/src/ui/ticketAssignmentsManager/filters/controls/ShowExpiredTicketsControl.tsx:15 |
521 | - __( 'show expired tickets', 'event_espresso' ), |
|
521 | + __('show expired tickets', 'event_espresso'), |
|
522 | 522 | |
523 | 523 | // Reference: domains/eventEditor/src/ui/ticketAssignmentsManager/filters/controls/ShowTrashedDatesControl.tsx:12 |
524 | - __( 'show trashed dates', 'event_espresso' ), |
|
524 | + __('show trashed dates', 'event_espresso'), |
|
525 | 525 | |
526 | 526 | // Reference: domains/eventEditor/src/ui/ticketAssignmentsManager/filters/controls/ShowTrashedTicketsControl.tsx:15 |
527 | - __( 'show trashed tickets', 'event_espresso' ), |
|
527 | + __('show trashed tickets', 'event_espresso'), |
|
528 | 528 | |
529 | 529 | // Reference: domains/eventEditor/src/ui/tickets/TicketRegistrationsLink.tsx:17 |
530 | - __( 'total registrations.', 'event_espresso' ), |
|
530 | + __('total registrations.', 'event_espresso'), |
|
531 | 531 | |
532 | 532 | // Reference: domains/eventEditor/src/ui/tickets/TicketRegistrationsLink.tsx:18 |
533 | - __( 'view ALL registrations for this ticket.', 'event_espresso' ), |
|
533 | + __('view ALL registrations for this ticket.', 'event_espresso'), |
|
534 | 534 | |
535 | 535 | // Reference: domains/eventEditor/src/ui/tickets/ticketForm/multiStep/Container.tsx:18 |
536 | - __( 'Edit ticket %s', 'event_espresso' ), |
|
536 | + __('Edit ticket %s', 'event_espresso'), |
|
537 | 537 | |
538 | 538 | // Reference: domains/eventEditor/src/ui/tickets/ticketForm/multiStep/Container.tsx:18 |
539 | - __( 'New Ticket Details', 'event_espresso' ), |
|
539 | + __('New Ticket Details', 'event_espresso'), |
|
540 | 540 | |
541 | 541 | // Reference: domains/eventEditor/src/ui/tickets/ticketForm/multiStep/ContentBody.tsx:44 |
542 | - __( 'Add ticket prices', 'event_espresso' ), |
|
542 | + __('Add ticket prices', 'event_espresso'), |
|
543 | 543 | |
544 | 544 | // Reference: domains/eventEditor/src/ui/tickets/ticketForm/multiStep/ContentBody.tsx:50 |
545 | - __( 'Skip prices - assign dates', 'event_espresso' ), |
|
545 | + __('Skip prices - assign dates', 'event_espresso'), |
|
546 | 546 | |
547 | 547 | // Reference: domains/eventEditor/src/ui/tickets/ticketForm/multiStep/ContentBody.tsx:66 |
548 | - __( 'Save and assign dates', 'event_espresso' ), |
|
548 | + __('Save and assign dates', 'event_espresso'), |
|
549 | 549 | |
550 | 550 | // Reference: domains/eventEditor/src/ui/tickets/ticketForm/multiStep/ContentBody.tsx:79 |
551 | - __( 'Ticket details', 'event_espresso' ), |
|
551 | + __('Ticket details', 'event_espresso'), |
|
552 | 552 | |
553 | 553 | // Reference: domains/eventEditor/src/ui/tickets/ticketForm/multiStep/TicketFormSteps.tsx:11 |
554 | - __( 'primary information about the ticket', 'event_espresso' ), |
|
554 | + __('primary information about the ticket', 'event_espresso'), |
|
555 | 555 | |
556 | 556 | // Reference: domains/eventEditor/src/ui/tickets/ticketForm/multiStep/TicketFormSteps.tsx:11 |
557 | - __( 'Ticket Details', 'event_espresso' ), |
|
557 | + __('Ticket Details', 'event_espresso'), |
|
558 | 558 | |
559 | 559 | // Reference: domains/eventEditor/src/ui/tickets/ticketForm/multiStep/TicketFormSteps.tsx:13 |
560 | - __( 'apply ticket price modifiers and taxes', 'event_espresso' ), |
|
560 | + __('apply ticket price modifiers and taxes', 'event_espresso'), |
|
561 | 561 | |
562 | 562 | // Reference: domains/eventEditor/src/ui/tickets/ticketForm/multiStep/TicketFormSteps.tsx:15 |
563 | - __( 'Price Calculator', 'event_espresso' ), |
|
563 | + __('Price Calculator', 'event_espresso'), |
|
564 | 564 | |
565 | 565 | // Reference: domains/eventEditor/src/ui/tickets/ticketForm/multiStep/TicketFormSteps.tsx:17 |
566 | - __( 'Assign Dates', 'event_espresso' ), |
|
566 | + __('Assign Dates', 'event_espresso'), |
|
567 | 567 | |
568 | 568 | // Reference: domains/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.tsx:100 |
569 | - __( 'Ticket Sales', 'event_espresso' ), |
|
569 | + __('Ticket Sales', 'event_espresso'), |
|
570 | 570 | |
571 | 571 | // Reference: domains/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.tsx:123 |
572 | 572 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/details/useBulkEditFormConfig.ts:112 |
573 | - __( 'Quantity For Sale', 'event_espresso' ), |
|
573 | + __('Quantity For Sale', 'event_espresso'), |
|
574 | 574 | |
575 | 575 | // Reference: domains/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.tsx:129 |
576 | - __( 'The maximum number of this ticket available for sale.%sSet to 0 to stop sales, or leave blank for no limit.', 'event_espresso' ), |
|
576 | + __('The maximum number of this ticket available for sale.%sSet to 0 to stop sales, or leave blank for no limit.', 'event_espresso'), |
|
577 | 577 | |
578 | 578 | // Reference: domains/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.tsx:138 |
579 | 579 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/details/useBulkEditFormConfig.ts:121 |
580 | - __( 'Number of Uses', 'event_espresso' ), |
|
580 | + __('Number of Uses', 'event_espresso'), |
|
581 | 581 | |
582 | 582 | // Reference: domains/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.tsx:144 |
583 | - __( 'Controls the total number of times this ticket can be used, regardless of the number of dates it is assigned to.%sExample: A ticket might have access to 4 different dates, but setting this field to 2 would mean that the ticket could only be used twice. Leave blank for no limit.', 'event_espresso' ), |
|
583 | + __('Controls the total number of times this ticket can be used, regardless of the number of dates it is assigned to.%sExample: A ticket might have access to 4 different dates, but setting this field to 2 would mean that the ticket could only be used twice. Leave blank for no limit.', 'event_espresso'), |
|
584 | 584 | |
585 | 585 | // Reference: domains/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.tsx:153 |
586 | 586 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/details/useBulkEditFormConfig.ts:129 |
587 | - __( 'Minimum Quantity', 'event_espresso' ), |
|
587 | + __('Minimum Quantity', 'event_espresso'), |
|
588 | 588 | |
589 | 589 | // Reference: domains/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.tsx:158 |
590 | - __( 'The minimum quantity that can be selected for this ticket. Use this to create ticket bundles or graduated pricing.%sLeave blank for no minimum.', 'event_espresso' ), |
|
590 | + __('The minimum quantity that can be selected for this ticket. Use this to create ticket bundles or graduated pricing.%sLeave blank for no minimum.', 'event_espresso'), |
|
591 | 591 | |
592 | 592 | // Reference: domains/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.tsx:167 |
593 | 593 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/details/useBulkEditFormConfig.ts:137 |
594 | - __( 'Maximum Quantity', 'event_espresso' ), |
|
594 | + __('Maximum Quantity', 'event_espresso'), |
|
595 | 595 | |
596 | 596 | // Reference: domains/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.tsx:173 |
597 | - __( 'The maximum quantity that can be selected for this ticket. Use this to create ticket bundles or graduated pricing.%sLeave blank for no maximum.', 'event_espresso' ), |
|
597 | + __('The maximum quantity that can be selected for this ticket. Use this to create ticket bundles or graduated pricing.%sLeave blank for no maximum.', 'event_espresso'), |
|
598 | 598 | |
599 | 599 | // Reference: domains/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.tsx:182 |
600 | 600 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/details/useBulkEditFormConfig.ts:146 |
601 | - __( 'Required Ticket', 'event_espresso' ), |
|
601 | + __('Required Ticket', 'event_espresso'), |
|
602 | 602 | |
603 | 603 | // Reference: domains/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.tsx:184 |
604 | - __( 'If enabled, the ticket must be selected and will appear first in frontend ticket lists.', 'event_espresso' ), |
|
604 | + __('If enabled, the ticket must be selected and will appear first in frontend ticket lists.', 'event_espresso'), |
|
605 | 605 | |
606 | 606 | // Reference: domains/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.tsx:191 |
607 | - __( 'Default Ticket', 'event_espresso' ), |
|
607 | + __('Default Ticket', 'event_espresso'), |
|
608 | 608 | |
609 | 609 | // Reference: domains/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.tsx:193 |
610 | - __( 'If enabled, the ticket will appear on all new events.', 'event_espresso' ), |
|
610 | + __('If enabled, the ticket will appear on all new events.', 'event_espresso'), |
|
611 | 611 | |
612 | 612 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/TicketsList.tsx:34 |
613 | - __( 'Available Tickets', 'event_espresso' ), |
|
613 | + __('Available Tickets', 'event_espresso'), |
|
614 | 614 | |
615 | 615 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/TicketsList.tsx:37 |
616 | - __( 'loading tickets...', 'event_espresso' ), |
|
616 | + __('loading tickets...', 'event_espresso'), |
|
617 | 617 | |
618 | 618 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/actionsMenu/AssignDatesButton.tsx:27 |
619 | - __( 'Number of related dates', 'event_espresso' ), |
|
619 | + __('Number of related dates', 'event_espresso'), |
|
620 | 620 | |
621 | 621 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/actionsMenu/AssignDatesButton.tsx:28 |
622 | - __( 'There are no event dates assigned to this ticket. Please click the calendar icon to update the assignments.', 'event_espresso' ), |
|
622 | + __('There are no event dates assigned to this ticket. Please click the calendar icon to update the assignments.', 'event_espresso'), |
|
623 | 623 | |
624 | 624 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/actionsMenu/AssignDatesButton.tsx:44 |
625 | - __( 'assign dates', 'event_espresso' ), |
|
625 | + __('assign dates', 'event_espresso'), |
|
626 | 626 | |
627 | 627 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/actionsMenu/dropdown/TicketMainMenu.tsx:17 |
628 | - __( 'Permanently delete Ticket?', 'event_espresso' ), |
|
628 | + __('Permanently delete Ticket?', 'event_espresso'), |
|
629 | 629 | |
630 | 630 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/actionsMenu/dropdown/TicketMainMenu.tsx:17 |
631 | - __( 'Move Ticket to Trash?', 'event_espresso' ), |
|
631 | + __('Move Ticket to Trash?', 'event_espresso'), |
|
632 | 632 | |
633 | 633 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/actionsMenu/dropdown/TicketMainMenu.tsx:19 |
634 | - __( 'Are you sure you want to permanently delete this ticket? This action is permanent and can not be undone.', 'event_espresso' ), |
|
634 | + __('Are you sure you want to permanently delete this ticket? This action is permanent and can not be undone.', 'event_espresso'), |
|
635 | 635 | |
636 | 636 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/actionsMenu/dropdown/TicketMainMenu.tsx:20 |
637 | - __( 'Are you sure you want to move this ticket to the trash? You can "untrash" this ticket later if you need to.', 'event_espresso' ), |
|
637 | + __('Are you sure you want to move this ticket to the trash? You can "untrash" this ticket later if you need to.', 'event_espresso'), |
|
638 | 638 | |
639 | 639 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/actionsMenu/dropdown/TicketMainMenu.tsx:29 |
640 | - __( 'ticket main menu', 'event_espresso' ), |
|
640 | + __('ticket main menu', 'event_espresso'), |
|
641 | 641 | |
642 | 642 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/actionsMenu/dropdown/TicketMainMenu.tsx:33 |
643 | - __( 'trash ticket', 'event_espresso' ), |
|
643 | + __('trash ticket', 'event_espresso'), |
|
644 | 644 | |
645 | 645 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/actionsMenu/dropdown/TicketMainMenu.tsx:42 |
646 | - __( 'edit ticket', 'event_espresso' ), |
|
646 | + __('edit ticket', 'event_espresso'), |
|
647 | 647 | |
648 | 648 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/actionsMenu/dropdown/TicketMainMenu.tsx:43 |
649 | - __( 'copy ticket', 'event_espresso' ), |
|
649 | + __('copy ticket', 'event_espresso'), |
|
650 | 650 | |
651 | 651 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/actions/Actions.tsx:30 |
652 | 652 | // Reference: packages/components/src/bulkEdit/BulkActions.tsx:43 |
653 | - __( 'bulk actions', 'event_espresso' ), |
|
653 | + __('bulk actions', 'event_espresso'), |
|
654 | 654 | |
655 | 655 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/actions/Actions.tsx:34 |
656 | - __( 'edit ticket details', 'event_espresso' ), |
|
656 | + __('edit ticket details', 'event_espresso'), |
|
657 | 657 | |
658 | 658 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/actions/Actions.tsx:38 |
659 | - __( 'delete tickets', 'event_espresso' ), |
|
659 | + __('delete tickets', 'event_espresso'), |
|
660 | 660 | |
661 | 661 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/actions/Actions.tsx:38 |
662 | - __( 'trash tickets', 'event_espresso' ), |
|
662 | + __('trash tickets', 'event_espresso'), |
|
663 | 663 | |
664 | 664 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/actions/Actions.tsx:42 |
665 | - __( 'edit ticket prices', 'event_espresso' ), |
|
665 | + __('edit ticket prices', 'event_espresso'), |
|
666 | 666 | |
667 | 667 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/delete/Delete.tsx:13 |
668 | - __( 'Are you sure you want to permanently delete these tickets? This action can NOT be undone!', 'event_espresso' ), |
|
668 | + __('Are you sure you want to permanently delete these tickets? This action can NOT be undone!', 'event_espresso'), |
|
669 | 669 | |
670 | 670 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/delete/Delete.tsx:14 |
671 | - __( 'Are you sure you want to trash these tickets?', 'event_espresso' ), |
|
671 | + __('Are you sure you want to trash these tickets?', 'event_espresso'), |
|
672 | 672 | |
673 | 673 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/delete/Delete.tsx:15 |
674 | - __( 'Delete tickets permanently', 'event_espresso' ), |
|
674 | + __('Delete tickets permanently', 'event_espresso'), |
|
675 | 675 | |
676 | 676 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/delete/Delete.tsx:15 |
677 | - __( 'Trash tickets', 'event_espresso' ), |
|
677 | + __('Trash tickets', 'event_espresso'), |
|
678 | 678 | |
679 | 679 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/details/EditDetails.tsx:22 |
680 | - __( 'Bulk edit ticket details', 'event_espresso' ), |
|
680 | + __('Bulk edit ticket details', 'event_espresso'), |
|
681 | 681 | |
682 | 682 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/details/EditDetails.tsx:23 |
683 | - __( 'any changes will be applied to ALL of the selected tickets.', 'event_espresso' ), |
|
683 | + __('any changes will be applied to ALL of the selected tickets.', 'event_espresso'), |
|
684 | 684 | |
685 | 685 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/prices/EditPrices.tsx:18 |
686 | - __( 'Bulk edit ticket prices', 'event_espresso' ), |
|
686 | + __('Bulk edit ticket prices', 'event_espresso'), |
|
687 | 687 | |
688 | 688 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/prices/buttons/EditModeButtons.tsx:18 |
689 | - __( 'Edit all prices together', 'event_espresso' ), |
|
689 | + __('Edit all prices together', 'event_espresso'), |
|
690 | 690 | |
691 | 691 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/prices/buttons/EditModeButtons.tsx:19 |
692 | - __( 'Edit all the selected ticket prices dynamically', 'event_espresso' ), |
|
692 | + __('Edit all the selected ticket prices dynamically', 'event_espresso'), |
|
693 | 693 | |
694 | 694 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/prices/buttons/EditModeButtons.tsx:23 |
695 | - __( 'Edit prices individually', 'event_espresso' ), |
|
695 | + __('Edit prices individually', 'event_espresso'), |
|
696 | 696 | |
697 | 697 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/prices/buttons/EditModeButtons.tsx:24 |
698 | - __( 'Edit prices for each ticket individually', 'event_espresso' ), |
|
698 | + __('Edit prices for each ticket individually', 'event_espresso'), |
|
699 | 699 | |
700 | 700 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/prices/buttons/FooterButtons.tsx:15 |
701 | 701 | // Reference: packages/components/src/bulkEdit/details/Submit.tsx:45 |
702 | 702 | // Reference: packages/form/src/ResetButton.tsx:17 |
703 | 703 | // Reference: packages/tpc/src/buttons/useResetButtonProps.tsx:12 |
704 | - __( 'Reset', 'event_espresso' ), |
|
704 | + __('Reset', 'event_espresso'), |
|
705 | 705 | |
706 | 706 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/prices/editSeparately/TPCInstance.tsx:22 |
707 | - __( 'Edit prices for Ticket: %s', 'event_espresso' ), |
|
707 | + __('Edit prices for Ticket: %s', 'event_espresso'), |
|
708 | 708 | |
709 | 709 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/cardView/TicketCardSidebar.tsx:36 |
710 | - __( 'Edit Ticket Sale Dates', 'event_espresso' ), |
|
710 | + __('Edit Ticket Sale Dates', 'event_espresso'), |
|
711 | 711 | |
712 | 712 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/cardView/TicketCardSidebar.tsx:38 |
713 | - __( 'edit ticket sales start and end dates', 'event_espresso' ), |
|
713 | + __('edit ticket sales start and end dates', 'event_espresso'), |
|
714 | 714 | |
715 | 715 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/cardView/TicketDetailsPanel.tsx:27 |
716 | - __( 'quantity', 'event_espresso' ), |
|
716 | + __('quantity', 'event_espresso'), |
|
717 | 717 | |
718 | 718 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/cardView/TicketQuantity.tsx:26 |
719 | - __( 'edit quantity of tickets available...', 'event_espresso' ), |
|
719 | + __('edit quantity of tickets available...', 'event_espresso'), |
|
720 | 720 | |
721 | 721 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/config.ts:15 |
722 | 722 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/tableView/useHeaderRowGenerator.tsx:51 |
723 | - __( 'On Sale', 'event_espresso' ), |
|
723 | + __('On Sale', 'event_espresso'), |
|
724 | 724 | |
725 | 725 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/config.ts:17 |
726 | - __( 'Pending', 'event_espresso' ), |
|
726 | + __('Pending', 'event_espresso'), |
|
727 | 727 | |
728 | 728 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/editable/EditablePrice.tsx:31 |
729 | - __( 'set price...', 'event_espresso' ), |
|
729 | + __('set price...', 'event_espresso'), |
|
730 | 730 | |
731 | 731 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/editable/EditablePrice.tsx:35 |
732 | - __( 'edit ticket total...', 'event_espresso' ), |
|
732 | + __('edit ticket total...', 'event_espresso'), |
|
733 | 733 | |
734 | 734 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/IsChainedButton.tsx:24 |
735 | - __( 'tickets list is linked to dates list and is showing tickets for above dates only', 'event_espresso' ), |
|
735 | + __('tickets list is linked to dates list and is showing tickets for above dates only', 'event_espresso'), |
|
736 | 736 | |
737 | 737 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/IsChainedButton.tsx:25 |
738 | - __( 'tickets list is unlinked and is showing tickets for all event dates', 'event_espresso' ), |
|
738 | + __('tickets list is unlinked and is showing tickets for all event dates', 'event_espresso'), |
|
739 | 739 | |
740 | 740 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:10 |
741 | - __( 'ticket sales start and end dates', 'event_espresso' ), |
|
741 | + __('ticket sales start and end dates', 'event_espresso'), |
|
742 | 742 | |
743 | 743 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:15 |
744 | - __( 'tickets with 90% or more sold', 'event_espresso' ), |
|
744 | + __('tickets with 90% or more sold', 'event_espresso'), |
|
745 | 745 | |
746 | 746 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:16 |
747 | - __( 'tickets with 75% or more sold', 'event_espresso' ), |
|
747 | + __('tickets with 75% or more sold', 'event_espresso'), |
|
748 | 748 | |
749 | 749 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:17 |
750 | - __( 'tickets with 50% or more sold', 'event_espresso' ), |
|
750 | + __('tickets with 50% or more sold', 'event_espresso'), |
|
751 | 751 | |
752 | 752 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:18 |
753 | - __( 'tickets with less than 50% sold', 'event_espresso' ), |
|
753 | + __('tickets with less than 50% sold', 'event_espresso'), |
|
754 | 754 | |
755 | 755 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:27 |
756 | - __( 'all tickets for all dates', 'event_espresso' ), |
|
756 | + __('all tickets for all dates', 'event_espresso'), |
|
757 | 757 | |
758 | 758 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:28 |
759 | - __( 'all on sale and sale pending', 'event_espresso' ), |
|
759 | + __('all on sale and sale pending', 'event_espresso'), |
|
760 | 760 | |
761 | 761 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:29 |
762 | - __( 'on sale tickets only', 'event_espresso' ), |
|
762 | + __('on sale tickets only', 'event_espresso'), |
|
763 | 763 | |
764 | 764 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:30 |
765 | - __( 'sale pending tickets only', 'event_espresso' ), |
|
765 | + __('sale pending tickets only', 'event_espresso'), |
|
766 | 766 | |
767 | 767 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:31 |
768 | - __( 'next on sale or sale pending only', 'event_espresso' ), |
|
768 | + __('next on sale or sale pending only', 'event_espresso'), |
|
769 | 769 | |
770 | 770 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:32 |
771 | - __( 'sold out tickets only', 'event_espresso' ), |
|
771 | + __('sold out tickets only', 'event_espresso'), |
|
772 | 772 | |
773 | 773 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:33 |
774 | - __( 'expired tickets only', 'event_espresso' ), |
|
774 | + __('expired tickets only', 'event_espresso'), |
|
775 | 775 | |
776 | 776 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:34 |
777 | - __( 'trashed tickets only', 'event_espresso' ), |
|
777 | + __('trashed tickets only', 'event_espresso'), |
|
778 | 778 | |
779 | 779 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:39 |
780 | - __( 'all tickets for above dates', 'event_espresso' ), |
|
780 | + __('all tickets for above dates', 'event_espresso'), |
|
781 | 781 | |
782 | 782 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:43 |
783 | - __( 'ticket sale date', 'event_espresso' ), |
|
783 | + __('ticket sale date', 'event_espresso'), |
|
784 | 784 | |
785 | 785 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:44 |
786 | - __( 'ticket name', 'event_espresso' ), |
|
786 | + __('ticket name', 'event_espresso'), |
|
787 | 787 | |
788 | 788 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:45 |
789 | - __( 'ticket ID', 'event_espresso' ), |
|
789 | + __('ticket ID', 'event_espresso'), |
|
790 | 790 | |
791 | 791 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:52 |
792 | - __( 'link', 'event_espresso' ), |
|
792 | + __('link', 'event_espresso'), |
|
793 | 793 | |
794 | 794 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:8 |
795 | - __( 'ticket sales start date only', 'event_espresso' ), |
|
795 | + __('ticket sales start date only', 'event_espresso'), |
|
796 | 796 | |
797 | 797 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:9 |
798 | - __( 'ticket sales end date only', 'event_espresso' ), |
|
798 | + __('ticket sales end date only', 'event_espresso'), |
|
799 | 799 | |
800 | 800 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/newTicketOptions/AddSingleTicket.tsx:19 |
801 | - __( 'Add New Ticket', 'event_espresso' ), |
|
801 | + __('Add New Ticket', 'event_espresso'), |
|
802 | 802 | |
803 | 803 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/newTicketOptions/AddSingleTicket.tsx:31 |
804 | - __( 'Single Ticket', 'event_espresso' ), |
|
804 | + __('Single Ticket', 'event_espresso'), |
|
805 | 805 | |
806 | 806 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/newTicketOptions/AddSingleTicket.tsx:33 |
807 | - __( 'Add a single ticket and assign the dates to it', 'event_espresso' ), |
|
807 | + __('Add a single ticket and assign the dates to it', 'event_espresso'), |
|
808 | 808 | |
809 | 809 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/tableView/TableView.tsx:32 |
810 | - __( 'Tickets', 'event_espresso' ), |
|
810 | + __('Tickets', 'event_espresso'), |
|
811 | 811 | |
812 | 812 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/tableView/useHeaderRowGenerator.tsx:50 |
813 | - __( 'Goes on Sale', 'event_espresso' ), |
|
813 | + __('Goes on Sale', 'event_espresso'), |
|
814 | 814 | |
815 | 815 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/tableView/useHeaderRowGenerator.tsx:61 |
816 | - __( 'Sale Ends', 'event_espresso' ), |
|
816 | + __('Sale Ends', 'event_espresso'), |
|
817 | 817 | |
818 | 818 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/tableView/useHeaderRowGenerator.tsx:62 |
819 | - __( 'Ends', 'event_espresso' ), |
|
819 | + __('Ends', 'event_espresso'), |
|
820 | 820 | |
821 | 821 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/tableView/useHeaderRowGenerator.tsx:71 |
822 | - __( 'Price', 'event_espresso' ), |
|
822 | + __('Price', 'event_espresso'), |
|
823 | 823 | |
824 | 824 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/tableView/useHeaderRowGenerator.tsx:78 |
825 | - __( 'Quantity', 'event_espresso' ), |
|
825 | + __('Quantity', 'event_espresso'), |
|
826 | 826 | |
827 | 827 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/tableView/useHeaderRowGenerator.tsx:94 |
828 | - __( 'Registrations', 'event_espresso' ), |
|
828 | + __('Registrations', 'event_espresso'), |
|
829 | 829 | |
830 | 830 | // Reference: domains/wpPluginsPage/src/exitSurvey/Popup.tsx:28 |
831 | - __( 'Do you have a moment to share why you are deactivating Event Espresso?', 'event_espresso' ), |
|
831 | + __('Do you have a moment to share why you are deactivating Event Espresso?', 'event_espresso'), |
|
832 | 832 | |
833 | 833 | // Reference: domains/wpPluginsPage/src/exitSurvey/Popup.tsx:39 |
834 | - __( 'Skip', 'event_espresso' ), |
|
834 | + __('Skip', 'event_espresso'), |
|
835 | 835 | |
836 | 836 | // Reference: domains/wpPluginsPage/src/exitSurvey/Popup.tsx:41 |
837 | - __( 'Sure I\'ll help', 'event_espresso' ), |
|
837 | + __('Sure I\'ll help', 'event_espresso'), |
|
838 | 838 | |
839 | 839 | // Reference: packages/adapters/src/Pagination/ItemRender.tsx:10 |
840 | - __( 'next', 'event_espresso' ), |
|
840 | + __('next', 'event_espresso'), |
|
841 | 841 | |
842 | 842 | // Reference: packages/adapters/src/Pagination/ItemRender.tsx:11 |
843 | - __( 'jump to previous', 'event_espresso' ), |
|
843 | + __('jump to previous', 'event_espresso'), |
|
844 | 844 | |
845 | 845 | // Reference: packages/adapters/src/Pagination/ItemRender.tsx:12 |
846 | - __( 'jump to next', 'event_espresso' ), |
|
846 | + __('jump to next', 'event_espresso'), |
|
847 | 847 | |
848 | 848 | // Reference: packages/adapters/src/Pagination/ItemRender.tsx:13 |
849 | - __( 'page', 'event_espresso' ), |
|
849 | + __('page', 'event_espresso'), |
|
850 | 850 | |
851 | 851 | // Reference: packages/adapters/src/Pagination/ItemRender.tsx:9 |
852 | - __( 'previous', 'event_espresso' ), |
|
852 | + __('previous', 'event_espresso'), |
|
853 | 853 | |
854 | 854 | // Reference: packages/adapters/src/Pagination/Pagination.tsx:38 |
855 | - __( 'pagination', 'event_espresso' ), |
|
855 | + __('pagination', 'event_espresso'), |
|
856 | 856 | |
857 | 857 | // Reference: packages/adapters/src/Pagination/PerPage.tsx:38 |
858 | - __( 'items per page', 'event_espresso' ), |
|
858 | + __('items per page', 'event_espresso'), |
|
859 | 859 | |
860 | 860 | // Reference: packages/adapters/src/Steps/Steps.tsx:30 |
861 | - __( 'Steps', 'event_espresso' ), |
|
861 | + __('Steps', 'event_espresso'), |
|
862 | 862 | |
863 | 863 | // Reference: packages/components/src/ActiveFilters/ActiveFilters.tsx:8 |
864 | - __( 'active filters:', 'event_espresso' ), |
|
864 | + __('active filters:', 'event_espresso'), |
|
865 | 865 | |
866 | 866 | // Reference: packages/components/src/ActiveFilters/FilterTag.tsx:9 |
867 | - __( 'remove filter - %s', 'event_espresso' ), |
|
867 | + __('remove filter - %s', 'event_espresso'), |
|
868 | 868 | |
869 | 869 | // Reference: packages/components/src/CalendarDateRange/CalendarDateRange.tsx:39 |
870 | - __( 'to', 'event_espresso' ), |
|
870 | + __('to', 'event_espresso'), |
|
871 | 871 | |
872 | 872 | // Reference: packages/components/src/CalendarDateSwitcher/CalendarDateSwitcher.tsx:33 |
873 | - __( 'starts', 'event_espresso' ), |
|
873 | + __('starts', 'event_espresso'), |
|
874 | 874 | |
875 | 875 | // Reference: packages/components/src/CalendarDateSwitcher/CalendarDateSwitcher.tsx:45 |
876 | - __( 'ends', 'event_espresso' ), |
|
876 | + __('ends', 'event_espresso'), |
|
877 | 877 | |
878 | 878 | // Reference: packages/components/src/CalendarPageDate/CalendarPageDate.tsx:57 |
879 | - __( 'TO', 'event_espresso' ), |
|
879 | + __('TO', 'event_espresso'), |
|
880 | 880 | |
881 | 881 | // Reference: packages/components/src/Confirm/ConfirmClose.tsx:8 |
882 | 882 | // Reference: packages/components/src/Modal/ModalWithAlert.tsx:23 |
883 | - __( 'Are you sure you want to close this?', 'event_espresso' ), |
|
883 | + __('Are you sure you want to close this?', 'event_espresso'), |
|
884 | 884 | |
885 | 885 | // Reference: packages/components/src/Confirm/ConfirmDelete.tsx:8 |
886 | - __( 'Are you sure you want to delete this?', 'event_espresso' ), |
|
886 | + __('Are you sure you want to delete this?', 'event_espresso'), |
|
887 | 887 | |
888 | 888 | // Reference: packages/components/src/Confirm/useConfirmWithButton.tsx:11 |
889 | - __( 'Please confirm this action.', 'event_espresso' ), |
|
889 | + __('Please confirm this action.', 'event_espresso'), |
|
890 | 890 | |
891 | 891 | // Reference: packages/components/src/Confirm/useConfirmationDialog.tsx:35 |
892 | - __( 'No', 'event_espresso' ), |
|
892 | + __('No', 'event_espresso'), |
|
893 | 893 | |
894 | 894 | // Reference: packages/components/src/Confirm/useConfirmationDialog.tsx:36 |
895 | - __( 'Yes', 'event_espresso' ), |
|
895 | + __('Yes', 'event_espresso'), |
|
896 | 896 | |
897 | 897 | // Reference: packages/components/src/DateTimeRangePicker/index.tsx:48 |
898 | - __( 'save', 'event_espresso' ), |
|
898 | + __('save', 'event_espresso'), |
|
899 | 899 | |
900 | 900 | // Reference: packages/components/src/DebugInfo/DebugInfo.tsx:36 |
901 | - __( 'Hide Debug Info', 'event_espresso' ), |
|
901 | + __('Hide Debug Info', 'event_espresso'), |
|
902 | 902 | |
903 | 903 | // Reference: packages/components/src/DebugInfo/DebugInfo.tsx:36 |
904 | - __( 'Show Debug Info', 'event_espresso' ), |
|
904 | + __('Show Debug Info', 'event_espresso'), |
|
905 | 905 | |
906 | 906 | // Reference: packages/components/src/EditDateRangeButton/index.tsx:41 |
907 | - __( 'Edit Start and End Dates and Times', 'event_espresso' ), |
|
907 | + __('Edit Start and End Dates and Times', 'event_espresso'), |
|
908 | 908 | |
909 | 909 | // Reference: packages/components/src/EntityActionsMenu/entityMenuItems/Copy.tsx:9 |
910 | - __( 'copy', 'event_espresso' ), |
|
910 | + __('copy', 'event_espresso'), |
|
911 | 911 | |
912 | 912 | // Reference: packages/components/src/EntityActionsMenu/entityMenuItems/Edit.tsx:9 |
913 | - __( 'edit', 'event_espresso' ), |
|
913 | + __('edit', 'event_espresso'), |
|
914 | 914 | |
915 | 915 | // Reference: packages/components/src/EntityActionsMenu/entityMenuItems/Trash.tsx:9 |
916 | - __( 'trash', 'event_espresso' ), |
|
916 | + __('trash', 'event_espresso'), |
|
917 | 917 | |
918 | 918 | // Reference: packages/components/src/EntityDetailsPanel/EntityDetailsPanelSold.tsx:36 |
919 | - __( 'view approved registrations for this date.', 'event_espresso' ), |
|
919 | + __('view approved registrations for this date.', 'event_espresso'), |
|
920 | 920 | |
921 | 921 | // Reference: packages/components/src/EntityDetailsPanel/EntityDetailsPanelSold.tsx:37 |
922 | - __( 'view approved registrations for this ticket.', 'event_espresso' ), |
|
922 | + __('view approved registrations for this ticket.', 'event_espresso'), |
|
923 | 923 | |
924 | 924 | // Reference: packages/components/src/EntityList/EntityList.tsx:38 |
925 | - __( 'no results found', 'event_espresso' ), |
|
925 | + __('no results found', 'event_espresso'), |
|
926 | 926 | |
927 | 927 | // Reference: packages/components/src/EntityList/EntityList.tsx:39 |
928 | - __( 'try changing filter settings', 'event_espresso' ), |
|
928 | + __('try changing filter settings', 'event_espresso'), |
|
929 | 929 | |
930 | 930 | // Reference: packages/components/src/EntityList/filterBar/buttons/CardViewFilterButton.tsx:22 |
931 | - __( 'card view', 'event_espresso' ), |
|
931 | + __('card view', 'event_espresso'), |
|
932 | 932 | |
933 | 933 | // Reference: packages/components/src/EntityList/filterBar/buttons/TableViewFilterButton.tsx:22 |
934 | - __( 'table view', 'event_espresso' ), |
|
934 | + __('table view', 'event_espresso'), |
|
935 | 935 | |
936 | 936 | // Reference: packages/components/src/EntityList/filterBar/buttons/ToggleFiltersButton.tsx:11 |
937 | - __( 'hide filters', 'event_espresso' ), |
|
937 | + __('hide filters', 'event_espresso'), |
|
938 | 938 | |
939 | 939 | // Reference: packages/components/src/EntityList/filterBar/buttons/ToggleFiltersButton.tsx:11 |
940 | - __( 'show filters', 'event_espresso' ), |
|
940 | + __('show filters', 'event_espresso'), |
|
941 | 941 | |
942 | 942 | // Reference: packages/components/src/EntityList/filterBar/buttons/ToggleSortingButton.tsx:28 |
943 | - __( 'disable sorting', 'event_espresso' ), |
|
943 | + __('disable sorting', 'event_espresso'), |
|
944 | 944 | |
945 | 945 | // Reference: packages/components/src/EntityList/filterBar/buttons/ToggleSortingButton.tsx:28 |
946 | - __( 'enable sorting', 'event_espresso' ), |
|
946 | + __('enable sorting', 'event_espresso'), |
|
947 | 947 | |
948 | 948 | // Reference: packages/components/src/Legend/ToggleLegendButton.tsx:27 |
949 | - __( 'hide legend', 'event_espresso' ), |
|
949 | + __('hide legend', 'event_espresso'), |
|
950 | 950 | |
951 | 951 | // Reference: packages/components/src/Legend/ToggleLegendButton.tsx:27 |
952 | - __( 'show legend', 'event_espresso' ), |
|
952 | + __('show legend', 'event_espresso'), |
|
953 | 953 | |
954 | 954 | // Reference: packages/components/src/LoadingIndicator/LoadingIndicator.tsx:7 |
955 | - __( 'loading ...', 'event_espresso' ), |
|
955 | + __('loading ...', 'event_espresso'), |
|
956 | 956 | |
957 | 957 | // Reference: packages/components/src/Modal/modalCloseButtonProps/index.ts:8 |
958 | - __( 'close modal', 'event_espresso' ), |
|
958 | + __('close modal', 'event_espresso'), |
|
959 | 959 | |
960 | 960 | // Reference: packages/components/src/PercentSign/index.tsx:11 |
961 | - __( '%', 'event_espresso' ), |
|
961 | + __('%', 'event_espresso'), |
|
962 | 962 | |
963 | 963 | // Reference: packages/components/src/Stepper/buttons/Next.tsx:12 |
964 | - __( 'Next', 'event_espresso' ), |
|
964 | + __('Next', 'event_espresso'), |
|
965 | 965 | |
966 | 966 | // Reference: packages/components/src/Stepper/buttons/Previous.tsx:12 |
967 | - __( 'Previous', 'event_espresso' ), |
|
967 | + __('Previous', 'event_espresso'), |
|
968 | 968 | |
969 | 969 | // Reference: packages/components/src/TabbableText/index.tsx:12 |
970 | - __( 'Click to edit...', 'event_espresso' ), |
|
970 | + __('Click to edit...', 'event_espresso'), |
|
971 | 971 | |
972 | 972 | // Reference: packages/components/src/TimezoneTimeInfo/Content.tsx:16 |
973 | - __( 'Your Local Time Zone', 'event_espresso' ), |
|
973 | + __('Your Local Time Zone', 'event_espresso'), |
|
974 | 974 | |
975 | 975 | // Reference: packages/components/src/TimezoneTimeInfo/Content.tsx:21 |
976 | - __( 'The Website\'s Time Zone', 'event_espresso' ), |
|
976 | + __('The Website\'s Time Zone', 'event_espresso'), |
|
977 | 977 | |
978 | 978 | // Reference: packages/components/src/TimezoneTimeInfo/Content.tsx:26 |
979 | - __( 'UTC (Greenwich Mean Time)', 'event_espresso' ), |
|
979 | + __('UTC (Greenwich Mean Time)', 'event_espresso'), |
|
980 | 980 | |
981 | 981 | // Reference: packages/components/src/TimezoneTimeInfo/TimezoneTimeInfo.tsx:23 |
982 | - __( 'This Date Converted To:', 'event_espresso' ), |
|
982 | + __('This Date Converted To:', 'event_espresso'), |
|
983 | 983 | |
984 | 984 | // Reference: packages/components/src/TimezoneTimeInfo/TimezoneTimeInfo.tsx:24 |
985 | - __( 'click for timezone |
|
986 | -information', 'event_espresso' ), |
|
985 | + __('click for timezone |
|
986 | +information', 'event_espresso'), |
|
987 | 987 | |
988 | 988 | // Reference: packages/components/src/bulkEdit/ActionCheckbox.tsx:34 |
989 | - __( 'select entity with id %s', 'event_espresso' ), |
|
989 | + __('select entity with id %s', 'event_espresso'), |
|
990 | 990 | |
991 | 991 | // Reference: packages/components/src/bulkEdit/ActionCheckbox.tsx:34 |
992 | - __( 'select all entities', 'event_espresso' ), |
|
992 | + __('select all entities', 'event_espresso'), |
|
993 | 993 | |
994 | 994 | // Reference: packages/components/src/bulkEdit/BulkActions.tsx:51 |
995 | - __( 'select all', 'event_espresso' ), |
|
995 | + __('select all', 'event_espresso'), |
|
996 | 996 | |
997 | 997 | // Reference: packages/components/src/bulkEdit/BulkActions.tsx:53 |
998 | - __( 'apply', 'event_espresso' ), |
|
998 | + __('apply', 'event_espresso'), |
|
999 | 999 | |
1000 | 1000 | // Reference: packages/components/src/bulkEdit/details/BulkEditDetailsProps.tsx:22 |
1001 | - __( 'Note: ', 'event_espresso' ), |
|
1001 | + __('Note: ', 'event_espresso'), |
|
1002 | 1002 | |
1003 | 1003 | // Reference: packages/components/src/bulkEdit/details/BulkEditDetailsProps.tsx:22 |
1004 | - __( 'any changes will be applied to ALL of the selected entities.', 'event_espresso' ), |
|
1004 | + __('any changes will be applied to ALL of the selected entities.', 'event_espresso'), |
|
1005 | 1005 | |
1006 | 1006 | // Reference: packages/components/src/bulkEdit/details/BulkEditDetailsProps.tsx:28 |
1007 | - __( 'Bulk edit details', 'event_espresso' ), |
|
1007 | + __('Bulk edit details', 'event_espresso'), |
|
1008 | 1008 | |
1009 | 1009 | // Reference: packages/components/src/bulkEdit/details/Submit.tsx:28 |
1010 | - __( 'Are you sure you want to bulk update the details?', 'event_espresso' ), |
|
1010 | + __('Are you sure you want to bulk update the details?', 'event_espresso'), |
|
1011 | 1011 | |
1012 | 1012 | // Reference: packages/components/src/bulkEdit/details/Submit.tsx:29 |
1013 | - __( 'Bulk update details', 'event_espresso' ), |
|
1013 | + __('Bulk update details', 'event_espresso'), |
|
1014 | 1014 | |
1015 | 1015 | // Reference: packages/dates/src/DateRangePicker/DateRangePickerLegend.tsx:14 |
1016 | - __( 'day in range', 'event_espresso' ), |
|
1016 | + __('day in range', 'event_espresso'), |
|
1017 | 1017 | |
1018 | 1018 | // Reference: packages/dates/src/DateRangePicker/DateRangePickerLegend.tsx:18 |
1019 | 1019 | // Reference: packages/dates/src/DateRangePicker/index.tsx:74 |
1020 | - __( 'end date', 'event_espresso' ), |
|
1020 | + __('end date', 'event_espresso'), |
|
1021 | 1021 | |
1022 | 1022 | // Reference: packages/dates/src/DateTimePicker.tsx:13 |
1023 | 1023 | // Reference: packages/dates/src/TimePicker.tsx:14 |
1024 | - __( 'time', 'event_espresso' ), |
|
1024 | + __('time', 'event_espresso'), |
|
1025 | 1025 | |
1026 | 1026 | // Reference: packages/dates/src/utils/misc.ts:13 |
1027 | - __( 'month(s)', 'event_espresso' ), |
|
1027 | + __('month(s)', 'event_espresso'), |
|
1028 | 1028 | |
1029 | 1029 | // Reference: packages/dates/src/utils/misc.ts:14 |
1030 | - __( 'week(s)', 'event_espresso' ), |
|
1030 | + __('week(s)', 'event_espresso'), |
|
1031 | 1031 | |
1032 | 1032 | // Reference: packages/dates/src/utils/misc.ts:15 |
1033 | - __( 'day(s)', 'event_espresso' ), |
|
1033 | + __('day(s)', 'event_espresso'), |
|
1034 | 1034 | |
1035 | 1035 | // Reference: packages/dates/src/utils/misc.ts:16 |
1036 | - __( 'hour(s)', 'event_espresso' ), |
|
1036 | + __('hour(s)', 'event_espresso'), |
|
1037 | 1037 | |
1038 | 1038 | // Reference: packages/dates/src/utils/misc.ts:17 |
1039 | - __( 'minute(s)', 'event_espresso' ), |
|
1039 | + __('minute(s)', 'event_espresso'), |
|
1040 | 1040 | |
1041 | 1041 | // Reference: packages/edtr-services/src/apollo/queries/datetimes/useFetchDatetimes.ts:27 |
1042 | - __( 'datetimes initialized', 'event_espresso' ), |
|
1042 | + __('datetimes initialized', 'event_espresso'), |
|
1043 | 1043 | |
1044 | 1044 | // Reference: packages/edtr-services/src/apollo/queries/datetimes/useFetchDatetimes.ts:43 |
1045 | - __( 'initializing datetimes', 'event_espresso' ), |
|
1045 | + __('initializing datetimes', 'event_espresso'), |
|
1046 | 1046 | |
1047 | 1047 | // Reference: packages/edtr-services/src/apollo/queries/priceTypes/useFetchPriceTypes.ts:26 |
1048 | - __( 'price types initialized', 'event_espresso' ), |
|
1048 | + __('price types initialized', 'event_espresso'), |
|
1049 | 1049 | |
1050 | 1050 | // Reference: packages/edtr-services/src/apollo/queries/priceTypes/useFetchPriceTypes.ts:41 |
1051 | - __( 'initializing price types', 'event_espresso' ), |
|
1051 | + __('initializing price types', 'event_espresso'), |
|
1052 | 1052 | |
1053 | 1053 | // Reference: packages/edtr-services/src/apollo/queries/prices/useFetchPrices.ts:36 |
1054 | - __( 'prices initialized', 'event_espresso' ), |
|
1054 | + __('prices initialized', 'event_espresso'), |
|
1055 | 1055 | |
1056 | 1056 | // Reference: packages/edtr-services/src/apollo/queries/prices/useFetchPrices.ts:70 |
1057 | - __( 'initializing prices', 'event_espresso' ), |
|
1057 | + __('initializing prices', 'event_espresso'), |
|
1058 | 1058 | |
1059 | 1059 | // Reference: packages/edtr-services/src/apollo/queries/tickets/useFetchTickets.ts:32 |
1060 | - __( 'tickets initialized', 'event_espresso' ), |
|
1060 | + __('tickets initialized', 'event_espresso'), |
|
1061 | 1061 | |
1062 | 1062 | // Reference: packages/edtr-services/src/apollo/queries/tickets/useFetchTickets.ts:47 |
1063 | - __( 'initializing tickets', 'event_espresso' ), |
|
1063 | + __('initializing tickets', 'event_espresso'), |
|
1064 | 1064 | |
1065 | 1065 | // Reference: packages/edtr-services/src/utils/dateAndTime.ts:11 |
1066 | - __( 'Start Date is required', 'event_espresso' ), |
|
1066 | + __('Start Date is required', 'event_espresso'), |
|
1067 | 1067 | |
1068 | 1068 | // Reference: packages/edtr-services/src/utils/dateAndTime.ts:15 |
1069 | - __( 'End Date is required', 'event_espresso' ), |
|
1069 | + __('End Date is required', 'event_espresso'), |
|
1070 | 1070 | |
1071 | 1071 | // Reference: packages/edtr-services/src/utils/dateAndTime.ts:5 |
1072 | - __( 'End Date & Time must be set later than the Start Date & Time', 'event_espresso' ), |
|
1072 | + __('End Date & Time must be set later than the Start Date & Time', 'event_espresso'), |
|
1073 | 1073 | |
1074 | 1074 | // Reference: packages/edtr-services/src/utils/dateAndTime.ts:6 |
1075 | - __( 'Required', 'event_espresso' ), |
|
1075 | + __('Required', 'event_espresso'), |
|
1076 | 1076 | |
1077 | 1077 | // Reference: packages/form/src/renderers/RepeatableRenderer.tsx:33 |
1078 | - __( 'Entry %d', 'event_espresso' ), |
|
1078 | + __('Entry %d', 'event_espresso'), |
|
1079 | 1079 | |
1080 | 1080 | // Reference: packages/form/src/renderers/RepeatableRenderer.tsx:47 |
1081 | - __( 'Add', 'event_espresso' ), |
|
1081 | + __('Add', 'event_espresso'), |
|
1082 | 1082 | |
1083 | 1083 | // Reference: packages/helpers/src/datetimes/getStatusTextLabel.ts:11 |
1084 | 1084 | // Reference: packages/helpers/src/tickets/getStatusTextLabel.ts:17 |
1085 | - __( 'sold out', 'event_espresso' ), |
|
1085 | + __('sold out', 'event_espresso'), |
|
1086 | 1086 | |
1087 | 1087 | // Reference: packages/helpers/src/datetimes/getStatusTextLabel.ts:14 |
1088 | 1088 | // Reference: packages/helpers/src/tickets/getStatusTextLabel.ts:14 |
1089 | - __( 'expired', 'event_espresso' ), |
|
1089 | + __('expired', 'event_espresso'), |
|
1090 | 1090 | |
1091 | 1091 | // Reference: packages/helpers/src/datetimes/getStatusTextLabel.ts:17 |
1092 | - __( 'upcoming', 'event_espresso' ), |
|
1092 | + __('upcoming', 'event_espresso'), |
|
1093 | 1093 | |
1094 | 1094 | // Reference: packages/helpers/src/datetimes/getStatusTextLabel.ts:20 |
1095 | - __( 'active', 'event_espresso' ), |
|
1095 | + __('active', 'event_espresso'), |
|
1096 | 1096 | |
1097 | 1097 | // Reference: packages/helpers/src/datetimes/getStatusTextLabel.ts:23 |
1098 | 1098 | // Reference: packages/helpers/src/tickets/getStatusTextLabel.ts:11 |
1099 | - __( 'trashed', 'event_espresso' ), |
|
1099 | + __('trashed', 'event_espresso'), |
|
1100 | 1100 | |
1101 | 1101 | // Reference: packages/helpers/src/datetimes/getStatusTextLabel.ts:26 |
1102 | - __( 'cancelled', 'event_espresso' ), |
|
1102 | + __('cancelled', 'event_espresso'), |
|
1103 | 1103 | |
1104 | 1104 | // Reference: packages/helpers/src/datetimes/getStatusTextLabel.ts:29 |
1105 | - __( 'postponed', 'event_espresso' ), |
|
1105 | + __('postponed', 'event_espresso'), |
|
1106 | 1106 | |
1107 | 1107 | // Reference: packages/helpers/src/datetimes/getStatusTextLabel.ts:33 |
1108 | - __( 'inactive', 'event_espresso' ), |
|
1108 | + __('inactive', 'event_espresso'), |
|
1109 | 1109 | |
1110 | 1110 | // Reference: packages/helpers/src/tickets/getStatusTextLabel.ts:20 |
1111 | - __( 'pending', 'event_espresso' ), |
|
1111 | + __('pending', 'event_espresso'), |
|
1112 | 1112 | |
1113 | 1113 | // Reference: packages/helpers/src/tickets/getStatusTextLabel.ts:23 |
1114 | - __( 'on sale', 'event_espresso' ), |
|
1114 | + __('on sale', 'event_espresso'), |
|
1115 | 1115 | |
1116 | 1116 | // Reference: packages/predicates/src/registration/statusOptions.ts:10 |
1117 | - __( 'Cancelled', 'event_espresso' ), |
|
1117 | + __('Cancelled', 'event_espresso'), |
|
1118 | 1118 | |
1119 | 1119 | // Reference: packages/predicates/src/registration/statusOptions.ts:14 |
1120 | - __( 'Declined', 'event_espresso' ), |
|
1120 | + __('Declined', 'event_espresso'), |
|
1121 | 1121 | |
1122 | 1122 | // Reference: packages/predicates/src/registration/statusOptions.ts:18 |
1123 | - __( 'Incomplete', 'event_espresso' ), |
|
1123 | + __('Incomplete', 'event_espresso'), |
|
1124 | 1124 | |
1125 | 1125 | // Reference: packages/predicates/src/registration/statusOptions.ts:22 |
1126 | - __( 'Not Approved', 'event_espresso' ), |
|
1126 | + __('Not Approved', 'event_espresso'), |
|
1127 | 1127 | |
1128 | 1128 | // Reference: packages/predicates/src/registration/statusOptions.ts:26 |
1129 | - __( 'Pending Payment', 'event_espresso' ), |
|
1129 | + __('Pending Payment', 'event_espresso'), |
|
1130 | 1130 | |
1131 | 1131 | // Reference: packages/predicates/src/registration/statusOptions.ts:30 |
1132 | - __( 'Wait List', 'event_espresso' ), |
|
1132 | + __('Wait List', 'event_espresso'), |
|
1133 | 1133 | |
1134 | 1134 | // Reference: packages/predicates/src/registration/statusOptions.ts:6 |
1135 | - __( 'Approved', 'event_espresso' ), |
|
1135 | + __('Approved', 'event_espresso'), |
|
1136 | 1136 | |
1137 | 1137 | // Reference: packages/rich-text-editor/src/components/ToolbarControls/HeadingControls.tsx:23 |
1138 | - __( 'heading selector', 'event_espresso' ), |
|
1138 | + __('heading selector', 'event_espresso'), |
|
1139 | 1139 | |
1140 | 1140 | // Reference: packages/rich-text-editor/src/components/constants.ts:12 |
1141 | - __( 'blockquote', 'event_espresso' ), |
|
1141 | + __('blockquote', 'event_espresso'), |
|
1142 | 1142 | |
1143 | 1143 | // Reference: packages/rich-text-editor/src/components/constants.ts:13 |
1144 | - __( 'unordered list', 'event_espresso' ), |
|
1144 | + __('unordered list', 'event_espresso'), |
|
1145 | 1145 | |
1146 | 1146 | // Reference: packages/rich-text-editor/src/components/constants.ts:14 |
1147 | - __( 'ordered list', 'event_espresso' ), |
|
1147 | + __('ordered list', 'event_espresso'), |
|
1148 | 1148 | |
1149 | 1149 | // Reference: packages/rich-text-editor/src/components/constants.ts:27 |
1150 | - __( 'bold', 'event_espresso' ), |
|
1150 | + __('bold', 'event_espresso'), |
|
1151 | 1151 | |
1152 | 1152 | // Reference: packages/rich-text-editor/src/components/constants.ts:28 |
1153 | - __( 'italic', 'event_espresso' ), |
|
1153 | + __('italic', 'event_espresso'), |
|
1154 | 1154 | |
1155 | 1155 | // Reference: packages/rich-text-editor/src/components/constants.ts:29 |
1156 | - __( 'underline', 'event_espresso' ), |
|
1156 | + __('underline', 'event_espresso'), |
|
1157 | 1157 | |
1158 | 1158 | // Reference: packages/tpc/src/buttons/AddPriceModifierButton.tsx:15 |
1159 | - __( 'add new price modifier after this row', 'event_espresso' ), |
|
1159 | + __('add new price modifier after this row', 'event_espresso'), |
|
1160 | 1160 | |
1161 | 1161 | // Reference: packages/tpc/src/buttons/DeleteAllPricesButton.tsx:13 |
1162 | - __( 'Delete all prices', 'event_espresso' ), |
|
1162 | + __('Delete all prices', 'event_espresso'), |
|
1163 | 1163 | |
1164 | 1164 | // Reference: packages/tpc/src/buttons/DeleteAllPricesButton.tsx:26 |
1165 | - __( 'Are you sure you want to delete all of this ticket\'s prices and make it free? This action is permanent and can not be undone.', 'event_espresso' ), |
|
1165 | + __('Are you sure you want to delete all of this ticket\'s prices and make it free? This action is permanent and can not be undone.', 'event_espresso'), |
|
1166 | 1166 | |
1167 | 1167 | // Reference: packages/tpc/src/buttons/DeleteAllPricesButton.tsx:30 |
1168 | - __( 'Delete all prices?', 'event_espresso' ), |
|
1168 | + __('Delete all prices?', 'event_espresso'), |
|
1169 | 1169 | |
1170 | 1170 | // Reference: packages/tpc/src/buttons/DeletePriceModifierButton.tsx:12 |
1171 | - __( 'delete price modifier', 'event_espresso' ), |
|
1171 | + __('delete price modifier', 'event_espresso'), |
|
1172 | 1172 | |
1173 | 1173 | // Reference: packages/tpc/src/buttons/ReverseCalculateButton.tsx:15 |
1174 | - __( 'Ticket base price is being reverse calculated from bottom to top starting with the ticket total. Entering a new ticket total will reverse calculate the ticket base price after applying all price modifiers in reverse. Click to turn off reverse calculations', 'event_espresso' ), |
|
1174 | + __('Ticket base price is being reverse calculated from bottom to top starting with the ticket total. Entering a new ticket total will reverse calculate the ticket base price after applying all price modifiers in reverse. Click to turn off reverse calculations', 'event_espresso'), |
|
1175 | 1175 | |
1176 | 1176 | // Reference: packages/tpc/src/buttons/ReverseCalculateButton.tsx:18 |
1177 | - __( 'Ticket total is being calculated normally from top to bottom starting from the base price. Entering a new ticket base price will recalculate the ticket total after applying all price modifiers. Click to turn on reverse calculations', 'event_espresso' ), |
|
1177 | + __('Ticket total is being calculated normally from top to bottom starting from the base price. Entering a new ticket base price will recalculate the ticket total after applying all price modifiers. Click to turn on reverse calculations', 'event_espresso'), |
|
1178 | 1178 | |
1179 | 1179 | // Reference: packages/tpc/src/buttons/TicketPriceCalculatorButton.tsx:30 |
1180 | - __( 'ticket price calculator', 'event_espresso' ), |
|
1180 | + __('ticket price calculator', 'event_espresso'), |
|
1181 | 1181 | |
1182 | 1182 | // Reference: packages/tpc/src/buttons/taxes/AddDefaultTaxesButton.tsx:10 |
1183 | 1183 | // Reference: packages/tpc/src/components/DefaultTaxesInfo.tsx:30 |
1184 | - __( 'Add default taxes', 'event_espresso' ), |
|
1184 | + __('Add default taxes', 'event_espresso'), |
|
1185 | 1185 | |
1186 | 1186 | // Reference: packages/tpc/src/buttons/taxes/RemoveTaxesButton.tsx:11 |
1187 | - __( 'Are you sure you want to remove all of this ticket\'s taxes?', 'event_espresso' ), |
|
1187 | + __('Are you sure you want to remove all of this ticket\'s taxes?', 'event_espresso'), |
|
1188 | 1188 | |
1189 | 1189 | // Reference: packages/tpc/src/buttons/taxes/RemoveTaxesButton.tsx:15 |
1190 | - __( 'Remove all taxes?', 'event_espresso' ), |
|
1190 | + __('Remove all taxes?', 'event_espresso'), |
|
1191 | 1191 | |
1192 | 1192 | // Reference: packages/tpc/src/buttons/taxes/RemoveTaxesButton.tsx:8 |
1193 | - __( 'Remove taxes', 'event_espresso' ), |
|
1193 | + __('Remove taxes', 'event_espresso'), |
|
1194 | 1194 | |
1195 | 1195 | // Reference: packages/tpc/src/components/DefaultPricesInfo.tsx:28 |
1196 | - __( 'Modify default prices.', 'event_espresso' ), |
|
1196 | + __('Modify default prices.', 'event_espresso'), |
|
1197 | 1197 | |
1198 | 1198 | // Reference: packages/tpc/src/components/DefaultTaxesInfo.tsx:29 |
1199 | - __( 'New default taxes are available. Click the "%s" button to add them now.', 'event_espresso' ), |
|
1199 | + __('New default taxes are available. Click the "%s" button to add them now.', 'event_espresso'), |
|
1200 | 1200 | |
1201 | 1201 | // Reference: packages/tpc/src/components/NoPricesBanner/AddDefaultPricesButton.tsx:10 |
1202 | - __( 'Add default prices', 'event_espresso' ), |
|
1202 | + __('Add default prices', 'event_espresso'), |
|
1203 | 1203 | |
1204 | 1204 | // Reference: packages/tpc/src/components/NoPricesBanner/index.tsx:14 |
1205 | - __( 'This Ticket is Currently Free', 'event_espresso' ), |
|
1205 | + __('This Ticket is Currently Free', 'event_espresso'), |
|
1206 | 1206 | |
1207 | 1207 | // Reference: packages/tpc/src/components/NoPricesBanner/index.tsx:22 |
1208 | 1208 | /* translators: %s default prices */ |
1209 | - __( 'Click the button below to load your %s into the calculator.', 'event_espresso' ), |
|
1209 | + __('Click the button below to load your %s into the calculator.', 'event_espresso'), |
|
1210 | 1210 | |
1211 | 1211 | // Reference: packages/tpc/src/components/NoPricesBanner/index.tsx:23 |
1212 | - __( 'default prices', 'event_espresso' ), |
|
1212 | + __('default prices', 'event_espresso'), |
|
1213 | 1213 | |
1214 | 1214 | // Reference: packages/tpc/src/components/NoPricesBanner/index.tsx:30 |
1215 | - __( 'Additional ticket price modifiers can be added or removed.', 'event_espresso' ), |
|
1215 | + __('Additional ticket price modifiers can be added or removed.', 'event_espresso'), |
|
1216 | 1216 | |
1217 | 1217 | // Reference: packages/tpc/src/components/NoPricesBanner/index.tsx:33 |
1218 | - __( 'Click the save button below to assign which dates this ticket will be available for purchase on.', 'event_espresso' ), |
|
1218 | + __('Click the save button below to assign which dates this ticket will be available for purchase on.', 'event_espresso'), |
|
1219 | 1219 | |
1220 | 1220 | // Reference: packages/tpc/src/components/TicketPriceCalculatorModal.tsx:30 |
1221 | - __( 'Price Calculator for Ticket: %s', 'event_espresso' ), |
|
1221 | + __('Price Calculator for Ticket: %s', 'event_espresso'), |
|
1222 | 1222 | |
1223 | 1223 | // Reference: packages/tpc/src/components/table/Table.tsx:43 |
1224 | - __( 'Ticket Price Calculator', 'event_espresso' ), |
|
1224 | + __('Ticket Price Calculator', 'event_espresso'), |
|
1225 | 1225 | |
1226 | 1226 | // Reference: packages/tpc/src/components/table/useFooterRowGenerator.tsx:41 |
1227 | - __( 'Total', 'event_espresso' ), |
|
1227 | + __('Total', 'event_espresso'), |
|
1228 | 1228 | |
1229 | 1229 | // Reference: packages/tpc/src/components/table/useFooterRowGenerator.tsx:50 |
1230 | - __( 'ticket total', 'event_espresso' ), |
|
1230 | + __('ticket total', 'event_espresso'), |
|
1231 | 1231 | |
1232 | 1232 | // Reference: packages/tpc/src/components/table/useHeaderRowGenerator.ts:29 |
1233 | - __( 'Price Type', 'event_espresso' ), |
|
1233 | + __('Price Type', 'event_espresso'), |
|
1234 | 1234 | |
1235 | 1235 | // Reference: packages/tpc/src/components/table/useHeaderRowGenerator.ts:35 |
1236 | - __( 'Label', 'event_espresso' ), |
|
1236 | + __('Label', 'event_espresso'), |
|
1237 | 1237 | |
1238 | 1238 | // Reference: packages/tpc/src/components/table/useHeaderRowGenerator.ts:47 |
1239 | - __( 'Amount', 'event_espresso' ), |
|
1239 | + __('Amount', 'event_espresso'), |
|
1240 | 1240 | |
1241 | 1241 | // Reference: packages/tpc/src/inputs/PriceAmountInput.tsx:34 |
1242 | - __( 'amount', 'event_espresso' ), |
|
1242 | + __('amount', 'event_espresso'), |
|
1243 | 1243 | |
1244 | 1244 | // Reference: packages/tpc/src/inputs/PriceAmountInput.tsx:45 |
1245 | - __( 'amount...', 'event_espresso' ), |
|
1245 | + __('amount...', 'event_espresso'), |
|
1246 | 1246 | |
1247 | 1247 | // Reference: packages/tpc/src/inputs/PriceDescriptionInput.tsx:10 |
1248 | - __( 'price description', 'event_espresso' ), |
|
1248 | + __('price description', 'event_espresso'), |
|
1249 | 1249 | |
1250 | 1250 | // Reference: packages/tpc/src/inputs/PriceDescriptionInput.tsx:15 |
1251 | - __( 'description...', 'event_espresso' ), |
|
1251 | + __('description...', 'event_espresso'), |
|
1252 | 1252 | |
1253 | 1253 | // Reference: packages/tpc/src/inputs/PriceIdInput.tsx:9 |
1254 | - __( 'price id', 'event_espresso' ), |
|
1254 | + __('price id', 'event_espresso'), |
|
1255 | 1255 | |
1256 | 1256 | // Reference: packages/tpc/src/inputs/PriceNameInput.tsx:10 |
1257 | - __( 'price name', 'event_espresso' ), |
|
1257 | + __('price name', 'event_espresso'), |
|
1258 | 1258 | |
1259 | 1259 | // Reference: packages/tpc/src/inputs/PriceNameInput.tsx:15 |
1260 | - __( 'label...', 'event_espresso' ), |
|
1260 | + __('label...', 'event_espresso'), |
|
1261 | 1261 | |
1262 | 1262 | // Reference: packages/tpc/src/inputs/PriceTypeInput.tsx:16 |
1263 | - __( 'price type', 'event_espresso' ), |
|
1263 | + __('price type', 'event_espresso'), |
|
1264 | 1264 | |
1265 | 1265 | // Reference: packages/components/src/LoadingNotice/LoadingNotice.tsx:16 |
1266 | - _x( 'loading%s', 'loading...', 'event_espresso' ) |
|
1266 | + _x('loading%s', 'loading...', 'event_espresso') |
|
1267 | 1267 | ); |
1268 | 1268 | /* THIS IS THE END OF THE GENERATED FILE */ |