PluginProbe
Easy Elements for Elementor – Addons & Website Templates / 1.3.9
Easy Elements for Elementor – Addons & Website Templates v1.3.9
1.5.3 1.5.2 1.5.1 1.5.0 1.4.9 1.4.6 1.4.7 1.4.8 1.4.5 1.4.4 1.4.3 1.2.7 1.2.8 1.2.9 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 1.3.6 1.3.7 1.3.8 1.3.9 1.4.0 All 47 releases
easy-elements / widgets / testimonials-grid / testimonials.php

testimonials.php in Easy Elements for Elementor – Addons & Website Templates 1.3.9, at widgets/testimonials-grid/testimonials.php

972 lines 35.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 namespace Easyel\EasyElements\Widgets;
3 use Elementor\Repeater;
4 use Elementor\Utils;
5 use Elementor\Controls_Manager;
6 use Elementor\Responsive_Control;
7 use Elementor\Group_Control_Image_Size;
8
9 defined( 'ABSPATH' ) || die();
10
11 class Easyel_Testimonials__Widget extends \Elementor\Widget_Base {
12
13 public function get_name() {
14 return 'eel-testimonials';
15 }
16
17 public function get_title() {
18 return esc_html__( 'Testimonials Grid', 'easy-elements' );
19 }
20
21 public function get_icon() {
22 return 'easyicon easyelIcon-testimonials-grid';
23 }
24
25 public function get_categories() {
26 return [ 'easyelements_category' ];
27 }
28
29 public function get_keywords() {
30 return [ 'testimonials', 'clients', 'feedback', 'partner', 'text' ];
31 }
32
33 public function get_style_depends() {
34 return [
35 'eel-testimonials',
36 ];
37 }
38
39 public function get_script_depends() {
40 return [
41 'eel-testimonials',
42 ];
43 }
44
45 protected function register_controls() {
46 $this->start_controls_section(
47 '_section_layout',
48 [
49 'label' => esc_html__( 'Layout Settings', 'easy-elements' ),
50 'tab' => Controls_Manager::TAB_CONTENT,
51 ]
52 );
53
54 $this->add_control(
55 'testimonials_skin',
56 [
57 'label' => esc_html__('Skin Type', 'easy-elements'),
58 'type' => \Elementor\Controls_Manager::SELECT,
59 'default' => 'default',
60 'options' => [
61 'default' => esc_html__('default', 'easy-elements'),
62 'skin1' => esc_html__('Skin 01', 'easy-elements'),
63 'skin2' => esc_html__('Skin 02', 'easy-elements'),
64 'skin3' => esc_html__('Skin 03', 'easy-elements'),
65 'skin4' => esc_html__('Skin 04', 'easy-elements'),
66 'skin5' => esc_html__('Skin 05', 'easy-elements'),
67 'skin6' => esc_html__('Skin 06', 'easy-elements'),
68 ],
69 ]
70 );
71
72 $this->add_control(
73 'avatar_image_top',
74 [
75 'label' => esc_html__('Avatar Image Top', 'easy-elements'),
76 'type' => \Elementor\Controls_Manager::SWITCHER,
77 'default' => '',
78 'label_on' => esc_html__( 'Yes', 'easy-elements' ),
79 'label_off' => esc_html__( 'No', 'easy-elements' ),
80 'return_value' => 'yes',
81 'condition' => [
82 'testimonials_skin' => ['skin2'],
83 ],
84 ]
85 );
86
87 $this->add_control(
88 'show_loadmore',
89 [
90 'label' => esc_html__( 'View All Button', 'easy-elements' ),
91 'type' => \Elementor\Controls_Manager::SWITCHER,
92 'label_on' => esc_html__( 'Show', 'easy-elements' ),
93 'label_off' => esc_html__( 'Hide', 'easy-elements' ),
94 'default' => 'no',
95 'condition' => [
96 'testimonials_skin' => ['skin3'],
97 ],
98 'description' => sprintf(
99 // Translators: %s is the number of items after which the button will work.
100 '<strong>%s</strong>',
101 sprintf(
102 // Translators: %s is the number of items after which the button will work.
103 __('This button will work after %s items', 'easy-elements'),
104 6
105 )
106 ),
107
108 ]
109 );
110
111 $this->add_control(
112 'load_more_text',
113 [
114 'label' => esc_html__('View all reviews', 'easy-elements'),
115 'type' => Controls_Manager::TEXT,
116 'default' => esc_html__( 'View all reviews', 'easy-elements' ),
117 'label_block' => true,
118 'condition' => [
119 'testimonials_skin' => 'skin3',
120 'show_loadmore' => 'yes',
121 ],
122 ]
123 );
124
125 $this->end_controls_section();
126
127 $this->start_controls_section(
128 '_section_logo',
129 [
130 'label' => esc_html__( 'Testimonials Settings', 'easy-elements' ),
131 'tab' => Controls_Manager::TAB_CONTENT,
132 ]
133 );
134
135 $repeater = new Repeater();
136
137 $repeater->add_control(
138 'image',
139 [
140 'label' => esc_html__('Picture', 'easy-elements'),
141 'type' => Controls_Manager::MEDIA,
142 'default' => [
143 'url' => Utils::get_placeholder_image_src(),
144 ],
145 ]
146 );
147
148 $repeater->add_control(
149 'name',
150 [
151 'label' => esc_html__('Name', 'easy-elements'),
152 'type' => Controls_Manager::TEXT,
153 'default' => esc_html__( 'Stefan Sears', 'easy-elements' ),
154 'label_block' => true,
155 ]
156 );
157
158 $repeater->add_control(
159 'designation',
160 [
161 'label' => esc_html__('Designation', 'easy-elements'),
162 'type' => Controls_Manager::TEXT,
163 'default' => esc_html__( 'Developer, Easy Elements Inc', 'easy-elements' ),
164 'label_block' => true,
165 ]
166 );
167
168 $repeater->add_control(
169 'description',
170 [
171 'label' => esc_html__('Description', 'easy-elements'),
172 'type' => Controls_Manager::TEXTAREA,
173 'default' => esc_html__( 'Enter Stefan Sears Description', 'easy-elements' ),
174 ]
175 );
176
177 $repeater->add_control(
178 'quote_icon',
179 [
180 'label' => esc_html__( 'Quote Icon', 'easy-elements' ),
181 'type' => \Elementor\Controls_Manager::ICONS,
182 'label_block' => true,
183 'default' => [
184 'value' => 'fas fa-quote-right',
185 'library' => 'fa-solid',
186 ],
187 'separator' => 'after',
188 'description' => sprintf(
189 '<strong>%s</strong>',
190 __('Only Default skin supported', 'easy-elements')
191 ),
192
193 ]
194 );
195 $repeater->add_control(
196 'rating',
197 [
198 'label' => esc_html__( 'Rating', 'easy-elements' ),
199 'type' => \Elementor\Controls_Manager::SELECT,
200 'options' => [
201 '1' => '�
202 ☆☆☆☆',
203 '2' => '�
204
205 ☆☆☆',
206 '3' => '�
207
208
209 ☆☆',
210 '4' => '�
211
212
213
214 ',
215 '5' => '�
216
217
218
219
220 ',
221 ],
222 'default' => '5',
223 'separator' => 'after',
224 'description' => sprintf(
225 '<strong>%s</strong>',
226 __('[skin1, skin2, skin4] skins type not supported', 'easy-elements')
227 ),
228
229 ]
230 );
231 $repeater->add_control(
232 'logo_company',
233 [
234 'label' => esc_html__('Logo', 'easy-elements'),
235 'type' => Controls_Manager::MEDIA,
236 'default' => [ '' ],
237 'description' => sprintf(
238 '<strong>%s</strong>',
239 __('Default skin not supported', 'easy-elements')
240 ),
241
242 ]
243 );
244
245 $this->add_control(
246 'easy_testimonials',
247 [
248 'type' => Controls_Manager::REPEATER,
249 'fields' => $repeater->get_controls(),
250 'title_field' => '{{{ name }}}',
251 'default' => array_fill( 0, 4, [
252 'image' => [ 'url' => Utils::get_placeholder_image_src() ],
253 'name' => esc_html__( 'Stefan Sears', 'easy-elements' ),
254 'description' => esc_html__( 'This service exceeded all my expectations. The team was professional, fast, and truly cared about delivering a top-notch experience from start to finish.', 'easy-elements' ),
255 ]),
256 ]
257 );
258
259 $this->add_group_control(
260 Group_Control_Image_Size::get_type(),
261 [
262 'name' => 'image',
263 'default' => 'full',
264 ]
265 );
266
267 $this->add_control(
268 'show_image',
269 [
270 'label' => esc_html__( 'Show Image', 'easy-elements' ),
271 'type' => \Elementor\Controls_Manager::SWITCHER,
272 'label_on' => esc_html__( 'Show', 'easy-elements' ),
273 'label_off' => esc_html__( 'Hide', 'easy-elements' ),
274 'return_value' => 'yes',
275 'default' => 'yes',
276 ]
277 );
278
279 $this->add_responsive_control(
280 'columns',
281 [
282 'label' => esc_html__( 'Select Columns', 'easy-elements' ),
283 'type' => Controls_Manager::SELECT,
284 'default' => '3',
285 'tablet_default' => '3',
286 'mobile_default' => '2',
287 'options' => [
288 '1' => '1 Column',
289 '2' => '2 Columns',
290 '3' => '3 Columns',
291 '4' => '4 Columns',
292 '5' => '5 Columns',
293 '6' => '6 Columns',
294 ],
295 'selectors' => [
296 '{{WRAPPER}} .e-e-testimonial .grid-item' => 'width: calc(100% / {{VALUE}});',
297 ],
298 'condition' => [
299 'testimonials_skin!' => ['default', 'skin4'],
300 ],
301 ]
302 );
303
304 $this->add_responsive_control(
305 'item_padding',
306 [
307 'label' => esc_html__( 'Item Padding', 'easy-elements' ),
308 'type' => Controls_Manager::DIMENSIONS,
309 'size_units' => [ 'px', 'em', '%' ],
310 'selectors' => [
311 '{{WRAPPER}} .e-e-testimonial .grid-item' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
312 ],
313 ]
314 );
315
316 $this->add_responsive_control(
317 'logo_height',
318 [
319 'label' => esc_html__( 'Logo Height', 'easy-elements' ),
320 'type' => \Elementor\Controls_Manager::SLIDER,
321 'size_units' => [ 'px', 'em', '%' ],
322 'range' => [
323 'px' => [
324 'min' => 20,
325 'max' => 500,
326 ],
327 'em' => [
328 'min' => 1,
329 'max' => 20,
330 ],
331 '%' => [
332 'min' => 1,
333 'max' => 100,
334 ],
335 ],
336 'selectors' => [
337 '{{WRAPPER}} .ee--tstml-inner-wrap.skin1 .eel-company-logo img, {{WRAPPER}} .eel-company-logo img' => 'height: {{SIZE}}{{UNIT}}; width:auto;',
338 ],
339 'condition' => [ 'testimonials_skin!' => 'default' ],
340 ]
341 );
342
343 $this->add_control(
344 'show_rating',
345 [
346 'label' => esc_html__( 'Show Rating', 'easy-elements' ),
347 'type' => \Elementor\Controls_Manager::SWITCHER,
348 'label_on' => esc_html__( 'Show', 'easy-elements' ),
349 'label_off' => esc_html__( 'Hide', 'easy-elements' ),
350 'return_value' => 'yes',
351 'default' => 'yes',
352 'condition' => [
353 'testimonials_skin!' => ['skin1','skin2','skin4'],
354 ],
355 ]
356 );
357 $this->add_control(
358 'rating_color',
359 [
360 'label' => esc_html__( 'Rating Color', 'easy-elements' ),
361 'type' => \Elementor\Controls_Manager::COLOR,
362 'selectors' => [
363 '{{WRAPPER}} .eel-rating span.star' => 'color: {{VALUE}};',
364 ],
365 'condition' => [
366 'testimonials_skin!' => ['skin1','skin2','skin4'],
367 'show_rating' => 'yes',
368 ],
369 ]
370 );
371 $this->add_responsive_control(
372 'rating_size',
373 [
374 'label' => esc_html__( 'Rating Size', 'easy-elements' ),
375 'type' => \Elementor\Controls_Manager::SLIDER,
376 'selectors' => [
377 '{{WRAPPER}} .eel-rating span.star' => 'font-size: {{SIZE}}{{UNIT}};',
378 ],
379 'condition' => [
380 'testimonials_skin!' => ['skin1','skin2','skin4'],
381 'show_rating' => 'yes',
382 ],
383 ]
384 );
385
386 $this->add_control(
387 'title_icon',
388 [
389 'label' => esc_html__( 'Title Icon', 'easy-elements' ),
390 'type' => \Elementor\Controls_Manager::ICONS,
391 'label_block' => true,
392 'default' => [
393 'value' => 'fas fa-check-circle',
394 'library' => 'fa-solid',
395 ],
396 'condition' => [
397 'testimonials_skin' => ['skin1'],
398 ],
399 ]
400 );
401
402 $this->end_controls_section();
403
404 $this->start_controls_section(
405 'section_style_item',
406 [
407 'label' => esc_html__( 'Item', 'easy-elements' ),
408 'tab' => \Elementor\Controls_Manager::TAB_STYLE,
409 ]
410 );
411
412
413 $this->add_group_control(
414 \Elementor\Group_Control_Background::get_type(),
415 [
416 'name' => 'bg',
417 'label' => __('Background', 'easy-elements'),
418 'types' => ['classic', 'gradient'],
419 'selector' => '{{WRAPPER}} .ee--tstml-inner-wrap',
420 ]
421 );
422
423 $this->add_group_control(
424 \Elementor\Group_Control_Border::get_type(),
425 [
426 'name' => 'border',
427 'label' => __('Border', 'easy-elements'),
428 'selector' => '{{WRAPPER}} .ee--tstml-inner-wrap',
429 ]
430 );
431
432
433 $this->add_control(
434 'border_radius',
435 [
436 'label' => __('Border Radius', 'easy-elements'),
437 'type' => \Elementor\Controls_Manager::DIMENSIONS,
438 'size_units' => ['px', '%', 'em'],
439 'selectors' => [
440 '{{WRAPPER}} .ee--tstml-inner-wrap' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
441 ],
442 ]
443 );
444
445 $this->add_group_control(
446 \Elementor\Group_Control_Box_Shadow::get_type(),
447 [
448 'name' => 'box_shadow',
449 'label' => __('Box Shadow', 'easy-elements'),
450 'selector' => '{{WRAPPER}} .ee--tstml-inner-wrap',
451 ]
452 );
453
454 $this->add_responsive_control(
455 'padding',
456 [
457 'label' => __('Padding', 'easy-elements'),
458 'type' => \Elementor\Controls_Manager::DIMENSIONS,
459 'size_units' => ['px', 'em', '%'],
460 'selectors' => [
461 '{{WRAPPER}} .ee--tstml-inner-wrap' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
462 ],
463 ]
464 );
465
466 $this->add_responsive_control(
467 'wrapper_gap',
468 [
469 'label' => __('Gap', 'easy-elements'),
470 'type' => \Elementor\Controls_Manager::SLIDER,
471 'size_units' => ['px', 'em', '%'],
472 'selectors' => [
473 '{{WRAPPER}} .ee--tstml-inner-wrap' => 'gap: {{SIZE}}{{UNIT}};',
474 ],
475 'condition' => [
476 'testimonials_skin' => 'default'
477 ]
478 ]
479 );
480
481 $this->end_controls_section();
482
483
484 $this->start_controls_section(
485 '_section_name',
486 [
487 'label' => esc_html__( 'Name', 'easy-elements' ),
488 'tab' => Controls_Manager::TAB_STYLE,
489 ]
490 );
491
492 $this->add_control(
493 'name_color',
494 [
495 'label' => esc_html__( 'Color', 'easy-elements' ),
496 'type' => \Elementor\Controls_Manager::COLOR,
497 'selectors' => [
498 '{{WRAPPER}} .ee--tstml-inner-wrap .eel-name' => 'color: {{VALUE}};',
499 ],
500 ]
501 );
502
503 $this->add_group_control(
504 \Elementor\Group_Control_Typography::get_type(),
505 [
506 'name' => 'name_typography',
507 'label' => esc_html__( 'Typography', 'easy-elements' ),
508 'selector' => '{{WRAPPER}} .ee--tstml-inner-wrap .eel-name',
509 ]
510 );
511 $this->add_responsive_control(
512 'name_margin',
513 [
514 'label' => __('Margin', 'easy-elements'),
515 'type' => \Elementor\Controls_Manager::DIMENSIONS,
516 'size_units' => ['px', '%', 'em'],
517 'selectors' => [
518 '{{WRAPPER}} .ee--tstml-inner-wrap .eel-author-wrap' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
519 ],
520 ]
521 );
522
523 $this->end_controls_section();
524
525 $this->start_controls_section(
526 '_section_designation',
527 [
528 'label' => esc_html__( 'Designation', 'easy-elements' ),
529 'tab' => Controls_Manager::TAB_STYLE,
530 ]
531 );
532
533 $this->add_control(
534 'designation_color',
535 [
536 'label' => esc_html__( 'Color', 'easy-elements' ),
537 'type' => \Elementor\Controls_Manager::COLOR,
538 'selectors' => [
539 '{{WRAPPER}} .ee--tstml-inner-wrap .eel-designation' => 'color: {{VALUE}};',
540 ],
541 ]
542 );
543
544 $this->add_group_control(
545 \Elementor\Group_Control_Typography::get_type(),
546 [
547 'name' => 'designation_typography',
548 'label' => esc_html__( 'Typography', 'easy-elements' ),
549 'selector' => '{{WRAPPER}} .ee--tstml-inner-wrap .eel-designation',
550 ]
551 );
552
553 $this->end_controls_section();
554
555 $this->start_controls_section(
556 '_section_description',
557 [
558 'label' => esc_html__( 'Description', 'easy-elements' ),
559 'tab' => Controls_Manager::TAB_STYLE,
560 ]
561 );
562 $this->add_control(
563 'description_color',
564 [
565 'label' => esc_html__( 'Color', 'easy-elements' ),
566 'type' => \Elementor\Controls_Manager::COLOR,
567 'selectors' => [
568 '{{WRAPPER}} .ee--tstml-inner-wrap .eel-description' => 'color: {{VALUE}};',
569 ],
570 ]
571 );
572
573 $this->add_group_control(
574 \Elementor\Group_Control_Typography::get_type(),
575 [
576 'name' => 'description_typography',
577 'label' => esc_html__( 'Typography', 'easy-elements' ),
578 'selector' => '{{WRAPPER}} .ee--tstml-inner-wrap .eel-description',
579 ]
580 );
581
582 $this->add_responsive_control(
583 'description_margin',
584 [
585 'label' => esc_html__( 'Description Margin', 'easy-elements' ),
586 'type' => \Elementor\Controls_Manager::DIMENSIONS,
587 'size_units' => [ 'px', '%', 'em' ],
588 'selectors' => [
589 '{{WRAPPER}} .ee--tstml-inner-wrap .eel-description' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
590 ],
591 ]
592 );
593
594 $this->add_responsive_control(
595 'min_height',
596 [
597 'label' => esc_html__( 'Min Height', 'easy-elements' ),
598 'type' => \Elementor\Controls_Manager::SLIDER,
599 'size_units' => [ 'px', 'em', '%' ],
600 'range' => [
601 'px' => [
602 'min' => 20,
603 'max' => 500,
604 ],
605 'em' => [
606 'min' => 1,
607 'max' => 20,
608 ],
609 '%' => [
610 'min' => 1,
611 'max' => 100,
612 ],
613 ],
614 'selectors' => [
615 '{{WRAPPER}} .ee--tstml-inner-wrap .eel-description' => 'min-height: {{SIZE}}{{UNIT}}; width:auto;',
616 ],
617 ]
618 );
619
620 $this->add_responsive_control(
621 'max_width',
622 [
623 'label' => esc_html__( 'Max Width', 'easy-elements' ),
624 'type' => \Elementor\Controls_Manager::SLIDER,
625 'size_units' => [ 'px', 'em', '%' ],
626 'range' => [
627 'px' => [
628 'min' => 20,
629 'max' => 500,
630 ],
631 'em' => [
632 'min' => 1,
633 'max' => 20,
634 ],
635 '%' => [
636 'min' => 1,
637 'max' => 100,
638 ],
639 ],
640 'selectors' => [
641 '{{WRAPPER}} .ee--tstml-inner-wrap .eel-description' => 'max-width: {{SIZE}}{{UNIT}};',
642 ],
643 ]
644 );
645
646 $this->end_controls_section();
647
648 $this->start_controls_section(
649 'author_image',
650 [
651 'label' => esc_html__( 'Author Image Settings', 'easy-elements' ),
652 'tab' => \Elementor\Controls_Manager::TAB_STYLE,
653 'condition' => [
654 'show_image' => 'yes',
655 ],
656 ]
657 );
658
659 $this->add_control(
660 'author_meta_alignment',
661 [
662 'label' => esc_html__( 'Author Info Alignment', 'easy-elements' ),
663 'type' => \Elementor\Controls_Manager::CHOOSE,
664 'options' => [
665 'flex-start' => [
666 'title' => esc_html__( 'flex-start', 'easy-elements' ),
667 'icon' => 'eicon-h-align-left',
668 ],
669 'center' => [
670 'title' => esc_html__( 'item-center', 'easy-elements' ),
671 'icon' => 'eicon-h-align-center',
672 ],
673 'flex-end' => [
674 'title' => esc_html__( 'flex-end', 'easy-elements' ),
675 'icon' => 'eicon-h-align-right',
676 ],
677 ],
678 'default' => 'flex-start',
679 'selectors' => [
680 '{{WRAPPER}} .ee--tstml-inner-wrap .eel-author-wrap' => 'align-items: {{VALUE}};',
681 ],
682 ]
683 );
684
685 $this->add_responsive_control(
686 'author_meta_alignment_style4',
687 [
688 'label' => esc_html__( 'Alignment', 'easy-elements' ),
689 'type' => \Elementor\Controls_Manager::CHOOSE,
690 'options' => [
691 'left' => [
692 'title' => esc_html__( 'Left', 'easy-elements' ),
693 'icon' => 'eicon-text-align-left',
694 ],
695 'center' => [
696 'title' => esc_html__( 'Center', 'easy-elements' ),
697 'icon' => 'eicon-text-align-center',
698 ],
699 'right' => [
700 'title' => esc_html__( 'Right', 'easy-elements' ),
701 'icon' => 'eicon-text-align-right',
702 ],
703 ],
704 'default' => 'left',
705 'selectors' => [
706 '{{WRAPPER}} .ee--tstml-inner-wrap.skin4 .eel-author' => 'text-align: {{VALUE}};',
707 ],
708 ]
709 );
710
711 $this->add_responsive_control(
712 'author_meta_gap',[
713 'label' => esc_html__( 'Author Info Gap', 'easy-elements' ),
714 'type' => \Elementor\Controls_Manager::DIMENSIONS,
715 'size_units' => [ 'px', 'em', '%' ],
716 'selectors' => [
717 '{{WRAPPER}} .ee--tstml-inner-wrap .eel-author-wrap .eel-picture' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
718 ],
719 ]
720 );
721
722 $this->add_responsive_control(
723 'author_image_size',
724 [
725 'label' => esc_html__( 'Image Size', 'easy-elements' ),
726 'type' => \Elementor\Controls_Manager::SLIDER,
727 'size_units' => [ 'px' ],
728 'range' => [
729 'px' => [
730 'min' => 0,
731 'max' => 1000,
732 ],
733 ],
734 'default' => [
735 'size' => 100,
736 'unit' => 'px',
737 ],
738 'selectors' => [
739 '{{WRAPPER}} .eel-author-wrap .eel-picture img' => 'width: {{SIZE}}{{UNIT}} !important; height: {{SIZE}}{{UNIT}} !important; object-fit: cover;',
740 '{{WRAPPER}} .eel-picture img' => 'width: {{SIZE}}{{UNIT}} !important; height: {{SIZE}}{{UNIT}} !important; object-fit: cover;',
741 ],
742 ]
743 );
744 $this->add_responsive_control(
745 'author_image_border_radius',
746 [
747 'label' => esc_html__( 'Border Radius', 'easy-elements' ),
748 'type' => Controls_Manager::DIMENSIONS,
749 'size_units' => [ 'px', 'em', '%' ],
750 'selectors' => [
751 '{{WRAPPER}} .eel-author-wrap .eel-picture img' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
752 '{{WRAPPER}} .eel-picture img' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
753 ],
754 ]
755 );
756
757 $this->end_controls_section();
758
759 $this->start_controls_section(
760 'quote_icon_styles',
761 [
762 'label' => esc_html__( 'Quote Icon', 'easy-elements' ),
763 'tab' => \Elementor\Controls_Manager::TAB_STYLE,
764 ]
765 );
766
767 $this->add_control(
768 'quote_icon_color',
769 [
770 'label' => esc_html__( 'Color', 'easy-elements' ),
771 'type' => \Elementor\Controls_Manager::COLOR,
772 'selectors' => [
773 '{{WRAPPER}} .eel-quote svg' => 'fill: {{VALUE}};',
774 '{{WRAPPER}} .eel-quote svg path' => 'fill: {{VALUE}};',
775 ],
776 ]
777 );
778 $this->add_responsive_control(
779 'quote_icon_size',
780 [
781 'label' => esc_html__( 'Size', 'easy-elements' ),
782 'type' => \Elementor\Controls_Manager::SLIDER,
783 'selectors' => [
784 '{{WRAPPER}} .eel-quote svg' => 'width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}};',
785 ],
786 ]
787 );
788 $this->end_controls_section();
789
790 // Style 3 View All Button
791 $this->start_controls_section(
792 'style3_view_all_button',
793 [
794 'label' => esc_html__( 'View All Button', 'easy-elements' ),
795 'tab' => \Elementor\Controls_Manager::TAB_STYLE,
796 'condition' => [
797 'testimonials_skin' => 'skin3',
798 'show_loadmore' => 'yes',
799 ],
800 ]
801 );
802 $this->add_group_control(
803 \Elementor\Group_Control_Typography::get_type(),
804 [
805 'name' => 'load_more_typography',
806 'label' => esc_html__( 'Typography', 'easy-elements' ),
807 'selector' => '{{WRAPPER}} .eel-testimonial-more-btn',
808 ]
809 );
810 $this->add_control(
811 'load_more_color',
812 [
813 'label' => esc_html__( 'Color', 'easy-elements' ),
814 'type' => \Elementor\Controls_Manager::COLOR,
815 'selectors' => [
816 '{{WRAPPER}} .eel-testimonial-more-btn' => 'color: {{VALUE}}',
817 ],
818 ]
819 );
820 $this->add_group_control(
821 \Elementor\Group_Control_Background::get_type(),
822 [
823 'name' => 'load_more_bg',
824 'label' => esc_html__('Background', 'easy-elements'),
825 'types' => [ 'classic', 'gradient' ],
826 'selector' => '{{WRAPPER}} .eel-testimonial-more-btn',
827 ]
828 );
829 $this->add_responsive_control(
830 'loadmore_padding',
831 [
832 'label' => esc_html__( 'Padding', 'easy-elements' ),
833 'type' => Controls_Manager::DIMENSIONS,
834 'size_units' => [ 'px', 'em', '%' ],
835 'selectors' => [
836 '{{WRAPPER}} .eel-testimonial-more-btn' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
837 ],
838 ]
839 );
840 $this->add_responsive_control(
841 'loadmore_border_radius',
842 [
843 'label' => esc_html__( 'Border Radius', 'easy-elements' ),
844 'type' => Controls_Manager::DIMENSIONS,
845 'size_units' => [ 'px', 'em', '%' ],
846 'selectors' => [
847 '{{WRAPPER}} .eel-testimonial-more-btn' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
848 ],
849 ]
850 );
851 $this->add_group_control(
852 \Elementor\Group_Control_Border::get_type(),
853 [
854 'name' => 'load_more_border',
855 'label' => __('Border', 'easy-elements'),
856 'selector' => '{{WRAPPER}} .eel-testimonial-more-btn',
857 ]
858 );
859 $this->add_control(
860 'load_more_hover_bg_heading',
861 [
862 'label' => esc_html__( 'Hover Style', 'easy-elements' ),
863 'type' => \Elementor\Controls_Manager::HEADING,
864 'separator' => 'before',
865 ]
866 );
867 $this->add_control(
868 'load_more_hover_color',
869 [
870 'label' => esc_html__( 'Hover Color', 'easy-elements' ),
871 'type' => \Elementor\Controls_Manager::COLOR,
872 'selectors' => [
873 '{{WRAPPER}} .eel-testimonial-more-btn:hover' => 'color: {{VALUE}}',
874 ],
875 ]
876 );
877 $this->add_group_control(
878 \Elementor\Group_Control_Background::get_type(),
879 [
880 'name' => 'load_more_hover_bg',
881 'label' => esc_html__('Hover Background', 'easy-elements'),
882 'types' => [ 'classic', 'gradient' ],
883 'selector' => '{{WRAPPER}} .eel-testimonial-more-btn:hover',
884 ]
885 );
886 $this->add_control(
887 'load_more_hover_border_color',
888 [
889 'label' => esc_html__( 'Hover Border Color', 'easy-elements' ),
890 'type' => \Elementor\Controls_Manager::COLOR,
891 'selectors' => [
892 '{{WRAPPER}} .eel-testimonial-more-btn:hover' => 'border-color: {{VALUE}}',
893 ],
894 ]
895 );
896
897 $this->end_controls_section();
898
899 }
900
901 protected function render() {
902 $settings = $this->get_settings_for_display();
903 if ( empty( $settings['easy_testimonials'] ) ) {
904 return;
905 }
906 ?>
907
908 <div class="e-e-testimonial grid-layout">
909 <div class="grid-wrap">
910 <?php $count = 0; foreach ( $settings['easy_testimonials'] as $item ) :
911 $count++;
912 $image_id = $item['image']['id'] ?? '';
913 // Safely get image size, supporting both array and string cases
914 if ( isset( $settings['image_size'] ) ) {
915 if ( is_array( $settings['image_size'] ) && isset( $settings['image_size']['size'] ) ) {
916 $image_size = $settings['image_size']['size'];
917 } else {
918 $image_size = $settings['image_size'];
919 }
920 } else {
921 $image_size = 'full';
922 }
923 if ( $image_id ) {
924 $image_data = wp_get_attachment_image_src( $image_id, $image_size );
925 $alt = get_post_meta( $image_id, '_wp_attachment_image_alt', true );
926 $title = get_the_title( $image_id );
927 } else {
928 $fallback_url = Utils::get_placeholder_image_src();
929 $image_data = [ $fallback_url, 600, 400 ];
930 $alt = esc_attr__( 'Sample Image', 'easy-elements' );
931 $title = esc_attr__( 'Sample Image', 'easy-elements' );
932 }
933
934 $logo_company_id = $item['logo_company']['id'] ?? '';
935 if ( $logo_company_id ) {
936 $logo_data = wp_get_attachment_image_src( $logo_company_id, $image_size );
937 $logo_url = $logo_data[0] ?? '';
938 $logo_alt = get_post_meta( $logo_company_id, '_wp_attachment_image_alt', true );
939 $logo_title = get_the_title( $logo_company_id );
940 }
941
942 $skin = $settings['testimonials_skin'] ?? 'default';
943 $template_path = plugin_dir_path(__FILE__) . 'skins/' . $skin . '.php';
944
945 $classes = 'not-hidden';
946 if ( isset( $count ) && $count > 6 ) {
947 $classes .= ' eel-hidden-testimonial';
948 }
949 ?>
950 <div class="grid-item <?php echo esc_attr($classes); ?>">
951 <div class="ee--testimonial">
952 <?php
953 if ( file_exists( $template_path ) ) {
954 include $template_path;
955 }
956 ?>
957 </div>
958 </div>
959 <?php endforeach; ?>
960 </div>
961 <?php if ( $count > 6 ) : ?>
962 <?php if($settings['show_loadmore'] == 'yes'): ?>
963 <div class="eel-testimonial-more-btn"> <?php echo esc_html($settings['load_more_text']); ?> </div>
964 <?php endif; ?>
965 <?php endif; ?>
966 </div>
967 <?php
968 }
969 }
970
971
972