| 1 |
<?php |
| 2 |
/** |
| 3 |
* Main MetaSettings class. |
| 4 |
* |
| 5 |
* @package RadiusTheme\SB |
| 6 |
*/ |
| 7 |
|
| 8 |
namespace RadiusTheme\SB\Elementor\Widgets\Controls; |
| 9 |
|
| 10 |
use Elementor\Controls_Manager; |
| 11 |
use RadiusTheme\SB\Elementor\Helper\ControlHelper; |
| 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 |
* MetaSettings class |
| 20 |
*/ |
| 21 |
class MetaSettings { |
| 22 |
/** |
| 23 |
* Widget Field |
| 24 |
* |
| 25 |
* @return array |
| 26 |
*/ |
| 27 |
public static function widget_fields( $widget ) { |
| 28 |
$alignment = ControlHelper::flex_alignment(); |
| 29 |
$fields = [ |
| 30 |
'meta_settings_content' => [ |
| 31 |
'mode' => 'section_start', |
| 32 |
'label' => esc_html__( 'Settings', 'shopbuilder' ), |
| 33 |
'tab' => 'content', |
| 34 |
], |
| 35 |
|
| 36 |
'meta_layout' => [ |
| 37 |
'label' => esc_html__( 'Layout', 'shopbuilder' ), |
| 38 |
'type' => 'choose', |
| 39 |
'default' => 'column', |
| 40 |
'options' => [ |
| 41 |
'row' => [ |
| 42 |
'title' => esc_html__( 'Inline', 'shopbuilder' ), |
| 43 |
'icon' => 'eicon-ellipsis-h', |
| 44 |
], |
| 45 |
'column' => [ |
| 46 |
'title' => esc_html__( 'New Line', 'shopbuilder' ), |
| 47 |
'icon' => 'eicon-editor-list-ul', |
| 48 |
], |
| 49 |
], |
| 50 |
|
| 51 |
'prefix_class' => 'shopbuilder-layout-', |
| 52 |
'separator' => 'default', |
| 53 |
'selectors' => [ |
| 54 |
$widget->selectors['meta_layout'] => 'gap: 5px;flex-direction: {{VALUE}};', |
| 55 |
], |
| 56 |
], |
| 57 |
|
| 58 |
'align' => [ |
| 59 |
'mode' => 'responsive', |
| 60 |
'label' => esc_html__( 'Alignment', 'shopbuilder' ), |
| 61 |
'type' => 'choose', |
| 62 |
'options' => $alignment, |
| 63 |
'default' => '', |
| 64 |
'selectors' => [ |
| 65 |
$widget->selectors['align'] => 'align-items: {{VALUE}};justify-content: {{VALUE}};', |
| 66 |
], |
| 67 |
], |
| 68 |
'gap' => [ |
| 69 |
'label' => esc_html__( 'Meta Gap (px)', 'shopbuilder' ), |
| 70 |
'type' => 'slider', |
| 71 |
'mode' => 'responsive', |
| 72 |
'size_units' => [ 'px' ], |
| 73 |
'range' => [ |
| 74 |
'px' => [ |
| 75 |
'min' => 0, |
| 76 |
'max' => 100, |
| 77 |
'step' => 1, |
| 78 |
], |
| 79 |
], |
| 80 |
'selectors' => [ |
| 81 |
$widget->selectors['gap'] => 'gap: {{SIZE}}{{UNIT}}', |
| 82 |
], |
| 83 |
], |
| 84 |
'show_sku' => [ |
| 85 |
'label' => esc_html__( 'Show SKU?', 'shopbuilder' ), |
| 86 |
'type' => 'switch', |
| 87 |
'description' => esc_html__( 'Switch on to show SKU.', 'shopbuilder' ), |
| 88 |
'default' => 'yes', |
| 89 |
], |
| 90 |
'show_cat' => [ |
| 91 |
'label' => esc_html__( 'Show Category?', 'shopbuilder' ), |
| 92 |
'type' => 'switch', |
| 93 |
'description' => esc_html__( 'Switch on to show category.', 'shopbuilder' ), |
| 94 |
'default' => 'yes', |
| 95 |
], |
| 96 |
'show_tag' => [ |
| 97 |
'label' => esc_html__( 'Show Tag?', 'shopbuilder' ), |
| 98 |
'type' => 'switch', |
| 99 |
'description' => esc_html__( 'Switch on to show tag.', 'shopbuilder' ), |
| 100 |
'default' => 'yes', |
| 101 |
], |
| 102 |
'meta_settings_content_end' => [ |
| 103 |
'mode' => 'section_end', |
| 104 |
], |
| 105 |
]; |
| 106 |
return $fields; |
| 107 |
} |
| 108 |
|
| 109 |
|
| 110 |
} |
| 111 |
|