PluginProbe ʕ •ᴥ•ʔ
JetFormBuilder — Dynamic Blocks Form Builder / 3.4.1
JetFormBuilder — Dynamic Blocks Form Builder v3.4.1
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 / compatibility / bricks / bricks.php
jetformbuilder / compatibility / bricks Last commit date
assets 1 year ago widgets 1 year ago bricks.php 1 year ago onboarding-builder.php 1 year ago
bricks.php
92 lines
1 <?php
2
3
4 namespace JFB_Compatibility\Bricks;
5
6 use Bricks\Elements;
7 use Jet_Form_Builder\Plugin;
8 use Jet_Form_Builder\Classes\Tools;
9 use JFB_Components\Compatibility\Base_Compat_Handle_Trait;
10 use JFB_Components\Compatibility\Base_Compat_Url_Trait;
11 use JFB_Components\Compatibility\Base_Compat_Dir_Trait;
12 use JFB_Components\Module\Base_Module_After_Install_It;
13 use JFB_Components\Module\Base_Module_Handle_It;
14 use JFB_Components\Module\Base_Module_It;
15 use JFB_Components\Module\Base_Module_Url_It;
16 use JFB_Components\Module\Base_Module_Dir_It;
17
18 // If this file is called directly, abort.
19 if ( ! defined( 'WPINC' ) ) {
20 die;
21 }
22
23 class Bricks implements
24 Base_Module_It,
25 Base_Module_Handle_It,
26 Base_Module_Url_It,
27 Base_Module_Dir_It,
28 Base_Module_After_Install_It {
29
30 use Base_Compat_Handle_Trait;
31 use Base_Compat_Url_Trait;
32 use Base_Compat_Dir_Trait;
33
34 /**
35 * @var Onboarding_Builder
36 */
37 private $onboarding_builder;
38
39 public function rep_item_id() {
40 return 'bricks';
41 }
42
43 public function condition(): bool {
44 return defined( 'BRICKS_VERSION' );
45 }
46
47 public function on_install() {
48 $this->onboarding_builder = new Onboarding_Builder();
49 }
50
51 public function on_uninstall() {
52 }
53
54 public function init_hooks() {
55 add_action( 'init', array( $this, 'register_elements' ), 10 );
56 add_action( 'wp_enqueue_scripts', array( $this, 'editor_styles' ) );
57
58 $this->get_onboarding_builder()->init_hooks();
59 }
60
61 public function remove_hooks() {
62 remove_action( 'init', array( $this, 'register_elements' ) );
63 remove_action( 'wp_enqueue_scripts', array( $this, 'editor_styles' ) );
64 }
65
66 public function register_elements() {
67 $file_path = $this->get_dir( 'widgets/form.php' );
68 Elements::register_element( $file_path, '', 'JFB_Compatibility\Bricks\Widgets\Form' );
69
70 do_action( 'jet-form-builder/bricks/register-elements' );
71 }
72
73 public function editor_styles() {
74 // Enqueue your files on the canvas & frontend, not the builder panel. Otherwise custom CSS might affect builder)
75 if ( Tools::is_editor() ) {
76 wp_enqueue_style(
77 $this->get_handle( 'icons' ),
78 $this->get_url( 'assets/build/editor/icons.css' ),
79 array(),
80 Plugin::instance()->get_version()
81 );
82 }
83 }
84
85 /**
86 * @return Onboarding_Builder
87 */
88 public function get_onboarding_builder(): Onboarding_Builder {
89 return $this->onboarding_builder;
90 }
91 }
92