PluginProbe
Easy Elements for Elementor – Addons & Website Templates / 1.3.2
Easy Elements for Elementor – Addons & Website Templates v1.3.2
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.2, at widgets/testimonials-grid/testimonials.php

946 lines 34.6 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_gap',[
687 'label' => esc_html__( 'Author Info Gap', 'easy-elements' ),
688 'type' => \Elementor\Controls_Manager::DIMENSIONS,
689 'size_units' => [ 'px', 'em', '%' ],
690 'selectors' => [
691 '{{WRAPPER}} .ee--tstml-inner-wrap .eel-author-wrap .eel-picture' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
692 ],
693 ]
694 );
695
696 $this->add_responsive_control(
697 'author_image_size',
698 [
699 'label' => esc_html__( 'Image Size', 'easy-elements' ),
700 'type' => \Elementor\Controls_Manager::SLIDER,
701 'size_units' => [ 'px' ],
702 'range' => [
703 'px' => [
704 'min' => 0,
705 'max' => 1000,
706 ],
707 ],
708 'default' => [
709 'size' => 100,
710 'unit' => 'px',
711 ],
712 'selectors' => [
713 '{{WRAPPER}} .eel-author-wrap .eel-picture img' => 'width: {{SIZE}}{{UNIT}} !important; height: {{SIZE}}{{UNIT}} !important; object-fit: cover;',
714 '{{WRAPPER}} .eel-picture img' => 'width: {{SIZE}}{{UNIT}} !important; height: {{SIZE}}{{UNIT}} !important; object-fit: cover;',
715 ],
716 ]
717 );
718 $this->add_responsive_control(
719 'author_image_border_radius',
720 [
721 'label' => esc_html__( 'Border Radius', 'easy-elements' ),
722 'type' => Controls_Manager::DIMENSIONS,
723 'size_units' => [ 'px', 'em', '%' ],
724 'selectors' => [
725 '{{WRAPPER}} .eel-author-wrap .eel-picture img' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
726 '{{WRAPPER}} .eel-picture img' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
727 ],
728 ]
729 );
730
731 $this->end_controls_section();
732
733 $this->start_controls_section(
734 'quote_icon_styles',
735 [
736 'label' => esc_html__( 'Quote Icon', 'easy-elements' ),
737 'tab' => \Elementor\Controls_Manager::TAB_STYLE,
738 ]
739 );
740
741 $this->add_control(
742 'quote_icon_color',
743 [
744 'label' => esc_html__( 'Color', 'easy-elements' ),
745 'type' => \Elementor\Controls_Manager::COLOR,
746 'selectors' => [
747 '{{WRAPPER}} .eel-quote svg' => 'fill: {{VALUE}};',
748 '{{WRAPPER}} .eel-quote svg path' => 'fill: {{VALUE}};',
749 ],
750 ]
751 );
752 $this->add_responsive_control(
753 'quote_icon_size',
754 [
755 'label' => esc_html__( 'Size', 'easy-elements' ),
756 'type' => \Elementor\Controls_Manager::SLIDER,
757 'selectors' => [
758 '{{WRAPPER}} .eel-quote svg' => 'width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}};',
759 ],
760 ]
761 );
762 $this->end_controls_section();
763
764 // Style 3 View All Button
765 $this->start_controls_section(
766 'style3_view_all_button',
767 [
768 'label' => esc_html__( 'View All Button', 'easy-elements' ),
769 'tab' => \Elementor\Controls_Manager::TAB_STYLE,
770 'condition' => [
771 'testimonials_skin' => 'skin3',
772 'show_loadmore' => 'yes',
773 ],
774 ]
775 );
776 $this->add_group_control(
777 \Elementor\Group_Control_Typography::get_type(),
778 [
779 'name' => 'load_more_typography',
780 'label' => esc_html__( 'Typography', 'easy-elements' ),
781 'selector' => '{{WRAPPER}} .eel-testimonial-more-btn',
782 ]
783 );
784 $this->add_control(
785 'load_more_color',
786 [
787 'label' => esc_html__( 'Color', 'easy-elements' ),
788 'type' => \Elementor\Controls_Manager::COLOR,
789 'selectors' => [
790 '{{WRAPPER}} .eel-testimonial-more-btn' => 'color: {{VALUE}}',
791 ],
792 ]
793 );
794 $this->add_group_control(
795 \Elementor\Group_Control_Background::get_type(),
796 [
797 'name' => 'load_more_bg',
798 'label' => esc_html__('Background', 'easy-elements'),
799 'types' => [ 'classic', 'gradient' ],
800 'selector' => '{{WRAPPER}} .eel-testimonial-more-btn',
801 ]
802 );
803 $this->add_responsive_control(
804 'loadmore_padding',
805 [
806 'label' => esc_html__( 'Padding', 'easy-elements' ),
807 'type' => Controls_Manager::DIMENSIONS,
808 'size_units' => [ 'px', 'em', '%' ],
809 'selectors' => [
810 '{{WRAPPER}} .eel-testimonial-more-btn' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
811 ],
812 ]
813 );
814 $this->add_responsive_control(
815 'loadmore_border_radius',
816 [
817 'label' => esc_html__( 'Border Radius', 'easy-elements' ),
818 'type' => Controls_Manager::DIMENSIONS,
819 'size_units' => [ 'px', 'em', '%' ],
820 'selectors' => [
821 '{{WRAPPER}} .eel-testimonial-more-btn' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
822 ],
823 ]
824 );
825 $this->add_group_control(
826 \Elementor\Group_Control_Border::get_type(),
827 [
828 'name' => 'load_more_border',
829 'label' => __('Border', 'easy-elements'),
830 'selector' => '{{WRAPPER}} .eel-testimonial-more-btn',
831 ]
832 );
833 $this->add_control(
834 'load_more_hover_bg_heading',
835 [
836 'label' => esc_html__( 'Hover Style', 'easy-elements' ),
837 'type' => \Elementor\Controls_Manager::HEADING,
838 'separator' => 'before',
839 ]
840 );
841 $this->add_control(
842 'load_more_hover_color',
843 [
844 'label' => esc_html__( 'Hover Color', 'easy-elements' ),
845 'type' => \Elementor\Controls_Manager::COLOR,
846 'selectors' => [
847 '{{WRAPPER}} .eel-testimonial-more-btn:hover' => 'color: {{VALUE}}',
848 ],
849 ]
850 );
851 $this->add_group_control(
852 \Elementor\Group_Control_Background::get_type(),
853 [
854 'name' => 'load_more_hover_bg',
855 'label' => esc_html__('Hover Background', 'easy-elements'),
856 'types' => [ 'classic', 'gradient' ],
857 'selector' => '{{WRAPPER}} .eel-testimonial-more-btn:hover',
858 ]
859 );
860 $this->add_control(
861 'load_more_hover_border_color',
862 [
863 'label' => esc_html__( 'Hover Border Color', 'easy-elements' ),
864 'type' => \Elementor\Controls_Manager::COLOR,
865 'selectors' => [
866 '{{WRAPPER}} .eel-testimonial-more-btn:hover' => 'border-color: {{VALUE}}',
867 ],
868 ]
869 );
870
871 $this->end_controls_section();
872
873 }
874
875 protected function render() {
876 $settings = $this->get_settings_for_display();
877 if ( empty( $settings['easy_testimonials'] ) ) {
878 return;
879 }
880 ?>
881
882 <div class="e-e-testimonial grid-layout">
883 <div class="grid-wrap">
884 <?php $count = 0; foreach ( $settings['easy_testimonials'] as $item ) :
885 $count++;
886 $image_id = $item['image']['id'] ?? '';
887 // Safely get image size, supporting both array and string cases
888 if ( isset( $settings['image_size'] ) ) {
889 if ( is_array( $settings['image_size'] ) && isset( $settings['image_size']['size'] ) ) {
890 $image_size = $settings['image_size']['size'];
891 } else {
892 $image_size = $settings['image_size'];
893 }
894 } else {
895 $image_size = 'full';
896 }
897 if ( $image_id ) {
898 $image_data = wp_get_attachment_image_src( $image_id, $image_size );
899 $alt = get_post_meta( $image_id, '_wp_attachment_image_alt', true );
900 $title = get_the_title( $image_id );
901 } else {
902 $fallback_url = Utils::get_placeholder_image_src();
903 $image_data = [ $fallback_url, 600, 400 ];
904 $alt = esc_attr__( 'Sample Image', 'easy-elements' );
905 $title = esc_attr__( 'Sample Image', 'easy-elements' );
906 }
907
908 $logo_company_id = $item['logo_company']['id'] ?? '';
909 if ( $logo_company_id ) {
910 $logo_data = wp_get_attachment_image_src( $logo_company_id, $image_size );
911 $logo_url = $logo_data[0] ?? '';
912 $logo_alt = get_post_meta( $logo_company_id, '_wp_attachment_image_alt', true );
913 $logo_title = get_the_title( $logo_company_id );
914 }
915
916 $skin = $settings['testimonials_skin'] ?? 'default';
917 $template_path = plugin_dir_path(__FILE__) . 'skins/' . $skin . '.php';
918
919 $classes = 'not-hidden';
920 if ( isset( $count ) && $count > 6 ) {
921 $classes .= ' eel-hidden-testimonial';
922 }
923 ?>
924 <div class="grid-item <?php echo esc_attr($classes); ?>">
925 <div class="ee--testimonial">
926 <?php
927 if ( file_exists( $template_path ) ) {
928 include $template_path;
929 }
930 ?>
931 </div>
932 </div>
933 <?php endforeach; ?>
934 </div>
935 <?php if ( $count > 6 ) : ?>
936 <?php if($settings['show_loadmore'] == 'yes'): ?>
937 <div class="eel-testimonial-more-btn"> <?php echo esc_html($settings['load_more_text']); ?> </div>
938 <?php endif; ?>
939 <?php endif; ?>
940 </div>
941 <?php
942 }
943 }
944
945
946