PluginProbe
UiCore Elements – Free widgets and templates for Elementor / 1.3.18
UiCore Elements – Free widgets and templates for Elementor v1.3.18
1.3.18 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 All 42 releases
← All changes | includes/widgets/testimonial-grid.php +148 -137 1.0.0 → 1.3.18 View file →
@@ -1,137 +1,148 @@
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 <[email protected]>
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());
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 <[email protected]>
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());