PluginProbe
The Innovative Form Builder – IvyForms / 1.1.1
The Innovative Form Builder – IvyForms v1.1.1
1.5.1 1.5 1.4.1 1.4 trunk 0.1.2 0.2 0.2.1 0.3 0.3.1 0.4 0.5 0.6 0.6.1 0.6.1-backup 0.6.1.1 0.7 0.8 0.8.1 0.8.2 0.9 0.9.1 1.0 1.1 1.1.1 All 27 releases
ivyforms / backend / src / Services / Integrations / IntegrationService.php

IntegrationService.php in The Innovative Form Builder – IvyForms 1.1.1, at backend/src/Services/Integrations/IntegrationService.php

145 lines 4.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace IvyForms\Services\Integrations;
4
5 use IvyForms\Common\Exceptions\InvalidArgumentException;
6
7 /**
8 * Integration Service
9 *
10 * Initializes the integration registry and registers default Lite integrations
11 *
12 * @since 1.0.0
13 */
14 class IntegrationService
15 {
16 private IntegrationRegistry $registry;
17
18 public function __construct(IntegrationRegistry $registry)
19 {
20 $this->registry = $registry;
21 }
22
23 /**
24 * Initialize integrations
25 *
26 * @return void
27 * @throws InvalidArgumentException
28 */
29 public function init(): void
30 {
31 // Register Lite integrations
32 $this->registerLiteIntegrations();
33
34 /**
35 * Allow Pro/addons to register their integrations
36 *
37 * @since 1.0.0
38 *
39 * @param IntegrationRegistry $registry The integration registry instance
40 */
41 do_action('ivyforms/integrations/register', $this->registry);
42 }
43
44 /**
45 * Register default Lite integrations
46 *
47 * @return void
48 * @throws InvalidArgumentException
49 */
50 private function registerLiteIntegrations(): void
51 {
52 // wpDataTables Integration (Lite)
53 $this->registry->register('wpdatatables', [
54 'label' => 'wpdatatables_label',
55 'component' => 'WpDataTablesIntegrationSettings',
56 'icon' => 'wpdatatables',
57 'description' => 'wpdatatables_description',
58 'category' => 'Data Management',
59 'requiresAuth' => false,
60 'plan' => 'lite',
61 'settingsSchema' => [
62 'enabled' => [
63 'type' => 'boolean',
64 'default' => false,
65 ],
66 ],
67 ]);
68
69 // Amelia Booking Integration (Lite)
70 $this->registry->register('ameliabooking', [
71 'label' => 'ameliabooking_label',
72 'component' => 'AmeliaBookingIntegrationSettings',
73 'icon' => 'ameliabooking',
74 'description' => 'ameliabooking_description',
75 'category' => 'Booking',
76 'requiresAuth' => false,
77 'hasFormSettings' => false,
78 'plan' => 'lite',
79 'settingsSchema' => [
80 'enabled' => [
81 'type' => 'boolean',
82 'default' => false,
83 ],
84 ],
85 ]);
86
87 // Register Pro integrations as placeholders
88 // These will be shown with "Upgrade" button when Pro is not installed
89 // When Pro is installed, these will be overwritten by Pro's registrar
90
91 // MailChimp Integration (Pro - Essentials)
92 $this->registry->register('mailchimp', [
93 'label' => 'mailchimp_label',
94 'component' => 'MailChimpIntegrationSettings',
95 'icon' => 'mailchimp',
96 'description' => 'mailchimp_description',
97 'category' => 'Email Marketing',
98 'requiresAuth' => true,
99 'hasGlobalSettings' => true,
100 'plan' => 'essentials',
101 ]);
102
103 // Webhooks Integration (Pro - Growth)
104 $this->registry->register('webhooks', [
105 'label' => 'webhooks_label',
106 'component' => 'WebhooksIntegrationSettings',
107 'icon' => 'webhooks',
108 'description' => 'webhooks_description',
109 'category' => 'Developer Tools',
110 'requiresAuth' => false,
111 'hasGlobalSettings' => false,
112 'plan' => 'growth',
113 'learnMoreUrl' => 'https://ivyforms.com/documentation/webhooks-integration/',
114 'settingsSchema' => [
115 'enabled' => [
116 'type' => 'boolean',
117 'default' => false,
118 ],
119 ],
120 ]);
121
122 // Zapier Integration (Pro - Growth)
123 // $this->registry->register('zapier', [
124 // 'label' => 'zapier_label',
125 // 'component' => 'ZapierIntegrationSettings',
126 // 'icon' => 'zapier',
127 // 'description' => 'zapier_description',
128 // 'category' => 'Automation',
129 // 'requiresAuth' => false,
130 // 'plan' => 'growth',
131 // ]);
132
133 // Salesforce Integration (Pro - Agency)
134 // $this->registry->register('salesforce', [
135 // 'label' => 'salesforce_label',
136 // 'component' => 'SalesforceIntegrationSettings',
137 // 'icon' => 'salesforce',
138 // 'description' => 'salesforce_description',
139 // 'category' => 'CRM',
140 // 'requiresAuth' => true,
141 // 'plan' => 'agency',
142 // ]);
143 }
144 }
145