PluginProbe ʕ •ᴥ•ʔ
JetFormBuilder — Dynamic Blocks Form Builder / 1.2.6
JetFormBuilder — Dynamic Blocks Form Builder v1.2.6
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 / media-field.php
jetformbuilder / templates / fields Last commit date
calculated-field.php 4 years ago checkbox-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 radio-field.php 4 years ago range-field.php 4 years ago select-field.php 4 years ago submit-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
media-field.php
58 lines
1 <?php
2 /**
3 * Media field template
4 */
5 use Jet_Form_Builder\File_Upload;
6
7 $this->add_attribute( 'class', 'jet-form-builder__field file-field jet-form-builder-file-upload__input' );
8 $this->add_attribute( 'class', $this->maybe_get_error_class( $args ) );
9 $this->add_attribute( 'class', $args['class_name'] );
10 $this->add_attribute( 'name', $this->block_type->get_field_name( $args['name'] . '_input' ) );
11 $this->add_attribute( 'type', 'file' );
12 $this->add_attribute( 'data-form_id', $this->form_id );
13 $this->add_attribute( 'data-field', $args['name'] );
14 $this->add_attribute( 'id', $this->block_type->get_field_id( $args ) );
15
16 if ( ! empty( $args['max_files'] ) ) {
17 $this->add_attribute( 'data-max_files', absint( $args['max_files'] ) );
18 $this->add_attribute( 'multiple', true );
19 }
20
21 if ( ! empty( $args['allowed_mimes'] ) ) {
22 $this->add_attribute( 'accept', implode( ',', $args['allowed_mimes'] ) );
23 }
24
25 $max_size = File_Upload::instance()->get_max_size_for_field( $args );
26
27 $this->add_attribute( 'data-max_size', $max_size );
28
29 $required = $this->block_type->get_required_val( $args );
30
31 if ( $required ) {
32 $required = 'required="required"';
33 }
34
35 if ( ! empty( $args['insert_attachment'] ) ) {
36 $format = ! empty( $args['value_format'] ) ? $args['value_format'] : 'url';
37 } else {
38 $format = 'url';
39 }
40
41 $value = File_Upload::instance()->get_result_value( $args );
42 $value = is_array( $value ) || ( 'url' === $format ) ? json_encode( $value ) : $value;
43 ?>
44 <div class="jet-form-builder__field-wrap jet-form-builder-file-upload">
45 <div class="jet-form-builder-file-upload__content">
46 <?php echo File_Upload::instance()->get_loader(); ?>
47 <div class="jet-form-builder-file-upload__files" <?php echo File_Upload::instance()->get_files_data_args( $this->block_type->block_attrs ); ?>><?php
48 echo File_Upload::instance()->get_result_html( $args );
49 ?></div>
50 </div>
51 <div class="jet-form-builder-file-upload__fields">
52 <input class="jet-form-builder-file-upload__value" type="hidden" name="<?php echo $this->block_type->get_field_name( $args['name'] ); ?>" data-field-name="<?php echo $args['name']; ?>" value="<?php echo htmlspecialchars( $value ); ?>" <?php echo $required; ?>>
53 <input <?php $this->render_attributes_string(); ?>>
54 <?php echo $this->maybe_render_error( $args ); ?>
55 </div>
56 <div class="jet-form-builder-file-upload__message"><small><?php _e( 'Maximum file size', 'jet-engine' );?>: <?php echo size_format( $max_size ); ?></small></div>
57 <div class="jet-form-builder-file-upload__errors is-hidden"></div>
58 </div>