PluginProbe
Master Addons for Elementor – Elementor Addons, Widgets, Mega Menu Builder, Popup Builder, Widget Builder & Template Kits / 1.0.8
Master Addons for Elementor – Elementor Addons, Widgets, Mega Menu Builder, Popup Builder, Widget Builder & Template Kits v1.0.8
3.2.2 3.2.3 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 All 174 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.0.8, at addons/weforms/weforms.php

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