PluginProbe
UiCore Elements – Free widgets and templates for Elementor / 1.2.0
UiCore Elements – Free widgets and templates for Elementor v1.2.0
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 / widgets / testimonial-grid.php

testimonial-grid.php in UiCore Elements – Free widgets and templates for Elementor 1.2.0, at includes/widgets/testimonial-grid.php

139 lines 4.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 namespace UiCoreElements;
3 use Elementor\Controls_Manager;
4 use UiCoreElements\UiCoreWidget;
5 use UiCoreElements\Utils\Testimonial_Trait;
6 use UiCoreElements\Utils\Animation_Trait;
7 use UiCoreElements\Utils\Grid_Trait;
8 use UicoreElements\Utils\Item_Style_Component;
9
10 use function PHPSTORM_META\map;
11
12 defined('ABSPATH') || exit();
13
14 /**
15 * Testimonial Grid
16 *
17 * @author Lucas Marini Falbo <lucas95@uicore.co>
18 * @since 1.0.1
19 */
20
21 class TestimonialGrid extends UiCoreWidget
22 {
23 use Testimonial_Trait;
24 use Animation_Trait;
25 use Grid_Trait;
26 use Item_Style_Component;
27
28 public function get_name()
29 {
30 return 'uicore-testimonial-grid';
31 }
32 public function get_title()
33 {
34 return esc_html__('Testimonial Grid', 'uicore-elements');
35 }
36 public function get_icon()
37 {
38 return 'eicon-testimonial ui-e-widget';
39 }
40 public function get_categories()
41 {
42 return ['uicore'];
43 }
44 public function get_keywords()
45 {
46 return ['testimonial', 'review', 'services', 'cards', 'box', 'features', 'client', 'grid'];
47 }
48 public function get_styles()
49 {
50 $styles = [
51 'testimonial-grid',
52 'grid',
53 'animation', // hover animations
54 'entrance', // entrance basic style
55 ];
56 if(!class_exists('\UiCore\Core') && !class_exists('\UiCoreAnimate\Base')){
57 $styles['e-animations'] = [ // entrance animations
58 'external' => true,
59 ];
60 }
61 return $styles;
62 }
63 public function get_scripts()
64 {
65 return [
66 'testimonial' => [
67 'condition' => [
68 'layout' => 'layout_5'
69 ],
70 ],
71 'entrance' => [
72 'condition' => [
73 'animate_items' => 'ui-e-grid-animate'
74 ],
75 ]
76 ];
77 }
78 protected function register_controls()
79 {
80
81 $this->TRAIT_register_testimonial_repeater_controls('Testimonial Grid Items'); // Repeater Controls
82
83 $this->start_controls_section( // Specific Additional Grid Controls
84 'section_review_additional_settings',
85 [
86 'label' => __('Additional Settings', 'uicore-elements'),
87 'tab' => Controls_Manager::TAB_CONTENT,
88 ]
89 );
90
91 $this->TRAIT_register_specific_testimonial_controls('layout');
92 $this->TRAIT_register_grid_layout_controls();
93 $this->TRAIT_register_testimonial_additional_controls(); // Content Additional Controls
94
95 $this->end_controls_section();
96
97 $this->start_controls_section(
98 'section_style_review_items',
99 [
100 'label' => esc_html__( 'Items', 'uicore-elements' ),
101 'tab' => Controls_Manager::TAB_STYLE,
102 ]
103 );
104
105 $this->TRAIT_register_all_item_style_controls(false);
106
107 $this->end_controls_section();
108
109 $this->TRAIT_register_style_controls(); // Other Components Style Controls
110
111 $this->start_controls_section(
112 'section_style_animations',
113 [
114 'label' => __('Animations', 'uicore-elements'),
115 'tab' => Controls_Manager::TAB_STYLE,
116 ]
117 );
118
119 $this->TRAIT_register_testimonial_animation_controls();
120
121 $this->end_controls_section();
122 }
123 public function render()
124 {
125 $settings = $this->get_settings_for_display();
126 $layout = $settings['layout'];
127 $masonry = $settings['masonry'] === 'yes' ? 'ui-e-maso' : '';
128
129 $this->add_render_attribute('review-card', 'class', ['ui-e-grid', $masonry]);
130 ?>
131 <div <?php $this->print_render_attribute_string('review-card'); ?>>
132 <?php foreach ( $settings['review_items'] as $index => $item ) : ?>
133 <?php $this->TRAIT_render_review_item($item, $layout); ?>
134 <?php endforeach; ?>
135 </div>
136 <?php
137 }
138 }
139 \Elementor\Plugin::instance()->widgets_manager->register(new TestimonialGrid());