PluginProbe
King Addons for Elementor – 100+ Elementor Widgets, 4 000+ Elementor Templates, WooCommerce Builder, Mega Menu, Popup Builder / 51.1.83
King Addons for Elementor – 100+ Elementor Widgets, 4 000+ Elementor Templates, WooCommerce Builder, Mega Menu, Popup Builder v51.1.83
51.1.84 51.1.85 51.1.83 51.1.82 51.1.81 51.1.79 51.1.78 51.1.77 51.1.76 51.1.74 51.1.75 51.1.65 51.1.64 51.1.63 trunk 51.1.14 51.1.2 51.1.35 51.1.36 51.1.37 51.1.38 51.1.39 51.1.44 51.1.45 51.1.46 All 39 releases
← All changes | includes/widgets/MailChimp/MailChimp.php +1532 -0 51.1.251.1.83 View file →
@@ -1,0 +1,1532 @@
1 +<?php
2 +
3 +namespace King_Addons;
4 +
5 +use Elementor\Widget_Base;
6 +use Elementor\Controls_Manager;
7 +use Elementor\Group_Control_Background;
8 +use Elementor\Group_Control_Box_Shadow;
9 +use Elementor\Group_Control_Typography;
10 +
11 +if (!defined('ABSPATH')) {
12 + exit;
13 +}
14 +
15 +class Mailchimp extends Widget_Base
16 +{
17 +
18 + public function get_name()
19 + {
20 + return 'king-addons-mailchimp';
21 + }
22 +
23 + public function get_title()
24 + {
25 + return esc_html__('Mailchimp', 'king-addons');
26 + }
27 +
28 + public function get_icon()
29 + {
30 + return 'king-addons-icon king-addons-mailchimp';
31 + }
32 +
33 + public function get_categories()
34 + {
35 + return ['king-addons'];
36 + }
37 +
38 + public function get_keywords()
39 + {
40 + return ['king addons', 'king', 'addons', 'kingaddons', 'king-addons', 'subscribe', 'subscription form',
41 + 'subscription', 'subscribe', 'form', 'forms', 'signin',
42 + 'signup', 'sign', 'sign up', 'sign in', 'register',
43 + 'email subscription', 'sing up form', 'signup form', 'newsletter',
44 + 'mailchimp', 'mail', 'email', 'chimp'];
45 + }
46 +
47 + public function get_script_depends()
48 + {
49 + return [KING_ADDONS_ASSETS_UNIQUE_KEY . '-mailchimp-script'];
50 + }
51 +
52 + public function get_style_depends()
53 + {
54 + return [KING_ADDONS_ASSETS_UNIQUE_KEY . '-mailchimp-style'];
55 + }
56 +
57 + public function get_custom_help_url()
58 + {
59 + return 'mailto:bug@kingaddons.com?subject=Bug Report - King Addons&body=Please describe the issue';
60 + }
61 +
62 + public function add_control_clear_fields_on_submit()
63 + {
64 + $this->add_control(
65 + 'clear_fields_on_submit',
66 + [
67 + 'label' => sprintf(__('Clear Fields On Submit %s', 'king-addons'), '<i class="eicon-pro-icon"></i>'),
68 + 'type' => Controls_Manager::SWITCHER,
69 + 'classes' => 'king-addons-pro-control'
70 + ]
71 + );
72 + }
73 +
74 + public function add_control_extra_fields()
75 + {
76 + $this->add_control(
77 + 'extra_fields',
78 + [
79 + 'label' => sprintf(__('Show Extra Fields %s', 'king-addons'), '<i class="eicon-pro-icon"></i>'),
80 + 'type' => Controls_Manager::SWITCHER,
81 + 'separator' => 'before',
82 + 'classes' => 'king-addons-pro-control'
83 + ]
84 + );
85 + }
86 +
87 + public function add_control_name_label()
88 + {
89 + }
90 +
91 + public function add_control_name_placeholder()
92 + {
93 + }
94 +
95 + public function add_control_last_name_label()
96 + {
97 + }
98 +
99 + public function add_control_last_name_placeholder()
100 + {
101 + }
102 +
103 + public function add_control_phone_number_label_and_placeholder()
104 + {
105 + }
106 +
107 + protected function register_controls()
108 + {
109 +
110 +
111 + $this->start_controls_section(
112 + 'section_mailchimp_settings',
113 + [
114 + 'label' => KING_ADDONS_ELEMENTOR_ICON . esc_html__('Settings', 'king-addons'),
115 + 'tab' => Controls_Manager::TAB_CONTENT,
116 + ]
117 + );
118 +
119 +
120 + $this->add_control(
121 + 'mailchimp_audience',
122 + [
123 + 'label' => esc_html__('Select Audience', 'king-addons'),
124 + 'type' => Controls_Manager::SELECT,
125 + 'default' => 'def',
126 + 'options' => Core::getMailchimpLists(),
127 + ]
128 + );
129 +
130 + if ('' == get_option('king_addons_mailchimp_api_key')) {
131 + /** @noinspection HtmlUnknownTarget */
132 + $this->add_control(
133 + 'mailchimp_key_notice',
134 + [
135 + 'type' => Controls_Manager::RAW_HTML,
136 + 'raw' => sprintf(__('Navigate to <strong><a href="%s" target="_blank">Dashboard > %s > Integrations</a></strong> to set up <strong>MailChimp API Key</strong>.', 'king-addons'), admin_url('admin.php?page=king-addons-settings'), Core::getPluginName()),
137 + 'content_classes' => 'elementor-panel-alert elementor-panel-alert-info',
138 + ]
139 + );
140 + }
141 +
142 + $this->end_controls_section();
143 +
144 +
145 + $this->start_controls_section(
146 + 'section_mailchimp_general',
147 + [
148 + 'label' => KING_ADDONS_ELEMENTOR_ICON . esc_html__('General', 'king-addons'),
149 + 'tab' => Controls_Manager::TAB_CONTENT,
150 + ]
151 + );
152 +
153 + $this->add_control_clear_fields_on_submit();
154 +
155 + $this->add_control(
156 + 'show_form_header',
157 + [
158 + 'label' => esc_html__('Show Form Header', 'king-addons'),
159 + 'type' => Controls_Manager::SWITCHER,
160 + ]
161 + );
162 +
163 + $this->add_control(
164 + 'form_title',
165 + [
166 + 'label' => esc_html__('Form Title', 'king-addons'),
167 + 'type' => Controls_Manager::TEXT,
168 + 'dynamic' => [
169 + 'active' => true,
170 + ],
171 + 'default' => 'Form Title',
172 + 'condition' => [
173 + 'show_form_header' => 'yes',
174 + ]
175 + ]
176 + );
177 +
178 + $this->add_control(
179 + 'form_description',
180 + [
181 + 'label' => esc_html__('Form Description', 'king-addons'),
182 + 'type' => Controls_Manager::TEXTAREA,
183 + 'dynamic' => [
184 + 'active' => true,
185 + ],
186 + 'default' => 'Subscribe to our newsletter.',
187 + 'condition' => [
188 + 'show_form_header' => 'yes',
189 + ]
190 + ]
191 + );
192 +
193 + $this->add_control(
194 + 'form_icon',
195 + [
196 + 'label' => esc_html__('Select Icon', 'king-addons'),
197 + 'type' => Controls_Manager::ICONS,
198 + 'skin' => 'inline',
199 + 'label_block' => false,
200 + 'default' => [
201 + 'value' => 'far fa-envelope',
202 + 'library' => 'fa-regular',
203 + ],
204 + 'condition' => [
205 + 'show_form_header' => 'yes',
206 + ]
207 + ]
208 + );
209 +
210 + $this->add_control(
211 + 'form_icon_display',
212 + [
213 + 'label' => esc_html__('Icon Position', 'king-addons'),
214 + 'type' => Controls_Manager::SELECT,
215 + 'default' => 'top',
216 + 'options' => [
217 + 'top' => esc_html__('Top', 'king-addons'),
218 + 'left' => esc_html__('Left', 'king-addons'),
219 + ],
220 + 'selectors_dictionary' => [
221 + 'top' => 'display: block;',
222 + 'left' => 'display: inline; margin-right: 5px;'
223 + ],
224 + 'selectors' => [
225 + '{{WRAPPER}} .king-addons-mailchimp-header i' => '{{VALUE}}',
226 + '{{WRAPPER}} .king-addons-mailchimp-header svg' => '{{VALUE}}'
227 + ],
228 + 'condition' => [
229 + 'show_form_header' => 'yes',
230 + ]
231 + ]
232 + );
233 +
234 + $this->add_control(
235 + 'email_label',
236 + [
237 + 'label' => esc_html__('Email Label', 'king-addons'),
238 + 'type' => Controls_Manager::TEXT,
239 + 'dynamic' => [
240 + 'active' => true,
241 + ],
242 + 'default' => 'Email',
243 + 'separator' => 'before',
244 + ]
245 + );
246 +
247 + $this->add_control(
248 + 'email_placeholder',
249 + [
250 + 'label' => esc_html__('Email Placeholder', 'king-addons'),
251 + 'type' => Controls_Manager::TEXT,
252 + 'dynamic' => [
253 + 'active' => true,
254 + ],
255 + 'default' => 'example@example.com',
256 + ]
257 + );
258 +
259 + if (!king_addons_freemius()->can_use_premium_code__premium_only()) {
260 + $this->add_control(
261 + 'mailchimp_pro_notice',
262 + [
263 + 'type' => Controls_Manager::RAW_HTML,
264 + 'raw' => 'Name and Last Name Field options are available in the <strong><a href="https://kingaddons.com/pricing/?utm_source=kng-module-mailchimp-settings-upgrade-pro&utm_medium=plugin&utm_campaign=kng" target="_blank">Pro version</a></strong>',
265 +
266 + 'content_classes' => 'king-addons-pro-notice',
267 + ]
268 + );
269 + }
270 +
271 + $this->add_control(
272 + 'subscribe_btn_text',
273 + [
274 + 'label' => esc_html__('Button Text', 'king-addons'),
275 + 'type' => Controls_Manager::TEXT,
276 + 'dynamic' => [
277 + 'active' => true,
278 + ],
279 + 'default' => 'Subscribe',
280 + ]
281 + );
282 +
283 + $this->add_control(
284 + 'subscribe_button_loading_text',
285 + [
286 + 'label' => esc_html__('Button Loading Text', 'king-addons'),
287 + 'type' => Controls_Manager::TEXT,
288 + 'dynamic' => [
289 + 'active' => true,
290 + ],
291 + 'default' => 'Subscribing...',
292 + 'separator' => 'after'
293 + ]
294 + );
295 +
296 + $this->add_control(
297 + 'success_message',
298 + [
299 + 'label' => esc_html__('Success Message', 'king-addons'),
300 + 'type' => Controls_Manager::TEXT,
301 + 'dynamic' => [
302 + 'active' => true,
303 + ],
304 + 'default' => 'You have been successfully Subscribed!',
305 + ]
306 + );
307 +
308 + $this->add_control(
309 + 'error_message',
310 + [
311 + 'label' => esc_html__('Error Message', 'king-addons'),
312 + 'type' => Controls_Manager::TEXT,
313 + 'dynamic' => [
314 + 'active' => true,
315 + ],
316 + 'default' => 'Ops! Something went wrong, please try again.',
317 + ]
318 + );
319 +
320 + $this->add_control_extra_fields();
321 +
322 + $this->add_control_name_label();
323 +
324 + $this->add_control_name_placeholder();
325 +
326 + $this->add_control_last_name_label();
327 +
328 + $this->add_control_last_name_placeholder();
329 +
330 + $this->add_control_phone_number_label_and_placeholder();
331 +
332 + $this->end_controls_section();
333 +
334 + Core::renderProFeaturesSection($this, '', Controls_Manager::RAW_HTML, 'mailchimp', [
335 + 'Add Extra Fields - Name, Last Name, Phone Number',
336 + 'Clear Fields After Form Submission'
337 + ]);
338 +
339 + $this->start_controls_section(
340 + 'section_style_container',
341 + [
342 + 'label' => KING_ADDONS_ELEMENTOR_ICON . esc_html__('Container', 'king-addons'),
343 + 'tab' => Controls_Manager::TAB_STYLE,
344 + 'show_label' => false,
345 + ]
346 + );
347 +
348 + $this->add_control(
349 + 'container_align',
350 + [
351 + 'label' => esc_html__('Alignment', 'king-addons'),
352 + 'type' => Controls_Manager::SELECT,
353 + 'default' => 'hr',
354 + 'options' => [
355 + 'hr' => esc_html__('Horizontal', 'king-addons'),
356 + 'vr' => esc_html__('Vertical', 'king-addons'),
357 + ],
358 + 'prefix_class' => 'king-addons-mailchimp-layout-',
359 + 'render_type' => 'template',
360 + 'separator' => 'after'
361 + ]
362 + );
363 +
364 + $this->add_group_control(
365 + Group_Control_Background::get_type(),
366 + [
367 + 'name' => 'container_background',
368 + 'label' => esc_html__('Background', 'king-addons'),
369 + 'types' => ['classic', 'gradient'],
370 + 'fields_options' => [
371 + 'color' => [
372 + 'default' => '',
373 + ],
374 + ],
375 + 'selector' => '{{WRAPPER}} .king-addons-mailchimp-form'
376 + ]
377 + );
378 +
379 + $this->add_control(
380 + 'container_border_color',
381 + [
382 + 'label' => esc_html__('Border Color', 'king-addons'),
383 + 'type' => Controls_Manager::COLOR,
384 + 'default' => '#E8E8E8',
385 + 'selectors' => [
386 + '{{WRAPPER}} .king-addons-mailchimp-form' => 'border-color: {{VALUE}}',
387 + ]
388 + ]
389 + );
390 +
391 + $this->add_group_control(
392 + Group_Control_Box_Shadow::get_type(),
393 + [
394 + 'name' => 'container_box_shadow',
395 + 'selector' => '{{WRAPPER}} .king-addons-mailchimp-form',
396 + ]
397 + );
398 +
399 + $this->add_control(
400 + 'container_border_type',
401 + [
402 + 'label' => esc_html__('Border Type', 'king-addons'),
403 + 'type' => Controls_Manager::SELECT,
404 + 'options' => [
405 + 'none' => esc_html__('None', 'king-addons'),
406 + 'solid' => esc_html__('Solid', 'king-addons'),
407 + 'double' => esc_html__('Double', 'king-addons'),
408 + 'dotted' => esc_html__('Dotted', 'king-addons'),
409 + 'dashed' => esc_html__('Dashed', 'king-addons'),
410 + 'groove' => esc_html__('Groove', 'king-addons'),
411 + ],
412 + 'default' => 'none',
413 + 'selectors' => [
414 + '{{WRAPPER}} .king-addons-mailchimp-form' => 'border-style: {{VALUE}};',
415 + ],
416 + 'separator' => 'before',
417 + ]
418 + );
419 +
420 + $this->add_control(
421 + 'container_border_width',
422 + [
423 + 'label' => esc_html__('Border Width', 'king-addons'),
424 + 'type' => Controls_Manager::DIMENSIONS,
425 + 'size_units' => ['px'],
426 + 'default' => [
427 + 'top' => 0,
428 + 'right' => 0,
429 + 'bottom' => 0,
430 + 'left' => 0,
431 + ],
432 + 'selectors' => [
433 + '{{WRAPPER}} .king-addons-mailchimp-form' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
434 + ],
435 + 'condition' => [
436 + 'container_border_type!' => 'none',
437 + ],
438 + ]
439 + );
440 +
441 + $this->add_responsive_control(
442 + 'container_padding',
443 + [
444 + 'label' => esc_html__('Padding', 'king-addons'),
445 + 'type' => Controls_Manager::DIMENSIONS,
446 + 'size_units' => ['px'],
447 + 'default' => [
448 + 'top' => 0,
449 + 'right' => 0,
450 + 'bottom' => 0,
451 + 'left' => 0,
452 + ],
453 + 'selectors' => [
454 + '{{WRAPPER}} .king-addons-mailchimp-form' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
455 + ],
456 + 'separator' => 'before',
457 + ]
458 + );
459 +
460 + $this->add_control(
461 + 'container_radius',
462 + [
463 + 'label' => esc_html__('Border Radius', 'king-addons'),
464 + 'type' => Controls_Manager::DIMENSIONS,
465 + 'size_units' => ['px', '%'],
466 + 'default' => [
467 + 'top' => 0,
468 + 'right' => 0,
469 + 'bottom' => 0,
470 + 'left' => 0,
471 + ],
472 + 'selectors' => [
473 + '{{WRAPPER}} .king-addons-mailchimp-form' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
474 + ],
475 + ]
476 + );
477 +
478 + $this->end_controls_section();
479 +
480 +
481 + $this->start_controls_section(
482 + 'section_style_header',
483 + [
484 + 'label' => KING_ADDONS_ELEMENTOR_ICON . esc_html__('Form Header', 'king-addons'),
485 + 'tab' => Controls_Manager::TAB_STYLE,
486 + 'show_label' => false,
487 + ]
488 + );
489 +
490 + $this->add_control(
491 + 'header_align',
492 + [
493 + 'label' => esc_html__('Alignment', 'king-addons'),
494 + 'type' => Controls_Manager::CHOOSE,
495 + 'options' => [
496 + 'left' => [
497 + 'title' => esc_html__('Left', 'king-addons'),
498 + 'icon' => 'eicon-text-align-left',
499 + ],
500 + 'center' => [
501 + 'title' => esc_html__('Center', 'king-addons'),
502 + 'icon' => 'eicon-text-align-center',
503 + ],
504 + 'right' => [
505 + 'title' => esc_html__('Right', 'king-addons'),
506 + 'icon' => 'eicon-text-align-right',
507 + ],
508 + ],
509 + 'default' => 'center',
510 + 'selectors' => [
511 + '{{WRAPPER}} .king-addons-mailchimp-header' => 'text-align: {{VALUE}};',
512 + ],
513 + ]
514 + );
515 +
516 + $this->add_control(
517 + 'header_align_divider',
518 + [
519 + 'type' => Controls_Manager::DIVIDER,
520 + 'style' => 'thick',
521 + ]
522 + );
523 +
524 + $this->add_control(
525 + 'header_icon_color',
526 + [
527 + 'label' => esc_html__('Icon Color', 'king-addons'),
528 + 'type' => Controls_Manager::COLOR,
529 + 'default' => '#5B03FF',
530 + 'selectors' => [
531 + '{{WRAPPER}} .king-addons-mailchimp-header i' => 'color: {{VALUE}}',
532 + '{{WRAPPER}} .king-addons-mailchimp-header svg' => 'fill: {{VALUE}}',
533 + ],
534 + ]
535 + );
536 +
537 + $this->add_responsive_control(
538 + 'header_icon_size',
539 + [
540 + 'label' => esc_html__('Icon Size', 'king-addons'),
541 + 'type' => Controls_Manager::SLIDER,
542 + 'size_units' => ['px'],
543 + 'range' => [
544 + 'px' => [
545 + 'min' => 10,
546 + 'max' => 100,
547 + ],
548 + ],
549 + 'default' => [
550 + 'unit' => 'px',
551 + 'size' => 28,
552 + ],
553 + 'selectors' => [
554 + '{{WRAPPER}} .king-addons-mailchimp-header i' => 'font-size: {{SIZE}}{{UNIT}};',
555 + '{{WRAPPER}} .king-addons-mailchimp-header svg' => 'width: {{SIZE}}{{UNIT}};height: {{SIZE}}{{UNIT}};',
556 + ]
557 + ]
558 + );
559 +
560 + $this->add_responsive_control(
561 + 'header_icon_distance',
562 + [
563 + 'label' => esc_html__('Icon Bottom Distance', 'king-addons'),
564 + 'type' => Controls_Manager::SLIDER,
565 + 'size_units' => ['px'],
566 + 'range' => [
567 + 'px' => [
568 + 'min' => 0,
569 + 'max' => 100,
570 + ],
571 + ],
572 + 'default' => [
573 + 'unit' => 'px',
574 + 'size' => 15,
575 + ],
576 + 'selectors' => [
577 + '{{WRAPPER}} .king-addons-mailchimp-header i' => 'margin-bottom: {{SIZE}}{{UNIT}};',
578 + '{{WRAPPER}} .king-addons-mailchimp-header svg' => 'margin-bottom: {{SIZE}}{{UNIT}};',
579 + ],
580 + 'separator' => 'after'
581 + ]
582 + );
583 +
584 + $this->add_control(
585 + 'header_title_color',
586 + [
587 + 'label' => esc_html__('Title Color', 'king-addons'),
588 + 'type' => Controls_Manager::COLOR,
589 + 'default' => '#424242',
590 + 'selectors' => [
591 + '{{WRAPPER}} .king-addons-mailchimp-header h3' => 'color: {{VALUE}}',
592 + ],
593 + ]
594 + );
595 +
596 + $this->add_group_control(
597 + Group_Control_Typography::get_type(),
598 + [
599 + 'name' => 'header_title_typography',
600 + 'selector' => '{{WRAPPER}} .king-addons-mailchimp-header h3',
601 + ]
602 + );
603 +
604 + $this->add_control(
605 + 'header_description_color',
606 + [
607 + 'label' => esc_html__('Description Color', 'king-addons'),
608 + 'type' => Controls_Manager::COLOR,
609 + 'default' => '#606060',
610 + 'selectors' => [
611 + '{{WRAPPER}} .king-addons-mailchimp-header p' => 'color: {{VALUE}}',
612 + ],
613 + 'separator' => 'before'
614 + ]
615 + );
616 +
617 + $this->add_group_control(
618 + Group_Control_Typography::get_type(),
619 + [
620 + 'name' => 'header_description_typography',
621 + 'selector' => '{{WRAPPER}} .king-addons-mailchimp-header p',
622 + ]
623 + );
624 +
625 + $this->add_responsive_control(
626 + 'header_title_distance',
627 + [
628 + 'label' => esc_html__('Title Bottom Distance', 'king-addons'),
629 + 'type' => Controls_Manager::SLIDER,
630 + 'size_units' => ['px'],
631 + 'range' => [
632 + 'px' => [
633 + 'min' => 0,
634 + 'max' => 100,
635 + ],
636 + ],
637 + 'default' => [
638 + 'unit' => 'px',
639 + 'size' => 10,
640 + ],
641 + 'selectors' => [
642 + '{{WRAPPER}} .king-addons-mailchimp-header h3' => 'margin-bottom: {{SIZE}}{{UNIT}};',
643 + ],
644 + 'separator' => 'before'
645 + ]
646 + );
647 +
648 + $this->add_responsive_control(
649 + 'header_desc_distance',
650 + [
651 + 'label' => esc_html__('Description Bottom Distance', 'king-addons'),
652 + 'type' => Controls_Manager::SLIDER,
653 + 'size_units' => ['px'],
654 + 'range' => [
655 + 'px' => [
656 + 'min' => 0,
657 + 'max' => 100,
658 + ],
659 + ],
660 + 'default' => [
661 + 'unit' => 'px',
662 + 'size' => 30,
663 + ],
664 + 'selectors' => [
665 + '{{WRAPPER}} .king-addons-mailchimp-header' => 'margin-bottom: {{SIZE}}{{UNIT}};',
666 + ],
667 + 'separator' => 'before'
668 + ]
669 + );
670 +
671 + $this->end_controls_section();
672 +
673 +
674 + $this->start_controls_section(
675 + 'section_style_labels',
676 + [
677 + 'label' => KING_ADDONS_ELEMENTOR_ICON . esc_html__('Labels', 'king-addons'),
678 + 'tab' => Controls_Manager::TAB_STYLE,
679 + 'show_label' => false,
680 + ]
681 + );
682 +
683 + $this->add_control(
684 + 'labels_color',
685 + [
686 + 'label' => esc_html__('Color', 'king-addons'),
687 + 'type' => Controls_Manager::COLOR,
688 + 'default' => '#818181',
689 + 'selectors' => [
690 + '{{WRAPPER}} .king-addons-mailchimp-fields label' => 'color: {{VALUE}}',
691 + ]
692 + ]
693 + );
694 +
695 + $this->add_group_control(
696 + Group_Control_Typography::get_type(),
697 + [
698 + 'name' => 'labels_typography',
699 + 'selector' => '{{WRAPPER}} .king-addons-mailchimp-fields label',
700 + ]
701 + );
702 +
703 + $this->add_responsive_control(
704 + 'labels_spacing',
705 + [
706 + 'label' => esc_html__('Spacing', 'king-addons'),
707 + 'type' => Controls_Manager::SLIDER,
708 + 'size_units' => ['px'],
709 + 'range' => [
710 + 'px' => [
711 + 'min' => 0,
712 + 'max' => 25,
713 + ],
714 + ],
715 + 'default' => [
716 + 'unit' => 'px',
717 + 'size' => 4,
718 + ],
719 + 'selectors' => [
720 + '{{WRAPPER}} .king-addons-mailchimp-fields label' => 'margin-bottom: {{SIZE}}{{UNIT}};',
721 + ],
722 + 'separator' => 'before'
723 + ]
724 + );
725 +
726 + $this->end_controls_section();
727 +
728 +
729 + $this->start_controls_section(
730 + 'section_style_inputs',
731 + [
732 + 'label' => KING_ADDONS_ELEMENTOR_ICON . esc_html__('Fields', 'king-addons'),
733 + 'tab' => Controls_Manager::TAB_STYLE,
734 + 'show_label' => false,
735 + ]
736 + );
737 +
738 + $this->start_controls_tabs('tabs_forms_inputs_style');
739 +
740 + $this->start_controls_tab(
741 + 'tab_inputs_normal',
742 + [
743 + 'label' => esc_html__('Normal', 'king-addons'),
744 + ]
745 + );
746 +
747 + $this->add_control(
748 + 'input_color',
749 + [
750 + 'label' => esc_html__('Text Color', 'king-addons'),
751 + 'type' => Controls_Manager::COLOR,
752 + 'default' => '#474747',
753 + 'selectors' => [
754 + '{{WRAPPER}} .king-addons-mailchimp-fields input' => 'color: {{VALUE}}',
755 + ]
756 + ]
757 + );
758 +
759 + $this->add_control(
760 + 'input_placeholder_color',
761 + [
762 + 'label' => esc_html__('Placeholder Color', 'king-addons'),
763 + 'type' => Controls_Manager::COLOR,
764 + 'default' => '#ADADAD',
765 + 'selectors' => [
766 + '{{WRAPPER}} .king-addons-mailchimp-fields input::placeholder' => 'color: {{VALUE}}',
767 + ],
768 + ]
769 + );
770 +
771 + $this->add_control(
772 + 'input_background_color',
773 + [
774 + 'label' => esc_html__('Background Color', 'king-addons'),
775 + 'type' => Controls_Manager::COLOR,
776 + 'default' => '#FFFFFF',
777 + 'selectors' => [
778 + '{{WRAPPER}} .king-addons-mailchimp-fields input' => 'background-color: {{VALUE}}',
779 + ]
780 + ]
781 + );
782 +
783 + $this->add_control(
784 + 'input_border_color',
785 + [
786 + 'label' => esc_html__('Border Color', 'king-addons'),
787 + 'type' => Controls_Manager::COLOR,
788 + 'default' => '#e8e8e8',
789 + 'selectors' => [
790 + '{{WRAPPER}} .king-addons-mailchimp-fields input' => 'border-color: {{VALUE}}',
791 + ]
792 + ]
793 + );
794 +
795 + $this->add_group_control(
796 + Group_Control_Box_Shadow::get_type(),
797 + [
798 + 'name' => 'input_box_shadow',
799 + 'selector' => '{{WRAPPER}} .king-addons-mailchimp-fields input',
800 + 'separator' => 'after',
801 + ]
802 + );
803 +
804 + $this->end_controls_tab();
805 +
806 + $this->start_controls_tab(
807 + 'tab_inputs_hover',
808 + [
809 + 'label' => esc_html__('Focus', 'king-addons'),
810 + ]
811 + );
812 +
813 + $this->add_control(
814 + 'input_color_fc',
815 + [
816 + 'label' => esc_html__('Text Color', 'king-addons'),
817 + 'type' => Controls_Manager::COLOR,
818 + 'default' => '#333333',
819 + 'selectors' => [
820 + '{{WRAPPER}} .king-addons-mailchimp-fields input:focus' => 'color: {{VALUE}}',
821 + ]
822 + ]
823 + );
824 +
825 + $this->add_control(
826 + 'input_placeholder_color_fc',
827 + [
828 + 'label' => esc_html__('Placeholder Color', 'king-addons'),
829 + 'type' => Controls_Manager::COLOR,
830 + 'default' => '#FFFFFF',
831 + 'selectors' => [
832 + '{{WRAPPER}} .king-addons-mailchimp-fields input:focus::placeholder' => 'color: {{VALUE}}',
833 + ],
834 + ]
835 + );
836 +
837 + $this->add_control(
838 + 'input_background_color_fc',
839 + [
840 + 'label' => esc_html__('Background Color', 'king-addons'),
841 + 'type' => Controls_Manager::COLOR,
842 + 'default' => '#FFFFFF',
843 + 'selectors' => [
844 + '{{WRAPPER}} .king-addons-mailchimp-fields input:focus' => 'background-color: {{VALUE}}',
845 + ]
846 + ]
847 + );
848 +
849 + $this->add_control(
850 + 'input_border_color_fc',
851 + [
852 + 'label' => esc_html__('Border Color', 'king-addons'),
853 + 'type' => Controls_Manager::COLOR,
854 + 'default' => '#e8e8e8',
855 + 'selectors' => [
856 + '{{WRAPPER}} .king-addons-mailchimp-fields input:focus' => 'border-color: {{VALUE}}',
857 + ]
858 + ]
859 + );
860 +
861 + $this->add_group_control(
862 + Group_Control_Box_Shadow::get_type(),
863 + [
864 + 'name' => 'input_box_shadow_fc',
865 + 'selector' => '{{WRAPPER}} .king-addons-mailchimp-fields input:focus',
866 + ]
867 + );
868 +
869 + $this->end_controls_tab();
870 +
871 + $this->end_controls_tabs();
872 +
873 + $this->add_control(
874 + 'input_transition_duration',
875 + [
876 + 'label' => esc_html__('Transition Duration (seconds)', 'king-addons'),
877 + 'type' => Controls_Manager::NUMBER,
878 + 'default' => 0.1,
879 + 'min' => 0,
880 + 'max' => 5,
881 + 'step' => 0.1,
882 + 'selectors' => [
883 + '{{WRAPPER}} .king-addons-mailchimp-fields input' => 'transition-duration: {{VALUE}}s',
884 + ],
885 + 'separator' => 'before',
886 + ]
887 + );
888 +
889 + $this->add_group_control(
890 + Group_Control_Typography::get_type(),
891 + [
892 + 'name' => 'input_typography',
893 + 'selector' => '{{WRAPPER}} .king-addons-mailchimp-fields input',
894 + ]
895 + );
896 +
897 + $this->add_responsive_control(
898 + 'input_height',
899 + [
900 + 'label' => esc_html__('Input Height', 'king-addons'),
901 + 'type' => Controls_Manager::SLIDER,
902 + 'size_units' => ['px'],
903 + 'range' => [
904 + 'px' => [
905 + 'min' => 30,
906 + 'max' => 100,
907 + ],
908 + ],
909 + 'default' => [
910 + 'unit' => 'px',
911 + 'size' => 45,
912 + ],
913 + 'selectors' => [
914 + '{{WRAPPER}} .king-addons-mailchimp-fields input' => 'height: {{SIZE}}px; line-height: {{SIZE}}px;',
915 + ],
916 + 'separator' => 'before'
917 + ]
918 + );
919 +
920 + $this->add_responsive_control(
921 + 'input_spacing',
922 + [
923 + 'label' => esc_html__('Gutter', 'king-addons'),
924 + 'type' => Controls_Manager::SLIDER,
925 + 'size_units' => ['px'],
926 + 'range' => [
927 + 'px' => [
928 + 'min' => 0,
929 + 'max' => 50,
930 + ],
931 + ],
932 + 'default' => [
933 + 'unit' => 'px',
934 + 'size' => 10,
935 + ],
936 + 'selectors' => [
937 + '{{WRAPPER}}.king-addons-mailchimp-layout-vr .king-addons-mailchimp-email, {{WRAPPER}}.king-addons-mailchimp-layout-vr .king-addons-mailchimp-first-name, {{WRAPPER}}.king-addons-mailchimp-layout-vr .king-addons-mailchimp-last-name, {{WRAPPER}}.king-addons-mailchimp-layout-vr .king-addons-mailchimp-phone-number' => 'margin-bottom: {{SIZE}}{{UNIT}};',
938 + '{{WRAPPER}}.king-addons-mailchimp-layout-hr .king-addons-mailchimp-email, {{WRAPPER}}.king-addons-mailchimp-layout-hr .king-addons-mailchimp-first-name, {{WRAPPER}}.king-addons-mailchimp-layout-hr .king-addons-mailchimp-last-name, {{WRAPPER}}.king-addons-mailchimp-layout-hr .king-addons-mailchimp-phone-number' => 'margin-right: {{SIZE}}{{UNIT}};',
939 + ],
940 + 'separator' => 'after'
941 + ]
942 + );
943 +
944 + $this->add_control(
945 + 'input_border_type',
946 + [
947 + 'label' => esc_html__('Border Type', 'king-addons'),
948 + 'type' => Controls_Manager::SELECT,
949 + 'options' => [
950 + 'none' => esc_html__('None', 'king-addons'),
951 + 'solid' => esc_html__('Solid', 'king-addons'),
952 + 'double' => esc_html__('Double', 'king-addons'),
953 + 'dotted' => esc_html__('Dotted', 'king-addons'),
954 + 'dashed' => esc_html__('Dashed', 'king-addons'),
955 + 'groove' => esc_html__('Groove', 'king-addons'),
956 + ],
957 + 'default' => 'solid',
958 + 'selectors' => [
959 + '{{WRAPPER}} .king-addons-mailchimp-fields input' => 'border-style: {{VALUE}};',
960 + ],
961 + ]
962 + );
963 +
964 + $this->add_control(
965 + 'input_border_width',
966 + [
967 + 'label' => esc_html__('Border Width', 'king-addons'),
968 + 'type' => Controls_Manager::DIMENSIONS,
969 + 'size_units' => ['px'],
970 + 'default' => [
971 + 'top' => 1,
972 + 'right' => 1,
973 + 'bottom' => 1,
974 + 'left' => 1,
975 + ],
976 + 'selectors' => [
977 + '{{WRAPPER}} .king-addons-mailchimp-fields input' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
978 + ],
979 + 'condition' => [
980 + 'input_border_type!' => 'none',
981 + ],
982 + ]
983 + );
984 +
985 + $this->add_responsive_control(
986 + 'input_padding',
987 + [
988 + 'label' => esc_html__('Padding', 'king-addons'),
989 + 'type' => Controls_Manager::DIMENSIONS,
990 + 'size_units' => ['px'],
991 + 'default' => [
992 + 'top' => 0,
993 + 'right' => 15,
994 + 'bottom' => 0,
995 + 'left' => 15,
996 + ],
997 + 'selectors' => [
998 + '{{WRAPPER}} .king-addons-mailchimp-fields input' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
999 + ],
1000 + 'separator' => 'before',
1001 + ]
1002 + );
1003 +
1004 + $this->add_control(
1005 + 'input_radius',
1006 + [
1007 + 'label' => esc_html__('Border Radius', 'king-addons'),
1008 + 'type' => Controls_Manager::DIMENSIONS,
1009 + 'size_units' => ['px', '%'],
1010 + 'default' => [
1011 + 'top' => 2,
1012 + 'right' => 2,
1013 + 'bottom' => 2,
1014 + 'left' => 2,
1015 + ],
1016 + 'selectors' => [
1017 + '{{WRAPPER}} .king-addons-mailchimp-fields input' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1018 + ],
1019 + ]
1020 + );
1021 +
1022 + $this->end_controls_section();
1023 +
1024 +
1025 + $this->start_controls_section(
1026 + 'section_style_subscribe_btn',
1027 + [
1028 + 'label' => KING_ADDONS_ELEMENTOR_ICON . esc_html__('Button', 'king-addons'),
1029 + 'tab' => Controls_Manager::TAB_STYLE,
1030 + 'show_label' => false,
1031 + ]
1032 + );
1033 +
1034 + $this->add_control(
1035 + 'subscribe_btn_align',
1036 + [
1037 + 'label' => esc_html__('Alignment', 'king-addons'),
1038 + 'type' => Controls_Manager::CHOOSE,
1039 + 'options' => [
1040 + 'flex-start' => [
1041 + 'title' => esc_html__('Left', 'king-addons'),
1042 + 'icon' => 'eicon-text-align-left',
1043 + ],
1044 + 'center' => [
1045 + 'title' => esc_html__('Center', 'king-addons'),
1046 + 'icon' => 'eicon-text-align-center',
1047 + ],
1048 + 'flex-end' => [
1049 + 'title' => esc_html__('Right', 'king-addons'),
1050 + 'icon' => 'eicon-text-align-right',
1051 + ],
1052 + ],
1053 + // Was 'left', which is not a valid align-self value, so browsers
1054 + // dropped the rule and the control opened with nothing selected.
1055 + // Empty keeps today's rendering and leaves the choice to the user.
1056 + 'default' => '',
1057 + 'selectors' => [
1058 + '{{WRAPPER}}.king-addons-mailchimp-layout-vr .king-addons-mailchimp-subscribe' => 'align-self: {{VALUE}};',
1059 + ],
1060 + 'condition' => [
1061 + 'container_align' => 'vr'
1062 + ]
1063 + ]
1064 + );
1065 +
1066 + $this->add_control(
1067 + 'subscribe_btn_divider1',
1068 + [
1069 + 'type' => Controls_Manager::DIVIDER,
1070 + 'style' => 'thick',
1071 + 'condition' => [
1072 + 'container_align' => 'vr'
1073 + ]
1074 + ]
1075 + );
1076 +
1077 + $this->start_controls_tabs('tabs_subscribe_btn_style');
1078 +
1079 + $this->start_controls_tab(
1080 + 'tab_subscribe_btn_normal',
1081 + [
1082 + 'label' => esc_html__('Normal', 'king-addons'),
1083 + ]
1084 + );
1085 +
1086 + $this->add_group_control(
1087 + Group_Control_Background::get_type(),
1088 + [
1089 + 'name' => 'subscribe_btn_bg_color',
1090 + 'label' => esc_html__('Background', 'king-addons'),
1091 + 'types' => ['classic', 'gradient'],
1092 + 'fields_options' => [
1093 + 'color' => [
1094 + 'default' => '#5B03FF',
1095 + ],
1096 + ],
1097 + 'selector' => '{{WRAPPER}} .king-addons-mailchimp-subscribe-btn'
1098 + ]
1099 + );
1100 +
1101 + $this->add_control(
1102 + 'subscribe_btn_color',
1103 + [
1104 + 'label' => esc_html__('Color', 'king-addons'),
1105 + 'type' => Controls_Manager::COLOR,
1106 + 'default' => '#ffffff',
1107 + 'selectors' => [
1108 + '{{WRAPPER}} .king-addons-mailchimp-subscribe-btn' => 'color: {{VALUE}}',
1109 + ],
1110 + ]
1111 + );
1112 +
1113 + $this->add_control(
1114 + 'subscribe_btn_border_color',
1115 + [
1116 + 'label' => esc_html__('Border Color', 'king-addons'),
1117 + 'type' => Controls_Manager::COLOR,
1118 + 'default' => '#E6E2E2',
1119 + 'selectors' => [
1120 + '{{WRAPPER}} .king-addons-mailchimp-subscribe-btn' => 'border-color: {{VALUE}}',
1121 + ],
1122 + ]
1123 + );
1124 +
1125 + $this->add_group_control(
1126 + Group_Control_Box_Shadow::get_type(),
1127 + [
1128 + 'name' => 'subscribe_btn_box_shadow',
1129 + 'selector' => '{{WRAPPER}} .king-addons-mailchimp-subscribe-btn',
1130 + ]
1131 + );
1132 +
1133 + $this->end_controls_tab();
1134 +
1135 + $this->start_controls_tab(
1136 + 'tab_subscribe_btn_hover',
1137 + [
1138 + 'label' => esc_html__('Hover', 'king-addons'),
1139 + ]
1140 + );
1141 +
1142 + $this->add_group_control(
1143 + Group_Control_Background::get_type(),
1144 + [
1145 + 'name' => 'subscribe_btn_bg_color_hr',
1146 + 'label' => esc_html__('Background', 'king-addons'),
1147 + 'types' => ['classic', 'gradient'],
1148 + 'fields_options' => [
1149 + 'color' => [
1150 + 'default' => '#4D02D8',
1151 + ],
1152 + ],
1153 + 'selector' => '{{WRAPPER}} .king-addons-mailchimp-subscribe-btn:hover'
1154 + ]
1155 + );
1156 +
1157 + $this->add_control(
1158 + 'subscribe_btn_color_hr',
1159 + [
1160 + 'label' => esc_html__('Color', 'king-addons'),
1161 + 'type' => Controls_Manager::COLOR,
1162 + 'default' => '#FFFFFF',
1163 + 'selectors' => [
1164 + '{{WRAPPER}} .king-addons-mailchimp-subscribe-btn:hover' => 'color: {{VALUE}}',
1165 + ],
1166 + ]
1167 + );
1168 +
1169 + $this->add_control(
1170 + 'subscribe_btn_border_color_hr',
1171 + [
1172 + 'label' => esc_html__('Border Color', 'king-addons'),
1173 + 'type' => Controls_Manager::COLOR,
1174 + 'selectors' => [
1175 + '{{WRAPPER}} .king-addons-mailchimp-subscribe-btn:hover' => 'border-color: {{VALUE}}',
1176 + ]
1177 + ]
1178 + );
1179 +
1180 + $this->add_group_control(
1181 + Group_Control_Box_Shadow::get_type(),
1182 + [
1183 + 'name' => 'subscribe_btn_box_shadow_hr',
1184 + 'selector' => '{{WRAPPER}} .king-addons-mailchimp-subscribe-btn:hover',
1185 + ]
1186 + );
1187 +
1188 + $this->end_controls_tab();
1189 +
1190 + $this->end_controls_tabs();
1191 +
1192 + $this->add_control(
1193 + 'subscribe_btn_divider2',
1194 + [
1195 + 'type' => Controls_Manager::DIVIDER,
1196 + 'style' => 'thick',
1197 + ]
1198 + );
1199 +
1200 + $this->add_control(
1201 + 'subscribe_btn_transition_duration',
1202 + [
1203 + 'label' => esc_html__('Transition Duration (seconds)', 'king-addons'),
1204 + 'type' => Controls_Manager::NUMBER,
1205 + 'default' => 0.1,
1206 + 'min' => 0,
1207 + 'max' => 5,
1208 + 'step' => 0.1,
1209 + 'selectors' => [
1210 + '{{WRAPPER}} .king-addons-mailchimp-subscribe-btn' => 'transition-duration: {{VALUE}}s',
1211 + ],
1212 + 'separator' => 'after',
1213 + ]
1214 + );
1215 +
1216 + $this->add_group_control(
1217 + Group_Control_Typography::get_type(),
1218 + [
1219 + 'name' => 'subscribe_btn_typography',
1220 + 'selector' => '{{WRAPPER}} .king-addons-mailchimp-subscribe-btn'
1221 + ]
1222 + );
1223 +
1224 + $this->add_responsive_control(
1225 + 'subscribe_btn_width',
1226 + [
1227 + 'label' => esc_html__('Width', 'king-addons'),
1228 + 'type' => Controls_Manager::SLIDER,
1229 + 'size_units' => ['px', '%'],
1230 + 'range' => [
1231 + 'px' => [
1232 + 'min' => 30,
1233 + 'max' => 300,
1234 + ],
1235 + ],
1236 + 'default' => [
1237 + 'unit' => 'px',
1238 + 'size' => 130,
1239 + ],
1240 + 'selectors' => [
1241 + '{{WRAPPER}} .king-addons-mailchimp-subscribe' => 'width: {{SIZE}}{{UNIT}};',
1242 + ],
1243 + 'separator' => 'before'
1244 + ]
1245 + );
1246 +
1247 + $this->add_responsive_control(
1248 + 'subscribe_btn_height',
1249 + [
1250 + 'label' => esc_html__('Height', 'king-addons'),
1251 + 'type' => Controls_Manager::SLIDER,
1252 + 'size_units' => ['px'],
1253 + 'range' => [
1254 + 'px' => [
1255 + 'min' => 10,
1256 + 'max' => 100,
1257 + ],
1258 + ],
1259 + 'default' => [
1260 + 'unit' => 'px',
1261 + 'size' => 45,
1262 + ],
1263 + 'selectors' => [
1264 + '{{WRAPPER}} .king-addons-mailchimp-subscribe-btn' => 'height: {{SIZE}}{{UNIT}}; line-height: {{SIZE}}{{UNIT}};',
1265 + ],
1266 + ]
1267 + );
1268 +
1269 + $this->add_responsive_control(
1270 + 'subscribe_btn_spacing',
1271 + [
1272 + 'label' => esc_html__('Top Distance', 'king-addons'),
1273 + 'type' => Controls_Manager::SLIDER,
1274 + 'size_units' => ['px'],
1275 + 'range' => [
1276 + 'px' => [
1277 + 'min' => 0,
1278 + 'max' => 50,
1279 + ],
1280 + ],
1281 + 'default' => [
1282 + 'unit' => 'px',
1283 + 'size' => 0,
1284 + ],
1285 + 'selectors' => [
1286 + '{{WRAPPER}}.king-addons-mailchimp-layout-vr .king-addons-mailchimp-subscribe-btn' => 'margin-top: {{SIZE}}{{UNIT}};',
1287 + ],
1288 + 'condition' => [
1289 + 'container_align' => 'vr'
1290 + ]
1291 + ]
1292 + );
1293 +
1294 + $this->add_control(
1295 + 'subscribe_btn_border_type',
1296 + [
1297 + 'label' => esc_html__('Border Type', 'king-addons'),
1298 + 'type' => Controls_Manager::SELECT,
1299 + 'options' => [
1300 + 'none' => esc_html__('None', 'king-addons'),
1301 + 'solid' => esc_html__('Solid', 'king-addons'),
1302 + 'double' => esc_html__('Double', 'king-addons'),
1303 + 'dotted' => esc_html__('Dotted', 'king-addons'),
1304 + 'dashed' => esc_html__('Dashed', 'king-addons'),
1305 + 'groove' => esc_html__('Groove', 'king-addons'),
1306 + ],
1307 + 'default' => 'none',
1308 + 'selectors' => [
1309 + '{{WRAPPER}} .king-addons-mailchimp-subscribe-btn' => 'border-style: {{VALUE}};',
1310 + ],
1311 + 'separator' => 'before',
1312 + ]
1313 + );
1314 +
1315 + $this->add_control(
1316 + 'subscribe_btn_border_width',
1317 + [
1318 + 'label' => esc_html__('Border Width', 'king-addons'),
1319 + 'type' => Controls_Manager::DIMENSIONS,
1320 + 'size_units' => ['px'],
1321 + 'default' => [
1322 + 'top' => 0,
1323 + 'right' => 0,
1324 + 'bottom' => 0,
1325 + 'left' => 0,
1326 + ],
1327 + 'selectors' => [
1328 + '{{WRAPPER}} .king-addons-mailchimp-subscribe-btn' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1329 + ],
1330 + 'condition' => [
1331 + 'subscribe_btn_border_type!' => 'none',
1332 + ],
1333 + ]
1334 + );
1335 +
1336 + $this->add_control(
1337 + 'subscribe_btn_radius',
1338 + [
1339 + 'label' => esc_html__('Border Radius', 'king-addons'),
1340 + 'type' => Controls_Manager::DIMENSIONS,
1341 + 'size_units' => ['px', '%'],
1342 + 'default' => [
1343 + 'top' => 2,
1344 + 'right' => 2,
1345 + 'bottom' => 2,
1346 + 'left' => 2,
1347 + ],
1348 + 'selectors' => [
1349 + '{{WRAPPER}} .king-addons-mailchimp-subscribe-btn' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1350 + ],
1351 + 'separator' => 'before',
1352 + ]
1353 + );
1354 +
1355 + $this->end_controls_section();
1356 +
1357 +
1358 + $this->start_controls_section(
1359 + 'section_style_message',
1360 + [
1361 + 'label' => KING_ADDONS_ELEMENTOR_ICON . esc_html__('Message', 'king-addons'),
1362 + 'tab' => Controls_Manager::TAB_STYLE,
1363 + 'show_label' => false,
1364 + ]
1365 + );
1366 +
1367 + $this->add_control(
1368 + 'success_message_color',
1369 + [
1370 + 'label' => esc_html__('Success Color', 'king-addons'),
1371 + 'type' => Controls_Manager::COLOR,
1372 + 'default' => '#333333',
1373 + 'selectors' => [
1374 + '{{WRAPPER}} .king-addons-mailchimp-success-message' => 'color: {{VALUE}}',
1375 + ]
1376 + ]
1377 + );
1378 +
1379 + $this->add_control(
1380 + 'error_message_color',
1381 + [
1382 + 'label' => esc_html__('Error Color', 'king-addons'),
1383 + 'type' => Controls_Manager::COLOR,
1384 + 'default' => '#FF348B',
1385 + 'selectors' => [
1386 + '{{WRAPPER}} .king-addons-mailchimp-error-message' => 'color: {{VALUE}}',
1387 + ]
1388 + ]
1389 + );
1390 +
1391 + $this->add_control(
1392 + 'message_color_bg',
1393 + [
1394 + 'label' => esc_html__('Background Color', 'king-addons'),
1395 + 'type' => Controls_Manager::COLOR,
1396 + 'default' => '#FFFFFF',
1397 + 'selectors' => [
1398 + '{{WRAPPER}} .king-addons-mailchimp-message' => 'background-color: {{VALUE}}',
1399 + ]
1400 + ]
1401 + );
1402 +
1403 + $this->add_group_control(
1404 + Group_Control_Typography::get_type(),
1405 + [
1406 + 'name' => 'message_typography',
1407 + 'selector' => '{{WRAPPER}} .king-addons-mailchimp-message',
1408 + ]
1409 + );
1410 +
1411 + $this->add_responsive_control(
1412 + 'message_padding',
1413 + [
1414 + 'label' => esc_html__('Padding', 'king-addons'),
1415 + 'type' => Controls_Manager::DIMENSIONS,
1416 + 'size_units' => ['px'],
1417 + 'default' => [
1418 + 'top' => 0,
1419 + 'right' => 0,
1420 + 'bottom' => 0,
1421 + 'left' => 0,
1422 + ],
1423 + 'selectors' => [
1424 + '{{WRAPPER}} .king-addons-mailchimp-message' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1425 + ],
1426 + 'separator' => 'before',
1427 + ]
1428 + );
1429 +
1430 + $this->add_responsive_control(
1431 + 'message_spacing',
1432 + [
1433 + 'label' => esc_html__('Spacing', 'king-addons'),
1434 + 'type' => Controls_Manager::SLIDER,
1435 + 'size_units' => ['px'],
1436 + 'range' => [
1437 + 'px' => [
1438 + 'min' => 0,
1439 + 'max' => 50,
1440 + ],
1441 + ],
1442 + 'default' => [
1443 + 'unit' => 'px',
1444 + 'size' => 10,
1445 + ],
1446 + 'selectors' => [
1447 + '{{WRAPPER}} .king-addons-mailchimp-message' => 'margin-top: {{SIZE}}{{UNIT}};',
1448 + ],
1449 + 'separator' => 'before'
1450 + ]
1451 + );
1452 +
1453 + $this->end_controls_section();
1454 + }
1455 +
1456 + public function render_pro_element_extra_fields()
1457 + {
1458 + }
1459 +
1460 + protected function render()
1461 + {
1462 + $settings = Core::displaySettings($this);
1463 +
1464 + // Conditionally set the clear_fields_on_submit value
1465 + $clear_fields_on_submit = king_addons_freemius()->can_use_premium_code__premium_only()
1466 + ? esc_attr($settings['clear_fields_on_submit'])
1467 + : '';
1468 +
1469 + // Pre-escape frequently used values
1470 + $id = esc_attr($this->get_id());
1471 + $audience = esc_attr($settings['mailchimp_audience']);
1472 + $form_icon_val = !empty($settings['form_icon']['value']) ? esc_attr($settings['form_icon']['value']) : '';
1473 + $form_icon = $form_icon_val ? "<i class=\"$form_icon_val\"></i>" : '';
1474 + $email_label = !empty($settings['email_label']) ? '<label>' . esc_html($settings['email_label']) . '</label>' : '';
1475 + ?>
1476 +
1477 + <form
1478 + class="king-addons-mailchimp-form"
1479 + id="king-addons-mailchimp-form-<?php echo $id; ?>"
1480 + method="POST"
1481 + data-list-id="<?php echo $audience; ?>"
1482 + data-clear-fields="<?php echo $clear_fields_on_submit; ?>"
1483 + >
1484 + <?php if ('yes' === $settings['show_form_header']) : ?>
1485 + <div class="king-addons-mailchimp-header">
1486 + <h3>
1487 + <?php
1488 + echo $form_icon;
1489 + echo esc_html($settings['form_title']);
1490 + ?>
1491 + </h3>
1492 + <p><?php echo wp_kses($settings['form_description'], ['br' => [], 'em' => [], 'strong' => []]); ?></p>
1493 + </div>
1494 + <?php endif; ?>
1495 +
1496 + <div class="king-addons-mailchimp-fields">
1497 + <div class="king-addons-mailchimp-email">
1498 + <?php echo $email_label; ?>
1499 + <input
1500 + type="email"
1501 + name="king_addons_mailchimp_email"
1502 + placeholder="<?php echo esc_attr($settings['email_placeholder']); ?>"
1503 + required
1504 + />
1505 + </div>
1506 +
1507 + <?php $this->render_pro_element_extra_fields(); ?>
1508 +
1509 + <div class="king-addons-mailchimp-subscribe">
1510 + <button
1511 + type="submit"
1512 + id="king-addons-subscribe-<?php echo $id; ?>"
1513 + class="king-addons-mailchimp-subscribe-btn"
1514 + data-loading="<?php echo esc_attr($settings['subscribe_button_loading_text']); ?>"
1515 + >
1516 + <?php echo esc_html($settings['subscribe_btn_text']); ?>
1517 + </button>
1518 + </div>
1519 + </div>
1520 +
1521 + <div class="king-addons-mailchimp-message">
1522 + <span class="king-addons-mailchimp-success-message">
1523 + <?php echo esc_html($settings['success_message']); ?>
1524 + </span>
1525 + <span class="king-addons-mailchimp-error-message">
1526 + <?php echo esc_html($settings['error_message']); ?>
1527 + </span>
1528 + </div>
1529 + </form>
1530 + <?php
1531 + }
1532 +}