PluginProbe
UiCore Elements – Free widgets and templates for Elementor / 1.2.3
UiCore Elements – Free widgets and templates for Elementor v1.2.3
1.3.17 1.3.16 trunk 1.0.0 1.0.1 1.0.10 1.0.11 1.0.12 1.0.13 1.0.14 1.0.15 1.0.16 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6 1.0.7 1.0.8 1.0.9 1.2.0 1.2.1 1.2.2 1.2.3 1.2.4 All 41 releases
uicore-elements / includes / utils / testimonial-component.php

testimonial-component.php in UiCore Elements – Free widgets and templates for Elementor 1.2.3, at includes/utils/testimonial-component.php

1,619 lines 60.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 namespace UiCoreElements\Utils;
3
4 use Elementor\Controls_Manager;
5 use Elementor\Plugin;
6 use Elementor\Utils;
7 use Elementor\Repeater;
8 use Elementor\Icons_Manager;
9 use Elementor\Group_Control_Image_Size;
10 use Elementor\Group_Control_Box_Shadow;
11 use Elementor\Group_Control_Border;
12 use Elementor\Group_Control_Typography;
13 use Elementor\Group_Control_Text_Shadow;
14 use Elementor\Core\Kits\Documents\Tabs\Global_Colors;
15 use UiCoreElements\Helper;
16
17
18 defined('ABSPATH') || exit();
19
20 trait Testimonial_Trait {
21
22 // Content Controls Functions
23 function TRAIT_register_testimonial_repeater_controls($logo)
24 {
25 $this->start_controls_section(
26 'section_reviewer_content',
27 [
28 /* translators: %s: Control title */
29 'label' => esc_html( sprintf('%s', $logo), 'uicore-elements'),
30 'tab' => Controls_Manager::TAB_CONTENT,
31 ]
32 );
33
34 $repeater = new Repeater();
35
36 $repeater->add_control(
37 'avatar',
38 [
39 'label' => __('Avatar', 'uicore-elements'),
40 'type' => Controls_Manager::MEDIA,
41 'render_type' => 'template',
42 'dynamic' => [
43 'active' => true,
44 ],
45 'default' => [
46 'url' => Utils::get_placeholder_image_src(),
47 ],
48 ]
49 );
50 $repeater->add_control(
51 'reviewer_name',
52 [
53 'label' => __('Name', 'uicore-elements'),
54 'type' => Controls_Manager::TEXT,
55 'dynamic' => [
56 'active' => true,
57 ],
58 'default' => __('Adam Smith', 'uicore-elements'),
59 'placeholder' => __('Enter reviewer name', 'uicore-elements'),
60 'label_block' => true,
61 ]
62 );
63 $repeater->add_control(
64 'reviewer_job_title',
65 [
66 'label' => __('Job Title', 'uicore-elements'),
67 'type' => Controls_Manager::TEXT,
68 'dynamic' => [
69 'active' => true,
70 ],
71 'default' => __('SEO Expert', 'uicore-elements'),
72 'placeholder' => __('Enter reviewer job title', 'uicore-elements'),
73 'label_block' => true,
74 ]
75 );
76 $repeater->add_control(
77 'rating_number',
78 [
79 'label' => __( 'Rating', 'uicore-elements' ),
80 'type' => Controls_Manager::SLIDER,
81 'size_units' => [ 'px' ],
82 'default' => [
83 'size' => 4.5,
84 ],
85 'range' => [
86 'px' => [
87 'min' => 0,
88 'max' => 5,
89 'step' => .5,
90 ],
91 ],
92 'dynamic' => [
93 'active' => true,
94 ],
95 ]
96 );
97 $repeater->add_control(
98 'review_text',
99 [
100 'label' => __('Review Text', 'uicore-elements'),
101 'type' => Controls_Manager::WYSIWYG,
102 'dynamic' => [
103 'active' => true,
104 ],
105 'default' => __('Click edit button to change this text. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit tellus, luctus nec ullamcorper mattis, pulvinar dapibus leo.', 'uicore-elements'),
106 'placeholder' => __('Enter review text', 'uicore-elements'),
107 ]
108 );
109 $repeater->add_control(
110 'image',
111 [
112 'label' => __('Secondary Image', 'uicore-elements'),
113 'type' => Controls_Manager::MEDIA,
114 'render_type' => 'template',
115 'dynamic' => [
116 'active' => true,
117 ],
118 'default' => [
119 'url' => Utils::get_placeholder_image_src(),
120 ],
121 ]
122 );
123 $this->add_control(
124 'review_items',
125 [
126 'show_label' => false,
127 'type' => Controls_Manager::REPEATER,
128 'fields' => $repeater->get_controls(),
129 'title_field' => '{{{ reviewer_name }}}',
130 'default' => [
131 [
132 'reviewer_name' => __( 'Adam', 'uicore-elements' ),
133 'reviewer_job_title' => __( 'SEO Expert', 'uicore-elements' ),
134 ],
135 [
136 'reviewer_name' => __( 'Karl', 'uicore-elements' ),
137 'reviewer_job_title' => __( 'Designer', 'uicore-elements' ),
138 ],
139 [
140 'reviewer_name' => __( 'Maria', 'uicore-elements' ),
141 'reviewer_job_title' => __( 'Developer', 'uicore-elements' ),
142 ],
143 [
144 'reviewer_name' => __( 'Michael', 'uicore-elements' ),
145 'reviewer_job_title' => __( 'Manager', 'uicore-elements' ),
146 ],
147 [
148 'reviewer_name' => __( 'Lena', 'uicore-elements' ),
149 'reviewer_job_title' => __( 'CEO', 'uicore-elements' ),
150 ],
151 [
152 'reviewer_name' => __( 'Jennifer', 'uicore-elements' ),
153 'reviewer_job_title' => __( 'Consultant', 'uicore-elements' ),
154 ],
155 ]
156 ]
157 );
158
159 $this->end_controls_section();
160 }
161 function TRAIT_register_testimonial_additional_controls()
162 {
163 $this->add_control(
164 'show_reviewer_name',
165 [
166 'label' => __('Show Name', 'uicore-elements'),
167 'type' => Controls_Manager::SWITCHER,
168 'default' => 'yes',
169 'separator' => 'before',
170 ]
171 );
172 $this->add_control(
173 'review_name_tag',
174 [
175 'label' => __('Name HTML Tag', 'uicore-elements'),
176 'type' => Controls_Manager::SELECT,
177 'default' => 'h4',
178 'options' => Helper::get_title_tags(),
179 'condition' => [
180 'show_reviewer_name' => 'yes',
181 ]
182 ]
183 );
184 $this->add_control(
185 'show_reviewer_job_title',
186 [
187 'label' => __('Show Job Title', 'uicore-elements'),
188 'type' => Controls_Manager::SWITCHER,
189 'default' => 'yes',
190 'separator' => 'before',
191 ]
192 );
193 $this->add_control(
194 'show_reviewer_rating',
195 [
196 'label' => __('Show Rating', 'uicore-elements'),
197 'type' => Controls_Manager::SWITCHER,
198 'default' => 'yes',
199 'separator' => 'before'
200 ]
201 );
202 $this->add_control(
203 'rating_type',
204 [
205 'label' => __( 'Rating Type', 'uicore-elements' ),
206 'type' => Controls_Manager::SELECT,
207 'default' => 'star',
208 'options' => [
209 'star' => __( 'Star', 'uicore-elements' ),
210 'number' => __( 'Number', 'uicore-elements' ),
211 ],
212 'condition' => [
213 'show_reviewer_rating' => 'yes'
214 ]
215 ]
216 );
217 $this->add_control(
218 'show_reviewer_text',
219 [
220 'label' => __('Show Review Text', 'uicore-elements'),
221 'type' => Controls_Manager::SWITCHER,
222 'default' => 'yes',
223 'separator' => 'before',
224 ]
225 );
226 $this->add_control(
227 'show_reviewer_image',
228 [
229 'label' => __('Show Image', 'uicore-elements'),
230 'type' => Controls_Manager::SWITCHER,
231 'default' => 'yes',
232 'separator' => 'before',
233 ]
234 );
235 $this->add_group_control(
236 Group_Control_Image_Size::get_type(),
237 [
238 'name' => 'image_media_size',
239 'default' => 'medium',
240 'condition' => [
241 'show_reviewer_image' => 'yes'
242 ]
243 ]
244 );
245 $this->add_control(
246 'show_reviewer_avatar',
247 [
248 'label' => __('Show Avatar', 'uicore-elements'),
249 'type' => Controls_Manager::SWITCHER,
250 'default' => 'yes',
251 'separator' => 'before',
252 ]
253 );
254 $this->add_group_control(
255 Group_Control_Image_Size::get_type(),
256 [
257 'name' => 'avatar_media_size',
258 'default' => 'medium',
259 'condition' => [
260 'show_reviewer_avatar' => 'yes'
261 ]
262 ]
263 );
264 $this->add_control(
265 'image_inline',
266 [
267 'label' => esc_html__('Image Inline', 'uicore-elements'),
268 'type' => Controls_Manager::SWITCHER,
269 'condition' => [
270 'show_reviewer_avatar' => 'yes'
271 ],
272 'prefix_class' => 'ui-e-img-inline-',
273 'render_type' => 'template',
274 'condition' => [
275 'layout' => ['layout_1', 'layout_2', 'layout_3'],
276 'show_reviewer_avatar' => 'yes'
277 ]
278 ]
279 );
280 $this->add_responsive_control(
281 'v_alignment',
282 [
283 'label' => __('Image Alignment', 'uicore-elements'),
284 'type' => Controls_Manager::CHOOSE,
285 'default' => 'flex-start',
286 'toggle' => false,
287 'options' => [
288 'flex-start' => [
289 'title' => __( 'Top', 'uicore-elements' ),
290 'icon' => 'eicon-v-align-top',
291 ],
292 'center' => [
293 'title' => __( 'Center', 'uicore-elements' ),
294 'icon' => 'eicon-v-align-middle',
295 ],
296 'flex-end' => [
297 'title' => __( 'Bottom', 'uicore-elements' ),
298 'icon' => 'eicon-v-align-bottom',
299 ],
300 ],
301 'selectors' => [
302 '{{WRAPPER}} .ui-e-item' => '--ui-e-img-alignment: {{VALUE}};',
303 ],
304 'condition' => [
305 'layout' => 'layout_6'
306 ],
307 ]
308 );
309 $this->add_control(
310 'show_reviewer_divider',
311 [
312 'label' => __('Show Divider', 'uicore-elements'),
313 'type' => Controls_Manager::SWITCHER,
314 'default' => 'yes',
315 'separator' => 'before',
316 'condition' => [
317 'layout' => 'layout_3'
318 ]
319 ]
320 );
321 $this->add_responsive_control(
322 'h_alignment',
323 [
324 'label' => __('Content Alignment', 'uicore-elements'),
325 'type' => Controls_Manager::CHOOSE,
326 'options' => [
327 'left' => [
328 'title' => __('Left', 'uicore-elements'),
329 'icon' => 'eicon-text-align-left',
330 ],
331 'center' => [
332 'title' => __('Center', 'uicore-elements'),
333 'icon' => 'eicon-text-align-center',
334 ],
335 'right' => [
336 'title' => __('Right', 'uicore-elements'),
337 'icon' => 'eicon-text-align-right',
338 ],
339 'justify' => [
340 'title' => __('Justified', 'uicore-elements'),
341 'icon' => 'eicon-text-align-justify',
342 ],
343 ],
344 'prefix_class' => 'ui-e-h-align-',
345 'selectors' => [
346 '{{WRAPPER}} .ui-e-item' => 'text-align: {{VALUE}};',
347 ],
348 'separator' => 'before'
349 ]
350 );
351 $this->add_responsive_control(
352 'content_v_alignment',
353 [
354 'label' => __('Vertical Alignment', 'uicore-elements'),
355 'type' => Controls_Manager::CHOOSE,
356 'default' => 'center',
357 'options' => [
358 'start' => [
359 'title' => __('Top', 'uicore-elements'),
360 'icon' => 'eicon-align-start-v',
361 ],
362 'center' => [
363 'title' => __('Center', 'uicore-elements'),
364 'icon' => 'eicon-align-center-v',
365 ],
366 'end' => [
367 'title' => __('Bottom', 'uicore-elements'),
368 'icon' => 'eicon-align-end-v',
369 ],
370 ],
371 'selectors' => [
372 '{{WRAPPER}} .ui-e-item' => '--ui-e-content-v-alignment: {{VALUE}};',
373 ]
374 ]
375 );
376 }
377
378 // Style Controls Functions}
379 function register_testimonial_image_controls()
380 {
381 $this->start_controls_section(
382 'section_style_avatar',
383 [
384 'label' => __('Avatar', 'uicore-elements'),
385 'tab' => Controls_Manager::TAB_STYLE,
386 'condition' => [
387 'show_reviewer_avatar' => 'yes'
388 ]
389 ]
390 );
391
392 $this->add_group_control(
393 Group_Control_Border::get_type(),
394 [
395 'name' => 'avatar_border',
396 'selector' => '{{WRAPPER}} .ui-e-testimonial-avatar img'
397 ]
398 );
399 $this->add_control(
400 'avatar_radius',
401 [
402 'label' => esc_html__('Border Radius', 'uicore-elements'),
403 'type' => Controls_Manager::DIMENSIONS,
404 'size_units' => ['px', 'em', '%'],
405 'selectors' => [
406 '{{WRAPPER}} .ui-e-testimonial-avatar img' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
407 ],
408 ]
409 );
410 $this->add_responsive_control(
411 'avatar_padding',
412 [
413 'label' => __('Padding', 'uicore-elements'),
414 'type' => Controls_Manager::DIMENSIONS,
415 'size_units' => ['px', 'em', '%'],
416 'selectors' => [
417 '{{WRAPPER}} .ui-e-testimonial-avatar img' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
418 ],
419 ]
420 );
421 $this->add_responsive_control(
422 'avatar_size',
423 [
424 'label' => __('Size', 'uicore-elements'),
425 'type' => Controls_Manager::SLIDER,
426 'size_units' => [ 'px', '%' ],
427 'default' => [
428 'size' => 120,
429 'unit' => 'px'
430 ],
431 'range' => [
432 '%' => [
433 'min' => 1,
434 'max' => 100,
435 ],
436 'px' => [
437 'min' => 10,
438 'max' => 500,
439 ]
440 ],
441 'description' => __('Using `%` might make image height fits the available space, depending on layout and inline options, cutting the image. Using `px` althougt adjust the image.', 'uicore-elements'),
442 'selectors' => [
443 '{{WRAPPER}}' => '--ui-e-avatar-size: {{SIZE}}{{UNIT}};',
444 ],
445 'render_type' => 'template',
446 'condition' => [
447 'layout!' => 'layout_5',
448 ]
449 ]
450 );
451 $this->add_responsive_control(
452 'avatar_size_px',
453 [
454 'label' => __('Size', 'uicore-elements'),
455 'type' => Controls_Manager::SLIDER,
456 'default' => [
457 'size' => 80,
458 'unit' => 'px'
459 ],
460 'range' => [
461 'px' => [
462 'min' => 1,
463 'max' => 250,
464 ],
465 ],
466 'selectors' => [
467 '{{WRAPPER}}' => '--ui-e-avatar-size: {{SIZE}}{{UNIT}};',
468 ],
469 'condition' => [
470 'layout' => 'layout_5',
471 ]
472 ]
473 );
474 $this->add_responsive_control(
475 'avatar_spacing',
476 [
477 'label' => __('Spacing', 'uicore-elements'),
478 'type' => Controls_Manager::SLIDER,
479 'default' => [
480 'size' => 15,
481 ],
482 'selectors' => [
483 '{{WRAPPER}}' => '--ui-e-avatar-spacing: {{SIZE}}{{UNIT}}'
484 ],
485 ]
486 );
487 $this->add_group_control(
488 Group_Control_Box_Shadow::get_type(),
489 [
490 'name' => 'avatar_shadow',
491 'selector' => '{{WRAPPER}} .ui-e-testimonial-avatar img'
492 ]
493 );
494 $this->add_control(
495 'avatar_offset_toggle',
496 [
497 'label' => __('Offset', 'uicore-elements'),
498 'type' => Controls_Manager::POPOVER_TOGGLE,
499 'label_off' => __('None', 'uicore-elements'),
500 'label_on' => __('Custom', 'uicore-elements'),
501 'return_value' => 'yes',
502 ]
503 );
504 $this->start_popover();
505
506 $this->add_responsive_control(
507 'avatar_horizontal_offset',
508 [
509 'label' => __('Horizontal', 'uicore-elements'),
510 'type' => Controls_Manager::SLIDER,
511 'default' => [
512 'size' => 0,
513 ],
514 'tablet_default' => [
515 'size' => 0,
516 ],
517 'mobile_default' => [
518 'size' => 0,
519 ],
520 'range' => [
521 'px' => [
522 'min' => -200,
523 'max' => 200,
524 ],
525 ],
526 'condition' => [
527 'avatar_offset_toggle' => 'yes'
528 ],
529 'render_type' => 'ui',
530 'selectors' => [
531 '{{WRAPPER}}' => '--ui-e-avatar-h-offset: {{SIZE}}px;'
532 ],
533 ]
534 );
535 $this->add_responsive_control(
536 'avatar_vertical_offset',
537 [
538 'label' => __('Vertical', 'uicore-elements'),
539 'type' => Controls_Manager::SLIDER,
540 'default' => [
541 'size' => 0,
542 ],
543 'tablet_default' => [
544 'size' => 0,
545 ],
546 'mobile_default' => [
547 'size' => 0,
548 ],
549 'range' => [
550 'px' => [
551 'min' => -200,
552 'max' => 200,
553 ],
554 ],
555 'condition' => [
556 'avatar_offset_toggle' => 'yes'
557 ],
558 'render_type' => 'ui',
559 'selectors' => [
560 '{{WRAPPER}}' => '--ui-e-avatar-v-offset: {{SIZE}}px;'
561 ],
562 ]
563 );
564 $this->end_popover();
565
566 $this->end_controls_section();
567 $this->start_controls_section(
568 'section_style_image',
569 [
570 'label' => __('Secondary Image', 'uicore-elements'),
571 'tab' => Controls_Manager::TAB_STYLE,
572 'condition' => [
573 'show_reviewer_image' => 'yes'
574 ]
575 ]
576 );
577 $this->add_control(
578 'image_size',
579 [
580 'label' => __('Size', 'uicore-elements'),
581 'type' => Controls_Manager::SLIDER,
582 'default' => [
583 'size' => 40,
584 'unit' => 'px'
585 ],
586 'range' => [
587 'px' => [
588 'min' => 10,
589 'max' => 500,
590 ],
591 ],
592 'selectors' => [
593 '{{WRAPPER}}' => '--ui-e-image-size: {{SIZE}}{{UNIT}};',
594 ],
595 ]
596 );
597 $this->add_control(
598 'image_spacing',
599 [
600 'label' => __('Spacing', 'uicore-elements'),
601 'type' => Controls_Manager::SLIDER,
602 'default' => [
603 'size' => 15,
604 ],
605 'selectors' => [
606 '{{WRAPPER}}' => '--ui-e-img-spacing: {{SIZE}}{{UNIT}}'
607 ],
608 'condition' => [
609 'layout!' => ['layout_2', 'layout_4', 'layout_6'],
610 ]
611 ]
612 );
613 $this->add_control(
614 'image_offset_toggle',
615 [
616 'label' => __('Offset', 'uicore-elements'),
617 'type' => Controls_Manager::POPOVER_TOGGLE,
618 'label_off' => __('None', 'uicore-elements'),
619 'label_on' => __('Custom', 'uicore-elements'),
620 'return_value' => 'yes',
621 ]
622 );
623 $this->start_popover();
624
625 $this->add_responsive_control(
626 'image_horizontal_offset',
627 [
628 'label' => __('Horizontal', 'uicore-elements'),
629 'type' => Controls_Manager::SLIDER,
630 'default' => [
631 'size' => 0,
632 ],
633 'tablet_default' => [
634 'size' => 0,
635 ],
636 'mobile_default' => [
637 'size' => 0,
638 ],
639 'range' => [
640 'px' => [
641 'min' => -200,
642 'max' => 200,
643 ],
644 ],
645 'condition' => [
646 'image_offset_toggle' => 'yes'
647 ],
648 'render_type' => 'ui',
649 'selectors' => [
650 '{{WRAPPER}}' => '--ui-e-img-h-offset: {{SIZE}}px;'
651 ],
652 ]
653 );
654 $this->add_responsive_control(
655 'image_vertical_offset',
656 [
657 'label' => __('Vertical', 'uicore-elements'),
658 'type' => Controls_Manager::SLIDER,
659 'default' => [
660 'size' => 0,
661 ],
662 'tablet_default' => [
663 'size' => 0,
664 ],
665 'mobile_default' => [
666 'size' => 0,
667 ],
668 'range' => [
669 'px' => [
670 'min' => -200,
671 'max' => 200,
672 ],
673 ],
674 'condition' => [
675 'image_offset_toggle' => 'yes'
676 ],
677 'render_type' => 'ui',
678 'selectors' => [
679 '{{WRAPPER}}' => '--ui-e-img-v-offset: {{SIZE}}px;'
680 ],
681 ]
682 );
683 $this->end_popover();
684 $this->end_controls_section();
685 }
686 function register_testimonial_name_controls()
687 {
688 $this->start_controls_section(
689 'section_style_name',
690 [
691 'label' => __('Name', 'uicore-elements'),
692 'tab' => Controls_Manager::TAB_STYLE,
693 'condition' => [
694 'show_reviewer_name' => 'yes',
695 ]
696 ]
697 );
698
699 $this->add_control(
700 'name_color',
701 [
702 'label' => __('Color', 'uicore-elements'),
703 'type' => Controls_Manager::COLOR,
704 'selectors' => [
705 '{{WRAPPER}} .ui-e-testimonial-name' => 'color: {{VALUE}};',
706 ],
707 ]
708 );
709 $this->add_control(
710 'name_hover_color',
711 [
712 'label' => __('Hover Color', 'uicore-elements'),
713 'type' => Controls_Manager::COLOR,
714 'selectors' => [
715 '{{WRAPPER}} .ui-e-item:hover .ui-e-testimonial-name' => 'color: {{VALUE}};',
716 ],
717 ]
718 );
719 $this->add_control(
720 'name_bottom_space',
721 [
722 'label' => __('Spacing', 'uicore-elements'),
723 'type' => Controls_Manager::SLIDER,
724 'range' => [
725 'px' => [
726 'min' => 0,
727 'max' => 100,
728 ],
729 ],
730 'selectors' => [
731 '{{WRAPPER}} .ui-e-testimonial-name' => 'padding-bottom: {{SIZE}}{{UNIT}};',
732 ],
733 ]
734 );
735 $this->add_group_control(
736 Group_Control_Typography::get_type(),
737 [
738 'name' => 'name_typography',
739 'selector' => '{{WRAPPER}} .ui-e-testimonial-name',
740 ]
741 );
742 $this->add_group_control(
743 Group_Control_Text_Shadow::get_type(),
744 [
745 'name' => 'name_shadow',
746 'label' => __( 'Text Shadow', 'uicore-elements' ),
747 'selector' => '{{WRAPPER}} .ui-e-testimonial-name',
748 ]
749 );
750
751 $this->end_controls_section();
752 }
753 function register_testimonial_job_controls()
754 {
755 $this->start_controls_section(
756 'section_style_job_title',
757 [
758 'label' => __('Job Title', 'uicore-elements'),
759 'tab' => Controls_Manager::TAB_STYLE,
760 'condition' => [
761 'show_reviewer_job_title' => 'yes',
762 ]
763 ]
764 );
765
766 $this->add_control(
767 'job_title_color',
768 [
769 'label' => __('Color', 'uicore-elements'),
770 'type' => Controls_Manager::COLOR,
771 'selectors' => [
772 '{{WRAPPER}} .ui-e-testimonial-job-title' => 'color: {{VALUE}};',
773 ],
774 ]
775 );
776 $this->add_control(
777 'job_title_hover_color',
778 [
779 'label' => __('Hover Color', 'uicore-elements'),
780 'type' => Controls_Manager::COLOR,
781 'selectors' => [
782 '{{WRAPPER}} .ui-e-item:hover .ui-e-testimonial-job-title' => 'color: {{VALUE}};',
783 ],
784 ]
785 );
786 $this->add_control(
787 'job_title_bottom_space',
788 [
789 'label' => __('Spacing', 'uicore-elements'),
790 'type' => Controls_Manager::SLIDER,
791 'range' => [
792 'px' => [
793 'min' => 0,
794 'max' => 100,
795 ],
796 ],
797 'default' => [
798 'size' => 10,
799 'unit' => 'px'
800 ],
801 'selectors' => [
802 '{{WRAPPER}} .ui-e-testimonial-job-title' => 'padding-bottom: {{SIZE}}{{UNIT}};',
803 ],
804 ]
805 );
806 $this->add_group_control(
807 Group_Control_Typography::get_type(),
808 [
809 'name' => 'job_title_typography',
810 'selector' => '{{WRAPPER}} .ui-e-testimonial-job-title',
811 ]
812 );
813
814 $this->end_controls_section();
815 }
816 function register_testimonial_text_controls()
817 {
818 $this->start_controls_section(
819 'section_style_text',
820 [
821 'label' => __('Text', 'uicore-elements'),
822 'tab' => Controls_Manager::TAB_STYLE,
823 'condition' => [
824 'show_reviewer_text' => 'yes',
825 ]
826 ]
827 );
828
829 $this->add_control(
830 'text_color',
831 [
832 'label' => __('Color', 'uicore-elements'),
833 'type' => Controls_Manager::COLOR,
834 'selectors' => [
835 '{{WRAPPER}} .ui-e-testimonial-text' => 'color: {{VALUE}};',
836 ],
837 ]
838 );
839 $this->add_control(
840 'text_hover_color',
841 [
842 'label' => __('Hover Color', 'uicore-elements'),
843 'type' => Controls_Manager::COLOR,
844 'selectors' => [
845 '{{WRAPPER}} .ui-e-item:hover .ui-e-testimonial-text' => 'color: {{VALUE}};',
846 ],
847 ]
848 );
849 $this->add_group_control(
850 Group_Control_Typography::get_type(),
851 [
852 'name' => 'text_typography',
853 'selector' => '{{WRAPPER}} .ui-e-testimonial-text',
854 ]
855 );
856 $this->add_control(
857 'text_bottom_space',
858 [
859 'label' => __('Spacing', 'uicore-elements'),
860 'type' => Controls_Manager::SLIDER,
861 'range' => [
862 'px' => [
863 'min' => 0,
864 'max' => 100,
865 ],
866 ],
867 'default' => [
868 'size' => 15,
869 'unit' => 'px'
870 ],
871 'selectors' => [
872 '{{WRAPPER}} .ui-e-testimonial-text' => 'padding-bottom: {{SIZE}}{{UNIT}};',
873 ],
874 ]
875 );
876
877 $this->end_controls_section();
878 }
879 function register_testimonial_rating_controls()
880 {
881 $this->start_controls_section(
882 'section_style_rating',
883 [
884 'label' => esc_html__('Rating', 'uicore-elements'),
885 'tab' => Controls_Manager::TAB_STYLE,
886 'condition' => [
887 'show_reviewer_rating' => 'yes',
888 ],
889 ]
890 );
891
892 // If SVG inline, we only need one color control because the semi-star bg color hack is not enabled with this experiment
893 if(Plugin::$instance->experiments->is_feature_active('e_font_icon_svg')) {
894 $this->add_control(
895 'active_rating_color',
896 [
897 'label' => esc_html__('Color', 'uicore-elements'),
898 'type' => Controls_Manager::COLOR,
899 'default' => '#ffab1a',
900 'selectors' => [
901 '{{WRAPPER}} .ui-e-testimonial-rating svg' => 'fill: {{VALUE}};',
902 ],
903 'condition' => [
904 'rating_type' => 'star',
905 ],
906 ]
907 );
908 // Without the experiment, two colors are usefull because <i> elements can be cut and printed as decimal-stars
909 } else {
910 $this->add_control(
911 'active_rating_color',
912 [
913 'label' => esc_html__('Active Color', 'uicore-elements'),
914 'type' => Controls_Manager::COLOR,
915 'default' => '#ffab1a',
916 'selectors' => [
917 '{{WRAPPER}} .ui-e-testimonial-rating .ui-e-marked i' => 'color: {{VALUE}};',
918 ],
919 'condition' => [
920 'rating_type' => 'star',
921 ],
922 ]
923 );
924 $this->add_control(
925 'rating_color',
926 [
927 'label' => esc_html__('Color', 'uicore-elements'),
928 'type' => Controls_Manager::COLOR,
929 'default' => '#ccd6df',
930 'selectors' => [
931 '{{WRAPPER}} .ui-e-testimonial-rating .ui-e-unmarked i' => 'color: {{VALUE}};',
932 ],
933 'condition' => [
934 'rating_type' => 'star',
935 ],
936 ]
937 );
938 }
939 $this->add_control(
940 'rating_number_color',
941 [
942 'label' => esc_html__('Color', 'uicore-elements'),
943 'type' => Controls_Manager::COLOR,
944 'selectors' => [
945 '{{WRAPPER}} .ui-e-testimonial-rating' => 'color: {{VALUE}};',
946 ],
947 'condition' => [
948 'rating_type' => 'number',
949 ],
950 ]
951 );
952 $this->add_control(
953 'rating_background',
954 [
955 'label' => __( 'Background Color', 'uicore-elements' ),
956 'type' => Controls_Manager::COLOR,
957 'selectors' => [
958 '{{WRAPPER}} .ui-e-testimonial-rating' => 'background-color: {{VALUE}};',
959 ],
960 'condition' => [
961 'rating_type' => 'star',
962 ],
963 ]
964 );
965 $this->add_control(
966 'rating_number_background',
967 [
968 'label' => __( 'Background Color', 'uicore-elements' ),
969 'type' => Controls_Manager::COLOR,
970 'selectors' => [
971 '{{WRAPPER}} .ui-e-testimonial-rating' => 'background-color: {{VALUE}};',
972 ],
973 'global' => [
974 'default' => Global_Colors::COLOR_PRIMARY,
975 ],
976 'condition' => [
977 'rating_type' => 'number',
978 ],
979 ]
980 );
981
982 $this->add_group_control(
983 Group_Control_Border::get_type(),
984 [
985 'name' => 'rating_border',
986 'selector' => '{{WRAPPER}} .ui-e-testimonial-rating',
987 ]
988 );
989 $this->add_control(
990 'rating_border_radius',
991 [
992 'label' => __( 'Border Radius', 'uicore-elements' ),
993 'type' => Controls_Manager::DIMENSIONS,
994 'size_units' => [ 'px', 'em', '%' ],
995 'selectors' => [
996 '{{WRAPPER}} .ui-e-testimonial-rating' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
997 ],
998 ]
999 );
1000 $this->add_control(
1001 'rating_padding',
1002 [
1003 'label' => esc_html__('Padding', 'uicore-elements'),
1004 'type' => Controls_Manager::DIMENSIONS,
1005 'size_units' => ['px', 'em', '%'],
1006 'selectors' => [
1007 '{{WRAPPER}} .ui-e-testimonial-rating' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1008 ],
1009 ]
1010 );
1011 $this->add_control(
1012 'rating_margin',
1013 [
1014 'label' => esc_html__('Margin', 'uicore-elements'),
1015 'type' => Controls_Manager::DIMENSIONS,
1016 'size_units' => ['px', '%'],
1017 'selectors' => [
1018 '{{WRAPPER}} .ui-e-testimonial-rating' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1019 ],
1020 ]
1021 );
1022 $this->add_control(
1023 'rating_size',
1024 [
1025 'label' => esc_html__('Size', 'uicore-elements'),
1026 'type' => Controls_Manager::SLIDER,
1027 'default' => [
1028 'size' => 14,
1029 'unit' => 'px'
1030 ],
1031 'selectors' => [
1032 '{{WRAPPER}} .ui-e-testimonial-rating' => 'font-size: {{SIZE}}{{UNIT}};',
1033 '{{WRAPPER}} .ui-e-testimonial-rating svg' => 'width: {{SIZE}}{{UNIT}};',
1034 ],
1035 ]
1036 );
1037 $this->add_control(
1038 'rating_space_between',
1039 [
1040 'label' => esc_html__('Space Between', 'uicore-elements'),
1041 'type' => Controls_Manager::SLIDER,
1042 'range' => [
1043 'px' => [
1044 'min' => 0,
1045 'max' => 10,
1046 ],
1047 ],
1048 'selectors' => [
1049 '{{WRAPPER}} .ui-e-testimonial-rating .ui-e-icon + .ui-e-icon' => 'margin-left: {{SIZE}}{{UNIT}};', // star type
1050 '{{WRAPPER}} .ui-e-testimonial-rating span' => 'margin-right: {{SIZE}}{{UNIT}};', // number type
1051 ],
1052 'condition' => [
1053 'rating_type' => 'star',
1054 ],
1055 ]
1056 );
1057
1058 $this->end_controls_section();
1059 }
1060 function register_testimonial_divider_controls()
1061 {
1062 $this->start_controls_section(
1063 'section_style_divider',
1064 [
1065 'label' => __('Divider', 'uicore-elements'),
1066 'tab' => Controls_Manager::TAB_STYLE,
1067 'condition' => [
1068 'layout' => 'layout_3',
1069 'show_reviewer_divider' => 'yes'
1070 ]
1071 ]
1072 );
1073
1074 $this->add_control(
1075 'divider_color',
1076 [
1077 'label' => __('Color', 'uicore-elements'),
1078 'type' => Controls_Manager::COLOR,
1079 'selectors' => [
1080 '{{WRAPPER}} .ui-e-testimonial-divider' => 'border-color: {{VALUE}};',
1081 ],
1082 ]
1083 );
1084 $this->add_control(
1085 'divider_spacing',
1086 [
1087 'label' => __('Spacing', 'uicore-elements'),
1088 'type' => Controls_Manager::SLIDER,
1089 'default' => [
1090 'size' => 20,
1091 'unit' => 'px'
1092 ],
1093 'selectors' => [
1094 '{{WRAPPER}} .ui-e-testimonial-divider' => 'margin-bottom: {{SIZE}}{{UNIT}};',
1095 ],
1096 ]
1097 );
1098
1099 $this->end_controls_section();
1100 }
1101
1102 // Register all Style Controls at once but Cards Controls since different widgets may/may not require an 'active' state
1103 function TRAIT_register_style_controls()
1104 {
1105 $this->register_testimonial_image_controls();
1106 $this->register_testimonial_name_controls();
1107 $this->register_testimonial_job_controls();
1108 $this->register_testimonial_text_controls();
1109 $this->register_testimonial_rating_controls();
1110 $this->register_testimonial_divider_controls();
1111 }
1112 // Register all Animation Controls at once
1113 function TRAIT_register_testimonial_animation_controls()
1114 {
1115 $this->TRAIT_register_entrance_animations_controls(); // animate each item
1116 // Hover Animations -- IMPORTANT: any new animation added here must also be added on condition list to the animation wrapper at TRAIT_render_review_item()
1117 $this->TRAIT_register_hover_animation_control(
1118 'Item Hover Animation',
1119 [],
1120 ['underline']
1121 );
1122 $this->TRAIT_register_hover_animation_control(
1123 'Image Animations',
1124 ['show_reviewer_image' => 'yes'],
1125 ['underline']
1126 );
1127 $this->TRAIT_register_hover_animation_control(
1128 'Avatar Animations',
1129 ['show_reviewer_avatar' => 'yes'],
1130 ['underline']
1131 );
1132 $this->TRAIT_register_hover_animation_control(
1133 'Text Animations',
1134 ['show_reviewer_text' => 'yes'],
1135 ['zoom', 'underline']
1136 );
1137 $this->TRAIT_register_hover_animation_control(
1138 'Name Animations',
1139 ['show_reviewer_name' => 'yes'],
1140 ['zoom']
1141 );
1142 $this->TRAIT_register_hover_animation_control(
1143 'Job Animations',
1144 ['show_reviewer_job_title' => 'yes'],
1145 ['zoom']
1146 );
1147 $this->TRAIT_register_hover_animation_control(
1148 'Rating Animations',
1149 ['show_reviewer_rating' => 'yes'],
1150 ['underline']
1151 );
1152 }
1153 // Register specific Controls that can't be called in blocks because are positioned differently on widgets, or used only by specific testimonial types, such as grid or carousel
1154 function TRAIT_register_specific_testimonial_controls($arg)
1155 {
1156
1157 switch ($arg){
1158 case 'layout' :
1159 $this->add_control(
1160 'layout',
1161 [
1162 'label' => esc_html__( 'Layout', 'uicore-elements' ),
1163 'type' => Controls_Manager::SELECT,
1164 'default' => 'layout_1',
1165 'options' => [
1166 'layout_1' => esc_html__( 'Layout 1', 'uicore-elements' ),
1167 'layout_2' => esc_html__( 'Layout 2', 'uicore-elements' ),
1168 'layout_3' => esc_html__( 'Layout 3', 'uicore-elements' ),
1169 'layout_4' => esc_html__( 'Layout 4', 'uicore-elements' ),
1170 'layout_5' => esc_html__( 'Layout 5', 'uicore-elements' ),
1171 'layout_6' => esc_html__( 'Layout 6', 'uicore-elements' ),
1172 ],
1173 'render_type' => 'template',
1174 'prefix_class' => 'ui-e-',
1175 'frontend_available' => true
1176 ]
1177 );
1178 break;
1179
1180 case 'item_animations' :
1181 $this->add_control(
1182 'item_hover_animation',
1183 [
1184 'label' => esc_html__( 'Item Hover Animation', 'uicore-elements' ),
1185 'type' => Controls_Manager::SELECT,
1186 'default' => '',
1187 'label_block' => true,
1188 'options' => $this->get_animations(),
1189 ]
1190 );
1191 break;
1192 }
1193
1194 }
1195
1196 // HTML Rendering Functions
1197 function render_reviewer_avatar($item)
1198 {
1199 $settings = $this->get_settings_for_display();
1200 $fit_avatar = ( $this->is_option('avatar_size') && $settings['avatar_size']['unit'] === 'px' )
1201 ? 'ui-avatar-fit'
1202 : '';
1203
1204 if ( ! $settings['show_reviewer_avatar'] ) {
1205 return;
1206 }
1207
1208 ?>
1209 <div class="ui-e-testimonial-avatar <?php echo esc_attr($settings['avatar_animations']);?> <?php echo esc_attr($fit_avatar);?>">
1210 <?php
1211 $avatar_url = Group_Control_Image_Size::get_attachment_image_src($item['avatar']['id'], 'avatar_media_size', $settings);
1212 if (!$avatar_url) {
1213 printf('<img src="%1$s" alt="%2$s">', esc_url($item['avatar']['url']), esc_html($item['reviewer_name']));
1214 } else {
1215 print(wp_get_attachment_image(
1216 $item['avatar']['id'],
1217 $settings['avatar_media_size_size'],
1218 false,
1219 [
1220 'alt' => esc_html($item['reviewer_name'])
1221 ]
1222 ));
1223 }
1224 ?>
1225 </div>
1226 <?php
1227 }
1228 function render_reviewer_secondary_image($item)
1229 {
1230 $settings = $this->get_settings_for_display();
1231
1232 $thumb_url = Group_Control_Image_Size::get_attachment_image_src($item['image']['id'], 'image_media_size', $settings);
1233
1234 if ( ! $settings['show_reviewer_image'] || !$thumb_url ) {
1235 return;
1236 }
1237
1238 ?>
1239 <div class="ui-e-testimonial-image <?php echo esc_attr($settings['image_animations']);?>">
1240 <?php
1241 if ($thumb_url) {
1242 print(wp_get_attachment_image(
1243 $item['image']['id'],
1244 $settings['image_media_size_size'],
1245 false,
1246 []
1247 ));
1248 }
1249 ?>
1250 </div>
1251 <?php
1252 }
1253 function render_reviewer_name($item)
1254 {
1255 $settings = $this->get_settings_for_display();
1256
1257 if ( ! $settings['show_reviewer_name'] ) {
1258 return;
1259 }
1260
1261 ?>
1262 <?php if ( $item['reviewer_name'] ) : ?>
1263 <<?php echo esc_html($settings['review_name_tag']); ?> class="ui-e-testimonial-name <?php echo esc_attr($settings['name_animations']);?>">
1264 <span><?php echo wp_kses_post($item['reviewer_name']);?></span>
1265 </<?php echo esc_html($settings['review_name_tag']); ?>>
1266 <?php endif; ?>
1267 <?php
1268 }
1269 function render_reviewer_job_title($item)
1270 {
1271 $settings = $this->get_settings_for_display();
1272
1273 if ( ! $settings['show_reviewer_job_title'] ) {
1274 return;
1275 }
1276
1277 ?>
1278 <?php if ( $item['reviewer_job_title'] ) : ?>
1279 <div class="ui-e-testimonial-job-title <?php echo esc_attr($settings['job_animations']);?>">
1280 <span><?php echo esc_html($item['reviewer_job_title']); ?></span>
1281 </div>
1282 <?php endif; ?>
1283 <?php
1284 }
1285 function render_review_text($item)
1286 {
1287 $settings = $this->get_settings_for_display();
1288
1289 if ( ! $settings['show_reviewer_text'] ) {
1290 return;
1291 }
1292
1293 ?>
1294 <?php if ( $item['review_text'] ) : ?>
1295 <div class="ui-e-testimonial-text <?php echo esc_attr($settings['text_animations']);?>">
1296 <?php echo wp_kses_post( $item['review_text'] ); ?>
1297 </div>
1298 <?php endif; ?>
1299 <?php
1300 }
1301 function render_review_rating($item)
1302 {
1303
1304 $settings = $this->get_settings_for_display();
1305
1306 $ID = $item['_id'];
1307 if ( !$settings['show_reviewer_rating'] ) {
1308 return;
1309 }
1310
1311 $rating_value = $item['rating_number']['size']; // get rating value
1312
1313 if ($settings['rating_type'] == 'star') {
1314
1315 ?>
1316 <div class="ui-e-testimonial-rating <?php echo esc_attr($settings['rating_animations']);?>">
1317 <?php
1318
1319 $rating_scale = 5;
1320
1321 if ( '' === $rating_value ) {
1322 $rating_value = $rating_scale;
1323 }
1324
1325 $rating_value = floatval( $rating_value );
1326 $rating_value = round( $rating_value, 2 );
1327
1328 for ( $index = 1; $index <= $rating_scale; $index++ ) {
1329
1330 // SVG Method (uses font-awesome library for it's half-star icon, and can prints full and half-star)
1331 if (Plugin::$instance->experiments->is_feature_active('e_font_icon_svg')){
1332 ?>
1333 <div class="ui-e-icon">
1334 <?php
1335 if ( $rating_value >= $index ) {
1336 echo Icons_Manager::try_get_icon_html( ['value' => 'fas fa-star', 'library' => 'fa-solid'], [ 'aria-hidden' => 'true' ] ); //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
1337 } elseif ( intval( ceil( $rating_value ) ) === $index ) {
1338 echo Icons_Manager::try_get_icon_html( ['value' => 'fas fa-star-half', 'library' => 'fa-solid'], ['aria-hidden' => 'true'] ); //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
1339 }
1340 ?>
1341 </div>
1342 <?php
1343 // Font Icon Method (uses elementor library and can print decimal specific stars)
1344 } else {
1345
1346 if ( $rating_value >= $index ) {
1347 $width = '100%'; // Full star if rate superior to current loop
1348 } elseif ( intval( ceil( $rating_value ) ) === $index ) {
1349 $width = ( $rating_value - ( $index - 1 ) ) * 100 . '%'; // Semi-star, calculating the width based on the decimal value
1350 } else {
1351 $width = '0%'; // No star if rate inferior to current loop
1352 }
1353
1354 // Creates the atts
1355 $this->add_render_attribute( "icon_marked_$ID" . "_$index", [
1356 'class' => 'ui-e-marked',
1357 ] );
1358 if ( '100%' !== $width ) {
1359 $this->add_render_attribute( "icon_marked_$ID" . "_$index", [
1360 'style' => '--ui-e-rate-width: ' . $width . ';',
1361 ] );
1362 }
1363
1364 ?>
1365 <div class="ui-e-icon">
1366 <div <?php $this->print_render_attribute_string( "icon_marked_$ID" . "_$index",); ?>>
1367 <?php echo Icons_Manager::try_get_icon_html( ['value' => 'eicon-star','library' => 'eicons'], [ 'aria-hidden' => 'true' ] ); //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped?>
1368 </div>
1369 <div class="ui-e-unmarked">
1370 <?php echo Icons_Manager::try_get_icon_html( ['value' => 'eicon-star','library' => 'eicons'], [ 'aria-hidden' => 'true' ] ); //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped?>
1371 </div>
1372 </div>
1373 <?php
1374 }
1375 }
1376 ?>
1377 </div>
1378 <?php
1379
1380 } else { // number type rating
1381 ?>
1382 <div class="ui-e-testimonial-rating number">
1383 <span><?php echo esc_html($rating_value);?></span>
1384 </div>
1385 <?php
1386 }
1387 }
1388 function render_review_divider()
1389 {
1390 $settings = $this->get_settings_for_display();
1391
1392 if ( !$settings['show_reviewer_divider'] ) {
1393 return;
1394 }
1395
1396 ?>
1397 <span class="ui-e-testimonial-divider"></span>
1398 <?php
1399 }
1400 function TRAIT_render_review_item($item, $layout)
1401 {
1402 $settings = $this->get_settings_for_display();
1403
1404 // Atts used by some layouts
1405 $atts = [
1406 'inline' => $this->is_option('image_inline', 'yes') ? true : false,
1407 ];
1408
1409 // Get entrance and item hover animation classes
1410 $entrance = $this->is_option('animate_items', 'ui-e-grid-animate') ? 'elementor-invisible' : '';
1411 $hover = isset($settings['item_hover_animation']) ? $settings['item_hover_animation'] : null;
1412 $animations = sprintf('%s %s', $entrance, $hover);
1413
1414 // Get all elements animation control options (triggered by .ui-e-animations-wrp:hover)
1415 $animation_options = [
1416 $settings['image_animations'],
1417 $settings['avatar_animations'],
1418 $settings['text_animations'],
1419 $settings['name_animations'],
1420 $settings['job_animations'],
1421 $settings['rating_animations']
1422 ];
1423 // get item animation only if is not slider,
1424 if (!str_contains($this->get_name(), 'slider')) {
1425 $animation_options[] = $settings['item_hover_animation'];
1426 }
1427 // check if any of the animation are set
1428 $has_animation = array_filter($animation_options, function($value) {
1429 return $value !== '';
1430 });
1431 // and also check if entrance is set
1432 $has_animation = $entrance !== '' ? true : $has_animation;
1433
1434 ?>
1435
1436 <div class="ui-e-wrp swiper-slide">
1437 <?php if (!empty($has_animation)) : ?>
1438 <div class="ui-e-animations-wrp <?php echo esc_attr($animations);?>">
1439 <?php endif; ?>
1440 <div class="ui-e-item">
1441 <?php
1442 switch($layout){
1443 case 'layout_2' :
1444 $this->render_layout_2($item, $atts);
1445 break;
1446 case 'layout_3' :
1447 $this->render_layout_3($item, $atts);
1448 break;
1449 case 'layout_4' :
1450 $this->render_layout_4($item);
1451 break;
1452 case 'layout_5' :
1453 $this->render_layout_5($item);
1454 break;
1455 case 'layout_6' :
1456 $this->render_layout_6($item);
1457 break;
1458 default:
1459 $this->render_layout_1($item, $atts);
1460 break;
1461 }
1462 ?>
1463 </div>
1464 <?php if (!empty($has_animation)) : ?>
1465 </div>
1466 <?php endif; ?>
1467 </div>
1468 <?php
1469 }
1470
1471 // Layouts
1472 function render_layout_1($item, $atts)
1473 {
1474
1475 $this->render_reviewer_secondary_image($item);
1476 ?>
1477 <div class="ui-e-content">
1478
1479 <?php $this->render_review_text($item); ?>
1480
1481 <?php if ($atts['inline']) : ?>
1482
1483 <div class="ui-e-testimonial-flex">
1484 <?php $this->render_reviewer_avatar($item); ?>
1485 <div class="ui-e-inner-content">
1486 <?php
1487 $this->render_reviewer_name($item);
1488 $this->render_reviewer_job_title($item);
1489 $this->render_review_rating($item);
1490 ?>
1491 </div>
1492 </div>
1493
1494 <?php else :
1495 $this->render_reviewer_avatar($item);
1496 $this->render_reviewer_name($item);
1497 $this->render_reviewer_job_title($item);
1498 $this->render_review_rating($item);
1499 endif; ?>
1500
1501 </div>
1502 <?php
1503 }
1504 function render_layout_2($item, $atts)
1505 {
1506 ?>
1507 <div class="ui-e-content">
1508
1509 <?php if ($atts['inline']) : ?>
1510 <div class="ui-e-testimonial-flex">
1511 <?php $this->render_reviewer_avatar($item); ?>
1512 <div class="ui-e-inner-content">
1513 <?php
1514 $this->render_reviewer_name($item);
1515 $this->render_reviewer_job_title($item);
1516 $this->render_review_rating($item);
1517 ?>
1518 </div>
1519 </div>
1520
1521 <?php else :
1522 $this->render_reviewer_avatar($item);
1523 $this->render_reviewer_name($item);
1524 $this->render_reviewer_job_title($item);
1525 $this->render_review_rating($item);
1526 endif; ?>
1527
1528 <?php $this->render_review_text($item); ?>
1529 </div>
1530
1531 <?php
1532 $this->render_reviewer_secondary_image($item);
1533 }
1534 function render_layout_3($item, $atts)
1535 {
1536 $this->render_reviewer_secondary_image($item);
1537 ?>
1538 <div class="ui-e-content">
1539
1540 <?php
1541 $this->render_review_rating($item);
1542 $this->render_review_text($item);
1543 $this->render_review_divider();
1544 ?>
1545
1546 <?php if ($atts['inline']) :?>
1547
1548 <div class="ui-e-testimonial-flex">
1549 <?php $this->render_reviewer_avatar($item); ?>
1550 <div class="ui-e-inner-content">
1551 <?php $this->render_reviewer_name($item); ?>
1552 <?php $this->render_reviewer_job_title($item); ?>
1553 </div>
1554 </div>
1555
1556 <?php else :
1557 $this->render_reviewer_avatar($item);
1558 $this->render_reviewer_name($item);
1559 $this->render_reviewer_job_title($item);
1560 endif; ?>
1561 </div>
1562 <?php
1563 }
1564 function render_layout_4($item)
1565 {
1566 ?>
1567 <div class="ui-e-testimonial-flex">
1568 <?php $this->render_reviewer_avatar($item); ?>
1569 <?php $this->render_reviewer_secondary_image($item); ?>
1570 </div>
1571
1572 <div class="ui-e-content">
1573 <?php
1574 $this->render_review_text($item);
1575 $this->render_reviewer_name($item);
1576 $this->render_reviewer_job_title($item);
1577 $this->render_review_rating($item);
1578 ?>
1579 </div>
1580 <?php
1581 }
1582 function render_layout_5($item)
1583 {
1584 ?>
1585 <div class="ui-e-testimonial-flex">
1586 <div class="ui-e-content">
1587
1588 <?php
1589 $this->render_reviewer_secondary_image($item);
1590 $this->render_review_text($item);
1591 $this->render_review_rating($item);
1592 $this->render_reviewer_name($item);
1593 $this->render_reviewer_job_title($item);
1594 ?>
1595 </div>
1596 <?php $this->render_reviewer_avatar($item); ?>
1597 </div>
1598 <?php
1599 }
1600 function render_layout_6($item)
1601 {
1602 ?>
1603 <div class="ui-e-testimonial-flex">
1604
1605 <?php $this->render_reviewer_avatar($item); ?>
1606
1607 <div class="ui-e-content">
1608 <?php
1609 $this->render_reviewer_name($item);
1610 $this->render_reviewer_job_title($item);
1611 $this->render_review_rating($item);
1612 $this->render_review_text($item);
1613 $this->render_reviewer_secondary_image($item);
1614 ?>
1615 </div>
1616 </div>
1617 <?php
1618 }
1619 }