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