PluginProbe
ShopBuilder – WooCommerce Builder For Elementor / 3.4.0
ShopBuilder – WooCommerce Builder For Elementor v3.4.0
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 / NoticeSettings.php

NoticeSettings.php in ShopBuilder – WooCommerce Builder For Elementor 3.4.0, at app/Elementor/Widgets/Controls/NoticeSettings.php

370 lines 11.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
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\Helpers\Fns;
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 NoticeSettings {
22 /**
23 * Widget Control Selectors
24 *
25 * @var array
26 */
27 private static $selectors = [];
28 /**
29 * Widget
30 *
31 * @var array
32 */
33 private static $widget;
34 /**
35 * Widget Field
36 *
37 * @param object $widget object.
38 * @return array
39 */
40 public static function widget_fields( $widget ) {
41 self::$widget = $widget;
42 self::$selectors = $widget->selectors;
43 return self::notice_style() + self::button_style();
44 }
45 /**
46 * Widget Field
47 *
48 * @return array
49 */
50 public static function notice_style() {
51 return [
52 'notice_section' => [
53 'mode' => 'section_start',
54 'label' => esc_html__( 'Notice', 'shopbuilder' ),
55 ],
56 'notice_typo_note' => [
57 'type' => 'html',
58 'raw' => sprintf(
59 '<h3 class="rtsb-elementor-group-heading">%s</h3>',
60 esc_html__( 'Typography', 'shopbuilder' )
61 ),
62 'content_classes' => 'elementor-panel-heading-title',
63 ],
64 'notice_typography' => [
65 'mode' => 'group',
66 'type' => 'typography',
67 'label' => esc_html__( 'Typography', 'shopbuilder' ),
68 'selector' => self::$selectors['notice_typography'],
69 ],
70 'notice_icon_size' => [
71 'label' => esc_html__( 'Icon Size', 'shopbuilder' ),
72 'type' => 'slider',
73 'range' => [
74 'px' => [
75 'min' => 10,
76 'max' => 100,
77 ],
78 ],
79 'selectors' => [
80 self::$selectors['notice_icon_size']['icon'] => 'font-size: {{SIZE}}{{UNIT}} !important;',
81 self::$selectors['notice_icon_size']['svg'] => 'width: {{SIZE}}{{UNIT}} !important;',
82 ],
83 ],
84 'notice_color_note' => [
85 'type' => 'html',
86 'raw' => sprintf(
87 '<h3 class="rtsb-elementor-group-heading">%s</h3>',
88 esc_html__( 'Colors', 'shopbuilder' )
89 ),
90 'separator' => 'before-short',
91 'content_classes' => 'elementor-panel-heading-title',
92 ],
93 'notice_color_tab' => [
94 'mode' => 'tabs_start',
95 ],
96 'notice_common_color_tab_start' => [
97 'mode' => 'tab_start',
98 'label' => esc_html__( 'Common', 'shopbuilder' ),
99 ],
100 'notice_bg_color' => [
101 'label' => esc_html__( 'Background Color', 'shopbuilder' ),
102 'type' => 'color',
103 'selectors' => [
104 self::$selectors['notice_bg_color'] => 'background-color: {{VALUE}} !important;',
105 ],
106 ],
107 'notice_text_color' => [
108 'label' => esc_html__( 'Text Color', 'shopbuilder' ),
109 'type' => 'color',
110 'selectors' => [
111 self::$selectors['notice_text_color'] => 'color: {{VALUE}} !important;',
112 ],
113 ],
114 'notice_border_color' => [
115 'label' => esc_html__( 'Border Color', 'shopbuilder' ),
116 'type' => 'color',
117 'selectors' => [
118 self::$selectors['notice_border_color'] => 'border-color: {{VALUE}} !important;',
119 ],
120 ],
121 'notice_icon_color' => [
122 'label' => esc_html__( 'Icon Color', 'shopbuilder' ),
123 'type' => 'color',
124 'selectors' => [
125 self::$selectors['notice_icon_color']['icon'] => 'color: {{VALUE}} !important;',
126 self::$selectors['notice_icon_color']['svg'] => 'fill: {{VALUE}} !important;',
127 ],
128 ],
129 'notice_icon_bg_color' => [
130 'label' => esc_html__( 'Icon Background Color', 'shopbuilder' ),
131 'type' => 'color',
132 'selectors' => [
133 self::$selectors['notice_icon_bg_color'] => 'background-color: {{VALUE}} !important;',
134 ],
135 ],
136 'notice_common_color_tab_end' => [
137 'mode' => 'tab_end',
138 ],
139 'notice_success_color_tab_start' => [
140 'mode' => 'tab_start',
141 'label' => esc_html__( 'Success', 'shopbuilder' ),
142 ],
143 'notice_success_bg_color' => [
144 'label' => esc_html__( 'Background Color', 'shopbuilder' ),
145 'type' => 'color',
146 'selectors' => [
147 self::$selectors['notice_success_bg_color'] => 'background-color: {{VALUE}} !important;',
148 ],
149 ],
150 'notice_success_text_color' => [
151 'label' => esc_html__( 'Text Color', 'shopbuilder' ),
152 'type' => 'color',
153 'selectors' => [
154 self::$selectors['notice_success_text_color'] => 'color: {{VALUE}} !important;',
155 ],
156 ],
157 'notice_success_border_color' => [
158 'label' => esc_html__( 'Border Color', 'shopbuilder' ),
159 'type' => 'color',
160 'selectors' => [
161 self::$selectors['notice_success_border_color'] => 'border-color: {{VALUE}} !important;',
162 ],
163 ],
164 'notice_success_icon_color' => [
165 'label' => esc_html__( 'Icon Color', 'shopbuilder' ),
166 'type' => 'color',
167 'selectors' => [
168 self::$selectors['notice_success_icon_color']['icon'] => 'color: {{VALUE}} !important;',
169 self::$selectors['notice_success_icon_color']['svg'] => 'fill: {{VALUE}} !important;',
170 ],
171 ],
172 'notice_success_icon_bg_color' => [
173 'label' => esc_html__( 'Icon Background Color', 'shopbuilder' ),
174 'type' => 'color',
175 'selectors' => [
176 self::$selectors['notice_success_icon_bg_color'] => 'background-color: {{VALUE}} !important;',
177 ],
178 ],
179 'notice_success_color_tab_end' => [
180 'mode' => 'tab_end',
181 ],
182 'notice_error_color_tab_start' => [
183 'mode' => 'tab_start',
184 'label' => esc_html__( 'Error', 'shopbuilder' ),
185 ],
186 'notice_error_bg_color' => [
187 'label' => esc_html__( 'Background Color', 'shopbuilder' ),
188 'type' => 'color',
189
190 'selectors' => [
191 self::$selectors['notice_error_bg_color'] => 'background-color: {{VALUE}} !important;',
192 ],
193 ],
194 'notice_error_text_color' => [
195 'label' => esc_html__( 'Text Color', 'shopbuilder' ),
196 'type' => 'color',
197
198 'selectors' => [
199 self::$selectors['notice_error_text_color'] => 'color: {{VALUE}} !important;',
200 ],
201 ],
202 'notice_error_border_color' => [
203 'label' => esc_html__( 'Border Color', 'shopbuilder' ),
204 'type' => 'color',
205 'selectors' => [
206 self::$selectors['notice_error_border_color'] => 'border-color: {{VALUE}} !important;',
207 ],
208 ],
209 'notice_error_icon_color' => [
210 'label' => esc_html__( 'Icon Color', 'shopbuilder' ),
211 'type' => 'color',
212 'selectors' => [
213 self::$selectors['notice_error_icon_color']['icon'] => 'color: {{VALUE}} !important;',
214 self::$selectors['notice_error_icon_color']['svg'] => 'fill: {{VALUE}} !important;',
215 ],
216 ],
217 'notice_error_icon_bg_color' => [
218 'label' => esc_html__( 'Icon Background Color', 'shopbuilder' ),
219 'type' => 'color',
220 'selectors' => [
221 self::$selectors['notice_error_icon_bg_color'] => 'background-color: {{VALUE}} !important;',
222 ],
223 ],
224 'notice_error_color_tab_end' => [
225 'mode' => 'tab_end',
226 ],
227 'notice_info_color_tab_start' => [
228 'mode' => 'tab_start',
229 'label' => esc_html__( 'Info', 'shopbuilder' ),
230 ],
231 'notice_info_bg_color' => [
232 'label' => esc_html__( 'Background Color', 'shopbuilder' ),
233 'type' => 'color',
234 'selectors' => [
235 self::$selectors['notice_info_bg_color'] => 'background-color: {{VALUE}} !important;',
236 ],
237 ],
238 'notice_info_text_color' => [
239 'label' => esc_html__( 'Text Color', 'shopbuilder' ),
240 'type' => 'color',
241 'selectors' => [
242 self::$selectors['notice_info_text_color'] => 'color: {{VALUE}} !important;',
243 ],
244 ],
245 'notice_info_border_color' => [
246 'label' => esc_html__( 'Border Color', 'shopbuilder' ),
247 'type' => 'color',
248 'selectors' => [
249 self::$selectors['notice_info_border_color'] => 'border-color: {{VALUE}} !important;',
250 ],
251 ],
252 'notice_info_icon_color' => [
253 'label' => esc_html__( 'Icon Color', 'shopbuilder' ),
254 'type' => 'color',
255 'selectors' => [
256 self::$selectors['notice_info_icon_color']['icon'] => 'color: {{VALUE}} !important;',
257 self::$selectors['notice_info_icon_color']['svg'] => 'fill: {{VALUE}} !important;',
258 ],
259 ],
260 'notice_info_icon_bg_color' => [
261 'label' => esc_html__( 'Icon Background Color', 'shopbuilder' ),
262 'type' => 'color',
263 'selectors' => [
264 self::$selectors['notice_info_icon_bg_color'] => 'background-color: {{VALUE}} !important;',
265 ],
266 ],
267 'notice_info_color_tab_end' => [
268 'mode' => 'tab_end',
269 ],
270 'notice_color_tab_end' => [
271 'mode' => 'tabs_end',
272 ],
273 'notice_spacing_note' => [
274 'type' => 'html',
275 'raw' => sprintf(
276 '<h3 class="rtsb-elementor-group-heading">%s</h3>',
277 esc_html__( 'Spacings', 'shopbuilder' )
278 ),
279 'separator' => 'before-short',
280 'content_classes' => 'elementor-panel-heading-title',
281 ],
282 'notice_gap_multiple' => [
283 'label' => esc_html__( 'Spacing for Multiple Notice', 'shopbuilder' ),
284 'description' => esc_html__( 'This spacing will apply between multiple notices.', 'shopbuilder' ),
285 'type' => 'slider',
286 'range' => [
287 'px' => [
288 'min' => 0,
289 'max' => 100,
290 ],
291 ],
292 'selectors' => [
293 self::$selectors['notice_gap_multiple'] => 'display: flex; flex-direction: column; gap: {{SIZE}}{{UNIT}} !important;',
294 ],
295 ],
296 'notice_icon_gap' => [
297 'label' => esc_html__( 'Icon Spacing', 'shopbuilder' ),
298 'type' => 'slider',
299 'range' => [
300 'px' => [
301 'min' => 0,
302 'max' => 100,
303 ],
304 ],
305 'selectors' => [
306 self::$selectors['notice_icon_gap'] => 'gap: {{SIZE}}{{UNIT}} !important;',
307 ],
308 ],
309 'notice_padding' => [
310 'label' => esc_html__( 'Padding (px)', 'shopbuilder' ),
311 'type' => 'dimensions',
312 'mode' => 'responsive',
313 'size_units' => [ 'px' ],
314 'selectors' => [
315 self::$selectors['notice_padding'] => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;',
316 ],
317 ],
318 'notice_border_radius' => [
319 'label' => esc_html__( 'Border Radius (px)', 'shopbuilder' ),
320 'type' => 'dimensions',
321 'size_units' => [ 'px' ],
322 'selectors' => [
323 self::$selectors['notice_border_radius'] => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;',
324 ],
325 ],
326 'notice_section_end' => [
327 'mode' => 'section_end',
328 ],
329 ];
330 }
331 /**
332 * Widget Field
333 *
334 * @return array
335 */
336 public static function button_style() {
337 $fields = ButtonSettings::style_settings( self::$widget );
338
339 unset( $fields['button_section_start']['tab'] );
340
341 $extra_controls = [];
342
343 $extra_controls['notice_button_alignment'] = [
344 'type' => 'choose',
345 'label' => esc_html__( 'Text Alignment', 'shopbuilder' ),
346 'options' => [
347 'left' => [
348 'title' => esc_html__( 'Left', 'shopbuilder' ),
349 'icon' => 'eicon-text-align-left',
350 ],
351 'center' => [
352 'title' => esc_html__( 'Center', 'shopbuilder' ),
353 'icon' => 'eicon-text-align-center',
354 ],
355 'right' => [
356 'title' => esc_html__( 'Right', 'shopbuilder' ),
357 'icon' => 'eicon-text-align-right',
358 ],
359 ],
360 'default' => 'left',
361 'toggle' => true,
362 'selectors' => [
363 self::$selectors['notice_button_alignment'] => 'justify-content: {{VALUE}} !important;',
364 ],
365 ];
366
367 return Fns::insert_controls( 'button_height', $fields, $extra_controls );
368 }
369 }
370