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

143 lines 4.1 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 // TODO: remove or set as false, after 3.30, when the full deprecation of widget innet wrapper is ready
79 public function has_widget_inner_wrapper(): bool {
80 return true;
81 }
82 protected function register_controls()
83 {
84
85 $this->TRAIT_register_testimonial_repeater_controls('Testimonial Grid Items'); // Repeater Controls
86
87 $this->start_controls_section( // Specific Additional Grid Controls
88 'section_review_additional_settings',
89 [
90 'label' => __('Additional Settings', 'uicore-elements'),
91 'tab' => Controls_Manager::TAB_CONTENT,
92 ]
93 );
94
95 $this->TRAIT_register_specific_testimonial_controls('layout');
96 $this->TRAIT_register_grid_layout_controls();
97 $this->TRAIT_register_testimonial_additional_controls(); // Content Additional Controls
98
99 $this->end_controls_section();
100
101 $this->start_controls_section(
102 'section_style_review_items',
103 [
104 'label' => esc_html__( 'Items', 'uicore-elements' ),
105 'tab' => Controls_Manager::TAB_STYLE,
106 ]
107 );
108
109 $this->TRAIT_register_all_item_style_controls(false);
110
111 $this->end_controls_section();
112
113 $this->TRAIT_register_style_controls(); // Other Components Style Controls
114
115 $this->start_controls_section(
116 'section_style_animations',
117 [
118 'label' => __('Animations', 'uicore-elements'),
119 'tab' => Controls_Manager::TAB_STYLE,
120 ]
121 );
122
123 $this->TRAIT_register_testimonial_animation_controls();
124
125 $this->end_controls_section();
126 }
127 public function render()
128 {
129 $settings = $this->get_settings_for_display();
130 $layout = $settings['layout'];
131 $masonry = $settings['masonry'] === 'yes' ? 'ui-e-maso' : '';
132
133 $this->add_render_attribute('review-card', 'class', ['ui-e-grid', $masonry]);
134 ?>
135 <div <?php $this->print_render_attribute_string('review-card'); ?>>
136 <?php foreach ( $settings['review_items'] as $index => $item ) : ?>
137 <?php $this->TRAIT_render_review_item($item, $layout); ?>
138 <?php endforeach; ?>
139 </div>
140 <?php
141 }
142 }
143 \Elementor\Plugin::instance()->widgets_manager->register(new TestimonialGrid());