PluginProbe
Master Addons for Elementor – Elementor Addons, Widgets, Mega Menu Builder, Popup Builder, Widget Builder & Template Kits / trunk
Master Addons for Elementor – Elementor Addons, Widgets, Mega Menu Builder, Popup Builder, Widget Builder & Template Kits vtrunk
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 / forms / weforms / weforms.php

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

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