PluginProbe ʕ •ᴥ•ʔ
Everest Forms – Contact Form, Payment Form, Quiz, Survey & Custom Form Builder with AI / 2.0.3
Everest Forms – Contact Form, Payment Form, Quiz, Survey & Custom Form Builder with AI v2.0.3
3.5.2 3.5.1 3.5.0 3.4.8 3.4.7 3.4.6 1.1.0 1.1.1 1.1.2 1.1.3 1.1.4 1.1.5 1.1.5.1 1.1.6 1.1.7 1.1.8 1.1.9 1.2.0 1.2.1 1.2.2 1.2.3 1.2.4 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 1.4.0 1.4.1 1.4.2 1.4.3 1.4.4 1.4.5 1.4.6 1.4.7 1.4.8 1.4.9 1.5.0 1.5.1 1.5.10 1.5.2 1.5.3 1.5.4 1.5.5 1.5.6 1.5.7 1.5.8 1.5.9 1.6.0 1.6.1 1.6.2 1.6.3 1.6.4 1.6.5 1.6.6 1.6.6.1 1.6.7 1.7.0 1.7.0.1 1.7.0.2 1.7.0.3 1.7.1 1.7.2 1.7.2.1 1.7.2.2 1.7.3 1.7.4 1.7.5 1.7.5.1 1.7.5.2 1.7.6 1.7.7 1.7.7.1 1.7.7.2 1.7.8 1.7.9 1.8.0 1.8.0.1 1.8.1 1.8.2 1.8.2.1 1.8.2.2 1.8.2.3 1.8.3 1.8.4 1.8.5 1.8.6 1.8.7 1.8.8 1.8.9 1.9.0 1.9.0.1 1.9.1 1.9.2 1.9.3 1.9.4 1.9.4.1 1.9.5 1.9.6 1.9.7 1.9.8 1.9.9 2.0.0 2.0.0.1 2.0.1 2.0.2 2.0.3 2.0.3.1 2.0.4 2.0.4.1 2.0.5 2.0.6 2.0.7 2.0.8 2.0.8.1 2.0.9 3.0.0 3.0.0.1 3.0.1 3.0.2 3.0.3 3.0.3.1 3.0.4 3.0.4.1 3.0.4.2 3.0.5 3.0.5.1 3.0.5.2 3.0.6 3.0.6.1 3.0.7.1 3.0.8 3.0.8.1 3.0.9 3.0.9.1 3.0.9.2 3.0.9.3 3.0.9.4 3.0.9.5 3.1.0 3.1.1 3.1.2 3.2.0 3.2.1 3.2.2 3.2.3 3.2.4 3.2.5 3.2.6 3.3.0 3.4.0 3.4.1 3.4.2 3.4.2.1 3.4.3 3.4.4 3.4.5 trunk 1.0 1.0.1 1.0.2 1.0.3
everest-forms / includes / fields / class-evf-field-checkbox.php
everest-forms / includes / fields Last commit date
class-evf-field-address.php 7 years ago class-evf-field-ai.php 2 years ago class-evf-field-captcha.php 2 years ago class-evf-field-checkbox.php 3 years ago class-evf-field-color.php 3 years ago class-evf-field-country.php 7 years ago class-evf-field-credit-card.php 2 years ago class-evf-field-date-time.php 2 years ago class-evf-field-divider.php 4 years ago class-evf-field-email.php 2 years ago class-evf-field-file-upload.php 6 years ago class-evf-field-first-name.php 2 years ago class-evf-field-hidden.php 7 years ago class-evf-field-html.php 7 years ago class-evf-field-image-upload.php 7 years ago class-evf-field-last-name.php 2 years ago class-evf-field-likert.php 2 years ago class-evf-field-lookup.php 2 years ago class-evf-field-number.php 2 years ago class-evf-field-password.php 7 years ago class-evf-field-payment-authorize-net.php 2 years ago class-evf-field-payment-checkbox.php 7 years ago class-evf-field-payment-coupon.php 2 years ago class-evf-field-payment-quantity.php 5 years ago class-evf-field-payment-radio.php 7 years ago class-evf-field-payment-single.php 7 years ago class-evf-field-payment-subtotal.php 3 years ago class-evf-field-payment-total.php 6 years ago class-evf-field-phone.php 7 years ago class-evf-field-privacy-policy.php 4 years ago class-evf-field-progress.php 3 years ago class-evf-field-radio.php 3 years ago class-evf-field-range-slider.php 6 years ago class-evf-field-rating.php 7 years ago class-evf-field-repeater.php 2 years ago class-evf-field-reset.php 3 years ago class-evf-field-scale-rating.php 2 years ago class-evf-field-select.php 3 years ago class-evf-field-signature.php 7 years ago class-evf-field-text.php 2 years ago class-evf-field-textarea.php 3 years ago class-evf-field-title.php 6 years ago class-evf-field-url.php 2 years ago class-evf-field-wysiwyg.php 4 years ago class-evf-field-yes-no.php 2 years ago
class-evf-field-checkbox.php
568 lines
1 <?php
2 /**
3 * Checkbox field.
4 *
5 * @package EverestForms\Fields
6 * @since 1.0.0
7 */
8
9 defined( 'ABSPATH' ) || exit;
10
11 /**
12 * EVF_Field_Checkbox class.
13 */
14 class EVF_Field_Checkbox extends EVF_Form_Fields {
15
16 /**
17 * Constructor.
18 */
19 public function __construct() {
20 $this->name = esc_html__( 'Checkboxes', 'everest-forms' );
21 $this->type = 'checkbox';
22 $this->icon = 'evf-icon evf-icon-checkbox';
23 $this->order = 70;
24 $this->group = 'general';
25 $this->defaults = array(
26 1 => array(
27 'label' => esc_html__( 'First Choice', 'everest-forms' ),
28 'value' => '',
29 'image' => '',
30 'default' => '',
31 ),
32 2 => array(
33 'label' => esc_html__( 'Second Choice', 'everest-forms' ),
34 'value' => '',
35 'image' => '',
36 'default' => '',
37 ),
38 3 => array(
39 'label' => esc_html__( 'Third Choice', 'everest-forms' ),
40 'value' => '',
41 'image' => '',
42 'default' => '',
43 ),
44 );
45 $this->settings = array(
46 'basic-options' => array(
47 'field_options' => array(
48 'label',
49 'meta',
50 'choices',
51 'choices_images',
52 'description',
53 'required',
54 'required_field_message_setting',
55 'required_field_message',
56 ),
57 ),
58 'advanced-options' => array(
59 'field_options' => array(
60 'randomize',
61 'show_values',
62 'input_columns',
63 'choice_limit',
64 'label_hide',
65 'css',
66 'select_all',
67 ),
68 ),
69 );
70
71 parent::__construct();
72 }
73
74 /**
75 * Hook in tabs.
76 */
77 public function init_hooks() {
78 add_filter( 'everest_forms_html_field_value', array( $this, 'html_field_value' ), 10, 4 );
79 add_filter( 'everest_forms_field_properties_' . $this->type, array( $this, 'field_properties' ), 5, 3 );
80 }
81
82 /**
83 * Return images, if any, for HTML supported values.
84 *
85 * @since 1.6.0
86 *
87 * @param string $value Field value.
88 * @param array $field Field settings.
89 * @param array $form_data Form data and settings.
90 * @param string $context Value display context.
91 *
92 * @return string
93 */
94 public function html_field_value( $value, $field, $form_data = array(), $context = '' ) {
95 if ( is_serialized( $field ) || in_array( $context, array( 'email-html', 'export-pdf' ), true ) ) {
96 $field_value = maybe_unserialize( $field );
97 $field_type = isset( $field_value['type'] ) ? sanitize_text_field( $field_value['type'] ) : 'checkbox';
98
99 if ( $field_type === $this->type ) {
100 if (
101 'entry-table' !== $context
102 && ! empty( $field_value['label'] )
103 && ! empty( $field_value['images'] )
104 && apply_filters( 'everest_forms_checkbox_field_html_value_images', true, $context )
105 ) {
106 $items = array();
107
108 if ( ! empty( $field_value['label'] ) ) {
109 foreach ( $field_value['label'] as $key => $value ) {
110 if ( ! empty( $field_value['images'][ $key ] ) ) {
111 $items[] = sprintf(
112 '<span style="max-width:200px;display:block;margin:0 0 5px 0;"><img src="%s" style="max-width:100%%;display:block;margin:0;"></span>%s',
113 esc_url( $field_value['images'][ $key ] ),
114 esc_html( $value )
115 );
116 } else {
117 $items[] = esc_html( $value );
118 }
119 }
120 }
121
122 return implode( 'export-csv' !== $context ? '<br><br>' : '|', $items );
123 }
124 }
125 }
126
127 return $value;
128 }
129
130 /**
131 * Define additional field properties.
132 *
133 * @since 1.0.0
134 *
135 * @param array $properties Field properties.
136 * @param array $field Field settings.
137 * @param array $form_data Form data and settings.
138 *
139 * @return array of additional field properties.
140 */
141 public function field_properties( $properties, $field, $form_data ) {
142 // Define data.
143 $form_id = absint( $form_data['id'] );
144 $field_id = $field['id'];
145 $choices = $field['choices'];
146
147 // Remove primary input.
148 unset( $properties['inputs']['primary'] );
149
150 // Set input container (ul) properties.
151 $properties['input_container'] = array(
152 'class' => array( ! empty( $field['random'] ) ? 'everest-forms-randomize' : '' ),
153 'data' => array(),
154 'attr' => array(),
155 'id' => "evf-{$form_id}-field_{$field_id}",
156 );
157
158 // Set choice limit.
159 $field['choice_limit'] = empty( $field['choice_limit'] ) ? 0 : (int) $field['choice_limit'];
160 if ( $field['choice_limit'] > 0 ) {
161 $properties['input_container']['data']['choice-limit'] = $field['choice_limit'];
162 }
163
164 // Set input properties.
165 foreach ( $choices as $key => $choice ) {
166 $depth = isset( $choice['depth'] ) ? absint( $choice['depth'] ) : 1;
167
168 // Choice labels should not be left blank, but if they are we provide a basic value.
169 $value = isset( $field['show_values'] ) ? $choice['value'] : $choice['label'];
170 if ( '' === $value ) {
171 if ( 1 === count( $choices ) ) {
172 $value = esc_html__( 'Checked', 'everest-forms' );
173 } else {
174 /* translators: %s - Choice Number. */
175 $value = sprintf( esc_html__( 'Choice %s', 'everest-forms' ), $key );
176 }
177 }
178
179 $properties['inputs'][ $key ] = array(
180 'container' => array(
181 'attr' => array(),
182 'class' => array( "choice-{$key}", "depth-{$depth}" ),
183 'data' => array(),
184 'id' => '',
185 ),
186 'label' => array(
187 'attr' => array(
188 'for' => "evf-{$form_id}-field_{$field_id}_{$key}",
189 ),
190 'class' => array( 'everest-forms-field-label-inline' ),
191 'data' => array(),
192 'id' => '',
193 'text' => evf_string_translation( $form_id, $field_id, $choice['label'], '-choice-' . $key ),
194 ),
195 'attr' => array(
196 'name' => "everest_forms[form_fields][{$field_id}][]",
197 'value' => $value,
198 ),
199 'class' => array( 'input-text' ),
200 'data' => array(),
201 'id' => "evf-{$form_id}-field_{$field_id}_{$key}",
202 'image' => isset( $choice['image'] ) ? $choice['image'] : '',
203 'required' => ! empty( $field['required'] ) ? 'required' : '',
204 'default' => isset( $choice['default'] ),
205 );
206
207 // Rule for choice limit validator.
208 if ( $field['choice_limit'] > 0 ) {
209 $properties['inputs'][ $key ]['data']['rule-check-limit'] = 'true';
210 }
211 }
212
213 // Required class for validation.
214 if ( ! empty( $field['required'] ) ) {
215 $properties['input_container']['class'][] = 'evf-field-required';
216 }
217
218 // Custom properties if enabled image choices.
219 if ( ! empty( $field['choices_images'] ) ) {
220 $properties['input_container']['class'][] = 'everest-forms-image-choices';
221
222 foreach ( $properties['inputs'] as $key => $inputs ) {
223 $properties['inputs'][ $key ]['container']['class'][] = 'everest-forms-image-choices-item';
224 }
225 }
226
227 // Add selected class for choices with defaults.
228 foreach ( $properties['inputs'] as $key => $inputs ) {
229 if ( ! empty( $inputs['default'] ) ) {
230 $properties['inputs'][ $key ]['container']['class'][] = 'everest-forms-selected';
231 }
232 }
233
234 return $properties;
235 }
236
237 /**
238 * Randomize order of choices.
239 *
240 * @since 1.6.0
241 * @param array $field Field Data.
242 */
243 public function randomize( $field ) {
244 $args = array(
245 'slug' => 'random',
246 'content' => $this->field_element(
247 'checkbox',
248 $field,
249 array(
250 'slug' => 'random',
251 'value' => isset( $field['random'] ) ? '1' : '0',
252 'desc' => esc_html__( 'Randomize Choices', 'everest-forms' ),
253 'tooltip' => esc_html__( 'Check this option to randomize the order of the choices.', 'everest-forms' ),
254 ),
255 false
256 ),
257 );
258 $this->field_element( 'row', $field, $args );
259 }
260
261 /**
262 * Choice limit field option.
263 *
264 * @since 1.6.0
265 * @param array $field Field data.
266 */
267 public function choice_limit( $field ) {
268 $choice_limit_label = $this->field_element(
269 'label',
270 $field,
271 array(
272 'slug' => 'choice_limit',
273 'value' => esc_html__( 'Choice Limit', 'everest-forms' ),
274 'tooltip' => esc_html__( 'Check this option to limit the number of checkboxes a user can select.', 'everest-forms' ),
275 ),
276 false
277 );
278 $choice_limit_input = $this->field_element(
279 'text',
280 $field,
281 array(
282 'slug' => 'choice_limit',
283 'value' => ( isset( $field['choice_limit'] ) && $field['choice_limit'] > 0 ) ? (int) $field['choice_limit'] : '',
284 'type' => 'number',
285 ),
286 false
287 );
288
289 $args = array(
290 'slug' => 'choice_limit',
291 'content' => $choice_limit_label . $choice_limit_input,
292 );
293 $this->field_element( 'row', $field, $args );
294 }
295
296 /**
297 * Show values field option.
298 *
299 * @param array $field Field Data.
300 */
301 public function show_values( $field ) {
302 // Show Values toggle option. This option will only show if already used or if manually enabled by a filter.
303 if ( ! empty( $field['show_values'] ) || apply_filters( 'everest_forms_fields_show_options_setting', false ) ) {
304 $args = array(
305 'slug' => 'show_values',
306 'content' => $this->field_element(
307 'checkbox',
308 $field,
309 array(
310 'slug' => 'show_values',
311 'value' => isset( $field['show_values'] ) ? $field['show_values'] : '0',
312 'desc' => __( 'Show Values', 'everest-forms' ),
313 'tooltip' => __( 'Check this to manually set form field values.', 'everest-forms' ),
314 ),
315 false
316 ),
317 );
318 $this->field_element( 'row', $field, $args );
319 }
320 }
321
322 /**
323 * Select All checkbox.
324 *
325 * @since 1.8.4
326 * @param array $field Field data.
327 */
328 public function select_all( $field ) {
329 $fld = $this->field_element(
330 'checkbox',
331 $field,
332 array(
333 'slug' => 'select_all',
334 'value' => isset( $field['select_all'] ) ? '1' : '0',
335 'desc' => esc_html__( 'Select All', 'everest-forms' ),
336 'tooltip' => esc_html__( 'Check this option to select all the options.', 'everest-forms' ),
337 ),
338 false
339 );
340
341 $args = array(
342 'slug' => 'select_all',
343 'content' => $fld,
344 );
345 $this->field_element( 'row', $field, $args );
346 }
347
348 /**
349 * Field preview inside the builder.
350 *
351 * @since 1.0.0
352 *
353 * @param array $field Field data and settings.
354 */
355 public function field_preview( $field ) {
356 // Label.
357 $this->field_preview_option( 'label', $field );
358
359 // Choices.
360 $this->field_preview_option( 'choices', $field );
361
362 // Description.
363 $this->field_preview_option( 'description', $field );
364 }
365
366 /**
367 * Field display on the form front-end.
368 *
369 * @since 1.0.0
370 *
371 * @param array $field Field Data.
372 * @param array $field_atts Field attributes.
373 * @param array $form_data All Form Data.
374 */
375 public function field_display( $field, $field_atts, $form_data ) {
376 // Define data.
377 $container = $field['properties']['input_container'];
378 $choices = $field['properties']['inputs'];
379 $select_all = isset( $field['select_all'] ) ? $field['select_all'] : '0';
380
381 // List.
382 printf( '<ul %s>', evf_html_attributes( $container['id'], $container['class'], $container['data'], $container['attr'] ) );
383
384 // Select All Checkbox.
385 if ( '1' === $select_all ) {
386 printf( '<li class="evf-select-all-checkbox-li"><input type="checkbox" id="evfCheckAll" class="evf-select-all-checkbox"><label for="evfCheckAll">' . esc_html__( 'Select All', 'everest-forms' ) . '</label></li>' );
387 }
388
389 foreach ( $choices as $choice ) {
390 if ( empty( $choice['container'] ) ) {
391 continue;
392 }
393
394 // Conditional logic.
395 if ( isset( $choices['primary'] ) ) {
396 $choice['attr']['conditional_id'] = $choices['primary']['attr']['conditional_id'];
397 if ( isset( $choices['primary']['attr']['conditional_rules'] ) ) {
398 $choice['attr']['conditional_rules'] = $choices['primary']['attr']['conditional_rules'];
399 }
400 }
401
402 printf( '<li %s>', evf_html_attributes( $choice['container']['id'], $choice['container']['class'], $choice['container']['data'], $choice['container']['attr'] ) );
403
404 if ( ! empty( $field['choices_images'] ) ) {
405 // Make image choices keyboard-accessible.
406 $choice['label']['attr']['tabindex'] = 0;
407
408 // Image choices.
409 printf( '<label %s>', evf_html_attributes( $choice['label']['id'], $choice['label']['class'], $choice['label']['data'], $choice['label']['attr'] ) );
410
411 if ( ! empty( $choice['image'] ) ) {
412 printf(
413 '<span class="everest-forms-image-choices-image"><img src="%s" alt="%s"%s></span>',
414 esc_url( $choice['image'] ),
415 esc_attr( $choice['label']['text'] ),
416 ! empty( $choice['label']['text'] ) ? ' title="' . esc_attr( $choice['label']['text'] ) . '"' : ''
417 );
418 }
419
420 echo '<br>';
421
422 $choice['attr']['tabindex'] = '-1';
423 printf( '<input type="checkbox" %s %s %s>', evf_html_attributes( $choice['id'], $choice['class'], $choice['data'], $choice['attr'] ), esc_attr( $choice['required'] ), checked( '1', $choice['default'], false ) );
424 echo '<label class="everest-forms-image-choices-label">' . wp_kses_post( $choice['label']['text'] ) . '</label>';
425 echo '</label>';
426 } else {
427 // Normal display.
428 printf( '<input type="checkbox" %s %s %s>', evf_html_attributes( $choice['id'], $choice['class'], $choice['data'], $choice['attr'] ), esc_attr( $choice['required'] ), checked( '1', $choice['default'], false ) );
429 printf( '<label %s>%s</label>', evf_html_attributes( $choice['label']['id'], $choice['label']['class'], $choice['label']['data'], $choice['label']['attr'] ), wp_kses_post( $choice['label']['text'] ) );
430 }
431
432 echo '</li>';
433 }
434
435 echo '</ul>';
436 }
437
438 /**
439 * Edit form field display on the entry back-end.
440 *
441 * @since 1.7.0
442 *
443 * @param array $entry_field Entry field data.
444 * @param array $field Field data.
445 * @param array $form_data Form data and settings.
446 */
447 public function edit_form_field_display( $entry_field, $field, $form_data ) {
448 $value_choices = ! empty( $entry_field['value_raw'] ) ? $entry_field['value_raw'] : array();
449
450 $this->remove_field_choices_defaults( $field, $field['properties'] );
451
452 foreach ( $value_choices as $input => $single_value ) {
453 $field['properties'] = $this->get_single_field_property_value( $single_value, sanitize_key( $input ), $field['properties'], $field );
454 }
455
456 $this->field_display( $field, null, $form_data );
457 }
458
459 /**
460 * Validates field on form submit.
461 *
462 * @since 1.6.0
463 *
464 * @param int $field_id Field ID.
465 * @param array $field_submit Submitted data.
466 * @param array $form_data Form data.
467 */
468 public function validate( $field_id, $field_submit, $form_data ) {
469 $field_submit = (array) $field_submit;
470 $form_id = $form_data['id'];
471 $fields = $form_data['form_fields'];
472 $choice_limit = empty( $fields[ $field_id ]['choice_limit'] ) ? 0 : (int) $fields[ $field_id ]['choice_limit'];
473 $entry = $form_data['entry'];
474 $visible = apply_filters( 'everest_forms_visible_fields', true, $form_data['form_fields'][ $field_id ], $entry, $form_data );
475 $required_message = isset( $form_data['form_fields'][ $field_id ]['required-field-message'], $form_data['form_fields'][ $field_id ]['required_field_message_setting'] ) && ! empty( $form_data['form_fields'][ $field_id ]['required-field-message'] ) && 'individual' == $form_data['form_fields'][ $field_id ]['required_field_message_setting'] ? $form_data['form_fields'][ $field_id ]['required-field-message'] : get_option( 'everest_forms_required_validation' );
476
477 if ( false === $visible ) {
478 return;
479 }
480
481 // Generating the error.
482 if ( $choice_limit > 0 && $choice_limit < count( $field_submit ) ) {
483 $error = get_option( 'everest_forms_check_limit_validation', esc_html__( 'You have exceeded number of allowed selections: {#}.', 'everest-forms' ) );
484 $error = str_replace( '{#}', $choice_limit, $error );
485 }
486
487 // Basic required check.
488 if ( ! empty( $fields[ $field_id ]['required'] ) && ( empty( $field_submit ) || ( 1 === count( $field_submit ) && empty( $field_submit[0] ) ) ) ) {
489 $error = $required_message;
490 }
491
492 if ( ! empty( $error ) ) {
493 evf()->task->errors[ $form_id ][ $field_id ] = $error;
494 }
495 }
496
497 /**
498 * Formats and sanitizes field.
499 *
500 * @since 1.0.0
501 *
502 * @param string $field_id Field Id.
503 * @param array $field_submit Submitted Field.
504 * @param array $form_data All Form Data.
505 * @param string $meta_key Field Meta Key.
506 */
507 public function format( $field_id, $field_submit, $form_data, $meta_key ) {
508 $field_submit = (array) $field_submit;
509 $field = $form_data['form_fields'][ $field_id ];
510 $name = make_clickable( $field['label'] );
511 $value_raw = evf_sanitize_array_combine( $field_submit );
512 $choice_keys = array();
513
514 $data = array(
515 'id' => $field_id,
516 'type' => $this->type,
517 'value' => array(
518 'name' => $name,
519 'type' => $this->type,
520 ),
521 'meta_key' => $meta_key,
522 'value_raw' => $value_raw,
523 );
524
525 /*
526 * If show_values is true, that means values posted are the raw values
527 * and not the labels. So we need to get the label values.
528 */
529 if ( ! empty( $field['show_values'] ) && '1' === $field['show_values'] ) {
530 foreach ( $field_submit as $item ) {
531 foreach ( $field['choices'] as $key => $choice ) {
532 if ( $item === $choice['value'] || ( empty( $choice['value']['label'] ) && (int) str_replace( 'Choice ', '', $item ) === $key ) ) {
533 $value[] = $choice['label'];
534 $choice_keys[] = $key;
535 break;
536 }
537 }
538 }
539
540 $data['value']['label'] = ! empty( $value ) ? evf_sanitize_array_combine( $value ) : '';
541 } else {
542 $data['value']['label'] = $value_raw;
543
544 // Determine choices keys, this is needed for image choices.
545 foreach ( $field_submit as $item ) {
546 foreach ( $field['choices'] as $key => $choice ) {
547 if ( $item === $choice['label'] ) {
548 $choice_keys[] = $key;
549 break;
550 }
551 }
552 }
553 }
554
555 // Images choices are enabled, lookup and store image URLs.
556 if ( ! empty( $choice_keys ) && ! empty( $field['choices_images'] ) ) {
557 $data['value']['images'] = array();
558
559 foreach ( $choice_keys as $key ) {
560 $data['value']['images'][] = ! empty( $field['choices'][ $key ]['image'] ) ? esc_url_raw( $field['choices'][ $key ]['image'] ) : '';
561 }
562 }
563
564 // Push field details to be saved.
565 evf()->task->form_fields[ $field_id ] = $data;
566 }
567 }
568