PluginProbe
ShopBuilder – WooCommerce Builder For Elementor / 2.1.13
ShopBuilder – WooCommerce Builder For Elementor v2.1.13
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.1.13, at app/Elementor/Helper/ControlHelper.php

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