PluginProbe ʕ •ᴥ•ʔ
Premium Addons for Elementor – Powerful Elementor Templates & Widgets / 4.1.0
Premium Addons for Elementor – Powerful Elementor Templates & Widgets v4.1.0
4.11.79 4.11.78 4.11.77 4.11.76 4.11.75 3.20.5 4.11.69 3.20.6 4.11.7 3.20.7 4.11.70 3.20.8 4.11.71 3.20.9 4.11.72 3.21.1 4.11.73 3.21.2 4.11.74 3.21.3 4.11.8 3.21.4 4.11.9 3.21.5 4.2.0 3.21.6 4.2.1 3.3.0 4.2.2 3.3.1 4.2.3 3.3.2 4.2.4 3.3.3 4.2.5 3.3.4 4.2.6 3.3.5 4.2.7 3.3.6 4.2.8 3.3.7 4.2.9 3.3.8 4.3.0 3.3.9 4.3.1 3.4.0 4.3.2 3.4.1 4.3.3 3.4.2 4.3.4 3.4.3 4.3.5 3.4.4 4.3.6 3.4.5 4.3.7 3.4.6 4.3.8 3.4.7 4.3.9 3.4.8 4.4.0 3.4.9 4.4.1 3.5.0 4.4.2 3.5.1 4.4.3 3.5.2 4.4.4 3.5.3 4.4.5 3.5.4 4.4.6 3.5.5 4.4.7 3.5.6 4.4.8 3.5.7 4.4.9 3.5.8 4.5.0 3.5.9 4.5.1 3.6.0 4.5.2 3.6.1 4.5.3 3.6.2 4.5.4 3.6.3 4.5.5 3.6.4 4.5.6 3.6.5 4.5.7 3.6.6 4.5.8 3.6.7 4.5.9 3.6.8 4.6.0 3.6.9 4.6.1 3.7.0 4.7.0 3.7.1 4.7.1 3.7.2 4.7.2 3.7.3 4.7.3 3.7.4 4.7.4 3.7.5 4.7.5 3.7.6 4.7.6 3.7.7 4.7.7 3.7.8 4.7.8 3.7.9 4.7.9 3.8.0 4.8.0 3.8.1 4.8.1 3.8.2 4.8.10 3.8.3 4.8.11 3.8.4 4.8.2 3.8.5 4.8.3 3.8.6 4.8.4 3.8.7 4.8.5 3.8.8 4.8.6 3.8.9 4.8.7 3.9.0 4.8.8 3.9.1 4.8.9 3.9.2 4.9.0 3.9.3 4.9.0-beta1 3.9.4 4.9.0-beta2 3.9.5 4.9.1 3.9.6 4.9.10 3.9.7 4.9.11 3.9.8 4.9.12 3.9.9 4.9.13 4.0.1 4.9.14 4.0.3 4.9.15 4.0.4 4.9.16 4.0.5 4.9.17 4.0.6 4.9.18 4.0.7 4.9.19 4.0.8 4.9.2 4.0.9 4.9.20 4.1.0 4.9.21 4.1.1 4.9.22 4.1.2 4.9.23 4.1.3 4.9.24 trunk 4.1.4 4.9.25 1.0 4.1.5 4.9.26 1.01 4.1.6 4.9.27 1.02 4.1.7 4.9.28 1.03 4.1.8 4.9.29 1.04 4.1.9 4.9.3 1.05 4.10.0 4.9.30 1.06 4.10.1 4.9.31 1.07 4.10.10 4.9.32 1.08 4.10.11 4.9.33 1.09 4.10.12 4.9.34 2.0 4.10.13 4.9.35 2.0.1 4.10.14 4.9.36 2.0.2 4.10.15 4.9.37 2.0.3 4.10.16 4.9.38 2.0.4 4.10.17 4.9.39 2.0.5 4.10.18 4.9.4 2.0.6 4.10.19 4.9.40 2.0.7 4.10.2 4.9.41 2.0.8 4.10.20 4.9.42 2.0.9 4.10.21 4.9.43 2.1.0 4.10.22 4.9.45 2.1.1 4.10.23 4.9.46 2.1.2 4.10.24 4.9.47 2.1.3 4.10.25 4.9.48 2.1.4 4.10.26 4.9.49 2.1.5 4.10.27 4.9.5 2.1.5-beta1 4.10.28 4.9.50 2.1.6 4.10.29 4.9.51 2.1.7 4.10.3 4.9.52 2.1.8 4.10.30 4.9.53 2.1.9 4.10.31 4.9.54 2.2.0 4.10.32 4.9.55 2.2.1 4.10.33 4.9.56 2.2.2 4.10.34 4.9.57 2.2.3 4.10.35 4.9.6 2.2.4 4.10.36 4.9.7 2.2.5 4.10.37 4.9.8 2.2.6 4.10.38 4.9.9 2.2.7 4.10.39 2.2.8 4.10.4 2.2.9 4.10.40 2.3.0 4.10.41 2.3.1 4.10.42 2.3.2 4.10.43 2.3.3 4.10.44 2.3.4 4.10.45 2.3.5 4.10.46 2.3.6 4.10.47 2.3.7 4.10.48 2.3.8 4.10.49 2.3.9 4.10.5 2.4.0 4.10.50 2.4.1 4.10.51 2.5.0 4.10.52 2.5.1 4.10.53 2.5.2 4.10.54 2.5.3 4.10.55 2.5.4 4.10.56 2.5.5 4.10.57 2.5.6 4.10.58 2.5.7 4.10.59 2.5.8 4.10.6 2.5.9 4.10.60 2.6.0 4.10.61 2.6.1 4.10.62 2.6.2 4.10.63 2.6.3 4.10.64 2.6.4 4.10.65 2.6.5 4.10.66 2.6.6 4.10.67 2.6.7 4.10.68 2.6.8 4.10.69 2.6.9 4.10.7 2.7.0 4.10.70 2.7.1 4.10.71 2.7.2 4.10.72 2.7.3 4.10.73 2.7.4 4.10.74 2.7.5 4.10.75 2.7.6 4.10.76 2.7.7 4.10.77 2.7.8 4.10.78 2.7.9 4.10.79 2.8.0 4.10.8 2.8.1 4.10.80 2.8.2 4.10.81 2.8.3 4.10.82 2.8.4 4.10.83 2.8.5 4.10.84 2.8.6 4.10.85 2.8.7 4.10.86 2.8.8 4.10.87 2.8.9 4.10.88 2.9.0 4.10.89 2.9.1 4.10.9 2.9.2 4.10.90 2.9.3 4.11.0 2.9.4 4.11.1 2.9.5 4.11.10 2.9.6 4.11.11 2.9.7 4.11.12 2.9.8 4.11.13 2.9.9 4.11.14 3.0.0 4.11.15 3.0.1 4.11.16 3.0.2 4.11.17 3.0.3 4.11.18 3.0.4 4.11.19 3.0.5 4.11.2 3.0.6 4.11.20 3.0.7 4.11.21 3.0.8 4.11.22 3.0.9 4.11.23 3.1.0 4.11.24 3.1.1 4.11.25 3.1.2 4.11.26 3.1.3 4.11.27 3.1.4 4.11.28 3.1.5 4.11.29 3.1.6 4.11.3 3.1.7 4.11.30 3.1.8 4.11.31 3.1.9 4.11.32 3.10.0 4.11.33 3.10.1 4.11.34 3.10.2 4.11.35 3.10.3 4.11.36 3.10.4 4.11.37 3.10.5 4.11.38 3.10.6 4.11.39 3.10.7 4.11.4 3.10.8 4.11.40 3.10.9 4.11.41 3.11.0 4.11.42 3.11.1 4.11.43 3.11.2 4.11.44 3.11.3 4.11.45 3.11.4 4.11.46 3.11.5 4.11.47 3.11.6 4.11.48 3.11.7 4.11.49 3.11.8 4.11.5 3.11.9 4.11.50 3.12.0 4.11.51 3.12.1 4.11.52 3.12.2 4.11.53 3.12.3 4.11.54 3.2.0 4.11.55 3.2.1 4.11.56 3.2.2 4.11.57 3.2.3 4.11.58 3.2.4 4.11.59 3.2.5 4.11.6 3.2.6 4.11.60 3.2.7 4.11.61 3.2.8 4.11.62 3.2.9 4.11.63 3.20.0 4.11.64 3.20.1 4.11.65 3.20.2 4.11.66 3.20.3 4.11.67 3.20.4 4.11.68
premium-addons-for-elementor / widgets / premium-contactform.php
premium-addons-for-elementor / widgets Last commit date
dep 5 years ago premium-banner.php 5 years ago premium-blog.php 5 years ago premium-button.php 5 years ago premium-carousel.php 5 years ago premium-contactform.php 5 years ago premium-countdown.php 5 years ago premium-counter.php 5 years ago premium-dual-header.php 5 years ago premium-fancytext.php 5 years ago premium-grid.php 5 years ago premium-icon-list.php 5 years ago premium-image-button.php 5 years ago premium-image-scroll.php 5 years ago premium-image-separator.php 5 years ago premium-lottie.php 5 years ago premium-maps.php 5 years ago premium-modalbox.php 5 years ago premium-person.php 5 years ago premium-pricing-table.php 5 years ago premium-progressbar.php 5 years ago premium-testimonials.php 5 years ago premium-title.php 5 years ago premium-videobox.php 5 years ago premium-vscroll.php 5 years ago
premium-contactform.php
623 lines
1 <?php
2
3 /**
4 * Premium Contact Form 7.
5 */
6 namespace PremiumAddons\Widgets;
7
8 // Elementor Classes.
9 use Elementor\Widget_Base;
10 use Elementor\Controls_Manager;
11 use Elementor\Scheme_Color;
12 use Elementor\Scheme_Typography;
13 use Elementor\Group_Control_Border;
14 use Elementor\Group_Control_Typography;
15 use Elementor\Group_Control_Box_Shadow;
16
17 // PremiumAddons Classes.
18 use PremiumAddons\Includes\Helper_Functions;
19
20 if ( ! defined( 'ABSPATH' ) ) exit; // If this file is called directly, abort.
21
22 /**
23 * Class Premium_Contactform
24 */
25 class Premium_Contactform extends Widget_Base {
26
27 public function get_name() {
28 return 'premium-contact-form';
29 }
30
31 public function get_title() {
32 return sprintf( '%1$s %2$s', Helper_Functions::get_prefix(), __('Contact Form7', 'premium-addons-for-elementor') );
33 }
34
35 public function get_icon() {
36 return 'pa-contact-form';
37 }
38
39 public function get_categories() {
40 return array( 'premium-elements' );
41 }
42
43 public function get_style_depends() {
44 return [
45 'premium-addons'
46 ];
47 }
48
49 public function get_script_depends() {
50 return [
51 'premium-addons'
52 ];
53 }
54
55 public function get_custom_help_url() {
56 return 'https://premiumaddons.com/support/';
57 }
58
59 /**
60 * Register Contact Form 7 controls.
61 *
62 * @since 1.0.0
63 * @access protected
64 */
65 protected function _register_controls() {
66
67 $this->start_controls_section('premium_section_wpcf7_form',
68 [
69 'label' => __( 'Contact Form', 'premium-addons-for-elementor' )
70 ]
71 );
72
73
74 $this->add_control('premium_wpcf7_form',
75 [
76 'label' => __( 'Select Your Contact Form', 'premium-addons-for-elementor' ),
77 'label_block' => true,
78 'type' => Controls_Manager::SELECT,
79 'options' => $this->get_wpcf_forms(),
80 ]
81 );
82
83
84 $this->end_controls_section();
85
86 $this->start_controls_section('premium_wpcf7_fields',
87 [
88 'label' => __('Fields', 'premium-addons-for-elementor'),
89 ]
90 );
91
92 $this->add_control('premium_wpcf7_fields_heading',
93 [
94 'label' => __('Width', 'premium-addons-for-elementor'),
95 'type' => Controls_Manager::HEADING
96 ]
97 );
98
99 $this->add_responsive_control('premium_elements_input_width',
100 [
101 'label' => __( 'Input Field', 'premium-addons-for-elementor' ),
102 'type' => Controls_Manager::SLIDER,
103 'size_units' => [ 'px', 'em', '%' ],
104 'range' => [
105 'px' => [
106 'min' => 10,
107 'max' => 1200,
108 ],
109 'em' => [
110 'min' => 1,
111 'max' => 80,
112 ],
113 ],
114 'default' => [
115 'size' => 100,
116 'unit' => '%'
117 ],
118 'selectors' => [
119 '{{WRAPPER}} .premium-cf7-container input.wpcf7-text, {{WRAPPER}} .premium-cf7-container .wpcf7-file' => 'width: {{SIZE}}{{UNIT}};',
120 ],
121 ]
122 );
123
124 $this->add_responsive_control('premium_elements_textarea_width',
125 [
126 'label' => __( 'Text Area', 'premium-addons-for-elementor' ),
127 'type' => Controls_Manager::SLIDER,
128 'size_units' => [ 'px', 'em', '%' ],
129 'range' => [
130 'px' => [
131 'min' => 10,
132 'max' => 1200,
133 ],
134 'em' => [
135 'min' => 1,
136 'max' => 80,
137 ],
138 ],
139 'default' => [
140 'size' => 100,
141 'unit' => '%'
142 ],
143 'selectors' => [
144 '{{WRAPPER}} .premium-cf7-container textarea.wpcf7-textarea' => 'width: {{SIZE}}{{UNIT}};',
145 ],
146 ]
147 );
148
149 $this->add_control('premium_wpcf7_fields_height_heading',
150 [
151 'label' => __('Height', 'premium-addons-for-elementor'),
152 'type' => Controls_Manager::HEADING
153 ]
154 );
155
156 $this->add_responsive_control('premium_elements_input_height',
157 [
158 'label' => __( 'Input Field', 'premium-addons-for-elementor' ),
159 'type' => Controls_Manager::SLIDER,
160 'size_units' => [ 'px', 'em' ],
161 'range' => [
162 'px' => [
163 'min' => 10,
164 'max' => 500,
165 ],
166 'em' => [
167 'min' => 1,
168 'max' => 40,
169 ],
170 ],
171 'selectors' => [
172 '{{WRAPPER}} .premium-cf7-container input.wpcf7-text' => 'height: {{SIZE}}{{UNIT}};',
173 ],
174 ]
175 );
176
177 $this->add_responsive_control('premium_elements_textarea_height',
178 [
179 'label' => __( 'Text Area', 'premium-addons-for-elementor' ),
180 'type' => Controls_Manager::SLIDER,
181 'size_units' => [ 'px', 'em' ],
182 'range' => [
183 'px' => [
184 'min' => 10,
185 'max' => 1200,
186 ],
187 'em' => [
188 'min' => 1,
189 'max' => 80,
190 ],
191 ],
192 'selectors' => [
193 '{{WRAPPER}} .premium-cf7-container textarea.wpcf7-textarea' => 'height: {{SIZE}}{{UNIT}};',
194 ],
195 ]
196 );
197
198 $this->end_controls_section();
199
200 $this->start_controls_section('premium_wpcf7_button',
201 [
202 'label' => __('Button', 'premium-addons-for-elementor'),
203 ]
204 );
205
206 $this->add_responsive_control('premium_elements_button_width',
207 [
208 'label' => __( 'Width', 'premium-addons-for-elementor' ),
209 'type' => Controls_Manager::SLIDER,
210 'size_units' => [ 'px', 'em', '%' ],
211 'range' => [
212 'px' => [
213 'min' => 10,
214 'max' => 1200,
215 ],
216 'em' => [
217 'min' => 1,
218 'max' => 80,
219 ],
220 ],
221 'selectors' => [
222 '{{WRAPPER}} .premium-cf7-container input.wpcf7-submit' => 'width: {{SIZE}}{{UNIT}};',
223 ],
224 ]
225 );
226
227
228 $this->add_responsive_control('premium_elements_button_height',
229 [
230 'label' => __( 'Height', 'premium-addons-for-elementor' ),
231 'type' => Controls_Manager::SLIDER,
232 'size_units' => [ 'px', 'em' ],
233 'range' => [
234 'px' => [
235 'min' => 10,
236 'max' => 500,
237 ],
238 'em' => [
239 'min' => 1,
240 'max' => 40,
241 ],
242 ],
243 'selectors' => [
244 '{{WRAPPER}} .premium-cf7-container input.wpcf7-submit' => 'height: {{SIZE}}{{UNIT}};',
245 ],
246 ]
247 );
248
249 $this->end_controls_section();
250
251 $this->start_controls_section('section_contact_form_styles',
252 [
253 'label' => __( 'Form', 'premium-addons-for-elementor' ),
254 'tab' => Controls_Manager::TAB_STYLE
255 ]
256 );
257
258 $this->add_control('premium_elements_input_background',
259 [
260 'label' => __( 'Input Field Background', 'premium-addons-for-elementor' ),
261 'type' => Controls_Manager::COLOR,
262 'selectors' => [
263 '{{WRAPPER}} .premium-cf7-container input, {{WRAPPER}} .premium-cf7-container textarea' => 'background: {{VALUE}}',
264 ]
265 ]
266 );
267
268 $this->add_responsive_control('premium_elements_input_padding',
269 [
270 'label' => __( 'Padding', 'premium-addons-for-elementor' ),
271 'type' => Controls_Manager::DIMENSIONS,
272 'size_units' => [ 'px', 'em', '%' ],
273 'selectors' => [
274 '{{WRAPPER}} .premium-cf7-container input, {{WRAPPER}} .premium-cf7-container textarea' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
275 ],
276 ]
277 );
278
279 $this->add_group_control(
280 Group_Control_Border::get_type(),
281 [
282 'name' => 'premium_elements_input_border',
283 'selector' => '{{WRAPPER}} .premium-cf7-container input, {{WRAPPER}} .premium-cf7-container textarea',
284 ]
285 );
286
287 $this->add_responsive_control('premium_elements_input_border_radius',
288 [
289 'label' => __( 'Border Radius', 'premium-addons-for-elementor' ),
290 'type' => Controls_Manager::DIMENSIONS,
291 'size_units' => [ 'px' ],
292 'selectors' => [
293 '{{WRAPPER}} .premium-cf7-container input, {{WRAPPER}} .premium-cf7-container textarea' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
294 ],
295 ]
296 );
297
298 $this->add_responsive_control('premium_elements_input_margin',
299 [
300 'label' => __( 'Margin', 'premium-addons-for-elementor' ),
301 'type' => Controls_Manager::DIMENSIONS,
302 'size_units' => [ 'px', 'em', '%' ],
303 'selectors' => [
304 '{{WRAPPER}} .premium-cf7-container input, {{WRAPPER}} .premium-cf7-container textarea' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
305 ],
306 ]
307 );
308
309 $this->add_control('premium_elements_input_focus',
310 [
311 'label' => __( 'Focus Border Color', 'premium-addons-for-elementor' ),
312 'type' => Controls_Manager::COLOR,
313 'selectors' => [
314 '{{WRAPPER}} .premium-cf7-container input.wpcf7-text:focus, {{WRAPPER}} .premium-cf7-container textarea.wpcf7-textarea:focus , {{WRAPPER}} .premium-cf7-container .wpcf7-file:focus' => 'border-color: {{VALUE}};',
315 ],
316 ]
317 );
318
319 $this->add_control('premium_elements_input_focus_border_animation',
320 [
321 'label' => __( 'Focus Border Animation', 'premium-addons-for-elementor' ),
322 'type' => Controls_Manager::SWITCHER,
323 'prefix_class' => 'premium-contact-form-anim-'
324 ]
325 );
326
327 $this->add_control('premium_elements_input_focus_border_color',
328 [
329 'label' => __( 'Focus Line Color', 'premium-addons-for-elementor' ),
330 'type' => Controls_Manager::COLOR,
331 'condition' => [
332 'premium_elements_input_focus_border_animation' => 'yes'
333 ],
334 'selectors' => [
335 '{{WRAPPER}}.premium-contact-form-anim-yes .wpcf7-span.is-focused::after' => 'background-color: {{VALUE}};',
336 ],
337 ]
338 );
339
340 $this->add_group_control(
341 Group_Control_Box_Shadow::get_type(),
342 [
343 'name' => 'input_button_shadow',
344 'selector' => '{{WRAPPER}} .premium-cf7-container input.wpcf7-text, {{WRAPPER}} .premium-cf7-container textarea.wpcf7-textarea, {{WRAPPER}} .premium-cf7-container .wpcf7-file',
345 ]
346 );
347
348 $this->end_controls_section();
349
350
351 $this->start_controls_section('section_contact_form_typography',
352 [
353 'label' => __( 'Labels', 'premium-addons-for-elementor' ),
354 'tab' => Controls_Manager::TAB_STYLE
355 ]
356 );
357
358
359 $this->add_control('premium_elements_heading_default',
360 [
361 'type' => Controls_Manager::HEADING,
362 'label' => __( 'Default Typography', 'premium-addons-for-elementor' ),
363 ]
364 );
365
366 $this->add_control('premium_elements_contact_form_color',
367 [
368 'label' => __( 'Default Font Color', 'premium-addons-for-elementor' ),
369 'type' => Controls_Manager::COLOR,
370 'scheme' => [
371 'type' => Scheme_Color::get_type(),
372 'value' => Scheme_Color::COLOR_1,
373 ],
374 'selectors' => [
375 '{{WRAPPER}} .premium-cf7-container, {{WRAPPER}} .premium-cf7-container label' => 'color: {{VALUE}};',
376 ],
377 ]
378 );
379
380 $this->add_group_control(
381 Group_Control_Typography::get_type(),
382 [
383 'name' => 'premium_elements_contact_form_default_typography',
384 'scheme' => Scheme_Typography::TYPOGRAPHY_1,
385 'selector' => '{{WRAPPER}} .premium-cf7-container',
386 ]
387 );
388
389 $this->add_control('premium_elements_heading_input',
390 [
391 'type' => Controls_Manager::HEADING,
392 'label' => __( 'Input Typography', 'premium-addons-for-elementor' ),
393 'separator' => 'before',
394 ]
395 );
396
397 $this->add_control('premium_elements_contact_form_field_color',
398 [
399 'label' => __( 'Input Text Color', 'premium-addons-for-elementor' ),
400 'type' => Controls_Manager::COLOR,
401 'scheme' => [
402 'type' => Scheme_Color::get_type(),
403 'value' => Scheme_Color::COLOR_1,
404 ],
405 'selectors' => [
406 '{{WRAPPER}} .premium-cf7-container input.wpcf7-text, {{WRAPPER}} .premium-cf7-container textarea.wpcf7-textarea' => 'color: {{VALUE}};',
407 ],
408 ]
409 );
410
411 $this->add_group_control(
412 Group_Control_Typography::get_type(),
413 [
414 'name' => 'premium_elements_contact_form_field_typography',
415 'scheme' => Scheme_Typography::TYPOGRAPHY_1,
416 'selector' => '{{WRAPPER}} .premium-cf7-container input.wpcf7-text, {{WRAPPER}} .premium-cf7-container textarea.wpcf7-textarea',
417 ]
418 );
419
420
421 $this->add_control('premium_elements_contact_form_placeholder_color',
422 [
423 'label' => __( 'Placeholder Color', 'premium-addons-for-elementor' ),
424 'type' => Controls_Manager::COLOR,
425 'selectors' => [
426 '{{WRAPPER}} .premium-cf7-container ::-webkit-input-placeholder' => 'color: {{VALUE}};',
427 '{{WRAPPER}} .premium-cf7-container ::-moz-placeholder' => 'color: {{VALUE}};',
428 '{{WRAPPER}} .premium-cf7-container ::-ms-input-placeholder' => 'color: {{VALUE}};',
429 ],
430 ]
431 );
432
433
434 $this->end_controls_section();
435
436 $this->start_controls_section('section_contact_form_submit_button_styles',
437 [
438 'label' => __( 'Button', 'premium-addons-for-elementor' ),
439 'tab' => Controls_Manager::TAB_STYLE
440 ]
441 );
442
443 $this->add_group_control(
444 Group_Control_Typography::get_type(),
445 [
446 'name' => 'section_title_premium_btn_typography',
447 'scheme' => Scheme_Typography::TYPOGRAPHY_1,
448 'selector' => '{{WRAPPER}} .premium-cf7-container input.wpcf7-submit',
449 ]
450 );
451
452 $this->add_responsive_control('section_title_premium_btn_padding',
453 [
454 'label' => __( 'Padding', 'premium-addons-for-elementor' ),
455 'type' => Controls_Manager::DIMENSIONS,
456 'size_units' => [ 'px', 'em', '%' ],
457 'selectors' => [
458 '{{WRAPPER}} .premium-cf7-container input.wpcf7-submit' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
459 ],
460 ]
461 );
462
463
464
465 $this->start_controls_tabs( 'premium_elements_button_tabs' );
466
467 $this->start_controls_tab( 'normal', [ 'label' => __( 'Normal', 'premium-addons-for-elementor' ) ] );
468
469 $this->add_control('premium_elements_button_text_color',
470 [
471 'label' => __( 'Text Color', 'premium-addons-for-elementor' ),
472 'type' => Controls_Manager::COLOR,
473 'selectors' => [
474 '{{WRAPPER}} .premium-cf7-container input.wpcf7-submit' => 'color: {{VALUE}};',
475 ],
476 ]
477 );
478
479 $this->add_control('premium_elements_button_background_color',
480 [
481 'label' => __( 'Background Color', 'premium-addons-for-elementor' ),
482 'type' => Controls_Manager::COLOR,
483 'scheme' => [
484 'type' => Scheme_Color::get_type(),
485 'value' => Scheme_Color::COLOR_1,
486 ],
487 'selectors' => [
488 '{{WRAPPER}} .premium-cf7-container input.wpcf7-submit' => 'background-color: {{VALUE}};',
489 ],
490 ]
491 );
492
493 $this->add_group_control(
494 Group_Control_Border::get_type(),
495 [
496 'name' => 'premium_elements_btn_border',
497 'selector' => '{{WRAPPER}} .premium-cf7-container input.wpcf7-submit',
498 ]
499 );
500
501 $this->add_responsive_control('premium_elements_btn_border_radius',
502 [
503 'label' => __( 'Border Radius', 'premium-addons-for-elementor' ),
504 'type' => Controls_Manager::SLIDER,
505 'range' => [
506 'px' => [
507 'max' => 100,
508 ],
509 ],
510 'selectors' => [
511 '{{WRAPPER}} .premium-cf7-container input.wpcf7-submit' => 'border-radius: {{SIZE}}px;',
512 ],
513 ]
514 );
515
516 $this->end_controls_tab();
517
518 $this->start_controls_tab('premium_elements_hover',
519 [
520 'label' => __( 'Hover', 'premium-addons-for-elementor' )
521 ]
522 );
523
524 $this->add_control('premium_elements_button_hover_text_color',
525 [
526 'label' => __( 'Text Color', 'premium-addons-for-elementor' ),
527 'type' => Controls_Manager::COLOR,
528 'selectors' => [
529 '{{WRAPPER}} .premium-cf7-container input.wpcf7-submit:hover' => 'color: {{VALUE}};',
530 ],
531 ]
532 );
533
534 $this->add_control('premium_elements_button_hover_background_color',
535 [
536 'label' => __( 'Background Color', 'premium-addons-for-elementor' ),
537 'type' => Controls_Manager::COLOR,
538 'selectors' => [
539 '{{WRAPPER}} .premium-cf7-container input.wpcf7-submit:hover' => 'background-color: {{VALUE}};',
540 ],
541 ]
542 );
543
544 $this->add_control('premium_elements_button_hover_border_color',
545 [
546 'label' => __( 'Border Color', 'premium-addons-for-elementor' ),
547 'type' => Controls_Manager::COLOR,
548 'selectors' => [
549 '{{WRAPPER}} .premium-cf7-container input.wpcf7-submit:hover' => 'border-color: {{VALUE}};',
550 ],
551 ]
552 );
553
554 $this->end_controls_tab();
555
556 $this->end_controls_tabs();
557
558
559 $this->add_group_control(
560 Group_Control_Box_Shadow::get_type(),
561 [
562 'name' => 'button_box_shadow',
563 'selector' => '{{WRAPPER}} .premium-cf7-container input.wpcf7-submit',
564 ]
565 );
566
567 $this->end_controls_section();
568
569
570 }
571
572 protected function get_wpcf_forms() {
573
574 if ( ! class_exists( 'WPCF7_ContactForm' ) ) {
575 return array();
576 }
577
578 $forms = \WPCF7_ContactForm::find( array(
579 'orderby' => 'title',
580 'order' => 'ASC',
581 ) );
582
583 if ( empty( $forms ) ) {
584 return array();
585 }
586
587 $result = array();
588
589 foreach ( $forms as $item ) {
590 $key = sprintf( '%1$s::%2$s', $item->id(), $item->title() );
591 $result[ $key ] = $item->title();
592 }
593
594 return $result;
595 }
596
597 /**
598 * Render Contact Form 7 widget output on the frontend.
599 *
600 * Written in PHP and used to generate the final HTML.
601 *
602 * @since 1.0.0
603 * @access protected
604 */
605 protected function render() {
606
607 $settings = $this->get_settings();
608
609 if ( ! empty( $settings['premium_wpcf7_form'] ) ) {
610
611 $this->add_render_attribute( 'container', 'class', 'premium-cf7-container' );
612
613 ?>
614
615 <div <?php echo $this->get_render_attribute_string( 'container' ); ?>>
616 <?php echo do_shortcode( '[contact-form-7 id="' . $settings['premium_wpcf7_form'] . '" ]' ); ?>
617 </div>
618
619 <?php
620 }
621
622 }
623 }