1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace GeminiLabs\SiteReviews\Integrations\WPBakery; |
4
|
|
|
|
5
|
|
|
use GeminiLabs\SiteReviews\Helpers\Cast; |
6
|
|
|
use GeminiLabs\SiteReviews\Modules\Rating; |
7
|
|
|
use GeminiLabs\SiteReviews\Shortcodes\SiteReviewsSummaryShortcode; |
8
|
|
|
|
9
|
|
|
class VcSiteReviewsSummary extends VcShortcode |
10
|
|
|
{ |
11
|
|
|
public static function vcShortcodeClass(): string |
12
|
|
|
{ |
13
|
|
|
return SiteReviewsSummaryShortcode::class; |
14
|
|
|
} |
15
|
|
|
|
16
|
|
|
public static function vcShortcodeIcon(): string |
17
|
|
|
{ |
18
|
|
|
return glsr()->url('assets/images/icons/wpbakery/wpbakery-summary.svg'); |
19
|
|
|
} |
20
|
|
|
|
21
|
|
|
public static function vcShortcodeSettings(): array |
22
|
|
|
{ |
23
|
|
|
return [ |
24
|
|
|
'assigned_posts' => [ |
25
|
|
|
'type' => 'autocomplete', |
26
|
|
|
'heading' => esc_html_x('Limit Reviews by Assigned Pages', 'admin-text', 'site-reviews'), |
27
|
|
|
'param_name' => 'assigned_posts', |
28
|
|
|
'settings' => [ |
29
|
|
|
'multiple' => true, |
30
|
|
|
'sortable' => true, |
31
|
|
|
], |
32
|
|
|
], |
33
|
|
|
'assigned_terms' => [ |
34
|
|
|
'type' => 'autocomplete', |
35
|
|
|
'heading' => esc_html_x('Limit Reviews by Assigned Categories', 'admin-text', 'site-reviews'), |
36
|
|
|
'param_name' => 'assigned_terms', |
37
|
|
|
'settings' => [ |
38
|
|
|
'multiple' => true, |
39
|
|
|
'sortable' => true, |
40
|
|
|
], |
41
|
|
|
], |
42
|
|
|
'assigned_users' => [ |
43
|
|
|
'type' => 'autocomplete', |
44
|
|
|
'heading' => esc_html_x('Limit Reviews by Assigned Users', 'admin-text', 'site-reviews'), |
45
|
|
|
'param_name' => 'assigned_users', |
46
|
|
|
'settings' => [ |
47
|
|
|
'multiple' => true, |
48
|
|
|
'sortable' => true, |
49
|
|
|
], |
50
|
|
|
], |
51
|
|
|
'type' => static::vcTypeOptions(), |
52
|
|
|
'terms' => [ |
53
|
|
|
'type' => 'dropdown', |
54
|
|
|
'heading' => esc_html_x('Limit Reviews by Accepted Terms', 'admin-text', 'site-reviews'), |
55
|
|
|
'param_name' => 'terms', |
56
|
|
|
'std' => '', |
57
|
|
|
'value' => [ |
58
|
|
|
esc_html_x('Select Terms...', 'admin-text', 'site-reviews') => '', |
59
|
|
|
esc_html_x('Terms were accepted', 'admin-text', 'site-reviews') => 'true', |
60
|
|
|
esc_html_x('Terms were not accepted', 'admin-text', 'site-reviews') => 'false', |
61
|
|
|
], |
62
|
|
|
], |
63
|
|
|
'rating' => [ |
64
|
|
|
'type' => 'glsr_type_range', |
65
|
|
|
'heading' => esc_html_x('Minimum Rating', 'admin-text', 'site-reviews'), |
66
|
|
|
'max' => Cast::toInt(glsr()->constant('MAX_RATING', Rating::class)), |
67
|
|
|
'min' => Cast::toInt(glsr()->constant('MIN_RATING', Rating::class)), |
68
|
|
|
'param_name' => 'rating', |
69
|
|
|
'std' => 0, |
70
|
|
|
], |
71
|
|
|
'schema' => [ |
72
|
|
|
'type' => 'checkbox', |
73
|
|
|
'heading' => esc_html_x('Enable the schema?', 'admin-text', 'site-reviews'), |
74
|
|
|
'description' => esc_html_x('The schema should only be enabled once on your page.', 'admin-text', 'site-reviews'), |
75
|
|
|
'param_name' => 'schema', |
76
|
|
|
'value' => [ |
77
|
|
|
esc_html_x('Yes', 'admin-text', 'site-reviews') => 'true', |
78
|
|
|
], |
79
|
|
|
], |
80
|
|
|
'hide' => [ |
81
|
|
|
'type' => 'checkbox', |
82
|
|
|
'heading' => esc_html__('Hide Options', 'site-reviews'), |
83
|
|
|
'param_name' => 'hide', |
84
|
|
|
'value' => array_flip(static::vcShortcode()->getHideOptions()), |
85
|
|
|
], |
86
|
|
|
'id' => [ |
87
|
|
|
'type' => 'textfield', |
88
|
|
|
'heading' => esc_html_x('Custom ID', 'admin-text', 'site-reviews'), |
89
|
|
|
'description' => esc_html_x('This should be a unique value.', 'admin-text', 'site-reviews'), |
90
|
|
|
'param_name' => 'id', |
91
|
|
|
'group' => esc_html_x('Advanced', 'admin-text', 'site-reviews'), |
92
|
|
|
], |
93
|
|
|
'class' => [ |
94
|
|
|
'type' => 'textfield', |
95
|
|
|
'heading' => esc_html_x('Additional CSS classes', 'admin-text', 'site-reviews'), |
96
|
|
|
'description' => esc_html_x('Separate multiple classes with spaces.', 'admin-text', 'site-reviews'), |
97
|
|
|
'param_name' => 'class', |
98
|
|
|
'group' => esc_html_x('Advanced', 'admin-text', 'site-reviews'), |
99
|
|
|
], |
100
|
|
|
]; |
101
|
|
|
} |
102
|
|
|
} |
103
|
|
|
|