PluginProbe ʕ •ᴥ•ʔ
ElementsKit Elementor Addons – Advanced Widgets & Templates Addons for Elementor / 4.0.2
ElementsKit Elementor Addons – Advanced Widgets & Templates Addons for Elementor v4.0.2
4.0.3 4.0.2 4.0.1 4.0.0 3.10.02 3.10.01 3.9.10 3.9.9 3.9.8 3.9.7 3.9.5 3.9.6 3.9.3 2.1.0 2.1.1 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.1.7 2.2.0 2.2.1 2.2.2 2.2.3 2.2.4 2.3.0 2.3.1 2.3.1.1 2.3.2 2.3.3 2.3.4 2.3.5 2.3.6 2.3.7 2.4.0 2.5.0 2.5.1 2.5.10 2.5.2 2.5.3 2.5.4 2.5.5 2.5.6 2.5.7 2.5.8 2.5.9 2.6.0 2.6.1 2.6.2 2.6.3 2.7.0 2.7.2 2.7.3 2.7.4 2.7.5 2.8.0 2.8.1 2.8.5 2.8.6 2.8.7 2.8.8 2.9.0 2.9.1 2.9.2 3.0.0 3.0.1 3.0.2 3.0.3 3.0.4 3.0.5 3.0.6 3.0.7 3.1.0 3.1.1 3.1.2 3.1.3 3.1.4 3.2.0 3.2.1 3.2.2 3.2.3 3.2.4 3.2.5 3.2.6 3.2.7 3.2.8 3.2.9 3.3.0 3.3.1 3.3.2 3.3.3 3.3.4 3.3.5 3.3.6 3.3.7 3.3.8 3.3.9 3.4.0 3.4.1 3.4.2 3.4.3 3.4.4 3.4.5 3.4.6 3.4.7 3.4.8 3.4.9 3.5.0 3.5.1 3.5.2 3.5.3 3.5.4 3.5.5 3.5.6 3.6.0 3.6.1 3.7.0 3.7.1 3.7.2 3.7.3 3.7.4 3.7.5 3.7.6 3.7.7 3.7.8 3.7.9 3.8.0 3.8.1 3.8.2 3.9.0 3.9.1 3.9.2 trunk 1.2.6 1.2.7 1.2.9 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 1.3.8 1.3.9 1.4.0 1.4.1 1.4.2 1.4.3 1.4.4 1.4.5 1.4.7 1.4.8 1.4.9 1.5.0 1.5.1 1.5.10 1.5.11 1.5.12 1.5.2 1.5.4 1.5.5 1.5.6 1.5.7 1.5.8 1.5.9 2.0.0 2.0.1 2.0.10 2.0.11 2.0.12 2.0.13 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6 2.0.7 2.0.8 2.0.9 2.0.9.1 2.0.9.2 2.0.9.3
elementskit-lite / widgets / mail-chimp / mail-chimp.php
elementskit-lite / widgets / mail-chimp Last commit date
mail-chimp-api.php 2 weeks ago mail-chimp-handler.php 2 weeks ago mail-chimp.php 2 weeks ago
mail-chimp.php
2152 lines
1 <?php
2 namespace Elementor;
3
4 use \Elementor\ElementsKit_Widget_Mail_Chimp_Handler as Handler;
5 use \ElementsKit_Lite\Widgets\Mail_Chimp\Mail_Chimp_Api;
6 use \ElementsKit_Lite\Modules\Controls\Controls_Manager as ElementsKit_Controls_Manager;
7
8 if ( ! defined( 'ABSPATH' ) ) exit;
9
10
11 class ElementsKit_Widget_Mail_Chimp extends Widget_Base {
12 use \ElementsKit_Lite\Widgets\Widget_Notice;
13
14
15 public $base;
16
17 public function get_script_depends() {
18 return ['ekit-mailchimp'];
19 }
20
21 public function get_style_depends() {
22 return ['ekit-mail-chimp'];
23 }
24
25 public function get_name() {
26 return Handler::get_name();
27 }
28
29 public function get_title() {
30 return Handler::get_title();
31 }
32
33 public function get_icon() {
34 return Handler::get_icon();
35 }
36
37 public function get_categories() {
38 return Handler::get_categories();
39 }
40
41 public function get_keywords() {
42 return Handler::get_keywords();
43 }
44
45 public function get_help_url() {
46 return 'https://wpmet.com/doc/mailchimp-3/';
47 }
48 protected function is_dynamic_content(): bool {
49 return false;
50 }
51
52 public function __get_lists() {
53 $options = ['' => 'Select List'];
54 $dataApi = Handler::get_data();
55 $token = isset($dataApi['token']) ? $dataApi['token'] : '';
56 $lists = Mail_Chimp_Api::get_lists($token, $this->is_editor_request());
57
58 if (is_array($lists)) {
59 foreach ($lists as $id => $name) {
60 $options[$id] = $name;
61 }
62 }
63
64 return $options;
65 }
66
67 /**
68 * Whether the current request is one that actually renders the Elementor controls panel.
69 */
70 private function is_editor_request() {
71 if (is_admin()) {
72 return true;
73 }
74
75 if (!class_exists('\Elementor\Plugin')) {
76 return false;
77 }
78
79 $elementor = \Elementor\Plugin::$instance;
80
81 return ($elementor->editor->is_edit_mode() || $elementor->preview->is_preview_mode());
82 }
83
84 protected function register_controls() {
85
86 //start content Mail form design
87 $this->start_controls_section(
88 'ekit_mail_chimp_section_form', [
89 'label' => esc_html__( 'Form ', 'elementskit-lite' ),
90 ]
91 );
92
93 $this->add_control(
94 'ekit_mail_chimp_select_check_api',
95 [
96 'raw' => '<strong>' . esc_html__( 'Please note!', 'elementskit-lite' ) . '</strong> ' . esc_html__( 'Please set API Key in ElementsKit_Lite Dashboard - User Data - MailChimp and Create Campaign..', 'elementskit-lite' ),
97 'type' => Controls_Manager::RAW_HTML,
98 'content_classes' => 'elementor-panel-alert elementor-panel-alert-warning',
99 'render_type' => 'ui',
100 'condition' => [
101 'ekit_mail_chimp_select_listed_id' => '',
102 ],
103 ]
104 );
105 $this->add_control(
106 'ekit_mail_chimp_select_listed_id',
107 [
108 'label' => esc_html__( 'Select List', 'elementskit-lite' ),
109 'type' => Controls_Manager::SELECT,
110 'default' => '',
111 'options' => $this->__get_lists(),
112 'description' => esc_html__('Create a campaign in mailchimp account <a href="https://mailchimp.com/help/create-a-regular-email-campaign/#Create_a_campaign" target="_blank"> Create Campaign</a>', 'elementskit-lite'),
113 ]
114 );
115
116 $this->add_control(
117 'ekit_mail_chimp_double_opt_in',
118 [
119 'label' => esc_html__( 'Double Opt-in', 'elementskit-lite' ),
120 'type' => Controls_Manager::SWITCHER,
121 'default' => 'no',
122 'description' => esc_html__('If you enable this feature , then you must need to enable it inside Mailchimp campaign settings. Otherwise please disable it.', 'elementskit-lite')
123 ]
124 );
125
126 $this->add_control(
127 'ekit_mail_chimp_opt_in_success_message',
128 [
129 'label' => esc_html__( 'Opt-in Success Message', 'elementskit-lite' ),
130 'type' => Controls_Manager::TEXT,
131 'dynamic' => [
132 'active' => true,
133 ],
134 'label_block' => true,
135 'default' => esc_html__( 'Please check your mail and confirm subscribe', 'elementskit-lite' ),
136 'placeholder' => esc_html__( 'Type your title here', 'elementskit-lite' ),
137 'condition' => [
138 'ekit_mail_chimp_double_opt_in' => 'yes',
139 ],
140 ]
141 );
142
143 $repeater = new Repeater();
144
145 $repeater->add_control(
146 'ekit_mail_chimp_field_type',
147 [
148 'label' => esc_html__( 'Type', 'elementskit-lite' ),
149 'type' => Controls_Manager::SELECT,
150 'default' => 'text',
151 'options' => [
152 'text' => esc_html__( 'Text', 'elementskit-lite' ),
153 'email' => esc_html__( 'Email', 'elementskit-lite' ),
154 'tel' => esc_html__( 'Phone', 'elementskit-lite' ),
155 'textarea' => esc_html__( 'Textarea', 'elementskit-lite' ),
156 ],
157 ]
158 );
159
160 $repeater->add_control(
161 'ekit_mail_chimp_field_label',
162 [
163 'label' => esc_html__( 'Label', 'elementskit-lite' ),
164 'type' => Controls_Manager::TEXT,
165 'default' => esc_html__( 'Label', 'elementskit-lite' ),
166 'dynamic' => [
167 'active' => true,
168 ],
169 ]
170 );
171
172 $repeater->add_control(
173 'ekit_mail_chimp_field_placeholder',
174 [
175 'label' => esc_html__( 'Placeholder', 'elementskit-lite' ),
176 'type' => Controls_Manager::TEXT,
177 'default' => esc_html__( 'Placeholder', 'elementskit-lite' ),
178 'dynamic' => [
179 'active' => true,
180 ],
181 ]
182 );
183
184 $repeater->add_control(
185 'ekit_mail_chimp_field_name',
186 [
187 'label' => esc_html__( 'Name', 'elementskit-lite' ),
188 'type' => Controls_Manager::TEXT,
189 'description' => esc_html__( 'This name must match with your MailChimp MERGE tag.', 'elementskit-lite' ),
190 'default' => '',
191 'dynamic' => [
192 'active' => true,
193 ],
194 ]
195 );
196
197 $repeater->add_control(
198 'ekit_mail_chimp_field_required',
199 [
200 'label' => esc_html__( 'Required', 'elementskit-lite' ),
201 'type' => Controls_Manager::SWITCHER,
202 'label_on' => esc_html__( 'Yes', 'elementskit-lite' ),
203 'label_off' => esc_html__( 'No', 'elementskit-lite' ),
204 'return_value' => 'yes',
205 'default' => 'no',
206 ]
207 );
208
209 $repeater->add_control(
210 'ekit_mail_chimp_field_icon_show',
211 [
212 'label' => esc_html__( 'Show Icon', 'elementskit-lite' ),
213 'type' => Controls_Manager::SWITCHER,
214 'label_on' => esc_html__( 'Yes', 'elementskit-lite' ),
215 'label_off' => esc_html__( 'No', 'elementskit-lite' ),
216 'return_value' => 'yes',
217 'default' => 'no',
218 ]
219 );
220
221 $repeater->add_control(
222 'ekit_mail_chimp_field_icon',
223 [
224 'label' => esc_html__( 'Icon', 'elementskit-lite' ),
225 'type' => Controls_Manager::ICONS,
226 'default' => [
227 'value' => 'fas fa-user',
228 'library' => 'fa-solid',
229 ],
230 'condition' => [
231 'ekit_mail_chimp_field_icon_show' => 'yes',
232 ],
233 ]
234 );
235
236 $repeater->add_control(
237 'ekit_mail_chimp_field_icon_position',
238 [
239 'label' => esc_html__( 'Icon Position', 'elementskit-lite' ),
240 'type' => Controls_Manager::SELECT,
241 'default' => 'before',
242 'options' => [
243 'before' => esc_html__( 'Before', 'elementskit-lite' ),
244 'after' => esc_html__( 'After', 'elementskit-lite' ),
245 ],
246 'condition' => [
247 'ekit_mail_chimp_field_icon_show' => 'yes',
248 ],
249 ]
250 );
251
252 $this->add_control(
253 'ekit_mail_chimp_fields_repeater',
254 [
255 'label' => esc_html__( 'Form Fields', 'elementskit-lite' ),
256 'type' => Controls_Manager::REPEATER,
257 'fields' => $repeater->get_controls(),
258 'default' => [
259 [
260 'ekit_mail_chimp_field_type' => 'email',
261 'ekit_mail_chimp_field_label' => 'Email Address',
262 'ekit_mail_chimp_field_placeholder' => 'Email Address',
263 'ekit_mail_chimp_field_name' => 'email',
264 'ekit_mail_chimp_field_required' => 'yes',
265 'ekit_mail_chimp_field_icon_show' => 'yes',
266 'ekit_mail_chimp_field_icon' => [
267 'value' => 'icon icon-envelope',
268 'library' => 'ekiticons',
269 ],
270 'ekit_mail_chimp_field_icon_position' => 'before',
271 ]
272 ],
273 'title_field' => '{{{ ekit_mail_chimp_field_label }}}',
274 ]
275 );
276
277 // submit button text
278 $this->add_control(
279 'ekit_mail_chimp_submit',
280 [
281 'label' => esc_html__( 'Submit Button Text', 'elementskit-lite' ),
282 'type' => Controls_Manager::TEXT,
283 'dynamic' => [
284 'active' => true,
285 ],
286 'default' => esc_html__( 'Sign Up', 'elementskit-lite' ),
287 'label_block' => false,
288 ]
289 );
290 $this->add_control(
291 'ekit_mail_chimp_submit_button_heading',
292 [
293 'label' => esc_html__( 'Submit Button:', 'elementskit-lite' ),
294 'type' => Controls_Manager::HEADING,
295 ]
296 );
297 $this->add_control(
298 'ekit_mail_chimp_submit_icon_show',
299 [
300 'label' => esc_html__( 'Show Icon', 'elementskit-lite' ),
301 'type' => Controls_Manager::SWITCHER,
302 'label_on' => esc_html__( 'Show', 'elementskit-lite' ),
303 'label_off' => esc_html__( 'Hide', 'elementskit-lite' ),
304 'return_value' => 'yes',
305 'default' => 'yes',
306 ]
307 );
308 $this->add_control(
309 'ekit_mail_chimp_submit_icons',
310 [
311 'label' => esc_html__( 'Button Icons', 'elementskit-lite' ),
312 'type' => Controls_Manager::ICONS,
313 'fa4compatibility' => 'ekit_mail_chimp_submit_icon',
314 'default' => [
315 'value' => 'icon icon-tick',
316 'library' => 'ekiticons',
317 ],
318 'condition' => [
319 'ekit_mail_chimp_submit_icon_show' => 'yes'
320 ]
321 ]
322 );
323 $this->add_control(
324 'ekit_mail_chimp_submit_icon_position',
325 [
326 'label' => esc_html__( 'Icon Position', 'elementskit-lite' ),
327 'type' => Controls_Manager::SELECT,
328 'default' => 'before',
329 'options' => [
330 'before' => esc_html__( 'Before', 'elementskit-lite' ),
331 'after' => esc_html__( 'After', 'elementskit-lite' ),
332 ],
333 'condition' => [
334 'ekit_mail_chimp_submit_icon_show' => 'yes',
335 'ekit_mail_chimp_submit_icons!' => ''
336 ]
337 ]
338 );
339
340 $this->add_control(
341 'ekit_mail_chimp_form_style_switcher',
342 [
343 'label' =>esc_html__( 'Form Style', 'elementskit-lite' ),
344 'type' => Controls_Manager::SELECT,
345 'default' => 'yes',
346 'options' => [
347 'yes' =>esc_html__( 'Inline', 'elementskit-lite' ),
348 'no' =>esc_html__( 'Full Width', 'elementskit-lite' ),
349 ],
350 ]
351 );
352
353 $this->add_control(
354 'ekit_mail_chimp_success_message',
355 [
356 'label' => __( 'Success Message', 'elementskit-lite' ),
357 'type' => Controls_Manager::TEXT,
358 'dynamic' => [
359 'active' => true,
360 ],
361 'default' => __( 'Successfully listed this email', 'elementskit-lite' ),
362 'placeholder' => __( 'Type your title here', 'elementskit-lite' ),
363 ]
364 );
365
366 $this->end_controls_section();
367 // end content form
368
369 // label
370 $this->start_controls_section(
371 'ekit_mail_chimp_input_label_style',
372 [
373 'label' => esc_html__( 'Label', 'elementskit-lite' ),
374 'tab' => Controls_Manager::TAB_STYLE,
375 ]
376 );
377
378 $this->add_group_control(
379 Group_Control_Typography::get_type(),
380 [
381 'name' => 'ekit_mail_chimp_input_label_typography',
382 'label' => esc_html__( 'Typography', 'elementskit-lite' ),
383 'selector' => '{{WRAPPER}} .elementskit_input_label',
384 ]
385 );
386
387 $this->add_responsive_control(
388 'ekit_mail_chimp_input_label_color',
389 [
390 'label' => esc_html__( 'Color', 'elementskit-lite' ),
391 'type' => Controls_Manager::COLOR,
392 'default' => '#000000',
393 'selectors' => [
394 '{{WRAPPER}} .elementskit_input_label' => 'color: {{VALUE}}',
395 ],
396 ]
397 );
398
399 $this->add_responsive_control(
400 'ekit_mail_chimp_input_label_margin',
401 [
402 'label' => esc_html__( 'Margin', 'elementskit-lite' ),
403 'type' => Controls_Manager::DIMENSIONS,
404 'size_units' => [ 'px', '%', 'em' ],
405 'selectors' => [
406 '{{WRAPPER}} .elementskit_input_label' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
407 ],
408 ]
409 );
410
411 $this->end_controls_section();
412
413
414 $this->start_controls_section(
415 'ekit_mail_chimp_input_wrapper_style',
416 [
417 'label' => esc_html__( 'Input Wrapper', 'elementskit-lite' ),
418 'tab' => Controls_Manager::TAB_STYLE,
419 ]
420 );
421 $this->add_responsive_control(
422 'ekit_mail_chimp_input_column_gap',
423 [
424 'label' => esc_html__( 'Column Gap', 'elementskit-lite' ),
425 'type' => Controls_Manager::SLIDER,
426 'size_units' => [ 'px', 'em' ],
427 'default' => [
428 'unit' => 'px',
429 'size' => 0,
430 ],
431 'selectors' => [
432 '{{WRAPPER}} .elementskit_inline_form' => '--input-gap: 0px;',
433 '{{WRAPPER}} .elementskit_inline_form' => '--input-gap: {{SIZE}}{{UNIT}};',
434 '{{WRAPPER}} .elementskit_form_wraper' => 'column-gap: {{SIZE}}{{UNIT}};',
435 ],
436 ]
437 );
438
439 $this->add_responsive_control(
440 'ekit_mail_chimp_input_row_gap',
441 [
442 'label' => esc_html__( 'Row Gap', 'elementskit-lite' ),
443 'type' => Controls_Manager::SLIDER,
444 'size_units' => [ 'px', 'em' ],
445 'default' => [
446 'unit' => 'px',
447 'size' => 0,
448 ],
449 'selectors' => [
450 '{{WRAPPER}} .elementskit_form_wraper' => 'row-gap: {{SIZE}}{{UNIT}};',
451 ],
452 ]
453 );
454 $this->add_responsive_control(
455 'ekit_mail_chimp_input_space_between',
456 [
457 'label' => esc_html__( 'Icon Gap', 'elementskit-lite' ),
458 'type' => Controls_Manager::SLIDER,
459 'size_units' => [ 'px', 'em' ],
460 'default' => [
461 'unit' => 'px',
462 'size' => 0,
463 ],
464 'selectors' => [
465 '{{WRAPPER}} .elementskit_input_element_container' => 'gap: {{SIZE}}{{UNIT}};',
466 ],
467 'separator' => 'after',
468 ]
469 );
470
471 // Input Wrapper Tabs
472 $this->start_controls_tabs(
473 'ekit_mail_chimp_input_wrapper_tabs'
474 );
475
476 // Normal Tab
477 $this->start_controls_tab(
478 'ekit_mail_chimp_input_wrapper_normal_tab',
479 [
480 'label' => esc_html__( 'Normal', 'elementskit-lite' ),
481 ]
482 );
483
484 $this->add_control(
485 'ekit_mail_chimp_input_wrapper_color',
486 [
487 'label' => esc_html__( 'Color', 'elementskit-lite' ),
488 'type' => Controls_Manager::COLOR,
489 'selectors' => [
490 '{{WRAPPER}} .elementskit_input_element_container .ekit_form_control' => 'color: {{VALUE}};',
491 ],
492 ]
493 );
494
495 $this->add_group_control(
496 Group_Control_Background::get_type(),
497 [
498 'name' => 'ekit_mail_chimp_input_wrapper_background',
499 'label' => esc_html__( 'Background', 'elementskit-lite' ),
500 'types' => [ 'classic', 'gradient' ],
501 'selector' => '{{WRAPPER}} .elementskit_input_element_container',
502 'exclude' => ['image'] // PHPCS:ignore WordPressVIPMinimum.Performance.WPQueryParams.PostNotIn_exclude
503 ]
504 );
505
506 $this->add_group_control(
507 Group_Control_Border::get_type(),
508 [
509 'name' => 'ekit_mail_chimp_input_wrapper_border',
510 'label' => esc_html__( 'Border', 'elementskit-lite' ),
511 'selector' => '{{WRAPPER}} .elementskit_input_element_container',
512 ]
513 );
514
515 $this->add_group_control(
516 Group_Control_Box_Shadow::get_type(),
517 [
518 'name' => 'ekit_mail_chimp_input_wrapper_box_shadow',
519 'label' => esc_html__( 'Box Shadow', 'elementskit-lite' ),
520 'selector' => '{{WRAPPER}} .elementskit_input_element_container',
521 ]
522 );
523
524 $this->end_controls_tab();
525
526 // Hover Tab
527 $this->start_controls_tab(
528 'ekit_mail_chimp_input_wrapper_hover_tab',
529 [
530 'label' => esc_html__( 'Hover', 'elementskit-lite' ),
531 ]
532 );
533
534 $this->add_control(
535 'ekit_mail_chimp_input_wrapper_hover_color',
536 [
537 'label' => esc_html__( 'Color', 'elementskit-lite' ),
538 'type' => Controls_Manager::COLOR,
539 'selectors' => [
540 '{{WRAPPER}} .elementskit_input_element_container:has(.ekit_form_control:hover) .ekit_form_control' => 'color: {{VALUE}};',
541 ],
542 ]
543 );
544
545 $this->add_group_control(
546 Group_Control_Background::get_type(),
547 [
548 'name' => 'ekit_mail_chimp_input_wrapper_hover_background',
549 'label' => esc_html__( 'Background', 'elementskit-lite' ),
550 'types' => [ 'classic', 'gradient' ],
551 'selector' => '{{WRAPPER}} .elementskit_input_element_container:hover',
552 'exclude' => ['image'] // PHPCS:ignore WordPressVIPMinimum.Performance.WPQueryParams.PostNotIn_exclude
553 ]
554 );
555
556 $this->add_group_control(
557 Group_Control_Border::get_type(),
558 [
559 'name' => 'ekit_mail_chimp_input_wrapper_hover_border',
560 'label' => esc_html__( 'Border', 'elementskit-lite' ),
561 'selector' => '{{WRAPPER}} .elementskit_input_element_container:hover',
562 ]
563 );
564
565 $this->add_group_control(
566 Group_Control_Box_Shadow::get_type(),
567 [
568 'name' => 'ekit_mail_chimp_input_wrapper_hover_box_shadow',
569 'label' => esc_html__( 'Box Shadow', 'elementskit-lite' ),
570 'selector' => '{{WRAPPER}} .elementskit_input_element_container:hover',
571 ]
572 );
573
574 $this->end_controls_tab();
575
576 // Focus Tab
577 $this->start_controls_tab(
578 'ekit_mail_chimp_input_wrapper_focus_tab',
579 [
580 'label' => esc_html__( 'Focus', 'elementskit-lite' ),
581 ]
582 );
583
584 $this->add_control(
585 'ekit_mail_chimp_input_wrapper_focus_color',
586 [
587 'label' => esc_html__( 'Color', 'elementskit-lite' ),
588 'type' => Controls_Manager::COLOR,
589 'selectors' => [
590 '{{WRAPPER}} .elementskit_input_element_container:focus-within .ekit_form_control' => 'color: {{VALUE}};',
591 ],
592 ]
593 );
594
595 $this->add_group_control(
596 Group_Control_Background::get_type(),
597 [
598 'name' => 'ekit_mail_chimp_input_wrapper_focus_background',
599 'label' => esc_html__( 'Background', 'elementskit-lite' ),
600 'types' => [ 'classic', 'gradient' ],
601 'selector' => '{{WRAPPER}} .elementskit_input_element_container:focus-within',
602 'exclude' => ['image'] // PHPCS:ignore WordPressVIPMinimum.Performance.WPQueryParams.PostNotIn_exclude
603 ]
604 );
605
606 $this->add_group_control(
607 Group_Control_Border::get_type(),
608 [
609 'name' => 'ekit_mail_chimp_input_wrapper_focus_border',
610 'label' => esc_html__( 'Border', 'elementskit-lite' ),
611 'selector' => '{{WRAPPER}} .elementskit_input_element_container:focus-within',
612 ]
613 );
614
615 $this->add_group_control(
616 Group_Control_Box_Shadow::get_type(),
617 [
618 'name' => 'ekit_mail_chimp_input_wrapper_focus_box_shadow',
619 'label' => esc_html__( 'Box Shadow', 'elementskit-lite' ),
620 'selector' => '{{WRAPPER}} .elementskit_input_element_container:focus-within',
621 ]
622 );
623
624 $this->end_controls_tab();
625 $this->end_controls_tabs();
626
627 // Border Radius (outside tabs)
628 $this->add_responsive_control(
629 'ekit_mail_chimp_input_wrapper_border_radius',
630 [
631 'label' => esc_html__( 'Border Radius', 'elementskit-lite' ),
632 'type' => Controls_Manager::DIMENSIONS,
633 'size_units' => [ 'px', '%' ],
634 'selectors' => [
635 '{{WRAPPER}} .elementskit_input_element_container' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
636 ],
637 'separator' => 'before',
638 ]
639 );
640
641 // Padding (outside tabs)
642 $this->add_responsive_control(
643 'ekit_mail_chimp_input_wrapper_padding',
644 [
645 'label' => esc_html__( 'Padding', 'elementskit-lite' ),
646 'type' => Controls_Manager::DIMENSIONS,
647 'size_units' => [ 'px', '%', 'em' ],
648 'selectors' => [
649 '{{WRAPPER}} .elementskit_input_element_container .ekit_form_control' =>
650 'padding-top: {{TOP}}{{UNIT}}; padding-right: {{RIGHT}}{{UNIT}}; padding-bottom: {{BOTTOM}}{{UNIT}};',
651 '{{WRAPPER}} .elementskit_input_element_container .elementskit_input_group_prepend' =>
652 'padding-top: {{TOP}}{{UNIT}}; padding-left: {{LEFT}}{{UNIT}}; padding-bottom: {{BOTTOM}}{{UNIT}};',
653 ],
654 ]
655 );
656
657 $this->end_controls_section();
658 // input style
659 $this->start_controls_section(
660 'ekit_mail_chimp_input_style',
661 [
662 'label' => esc_html__( 'Input', 'elementskit-lite' ),
663 'tab' => Controls_Manager::TAB_STYLE,
664 ]
665 );
666
667
668
669
670 $this->add_control(
671 'ekit_mail_chimp_input_style_width__switch',
672 [
673 'label' => esc_html__( 'Use Width', 'elementskit-lite' ),
674 'type' => Controls_Manager::SWITCHER,
675 'label_on' => esc_html__( 'Show', 'elementskit-lite' ),
676 'label_off' => esc_html__( 'Hide', 'elementskit-lite' ),
677 'separator' => 'before',
678 'return_value' => 'yes',
679 'default' => 'no',
680 ]
681 );
682
683 $this->add_responsive_control(
684 'ekit_mail_chimp_input_style_width',
685 [
686 'label' => esc_html__( 'Width', 'elementskit-lite' ),
687 'type' => Controls_Manager::SLIDER,
688 'size_units' => [ 'px', '%' ],
689 'default' => [
690 'unit' => '%',
691 'size' => 66
692 ],
693 'range' => [
694 'px' => [
695 'min' => 0,
696 'max' => 1000,
697 'step' => 5,
698 ],
699 '%' => [
700 'min' => 0,
701 'max' => 100,
702 ],
703 ],
704 'selectors' => [
705 '{{WRAPPER}} .elementskit_form_wraper .elementskit_input_container' => 'flex: 0 0 calc({{SIZE}}{{UNIT}} - var(--input-gap, 30px) / 2);',
706 ],
707 'condition' => [
708 'ekit_mail_chimp_input_style_width__switch' => 'yes'
709 ]
710 ]
711 );
712
713 $this->add_group_control(
714 Group_Control_Typography::get_type(),
715 [
716 'name' => 'ekit_mail_chimp_input_typography',
717 'label' => esc_html__( 'Typography', 'elementskit-lite' ),
718 'selector' => '{{WRAPPER}} .ekit_form_control',
719 ]
720 );
721
722 $this->start_controls_tabs(
723 'mailchimp_input_tabs'
724 );
725
726 $this->start_controls_tab(
727 'mailchimp_input_normal_tab',
728 [
729 'label' => esc_html__( 'Normal', 'elementskit-lite' ),
730 ]
731 );
732
733 $this->add_group_control(
734 Group_Control_Background::get_type(),
735 [
736 'name' => 'ekit_mail_chimp_input_style_background',
737 'label' => esc_html__( 'Background', 'elementskit-lite' ),
738 'types' => [ 'classic', 'gradient' ],
739 'selector' => '{{WRAPPER}} .ekit_form_control',
740 'exclude' => ['image'] // PHPCS:ignore WordPressVIPMinimum.Performance.WPQueryParams.PostNotIn_exclude
741 ]
742 );
743
744 $this->add_group_control(
745 Group_Control_Border::get_type(),
746 [
747 'name' => 'ekit_mail_chimp_input_style_border',
748 'label' => esc_html__( 'Border', 'elementskit-lite' ),
749 'selector' => '{{WRAPPER}} .ekit_form_control',
750 ]
751 );
752
753 $this->add_group_control(
754 Group_Control_Box_Shadow::get_type(),
755 [
756 'name' => 'ekit_mail_chimp_input_style_box_shadow',
757 'label' => esc_html__( 'Box Shadow', 'elementskit-lite' ),
758 'selector' => '{{WRAPPER}} .ekit_form_control, {{WRAPPER}} .ekit_form_control:focus',
759 ]
760 );
761
762 $this->end_controls_tab();
763
764 $this->start_controls_tab(
765 'mailchimp_input_hover_tab',
766 [
767 'label' => esc_html__( 'Hover', 'elementskit-lite' ),
768 ]
769 );
770
771 $this->add_group_control(
772 Group_Control_Background::get_type(),
773 [
774 'name' => 'ekit_mail_chimp_input_style_hover_background',
775 'label' => esc_html__( 'Background', 'elementskit-lite' ),
776 'types' => [ 'classic', 'gradient' ],
777 'selector' => '{{WRAPPER}} .ekit_form_control:hover',
778 'exclude' => ['image'] // PHPCS:ignore WordPressVIPMinimum.Performance.WPQueryParams.PostNotIn_exclude
779 ]
780 );
781
782 $this->add_group_control(
783 Group_Control_Border::get_type(),
784 [
785 'name' => 'ekit_mail_chimp_input_style_hover_border',
786 'label' => esc_html__( 'Border', 'elementskit-lite' ),
787 'selector' => '{{WRAPPER}} .ekit_form_control:hover',
788 ]
789 );
790
791 $this->add_group_control(
792 Group_Control_Box_Shadow::get_type(),
793 [
794 'name' => 'ekit_mail_chimp_input_style_hover_box_shadow',
795 'label' => esc_html__( 'Box Shadow', 'elementskit-lite' ),
796 'selector' => '{{WRAPPER}} .ekit_form_control:hover',
797 ]
798 );
799
800 $this->end_controls_tab();
801
802 $this->start_controls_tab(
803 'mailchimp_input_focus_tab',
804 [
805 'label' => esc_html__( 'Focus', 'elementskit-lite' ),
806 ]
807 );
808
809 $this->add_group_control(
810 Group_Control_Background::get_type(),
811 [
812 'name' => 'ekit_mail_chimp_input_focus_style_background',
813 'label' => esc_html__( 'Background', 'elementskit-lite' ),
814 'types' => [ 'classic', 'gradient' ],
815 'selector' => '{{WRAPPER}} .ekit_form_control:focus',
816 'exclude' => ['image'] // PHPCS:ignore WordPressVIPMinimum.Performance.WPQueryParams.PostNotIn_exclude
817 ]
818 );
819
820 $this->add_group_control(
821 Group_Control_Border::get_type(),
822 [
823 'name' => 'ekit_mail_chimp_input_focus_style_border',
824 'label' => esc_html__( 'Border', 'elementskit-lite' ),
825 'selector' => '{{WRAPPER}} .ekit_form_control:focus',
826 ]
827 );
828
829 $this->add_group_control(
830 Group_Control_Box_Shadow::get_type(),
831 [
832 'name' => 'ekit_mail_chimp_input_focus_style_box_shadow',
833 'label' => esc_html__( 'Box Shadow', 'elementskit-lite' ),
834 'selector' => '{{WRAPPER}} .ekit_form_control:focus',
835 ]
836 );
837
838 $this->end_controls_tab();
839 $this->end_controls_tabs();
840
841 $this->add_responsive_control(
842 'ekit_mail_chimp_input_style_radius',
843 [
844 'label' => esc_html__( 'Border Radius', 'elementskit-lite' ),
845 'type' => Controls_Manager::DIMENSIONS,
846 'size_units' => [ 'px', '%' ],
847 'selectors' => [
848 '{{WRAPPER}} .ekit_form_control' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
849 ],
850 'separator' => 'before',
851 ]
852 );
853
854 $this->add_responsive_control(
855 'ekit_mail_chimp_input_style_padding',
856 [
857 'label' => esc_html__( 'Padding', 'elementskit-lite' ),
858 'type' => Controls_Manager::DIMENSIONS,
859 'size_units' => [ 'px', '%', 'em' ],
860 'default' => [
861 'top' => 0,
862 'right' => 20,
863 'bottom' => 0,
864 'left' => 20
865 ],
866 'selectors' => [
867 '{{WRAPPER}} .ekit_form_control' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
868 ],
869 ]
870 );
871
872
873
874 $this->add_responsive_control(
875 'ekit_mail_chimp_input_style_margin_bottom',
876 [
877 'label' => esc_html__( 'Margin Bottom', 'elementskit-lite' ),
878 'type' => Controls_Manager::SLIDER,
879 'size_units' => [ 'px' ],
880 'range' => [
881 'px' => [
882 'min' => 0,
883 'max' => 100,
884 'step' => 1,
885 ],
886 ],
887 'default' => [
888 'unit' => 'px',
889 'size' => 20,
890 ],
891 'selectors' => [
892 '{{WRAPPER}} .elementskit_input_wraper:not(:last-child)' => 'margin-bottom: {{SIZE}}{{UNIT}};',
893 ],
894 'condition' => [
895 'ekit_mail_chimp_form_style_switcher!' => 'yes'
896 ]
897 ]
898 );
899
900 $this->add_responsive_control(
901 'ekit_mail_chimp_input_style_margin_right',
902 [
903 'label' => esc_html__( 'Margin Right', 'elementskit-lite' ),
904 'type' => Controls_Manager::SLIDER,
905 'size_units' => [ 'px', ],
906 'range' => [
907 'px' => [
908 'min' => 0,
909 'max' => 100,
910 'step' => 1,
911 ],
912 ],
913 'default' => [
914 'unit' => 'px',
915 'size' => 30,
916 ],
917 'selectors' => [
918 '{{WRAPPER}} .elementskit_inline_form .elementskit_input_wraper:not(:last-child)' => 'margin-right: {{SIZE}}{{UNIT}};',
919 ],
920 'condition' => [
921 'ekit_mail_chimp_form_style_switcher' => 'yes'
922 ]
923 ]
924 );
925
926 $this->add_responsive_control(
927 'inline_margin_bottom',
928 [
929 'label' => esc_html__( 'Margin Bottom', 'elementskit-lite' ),
930 'type' => Controls_Manager::SLIDER,
931 'devices' => ['desktop', 'mobile'],
932 'selectors' => [
933 '{{WRAPPER}} .has-extra-fields > .elementskit_input_wraper:not(:last-child)' => 'margin-bottom: {{SIZE}}{{UNIT}};',
934 ],
935 'condition' => [
936 'ekit_mail_chimp_form_style_switcher' => 'yes', // Inline Style
937 'ekit_mail_chimp_section_form_name_show' => 'yes', // Show Names
938 ]
939 ]
940 );
941
942 $this->add_control(
943 'ekit_mail_chimp_input_style_placeholder_heading',
944 [
945 'label' => esc_html__( 'Placeholder', 'elementskit-lite' ),
946 'type' => Controls_Manager::HEADING,
947 'separator' => 'before',
948 ]
949 );
950
951 $this->add_responsive_control(
952 'ekit_mail_chimp_input_style_placeholder_color',
953 [
954 'label' => esc_html__( 'Placeholder Color', 'elementskit-lite' ),
955 'type' => Controls_Manager::COLOR,
956 'default' => '#000000',
957 'selectors' => [
958 '{{WRAPPER}} .ekit_form_control::-webkit-input-placeholder' => 'color: {{VALUE}}',
959 '{{WRAPPER}} .ekit_form_control::-moz-placeholder' => 'color: {{VALUE}}',
960 '{{WRAPPER}} .ekit_form_control:-ms-input-placeholder' => 'color: {{VALUE}}',
961 '{{WRAPPER}} .ekit_form_control:-moz-placeholder' => 'color: {{VALUE}}',
962 ],
963 ]
964 );
965
966 $this->add_responsive_control(
967 'ekit_mail_chimp_input_style_placeholder_font_size',
968 [
969 'label' => esc_html__( 'Font Size', 'elementskit-lite' ),
970 'type' => Controls_Manager::SLIDER,
971 'size_units' => [ 'px' ],
972 'range' => [
973 'px' => [
974 'min' => 0,
975 'max' => 100,
976 'step' => 1,
977 ],
978 ],
979 'default' => [
980 'unit' => 'px',
981 'size' => 14,
982 ],
983 'selectors' => [
984 '{{WRAPPER}} .ekit_form_control::-webkit-input-placeholder' => 'font-size: {{SIZE}}{{UNIT}};',
985 '{{WRAPPER}} .ekit_form_control::-moz-placeholder' => 'font-size: {{SIZE}}{{UNIT}};',
986 '{{WRAPPER}} .ekit_form_control:-ms-input-placeholder' => 'font-size: {{SIZE}}{{UNIT}};',
987 '{{WRAPPER}} .ekit_form_control:-moz-placeholder' => 'font-size: {{SIZE}}{{UNIT}};',
988 ],
989 ]
990 );
991
992 $this->end_controls_section();
993
994 $this->start_controls_section(
995 'ekit_mail_chimp_button_style_holder',
996 [
997 'label' => esc_html__( 'Button', 'elementskit-lite' ),
998 'tab' => Controls_Manager::TAB_STYLE,
999 ]
1000 );
1001
1002 $this->add_control(
1003 'ekit_mail_chimp_button_use_position',
1004 [
1005 'label' => esc_html__( 'Use Position', 'elementskit-lite' ),
1006 'type' => Controls_Manager::SWITCHER,
1007 'label_on' => esc_html__( 'Yes', 'elementskit-lite' ),
1008 'label_off' => esc_html__( 'No', 'elementskit-lite' ),
1009 'return_value' => 'absolute',
1010 'default' => 'no',
1011 'selectors' => [
1012 '{{WRAPPER}} .ekit_submit_input_holder' => 'position: {{VALUE}};',
1013 ],
1014 ]
1015 );
1016
1017 $this->add_control(
1018 'ekit_mail_chimp_button_horizontal_position',
1019 [
1020 'label' => esc_html__( 'Horizontal Position', 'elementskit-lite' ),
1021 'type' => Controls_Manager::CHOOSE,
1022 'options' => [
1023 'left' => [
1024 'title' => esc_html__( 'Left', 'elementskit-lite' ),
1025 'icon' => 'eicon-h-align-left',
1026 ],
1027 'right' => [
1028 'title' => esc_html__( 'Right', 'elementskit-lite' ),
1029 'icon' => 'eicon-h-align-right',
1030 ],
1031 ],
1032 'default' => 'right',
1033 'toggle' => false,
1034 'condition' => [
1035 'ekit_mail_chimp_button_use_position' => 'absolute',
1036 ],
1037 ]
1038 );
1039
1040 $this->add_responsive_control(
1041 'ekit_mail_chimp_button_horizontal_offset',
1042 [
1043 'label' => esc_html__( 'Horizontal Offset', 'elementskit-lite' ),
1044 'type' => Controls_Manager::SLIDER,
1045 'size_units' => [ 'px', '%' ],
1046 'range' => [
1047 'px' => [
1048 'min' => -1000,
1049 'max' => 1000,
1050 'step' => 1,
1051 ],
1052 '%' => [
1053 'min' => -100,
1054 'max' => 100,
1055 ],
1056 ],
1057 'default' => [
1058 'unit' => 'px',
1059 'size' => 0,
1060 ],
1061 'selectors' => [
1062 '{{WRAPPER}} .ekit_submit_input_holder' => '{{ekit_mail_chimp_button_horizontal_position.VALUE}}: {{SIZE}}{{UNIT}};',
1063 ],
1064 'condition' => [
1065 'ekit_mail_chimp_button_use_position' => 'absolute',
1066 ],
1067 ]
1068 );
1069
1070 $this->add_control(
1071 'ekit_mail_chimp_button_vertical_position',
1072 [
1073 'label' => esc_html__( 'Vertical Position', 'elementskit-lite' ),
1074 'type' => Controls_Manager::CHOOSE,
1075 'options' => [
1076 'top' => [
1077 'title' => esc_html__( 'Top', 'elementskit-lite' ),
1078 'icon' => 'eicon-v-align-top',
1079 ],
1080 'bottom' => [
1081 'title' => esc_html__( 'Bottom', 'elementskit-lite' ),
1082 'icon' => 'eicon-v-align-bottom',
1083 ],
1084 ],
1085 'default' => 'top',
1086 'toggle' => false,
1087 'condition' => [
1088 'ekit_mail_chimp_button_use_position' => 'absolute',
1089 ],
1090 ]
1091 );
1092
1093 $this->add_responsive_control(
1094 'ekit_mail_chimp_button_vertical_offset',
1095 [
1096 'label' => esc_html__( 'Vertical Offset', 'elementskit-lite' ),
1097 'type' => Controls_Manager::SLIDER,
1098 'size_units' => [ 'px', '%' ],
1099 'range' => [
1100 'px' => [
1101 'min' => -1000,
1102 'max' => 1000,
1103 'step' => 1,
1104 ],
1105 '%' => [
1106 'min' => -100,
1107 'max' => 100,
1108 ],
1109 ],
1110 'default' => [
1111 'unit' => 'px',
1112 'size' => 0,
1113 ],
1114 'selectors' => [
1115 '{{WRAPPER}} .ekit_submit_input_holder' => '{{ekit_mail_chimp_button_vertical_position.VALUE}}: {{SIZE}}{{UNIT}};',
1116 ],
1117 'condition' => [
1118 'ekit_mail_chimp_button_use_position' => 'absolute',
1119 ],
1120 'separator' => 'after',
1121 ]
1122 );
1123
1124
1125 $this->add_group_control(
1126 Group_Control_Typography::get_type(),
1127 [
1128 'name' => 'ekit_mail_chimp_button_typography',
1129 'label' => esc_html__( 'Typography', 'elementskit-lite' ),
1130 'selector' => '{{WRAPPER}} .ekit-mail-submit',
1131 ]
1132 );
1133
1134
1135
1136
1137
1138 $this->add_responsive_control(
1139 'ekit_mail_chimp_button_border_radius',
1140 [
1141 'label' => esc_html__( 'Border Radius', 'elementskit-lite' ),
1142 'type' => Controls_Manager::DIMENSIONS,
1143 'size_units' => [ 'px', '%', 'em' ],
1144 'selectors' => [
1145 '{{WRAPPER}} .ekit-mail-submit' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1146 ],
1147 ]
1148 );
1149
1150 $this->add_responsive_control(
1151 'ekit_mail_chimp_button_border_padding',
1152 [
1153 'label' => esc_html__( 'Padding', 'elementskit-lite' ),
1154 'type' => Controls_Manager::DIMENSIONS,
1155 'size_units' => [ 'px', '%', 'em' ],
1156 'default' => [
1157 'top' => 8,
1158 'right' => 20,
1159 'bottom' => 8,
1160 'left' => 20
1161 ],
1162 'selectors' => [
1163 '{{WRAPPER}} .ekit-mail-submit' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1164 ],
1165 ]
1166 );
1167
1168 $this->add_group_control(
1169 Group_Control_Border::get_type(),
1170 [
1171 'name' => 'ekit_mail_chimp_button_border',
1172 'label' => esc_html__( 'Border', 'elementskit-lite' ),
1173 'selector' => '{{WRAPPER}} .ekit-mail-submit',
1174 ]
1175 );
1176
1177 $this->add_group_control(
1178 Group_Control_Text_Shadow::get_type(),
1179 [
1180 'name' => 'ekit_mail_chimp_button_title_shadow',
1181 'selector' => '{{WRAPPER}} .ekit-mail-submit' ,
1182 ]
1183 );
1184
1185 $this->add_control(
1186 'ekit_mail_chimp_button_style_use_width_height',
1187 [
1188 'label' => esc_html__( 'Use Width', 'elementskit-lite' ),
1189 'type' => Controls_Manager::SWITCHER,
1190 'label_on' => esc_html__( 'Show', 'elementskit-lite' ),
1191 'label_off' => esc_html__( 'Hide', 'elementskit-lite' ),
1192 'return_value' => 'yes',
1193 'default' => 'no',
1194 ]
1195 );
1196
1197 $this->add_responsive_control(
1198 'ekit_mail_chimp_button_width',
1199 [
1200 'label' => esc_html__( 'Width', 'elementskit-lite' ),
1201 'type' => Controls_Manager::SLIDER,
1202 'size_units' => [ 'px', '%' ],
1203 'range' => [
1204 'px' => [
1205 'min' => 50,
1206 'max' => 1000,
1207 'step' => 1,
1208 ],
1209 '%' => [
1210 'min' => 10,
1211 'max' => 100,
1212 ],
1213 ],
1214 'default' => [
1215 'unit' => 'px',
1216 'size' => 50,
1217 ],
1218 'selectors' => [
1219 '{{WRAPPER}} .ekit-mail-submit' => 'width: {{SIZE}}{{UNIT}};',
1220 ],
1221 'condition' => [
1222 'ekit_mail_chimp_button_style_use_width_height' => 'yes'
1223 ]
1224 ]
1225 );
1226
1227
1228 $this->add_responsive_control(
1229 'ekit_mail_chimp_button_style_margin',
1230 [
1231 'label' => esc_html__( 'Margin', 'elementskit-lite' ),
1232 'type' => Controls_Manager::DIMENSIONS,
1233 'size_units' => [ 'px', '%', 'em' ],
1234 'selectors' => [
1235 '{{WRAPPER}} .ekit-mail-submit' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1236 ],
1237 ]
1238 );
1239
1240 $this->start_controls_tabs(
1241 'ekit_mail_chimp_button_normal_and_hover_tabs'
1242 );
1243 $this->start_controls_tab(
1244 'ekit_mail_chimp_button_normal_tab',
1245 [
1246 'label' => esc_html__( 'Normal', 'elementskit-lite' ),
1247 ]
1248 );
1249
1250 $this->add_responsive_control(
1251 'ekit_mail_chimp_button_color',
1252 [
1253 'label' => esc_html__( 'Color', 'elementskit-lite' ),
1254 'type' => Controls_Manager::COLOR,
1255 'default' => '#fff',
1256 'selectors' => [
1257 '{{WRAPPER}} .ekit-mail-submit' => 'color: {{VALUE}};',
1258 '{{WRAPPER}} .ekit-mail-submit svg' => 'fill: {{VALUE}};',
1259 ],
1260 ]
1261 );
1262
1263 $this->add_group_control(
1264 Group_Control_Background::get_type(),
1265 [
1266 'name' => 'ekit_mail_chimp_button_background',
1267 'label' => esc_html__( 'Background', 'elementskit-lite' ),
1268 'types' => [ 'classic', 'gradient', ],
1269 'selector' => '{{WRAPPER}} .ekit-mail-submit',
1270 'exclude' => ['image'] // PHPCS:ignore WordPressVIPMinimum.Performance.WPQueryParams.PostNotIn_exclude
1271 ]
1272 );
1273
1274 $this->add_group_control(
1275 Group_Control_Box_Shadow::get_type(),
1276 [
1277 'name' => 'ekit_mail_chimp_button_box_shadow',
1278 'label' => esc_html__( 'Box Shadow', 'elementskit-lite' ),
1279 'selector' => '{{WRAPPER}} .ekit-mail-submit',
1280 ]
1281 );
1282
1283 $this->end_controls_tab();
1284 $this->start_controls_tab(
1285 'ekit_mail_chimp_button_hover_tab',
1286 [
1287 'label' => esc_html__( 'Hover', 'elementskit-lite' ),
1288 ]
1289 );
1290
1291 $this->add_responsive_control(
1292 'ekit_mail_chimp_button_color_hover',
1293 [
1294 'label' => esc_html__( 'Color', 'elementskit-lite' ),
1295 'type' => Controls_Manager::COLOR,
1296 'default' => '#fff',
1297 'selectors' => [
1298 '{{WRAPPER}} .ekit-mail-submit:hover' => 'color: {{VALUE}};',
1299 '{{WRAPPER}} .ekit-mail-submit:hover svg' => 'fill: {{VALUE}};',
1300 ],
1301 ]
1302 );
1303
1304 $this->add_group_control(
1305 Group_Control_Background::get_type(),
1306 [
1307 'name' => 'ekit_mail_chimp_button_background_hover',
1308 'label' => esc_html__( 'Background', 'elementskit-lite' ),
1309 'types' => [ 'classic', 'gradient', ],
1310 'selector' => '{{WRAPPER}} .ekit-mail-submit:before',
1311 'exclude' => ['image'] // PHPCS:ignore WordPressVIPMinimum.Performance.WPQueryParams.PostNotIn_exclude
1312 ]
1313 );
1314
1315 $this->add_group_control(
1316 Group_Control_Box_Shadow::get_type(),
1317 [
1318 'name' => 'ekit_mail_chimp_button_hover_box_shadow',
1319 'label' => esc_html__( 'Box Shadow', 'elementskit-lite' ),
1320 'selector' => '{{WRAPPER}} .ekit-mail-submit:hover',
1321 ]
1322 );
1323
1324 $this->end_controls_tab();
1325
1326 $this->end_controls_tabs();
1327
1328 $this->add_control(
1329 'ekit_mail_chimp_button_icon_heading',
1330 [
1331 'label' => esc_html__( 'Icon', 'elementskit-lite' ),
1332 'type' => Controls_Manager::HEADING,
1333 'separator' => 'before',
1334 ]
1335 );
1336
1337 $this->add_responsive_control(
1338 'ekit_mail_chimp_button_icon_padding_right',
1339 [
1340 'label' => esc_html__( 'Icon Spacing', 'elementskit-lite' ),
1341 'type' => Controls_Manager::SLIDER,
1342 'size_units' => [ 'px' ],
1343 'range' => [
1344 'px' => [
1345 'min' => 0,
1346 'max' => 100,
1347 'step' => 1,
1348 ],
1349 ],
1350 'default' => [
1351 'unit' => 'px',
1352 'size' => 10,
1353 ],
1354 'selectors' => [
1355 '{{WRAPPER}} .ekit-mail-submit > i, {{WRAPPER}} .ekit-mail-submit > svg' => 'margin-right: {{SIZE}}{{UNIT}};',
1356 ],
1357 'condition' => [
1358 'ekit_mail_chimp_submit_icon_position' => 'before'
1359 ]
1360 ]
1361 );
1362
1363 $this->add_responsive_control(
1364 'ekit_mail_chimp_button_icon_padding_left',
1365 [
1366 'label' => esc_html__( 'Icon Spacing', 'elementskit-lite' ),
1367 'type' => Controls_Manager::SLIDER,
1368 'size_units' => [ 'px' ],
1369 'range' => [
1370 'px' => [
1371 'min' => 0,
1372 'max' => 100,
1373 'step' => 1,
1374 ],
1375 ],
1376 'default' => [
1377 'unit' => 'px',
1378 'size' => 10,
1379 ],
1380 'selectors' => [
1381 '{{WRAPPER}} .ekit-mail-submit > i, {{WRAPPER}} .ekit-mail-submit > svg' => 'margin-left: {{SIZE}}{{UNIT}};',
1382 ],
1383 'condition' => [
1384 'ekit_mail_chimp_submit_icon_position' => 'after'
1385 ]
1386 ]
1387 );
1388
1389 $this->add_responsive_control(
1390 'ekit_simple_tab_title_icon_size',
1391 [
1392 'label' => esc_html__( 'Icon Size', 'elementskit-lite' ),
1393 'type' => Controls_Manager::SLIDER,
1394 'size_units' => [ 'px', '%' ],
1395 'range' => [
1396 'px' => [
1397 'min' => 1,
1398 'max' => 100,
1399 'step' => 5,
1400 ],
1401 '%' => [
1402 'min' => 1,
1403 'max' => 100,
1404 ],
1405 ],
1406 'selectors' => [
1407 '{{WRAPPER}} .ekit-mail-submit > i, {{WRAPPER}} .ekit-mail-submit > i' => 'font-size: {{SIZE}}{{UNIT}};',
1408 '{{WRAPPER}} .ekit-mail-submit > i, {{WRAPPER}} .ekit-mail-submit > svg' => 'max-width: {{SIZE}}{{UNIT}}; height: auto',
1409 ],
1410 ]
1411 );
1412
1413 $this->end_controls_section();
1414
1415 $this->start_controls_section(
1416 'ekit_mail_chimp_input_icon_style_holder',
1417 [
1418 'label' => esc_html__( 'Input Icon', 'elementskit-lite' ),
1419 'tab' => Controls_Manager::TAB_STYLE,
1420 ]
1421 );
1422
1423 $this->add_group_control(
1424 Group_Control_Background::get_type(),
1425 [
1426 'name' => 'ekit_mail_chimp_input_icon_background',
1427 'label' => esc_html__( 'Background', 'elementskit-lite' ),
1428 'types' => [ 'classic', 'gradient' ],
1429 'selector' => '{{WRAPPER}} .elementskit_input_group_text',
1430 'exclude' => ['image'] // PHPCS:ignore WordPressVIPMinimum.Performance.WPQueryParams.PostNotIn_exclude
1431 ]
1432 );
1433
1434 $this->add_control(
1435 'ekit_mail_chimp_input_icon_color_hr',
1436 [
1437 'type' => Controls_Manager::DIVIDER,
1438 ]
1439 );
1440
1441 $this->add_responsive_control(
1442 'ekit_mail_chimp_input_icon_color',
1443 [
1444 'label' => esc_html__( 'Color', 'elementskit-lite' ),
1445 'type' => Controls_Manager::COLOR,
1446 'default' => '#000000',
1447 'selectors' => [
1448 '{{WRAPPER}} .elementskit_input_group_text i' => 'color: {{VALUE}};',
1449 '{{WRAPPER}} .elementskit_input_group_text svg' => 'fill: {{VALUE}};',
1450 ],
1451 ]
1452 );
1453
1454 $this->add_responsive_control(
1455 'ekit_mail_chimp_input_icon_font_size',
1456 [
1457 'label' => esc_html__( 'Icon Size', 'elementskit-lite' ),
1458 'type' => Controls_Manager::SLIDER,
1459 'size_units' => [ 'px' ],
1460 'range' => [
1461 'px' => [
1462 'min' => 0,
1463 'max' => 200,
1464 'step' => 1,
1465 ],
1466 ],
1467 'default' => [
1468 'unit' => 'px',
1469 'size' => 10,
1470 ],
1471 'selectors' => [
1472 '{{WRAPPER}} .elementskit_input_group_text' => 'font-size: {{SIZE}}{{UNIT}};',
1473 '{{WRAPPER}} .elementskit_input_group_text svg' => 'max-width: {{SIZE}}{{UNIT}};',
1474 ],
1475 ]
1476 );
1477
1478
1479 $this->add_group_control(
1480 Group_Control_Border::get_type(),
1481 [
1482 'name' => 'ekit_mail_chimp_input_icon_border',
1483 'label' => esc_html__( 'Border', 'elementskit-lite' ),
1484 'selector' => '{{WRAPPER}} .elementskit_input_group_text',
1485 ]
1486 );
1487
1488 $this->add_responsive_control(
1489 'ekit_mail_chimp_input_icon_padding',
1490 [
1491 'label' => esc_html__( 'Padding', 'elementskit-lite' ),
1492 'type' => Controls_Manager::DIMENSIONS,
1493 'size_units' => [ 'px', '%', 'em' ],
1494 'selectors' => [
1495 '{{WRAPPER}} .elementskit_input_group_text' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1496 ],
1497 ]
1498 );
1499
1500 $this->add_responsive_control(
1501 'ekit_mail_chimp_input_icon_border_radius',
1502 [
1503 'label' => esc_html__( 'Border Radius', 'elementskit-lite' ),
1504 'type' => Controls_Manager::DIMENSIONS,
1505 'size_units' => [ 'px', '%', 'em' ],
1506 'selectors' => [
1507 '{{WRAPPER}} .elementskit_input_group_text' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1508 ],
1509 ]
1510 );
1511
1512 $this->end_controls_section();
1513
1514 $this->start_controls_section(
1515 'ekit_mail_chimp_success_error',
1516 [
1517 'label' => esc_html__( 'Success & Error message', 'elementskit-lite' ),
1518 'tab' => Controls_Manager::TAB_STYLE,
1519 ]
1520 );
1521
1522 $this->add_responsive_control(
1523 'ekit_mail_chimp_message_width',
1524 [
1525 'label' => esc_html__( 'Width', 'elementskit-lite' ),
1526 'type' => Controls_Manager::SLIDER,
1527 'size_units' => [ 'px', '%' ],
1528 'range' => [
1529 'px' => [
1530 'min' => 0,
1531 'max' => 1000,
1532 'step' => 1,
1533 ],
1534 '%' => [
1535 'min' => 0,
1536 'max' => 100,
1537 ],
1538 ],
1539 'default' => [
1540 'unit' => '%',
1541 'size' => 100,
1542 ],
1543 'selectors' => [
1544 '{{WRAPPER}} .ekit-mail-message' => 'width: {{SIZE}}{{UNIT}};',
1545 ],
1546 ]
1547 );
1548
1549 $this->add_responsive_control(
1550 'ekit_mail_chimp_success_error_padding',
1551 [
1552 'label' => esc_html__( 'Padding', 'elementskit-lite' ),
1553 'type' => Controls_Manager::DIMENSIONS,
1554 'size_units' => [ 'px', '%' ],
1555 'selectors' => [
1556 '{{WRAPPER}} .ekit-mail-message' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1557 ],
1558 ]
1559 );
1560
1561 $this->add_responsive_control(
1562 'ekit_mail_chimp_success_error_margin',
1563 [
1564 'label' => esc_html__( 'Margin', 'elementskit-lite' ),
1565 'type' => Controls_Manager::DIMENSIONS,
1566 'size_units' => [ 'px', '%' ],
1567 'selectors' => [
1568 '{{WRAPPER}} .ekit-mail-message' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1569 ],
1570 ]
1571 );
1572
1573 $this->add_control(
1574 'ekit_mail_chimp_success_error_border_radius',
1575 [
1576 'label' => esc_html__( 'Border Radius', 'elementskit-lite' ),
1577 'type' => Controls_Manager::DIMENSIONS,
1578 'size_units' => [ 'px', '%', 'em' ],
1579 'selectors' => [
1580 '{{WRAPPER}} .ekit-mail-message' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1581 ]
1582 ]
1583 );
1584
1585 $this->add_group_control(
1586 Group_Control_Typography::get_type(), [
1587 'name' => 'ekit_mail_chimp_success_error_typography',
1588 'selector' => '{{WRAPPER}} .ekit-mail-message',
1589 ]
1590 );
1591
1592 $this->add_control(
1593 'ekit_mail_chimp_success_heading',
1594 [
1595 'label' => esc_html__( 'Success:', 'elementskit-lite' ),
1596 'type' => Controls_Manager::HEADING,
1597 ]
1598 );
1599
1600 $this->add_responsive_control(
1601 'ekit_mail_chimp_success_color', [
1602 'label' =>esc_html__( 'Color', 'elementskit-lite' ),
1603 'type' => Controls_Manager::COLOR,
1604 'selectors' => [
1605 '{{WRAPPER}} .ekit-mail-message.success' => 'color: {{VALUE}};',
1606 ],
1607 ]
1608 );
1609
1610 $this->add_group_control(
1611 Group_Control_Background::get_type(),
1612 array(
1613 'name' => 'ekit_mail_chimp_success_bg_color',
1614 'label' => esc_html__( 'Background Color', 'elementskit-lite' ),
1615 'selector' => '{{WRAPPER}} .ekit-mail-message.success',
1616 )
1617 );
1618
1619 $this->add_group_control(
1620 Group_Control_Border::get_type(),
1621 [
1622 'name' => 'ekit_mail_chimp_success_border',
1623 'label' => esc_html__( 'Border', 'elementskit-lite' ),
1624 'selector' => '{{WRAPPER}} .ekit-mail-message.success',
1625 ]
1626 );
1627
1628 $this->add_control(
1629 'ekit_mail_chimp_error_heading',
1630 [
1631 'label' => esc_html__( 'Error:', 'elementskit-lite' ),
1632 'type' => Controls_Manager::HEADING,
1633 ]
1634 );
1635
1636 $this->add_responsive_control(
1637 'ekit_mail_chimp_error_color', [
1638 'label' =>esc_html__( 'Color', 'elementskit-lite' ),
1639 'type' => Controls_Manager::COLOR,
1640 'selectors' => [
1641 '{{WRAPPER}} .ekit-mail-message.error' => 'color: {{VALUE}};',
1642 ],
1643 ]
1644 );
1645
1646 $this->add_group_control(
1647 Group_Control_Background::get_type(),
1648 array(
1649 'name' => 'ekit_mail_chimp_error_bg_color',
1650 'label' => esc_html__( 'Background Color', 'elementskit-lite' ),
1651 'selector' => '{{WRAPPER}} .ekit-mail-message.error',
1652 )
1653 );
1654
1655 $this->add_group_control(
1656 Group_Control_Border::get_type(),
1657 [
1658 'name' => 'ekit_mail_chimp_error_border',
1659 'label' => esc_html__( 'Border', 'elementskit-lite' ),
1660 'selector' => '{{WRAPPER}} .ekit-mail-message.error',
1661 ]
1662 );
1663
1664
1665 $this->end_controls_section();
1666
1667 $this->insert_pro_message();
1668 }
1669
1670 protected function render_legacy_fields( $settings ) {
1671 extract($settings);
1672 if ( ! empty( $ekit_mail_chimp_fields_repeater ) ) {
1673 return;
1674 }
1675
1676 ?>
1677 <?php if(isset($ekit_mail_chimp_section_form_name_show) && $ekit_mail_chimp_section_form_name_show == 'yes'):?>
1678 <div class="ekit-mail-chimp-name elementskit_input_wraper elementskit_input_container">
1679 <div class="elementskit_form_group">
1680 <?php if($ekit_mail_chimp_first_name_label != ''): ?>
1681 <label class="elementskit_input_label"><?php echo esc_html( $ekit_mail_chimp_first_name_label );?> <span class="ekit_required_mark">*</span></label>
1682 <?php endif; ?>
1683 <div class="elementskit_input_element_container <?php if(($ekit_mail_chimp_first_name_icon_show == 'yes') && ($ekit_mail_chimp_first_name_icons != '')) : ?>elementskit_input_group<?php endif; ?>">
1684 <?php if(($ekit_mail_chimp_first_name_icon_show == 'yes') && ($ekit_mail_chimp_first_name_icons != '') && ($ekit_mail_chimp_first_name_icon_before_after == 'before')) : ?>
1685 <div class="elementskit_input_group_prepend">
1686 <div class="elementskit_input_group_text">
1687 <?php
1688 // new icon
1689 $migrated = isset( $settings['__fa4_migrated']['ekit_mail_chimp_first_name_icons'] );
1690 // Check if its a new widget without previously selected icon using the old Icon control
1691 $is_new = empty( $settings['ekit_mail_chimp_first_name_icon'] );
1692 if ( $is_new || $migrated ) {
1693 // new icon
1694 Icons_Manager::render_icon( $settings['ekit_mail_chimp_first_name_icons'], [ 'aria-hidden' => 'true' ] );
1695 } else {
1696 ?>
1697 <i class="<?php echo esc_attr($settings['ekit_mail_chimp_first_name_icon']); ?>" aria-hidden="true"></i>
1698 <?php
1699 }
1700 ?>
1701 </div>
1702 </div>
1703 <?php endif; ?>
1704 <input type="text" aria-label="<?php echo esc_attr__( 'First name', 'elementskit-lite' ); ?>" class="ekit_user_first ekit_form_control <?php if(($ekit_mail_chimp_first_name_icon_show == 'yes') && ($ekit_mail_chimp_first_name_icons != '') && ($ekit_mail_chimp_first_name_icon_before_after == 'after')) : ?> ekit_append_input <?php endif; ?>" name="firstname" placeholder="<?php echo esc_html( $ekit_mail_chimp_first_name_placeholder );?>" required />
1705
1706 <?php if(($ekit_mail_chimp_first_name_icon_show == 'yes') && ($ekit_mail_chimp_first_name_icons != '') && ($ekit_mail_chimp_first_name_icon_before_after == 'after')) : ?>
1707 <div class="elementskit_input_group_append">
1708 <div class="elementskit_input_group_text">
1709 <?php
1710 // new icon
1711 $migrated = isset( $settings['__fa4_migrated']['ekit_mail_chimp_first_name_icons'] );
1712 // Check if its a new widget without previously selected icon using the old Icon control
1713 $is_new = empty( $settings['ekit_mail_chimp_first_name_icon'] );
1714 if ( $is_new || $migrated ) {
1715 // new icon
1716 Icons_Manager::render_icon( $settings['ekit_mail_chimp_first_name_icons'], [ 'aria-hidden' => 'true' ] );
1717 } else {
1718 ?>
1719 <i class="<?php echo esc_attr($settings['ekit_mail_chimp_first_name_icon']); ?>" aria-hidden="true"></i>
1720 <?php
1721 }
1722 ?>
1723 </div>
1724 </div>
1725 <?php endif; ?>
1726 </div>
1727 </div>
1728 <?php // endif; ?>
1729 </div>
1730 <?php endif; ?>
1731 <?php if(isset($ekit_mail_chimp_section_form_name_show) && $ekit_mail_chimp_section_form_name_show == 'yes'):?>
1732 <div class="ekit-mail-chimp-name elementskit_input_wraper elementskit_input_container">
1733 <div class="elementskit_form_group">
1734
1735 <label class="elementskit_input_label"><?php echo esc_html( $ekit_mail_chimp_last_name_label ); ?> <span class="ekit_required_mark">*</span></label>
1736 <?php endif; ?>
1737 <div class="elementskit_input_element_container <?php if(($ekit_mail_chimp_last_name_icon_show == 'yes') && ($ekit_mail_chimp_last_name_icons != '')) : ?>elementskit_input_group<?php endif; ?>">
1738 <?php if(($ekit_mail_chimp_last_name_icon_show == 'yes') && ($ekit_mail_chimp_last_name_icons != '') && ($ekit_mail_chimp_last_name_icon_before_after == 'before')) : ?>
1739 <div class="elementskit_input_group_prepend">
1740 <div class="elementskit_input_group_text">
1741 <?php
1742 // new icon
1743 $migrated = isset( $settings['__fa4_migrated']['ekit_mail_chimp_last_name_icons'] );
1744 // Check if its a new widget without previously selected icon using the old Icon control
1745 $is_new = empty( $settings['ekit_mail_chimp_last_name_icon'] );
1746 if ( $is_new || $migrated ) {
1747 // new icon
1748 Icons_Manager::render_icon( $settings['ekit_mail_chimp_last_name_icons'], [ 'aria-hidden' => 'true' ] );
1749 } else {
1750 ?>
1751 <i class="<?php echo esc_attr($settings['ekit_mail_chimp_last_name_icon']); ?>" aria-hidden="true"></i>
1752 <?php
1753 }
1754 ?>
1755 </div>
1756 </div>
1757 <?php endif; ?>
1758 <input type="text" aria-label="<?php echo esc_attr__( 'Last name', 'elementskit-lite' ); ?>" class="ekit_user_last ekit_form_control <?php if(($ekit_mail_chimp_last_name_icon_show == 'yes') && ($ekit_mail_chimp_last_name_icons != '') && ($ekit_mail_chimp_last_name_icon_before_after == 'after')) : ?> ekit_append_input <?php endif; ?>" name="lastname" placeholder="<?php echo esc_html( $ekit_mail_chimp_last_name_placeholder );?>" required />
1759
1760 <?php if(($ekit_mail_chimp_last_name_icon_show == 'yes') && ($ekit_mail_chimp_last_name_icons != '') && ($ekit_mail_chimp_last_name_icon_before_after == 'after')) : ?>
1761 <div class="elementskit_input_group_append">
1762 <div class="elementskit_input_group_text">
1763 <?php
1764 // new icon
1765 $migrated = isset( $settings['__fa4_migrated']['ekit_mail_chimp_last_name_icons'] );
1766 // Check if its a new widget without previously selected icon using the old Icon control
1767 $is_new = empty( $settings['ekit_mail_chimp_last_name_icon'] );
1768 if ( $is_new || $migrated ) {
1769 // new icon
1770 Icons_Manager::render_icon( $settings['ekit_mail_chimp_last_name_icons'], [ 'aria-hidden' => 'true' ] );
1771 } else {
1772 ?>
1773 <i class="<?php echo esc_attr($settings['ekit_mail_chimp_last_name_icon']); ?>" aria-hidden="true"></i>
1774 <?php
1775 }
1776 ?>
1777 </div>
1778 </div>
1779 <?php endif; ?>
1780 </div>
1781 </div>
1782 <?php //endif; ?>
1783 </div>
1784 <?php
1785 if(isset($ekit_mail_chimp_section_form_phone_show) && $ekit_mail_chimp_section_form_phone_show == 'yes'):?>
1786 <div class="ekit-mail-chimp-phone elementskit_input_wraper elementskit_input_container">
1787 <div class="elementskit_form_group">
1788 <?php if($ekit_mail_chimp_phone_label != ''): ?>
1789 <label class="elementskit_input_label"><?php echo esc_html( $ekit_mail_chimp_phone_label );?> <span class="ekit_required_mark">*</span></label>
1790 <?php endif; ?>
1791 <div class="elementskit_input_element_container <?php if(($ekit_mail_chimp_phone_icon_show == 'yes') && ($ekit_mail_chimp_phone_icons != '')) : ?>elementskit_input_group<?php endif; ?>">
1792 <?php if(($ekit_mail_chimp_phone_icon_show == 'yes') && ($ekit_mail_chimp_phone_icons != '') && ($ekit_mail_chimp_phone_icon_before_after == 'before')) : ?>
1793 <div class="elementskit_input_group_prepend">
1794 <div class="elementskit_input_group_text">
1795 <?php
1796 // new icon
1797 $migrated = isset( $settings['__fa4_migrated']['ekit_mail_chimp_phone_icons'] );
1798 // Check if its a new widget without previously selected icon using the old Icon control
1799 $is_new = empty( $settings['ekit_mail_chimp_phone_icon'] );
1800 if ( $is_new || $migrated ) {
1801 // new icon
1802 Icons_Manager::render_icon( $settings['ekit_mail_chimp_phone_icons'], [ 'aria-hidden' => 'true' ] );
1803 } else {
1804 ?>
1805 <i class="<?php echo esc_attr($settings['ekit_mail_chimp_phone_icon']); ?>" aria-hidden="true"></i>
1806 <?php
1807 }
1808 ?>
1809 </div>
1810 </div>
1811 <?php endif; ?>
1812 <input type="tel" aria-label="<?php echo esc_attr__( 'Phone number', 'elementskit-lite' ); ?>" class="ekit_mail_phone ekit_form_control <?php if(($ekit_mail_chimp_phone_icon_show == 'yes') && ($ekit_mail_chimp_phone_icons != '') && ($ekit_mail_chimp_phone_icon_before_after == 'after')) : ?> ekit_append_input <?php endif; ?>" name="phone" placeholder="<?php echo esc_html( $ekit_mail_chimp_phone_placeholder ); ?>" required />
1813
1814 <?php if(($ekit_mail_chimp_phone_icon_show == 'yes') && ($ekit_mail_chimp_phone_icons != '') && ($ekit_mail_chimp_phone_icon_before_after == 'after')) : ?>
1815 <div class="elementskit_input_group_append">
1816 <div class="elementskit_input_group_text">
1817 <?php
1818 // new icon
1819 $migrated = isset( $settings['__fa4_migrated']['ekit_mail_chimp_phone_icons'] );
1820 // Check if its a new widget without previously selected icon using the old Icon control
1821 $is_new = empty( $settings['ekit_mail_chimp_phone_icon'] );
1822 if ( $is_new || $migrated ) {
1823 // new icon
1824 Icons_Manager::render_icon( $settings['ekit_mail_chimp_phone_icons'], [ 'aria-hidden' => 'true' ] );
1825 } else {
1826 ?>
1827 <i class="<?php echo esc_attr($settings['ekit_mail_chimp_phone_icon']); ?>" aria-hidden="true"></i>
1828 <?php
1829 }
1830 ?>
1831 </div>
1832 </div>
1833 <?php endif; ?>
1834 </div>
1835 </div>
1836 </div>
1837 <?php endif; ?>
1838 <div class="ekit-mail-chimp-email elementskit_input_wraper elementskit_input_container">
1839 <div class="elementskit_form_group">
1840 <?php if($ekit_mail_chimp_email_address_label != ''): ?>
1841 <label class="elementskit_input_label"><?php echo esc_html( $ekit_mail_chimp_email_address_label ); ?> <span class="ekit_required_mark">*</span></label>
1842 <?php endif; ?>
1843 <div class="elementskit_input_element_container <?php if(($ekit_mail_chimp_email_icon_show == 'yes') && ($ekit_mail_chimp_email_icons != '')) : ?>elementskit_input_group<?php endif; ?>">
1844 <?php if(($ekit_mail_chimp_email_icon_show == 'yes') && ($ekit_mail_chimp_email_icons != '') && ($ekit_mail_chimp_email_icon_before_after == 'before')) : ?>
1845 <div class="elementskit_input_group_prepend">
1846 <div class="elementskit_input_group_text">
1847 <?php
1848 // new icon
1849 $migrated = isset( $settings['__fa4_migrated']['ekit_mail_chimp_email_icons'] );
1850 // Check if its a new widget without previously selected icon using the old Icon control
1851 $is_new = empty( $settings['ekit_mail_chimp_email_icon'] );
1852 if ( $is_new || $migrated ) {
1853 // new icon
1854 Icons_Manager::render_icon( $settings['ekit_mail_chimp_email_icons'], [ 'aria-hidden' => 'true' ] );
1855 } else {
1856 ?>
1857 <i class="<?php echo esc_attr($settings['ekit_mail_chimp_email_icon']); ?>" aria-hidden="true"></i>
1858 <?php
1859 }
1860 ?>
1861 </div>
1862 </div>
1863 <?php endif; ?>
1864 <input type="email" aria-label="<?php echo esc_attr__( 'Email address', 'elementskit-lite' ); ?>" name="email" class="ekit_mail_email ekit_form_control <?php if(($ekit_mail_chimp_email_icon_show == 'yes') && ($ekit_mail_chimp_email_icons != '') && ($ekit_mail_chimp_email_icon_before_after == 'after')) : ?> ekit_append_input <?php endif; ?>" placeholder="<?php echo esc_html( $ekit_mail_chimp_email_address_placeholder ); ?>" required />
1865
1866 <?php if(($ekit_mail_chimp_email_icon_show == 'yes') && ($ekit_mail_chimp_email_icons != '') && ($ekit_mail_chimp_email_icon_before_after == 'after')) : ?>
1867 <div class="elementskit_input_group_append">
1868 <div class="elementskit_input_group_text">
1869 <?php
1870 // new icon
1871 $migrated = isset( $settings['__fa4_migrated']['ekit_mail_chimp_email_icons'] );
1872 // Check if its a new widget without previously selected icon using the old Icon control
1873 $is_new = empty( $settings['ekit_mail_chimp_email_icon'] );
1874 if ( $is_new || $migrated ) {
1875 // new icon
1876 Icons_Manager::render_icon( $settings['ekit_mail_chimp_email_icons'], [ 'aria-hidden' => 'true' ] );
1877 } else {
1878 ?>
1879 <i class="<?php echo esc_attr($settings['ekit_mail_chimp_email_icon']); ?>" aria-hidden="true"></i>
1880 <?php
1881 }
1882 ?>
1883 </div>
1884 </div>
1885 <?php endif; ?>
1886 </div>
1887 </div>
1888 </div>
1889 <?php
1890 }
1891
1892
1893
1894 /**
1895 * Recursively find and update ONLY the specific widget by ID
1896 */
1897
1898
1899 protected function render_repeater_fields( $settings ) {
1900
1901 extract($settings);
1902 if ( empty( $ekit_mail_chimp_fields_repeater ) ) {
1903 return;
1904 }
1905
1906 foreach ( $ekit_mail_chimp_fields_repeater as $index => $item ) :
1907 $field_type = $item['ekit_mail_chimp_field_type'];
1908 $field_label = $item['ekit_mail_chimp_field_label'];
1909 $field_placeholder = $item['ekit_mail_chimp_field_placeholder'];
1910 $is_required_attr = $item['ekit_mail_chimp_field_required'] === 'yes' ? 'required' : '';
1911 $field_name = $item['ekit_mail_chimp_field_name'];
1912 $show_icon = $item['ekit_mail_chimp_field_icon_show'] === 'yes';
1913 $icon_position = $item['ekit_mail_chimp_field_icon_position'];
1914 ?>
1915 <div class="elementskit_input_wraper elementskit_input_container key-<?php echo esc_attr($index); ?>">
1916 <div class="elementskit_form_group">
1917 <?php if ( ! empty($field_label) ) : ?>
1918 <label class="elementskit_input_label"><?php echo esc_html($field_label); ?> <?php if ( $is_required_attr ) : ?><span class="ekit_required_mark">*</span><?php endif; ?></label>
1919 <?php endif; ?>
1920 <div class="elementskit_input_element_container <?php echo $show_icon ? 'elementskit_input_group' : ''; ?>">
1921 <?php if ( $show_icon && $icon_position === 'before' ) : ?>
1922 <div class="elementskit_input_group_prepend">
1923 <div class="elementskit_input_group_text">
1924 <?php Icons_Manager::render_icon( $item['ekit_mail_chimp_field_icon'], [ 'aria-hidden' => 'true' ] ); ?>
1925 </div>
1926 </div>
1927 <?php endif; ?>
1928
1929 <?php if ( $field_type === 'textarea' ) : ?>
1930 <textarea
1931 class="ekit_form_control <?php echo ( $show_icon && $icon_position === 'after' ) ? 'ekit_append_input' : ''; ?>"
1932 name="<?php echo esc_attr( $field_name ); ?>"
1933 placeholder="<?php echo esc_attr( $field_placeholder ); ?>"
1934 <?php echo $is_required_attr ? 'required' : ''; ?>
1935 ></textarea>
1936 <?php else : ?>
1937 <input
1938 type="<?php echo esc_attr( $field_type ); ?>"
1939 class="ekit_form_control <?php echo esc_attr( ( $show_icon && $icon_position === 'after' ) ? 'ekit_append_input' : '' ); ?>"
1940 name="<?php echo esc_attr( $field_name ); ?>"
1941 placeholder="<?php echo esc_attr( $field_placeholder ); ?>"
1942 <?php echo $is_required_attr ? 'required' : ''; ?>
1943 >
1944 <?php endif; ?>
1945
1946 <?php if ( $show_icon && $icon_position === 'after' ) : ?>
1947 <div class="elementskit_input_group_append">
1948 <div class="elementskit_input_group_text">
1949 <?php Icons_Manager::render_icon( $item['ekit_mail_chimp_field_icon'], [ 'aria-hidden' => 'true' ] ); ?>
1950 </div>
1951 </div>
1952 <?php endif; ?>
1953 </div>
1954 </div>
1955 </div>
1956 <?php endforeach;
1957 }
1958
1959
1960 protected function render( ) {
1961 echo '<div class="ekit-wid-con" >';
1962 $this->render_raw();
1963 echo '</div>';
1964 }
1965 protected function render_raw( ) {
1966
1967 $settings = $this->get_settings_for_display();
1968 extract($settings);
1969
1970 $this->add_render_attribute(
1971 'content_wrapper',
1972 [
1973 'class' => 'elementskit_form_wraper'.($ekit_mail_chimp_form_style_switcher == 'yes' ? ' elementskit_inline_form' : '' ),
1974 ]
1975 );
1976 $this->add_render_attribute(
1977 'form',
1978 [
1979 'class' => 'ekit-mailChimpForm',
1980 'data-listed' => esc_attr($ekit_mail_chimp_select_listed_id),
1981 'data-success-message' => esc_attr($ekit_mail_chimp_success_message),
1982 'data-success-opt-in-message' => esc_attr($ekit_mail_chimp_opt_in_success_message),
1983 'data-nonce' => wp_create_nonce('wp_rest'),
1984 ]
1985 );
1986 ?>
1987 <div class="ekit-mail-chimp">
1988 <form method="post"
1989 <?php
1990 // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Safe attribute string generated by Elementor.
1991 echo $this->get_render_attribute_string('form');
1992 ?>
1993 >
1994 <input type="hidden" name="double_opt_in" value="<?php echo esc_attr($ekit_mail_chimp_double_opt_in)?>">
1995
1996 <div <?php echo $this->get_render_attribute_string('content_wrapper'); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Already escaped by elementor ?>>
1997 <?php
1998 $this->render_repeater_fields($settings);
1999 // $this->render_legacy_fields($settings);
2000 ?>
2001 <div class="ekit_submit_input_holder elementskit_input_wraper">
2002 <button type="submit" class="ekit-mail-submit" name="ekit_mail_chimp"><?php if(($ekit_mail_chimp_submit_icon_show == 'yes') && ($ekit_mail_chimp_submit_icons != '') && ($ekit_mail_chimp_submit_icon_position == 'before')): ?>
2003
2004 <?php
2005 // new icon
2006 $migrated = isset( $settings['__fa4_migrated']['ekit_mail_chimp_submit_icons'] );
2007 // Check if its a new widget without previously selected icon using the old Icon control
2008 $is_new = empty( $settings['ekit_mail_chimp_submit_icon'] );
2009 if ( $is_new || $migrated ) {
2010 // new icon
2011 Icons_Manager::render_icon( $settings['ekit_mail_chimp_submit_icons'], [ 'aria-hidden' => 'true' ] );
2012 } else {
2013 ?>
2014 <i class="<?php echo esc_attr($settings['ekit_mail_chimp_submit_icon']); ?>" aria-hidden="true"></i>
2015 <?php
2016 }
2017 ?>
2018
2019 <?php endif; ?><?php echo esc_html( $ekit_mail_chimp_submit );?><?php if(($ekit_mail_chimp_submit_icon_show == 'yes') && ($ekit_mail_chimp_submit_icons != '') && ($ekit_mail_chimp_submit_icon_position == 'after')): ?>
2020
2021 <?php
2022 // new icon
2023 $migrated = isset( $settings['__fa4_migrated']['ekit_mail_chimp_submit_icons'] );
2024 // Check if its a new widget without previously selected icon using the old Icon control
2025 $is_new = empty( $settings['ekit_mail_chimp_submit_icon'] );
2026 if ( $is_new || $migrated ) {
2027 // new icon
2028 Icons_Manager::render_icon( $settings['ekit_mail_chimp_submit_icons'], [ 'aria-hidden' => 'true' ] );
2029 } else {
2030 ?>
2031 <i class="<?php echo esc_attr($settings['ekit_mail_chimp_submit_icon']); ?>" aria-hidden="true"></i>
2032 <?php
2033 }
2034 ?>
2035
2036 <?php endif; ?></button>
2037 </div>
2038 </div>
2039 <div class="ekit-mail-message"></div>
2040 </form>
2041 </div>
2042 <?php
2043 }
2044
2045 /**
2046 * Check if this widget instance needs migration
2047 */
2048 protected function needs_migration() {
2049 $settings = $this->get_settings_for_display();
2050
2051 // Check if repeater is empty
2052 $repeater_empty = empty($settings['ekit_mail_chimp_fields_repeater']);
2053
2054 // Check if any legacy fields exist
2055 $has_legacy = (
2056 !empty($settings['ekit_mail_chimp_section_form_name_show']) ||
2057 !empty($settings['ekit_mail_chimp_section_form_phone_show']) ||
2058 !empty($settings['ekit_mail_chimp_email_address_label'])
2059 );
2060
2061 return $repeater_empty && $has_legacy;
2062 }
2063
2064 /**
2065 * Convert legacy fields to repeater format
2066 */
2067 protected function migrate_legacy_fields() {
2068 $settings = $this->get_settings_for_display();
2069 $repeater_fields = [];
2070
2071 foreach ($this->get_legacy_field_map() as $field) {
2072 // Skip disabled sections (except email)
2073 if (
2074 $field['show_key'] &&
2075 ($settings[$field['show_key']] ?? 'no') !== 'yes'
2076 ) {
2077 continue;
2078 }
2079
2080 $repeater_fields[] = $this->build_repeater_field($field, $settings);
2081 }
2082
2083
2084 return $repeater_fields;
2085 }
2086
2087 /**
2088 * Legacy field mapping definition
2089 */
2090 protected function get_legacy_field_map() {
2091 return [
2092 [
2093 'type' => 'text',
2094 'show_key' => 'ekit_mail_chimp_section_form_name_show',
2095 'label_key' => 'ekit_mail_chimp_first_name_label',
2096 'ph_key' => 'ekit_mail_chimp_first_name_placeholder',
2097 'icon_show' => 'ekit_mail_chimp_first_name_icon_show',
2098 'icon' => 'ekit_mail_chimp_first_name_icons',
2099 'icon_pos' => 'ekit_mail_chimp_first_name_icon_before_after',
2100 'default' => 'First Name',
2101 ],
2102 [
2103 'type' => 'text',
2104 'show_key' => 'ekit_mail_chimp_section_form_name_show',
2105 'label_key' => 'ekit_mail_chimp_last_name_label',
2106 'ph_key' => 'ekit_mail_chimp_last_name_placeholder',
2107 'icon_show' => 'ekit_mail_chimp_last_name_icon_show',
2108 'icon' => 'ekit_mail_chimp_last_name_icons',
2109 'icon_pos' => 'ekit_mail_chimp_last_name_icon_before_after',
2110 'default' => 'Last Name',
2111 ],
2112 [
2113 'type' => 'tel',
2114 'show_key' => 'ekit_mail_chimp_section_form_phone_show',
2115 'label_key' => 'ekit_mail_chimp_phone_label',
2116 'ph_key' => 'ekit_mail_chimp_phone_placeholder',
2117 'icon_show' => 'ekit_mail_chimp_phone_icon_show',
2118 'icon' => 'ekit_mail_chimp_phone_icons',
2119 'icon_pos' => 'ekit_mail_chimp_phone_icon_before_after',
2120 'default' => 'Phone',
2121 ],
2122 [
2123 'type' => 'email',
2124 'show_key' => null, // always enabled
2125 'label_key' => 'ekit_mail_chimp_email_address_label',
2126 'ph_key' => 'ekit_mail_chimp_email_address_placeholder',
2127 'icon_show' => 'ekit_mail_chimp_email_icon_show',
2128 'icon' => 'ekit_mail_chimp_email_icons',
2129 'icon_pos' => 'ekit_mail_chimp_email_icon_before_after',
2130 'default' => 'Email',
2131 ],
2132 ];
2133 }
2134
2135 /**
2136 * Build single repeater field from legacy settings
2137 */
2138 protected function build_repeater_field($field, $settings) {
2139 return [
2140 '_id' => wp_unique_id(),
2141 'ekit_mail_chimp_field_type' => $field['type'],
2142 'ekit_mail_chimp_field_label' => $settings[$field['label_key']] ?? $field['default'],
2143 'ekit_mail_chimp_field_placeholder' => $settings[$field['ph_key']] ?? $field['default'],
2144 'ekit_mail_chimp_field_name' => '',
2145 'ekit_mail_chimp_field_required' => 'yes',
2146 'ekit_mail_chimp_field_icon_show' => $settings[$field['icon_show']] ?? 'no',
2147 'ekit_mail_chimp_field_icon' => $settings[$field['icon']] ?? [],
2148 'ekit_mail_chimp_field_icon_position' => $settings[$field['icon_pos']] ?? 'before',
2149 ];
2150 }
2151 }
2152