PluginProbe
JetFormBuilder — Dynamic Blocks Form Builder / 3.5.6
JetFormBuilder — Dynamic Blocks Form Builder v3.5.6
3.6.5.2 3.6.5.1 3.6.5 3.6.4.2 3.6.4.1 3.6.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 All 130 releases
jetformbuilder / includes / file-upload.php

file-upload.php in JetFormBuilder — Dynamic Blocks Form Builder 3.5.6, at includes/file-upload.php

57 lines 1.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Jet_Form_Builder;
4
5 use Jet_Form_Builder\Classes\Instance_Trait;
6 use Jet_Form_Builder\Classes\Tools;
7
8 // If this file is called directly, abort.
9 if ( ! defined( 'WPINC' ) ) {
10 die;
11 }
12
13 /**
14 * @method static File_Upload instance()
15 *
16 * Class description
17 *
18 * @package package_name
19 * @author Cherry Team
20 * @license GPL-2.0+
21 */
22 class File_Upload {
23
24 use Instance_Trait;
25
26 public function get_loader() {
27 return '<div class="jet-form-builder-file-upload__loader">' . apply_filters(
28 'jet-form-builder/file-upload/loader',
29 '<svg xmlns="http://www.w3.org/2000/svg" width="38" height="38" viewBox="0 0 38 38" stroke="#fff"><g fill="none" fill-rule="evenodd"><g transform="translate(1 1)" stroke-width="2"><circle stroke-opacity=".5" cx="18" cy="18" r="18"/><path d="M36 18c0-9.94-8.06-18-18-18" transform="rotate(137.826 18 18)"><animateTransform attributeName="transform" type="rotate" from="0 18 18" to="360 18 18" dur="1s" repeatCount="indefinite"/></path></g></g></svg>'
30 ) . '</div>';
31 }
32
33 /**
34 * Register form-specific assets
35 *
36 * @return void
37 */
38 public function enqueue_scripts() {
39 wp_enqueue_script( 'jet-form-builder-sortable' );
40 wp_enqueue_script( 'jet-form-builder-file-upload' );
41
42 $messages = wp_json_encode( jet_form_builder()->msg_router->get_manager()->get_messages() );
43 $form_id = (int) Live_Form::instance()->form_id;
44
45 wp_add_inline_script(
46 'jet-form-builder-file-upload',
47 "
48 window.JetFormBuilderFileUploadConfig = window.JetFormBuilderFileUploadConfig || {};
49 window.JetFormBuilderFileUploadConfig.errors = window.JetFormBuilderFileUploadConfig.errors || {};
50
51 window.JetFormBuilderFileUploadConfig.errors[ $form_id ] = $messages;
52 "
53 );
54 }
55
56 }
57