|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace GeminiLabs\SiteReviews\Integrations\Elementor\Widgets; |
|
4
|
|
|
|
|
5
|
|
|
use Elementor\Controls_Manager; |
|
6
|
|
|
use Elementor\Group_Control_Background; |
|
7
|
|
|
use Elementor\Group_Control_Border; |
|
8
|
|
|
use Elementor\Group_Control_Box_Shadow; |
|
9
|
|
|
use Elementor\Group_Control_Typography; |
|
10
|
|
|
use GeminiLabs\SiteReviews\License; |
|
11
|
|
|
use GeminiLabs\SiteReviews\Shortcodes\SiteReviewsFormShortcode; |
|
12
|
|
|
|
|
13
|
|
|
class ElementorSiteReviewsForm extends ElementorWidget |
|
14
|
|
|
{ |
|
15
|
|
|
public function get_icon(): string |
|
16
|
|
|
{ |
|
17
|
|
|
return 'eicon-glsr-form'; |
|
18
|
|
|
} |
|
19
|
|
|
|
|
20
|
|
|
public static function shortcodeClass(): string |
|
21
|
|
|
{ |
|
22
|
|
|
return SiteReviewsFormShortcode::class; |
|
23
|
|
|
} |
|
24
|
|
|
|
|
25
|
|
|
protected function get_upsale_data(): array |
|
26
|
|
|
{ |
|
27
|
|
|
return [ |
|
28
|
|
|
'condition' => !glsr(License::class)->isPremium(), |
|
29
|
|
|
'description' => esc_html_x('Upgrade to Site Reviews Premium and get a bunch of additional features and professional support.', 'admin-text', 'site-reviews'), |
|
30
|
|
|
'image' => glsr()->url('assets/images/premium.svg'), |
|
31
|
|
|
'image_alt' => esc_attr_x('Upgrade', 'admin-text', 'site-reviews'), |
|
32
|
|
|
'upgrade_text' => esc_html_x('Upgrade Now', 'admin-text', 'site-reviews'), |
|
33
|
|
|
'upgrade_url' => glsr_premium_url('site-reviews-premium'), |
|
34
|
|
|
]; |
|
35
|
|
|
} |
|
36
|
|
|
|
|
37
|
|
|
protected function styleConfig(): array |
|
38
|
|
|
{ |
|
39
|
|
|
return [ |
|
40
|
|
|
'style_col_gap' => [ |
|
41
|
|
|
'is_responsive' => true, |
|
42
|
|
|
'label' => esc_html_x('Column Gap', 'admin-text', 'site-reviews'), |
|
43
|
|
|
'selectors' => [ |
|
44
|
|
|
'{{WRAPPER}}' => '--glsr-form-col-gap: {{SIZE}}{{UNIT}};', |
|
45
|
|
|
], |
|
46
|
|
|
'size_units' => ['px', 'em', 'rem', 'custom'], |
|
47
|
|
|
'type' => Controls_Manager::SLIDER, |
|
48
|
|
|
], |
|
49
|
|
|
'style_row_gap' => [ |
|
50
|
|
|
'is_responsive' => true, |
|
51
|
|
|
'label' => esc_html_x('Row Gap', 'admin-text', 'site-reviews'), |
|
52
|
|
|
'selectors' => [ |
|
53
|
|
|
'{{WRAPPER}}' => '--glsr-form-row-gap: {{SIZE}}{{UNIT}};', |
|
54
|
|
|
], |
|
55
|
|
|
'size_units' => ['px', 'em', 'rem', 'custom'], |
|
56
|
|
|
'type' => Controls_Manager::SLIDER, |
|
57
|
|
|
], |
|
58
|
|
|
'style_rating_separator' => [ |
|
59
|
|
|
'label' => esc_html_x('Rating Field', 'admin-text', 'site-reviews'), |
|
60
|
|
|
'separator' => 'before', |
|
61
|
|
|
'type' => Controls_Manager::HEADING, |
|
62
|
|
|
], |
|
63
|
|
|
'style_rating_color' => [ |
|
64
|
|
|
'label' => esc_html_x('Star Color', 'admin-text', 'site-reviews'), |
|
65
|
|
|
'selectors' => [ |
|
66
|
|
|
'{{WRAPPER}} .glsr:not([data-theme])' => '--glsr-form-star-bg: {{VALUE}};', |
|
67
|
|
|
], |
|
68
|
|
|
'type' => Controls_Manager::COLOR, |
|
69
|
|
|
], |
|
70
|
|
|
'style_rating_size' => [ |
|
71
|
|
|
'is_responsive' => true, |
|
72
|
|
|
'label' => esc_html_x('Star Size', 'admin-text', 'site-reviews'), |
|
73
|
|
|
'selectors' => [ |
|
74
|
|
|
'{{WRAPPER}}' => '--glsr-form-star: {{SIZE}}{{UNIT}};', |
|
75
|
|
|
], |
|
76
|
|
|
'size_units' => ['px', 'em', 'rem', 'custom'], |
|
77
|
|
|
'type' => Controls_Manager::SLIDER, |
|
78
|
|
|
], |
|
79
|
|
|
'style_rating_gap' => [ |
|
80
|
|
|
'is_responsive' => true, |
|
81
|
|
|
'label' => esc_html_x('Star Spacing', 'admin-text', 'site-reviews'), |
|
82
|
|
|
'selectors' => [ |
|
83
|
|
|
'{{WRAPPER}} .glsr-field-rating span[data-rating]' => 'column-gap: {{SIZE}}{{UNIT}};', |
|
84
|
|
|
], |
|
85
|
|
|
'size_units' => ['px', 'em', 'rem', 'custom'], |
|
86
|
|
|
'type' => Controls_Manager::SLIDER, |
|
87
|
|
|
], |
|
88
|
|
|
'style_toggle_separator' => [ |
|
89
|
|
|
'label' => esc_html_x('Toggle Field', 'admin-text', 'site-reviews'), |
|
90
|
|
|
'separator' => 'before', |
|
91
|
|
|
'type' => Controls_Manager::HEADING, |
|
92
|
|
|
], |
|
93
|
|
|
'style_toggle_color' => [ |
|
94
|
|
|
'label' => esc_html_x('Toggle Color', 'admin-text', 'site-reviews'), |
|
95
|
|
|
'selectors' => [ |
|
96
|
|
|
'{{WRAPPER}} .glsr-field-toggle' => '--glsr-toggle-bg-1: {{VALUE}};', |
|
97
|
|
|
], |
|
98
|
|
|
'type' => Controls_Manager::COLOR, |
|
99
|
|
|
], |
|
100
|
|
|
]; |
|
101
|
|
|
} |
|
102
|
|
|
} |
|
103
|
|
|
|