PluginProbe ʕ •ᴥ•ʔ
JetFormBuilder — Dynamic Blocks Form Builder / 3.3.4.1
JetFormBuilder — Dynamic Blocks Form Builder v3.3.4.1
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 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 / active-campaign / module.php
jetformbuilder / modules / active-campaign Last commit date
actions 2 years ago admin 2 years ago api 2 years ago assets 2 years ago methods 2 years ago rest-api 2 years ago module.php 2 years ago
module.php
122 lines
1 <?php
2
3
4 namespace JFB_Modules\Active_Campaign;
5
6 use Jet_Form_Builder\Actions\Manager;
7 use Jet_Form_Builder\Admin\Tabs_Handlers\Tab_Handler_Manager;
8 use JFB_Components\Module\Base_Module_Dir_It;
9 use JFB_Components\Module\Base_Module_Dir_Trait;
10 use JFB_Components\Rest_Api\Rest_Api_Controller_Base;
11 use JFB_Modules\Active_Campaign\Actions\Active_Campaign_Action;
12 use JFB_Modules\Active_Campaign\Rest_Api\Rest_Controller;
13 use JFB_Components\Module\Base_Module_After_Install_It;
14 use JFB_Components\Module\Base_Module_Handle_It;
15 use JFB_Components\Module\Base_Module_Handle_Trait;
16 use JFB_Components\Module\Base_Module_It;
17 use JFB_Components\Module\Base_Module_Url_It;
18 use JFB_Components\Module\Base_Module_Url_Trait;
19 use JFB_Modules\Active_Campaign\Admin\Tabs;
20
21 // If this file is called directly, abort.
22 if ( ! defined( 'WPINC' ) ) {
23 die;
24 }
25
26 final class Module implements
27 Base_Module_It,
28 Base_Module_After_Install_It,
29 Base_Module_Url_It,
30 Base_Module_Handle_It,
31 Base_Module_Dir_It {
32
33 use Base_Module_Url_Trait;
34 use Base_Module_Handle_Trait;
35 use Base_Module_Dir_Trait;
36
37 private $rest;
38
39 public function rep_item_id() {
40 return 'active-campaign';
41 }
42
43 public function condition(): bool {
44 return true;
45 }
46
47 public function on_install() {
48 $this->rest = new Rest_Controller();
49
50 // install tab handler for Settings page
51 Tab_Handler_Manager::instance()->install( new Tabs\Active_Campaign_Handler() );
52 }
53
54 public function on_uninstall() {
55 unset( $this->rest );
56 // remove tab handler from Settings page
57 Tab_Handler_Manager::instance()->uninstall( 'active-campaign-tab' );
58 }
59
60 public function init_hooks() {
61 add_action( 'rest_api_init', array( $this->get_rest(), 'register_routes' ) );
62 add_action( 'jet-form-builder/actions/register', array( $this, 'add_action' ) );
63 add_action(
64 'jet-form-builder/editor-assets/before',
65 array( $this, 'editor_assets' ),
66 0
67 );
68 add_action(
69 'jet-fb/admin-pages/before-assets/jfb-settings',
70 array( $this, 'admin_settings_assets' ),
71 0
72 );
73 }
74
75 public function remove_hooks() {
76 remove_action( 'rest_api_init', array( $this->get_rest(), 'register_routes' ) );
77 remove_action( 'jet-form-builder/actions/register', array( $this, 'add_action' ) );
78 remove_action(
79 'jet-form-builder/editor-assets/before',
80 array( $this, 'editor_assets' ),
81 0
82 );
83 remove_action(
84 'jet-fb/admin-pages/before-assets/jfb-settings',
85 array( $this, 'admin_settings_assets' ),
86 0
87 );
88 }
89
90 public function add_action( Manager $manager ) {
91 $manager->register_action_type( new Active_Campaign_Action() );
92 }
93
94 public function editor_assets() {
95 $script_asset = require_once $this->get_dir( 'assets/build/editor.asset.php' );
96
97 wp_enqueue_script(
98 $this->get_handle(),
99 $this->get_url( 'assets/build/editor.js' ),
100 $script_asset['dependencies'],
101 $script_asset['version'],
102 true
103 );
104 }
105
106 public function admin_settings_assets() {
107 $script_asset = require_once $this->get_dir( 'assets/build/admin/jfb-settings.asset.php' );
108
109 wp_enqueue_script(
110 $this->get_handle(),
111 $this->get_url( 'assets/build/admin/jfb-settings.js' ),
112 $script_asset['dependencies'],
113 $script_asset['version'],
114 true
115 );
116 }
117
118 public function get_rest(): Rest_Api_Controller_Base {
119 return $this->rest;
120 }
121 }
122