PluginProbe
Master Addons for Elementor – Elementor Addons, Widgets, Mega Menu Builder, Popup Builder, Widget Builder & Template Kits / 1.2.7
Master Addons for Elementor – Elementor Addons, Widgets, Mega Menu Builder, Popup Builder, Widget Builder & Template Kits v1.2.7
3.2.1 3.2.0 3.1.9 3.1.8 3.1.7 3.1.6 3.1.5 3.1.4 3.1.3 3.1.2 3.1.1 3.1.0 3.0.9 trunk 1.0.6 1.0.7 1.0.8 1.0.9 1.1.0 1.1.1 1.1.3 1.1.4 1.1.5 1.1.6 1.1.7 All 172 releases
master-addons / addons / weforms / weforms.php

weforms.php in Master Addons for Elementor – Elementor Addons, Widgets, Mega Menu Builder, Popup Builder, Widget Builder & Template Kits 1.2.7, at addons/weforms/weforms.php

867 lines 26.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 namespace Elementor;
3
4 /**
5 * Author Name: Liton Arefin
6 * Author URL: https://jeweltheme.com
7 * Date: 6/25/19
8 */
9
10 use \Elementor\Controls_Manager as Controls_Manager;
11 use \Elementor\Group_Control_Border as Group_Control_Border;
12 use \Elementor\Group_Control_Box_Shadow as Group_Control_Box_Shadow;
13 use \Elementor\Group_Control_Typography as Group_Control_Typography;
14 use \Elementor\Scheme_Typography as Scheme_Typography;
15 use \Elementor\Widget_Base as Widget_Base;
16 use MasterAddons\Inc\Helper\Master_Addons_Helper;
17
18
19
20 if ( ! defined( 'ABSPATH' ) ) exit; // If this file is called directly, abort.
21
22
23 class Master_Addons_WeForms extends Widget_Base {
24
25 public function get_name() {
26 return 'ma-weforms';
27 }
28
29 public function get_title() {
30 return esc_html__( 'weForms', MELA_TD );
31 }
32
33 public function get_icon() {
34 return 'ma-el-icon fa fa-envelope-o';
35 }
36
37 public function get_categories() {
38 return [ 'master-addons' ];
39 }
40
41 protected function _register_controls() {
42
43
44 $this->start_controls_section(
45 'ma_el_section_weform',
46 [
47 'label' => esc_html__( 'Select weForm', MELA_TD )
48 ]
49 );
50
51
52
53 $this->add_control(
54 'wpuf_contact_form',
55 [
56 'label' => esc_html__( 'Select weForm', MELA_TD ),
57 'description' => esc_html__( 'Please save and refresh the page after selecting the form', MELA_TD ),
58 'label_block' => true,
59 'type' => Controls_Manager::SELECT,
60 'options' => Master_Addons_Helper::ma_el_get_weforms(),
61 'default' => '0',
62 ]
63 );
64
65
66 $this->end_controls_section();
67
68
69
70
71 if ( ma_el_fs()->is_not_paying() ) {
72
73 $this->start_controls_section(
74 'maad_el_section_pro',
75 [
76 'label' => esc_html__( 'Upgrade to Pro Version for More Features', MELA_TD )
77 ]
78 );
79
80 $this->add_control(
81 'maad_el_control_get_pro',
82 [
83 'label' => esc_html__( 'Unlock more possibilities', MELA_TD ),
84 'type' => Controls_Manager::CHOOSE,
85 'options' => [
86 '1' => [
87 'title' => esc_html__( '', MELA_TD ),
88 'icon' => 'fa fa-unlock-alt',
89 ],
90 ],
91 'default' => '1',
92 'description' => '<span class="pro-feature"> Upgrade to <a href="' . ma_el_fs()->get_upgrade_url() . '" target="_blank">Pro Version</a> for more Elements with Customization Options.</span>'
93 ]
94 );
95
96 $this->end_controls_section();
97 }
98
99
100
101 $this->start_controls_section(
102 'ma_weform_section_style',
103 [
104 'label' => esc_html__( 'Design Layout', MELA_TD ),
105 'tab' => Controls_Manager::TAB_STYLE
106 ]
107 );
108
109
110 // Premium Version Codes
111 if ( ma_el_fs()->can_use_premium_code() ) {
112
113 $this->add_control(
114 'ma_weform_layout_style',
115 [
116 'label' => __( 'Design Variations', MELA_TD ),
117 'type' => Controls_Manager::SELECT,
118 'default' => '1',
119 'options' => [
120 '1' => __( 'Style One', MELA_TD ),
121 '2' => __( 'Style Two', MELA_TD ),
122 '3' => __( 'Style Three', MELA_TD ),
123 '4' => __( 'Style Four', MELA_TD ),
124 '5' => __( 'Style Five', MELA_TD ),
125 '6' => __( 'Style Six', MELA_TD ),
126 '7' => __( 'Style Seven', MELA_TD ),
127 '8' => __( 'Style Eight', MELA_TD ),
128 '9' => __( 'Style Nine', MELA_TD ),
129 '10' => __( 'Style Ten', MELA_TD ),
130 '11' => __( 'Style Eleven', MELA_TD ),
131 ],
132 ]
133 );
134
135 } else{
136 $this->add_control(
137 'ma_weform_layout_style',
138 [
139 'label' => __( 'Design Variations', MELA_TD ),
140 'type' => Controls_Manager::SELECT,
141 'default' => '1',
142 'options' => [
143 '1' => __( 'Style One', MELA_TD ),
144 '2' => __( 'Style Two', MELA_TD ),
145 '3' => __( 'Style Three', MELA_TD ),
146 '4' => __( 'Style Four', MELA_TD ),
147 'wef-pro-1' => __( 'Style Five (Pro)', MELA_TD ),
148 'wef-pro-2' => __( 'Style Six (Pro)', MELA_TD ),
149 'wef-pro-3' => __( 'Style Seven (Pro)', MELA_TD ),
150 'wef-pro-4' => __( 'Style Eight (Pro)', MELA_TD ),
151 'wef-pro-5' => __( 'Style Nine (Pro)', MELA_TD ),
152 'wef-pro-6' => __( 'Style Ten (Pro)', MELA_TD ),
153 'wef-pro-7' => __( 'Style Eleven (Pro)', MELA_TD ),
154 ],
155 'description' => sprintf( '10+ more Variations on <a href="%s" target="_blank">%s</a>',
156 esc_url_raw( admin_url('admin.php?page=master-addons-settings-pricing') ),
157 __( 'Upgrade Now', MELA_TD ) )
158 ]
159 );
160 }
161
162
163 $this->end_controls_section();
164
165
166
167 $this->start_controls_section(
168 'ma_el_section_weform_styles',
169 [
170 'label' => esc_html__( 'Form Container Styles', MELA_TD ),
171 'tab' => Controls_Manager::TAB_STYLE
172 ]
173 );
174
175 $this->add_control(
176 'ma_el_weform_background',
177 [
178 'label' => esc_html__( 'Form Background Color', MELA_TD ),
179 'type' => Controls_Manager::COLOR,
180 'selectors' => [
181 '{{WRAPPER}} .eael-weform-container' => 'background-color: {{VALUE}};',
182 ],
183 ]
184 );
185
186 $this->add_responsive_control(
187 'ma_el_weform_alignment',
188 [
189 'label' => esc_html__( 'Form Alignment', MELA_TD ),
190 'type' => Controls_Manager::CHOOSE,
191 'label_block' => true,
192 'options' => [
193 'default' => [
194 'title' => __( 'Default', MELA_TD ),
195 'icon' => 'fa fa-ban',
196 ],
197 'left' => [
198 'title' => esc_html__( 'Left', MELA_TD ),
199 'icon' => 'fa fa-align-left',
200 ],
201 'center' => [
202 'title' => esc_html__( 'Center', MELA_TD ),
203 'icon' => 'fa fa-align-center',
204 ],
205 'right' => [
206 'title' => esc_html__( 'Right', MELA_TD ),
207 'icon' => 'fa fa-align-right',
208 ],
209 ],
210 'default' => 'default',
211 'prefix_class' => 'eael-contact-form-align-',
212 ]
213 );
214
215 $this->add_responsive_control(
216 'ma_el_weform_width',
217 [
218 'label' => esc_html__( 'Form Width', MELA_TD ),
219 'type' => Controls_Manager::SLIDER,
220 'size_units' => [ 'px', 'em', '%' ],
221 'range' => [
222 'px' => [
223 'min' => 10,
224 'max' => 1500,
225 ],
226 'em' => [
227 'min' => 1,
228 'max' => 80,
229 ],
230 ],
231 'selectors' => [
232 '{{WRAPPER}} .eael-weform-container' => 'width: {{SIZE}}{{UNIT}};',
233 ],
234 ]
235 );
236
237 $this->add_responsive_control(
238 'ma_el_weform_max_width',
239 [
240 'label' => esc_html__( 'Form Max Width', MELA_TD ),
241 'type' => Controls_Manager::SLIDER,
242 'size_units' => [ 'px', 'em', '%' ],
243 'range' => [
244 'px' => [
245 'min' => 10,
246 'max' => 1500,
247 ],
248 'em' => [
249 'min' => 1,
250 'max' => 80,
251 ],
252 ],
253 'selectors' => [
254 '{{WRAPPER}} .eael-weform-container' => 'max-width: {{SIZE}}{{UNIT}};',
255 ],
256 ]
257 );
258
259
260 $this->add_responsive_control(
261 'ma_el_weform_margin',
262 [
263 'label' => esc_html__( 'Form Margin', MELA_TD ),
264 'type' => Controls_Manager::DIMENSIONS,
265 'size_units' => [ 'px', 'em', '%' ],
266 'selectors' => [
267 '{{WRAPPER}} .eael-weform-container' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
268 ],
269 ]
270 );
271
272 $this->add_responsive_control(
273 'ma_el_weform_padding',
274 [
275 'label' => esc_html__( 'Form Padding', MELA_TD ),
276 'type' => Controls_Manager::DIMENSIONS,
277 'size_units' => [ 'px', 'em', '%' ],
278 'selectors' => [
279 '{{WRAPPER}} .eael-weform-container' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
280 ],
281 ]
282 );
283
284
285 $this->add_control(
286 'ma_el_weform_border_radius',
287 [
288 'label' => esc_html__( 'Border Radius', MELA_TD ),
289 'type' => Controls_Manager::DIMENSIONS,
290 'separator' => 'before',
291 'size_units' => [ 'px' ],
292 'selectors' => [
293 '{{WRAPPER}} .eael-weform-container' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
294 ],
295 ]
296 );
297
298
299 $this->add_group_control(
300 Group_Control_Border::get_type(),
301 [
302 'name' => 'ma_el_weform_border',
303 'selector' => '{{WRAPPER}} .eael-weform-container',
304 ]
305 );
306
307
308 $this->add_group_control(
309 Group_Control_Box_Shadow::get_type(),
310 [
311 'name' => 'ma_el_weform_box_shadow',
312 'selector' => '{{WRAPPER}} .eael-weform-container',
313 ]
314 );
315
316 $this->end_controls_section();
317
318
319
320 $this->start_controls_section(
321 'ma_el_section_weform_field_styles',
322 [
323 'label' => esc_html__( 'Form Fields Styles', MELA_TD ),
324 'tab' => Controls_Manager::TAB_STYLE
325 ]
326 );
327
328 $this->add_control(
329 'ma_el_weform_input_background',
330 [
331 'label' => esc_html__( 'Input Field Background', MELA_TD ),
332 'type' => Controls_Manager::COLOR,
333 'selectors' => [
334 '{{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="text"],
335 {{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="password"],
336 {{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="email"],
337 {{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="url"],
338 {{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="url"],
339 {{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="number"],
340 {{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields textarea' => 'background-color: {{VALUE}};',
341 ],
342 ]
343 );
344
345
346 $this->add_responsive_control(
347 'ma_el_weform_input_width',
348 [
349 'label' => esc_html__( 'Input Width', MELA_TD ),
350 'type' => Controls_Manager::SLIDER,
351 'size_units' => [ 'px', 'em', '%' ],
352 'range' => [
353 'px' => [
354 'min' => 10,
355 'max' => 1500,
356 ],
357 'em' => [
358 'min' => 1,
359 'max' => 80,
360 ],
361 ],
362 'selectors' => [
363 '{{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="text"],
364 {{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="password"],
365 {{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="email"],
366 {{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="url"],
367 {{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="url"],
368 {{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="number"]' => 'width: {{SIZE}}{{UNIT}};',
369 ],
370 ]
371 );
372
373 $this->add_responsive_control(
374 'ma_el_weform_textarea_width',
375 [
376 'label' => esc_html__( 'Textarea Width', MELA_TD ),
377 'type' => Controls_Manager::SLIDER,
378 'size_units' => [ 'px', 'em', '%' ],
379 'range' => [
380 'px' => [
381 'min' => 10,
382 'max' => 1500,
383 ],
384 'em' => [
385 'min' => 1,
386 'max' => 80,
387 ],
388 ],
389 'selectors' => [
390 '{{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields textarea' => 'width: {{SIZE}}{{UNIT}};',
391 ],
392 ]
393 );
394
395 $this->add_responsive_control(
396 'ma_el_weform_input_padding',
397 [
398 'label' => esc_html__( 'Fields Padding', MELA_TD ),
399 'type' => Controls_Manager::DIMENSIONS,
400 'size_units' => [ 'px', 'em', '%' ],
401 'selectors' => [
402 '{{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="text"],
403 {{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="password"],
404 {{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="email"],
405 {{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="url"],
406 {{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="url"],
407 {{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="number"],
408 {{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields textarea' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
409 ],
410 ]
411 );
412
413
414
415 $this->add_control(
416 'ma_el_weform_input_border_radius',
417 [
418 'label' => esc_html__( 'Border Radius', MELA_TD ),
419 'type' => Controls_Manager::DIMENSIONS,
420 'separator' => 'before',
421 'size_units' => [ 'px' ],
422 'selectors' => [
423 '{{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="text"],
424 {{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="password"],
425 {{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="email"],
426 {{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="url"],
427 {{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="url"],
428 {{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="number"],
429 {{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields textarea' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
430 ],
431 ]
432 );
433
434
435 $this->add_group_control(
436 Group_Control_Border::get_type(),
437 [
438 'name' => 'ma_el_weform_input_border',
439 'selector' => '{{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="text"],
440 {{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="password"],
441 {{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="email"],
442 {{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="url"],
443 {{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="url"],
444 {{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="number"],
445 {{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields textarea',
446 ]
447 );
448
449
450 $this->add_group_control(
451 Group_Control_Box_Shadow::get_type(),
452 [
453 'name' => 'ma_el_weform_input_box_shadow',
454 'selector' => '{{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="text"],
455 {{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="password"],
456 {{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="email"],
457 {{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="url"],
458 {{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="url"],
459 {{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="number"],
460 {{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields textarea',
461 ]
462 );
463
464 $this->add_control(
465 'ma_el_weform_focus_heading',
466 [
467 'type' => Controls_Manager::HEADING,
468 'label' => esc_html__( 'Focus State Style', MELA_TD ),
469 'separator' => 'before',
470 ]
471 );
472
473
474 $this->add_group_control(
475 Group_Control_Box_Shadow::get_type(),
476 [
477 'name' => 'ma_el_weform_input_focus_box_shadow',
478 'selector' => '{{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="text"]:focus,
479 {{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="password"]:focus,
480 {{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="email"]:focus,
481 {{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="url"]:focus,
482 {{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="url"]:focus,
483 {{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="number"]:focus,
484 {{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields textarea:focus',
485 ]
486 );
487
488 $this->add_control(
489 'ma_el_weform_input_focus_border',
490 [
491 'label' => esc_html__( 'Border Color', MELA_TD ),
492 'type' => Controls_Manager::COLOR,
493 'selectors' => [
494 '{{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="text"]:focus,
495 {{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="password"]:focus,
496 {{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="email"]:focus,
497 {{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="url"]:focus,
498 {{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="url"]:focus,
499 {{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="number"]:focus,
500 {{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields textarea:focus' => 'border-color: {{VALUE}};',
501 ],
502 ]
503 );
504
505
506
507 $this->end_controls_section();
508
509
510 $this->start_controls_section(
511 'ma_el_section_weform_typography',
512 [
513 'label' => esc_html__( 'Color & Typography', MELA_TD ),
514 'tab' => Controls_Manager::TAB_STYLE
515 ]
516 );
517
518
519 $this->add_control(
520 'ma_el_weform_label_color',
521 [
522 'label' => esc_html__( 'Label Color', MELA_TD ),
523 'type' => Controls_Manager::COLOR,
524 'selectors' => [
525 '{{WRAPPER}} .eael-weform-container, {{WRAPPER}} .eael-weform-container .wpuf-label label' => 'color: {{VALUE}};',
526 ],
527 ]
528 );
529
530 $this->add_control(
531 'ma_el_weform_field_color',
532 [
533 'label' => esc_html__( 'Field Font Color', MELA_TD ),
534 'type' => Controls_Manager::COLOR,
535 'selectors' => [
536 '{{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="text"],
537 {{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="password"],
538 {{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="email"],
539 {{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="url"],
540 {{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="url"],
541 {{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="number"],
542 {{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields textarea' => 'color: {{VALUE}};',
543 ],
544 ]
545 );
546
547 $this->add_control(
548 'ma_el_weform_placeholder_color',
549 [
550 'label' => esc_html__( 'Placeholder Font Color', MELA_TD ),
551 'type' => Controls_Manager::COLOR,
552 'selectors' => [
553 '{{WRAPPER}} .eael-weform-container ::-webkit-input-placeholder' => 'color: {{VALUE}};',
554 '{{WRAPPER}} .eael-weform-container ::-moz-placeholder' => 'color: {{VALUE}};',
555 '{{WRAPPER}} .eael-weform-container ::-ms-input-placeholder' => 'color: {{VALUE}};',
556 ],
557 ]
558 );
559
560
561 $this->add_control(
562 'ma_el_weform_label_heading',
563 [
564 'type' => Controls_Manager::HEADING,
565 'label' => esc_html__( 'Label Typography', MELA_TD ),
566 'separator' => 'before',
567 ]
568 );
569
570 $this->add_group_control(
571 Group_Control_Typography::get_type(),
572 [
573 'name' => 'ma_el_weform_label_typography',
574 'selector' => '{{WRAPPER}} .eael-weform-container, {{WRAPPER}} .eael-weform-container .wpuf-label label',
575 ]
576 );
577
578
579 $this->add_control(
580 'ma_el_weform_heading_input_field',
581 [
582 'type' => Controls_Manager::HEADING,
583 'label' => esc_html__( 'Input Fields Typography', MELA_TD ),
584 'separator' => 'before',
585 ]
586 );
587
588 $this->add_group_control(
589 Group_Control_Typography::get_type(),
590 [
591 'name' => 'ma_el_weform_input_field_typography',
592 'selector' => '{{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="text"],
593 {{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="password"],
594 {{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="email"],
595 {{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="url"],
596 {{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="url"],
597 {{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="number"],
598 {{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields textarea',
599 ]
600 );
601
602 $this->end_controls_section();
603
604
605
606 $this->start_controls_section(
607 'ma_el_section_weform_submit_button_styles',
608 [
609 'label' => esc_html__( 'Submit Button Styles', MELA_TD ),
610 'tab' => Controls_Manager::TAB_STYLE
611 ]
612 );
613
614 $this->add_responsive_control(
615 'ma_el_weform_submit_btn_width',
616 [
617 'label' => esc_html__( 'Button Width', MELA_TD ),
618 'type' => Controls_Manager::SLIDER,
619 'size_units' => [ 'px', 'em', '%' ],
620 'range' => [
621 'px' => [
622 'min' => 10,
623 'max' => 1500,
624 ],
625 'em' => [
626 'min' => 1,
627 'max' => 80,
628 ],
629 ],
630 'selectors' => [
631 '{{WRAPPER}} .eael-weform-container ul.wpuf-form .wpuf-submit input[type="submit"]' => 'width: {{SIZE}}{{UNIT}};',
632 ],
633 ]
634 );
635
636 $this->add_responsive_control(
637 'ma_el_weform_submit_btn_alignment',
638 [
639 'label' => esc_html__( 'Button Alignment', MELA_TD ),
640 'type' => Controls_Manager::CHOOSE,
641 'label_block' => true,
642 'options' => [
643 'default' => [
644 'title' => __( 'Default', MELA_TD ),
645 'icon' => 'fa fa-ban',
646 ],
647 'left' => [
648 'title' => esc_html__( 'Left', MELA_TD ),
649 'icon' => 'fa fa-align-left',
650 ],
651 'center' => [
652 'title' => esc_html__( 'Center', MELA_TD ),
653 'icon' => 'fa fa-align-center',
654 ],
655 'right' => [
656 'title' => esc_html__( 'Right', MELA_TD ),
657 'icon' => 'fa fa-align-right',
658 ],
659 ],
660 'default' => 'default',
661 'prefix_class' => 'eael-contact-form-btn-align-',
662 ]
663 );
664
665 $this->add_group_control(
666 Group_Control_Typography::get_type(),
667 [
668 'name' => 'ma_el_weform_submit_btn_typography',
669 'scheme' => Scheme_Typography::TYPOGRAPHY_1,
670 'selector' => '{{WRAPPER}} .eael-weform-container ul.wpuf-form .wpuf-submit input[type="submit"]',
671 ]
672 );
673
674 $this->add_responsive_control(
675 'ma_el_weform_submit_btn_margin',
676 [
677 'label' => esc_html__( 'Margin', MELA_TD ),
678 'type' => Controls_Manager::DIMENSIONS,
679 'size_units' => [ 'px', 'em', '%' ],
680 'selectors' => [
681 '{{WRAPPER}} .eael-weform-container ul.wpuf-form .wpuf-submit input[type="submit"]' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
682 ],
683 ]
684 );
685
686
687 $this->add_responsive_control(
688 'ma_el_weform_submit_btn_padding',
689 [
690 'label' => esc_html__( 'Padding', MELA_TD ),
691 'type' => Controls_Manager::DIMENSIONS,
692 'size_units' => [ 'px', 'em', '%' ],
693 'selectors' => [
694 '{{WRAPPER}} .eael-weform-container ul.wpuf-form .wpuf-submit input[type="submit"]' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
695 ],
696 ]
697 );
698
699
700
701 $this->start_controls_tabs( 'ma_el_weform_submit_button_tabs' );
702
703 $this->start_controls_tab( 'normal', [ 'label' => esc_html__( 'Normal', MELA_TD ) ] );
704
705 $this->add_control(
706 'ma_el_weform_submit_btn_text_color',
707 [
708 'label' => esc_html__( 'Text Color', MELA_TD ),
709 'type' => Controls_Manager::COLOR,
710 'selectors' => [
711 '{{WRAPPER}} .eael-weform-container ul.wpuf-form .wpuf-submit input[type="submit"]' => 'color: {{VALUE}};',
712 ],
713 ]
714 );
715
716
717
718 $this->add_control(
719 'ma_el_weform_submit_btn_background_color',
720 [
721 'label' => esc_html__( 'Background Color', MELA_TD ),
722 'type' => Controls_Manager::COLOR,
723 'selectors' => [
724 '{{WRAPPER}} .eael-weform-container ul.wpuf-form .wpuf-submit input[type="submit"]' => 'background-color: {{VALUE}};',
725 ],
726 ]
727 );
728
729 $this->add_group_control(
730 Group_Control_Border::get_type(),
731 [
732 'name' => 'ma_el_weform_submit_btn_border',
733 'selector' => '{{WRAPPER}} .eael-weform-container ul.wpuf-form .wpuf-submit input[type="submit"]',
734 ]
735 );
736
737 $this->add_control(
738 'ma_el_weform_submit_btn_border_radius',
739 [
740 'label' => esc_html__( 'Border Radius', MELA_TD ),
741 'type' => Controls_Manager::SLIDER,
742 'range' => [
743 'px' => [
744 'max' => 100,
745 ],
746 ],
747 'selectors' => [
748 '{{WRAPPER}} .eael-weform-container ul.wpuf-form .wpuf-submit input[type="submit"]' => 'border-radius: {{SIZE}}px;',
749 ],
750 ]
751 );
752
753
754
755 $this->end_controls_tab();
756
757 $this->start_controls_tab( 'ma_el_weform_submit_btn_hover', [ 'label' => esc_html__( 'Hover', MELA_TD ) ] );
758
759 $this->add_control(
760 'ma_el_weform_submit_btn_hover_text_color',
761 [
762 'label' => esc_html__( 'Text Color', MELA_TD ),
763 'type' => Controls_Manager::COLOR,
764 'selectors' => [
765 '{{WRAPPER}} .eael-weform-container ul.wpuf-form .wpuf-submit input[type="submit"]:hover' => 'color: {{VALUE}};',
766 ],
767 ]
768 );
769
770 $this->add_control(
771 'ma_el_weform_submit_btn_hover_background_color',
772 [
773 'label' => esc_html__( 'Background Color', MELA_TD ),
774 'type' => Controls_Manager::COLOR,
775 'selectors' => [
776 '{{WRAPPER}} .eael-weform-container ul.wpuf-form .wpuf-submit input[type="submit"]:hover' => 'background-color: {{VALUE}};',
777 ],
778 ]
779 );
780
781 $this->add_control(
782 'ma_el_weform_submit_btn_hover_border_color',
783 [
784 'label' => esc_html__( 'Border Color', MELA_TD ),
785 'type' => Controls_Manager::COLOR,
786 'selectors' => [
787 '{{WRAPPER}} .eael-weform-container ul.wpuf-form .wpuf-submit input[type="submit"]:hover' => 'border-color: {{VALUE}};',
788 ],
789 ]
790 );
791
792 $this->end_controls_tab();
793
794 $this->end_controls_tabs();
795
796
797 $this->add_group_control(
798 Group_Control_Box_Shadow::get_type(),
799 [
800 'name' => 'ma_el_weform_submit_btn_box_shadow',
801 'selector' => '{{WRAPPER}} .eael-weform-container ul.wpuf-form .wpuf-submit input[type="submit"]',
802 ]
803 );
804
805
806 $this->end_controls_section();
807
808
809 if ( ma_el_fs()->is_not_paying() ) {
810
811 $this->start_controls_section(
812 'ma_el_section_pro_style_section',
813 [
814 'label' => esc_html__( 'Upgrade to Pro Version for More Features', MELA_TD ),
815 'tab' => Controls_Manager::TAB_STYLE
816 ]
817 );
818
819 $this->add_control(
820 'ma_el_control_get_pro_style_tab',
821 [
822 'label' => esc_html__( 'Unlock more possibilities', MELA_TD ),
823 'type' => Controls_Manager::CHOOSE,
824 'options' => [
825 '1' => [
826 'title' => esc_html__( '', MELA_TD ),
827 'icon' => 'fa fa-unlock-alt',
828 ],
829 ],
830 'default' => '1',
831 'description' => '<span class="pro-feature"> Upgrade to <a href="' . ma_el_fs()->get_upgrade_url() . '" target="_blank">Pro Version</a> for more Elements with
832 Customization Options.</span>'
833 ]
834 );
835
836 $this->end_controls_section();
837 }
838
839
840
841 }
842
843 protected function render( ) {
844
845 $settings = $this->get_settings();
846
847
848 ?>
849
850
851 <?php if ( ! empty( $settings['wpuf_contact_form'] ) ) : ?>
852 <div class="eael-weform-container ma-cf ma-cf-<?php echo
853 $settings['ma_weform_layout_style'];?>">
854 <?php echo do_shortcode( '[weforms id="' . $settings['wpuf_contact_form'] . '" ]' ); ?>
855 </div>
856 <?php endif; ?>
857
858 <?php
859
860 }
861
862
863
864 protected function _content_template() {}
865 }
866
867 Plugin::instance()->widgets_manager->register_widget_type( new Master_Addons_WeForms() );