PluginProbe ʕ •ᴥ•ʔ
JetFormBuilder — Dynamic Blocks Form Builder / 2.0.4
JetFormBuilder — Dynamic Blocks Form Builder v2.0.4
3.6.3.1 3.6.3 3.6.2.2 3.6.2.1 3.6.2 3.6.1.1 3.6.1 3.6.0.1 trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.1.0 1.1.1 1.1.2 1.1.3 1.1.4 1.1.5 1.1.6 1.1.7 1.2.0 1.2.1 1.2.2 1.2.3 1.2.4 1.2.5 1.2.6 1.2.7 1.3.0 1.3.1 1.3.2 1.3.3 1.4.0 1.4.1 1.4.2 1.4.3 1.5.0 1.5.1 1.5.2 1.5.3 1.5.4 1.5.5 2.0.0 2.0.1 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6 2.1.0 2.1.1 2.1.10 2.1.11 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.1.7 2.1.8 2.1.9 3.0.0 3.0.0.1 3.0.0.2 3.0.0.3 3.0.1 3.0.1.1 3.0.2 3.0.3 3.0.4 3.0.5 3.0.6 3.0.7 3.0.8 3.0.9 3.1.0 3.1.0.1 3.1.1 3.1.2 3.1.3 3.1.4 3.1.5 3.1.6 3.1.7 3.1.8 3.1.9 3.2.0 3.2.1 3.2.2 3.2.3 3.3.0 3.3.1 3.3.2 3.3.3 3.3.3.1 3.3.4 3.3.4.1 3.3.4.2 3.4.0 3.4.1 3.4.2 3.4.3 3.4.4 3.4.5 3.4.5.1 3.4.5.2 3.4.6 3.4.7 3.4.7.1 3.5.0 3.5.1 3.5.1.1 3.5.1.2 3.5.2 3.5.2.1 3.5.3 3.5.4 3.5.5 3.5.6 3.5.6.1 3.5.6.2 3.5.6.3 3.6.0
jetformbuilder / templates / fields / calculated-field.php
jetformbuilder / templates / fields Last commit date
action-button.php 4 years ago calculated-field.php 4 years ago checkbox-field.php 4 years ago color-picker-field.php 4 years ago date-field.php 4 years ago datetime-field.php 4 years ago form-break-field.php 4 years ago group-break-field.php 4 years ago heading-field.php 4 years ago hidden-field.php 4 years ago media-field.php 4 years ago number-field.php 4 years ago progress-bar.php 4 years ago radio-field.php 4 years ago range-field.php 4 years ago select-field.php 4 years ago text-field.php 4 years ago textarea-field.php 4 years ago time-field.php 4 years ago wysiwyg-field.php 4 years ago
calculated-field.php
57 lines
1 <?php
2 /**
3 * Calculated field template
4 *
5 * @var Calculated_Field_Render $this
6 */
7
8 use Jet_Form_Builder\Blocks\Render\Calculated_Field_Render;
9
10 $calc_data = $this->get_calculated_data( $args );
11
12 if ( empty( $calc_data['formula'] ) ) {
13 return;
14 }
15
16 $name = $this->block_type->get_field_name( $args['name'] );
17 $default_value = ! empty( $args['default'] ) ? $args['default'] : '';
18 $prefix = ! empty( $args['calc_prefix'] ) ? $args['calc_prefix'] : false;
19 $suffix = ! empty( $args['calc_suffix'] ) ? $args['calc_suffix'] : false;
20 $precision = isset( $args['precision'] ) ? $args['precision'] : 0;
21 $is_hidden = isset( $args['calc_hidden'] ) ? filter_var( $args['calc_hidden'], FILTER_VALIDATE_BOOLEAN ) : false;
22
23 $this->add_attribute( 'class', $args['class_name'] );
24 $this->add_attribute( 'data-formula', $calc_data['formula'] );
25 $this->add_attribute( 'data-name', $args['name'] );
26 $this->add_attribute( 'data-listen_to', htmlspecialchars( wp_json_encode( $calc_data['listen_fields'] ) ) );
27 $this->add_attribute( 'data-precision', $precision );
28 $this->add_attribute( 'data-sep-decimal', $args['separate_decimals'] );
29 $this->add_attribute( 'data-sep-thousands', $args['separate_thousands'] );
30
31 $this->add_attribute(
32 'class',
33 empty( $this->block_type->get_current_repeater() )
34 ? 'jet-form-builder__calculated-field'
35 : 'jet-form-builder__calculated-field--child'
36 );
37
38 $this->add_attribute( 'class', $is_hidden ? 'jet-form-builder__calculated-field--hidden' : '' );
39
40 // phpcs:disable WordPress.Security.EscapeOutput.OutputNotEscaped, WordPress.WhiteSpace.PrecisionAlignment.Found
41 ?>
42 <div <?php $this->render_attributes_string(); ?>>
43 <?php if ( false !== $prefix ) : ?>
44 <div class="jet-form-builder__calculated-field-prefix"><?php echo wp_kses_post( $prefix ); ?></div>
45 <?php endif; ?>
46 <input type="hidden"
47 name="<?php echo esc_attr( $name ); ?>"
48 value="<?php echo esc_attr( $default_value ); ?>"
49 class="jet-form-builder__calculated-field-input jet-form-builder__field"
50 data-field-name="<?php echo esc_attr( $args['name'] ); ?>" />
51 <div class="jet-form-builder__calculated-field-val"><?php echo wp_kses_post( $this->render_editor_placeholder() ); ?></div>
52 <?php if ( false !== $suffix ) : ?>
53 <div class="jet-form-builder__calculated-field-suffix"><?php echo wp_kses_post( $suffix ); ?></div>
54 <?php endif; ?>
55 </div>
56 <?php // phpcs:enable WordPress.Security.EscapeOutput.OutputNotEscaped, WordPress.WhiteSpace.PrecisionAlignment.Found
57