| 1 |
<?php |
| 2 |
/** |
| 3 |
* Main ProductDescription 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 |
* Product Description class |
| 20 |
*/ |
| 21 |
class AddInfoSettings { |
| 22 |
/** |
| 23 |
* Widget Field |
| 24 |
* |
| 25 |
* @param object $widget Widget instance. |
| 26 |
* |
| 27 |
* @return array |
| 28 |
*/ |
| 29 |
public static function widget_fields( $widget ) { |
| 30 |
$alignment = ControlHelper::alignment(); |
| 31 |
unset( $alignment['justify'] ); |
| 32 |
$fields = [ |
| 33 |
'general_section' => [ |
| 34 |
'mode' => 'section_start', |
| 35 |
'label' => esc_html__( 'General Section', 'shopbuilder' ), |
| 36 |
'tab' => 'content', |
| 37 |
], |
| 38 |
'show_title' => [ |
| 39 |
'label' => esc_html__( 'Show Title?', 'shopbuilder' ), |
| 40 |
'type' => 'switch', |
| 41 |
'description' => esc_html__( 'Switch on to show Title.', 'shopbuilder' ), |
| 42 |
'default' => 'yes', |
| 43 |
'separator' => 'default', |
| 44 |
], |
| 45 |
'general_section_end' => [ |
| 46 |
'mode' => 'section_end', |
| 47 |
], |
| 48 |
'style_section' => [ |
| 49 |
'mode' => 'section_start', |
| 50 |
'label' => esc_html__( 'Heading Style', 'shopbuilder' ), |
| 51 |
'tab' => 'style', |
| 52 |
'condition' => [ |
| 53 |
'show_title' => 'yes', |
| 54 |
], |
| 55 |
], |
| 56 |
'heading_typography' => [ |
| 57 |
'mode' => 'group', |
| 58 |
'type' => 'typography', |
| 59 |
'label' => esc_html__( 'Typography', 'shopbuilder' ), |
| 60 |
'selector' => $widget->selectors['heading_typography'], |
| 61 |
], |
| 62 |
'heading_color' => [ |
| 63 |
'label' => esc_html__( 'Color', 'shopbuilder' ), |
| 64 |
'type' => 'color', |
| 65 |
'selectors' => [ |
| 66 |
$widget->selectors['heading_color'] => 'color: {{VALUE}}', |
| 67 |
], |
| 68 |
], |
| 69 |
'heading_margin' => [ |
| 70 |
'mode' => 'responsive', |
| 71 |
'label' => esc_html__( 'Margin', 'shopbuilder' ), |
| 72 |
'type' => 'dimensions', |
| 73 |
'size_units' => [ 'px', '%', 'em' ], |
| 74 |
'default' => [ |
| 75 |
'top' => '0', |
| 76 |
'right' => '0', |
| 77 |
'bottom' => '20', |
| 78 |
'left' => '0', |
| 79 |
'unit' => 'px', |
| 80 |
'isLinked' => false, |
| 81 |
], |
| 82 |
'selectors' => [ |
| 83 |
$widget->selectors['heading_margin'] => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 84 |
], |
| 85 |
], |
| 86 |
'style_section_end' => [ |
| 87 |
'mode' => 'section_end', |
| 88 |
], |
| 89 |
'content_section' => [ |
| 90 |
'mode' => 'section_start', |
| 91 |
'label' => esc_html__( 'Content', 'shopbuilder' ), |
| 92 |
'tab' => 'style', |
| 93 |
], |
| 94 |
'content_typography' => [ |
| 95 |
'mode' => 'group', |
| 96 |
'type' => 'typography', |
| 97 |
'label' => esc_html__( 'Typography', 'shopbuilder' ), |
| 98 |
'selector' => $widget->selectors['content_typography'], |
| 99 |
], |
| 100 |
'content_color' => [ |
| 101 |
'label' => esc_html__( 'Color', 'shopbuilder' ), |
| 102 |
'type' => 'color', |
| 103 |
'selectors' => [ |
| 104 |
$widget->selectors['content_color'] => 'color: {{VALUE}}', |
| 105 |
], |
| 106 |
], |
| 107 |
'content_border' => [ |
| 108 |
'mode' => 'group', |
| 109 |
'type' => 'border', |
| 110 |
'selector' => $widget->selectors['content_border'], |
| 111 |
'size_units' => [ 'px' ], |
| 112 |
'fields_options' => [ |
| 113 |
'border' => [ |
| 114 |
'default' => 'solid', |
| 115 |
], |
| 116 |
'width' => [ |
| 117 |
'default' => [ |
| 118 |
'top' => '1', |
| 119 |
'right' => '1', |
| 120 |
'bottom' => '1', |
| 121 |
'left' => '1', |
| 122 |
'unit' => 'px', |
| 123 |
'isLinked' => true, |
| 124 |
], |
| 125 |
], |
| 126 |
'color' => [ |
| 127 |
'default' => '#e5e7eb', |
| 128 |
], |
| 129 |
], |
| 130 |
], |
| 131 |
'content_padding' => [ |
| 132 |
'mode' => 'responsive', |
| 133 |
'label' => esc_html__( 'Padding', 'shopbuilder' ), |
| 134 |
'type' => 'dimensions', |
| 135 |
'size_units' => [ 'px', '%', 'em' ], |
| 136 |
'default' => [ |
| 137 |
'top' => '12', |
| 138 |
'right' => '18', |
| 139 |
'bottom' => '12', |
| 140 |
'left' => '18', |
| 141 |
'unit' => 'px', |
| 142 |
'isLinked' => false, |
| 143 |
], |
| 144 |
'selectors' => [ |
| 145 |
$widget->selectors['content_padding'] => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 146 |
], |
| 147 |
], |
| 148 |
'content_section_end' => [ |
| 149 |
'mode' => 'section_end', |
| 150 |
], |
| 151 |
]; |
| 152 |
|
| 153 |
return $fields; |
| 154 |
} |
| 155 |
} |
| 156 |
|