PluginProbe
ShopBuilder – WooCommerce Builder For Elementor / 1.1.4
ShopBuilder – WooCommerce Builder For Elementor v1.1.4
3.4.2 3.4.1 3.4.0 2.0.1 2.0.2 2.0.3 2.1.0 2.1.1 2.1.10 2.1.11 2.1.12 2.1.13 2.1.14 2.1.15 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.1.7 2.1.8 2.1.9 2.2.0 2.2.1 2.2.2 All 63 releases
shopbuilder / app / Elementor / Widgets / Controls / ProductTabsSettings.php

ProductTabsSettings.php in ShopBuilder – WooCommerce Builder For Elementor 1.1.4, at app/Elementor/Widgets/Controls/ProductTabsSettings.php

348 lines 10.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 /**
4 * Main ProductDescription class.
5 *
6 * @package RadiusTheme\SB
7 */
8
9 namespace RadiusTheme\SB\Elementor\Widgets\Controls;
10
11 use Elementor\Controls_Manager;
12 use RadiusTheme\SB\Elementor\Helper\ControlHelper;
13
14 // Do not allow directly accessing this file.
15 if ( ! defined( 'ABSPATH' ) ) {
16 exit( 'This script cannot be accessed directly.' );
17 }
18
19 /**
20 * Product Description class
21 */
22 class ProductTabsSettings {
23 /**
24 * Widget Control Selectors
25 *
26 * @var array
27 */
28 private static $selectors = [];
29 /**
30 * Widget Field
31 *
32 * @return array
33 */
34 public static function widget_fields( $widget ) {
35 self::$selectors = $widget->selectors;
36 return self::general() +
37 self::nav_style() +
38 self::tab_content() +
39 self::additional_info() +
40 ReviewsSettings::widget_fields( $widget );
41 }
42 /**
43 * Widget Field
44 *
45 * @return array
46 */
47 public static function general() {
48 $fields = [
49 'general_section' => [
50 'mode' => 'section_start',
51 'label' => esc_html__( 'General', 'shopbuilder' ),
52 ],
53 'layout_style' => [
54 'label' => esc_html__( 'Layout', 'shopbuilder' ),
55 'type' => 'select',
56 'options' => [
57 'default' => esc_html__( 'Default', 'shopbuilder' ),
58 ],
59 'default' => 'default',
60 'separator' => 'default',
61 ],
62 'description' => [
63 'label' => esc_html__( 'Description', 'shopbuilder' ),
64 'type' => 'switch',
65 'description' => esc_html__( 'Switch on to show description.', 'shopbuilder' ),
66 'default' => 'yes',
67 ],
68 'additional_information' => [
69 'label' => esc_html__( 'Additional information', 'shopbuilder' ),
70 'type' => 'switch',
71 'description' => esc_html__( 'Switch on to show Additional information.', 'shopbuilder' ),
72 'default' => 'yes',
73 ],
74 'reviews' => [
75 'label' => esc_html__( 'Reviews', 'shopbuilder' ),
76 'type' => 'switch',
77 'description' => esc_html__( 'Switch on to show Reviews.', 'shopbuilder' ),
78 'default' => '',
79 ],
80 'general_section_end' => [
81 'mode' => 'section_end',
82 ],
83 ];
84 return $fields;
85 }
86 /**
87 * Widget Field
88 *
89 * @return array
90 */
91 public static function nav_style() {
92 $fields = [
93 'nav_style' => [
94 'mode' => 'section_start',
95 'tab' => 'style',
96 'label' => esc_html__( 'Nav Style', 'shopbuilder' ),
97 ],
98 'nav_typography' => [
99 'mode' => 'group',
100 'type' => 'typography',
101 'label' => esc_html__( 'Typography', 'shopbuilder' ),
102 'selector' => self::$selectors['nav_typography'],
103 ],
104 'nav_tabs_start' => [
105 'mode' => 'tabs_start',
106 ],
107 // Tab For normal view.
108 'nav_normal' => [
109 'mode' => 'tab_start',
110 'label' => esc_html__( 'Normal', 'shopbuilder' ),
111 ],
112 'nav_color' => [
113 'label' => esc_html__( 'Menu color', 'shopbuilder' ),
114 'type' => 'color',
115 'separator' => 'default',
116 'selectors' => [
117 self::$selectors['nav_color'] => 'color: {{VALUE}}',
118 ],
119 ],
120 'nav_bg_color' => [
121 'label' => esc_html__( 'Background Color', 'shopbuilder' ),
122 'type' => 'color',
123 'default' => '',
124 'alpha' => true,
125 'selectors' => [
126 self::$selectors['nav_bg_color'] => 'background: {{VALUE}};',
127 ],
128 ],
129
130 'nav_border' => [
131 'mode' => 'group',
132 'type' => 'border',
133 'selector' => self::$selectors['nav_border'],
134 'size_units' => [ 'px' ],
135 ],
136
137 'nav_active_color' => [
138 'label' => esc_html__( 'Active Menu color', 'shopbuilder' ),
139 'type' => 'color',
140 'selectors' => [
141 self::$selectors['nav_active_color'] => 'color: {{VALUE}}',
142 ],
143 ],
144
145 'nav_active_bg_color' => [
146 'label' => esc_html__( 'Active Background Color', 'shopbuilder' ),
147 'type' => 'color',
148 'default' => '',
149 'alpha' => true,
150 'selectors' => [
151 self::$selectors['nav_active_bg_color'] => 'background: {{VALUE}};',
152 ],
153 ],
154
155 'nav_active_border_color' => [
156 'label' => esc_html__( 'Active Border color', 'shopbuilder' ),
157 'type' => 'color',
158 'selectors' => [
159 self::$selectors['nav_active_border_color'] => 'border-color: {{VALUE}}',
160 ],
161 ],
162
163 'nav_normal_end' => [
164 'mode' => 'tab_end',
165 ],
166 'nav_hover' => [
167 'mode' => 'tab_start',
168 'label' => esc_html__( 'Hover', 'shopbuilder' ),
169 ],
170 'nav_hover_color' => [
171 'label' => esc_html__( 'Menu color', 'shopbuilder' ),
172 'type' => 'color',
173
174 'separator' => 'default',
175 'selectors' => [
176 self::$selectors['nav_hover_color'] => 'color: {{VALUE}}',
177 ],
178 ],
179 'nav_hover_bg_color' => [
180 'label' => esc_html__( 'Background Color', 'shopbuilder' ),
181 'type' => 'color',
182 'default' => '',
183
184 'selectors' => [
185 self::$selectors['nav_hover_bg_color'] => 'background: {{VALUE}};',
186 ],
187 ],
188 'nav_active_hover_color' => [
189 'label' => esc_html__( 'Active Menu color', 'shopbuilder' ),
190 'type' => 'color',
191 'selectors' => [
192 self::$selectors['nav_active_hover_color'] => 'color: {{VALUE}}',
193 ],
194 ],
195 'nav_active_hover_bg_color' => [
196 'label' => esc_html__( 'Active Background Color', 'shopbuilder' ),
197 'type' => 'color',
198 'default' => '',
199
200 'selectors' => [
201 self::$selectors['nav_active_hover_bg_color'] => 'background: {{VALUE}};',
202 ],
203 ],
204 'nav_active_hover_border_color' => [
205 'label' => esc_html__( 'Active Border color', 'shopbuilder' ),
206 'type' => 'color',
207 'selectors' => [
208 self::$selectors['nav_active_hover_border_color'] => 'border-bottom-color: {{VALUE}}',
209 ],
210 ],
211 'nav_hover_end' => [
212 'mode' => 'tab_end',
213 ],
214 'nav_tabs_end' => [
215 'mode' => 'tabs_end',
216 ],
217 'nav_padding' => [
218 'label' => esc_html__( 'Padding', 'shopbuilder' ),
219 'type' => 'dimensions',
220 'size_units' => [ 'px' ],
221 'selectors' => [
222 self::$selectors['nav_padding'] => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
223 ],
224 ],
225 'nav_style_end' => [
226 'mode' => 'section_end',
227 ],
228 ];
229 return $fields;
230 }
231
232
233 /**
234 * Widget Field
235 *
236 * @return array
237 */
238 public static function tab_content() {
239 $fields = [
240 'tab_content_style' => [
241 'mode' => 'section_start',
242 'tab' => 'style',
243 'label' => esc_html__( 'Tab Content', 'shopbuilder' ),
244 ],
245 'content_padding' => [
246 'label' => esc_html__( 'Padding', 'shopbuilder' ),
247 'type' => 'dimensions',
248 'separator' => 'default',
249 'size_units' => [ 'px' ],
250 'selectors' => [
251 self::$selectors['content_padding'] => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
252 ],
253 ],
254 'show_title' => [
255 'label' => esc_html__( 'Show title', 'shopbuilder' ),
256 'type' => 'choose',
257 'options' => [
258 'block' => [
259 'title' => esc_html__( 'Show', 'shopbuilder' ),
260 'icon' => 'eicon-check-circle',
261 ],
262 'none' => [
263 'title' => esc_html__( 'Hide', 'shopbuilder' ),
264 'icon' => 'eicon-editor-close',
265 ],
266 ],
267 'default' => 'block',
268 'selectors' => [
269 self::$selectors['show_title'] => 'display: {{VALUE}} !important;',
270 ],
271 ],
272 'tab_title_typography' => [
273 'mode' => 'group',
274 'type' => 'typography',
275 'separator' => 'before',
276 'label' => esc_html__( 'Title Typography', 'shopbuilder' ),
277 'condition' => [
278 'show_title' => 'block',
279 ],
280 'selector' => self::$selectors['tab_title_typography'],
281 ],
282 'tab_title_gap' => [
283 'label' => esc_html__( 'Title Margin', 'shopbuilder' ),
284 'type' => 'dimensions',
285 'size_units' => [ 'px' ],
286 'condition' => [
287 'show_title' => 'block',
288 ],
289 'selectors' => [
290 self::$selectors['tab_title_gap'] => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
291 ],
292 ],
293 'tab_content_title_color' => [
294 'label' => esc_html__( 'Title Color', 'shopbuilder' ),
295 'type' => 'color',
296
297 'selectors' => [
298 self::$selectors['tab_content_title_color'] => 'color: {{VALUE}}',
299 ],
300 'condition' => [
301 'show_title' => 'block',
302 ],
303 ],
304 'tab_content_style_end' => [
305 'mode' => 'section_end',
306 ],
307 ];
308 return $fields;
309 }
310
311 /**
312 * Widget Field
313 *
314 * @return array
315 */
316 public static function additional_info() {
317 $fields = [
318 'additional_info_style' => [
319 'mode' => 'section_start',
320 'tab' => 'style',
321 'label' => esc_html__( 'Additional info', 'shopbuilder' ),
322 'condition' => [
323 'additional_information' => 'yes',
324 ],
325 ],
326 'additional_info_typography' => [
327 'mode' => 'group',
328 'type' => 'typography',
329 'label' => esc_html__( 'Typography', 'shopbuilder' ),
330 'selector' => self::$selectors['additional_info_typography'],
331 ],
332 'attributes_gap' => [
333 'label' => esc_html__( 'Cell Padding', 'shopbuilder' ),
334 'type' => 'dimensions',
335 'size_units' => [ 'px' ],
336 'selectors' => [
337 self::$selectors['attributes_gap'] => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;',
338 ],
339 ],
340 'additional_info_style_end' => [
341 'mode' => 'section_end',
342 ],
343 ];
344 return $fields;
345 }
346
347 }
348