PluginProbe
ShopBuilder – WooCommerce Builder For Elementor / 2.5.3
ShopBuilder – WooCommerce Builder For Elementor v2.5.3
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 / Helper / ControlHelper.php

ControlHelper.php in ShopBuilder – WooCommerce Builder For Elementor 2.5.3, at app/Elementor/Helper/ControlHelper.php

738 lines 21.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * BuilderFns class
4 *
5 * The builder.
6 *
7 * @package RadiusTheme\SB
8 * @since 1.0.0
9 */
10
11 namespace RadiusTheme\SB\Elementor\Helper;
12
13 // Do not allow directly accessing this file.
14 if ( ! defined( 'ABSPATH' ) ) {
15 exit( 'This script cannot be accessed directly.' );
16 }
17
18 /**
19 * BuilderFns class
20 */
21 class ControlHelper {
22 /**
23 * Widget alignment.
24 *
25 * @return array
26 */
27 public static function alignment() {
28 return [
29 'left' => [
30 'title' => esc_html__( 'Left', 'shopbuilder' ),
31 'icon' => 'eicon-text-align-left',
32 ],
33 'center' => [
34 'title' => esc_html__( 'Center', 'shopbuilder' ),
35 'icon' => 'eicon-text-align-center',
36 ],
37 'right' => [
38 'title' => esc_html__( 'Right', 'shopbuilder' ),
39 'icon' => 'eicon-text-align-right',
40 ],
41 'justify' => [
42 'title' => esc_html__( 'Justified', 'shopbuilder' ),
43 'icon' => 'eicon-text-align-justify',
44 ],
45 ];
46 }
47 /**
48 * Widget alignment.
49 *
50 * @return array
51 */
52 public static function flex_alignment() {
53 return [
54 'start' => [
55 'title' => esc_html__( 'Start', 'shopbuilder' ),
56 'icon' => 'eicon-text-align-left',
57 ],
58 'center' => [
59 'title' => esc_html__( 'Center', 'shopbuilder' ),
60 'icon' => 'eicon-text-align-center',
61 ],
62 'end' => [
63 'title' => esc_html__( 'End', 'shopbuilder' ),
64 'icon' => 'eicon-text-align-right',
65 ],
66 ];
67 }
68 /**
69 * Grid Layout Columns
70 *
71 * @return array
72 */
73 public static function layout_columns() {
74 return [
75 0 => esc_html__( 'Layout Default', 'shopbuilder' ),
76 1 => esc_html__( '1 Column', 'shopbuilder' ),
77 2 => esc_html__( '2 Columns', 'shopbuilder' ),
78 3 => esc_html__( '3 Columns', 'shopbuilder' ),
79 4 => esc_html__( '4 Columns', 'shopbuilder' ),
80 5 => esc_html__( '5 Columns', 'shopbuilder' ),
81 6 => esc_html__( '6 Columns', 'shopbuilder' ),
82 7 => esc_html__( '7 Columns', 'shopbuilder' ),
83 8 => esc_html__( '8 Columns', 'shopbuilder' ),
84 ];
85 }
86
87 /**
88 * Grid Layouts
89 *
90 * @return array
91 */
92 public static function grid_layouts() {
93 $status = ! rtsb()->has_pro();
94
95 return apply_filters(
96 'rtsb/elements/elementor/grid_layouts',
97 [
98 'grid-layout1' => [
99 'title' => esc_html__( 'Grid Layout 1', 'shopbuilder' ),
100 'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/grid-Layout-1.png' ) ),
101 ],
102
103 'grid-layout2' => [
104 'title' => esc_html__( 'Grid Layout 2', 'shopbuilder' ),
105 'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/grid-Layout-2.png' ) ),
106 ],
107
108 'grid-layout3' => [
109 'title' => esc_html__( 'Grid Layout 3', 'shopbuilder' ),
110 'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/grid-style-3.png' ) ),
111 'is_pro' => $status,
112 ],
113 'grid-layout4' => [
114 'title' => esc_html__( 'Grid Layout 4', 'shopbuilder' ),
115 'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/grid-style-4.png' ) ),
116 'is_pro' => $status,
117 ],
118 'grid-layout5' => [
119 'title' => esc_html__( 'Grid Layout 5', 'shopbuilder' ),
120 'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/grid-style-5.png' ) ),
121 'is_pro' => $status,
122 ],
123 'grid-layout6' => [
124 'title' => esc_html__( 'Grid Layout 6', 'shopbuilder' ),
125 'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/grid-style-6.png' ) ),
126 'is_pro' => $status,
127 ],
128 'grid-layout7' => [
129 'title' => esc_html__( 'Grid Layout 7', 'shopbuilder' ),
130 'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/grid-style-7.png' ) ),
131 'is_pro' => $status,
132 ],
133 'grid-layout8' => [
134 'title' => esc_html__( 'Grid Layout 8', 'shopbuilder' ),
135 'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/grid-style-8.png' ) ),
136 'is_pro' => $status,
137 ],
138 'grid-layout9' => [
139 'title' => esc_html__( 'Special Layout 1', 'shopbuilder' ),
140 'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/grid-style-9a.png' ) ),
141 'is_pro' => $status,
142 ],
143 ]
144 );
145 }
146
147 /**
148 * Single Product Tab Layouts
149 *
150 * @return array
151 */
152 public static function single_product_tab_layouts() {
153 $status = ! rtsb()->has_pro();
154
155 return apply_filters(
156 'rtsb/elements/elementor/single_product_tab_layouts',
157 [
158 'default' => [
159 'title' => esc_html__( 'Default Layout', 'shopbuilder' ),
160 'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/tab-01.png' ) ),
161 ],
162 'custom-layout1' => [
163 'title' => esc_html__( 'Accordion Layout', 'shopbuilder' ),
164 'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/tab-02.png' ) ),
165 'is_pro' => $status,
166 ],
167 'custom-layout2' => [
168 'title' => esc_html__( 'Tab Layout', 'shopbuilder' ),
169 'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/tab-03.png' ) ),
170 'is_pro' => $status,
171 ],
172 ]
173 );
174 }
175
176 /**
177 * Multi Step Checkout Layouts
178 *
179 * @return array
180 */
181 public static function multi_step_checkout_layouts() {
182 $status = ! rtsb()->has_pro();
183
184 return apply_filters(
185 'rtsb/elements/elementor/single_product_tab_layouts',
186 [
187 'layout1' => [
188 'title' => esc_html__( 'Layout 1', 'shopbuilder' ),
189 'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/tab-01.png' ) ),
190 ],
191
192 ]
193 );
194 }
195
196 /**
197 * Single Advanced Product Tab Layouts
198 *
199 * @return array
200 */
201 public static function single_advanced_product_tab_layouts() {
202 // TODO:: Check If the FUnction Used Or Not.
203 return apply_filters(
204 'rtsb/elements/elementor/single_advanced_product_tab_layouts',
205 [
206 'default' => [
207 'title' => esc_html__( 'Default Layout', 'shopbuilder' ),
208 'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/tab-01.png' ) ),
209 ],
210 'custom-layout1' => [
211 'title' => esc_html__( 'Accordion Layout', 'shopbuilder' ),
212 'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/tab-02.png' ) ),
213 ],
214 'custom-layout2' => [
215 'title' => esc_html__( 'Tab Layout', 'shopbuilder' ),
216 'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/tab-03.png' ) ),
217 ],
218 ]
219 );
220 }
221
222 /**
223 * Slider Layouts
224 *
225 * @return array
226 */
227 public static function slider_layouts() {
228 $status = ! rtsb()->has_pro();
229
230 return apply_filters(
231 'rtsb/elements/elementor/slider_layouts',
232 [
233 'slider-layout1' => [
234 'title' => esc_html__( 'Slider Layout 1', 'shopbuilder' ),
235 'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/grid-Layout-1.png' ) ),
236 ],
237
238 'slider-layout2' => [
239 'title' => esc_html__( 'Slider Layout 2', 'shopbuilder' ),
240 'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/grid-Layout-2.png' ) ),
241 ],
242
243 'slider-layout3' => [
244 'title' => esc_html__( 'Slider Layout 3', 'shopbuilder' ),
245 'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/slider-style-3.png' ) ),
246 'is_pro' => $status,
247 ],
248
249 'slider-layout4' => [
250 'title' => esc_html__( 'Slider Layout 4', 'shopbuilder' ),
251 'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/slider-style-4.png' ) ),
252 'is_pro' => $status,
253 ],
254 'slider-layout5' => [
255 'title' => esc_html__( 'Slider Layout 5', 'shopbuilder' ),
256 'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/slider-style-5.png' ) ),
257 'is_pro' => $status,
258 ],
259 'slider-layout6' => [
260 'title' => esc_html__( 'Slider Layout 6', 'shopbuilder' ),
261 'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/slider-style-6.png' ) ),
262 'is_pro' => $status,
263 ],
264 'slider-layout7' => [
265 'title' => esc_html__( 'Slider Layout 7', 'shopbuilder' ),
266 'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/slider-style-7.png' ) ),
267 'is_pro' => $status,
268 ],
269 'slider-layout8' => [
270 'title' => esc_html__( 'Slider Layout 8', 'shopbuilder' ),
271 'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/list-style-6.png' ) ),
272 'is_pro' => $status,
273 ],
274 'slider-layout9' => [
275 'title' => esc_html__( 'Slider Layout 9', 'shopbuilder' ),
276 'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/grid-style-8.png' ) ),
277 'is_pro' => $status,
278 ],
279 ]
280 );
281 }
282
283 /**
284 * List Layouts
285 *
286 * @return array
287 */
288 public static function list_layouts() {
289 $status = ! rtsb()->has_pro();
290
291 return apply_filters(
292 'rtsb/elements/elementor/list_layouts',
293 [
294 'list-layout1' => [
295 'title' => esc_html__( 'List Layout 1', 'shopbuilder' ),
296 'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/list-Layout-1.png' ) ),
297 ],
298 'list-layout2' => [
299 'title' => esc_html__( 'List Layout 2', 'shopbuilder' ),
300 'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/list-Layout-2.png' ) ),
301 ],
302 'list-layout3' => [
303 'title' => esc_html__( 'List Layout 3', 'shopbuilder' ),
304 'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/list-style-3.png' ) ),
305 'is_pro' => $status,
306 ],
307 'list-layout4' => [
308 'title' => esc_html__( 'List Layout 4', 'shopbuilder' ),
309 'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/list-style-4.png' ) ),
310 'is_pro' => $status,
311 ],
312 'list-layout5' => [
313 'title' => esc_html__( 'List Layout 5', 'shopbuilder' ),
314 'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/list-style-5.png' ) ),
315 'is_pro' => $status,
316 ],
317 'list-layout6' => [
318 'title' => esc_html__( 'List Layout 6', 'shopbuilder' ),
319 'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/list-style-6.png' ) ),
320 'is_pro' => $status,
321 ],
322 'list-layout7' => [
323 'title' => esc_html__( 'List Layout 7', 'shopbuilder' ),
324 'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/list-style-7.png' ) ),
325 'is_pro' => $status,
326 ],
327 ]
328 );
329 }
330
331 /**
332 * Category Layouts
333 *
334 * @return array
335 */
336 public static function category_layouts() {
337 $status = ! rtsb()->has_pro();
338
339 return apply_filters(
340 'rtsb/elements/elementor/category_layouts',
341 [
342 'category-layout1' => [
343 'title' => esc_html__( 'Category Layout 1', 'shopbuilder' ),
344 'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/categories-1.png' ) ),
345 ],
346
347 'category-layout2' => [
348 'title' => esc_html__( 'Category Layout 2', 'shopbuilder' ),
349 'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/categories-2.png' ) ),
350 ],
351 'category-layout3' => [
352 'title' => esc_html__( 'Category Layout 3', 'shopbuilder' ),
353 'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/categories-3.png' ) ),
354 'is_pro' => $status,
355 ],
356 'category-layout4' => [
357 'title' => esc_html__( 'Category Layout 4', 'shopbuilder' ),
358 'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/categories-3.png' ) ),
359 'is_pro' => $status,
360 ],
361
362 ]
363 );
364 }
365
366 /**
367 * Category Layouts
368 *
369 * @return array
370 */
371 public static function share_layouts() {
372 $status = ! rtsb()->has_pro();
373
374 return apply_filters(
375 'rtsb/elements/elementor/share_layouts',
376 [
377 'share-layout1' => [
378 'title' => esc_html__( 'Social Share Preset 1', 'shopbuilder' ),
379 'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/share-preset-1.png' ) ),
380 ],
381
382 'share-layout2' => [
383 'title' => esc_html__( 'Social Share Preset 2', 'shopbuilder' ),
384 'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/share-preset-2.png' ) ),
385 ],
386
387 // TODO: Will be activated later.
388 // 'share-layout3' => [
389 // 'title' => esc_html__( 'Social Share Preset 3', 'shopbuilder' ),
390 // 'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/share-preset-1.png' ) ),
391 // 'is_pro' => $status,
392 // ],
393 ]
394 );
395 }
396
397 /**
398 * Action Button Presets
399 *
400 * @return array
401 */
402 public static function action_btn_presets() {
403
404 return apply_filters(
405 'rtsb/elements/elementor/action_btn_presets',
406 [
407 'preset1' => [
408 'title' => esc_html__( 'Preset 1', 'shopbuilder' ),
409 'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/action-preset-1.jpg' ) ),
410 ],
411
412 'preset2' => [
413 'title' => esc_html__( 'Preset 2', 'shopbuilder' ),
414 'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/action-preset-2.jpg' ) ),
415 ],
416
417 'preset3' => [
418 'title' => esc_html__( 'Preset 3', 'shopbuilder' ),
419 'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/action-preset-3.jpg' ) ),
420 ],
421 'preset4' => [
422 'title' => esc_html__( 'Preset 4', 'shopbuilder' ),
423 'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/action-preset-4.jpg' ) ),
424 ],
425 'preset5' => [
426 'title' => esc_html__( 'Preset 5', 'shopbuilder' ),
427 'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/action-preset-5.jpg' ) ),
428 'is_pro' => ! rtsb()->has_pro(),
429 ],
430 'preset6' => [
431 'title' => esc_html__( 'Preset 6', 'shopbuilder' ),
432 'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/action-preset-6.jpg' ) ),
433 'is_pro' => ! rtsb()->has_pro(),
434 ],
435 ]
436 );
437 }
438
439 /**
440 * Badge Presets
441 *
442 * @return array
443 */
444 public static function badge_presets() {
445 $status = ! rtsb()->has_pro();
446
447 return apply_filters(
448 'rtsb/elements/elementor/badge_presets',
449 [
450 'preset1' => [
451 'title' => esc_html__( 'Preset 1', 'shopbuilder' ),
452 'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/badge-preset-1.png' ) ),
453 ],
454
455 'preset2' => [
456 'title' => esc_html__( 'Preset 2', 'shopbuilder' ),
457 'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/badge-preset-2.png' ) ),
458 ],
459
460 'preset3' => [
461 'title' => esc_html__( 'Preset 3', 'shopbuilder' ),
462 'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/badge-preset-3.png' ) ),
463 ],
464
465 'preset4' => [
466 'title' => esc_html__( 'Preset 4', 'shopbuilder' ),
467 'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/badge-preset-4.png' ) ),
468 ],
469 ]
470 );
471 }
472
473 /**
474 * Single Category Layouts
475 *
476 * @return array
477 */
478 public static function single_category_layouts() {
479 $status = ! rtsb()->has_pro();
480
481 return apply_filters(
482 'rtsb/elements/elementor/category_single_layouts',
483 [
484 'category-single-layout1' => [
485 'title' => esc_html__( 'Single Category Layout 1', 'shopbuilder' ),
486 'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/single-category-1.png' ) ),
487 ],
488
489 'category-single-layout2' => [
490 'title' => esc_html__( 'Single Category Layout 2', 'shopbuilder' ),
491 'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/single-category-2.png' ) ),
492 'is_pro' => $status,
493 ],
494 ]
495 );
496 }
497
498 /**
499 * Posts Order By.
500 *
501 * @return array
502 */
503 public static function posts_order_by() {
504 return [
505 'ID' => esc_html__( 'Product ID', 'shopbuilder' ),
506 'title' => esc_html__( 'Product Title', 'shopbuilder' ),
507 'price' => esc_html__( 'Product Price', 'shopbuilder' ),
508 'date' => esc_html__( 'Date', 'shopbuilder' ),
509 'menu_order' => esc_html__( 'Menu Order', 'shopbuilder' ),
510 'rand' => esc_html__( 'Random', 'shopbuilder' ),
511 ];
512 }
513
514 /**
515 * Categories Order By.
516 *
517 * @return array
518 */
519 public static function cats_order_by() {
520 return [
521 'id' => esc_html__( 'Category IDs', 'shopbuilder' ),
522 'name' => esc_html__( 'Category Name', 'shopbuilder' ),
523 'count' => esc_html__( 'Product Count', 'shopbuilder' ),
524 'menu_order' => esc_html__( 'Menu Order', 'shopbuilder' ),
525 ];
526 }
527
528 /**
529 * Posts Order By.
530 *
531 * @return array
532 */
533 public static function posts_order() {
534 return [
535 'ASC' => esc_html__( 'Ascending', 'shopbuilder' ),
536 'DESC' => esc_html__( 'Descending', 'shopbuilder' ),
537 ];
538 }
539
540 /**
541 * Filter products
542 *
543 * @return array
544 */
545 public static function filter_products() {
546 return [
547 'recent' => esc_html__( 'Default', 'shopbuilder' ),
548 'featured' => esc_html__( 'Featured Products', 'shopbuilder' ),
549 'best-selling' => esc_html__( 'Best Selling Products', 'shopbuilder' ),
550 'sale' => esc_html__( 'On Sale Products', 'shopbuilder' ),
551 'top-rated' => esc_html__( 'Top Rated Products', 'shopbuilder' ),
552 'recently-viewed' => esc_html__( 'Recently Viewed Products', 'shopbuilder' ),
553 ];
554 }
555
556 /**
557 * Pagination options
558 *
559 * @return array
560 */
561 public static function pagination_options() {
562 return apply_filters(
563 'rtsb/elementor/pagination_options',
564 [
565 'pagination' => esc_html__( 'Number Pagination', 'shopbuilder' ),
566 ]
567 );
568 }
569
570 /**
571 * Heading Tags
572 *
573 * @return array
574 */
575 public static function heading_tags() {
576 return [
577 'h1' => esc_html__( 'H1', 'shopbuilder' ),
578 'h2' => esc_html__( 'H2', 'shopbuilder' ),
579 'h3' => esc_html__( 'H3', 'shopbuilder' ),
580 'h4' => esc_html__( 'H4', 'shopbuilder' ),
581 'h5' => esc_html__( 'H5', 'shopbuilder' ),
582 'h6' => esc_html__( 'H6', 'shopbuilder' ),
583 'p' => esc_html__( 'p', 'shopbuilder' ),
584 'div' => esc_html__( 'div', 'shopbuilder' ),
585 'span' => esc_html__( 'span', 'shopbuilder' ),
586 ];
587 }
588
589 /**
590 * General Style Section
591 *
592 * @param string $id_prefix Section id prefix.
593 * @param string $title Section title.
594 * @param object $obj Reference object.
595 * @param array $condition Condition.
596 * @param array $selectors CSS electors.
597 * @param array $conditions Conditions.
598 *
599 * @return array
600 */
601 public static function general_elementor_style( $id_prefix, $title, $obj, $condition, $selectors, $conditions = [] ) {
602 $prefix = str_replace( ' ', '_', strtolower( $id_prefix ) ) . '_';
603
604 $fields[ $prefix . 'style_section' ] = $obj->start_section(
605 esc_html( $title ),
606 'style',
607 $conditions,
608 $condition
609 );
610
611 $fields[ $prefix . 'typo_note' ] = $obj->el_heading( esc_html__( 'Typography', 'shopbuilder' ), 'default' );
612
613 $fields[ 'rtsb_el_' . $prefix . 'typography' ] = [
614 'mode' => 'group',
615 'type' => 'typography',
616 'selector' => ! empty( $selectors['typography'] ) ? $selectors['typography'] : [],
617 ];
618
619 $fields[ $prefix . 'alignment' ] = [
620 'mode' => 'responsive',
621 'type' => 'choose',
622 'label' => esc_html__( 'Alignment', 'shopbuilder' ),
623 'options' => [
624 'left' => [
625 'title' => esc_html__( 'Left', 'shopbuilder' ),
626 'icon' => 'eicon-text-align-left',
627 ],
628 'center' => [
629 'title' => esc_html__( 'Center', 'shopbuilder' ),
630 'icon' => 'eicon-text-align-center',
631 ],
632 'right' => [
633 'title' => esc_html__( 'Right', 'shopbuilder' ),
634 'icon' => 'eicon-text-align-right',
635 ],
636 ],
637 'selectors' => ! empty( $selectors['alignment'] ) ? $selectors['alignment'] : [],
638 ];
639
640 $fields[ $prefix . 'color_note' ] = $obj->el_heading( esc_html__( 'Colors', 'shopbuilder' ), 'before' );
641
642 $fields[ $prefix . 'color_tabs' ] = $obj->start_tab_group();
643 $fields[ $prefix . 'color_tab' ] = $obj->start_tab( esc_html__( 'Normal', 'shopbuilder' ) );
644
645 $fields[ $prefix . 'color' ] = [
646 'type' => 'color',
647 'label' => esc_html__( 'Color', 'shopbuilder' ),
648 'selectors' => ! empty( $selectors['color'] ) ? $selectors['color'] : [],
649 'separator' => 'default',
650 ];
651
652 $fields[ $prefix . 'bg_color' ] = [
653 'type' => 'color',
654 'label' => esc_html__( 'Background Color', 'shopbuilder' ),
655 'selectors' => ! empty( $selectors['bg_color'] ) ? $selectors['bg_color'] : [],
656 'separator' => 'default',
657 ];
658
659 $fields[ $prefix . 'color_tab_end' ] = $obj->end_tab();
660 $fields[ $prefix . 'hover_color_tab' ] = $obj->start_tab( esc_html__( 'Hover', 'shopbuilder' ) );
661
662 $fields[ $prefix . 'hover_color' ] = [
663 'type' => 'color',
664 'label' => esc_html__( 'Hover Color', 'shopbuilder' ),
665 'selectors' => ! empty( $selectors['hover_color'] ) ? $selectors['hover_color'] : [],
666 'separator' => 'default',
667 ];
668
669 $fields[ $prefix . 'hover_bg_color' ] = [
670 'type' => 'color',
671 'label' => esc_html__( 'Hover Background Color', 'shopbuilder' ),
672 'selectors' => ! empty( $selectors['hover_bg_color'] ) ? $selectors['hover_bg_color'] : [],
673 'separator' => 'default',
674 ];
675
676 $fields[ $prefix . 'hover_color_tab_end' ] = $obj->end_tab();
677 $fields[ $prefix . 'color_tabs_end' ] = $obj->end_tab_group();
678
679 $fields[ $prefix . 'border_note' ] = $obj->el_heading( esc_html__( 'Border', 'shopbuilder' ), 'before' );
680
681 $fields[ 'rtsb_el_' . $prefix . 'border' ] = [
682 'mode' => 'group',
683 'type' => 'border',
684 'label' => esc_html__( 'Border', 'shopbuilder' ),
685 'selector' => ! empty( $selectors['border'] ) ? $selectors['border'] : [],
686 'fields_options' => [
687 'color' => [
688 'label' => esc_html__( 'Border Color', 'shopbuilder' ),
689 ],
690 ],
691 'separator' => 'default',
692 ];
693
694 $fields[ $prefix . 'border_hover_color' ] = [
695 'type' => 'color',
696 'label' => esc_html__( 'Hover Border Color', 'shopbuilder' ),
697 'condition' => [ 'rtsb_el_' . $prefix . 'border_border!' => [ '' ] ],
698 'selectors' => ! empty( $selectors['border_hover_color'] ) ? $selectors['border_hover_color'] : [],
699 'separator' => 'default',
700 ];
701
702 $fields[ $prefix . 'spacing_note' ] = $obj->el_heading( esc_html__( 'Spacing', 'shopbuilder' ), 'before' );
703
704 $fields[ $prefix . 'padding' ] = [
705 'mode' => 'responsive',
706 'type' => 'dimensions',
707 'label' => esc_html__( 'Padding', 'shopbuilder' ),
708 'size_units' => [ 'px', '%', 'em' ],
709 'selectors' => ! empty( $selectors['padding'] ) ? $selectors['padding'] : [],
710 'separator' => 'default',
711 ];
712
713 $fields[ $prefix . 'margin' ] = [
714 'mode' => 'responsive',
715 'type' => 'dimensions',
716 'label' => esc_html__( 'Margin', 'shopbuilder' ),
717 'size_units' => [ 'px', '%', 'em' ],
718 'selectors' => ! empty( $selectors['margin'] ) ? $selectors['margin'] : [],
719 ];
720
721 $fields[ $prefix . 'style_section_end' ] = $obj->end_section();
722
723 return $fields;
724 }
725
726 /**
727 * Sharing Settings.
728 *
729 * @return array
730 */
731 public static function sharing_settings() {
732 $settings = get_option( 'rtsb_settings' );
733 $share_settings = ! empty( $settings['general']['social_share']['share_platforms'] ) ? $settings['general']['social_share']['share_platforms'] : [];
734
735 return ! empty( $share_settings ) && is_array( $share_settings ) ? $share_settings : [ 'facebook', 'twitter' ];
736 }
737 }
738