PluginProbe
SureForms – Contact Form Builder, AI Forms, Payment Form, Survey & Quiz / 0.0.13
SureForms – Contact Form Builder, AI Forms, Payment Form, Survey & Quiz v0.0.13
2.12.7 2.12.6 2.12.5 2.12.4 2.12.3 2.12.2 2.12.1 2.12.0 2.11.1 2.11.0 2.10.1 2.10.0 2.9.1 2.9.0 2.8.2 2.8.1 2.7.0 2.7.1 2.8.0 trunk 0.0.10 0.0.11 0.0.12 0.0.13 0.0.2 All 97 releases
sureforms / inc / page-builders / page-builders.php

page-builders.php in SureForms – Contact Form Builder, AI Forms, Payment Form, Survey & Quiz 0.0.13, at inc/page-builders/page-builders.php

64 lines 2.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Page Builder.
4 *
5 * @package sureforms.
6 * @since 0.0.5
7 */
8
9 namespace SRFM\Inc\Page_Builders;
10
11 use SRFM\Inc\Page_Builders\Elementor\Service_Provider as Elementor_Service_Provider;
12 use SRFM\Inc\Page_Builders\Bricks\Service_Provider as Bricks_Service_Provider;
13 use SRFM\Inc\Traits\Get_Instance;
14 use SRFM\Inc\Frontend_Assets;
15
16 /**
17 * Class to add SureForms widget in other page builders.
18 */
19 class Page_Builders {
20 use Get_Instance;
21
22 /**
23 * Constructor
24 *
25 * Load all Page Builders form widgets.
26 *
27 * @since 0.0.5
28 * @return void
29 */
30 public function __construct() {
31 Elementor_Service_Provider::get_instance();
32 Bricks_Service_Provider::get_instance();
33 }
34
35 /**
36 * Enqueue common fields assets for the dropdown and phone fields.
37 *
38 * @since 0.0.10
39 * @return void
40 */
41 public static function enqueue_common_fields_assets() {
42 $file_prefix = defined( 'SRFM_DEBUG' ) && SRFM_DEBUG ? '' : '.min';
43 $dir_name = defined( 'SRFM_DEBUG' ) && SRFM_DEBUG ? 'unminified' : 'minified';
44 $js_uri = SRFM_URL . 'assets/js/' . $dir_name . '/blocks/';
45 $js_vendor_uri = SRFM_URL . 'assets/js/minified/deps/';
46
47 wp_enqueue_script( SRFM_SLUG . '-phone', $js_uri . 'phone' . $file_prefix . '.js', [], SRFM_VER, true );
48 wp_enqueue_script( SRFM_SLUG . '-phone-intl-input-deps', $js_vendor_uri . 'intl/intTelInput.min.js', [], SRFM_VER, true );
49 wp_enqueue_script( SRFM_SLUG . '-phone-intl-utils-deps', $js_vendor_uri . 'intl/intTelUtils.min.js', [], SRFM_VER, true );
50
51 wp_enqueue_script( SRFM_SLUG . '-dropdown', $js_uri . 'dropdown' . $file_prefix . '.js', [], SRFM_VER, true );
52 wp_enqueue_script( SRFM_SLUG . '-tom-select', $js_vendor_uri . 'tom-select.min.js', [], SRFM_VER, true );
53
54 if ( defined( 'SRFM_PRO_VER' ) && defined( 'SRFM_PRO_URL' ) && defined( 'SRFM_PRO_SLUG' ) ) {
55 $css_uri = SRFM_PRO_URL . 'assets/css/' . $dir_name . '/';
56
57 wp_enqueue_style( SRFM_PRO_SLUG . '-frontend-default', $css_uri . '/blocks/default/frontend' . $file_prefix . '.css', [], SRFM_PRO_VER );
58 }
59
60 Frontend_Assets::enqueue_scripts_and_styles();
61 }
62
63 }
64