1: <?php
2: /**
3: * Form Builder Object
4: *
5: * @package EPL
6: * @subpackage Classes/Forms
7: * @copyright Copyright (c) 2019, Merv Barrett
8: * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
9: * @since 2.3
10: */
11:
12: // Exit if accessed directly.
13: if ( ! defined( 'ABSPATH' ) ) {
14: exit;
15: }
16:
17: // phpcs:disable WordPress.Security.NonceVerification
18:
19: /**
20: * EPL_FORM_BUILDER Class
21: *
22: * @since 2.3
23: */
24: class EPL_FORM_BUILDER {
25:
26: /**
27: * Prefix for this class, will be used for filters & actions
28: *
29: * @var string $prefix Prefix name.
30: * @since 2.3
31: */
32: private $prefix = 'epl_form_builder_';
33:
34: /**
35: * Text domain for translation
36: *
37: * @var string $text_domain Text domain name.
38: * @since 2.3
39: */
40: private $text_domain = 'easy-property-listings';
41:
42: /**
43: * Form fields
44: *
45: * @var array $form_fields Form fields.
46: * @since 2.3
47: */
48: public $form_fields = array();
49:
50: /**
51: * Form sections
52: *
53: * @var array $form_sections Form sections.
54: * @since 2.3
55: */
56: public $form_sections = array();
57:
58: /**
59: * Classes for form and fields
60: *
61: * @var array $form_classes Form css classes.
62: * @since 2.3
63: */
64: private $form_classes = array();
65:
66: /**
67: * Configuration of this form
68: *
69: * @var array $configuration Settings of the form.
70: * @since 2.3
71: */
72: public $configuration = array();
73:
74: /**
75: * Form has nonce or not
76: *
77: * @var bool $has_nonce Security field.
78: * @since 2.3
79: */
80: public $has_nonce = false;
81:
82: /**
83: * Holds the list of form attributes, defaults & added by user
84: *
85: * @var array $form_attributes Form options.
86: * @since 2.3
87: */
88: public $form_attributes = array();
89:
90: /**
91: * Holds the nonce key
92: *
93: * @var array $nonce_key nonce key.
94: * @since 2.3
95: */
96: public $nonce_key;
97:
98: /**
99: * Holds the nonce value
100: *
101: * @var array $nonce_value nonce value.
102: * @since 2.3
103: */
104: public $nonce_value;
105:
106: /**
107: * Get things going
108: *
109: * @param array $config Form ptions.
110: * @since 2.3
111: */
112: public function __construct( $config = array() ) {
113:
114: $defaults = array(
115: 'form_tag' => 'on',
116: 'form_wrap' => 'on',
117: 'form_context' => 'default', // default , meta , settings.
118: 'callback_action' => null,
119: 'is_ajax' => false,
120: );
121:
122: $this->configuration = shortcode_atts( $defaults, $config );
123:
124: // Set form defaults.
125: $this->set_defaults();
126: }
127:
128: /**
129: * Call default & user submitted callbacks for this form upon form submission
130: *
131: * @since 2.3
132: * @return void
133: */
134: public function __destruct() {
135: $this->callbacks();
136: }
137:
138: /**
139: * Call default & user submitted callbacks for this form upon form submission
140: *
141: * @param string $key Meta key.
142: * @return string
143: * @since 2.3
144: */
145: public function __get( $key ) {
146: return isset( $this->{$key} ) ? $this->{$key} : null;
147: }
148:
149: /**
150: * Callbacks
151: *
152: * @since 2.3
153: */
154: public function callbacks() {
155:
156: if ( isset( $_REQUEST[ $this->prefix . 'form_submit' ] ) ) {
157:
158: // Hook to this action to save form data.
159: do_action( $this->prefix . 'save_form', get_object_vars( $this ), $_REQUEST );
160:
161: // Run user defined hook if applicable.
162: if ( ! is_null( $this->configuration['callback_action'] ) ) {
163: do_action( $this->prefix . $this->configuration['callback_action'], get_object_vars( $this ), $_REQUEST );
164: }
165: }
166: }
167:
168: /**
169: * Set form configuration
170: *
171: * @param string $key Meta key.
172: *
173: * @return bool|mixed
174: * @since 2.3
175: */
176: public function get_configuration( $key = '' ) {
177: return isset( $this->configuration[ $key ] ) ? $this->configuration[ $key ] : false;
178: }
179:
180: /**
181: * Get value
182: *
183: * @param string $field Field meta key.
184: *
185: * @return mixed|string
186: * @since 2.3
187: */
188: public function get_value( $field ) {
189: // phpcs:disable
190: switch ( $this->configuration['form_context'] ) {
191:
192: case 'default':
193: return isset( $field['value'] ) ? $field['value'] : ( isset( $field['default'] ) ? $field['default'] : '' );
194: break;
195:
196: case 'meta':
197: global $post;
198: return isset( $field['name'] ) ? get_post_meta( $post->ID, $field['name'], true ) : '';
199: break;
200:
201: case 'settings':
202: global $epl_settings;
203: return isset( $field['name'] ) ? $epl_settings[ $field['name'] ] : '';
204: break;
205:
206: }
207: // phpcs:enable
208: }
209:
210: /**
211: * Set form classes
212: *
213: * @since 2.3
214: */
215: public function set_form_classes() {
216:
217: $this->form_classes = apply_filters(
218: $this->prefix . 'form_classes',
219: array(
220: 'form_container' => array(
221: $this->prefix . 'form_container',
222: 'row',
223: ),
224: 'form' => array(
225: $this->prefix . 'form',
226: 'col-md-12',
227: ),
228: 'field_container' => array(
229: $this->prefix . 'field_container',
230: 'col-md-12',
231: ),
232: 'field' => array(
233: $this->prefix . 'field',
234: 'col-md-12',
235: ),
236: 'label_container' => array(
237: $this->prefix . 'label_container',
238: 'col-md-12',
239: ),
240: 'label' => array(
241: $this->prefix . 'label',
242: 'col-md-12',
243: ),
244: ),
245: $this->form_attributes
246: );
247: }
248:
249: /**
250: * List of invalid attributes per field type that must be removed from field array before field rendering
251: *
252: * @since 2.3
253: */
254: public function invalid_attributes() {
255: return apply_filters(
256: $this->prefix . 'invalid_attributes',
257: array(
258: 'label' => array( 'all' ),
259: 'default' => array( 'all' ),
260: 'opts' => array( 'all' ),
261: )
262: );
263: }
264:
265: /**
266: * Get classes for wrappers, form , fields
267: *
268: * @param string $key Meta key.
269: * @param array $field Field type.
270: *
271: * @return string
272: * @since 2.3
273: */
274: public function get_class( $key = '', $field = array() ) {
275:
276: if ( isset( $this->form_classes[ $key ] ) ) {
277: $classes = implode( ' ', array_map( 'sanitize_html_class', $this->form_classes[ $key ] ) );
278: if ( isset( $field['type'] ) ) {
279: $classes .= ' ' . $this->prefix . $key . '_' . $field['type'];
280: }
281:
282: if ( 'field' === $key && isset( $field['class'] ) ) {
283:
284: if ( is_array( $field['class'] ) && count( $field['class'] ) > 0 ) {
285: $classes .= implode( ' ', array_map( 'sanitize_html_class', $field['class'] ) );
286: } else {
287: $classes .= ' ' . $field['class'];
288: }
289: }
290: return $classes;
291: }
292: }
293:
294: /**
295: * Get Field Attributes
296: *
297: * @param array $field Fields.
298: *
299: * @return string
300: * @since 2.3
301: */
302: public function get_attributes( $field ) {
303:
304: $html = '';
305: $field['id'] = isset( $field['id'] ) ? $field['id'] : '';
306:
307: if ( empty( $field['id'] ) ) {
308: $field['id'] = isset( $field['name'] ) ? epl_sanitize_key( $field['name'] ) : '';
309: }
310:
311: $invalid_attributes = $this->invalid_attributes();
312:
313: foreach ( $field as $key => $value ) {
314:
315: if ( isset( $invalid_attributes[ $key ] ) && ( in_array( $field['type'], $invalid_attributes[ $key ], true ) || in_array( 'all', $invalid_attributes[ $key ], true ) ) ) { //phpcs:ignore
316: // This attribute is not valid for current input type, lets skip it.
317: } else {
318:
319: if ( 'name' === $key ) {
320: $value = esc_attr( $value );
321: }
322: if ( isset( $field['multiple'] ) && in_array( $field['type'], array( 'select', 'checkbox' ), true ) && 'name' === $key ) {
323: $value = $value . '[]';
324: }
325: $value = is_array( $value ) ? implode( ',', $value ) : $value;
326: $html .= $key . '="' . $value . '" ';
327: }
328: }
329: return $html;
330: }
331:
332: /**
333: * The public function can be used to configure the attributes of form
334: *
335: * @param string|array $key Meta key.
336: * @param string $value Field value.
337: *
338: * @since 2.3
339: */
340: public function set_form_attributes( $key = '', $value = '' ) {
341:
342: // If user wants to add a single attribute.
343: if ( ! empty( $key ) && is_string( $key ) ) {
344: $this->form_attributes[ $this->escape( 'text', $key ) ] = $this->escape( 'attribute', $value );
345:
346: } elseif ( is_array( $key ) & ! empty( $key ) ) {
347:
348: // Multiple attrubtes at once.
349: foreach ( $key as $index => $val ) {
350: $this->form_attributes[ $this->escape( 'text', $index ) ] = $this->escape( 'attribute', $val );
351: }
352: }
353: }
354:
355: /**
356: * Set default attributes for the form tag
357: *
358: * @since 2.3
359: */
360: private function set_default_form_attributes() {
361:
362: $this->form_attributes = apply_filters(
363: $this->prefix . 'form_default_attributes',
364: array(
365: 'action' => '',
366: 'id' => '',
367: 'class' => '',
368: 'enctype' => '',
369: 'method' => 'POST',
370: 'name' => '',
371: )
372: );
373:
374: if ( true === $this->configuration['is_ajax'] ) {
375: $this->form_attributes[ 'data-' . $this->prefix . 'ajax_submit' ] = 'true';
376: }
377: }
378:
379: /**
380: * Sets up all the form defaults while object instantiation
381: *
382: * @since 2.3
383: */
384: private function set_defaults() {
385:
386: do_action( $this->prefix . 'before_setup_defaults' );
387: $this->set_default_form_attributes();
388: $this->set_form_classes();
389: do_action( $this->prefix . 'after_setup_defaults' );
390: }
391:
392: /**
393: * Escape necessary data
394: *
395: * @param string $type Field type.
396: * @param string $value Field value.
397: *
398: * @return string|void
399: * @since 2.3
400: */
401: private function escape( $type = '', $value = '' ) {
402: // phpcs:disable
403: switch ( $type ) {
404:
405: case 'url':
406: return esc_url( $value );
407: break;
408:
409: case 'class':
410: case 'id':
411: return sanitize_html_class( $value );
412: break;
413:
414: case 'text':
415: return sanitize_text_field( $value );
416: break;
417: case 'attribute':
418: return esc_attr( $value );
419: } // phpcs:enable
420: }
421:
422: /**
423: * Add multiple form sections at once
424: *
425: * @param array $sections Field sections.
426: * @since 2.3
427: */
428: public function add_sections( $sections = array() ) {
429:
430: foreach ( $sections as $section ) {
431: $this->add_section( $section );
432: }
433: }
434:
435: /**
436: * Add single section to form
437: *
438: * @param array $section Field sections.
439: * @since 2.3
440: */
441: public function add_section( $section = array() ) {
442: $this->form_sections[] = $section;
443: }
444:
445: /**
446: * Add single field to form
447: *
448: * @param array $field Fields array.
449: * @since 2.3
450: */
451: public function add_field( $field = array() ) {
452: foreach ( $field as $key => &$val ) {
453: if ( is_string( $val ) ) {
454: $val = esc_attr( $val );
455: }
456: }
457: $this->form_fields[] = $field;
458: }
459:
460: /**
461: * Add multiple form fields at once
462: *
463: * @param array $fields Fields array.
464: * @since 2.3
465: */
466: public function add_fields( $fields = array() ) {
467:
468: foreach ( $fields as $field ) {
469: $this->add_field( $field );
470: }
471:
472: $this->add_field(
473: array(
474: 'type' => 'hidden',
475: 'name' => $this->prefix . 'form_submit',
476: 'value' => 'true',
477: )
478: );
479:
480: if ( ! is_null( $this->configuration['callback_action'] ) ) {
481: $this->add_field(
482: array(
483: 'type' => 'hidden',
484: 'name' => $this->prefix . 'form_action',
485: 'value' => $this->prefix . $this->configuration['callback_action'],
486: )
487: );
488: }
489: }
490:
491: /**
492: * Render form html based on the fields & form attributes
493: *
494: * @since 2.3
495: */
496: public function render_form() {
497:
498: ob_start();
499:
500: if ( 'on' === $this->get_configuration( 'form_wrap' ) ) {
501: do_action( 'before_' . $this->prefix . 'form_container_open' );
502: $this->render_form_container_open();
503: }
504:
505: if ( 'on' === $this->get_configuration( 'form_tag' ) ) {
506: do_action( 'before_' . $this->prefix . 'form_open' );
507: $this->render_form_open();
508: }
509:
510: do_action( 'before_' . $this->prefix . 'form_sections' );
511: $this->render_sections();
512: do_action( 'after_' . $this->prefix . 'form_sections' );
513:
514: do_action( 'before_' . $this->prefix . 'form_fields' );
515: $this->render_fields();
516: do_action( 'after_' . $this->prefix . 'form_fields' );
517:
518: if ( 'on' === $this->get_configuration( 'form_tag' ) ) {
519: $this->render_form_close();
520: do_action( 'after_' . $this->prefix . 'form_close' );
521: }
522:
523: if ( 'on' === $this->get_configuration( 'form_wrap' ) ) {
524: $this->render_form_container_close();
525: do_action( 'after_' . $this->prefix . 'form_container_close' );
526: }
527:
528: echo ob_get_clean(); // phpcs:ignore
529: }
530:
531: /**
532: * Render form container opening tag
533: *
534: * @since 2.3
535: */
536: public function render_form_container_open() {
537: // phpcs:disable WordPress.Security.EscapeOutput
538: $html = "\n<div ";
539: $html .= 'class ="' . esc_attr( $this->get_class( 'form_container' ) ) . '" ';
540: $html .= '>';
541: echo apply_filters( $this->prefix . 'form_container_open_tag', $html, $this->form_attributes );
542: }
543:
544: /**
545: * Render form container closing tag
546: *
547: * @since 2.3
548: */
549: public function render_form_container_close() {
550:
551: echo apply_filters( $this->prefix . 'form_container_close_tag', "\n</div>", $this->form_attributes );
552: }
553:
554: /**
555: * Render form opening tag
556: *
557: * @since 2.3
558: */
559: public function render_form_open() {
560:
561: $html = "\n<form ";
562: foreach ( $this->form_attributes as $key => $value ) {
563: $html .= $key . '="' . $value . '" ';
564: }
565: $html .= ' >';
566: echo apply_filters( $this->prefix . 'form_open_tag', $html, $this->form_attributes );
567: }
568:
569: /**
570: * Render form closing tag
571: *
572: * @since 2.3
573: */
574: public function render_form_close() {
575:
576: echo apply_filters( $this->prefix . 'form_close_tag', "\n</form>", $this->form_attributes );
577: }
578:
579: /**
580: * Render all form sections
581: *
582: * @since 2.3
583: */
584: private function render_sections() {
585:
586: if ( ! empty( $this->form_sections ) ) {
587: foreach ( $this->form_sections as $section ) {
588: $this->render_section( $section );
589:
590: }
591: }
592: }
593:
594: /**
595: * Render single form section
596: *
597: * @param array $section Field section.
598: * @since 2.3
599: */
600: private function render_section( $section ) {
601:
602: $section_class = $this->prefix . 'form_section ' . isset( $section['class'] ) ? $section['class'] : '';
603: $section_id = isset( $section['id'] ) ? $section['id'] : '';
604: $section_label = isset( $section['label'] ) ? $section['label'] : '';
605: $section_help = isset( $section['help'] ) ? $section['help'] : ''; ?>
606:
607: <div id="<?php echo esc_attr( $section_id ); ?>" class="<?php echo esc_attr( $section_class ); ?>" >
608:
609: <span class="<?php echo esc_attr( $this->prefix . 'section_label' ); ?>">
610: <?php
611: echo esc_attr( $section_label );
612: ?>
613: </span>
614:
615: <span class="<?php echo esc_attr( $this->prefix . 'section_help' ); ?>">
616: <?php
617: echo wp_kses_post( $section_help );
618: ?>
619: </span>
620:
621: <div class="<?php echo esc_attr( $this->prefix . 'section_fields' ); ?>">
622: <?php
623: if ( ! empty( $section['fields'] ) ) {
624: foreach ( $section['fields'] as $field ) {
625: $this->render_field( $field );
626:
627: }
628: }
629: ?>
630: </div>
631:
632: </div>
633: <?php
634: }
635:
636: /**
637: * Render all form fields based on type
638: *
639: * @since 2.3
640: */
641: private function render_fields() {
642:
643: if ( ! empty( $this->form_fields ) ) {
644: foreach ( $this->form_fields as $field ) {
645: $this->render_field( $field );
646:
647: }
648: }
649: }
650:
651: /**
652: * Render single form field
653: *
654: * @param array $field Field array.
655: * @since 2.3
656: */
657: private function render_field( $field ) {
658:
659: $this->render_field_container_open();
660: $this->render_field_label( $field );
661:
662: switch ( $field['type'] ) {
663:
664: case 'text':
665: case 'url':
666: case 'number':
667: case 'tel':
668: case 'hidden':
669: $this->render_text( $field );
670: break;
671: case 'textarea':
672: $this->render_textarea( $field );
673: break;
674: case 'radio':
675: $this->render_radio( $field );
676: break;
677: case 'select':
678: case 'select_single':
679: $this->render_select( $field );
680: break;
681: case 'checkbox':
682: case 'checkbox_single':
683: $this->render_checkbox( $field );
684: break;
685: case 'wp_editor':
686: $this->render_wp_editor( $field );
687: break;
688:
689: default:
690: $this->render_text( $field );
691: break;
692:
693: }
694: $this->render_field_container_close();
695: }
696:
697: /**
698: * Render field container opening tag
699: *
700: * @since 2.3
701: */
702: public function render_field_container_open() {
703:
704: $html = "\n<div ";
705: $html .= 'class ="' . $this->get_class( 'field_container' ) . '" ';
706: $html .= '>';
707: echo apply_filters( $this->prefix . 'field_container_open_tag', $html, $this->form_attributes );
708: }
709:
710: /**
711: * Render field container closing tag
712: *
713: * @since 2.3
714: */
715: public function render_field_container_close() {
716:
717: echo apply_filters( $this->prefix . 'field_container_close_tag', "\n</div>", $this->form_attributes );
718: }
719:
720: /**
721: * Render field label
722: *
723: * @param array $field Fields array.
724: * @since 2.3
725: */
726: public function render_field_label( $field = array() ) {
727:
728: $wrapper = "\n<span ";
729: $wrapper .= 'class ="' . $this->get_class( 'label_container', $field ) . '" ';
730: $wrapper .= '>';
731:
732: if ( isset( $field['label'] ) ) {
733:
734: $html = "\n<label ";
735: $html .= 'class ="' . $this->get_class( 'label', $field ) . '" ';
736: $html .= '>';
737: $html .= apply_filters( $this->prefix . 'field_label', $field['label'], $field );
738: $html .= "\n</label>";
739: $wrapper .= $html;
740: }
741:
742: $wrapper .= "\n</span>";
743:
744: echo apply_filters( $this->prefix . 'field_label_html', $wrapper, $field );
745: }
746:
747: /**
748: * Render text & similar fields
749: *
750: * @param array $field Fields array.
751: * @since 2.3
752: */
753: private function render_text( $field ) {
754:
755: $field['value'] = esc_attr( stripslashes( $this->get_value( $field ) ) );
756: $field['class'] = $this->get_class( 'field', $field );
757: $html = "\n<input ";
758: $html .= $this->get_attributes( $field );
759: $html .= ' />';
760: echo apply_filters( $this->prefix . 'form_' . $field['type'] . '_tag', $html, $field );
761: }
762:
763: /**
764: * Render textarea
765: *
766: * @param array $field Fields array.
767: * @since 2.3
768: */
769: private function render_textarea( $field ) {
770:
771: $value = $this->get_value( $field );
772: $field['class'] = $this->get_class( 'field', $field );
773: $html = "\n<textarea ";
774: $html .= $this->get_attributes( $field );
775: $html .= '>';
776: $html .= esc_attr( $value );
777: $html .= '</textarea>';
778: echo apply_filters( $this->prefix . 'form_' . $field['type'] . '_tag', $html, $field );
779: }
780:
781: /**
782: * Render radio
783: *
784: * @param array $field Fields array.
785: * @since 2.3
786: */
787: private function render_radio( $field ) {
788:
789: $options = $field['opts'];
790: $value = $this->get_value( $field );
791:
792: unset( $field['opts'] );
793:
794: foreach ( $options as $option => $label ) {
795:
796: if ( $option === $value ) {
797: $field['checked'] = 'checked';
798: }
799:
800: $field['value'] = esc_attr( stripslashes( $option ) );
801: $field['class'] = $this->get_class( 'field', $field );
802: $html = "\n<input ";
803: $html .= $this->get_attributes( $field );
804: $html .= ' >' . $label;
805: echo apply_filters( $this->prefix . 'form_' . $field['type'] . '_tag', $html, $field );
806: unset( $field['checked'] );
807: }
808: }
809:
810: /**
811: * Render checkbox
812: *
813: * @param array $field Fields array.
814: * @since 2.3
815: */
816: private function render_checkbox( $field ) {
817:
818: $options = $field['opts'];
819: $value = $this->get_value( $field );
820:
821: unset( $field['opts'] );
822:
823: foreach ( $options as $option => $label ) {
824:
825: if ( $option === $value ) {
826: $field['checked'] = 'checked';
827: }
828:
829: $field['value'] = esc_attr( stripslashes( $option ) );
830: $field['class'] = $this->get_class( 'field', $field );
831: $html = "\n<input ";
832: $html .= $this->get_attributes( $field );
833: $html .= ' >' . $label;
834: echo apply_filters( $this->prefix . 'form_' . $field['type'] . '_tag', $html, $field );
835: unset( $field['checked'] );
836: }
837: }
838:
839: /**
840: * Render Editior
841: *
842: * @param array $field Fields array.
843: * @since 2.3
844: */
845: private function render_wp_editor( $field ) {
846: $value = stripslashes( $this->get_value( $field ) );
847: $field['class'] = $this->get_class( 'field', $field );
848: wp_editor( $value, $field['name'] );
849: }
850:
851: /**
852: * Render select
853: *
854: * @param array $field Fields array.
855: * @since 2.3
856: */
857: private function render_select( $field ) {
858: global $post;
859: $options = $field['opts'];
860: unset( $field['opts'] );
861:
862: $value = $this->get_value( $field );
863: $field['class'] = $this->get_class( 'field', $field );
864: $html = "\n<select ";
865: $html .= $this->get_attributes( $field );
866: $html .= ' >';
867: $value = (array) $value;
868: $value = array_map( 'sanitize_text_field', $value );
869:
870: foreach ( $options as $option => $label ) {
871:
872: if ( is_array( $label ) ) {
873: if ( isset( $label['exclude'] ) && ! empty( $label['exclude'] ) ) {
874: if ( in_array( $post->post_type, $label['exclude'], true ) ) {
875: continue;
876: }
877: }
878:
879: if ( isset( $label['include'] ) && ! empty( $label['include'] ) ) {
880: if ( ! in_array( $post->post_type, $label['include'], true ) ) {
881: continue;
882: }
883: }
884: $label = $label['label'];
885: }
886: $html .= "\n<option ";
887: $html .= 'value = "' . stripslashes( $option ) . '"';
888:
889: if ( in_array( $option, $value, true ) ) {
890: $html .= ' selected = "selected" ';
891: }
892:
893: $html .= ' >' . $label . "\n</option>";
894:
895: }
896: $html .= "\n</select>";
897: echo apply_filters( $this->prefix . 'form_' . $field['type'] . '_tag', $html, $field );
898: }
899:
900: /**
901: * Render nonce field
902: *
903: * @param string $action Action name.
904: * @since 2.3
905: */
906: public function add_nonce( $action = '' ) {
907:
908: $this->has_nonce = true;
909: $this->nonce_key = ! empty( $action ) ? $action : $this->prefix . 'nonce_action';
910: $this->nonce_value = wp_create_nonce( $action );
911:
912: $this->add_field(
913: array(
914: 'type' => 'hidden',
915: 'name' => $this->nonce_key,
916: 'value' => $this->nonce_value,
917: )
918: );
919: }
920: }
921: