PluginProbe
UiCore Elements – Free widgets and templates for Elementor / 1.3.17
UiCore Elements – Free widgets and templates for Elementor v1.3.17
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.3.17, at includes/widgets/testimonial-grid.php

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