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

137 lines 3.8 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
9 use function PHPSTORM_META\map;
10
11 defined('ABSPATH') || exit();
12
13 /**
14 * Testimonial Grid
15 *
16 * @author Lucas Marini Falbo <lucas95@uicore.co>
17 * @since 1.0.1
18 */
19
20 class TestimonialGrid extends UiCoreWidget
21 {
22 use Testimonial_Trait;
23 use Animation_Trait;
24 use Grid_Trait;
25
26 public function get_name()
27 {
28 return 'uicore-testimonial-grid';
29 }
30 public function get_title()
31 {
32 return esc_html__('Testimonial Grid', 'uicore-elements');
33 }
34 public function get_icon()
35 {
36 return 'eicon-testimonial ui-e-widget';
37 }
38 public function get_categories()
39 {
40 return ['uicore'];
41 }
42 public function get_keywords()
43 {
44 return ['testimonial', 'review', 'services', 'cards', 'box', 'features', 'testimonial', 'client', 'grid'];
45 }
46 public function get_styles()
47 {
48 return [
49 'testimonial-grid',
50 'animation', // hover animations
51 'entrance', // entrance basic style
52 'e-animations' => [ // entrance animations
53 'condition' => [
54 'animation_assets' => 'false'
55 ],
56 'external' => true,
57 ]
58 ];
59 }
60 public function get_scripts()
61 {
62 return [
63 'testimonial' => [
64 'condition' => [
65 'layout' => 'layout_5'
66 ],
67 ],
68 'entrance' => [
69 'condition' => [
70 'animate_items' => 'ui-e-grid-animate'
71 ],
72 ]
73 ];
74 }
75 protected function register_controls()
76 {
77
78 $this->register_testimonial_repeater_controls('Testimonial Grid Items'); // Repeater Controls
79
80 $this->start_controls_section( // Specific Additional Grid Controls
81 'section_review_additional_settings',
82 [
83 'label' => __('Additional Settings', 'uicore-elements'),
84 'tab' => Controls_Manager::TAB_CONTENT,
85 ]
86 );
87
88 $this->TRAIT_register_entrace_asset_helper(); // Animation asset condition
89 $this->register_specific_testimonial_controls('layout');
90 $this->register_grid_layout_controls(); // column, gaps and masonry
91
92 $this->register_testimonial_additional_controls(); // Content Additional Controls
93
94 $this->end_controls_section();
95
96 $this->start_controls_section(
97 'section_style_review_items',
98 [
99 'label' => esc_html__( 'Items', 'uicore-elements' ),
100 'tab' => Controls_Manager::TAB_STYLE,
101 ]
102 );
103
104 $this->register_all_grid_item_style_controls();
105
106 $this->end_controls_section();
107
108 $this->register_style_controls(); // Other Components Style Controls
109
110 $this->start_controls_section(
111 'section_style_animations',
112 [
113 'label' => __('Animations', 'uicore-elements'),
114 'tab' => Controls_Manager::TAB_STYLE,
115 ]
116 );
117
118 $this->register_testimonial_animation_controls();
119
120 $this->end_controls_section();
121 }
122 public function render()
123 {
124 $settings = $this->get_settings_for_display();
125 $layout = $settings['layout'];
126
127 $this->add_render_attribute('review-card', 'class', 'ui-e-grid');
128 ?>
129 <div <?php $this->print_render_attribute_string('review-card'); ?>>
130 <?php foreach ( $settings['review_items'] as $index => $item ) : ?>
131 <?php $this->render_review_item($item, $layout); ?>
132 <?php endforeach; ?>
133 </div>
134 <?php
135 }
136 }
137 \Elementor\Plugin::instance()->widgets_manager->register(new TestimonialGrid());