PluginProbe ʕ •ᴥ•ʔ
JetFormBuilder — Dynamic Blocks Form Builder / 3.5.4
JetFormBuilder — Dynamic Blocks Form Builder v3.5.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 / modules / blocks-v2 / text-field / block-template.php
jetformbuilder / modules / blocks-v2 / text-field Last commit date
assets 1 year ago .eslintrc.js 1 year ago block-asset.php 1 year ago block-render.php 2 years ago block-template.php 1 year ago block-type.php 2 years ago block.json 1 year ago
block-template.php
105 lines
1 <?php
2 /**
3 * input[type="hidden"] template
4 *
5 * @var Base $this
6 * @var array $args
7 */
8
9 use Jet_Form_Builder\Blocks\Render\Base;
10 use Jet_Form_Builder\Classes\Tools;
11
12 // If this file is called directly, abort.
13 if ( ! defined( 'WPINC' ) ) {
14 die;
15 }
16
17 $this->set_value();
18 $this->add_attribute( 'placeholder', $args['placeholder'] );
19 $this->add_attribute( 'required', $this->block_type->get_required_val() );
20 $this->add_attribute( 'name', $this->block_type->get_field_name( $args['name'] ) );
21 $this->add_attribute( 'id', $this->block_type->get_field_id( $args ) );
22 $this->add_attribute( 'type', $args['field_type'] );
23 $this->add_attribute( 'data-field-name', $args['name'] );
24 $this->add_attribute( 'class', 'jet-form-builder__field text-field' );
25 $this->add_attribute( 'class', $args['class_name'] );
26 $this->add_attribute( 'minlength', $this->args['minlength'] ?? '' );
27 $this->add_attribute( 'maxlength', $this->args['maxlength'] ?? '' );
28 $this->add_attribute( 'data-jfb-sync' );
29
30 $this->add_attribute(
31 'autocomplete',
32 'off' === $this->args['autocomplete']
33 ? 'off_' . substr( str_shuffle( 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789' ), 0, 8 )
34 : $this->args['autocomplete']
35 );
36
37
38 if ( ! empty( $args['enable_input_mask'] ) && ! empty( $args['input_mask'] ) ) {
39 $this->add_attribute( 'class', 'jet-form-builder__masked-field' );
40
41 $mask_type = ! empty( $args['mask_type'] ) ? $args['mask_type'] : '';
42
43 $clear = $this->args['clear_on_submit'] ?? '';
44
45 if ( $clear ) {
46 $this->add_attribute( 'data-clear-mask-on-submit', $clear );
47 }
48
49 if ( $mask_type ) {
50 $this->add_attribute( 'data-inputmask', '\'alias\': \'' . esc_attr( $mask_type ) . '\'' );
51 $this->add_attribute( 'data-inputmask-inputformat', esc_attr( $args['input_mask'] ) );
52 $this->add_attribute( 'data-inputmask-inputmode', 'verbatim' );
53 } else {
54 $this->add_attribute( 'data-inputmask', '\'mask\': \'' . esc_attr( $args['input_mask'] ) . '\'' );
55 }
56
57 $mask_placeholder = ! empty( $args['mask_placeholder'] ) ? esc_attr( $args['mask_placeholder'] ) : '';
58
59 if ( $mask_placeholder ) {
60 $this->add_attribute( 'data-inputmask-placeholder', $mask_placeholder );
61 }
62
63 $mask_visibility = ! empty( $args['mask_visibility'] ) ? $args['mask_visibility'] : 'always';
64
65 switch ( $mask_visibility ) {
66 case 'focus':
67 $this->add_attribute( 'data-inputmask-showmaskonhover', 'false' );
68 break;
69
70 case 'hover':
71 $this->add_attribute( 'data-inputmask-showmaskonhover', 'true' );
72 $this->add_attribute( 'data-inputmask-showmaskonfocus', 'true' );
73 break;
74
75 default:
76 $this->add_attribute( 'data-inputmask-clearmaskonlostfocus', 'false' );
77 break;
78 }
79 }
80 $show_eye = $this->args['showEye'] ?? false;
81 $wrap_classes = sprintf(
82 'jet-form-builder__field-wrap %s',
83 $show_eye ? 'has-eye-icon' : ''
84 )
85
86 // phpcs:disable WordPress.Security.EscapeOutput.OutputNotEscaped
87 ?>
88 <div class="<?php echo esc_attr( trim( $wrap_classes ) ); ?>">
89 <?php do_action( 'jet-form-builder/before-field', $this ); ?>
90 <input <?php $this->render_attributes_string(); ?>>
91 <?php if ( $show_eye && 'password' === $args['field_type'] ) : ?>
92 <span
93 class="jfb-eye-icon seen"
94 role="button"
95 tabindex="0"
96 style="<?php echo Tools::is_editor() ? 'display:none;' : ''; ?>"
97 >
98 <?php echo $this->get_seen_icon(); ?>
99 <?php echo $this->get_unseen_icon(); ?>
100 </span>
101 <?php endif; ?>
102 <?php do_action( 'jet-form-builder/after-field', $this ); ?>
103 </div>
104 <?php // phpcs:enable WordPress.Security.EscapeOutput.OutputNotEscaped
105