PluginProbe
Master Addons for Elementor – Elementor Addons, Widgets, Mega Menu Builder, Popup Builder, Widget Builder & Template Kits / 2.0.2
Master Addons for Elementor – Elementor Addons, Widgets, Mega Menu Builder, Popup Builder, Widget Builder & Template Kits v2.0.2
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 2.0.2, at addons/weforms/weforms.php

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