PluginProbe
ShopBuilder – WooCommerce Builder For Elementor / 3.2.6
ShopBuilder – WooCommerce Builder For Elementor v3.2.6
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 / General / TeamMember / Controls.php

Controls.php in ShopBuilder – WooCommerce Builder For Elementor 3.2.6, at app/Elementor/Widgets/General/TeamMember/Controls.php

859 lines 30.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Controls class.
4 *
5 * @package RadiusTheme\SB
6 */
7
8 namespace RadiusTheme\SB\Elementor\Widgets\General\TeamMember;
9
10 use Elementor\Utils;
11 use RadiusTheme\SB\Helpers\Fns;
12 use RadiusTheme\SB\Elementor\Helper\ControlHelper;
13 use RadiusTheme\SB\Elementor\Widgets\Controls\SettingsFields;
14 use RadiusTheme\SB\Elementor\Widgets\Controls\StyleFields as StyleFieldsFree;
15
16 // Do not allow directly accessing this file.
17 if ( ! defined( 'ABSPATH' ) ) {
18 exit( 'This script cannot be accessed directly.' );
19 }
20
21 /**
22 * Settings class.
23 *
24 * @package RadiusTheme\SB
25 */
26 class Controls {
27 /**
28 * Content section
29 *
30 * @param object $obj Reference object.
31 *
32 * @return array
33 */
34 public static function content( $obj ) {
35 return array_merge(
36 self::preset( $obj ),
37 self::general_settings( $obj ),
38 self::slider_settings( $obj ),
39 self::team_member_items( $obj ),
40 );
41 }
42
43 /**
44 * Style section
45 *
46 * @param object $obj Reference object.
47 *
48 * @return array
49 */
50 public static function style( $obj ) {
51 return array_merge(
52 self::team_item_style( $obj ),
53 self::image_styles( $obj ),
54 self::title_style( $obj ),
55 self::content_style( $obj ),
56 self::designation_style( $obj ),
57 self::social_icon_style( $obj ),
58 self::logo_slider_buttons( $obj ),
59 );
60 }
61
62 /**
63 * Preset section
64 *
65 * @param object $obj Reference object.
66 *
67 * @return array
68 */
69 private static function preset( $obj ) {
70 $status = ! rtsb()->has_pro();
71 $fields['sb_team_preset'] = $obj->start_section(
72 esc_html__( 'Layout', 'shopbuilder' ),
73 'content'
74 );
75 $fields['layout_note'] = $obj->el_heading( esc_html__( 'Predefined Layouts', 'shopbuilder' ) );
76 $fields['layout_style'] = [
77 'type' => 'rtsb-image-selector',
78 'options' => ControlHelper::general_widgets_team_member(),
79 'default' => 'rtsb-team-layout1',
80 ];
81 $fields['cols'] = [
82 'type' => 'select2',
83 'mode' => 'responsive',
84 'label' => esc_html__( 'Number of Columns', 'shopbuilder' ),
85 'description' => esc_html__( 'Please select the number of columns to show per row.', 'shopbuilder' ),
86 'options' => ControlHelper::layout_columns(),
87 'label_block' => true,
88 'default' => '0',
89 'tablet_default' => '3',
90 'mobile_default' => '2',
91 'required' => true,
92 'render_type' => 'template',
93 'selectors' => [
94 $obj->selectors['columns']['cols'] => 'grid-template-columns: repeat({{VALUE}}, minmax(0, 1fr));',
95 ],
96 'separator' => 'before',
97 ];
98 $fields['rows'] = [
99 'type' => 'select2',
100 'label' => esc_html__( 'Number of Product Rows', 'shopbuilder' ),
101 'description' => esc_html__( 'Please select the number of slide rows. Slide Rows represents how many rows of slides will be displayed at once.', 'shopbuilder' ),
102 'options' => [
103 1 => esc_html__( 'Layout Default (1 Row)', 'shopbuilder' ),
104 2 => esc_html__( '2 Rows', 'shopbuilder' ),
105 3 => esc_html__( '3 Rows', 'shopbuilder' ),
106 4 => esc_html__( '4 Rows', 'shopbuilder' ),
107 5 => esc_html__( '5 Rows', 'shopbuilder' ),
108 ],
109 'label_block' => true,
110 'default' => '1',
111 'tablet_default' => '1',
112 'mobile_default' => '1',
113 'required' => true,
114 'classes' => $obj->pro_class(),
115 'is_pro' => $status,
116 'condition' => [ 'activate_slider_item' => 'yes' ],
117 ];
118
119 $fields['cols_group'] = [
120 'type' => 'select2',
121 'mode' => 'responsive',
122 'label' => esc_html__( 'Number of Slides Per Group', 'shopbuilder' ),
123 'description' => esc_html__( 'Please select the number of slides to show per group. Slides Per Group indicates how many slides will be transitioned at a time.', 'shopbuilder' ),
124 'options' => ControlHelper::layout_columns(),
125 'label_block' => true,
126 'default' => '0',
127 'tablet_default' => '2',
128 'mobile_default' => '1',
129 'required' => true,
130 'condition' => [ 'activate_slider_item' => 'yes' ],
131 ];
132 $fields['element_height'] = [
133 'type' => 'slider',
134 'mode' => 'responsive',
135 'label' => esc_html__( 'Element Height', 'shopbuilder' ),
136 'size_units' => [ 'px', '%' ],
137 'range' => [
138 'px' => [
139 'min' => 0,
140 'max' => 1000,
141 ],
142 '%' => [
143 'min' => 0,
144 'max' => 100,
145 ],
146 ],
147 'description' => esc_html__( 'Please select the element height.', 'shopbuilder' ),
148 'selectors' => [
149 $obj->selectors['element']['element_height'] => 'height: {{SIZE}}{{UNIT}};',
150 ],
151 ];
152 $fields['grid_gap'] = [
153 'type' => 'slider',
154 'mode' => 'responsive',
155 'label' => esc_html__( 'Grid Gap / Spacing (px)', 'shopbuilder' ),
156 'size_units' => [ 'px' ],
157 'range' => [
158 'px' => [
159 'min' => 0,
160 'max' => 100,
161 'step' => 1,
162 ],
163 ],
164 'default' => [
165 'unit' => 'px',
166 'size' => 30,
167 ],
168 'description' => esc_html__( 'Please select the grid gap in px.', 'shopbuilder' ),
169 'selectors' => [
170 $obj->selectors['columns']['grid_gap']['padding'] => 'padding-left: calc({{SIZE}}{{UNIT}} / 2); padding-right: calc({{SIZE}}{{UNIT}} / 2);',
171 $obj->selectors['columns']['grid_gap']['margin'] => 'margin-left: calc(-{{SIZE}}{{UNIT}} / 2); margin-right: calc(-{{SIZE}}{{UNIT}} / 2);',
172 $obj->selectors['columns']['grid_gap']['slider_layout'] => ' --rtsb-team-slider-spacing: {{SIZE}}{{UNIT}};',
173 $obj->selectors['columns']['grid_gap']['bottom'] => 'margin-bottom: {{SIZE}}{{UNIT}};',
174 ],
175 ];
176 $fields['sb_team_preset_end'] = $obj->end_section();
177 return $fields;
178 }
179
180
181 /**
182 * General section
183 *
184 * @param object $obj Reference object.
185 *
186 * @return array
187 */
188 private static function general_settings( $obj ) {
189 $fields['general_settings_sec_start'] = $obj->start_section(
190 esc_html__( 'General Settings', 'shopbuilder' ),
191 'content',
192 [],
193 );
194 $fields['social_heading'] = $obj->el_heading( esc_html__( 'Team Member Settings', 'shopbuilder' ) );
195 $fields['member_name_html_tag'] = [
196 'label' => esc_html__( 'Member Name Tag', 'shopbuilder' ),
197 'description' => esc_html__( 'Please select the name tag.', 'shopbuilder' ),
198 'type' => 'select',
199 'options' => ControlHelper::heading_tags(),
200 'default' => 'h2',
201 'label_block' => true,
202 ];
203 $fields['display_member_designation'] = [
204 'label' => esc_html__( 'Show Team Designation?', 'shopbuilder' ),
205 'description' => esc_html__( 'Switch on to show member designation.', 'shopbuilder' ),
206 'label_on' => esc_html__( 'On', 'shopbuilder' ),
207 'label_off' => esc_html__( 'Off', 'shopbuilder' ),
208 'type' => 'switch',
209 'default' => 'yes',
210 'separator' => 'before',
211 ];
212 $fields['display_member_description'] = [
213 'label' => esc_html__( 'Show Team Description?', 'shopbuilder' ),
214 'description' => esc_html__( 'Switch on to show member description.', 'shopbuilder' ),
215 'label_on' => esc_html__( 'On', 'shopbuilder' ),
216 'label_off' => esc_html__( 'Off', 'shopbuilder' ),
217 'type' => 'switch',
218 'separator' => 'before',
219 ];
220 $fields['display_social_icon'] = [
221 'label' => esc_html__( 'Show Social Icons?', 'shopbuilder' ),
222 'description' => esc_html__( 'Switch on to show member social icons.', 'shopbuilder' ),
223 'label_on' => esc_html__( 'On', 'shopbuilder' ),
224 'label_off' => esc_html__( 'Off', 'shopbuilder' ),
225 'type' => 'switch',
226 'default' => 'yes',
227 ];
228 $fields['image_linkable'] = [
229 'label' => esc_html__( 'Image Linkable?', 'shopbuilder' ),
230 'description' => esc_html__( 'Switch on to activate image linkable.', 'shopbuilder' ),
231 'label_on' => esc_html__( 'On', 'shopbuilder' ),
232 'label_off' => esc_html__( 'Off', 'shopbuilder' ),
233 'type' => 'switch',
234 ];
235 $fields['member_name_linkable'] = [
236 'label' => esc_html__( 'Team Name Linkable?', 'shopbuilder' ),
237 'description' => esc_html__( 'Switch on to activate member name linkable.', 'shopbuilder' ),
238 'label_on' => esc_html__( 'On', 'shopbuilder' ),
239 'label_off' => esc_html__( 'Off', 'shopbuilder' ),
240 'type' => 'switch',
241 ];
242 $fields['activate_slider_item'] = [
243 'label' => esc_html__( 'Activate Team Slider?', 'shopbuilder' ),
244 'description' => esc_html__( 'Switch on to activate logo slider.', 'shopbuilder' ),
245 'label_on' => esc_html__( 'On', 'shopbuilder' ),
246 'label_off' => esc_html__( 'Off', 'shopbuilder' ),
247 'type' => 'switch',
248 ];
249 $fields['member_image_size_dimension_note'] = $obj->el_heading( esc_html__( 'Image Settings', 'shopbuilder' ), 'before' );
250 $fields['member_image_size'] = [
251 'type' => 'select2',
252 'label' => esc_html__( 'Select Image Size', 'shopbuilder' ),
253 'description' => esc_html__( 'Please select the image size.', 'shopbuilder' ),
254 'options' => Fns::get_image_sizes(),
255 'default' => 'full',
256 'label_block' => true,
257 'content_classes' => 'elementor-descriptor',
258 ];
259 $fields['member_img_dimension'] = [
260 'type' => 'image-dimensions',
261 'label' => esc_html__( 'Enter Custom Image Size', 'shopbuilder' ),
262 'label_block' => true,
263 'default' => [
264 'width' => 400,
265 'height' => 400,
266 ],
267 'condition' => [
268 'member_image_size' => 'rtsb_custom',
269 ],
270 ];
271 $fields['member_img_crop'] = [
272 'type' => 'select2',
273 'label' => esc_html__( 'Image Crop', 'shopbuilder' ),
274 'description' => esc_html__( 'Please click on "Apply" to update the image.', 'shopbuilder' ),
275 'options' => [
276 'soft' => esc_html__( 'Soft Crop', 'shopbuilder' ),
277 'hard' => esc_html__( 'Hard Crop', 'shopbuilder' ),
278 ],
279 'default' => 'hard',
280 'condition' => [
281 'member_image_size' => 'rtsb_custom',
282 ],
283 ];
284 $fields['member_img_custom_dimension_note'] = [
285 'type' => 'html',
286 'raw' => sprintf(
287 '<span style="display: block; background: #fffbf1; padding: 10px; font-weight: 500; line-height: 1.4; color: #bd3a3a;border: 1px solid #bd3a3a;">%s</span>',
288 esc_html__( 'Please note that, if you enter image size larger than the actual image itself, the image sizes will fallback to the full image dimension.', 'shopbuilder' )
289 ),
290 'condition' => [
291 'member_image_size' => 'rtsb_custom',
292 ],
293 ];
294 $fields['general_settings_sec_end'] = $obj->end_section();
295
296 return $fields;
297 }
298 /**
299 * Team items
300 *
301 * @param object $obj Reference object.
302 *
303 * @return array
304 */
305 public static function team_member_items( $obj ) {
306 $fields['team_items_settings_sec_start'] = $obj->start_section(
307 esc_html__( 'Team Members', 'shopbuilder' ),
308 'content',
309 [],
310 );
311 $repeater_fields = [
312 'member_image' => [
313 'type' => 'media',
314 'label' => esc_html__( 'Upload Member Image', 'shopbuilder' ),
315 'default' => [
316 'url' => Utils::get_placeholder_image_src(),
317 ],
318 ],
319 'member_name' => [
320 'label' => esc_html__( 'Member Name', 'shopbuilder' ),
321 'type' => 'text',
322 'label_block' => true,
323 'default' => esc_html__( 'Kristin Watson', 'shopbuilder' ),
324 'separator' => 'before-short',
325 ],
326 'member_designation' => [
327 'label' => esc_html__( 'Member Designation', 'shopbuilder' ),
328 'type' => 'text',
329 'label_block' => true,
330 'default' => esc_html__( 'Plugin Developer', 'shopbuilder' ),
331 ],
332 'member_bio' => [
333 'label' => esc_html__( 'Member Bio', 'shopbuilder' ),
334 'type' => 'wysiwyg',
335 'label_block' => true,
336 'default' => esc_html__( 'Lorem Ipsum is simply dummy text of the printing and typesetting has been the industry standard dummy text ever since.', 'shopbuilder' ),
337 'separator' => 'before-short',
338 ],
339 'link_heading' => $obj->el_heading( esc_html__( 'Team Member Link', 'shopbuilder' ), 'before-short' ),
340 'image_link' => [
341 'label' => esc_html__( 'Image Link', 'shopbuilder' ),
342 'type' => 'url',
343 ],
344 'member_name_link' => [
345 'label' => esc_html__( 'Title Link', 'shopbuilder' ),
346 'type' => 'url',
347 ],
348 'social_heading' => $obj->el_heading( esc_html__( 'Social Links', 'shopbuilder' ), 'before-short' ),
349
350 ];
351 $repeater_fields = array_merge(
352 $repeater_fields,
353 ControlHelper::social_media_field()
354 );
355 $fields['general_settings_sec_start'] = $obj->start_section(
356 esc_html__( 'Settings', 'shopbuilder' ),
357 'content',
358 [],
359 );
360 $fields['team_member_items'] = [
361 'type' => 'repeater',
362 'label' => esc_html__( 'Add Team Members', 'shopbuilder' ),
363 'mode' => 'repeater',
364 'title_field' => '{{{ member_name }}}',
365 'separator' => 'after',
366 'fields' => $repeater_fields,
367 'default' => [
368 [
369 'member_name' => esc_html__( 'Kristin Watson', 'shopbuilder' ),
370 'member_designation' => __( 'Senior Artist', 'shopbuilder' ),
371 'member_bio' => esc_html__( 'Lorem Ipsum is simply dummy text of the printing and typesetting has been the industry standard dummy text ever since.', 'shopbuilder' ),
372 ],
373 [
374 'member_name' => esc_html__( 'Leslie Alexander', 'shopbuilder' ),
375 'member_designation' => __( 'Software Developer', 'shopbuilder' ),
376 'member_bio' => esc_html__( 'Lorem Ipsum is simply dummy text of the printing and typesetting has been the industry standard dummy text ever since.', 'shopbuilder' ),
377 ],
378 [
379 'member_name' => esc_html__( 'Darrell Steward', 'shopbuilder' ),
380 'member_designation' => __( 'UX Designer', 'shopbuilder' ),
381 'member_bio' => esc_html__( 'Lorem Ipsum is simply dummy text of the printing and typesetting has been the industry standard dummy text ever since.', 'shopbuilder' ),
382 ],
383 [
384 'member_name' => esc_html__( 'John Doe', 'shopbuilder' ),
385 'member_designation' => __( 'Junior Executive', 'shopbuilder' ),
386 'member_bio' => esc_html__( 'Lorem Ipsum is simply dummy text of the printing and typesetting has been the industry standard dummy text ever since.', 'shopbuilder' ),
387 ],
388
389 ],
390 ];
391 $fields['team_items_settings_sec_end'] = $obj->end_section();
392 return $fields;
393 }
394
395 /**
396 * Slider section
397 *
398 * @param object $obj Reference object.
399 *
400 * @return array
401 */
402 public static function slider_settings( $obj ) {
403 $fields = SettingsFields::slider_settings( $obj );
404 unset( $fields['slider_nav_position'] );
405 $fields['slider_control_section']['condition'] = [
406 'activate_slider_item' => 'yes',
407 ];
408 $fields['slider_control_section']['tab'] = 'content';
409 return $fields;
410 }
411
412 /**
413 * Content Box style section
414 *
415 * @param object $obj Reference object.
416 *
417 * @return array
418 */
419 private static function team_item_style( $obj ) {
420
421 $css_selectors = $obj->selectors['team_item_style'];
422 $title = esc_html__( 'Team Member Item', 'shopbuilder' );
423 $selectors = [
424 'box_shadow' => $css_selectors['box_shadow'],
425 'border' => $css_selectors['border'],
426 'bg_color' => [ $css_selectors['bg_color'] => 'background-color: {{VALUE}};' ],
427 'padding' => [ $css_selectors['padding'] => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;' ],
428 'border_radius' => [ $css_selectors['border_radius'] => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;' ],
429 ];
430
431 $fields = ControlHelper::general_elementor_style( 'team_item_style', $title, $obj, [], $selectors );
432
433 unset(
434 $fields['team_item_style_typo_note'],
435 $fields['rtsb_el_team_item_style_typography'],
436 $fields['team_item_style_color'],
437 $fields['team_item_style_alignment'],
438 $fields['team_item_style_color_tabs'],
439 $fields['team_item_style_color_tab'],
440 $fields['team_item_style_color_tab_end'],
441 $fields['team_item_style_hover_color_tab'],
442 $fields['team_item_style_hover_color'],
443 $fields['team_item_style_hover_bg_color'],
444 $fields['team_item_style_hover_color_tab_end'],
445 $fields['team_item_style_color_tabs_end'],
446 $fields['team_item_style_border_hover_color'],
447 $fields['team_item_style_margin']
448 );
449 $fields['team_item_style_border_note']['separator'] = 'default';
450 $fields['team_item_style_color_note']['separator'] = 'default';
451 $extra_controls['team_item_style_border_radius'] = [
452 'label' => esc_html__( 'Border Radius', 'shopbuilder' ),
453 'type' => 'dimensions',
454 'mode' => 'responsive',
455 'size_units' => [ 'px' ],
456 'selectors' => $selectors['border_radius'],
457 ];
458 $fields = Fns::insert_controls( 'team_item_style_spacing_note', $fields, $extra_controls );
459
460 $extra_controls2['rtsb_team_item_style_box_shadow'] = [
461 'type' => 'box-shadow',
462 'mode' => 'group',
463 'label' => esc_html__( 'Box Shadow', 'shopbuilder' ),
464 'selector' => $selectors['box_shadow'],
465 ];
466 $fields = Fns::insert_controls( 'team_item_style_border_note', $fields, $extra_controls2 );
467 return $fields;
468 }
469 /**
470 * Title style section
471 *
472 * @param object $obj Reference object.
473 *
474 * @return array
475 */
476 private static function title_style( $obj ) {
477 $css_selectors = $obj->selectors['title_style'];
478 $title = esc_html__( 'Title', 'shopbuilder' );
479 $selectors = [
480 'typography' => $css_selectors['typography'],
481 'color' => [ $css_selectors['color'] => 'color: {{VALUE}};' ],
482 'separator_color' => [ $css_selectors['separator_color'] => 'background-color: {{VALUE}};' ],
483 'margin' => [ $css_selectors['margin'] => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}!important;' ],
484 ];
485
486 $fields = ControlHelper::general_elementor_style( 'title_style', $title, $obj, [], $selectors );
487 unset(
488 $fields['title_style_alignment'],
489 $fields['rtsb_el_title_style_border'],
490 $fields['title_style_border_note'],
491 $fields['title_style_color_tabs'],
492 $fields['title_style_color_tab'],
493 $fields['title_style_color_tab_end'],
494 $fields['title_style_hover_color_tab'],
495 $fields['title_style_bg_color'],
496 $fields['title_style_hover_color'],
497 $fields['title_style_hover_bg_color'],
498 $fields['title_style_border_hover_color'],
499 $fields['title_style_padding'],
500 $fields['title_style_hover_color_tab_end'],
501 $fields['title_style_color_tabs_end'],
502 );
503 $extra_controls['title_style_separator_color'] = [
504 'type' => 'color',
505 'label' => esc_html__( 'Separator Color', 'shopbuilder' ),
506 'selectors' => $selectors['separator_color'],
507 'condition' => [
508 'layout_style' => [ 'rtsb-team-layout4' ],
509 ],
510 ];
511 $fields = Fns::insert_controls( 'title_style_spacing_note', $fields, $extra_controls );
512 return $fields;
513 }
514 /**
515 * Content style section
516 *
517 * @param object $obj Reference object.
518 *
519 * @return array
520 */
521 private static function content_style( $obj ) {
522 $css_selectors = $obj->selectors['content_style'];
523 $title = esc_html__( 'Content', 'shopbuilder' );
524 $selectors = [
525 'typography' => $css_selectors['typography'],
526 'color' => [ $css_selectors['color'] => 'color: {{VALUE}};' ],
527 'margin' => [ $css_selectors['margin'] => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}!important;' ],
528 ];
529
530 $fields = ControlHelper::general_elementor_style( 'content_style', $title, $obj, [], $selectors );
531 unset(
532 $fields['content_style_alignment'],
533 $fields['rtsb_el_content_style_border'],
534 $fields['content_style_border_note'],
535 $fields['content_style_color_tabs'],
536 $fields['content_style_color_tab'],
537 $fields['content_style_color_tab_end'],
538 $fields['content_style_hover_color_tab'],
539 $fields['content_style_bg_color'],
540 $fields['content_style_hover_color'],
541 $fields['content_style_hover_bg_color'],
542 $fields['content_style_border_hover_color'],
543 $fields['content_style_padding'],
544 $fields['content_style_hover_color_tab_end'],
545 $fields['content_style_color_tabs_end'],
546 );
547 return $fields;
548 }
549 /**
550 * Designation style section
551 *
552 * @param object $obj Reference object.
553 *
554 * @return array
555 */
556 private static function designation_style( $obj ) {
557 $css_selectors = $obj->selectors['designation_style'];
558 $title = esc_html__( 'Designation', 'shopbuilder' );
559 $selectors = [
560 'typography' => $css_selectors['typography'],
561 'color' => [ $css_selectors['color'] => 'color: {{VALUE}};' ],
562 'margin' => [ $css_selectors['margin'] => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}!important;' ],
563 ];
564
565 $fields = ControlHelper::general_elementor_style( 'designation_style', $title, $obj, [], $selectors );
566 unset(
567 $fields['designation_style_alignment'],
568 $fields['rtsb_el_designation_style_border'],
569 $fields['designation_style_border_note'],
570 $fields['designation_style_color_tabs'],
571 $fields['designation_style_color_tab'],
572 $fields['designation_style_color_tab_end'],
573 $fields['designation_style_hover_color_tab'],
574 $fields['designation_style_bg_color'],
575 $fields['designation_style_hover_color'],
576 $fields['designation_style_hover_bg_color'],
577 $fields['designation_style_border_hover_color'],
578 $fields['designation_style_padding'],
579 $fields['designation_style_hover_color_tab_end'],
580 $fields['designation_style_color_tabs_end'],
581 );
582 return $fields;
583 }
584 /**
585 * Slider Button section
586 *
587 * @param object $obj Reference object.
588 *
589 * @return array
590 */
591 public static function logo_slider_buttons( $obj ) {
592 $slider_btn_settings = StyleFieldsFree::slider_buttons( $obj );
593 $slider_btn_settings['slider_buttons_style_section']['condition'] = [
594 'activate_slider_item' => 'yes',
595 ];
596 return $slider_btn_settings;
597 }
598 /**
599 * Image style section
600 *
601 * @param object $obj Reference object.
602 *
603 * @return array
604 */
605 public static function image_styles( $obj ) {
606 $alignment_options = ControlHelper::alignment();
607 unset( $alignment_options['justify'] );
608 $fields['image_style_sec_start'] = $obj->start_section(
609 esc_html__( 'Image', 'shopbuilder' ),
610 'style',
611 [],
612 );
613 $fields['image_hover_effect'] = [
614 'type' => 'select',
615 'label' => esc_html__( 'Image Hover Effect', 'shopbuilder' ),
616 'options' => self::team_member_image_hover_effect(),
617 'default' => 'rtsb-gw-img-zoom-in',
618 'label_block' => true,
619 ];
620 $fields['image_alignment'] = [
621 'mode' => 'responsive',
622 'type' => 'choose',
623 'label' => esc_html__( 'Image Alignment', 'shopbuilder' ),
624 'options' => $alignment_options,
625 'separator' => 'before',
626 'selectors' => [ $obj->selectors['image_style']['alignment'] => 'text-align: {{VALUE}};justify-content: {{VALUE}};' ],
627 'condition' => [
628 'layout_style!' => [ 'rtsb-team-layout3','rtsb-team-layout4' ],
629 ],
630 ];
631 $fields['image_styles_dimension_note'] = $obj->el_heading( esc_html__( 'Dimension', 'shopbuilder' ) );
632
633 $fields['image_styles_width'] = [
634 'type' => 'slider',
635 'label' => esc_html__( 'Image Width', 'shopbuilder' ),
636 'size_units' => [ '%', 'px' ],
637 'range' => [
638 '%' => [
639 'min' => 0,
640 'max' => 100,
641 'step' => 1,
642 ],
643 'px' => [
644 'min' => 0,
645 'max' => 600,
646 'step' => 1,
647 ],
648 ],
649 'selectors' => [
650 $obj->selectors['image_style']['width'] => 'width: {{SIZE}}{{UNIT}};',
651 $obj->selectors['image_style']['flex_width'] => 'flex: 0 0 {{SIZE}}{{UNIT}};',
652 ],
653 ];
654 $fields['image_styles_height'] = [
655 'type' => 'slider',
656 'label' => esc_html__( 'Image Height', 'shopbuilder' ),
657 'size_units' => [ '%', 'px' ],
658 'range' => [
659 '%' => [
660 'min' => 0,
661 'max' => 100,
662 'step' => 1,
663 ],
664 'px' => [
665 'min' => 0,
666 'max' => 600,
667 'step' => 1,
668 ],
669 ],
670 'selectors' => [
671 $obj->selectors['image_style']['height'] => 'height: {{SIZE}}{{UNIT}};object-fit:cover;',
672 ],
673 ];
674 $fields['image_styles_max_width'] = [
675 'type' => 'slider',
676 'label' => esc_html__( 'Image Max-Width', 'shopbuilder' ),
677 'size_units' => [ '%', 'px' ],
678 'range' => [
679 '%' => [
680 'min' => 0,
681 'max' => 100,
682 'step' => 1,
683 ],
684 'px' => [
685 'min' => 0,
686 'max' => 600,
687 'step' => 1,
688 ],
689
690 ],
691 'selectors' => [
692 $obj->selectors['image_style']['max_width'] => 'max-width: {{SIZE}}{{UNIT}};',
693 ],
694 ];
695 $fields['image_border_note'] = $obj->el_heading( esc_html__( 'Border', 'shopbuilder' ), 'before' );
696 $fields['image_border'] = [
697 'mode' => 'group',
698 'type' => 'border',
699 'label' => esc_html__( 'Border', 'shopbuilder' ),
700 'selector' => $obj->selectors['image_style']['border'],
701 'fields_options' => [
702 'color' => [
703 'label' => esc_html__( 'Border Color', 'shopbuilder' ),
704 ],
705 ],
706 'separator' => 'default',
707 ];
708 $fields['image_styles_radius'] = [
709 'mode' => 'responsive',
710 'type' => 'dimensions',
711 'label' => esc_html__( 'Border Radius', 'shopbuilder' ),
712 'size_units' => [ 'px', '%', 'em' ],
713 'selectors' => [
714 $obj->selectors['image_style']['border_radius'] => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
715 ],
716 ];
717 $fields['image_styles_spacing_note'] = $obj->el_heading( esc_html__( 'Spacing', 'shopbuilder' ) );
718 $fields['image_styles_margin'] = [
719 'mode' => 'responsive',
720 'type' => 'dimensions',
721 'label' => esc_html__( 'Margin', 'shopbuilder' ),
722 'size_units' => [ 'px', '%', 'em' ],
723 'selectors' => [
724 $obj->selectors['image_style']['margin'] => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
725 ],
726 ];
727 $fields['image_sec_end'] = $obj->end_section();
728
729 return $fields;
730 }
731 /**
732 * Social Icon style section
733 *
734 * @param object $obj Reference object.
735 *
736 * @return array
737 */
738 private static function social_icon_style( $obj ) {
739 $css_selectors = $obj->selectors['social_icon_style'];
740 $title = esc_html__( 'Social Icon', 'shopbuilder' );
741 $selectors = [
742 'icon_size' => [
743 $css_selectors['icon_size']['font_size'] => 'font-size: {{SIZE}}{{UNIT}};',
744 $css_selectors['icon_size']['svg'] => 'height: {{SIZE}}{{UNIT}};width: {{SIZE}}{{UNIT}};',
745 ],
746 'border' => $css_selectors['border'],
747 'border_hover_color' => [ $css_selectors['border_hover_color'] => 'border-color: {{VALUE}};' ],
748 'color' => [ $css_selectors['color'] => 'fill: {{VALUE}};' ],
749 'bg_color' => [ $css_selectors['bg_color'] => 'background-color: {{VALUE}};' ],
750 'hover_bg_color' => [ $css_selectors['hover_bg_color'] => 'background-color: {{VALUE}};' ],
751 'hover_color' => [ $css_selectors['hover_color'] => 'fill: {{VALUE}};' ],
752 'border_radius' => [ $css_selectors['border_radius'] => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' ],
753 'margin' => [ $css_selectors['margin'] => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}!important;' ],
754 'icon_width' => [ $css_selectors['icon_width'] => 'width: {{SIZE}}{{UNIT}}' ],
755 'icon_height' => [ $css_selectors['icon_height'] => 'height: {{SIZE}}{{UNIT}}' ],
756 'icon_gap' => [ $css_selectors['icon_gap'] => 'gap: {{SIZE}}{{UNIT}}' ],
757 ];
758
759 $fields = ControlHelper::general_elementor_style( 'social_icon_style', $title, $obj, [], $selectors );
760 unset(
761 $fields['social_icon_style_alignment'],
762 $fields['rtsb_el_social_icon_style_typography'],
763 $fields['social_icon_style_padding'],
764 );
765 $extra_controls['social_icon_size'] = [
766 'type' => 'slider',
767 'mode' => 'responsive',
768 'label' => esc_html__( 'Icon Size', 'shopbuilder' ),
769 'size_units' => [ 'px' ],
770 'range' => [
771 'px' => [
772 'min' => 0,
773 'max' => 100,
774 ],
775 ],
776 'selectors' => $selectors['icon_size'],
777 ];
778 $fields = Fns::insert_controls( 'social_icon_style_typo_note', $fields, $extra_controls, true );
779 $extra_fields2['social_icon_style_border_radius'] = [
780 'label' => esc_html__( 'Border Radius', 'shopbuilder' ),
781 'type' => 'dimensions',
782 'mode' => 'responsive',
783 'size_units' => [ 'px' ],
784 'selectors' => $selectors['border_radius'],
785 ];
786 $fields = Fns::insert_controls( 'rtsb_el_social_icon_style_border', $fields, $extra_fields2, true );
787 $extra_controls3['social_icon_style_size_note'] = $obj->el_heading(
788 esc_html__( 'Size', 'shopbuilder' ),
789 'before',
790 );
791 $extra_controls3['social_icon_style_width'] = [
792 'type' => 'slider',
793 'mode' => 'responsive',
794 'label' => esc_html__( 'Width', 'shopbuilder' ),
795 'size_units' => [ 'px' ],
796 'range' => [
797 'px' => [
798 'min' => 0,
799 'max' => 100,
800 ],
801 ],
802 'selectors' => $selectors['icon_width'],
803 ];
804 $extra_controls3['social_icon_style_height'] = [
805 'type' => 'slider',
806 'mode' => 'responsive',
807 'label' => esc_html__( 'Height', 'shopbuilder' ),
808 'size_units' => [ 'px' ],
809 'range' => [
810 'px' => [
811 'min' => 0,
812 'max' => 100,
813 ],
814 ],
815 'selectors' => $selectors['icon_height'],
816 ];
817 $fields = Fns::insert_controls( 'social_icon_style_spacing_note', $fields, $extra_controls3 );
818 $extra_controls4['social_icon_style_icon_gap'] = [
819 'type' => 'slider',
820 'mode' => 'responsive',
821 'label' => esc_html__( 'Icon Gap', 'shopbuilder' ),
822 'size_units' => [ 'px' ],
823 'range' => [
824 'px' => [
825 'min' => 0,
826 'max' => 100,
827 ],
828 ],
829 'selectors' => $selectors['icon_gap'],
830 ];
831 $fields = Fns::insert_controls( 'social_icon_style_spacing_note', $fields, $extra_controls4, true );
832 return $fields;
833 }
834
835
836 /**
837 * Retrieves the available image hover effects for team member widgets.
838 *
839 * The effects include options such as 'None', 'Scale In', 'Scale Out', 'Slide Up', 'Slide Down',
840 * 'Slide Right', and 'Slide Left'. These effects are customizable through the 'rtsb/general/widget/team_member_image_hover_effect' filter.
841 *
842 * @return array Associative array of image hover effect keys.
843 */
844 public static function team_member_image_hover_effect() {
845 return apply_filters(
846 'rtsb/general/widget/team_member_image_hover_effect',
847 [
848 'rtsb-gw-img-effect-none' => __( 'None', 'shopbuilder' ),
849 'rtsb-gw-img-zoom-in' => __( 'Scale In', 'shopbuilder' ),
850 'rtsb-gw-img-zoom-out' => __( 'Scale Out', 'shopbuilder' ),
851 'rtsb-gw-img-slide-up' => __( 'Slide Up', 'shopbuilder' ),
852 'rtsb-gw-img-slide-down' => __( 'Slide Down', 'shopbuilder' ),
853 'rtsb-gw-img-slide-right' => __( 'Slide Right', 'shopbuilder' ),
854 'rtsb-gw-img-slide-left' => __( 'Slide Left', 'shopbuilder' ),
855 ]
856 );
857 }
858 }
859