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/logo-carousel.php +75 -91 1.0.6 → 1.3.18 View file →
@@ -1,6 +1,8 @@
1 1 <?php
2 +
2 3 namespace UiCoreElements;
4 +
3 5 use Elementor\Controls_Manager;
4 6 use UiCoreElements\UiCoreWidget;
5 7 use UiCoreElements\Utils\Carousel_Trait;
6 8 use UiCoreElements\Utils\Logo_Trait;
@@ -47,12 +49,13 @@
47 49 public function get_styles()
48 50 {
49 51 $styles = [
50 52 'logo-carousel',
53 + 'carousel',
51 54 'animation', // hover animations
52 55 'entrance', // entrance basic style
53 56 ];
54 - if(!class_exists('\UiCore\Core') && !class_exists('\UiCoreAnimate\Base')){
57 + if (!class_exists('\UiCore\Core') && !class_exists('\UiCoreAnimate\Base')) {
55 58 $styles['e-animations'] = [ // entrance animations
56 59 'external' => true,
57 60 ];
58 61 }
@@ -59,32 +62,15 @@
59 62 return $styles;
60 63 }
61 64 public function get_scripts()
62 65 {
63 - return [
64 - 'carousel',
65 - 'utils/global-testimonial' => [
66 - 'condition' => [
67 - 'layout' => 'layout_5'
68 - ],
69 - ],
70 - 'utils/carousel-effects/circular' => [
71 - 'condition' => [
72 - 'animation_style' => 'circular',
73 - ]
74 - ],
75 - 'utils/carousel-effects/fade-and-blur' => [
76 - 'condition' => [
77 - 'animation_style' => 'fade_blur',
78 - ]
79 - ],
80 - 'entrance' => [
81 - 'condition' => [
82 - 'animate_items' => 'ui-e-grid-animate'
83 - ],
84 - ]
85 - ];
66 + return $this->TRAIT_get_carousel_scripts();
86 67 }
68 + public function has_widget_inner_wrapper(): bool
69 + {
70 + // TODO: remove after Optmized Markup experiment is merged to the core
71 + return ! \Elementor\Plugin::$instance->experiments->is_feature_active('e_optimized_markup');
72 + }
87 73 protected function register_controls()
88 74 {
89 75
90 76 $this->TRAIT_register_logo_repeater_controls('Logo Carousel Items'); // Repeater Controls
@@ -89,18 +75,18 @@
89 75
90 76 $this->TRAIT_register_logo_repeater_controls('Logo Carousel Items'); // Repeater Controls
91 77
92 78 $this->start_controls_section(
93 - 'section_carousel_settings',
94 - [
95 - 'label' => __('Carousel Settings', 'uicore-elements'),
96 - ]
97 - );
79 + 'section_carousel_settings',
80 + [
81 + 'label' => __('Carousel Settings', 'uicore-elements'),
82 + ]
83 + );
98 84
99 - $this->TRAIT_register_carousel_additional_controls(); // Carousel Additionals
100 - $this->TRAIT_register_logo_adittional_controls();
101 - $this->add_control('add_carousel_divider',['type' => Controls_Manager::DIVIDER,]);
102 - $this->TRAIT_register_carousel_settings_controls(); // Carousel settings
85 + $this->TRAIT_register_carousel_additional_controls(); // Carousel Additionals
86 + $this->TRAIT_register_logo_adittional_controls();
87 + $this->add_control('add_carousel_divider', ['type' => Controls_Manager::DIVIDER,]);
88 + $this->TRAIT_register_carousel_settings_controls(); // Carousel settings
103 89
104 90 $this->end_controls_section();
105 91
106 92 $this->TRAIT_register_navigation_controls(); // Navigation settings
@@ -105,48 +91,48 @@
105 91
106 92 $this->TRAIT_register_navigation_controls(); // Navigation settings
107 93
108 94 $this->start_controls_section(
109 - 'section_style_review_items',
110 - [
111 - 'label' => esc_html__( 'Logo Carousel', 'uicore-elements' ),
112 - 'tab' => Controls_Manager::TAB_STYLE,
113 - ]
114 - );
95 + 'section_style_review_items',
96 + [
97 + 'label' => esc_html__('Logo Carousel', 'uicore-elements'),
98 + 'tab' => Controls_Manager::TAB_STYLE,
99 + ]
100 + );
115 101
116 - $this->start_controls_tabs( 'tabs_item_style' );
102 + $this->start_controls_tabs('tabs_item_style');
117 103
118 - $this->start_controls_tab(
119 - 'tab_item_normal',
120 - [
121 - 'label' => esc_html__( 'Normal', 'uicore-elements' ),
122 - ]
123 - );
124 - $this->TRAIT_register_normal_item_style_controls(false);
125 - $this->TRAIT_register_logos_image_style_controls('normal');
126 - $this->end_controls_tab();
104 + $this->start_controls_tab(
105 + 'tab_item_normal',
106 + [
107 + 'label' => esc_html__('Normal', 'uicore-elements'),
108 + ]
109 + );
110 + $this->TRAIT_register_normal_item_style_controls(false);
111 + $this->TRAIT_register_logos_image_style_controls('normal');
112 + $this->end_controls_tab();
127 113
128 - $this->start_controls_tab(
129 - 'tab_item_hover',
130 - [
131 - 'label' => esc_html__( 'Hover', 'uicore-elements' ),
132 - ]
133 - );
134 - $this->TRAIT_register_hover_item_style_controls(false);
135 - $this->TRAIT_register_logos_image_style_controls('hover');
136 - $this->end_controls_tab();
114 + $this->start_controls_tab(
115 + 'tab_item_hover',
116 + [
117 + 'label' => esc_html__('Hover', 'uicore-elements'),
118 + ]
119 + );
120 + $this->TRAIT_register_hover_item_style_controls(false);
121 + $this->TRAIT_register_logos_image_style_controls('hover');
122 + $this->end_controls_tab();
137 123
138 - $this->start_controls_tab(
139 - 'tab_item_active',
140 - [
141 - 'label' => esc_html__( 'Active', 'uicore-elements' ),
142 - ]
143 - );
144 - $this->TRAIT_register_active_item_style_controls(false);
145 - $this->TRAIT_register_logos_image_style_controls('active');
146 - $this->end_controls_tabs();
124 + $this->start_controls_tab(
125 + 'tab_item_active',
126 + [
127 + 'label' => esc_html__('Active', 'uicore-elements'),
128 + ]
129 + );
130 + $this->TRAIT_register_active_item_style_controls(false);
131 + $this->TRAIT_register_logos_image_style_controls('active');
132 + $this->end_controls_tabs();
147 133
148 - $this->end_controls_tabs(); // Necessary because register_testimonial_card_controls() OPENS but DON'T close start_controls_tabs()
134 + $this->end_controls_tabs(); // Necessary because register_testimonial_card_controls() OPENS but DON'T close start_controls_tabs()
149 135
150 136 $this->end_controls_section();
151 137
152 138 $this->TRAIT_register_navigation_style_controls(); // Carousel Navigation Styles
@@ -158,19 +144,19 @@
158 144 'tab' => Controls_Manager::TAB_STYLE,
159 145 ]
160 146 );
161 147
162 - $this->TRAIT_register_entrance_animations_controls();
163 - $this->TRAIT_register_hover_animation_control(
164 - 'Item Hover Animation',
165 - [],
166 - ['underline']
167 - );
168 - $this->TRAIT_register_hover_animation_control(
169 - 'Logo Hover Animation',
170 - [],
171 - ['underline']
172 - );
148 + $this->TRAIT_register_entrance_animations_controls();
149 + $this->TRAIT_register_hover_animation_control(
150 + 'Item Hover Animation',
151 + [],
152 + ['underline']
153 + );
154 + $this->TRAIT_register_hover_animation_control(
155 + 'Logo Hover Animation',
156 + [],
157 + ['underline']
158 + );
173 159
174 160 $this->end_controls_section();
175 161
176 162 // Remove unused logo control
@@ -177,19 +163,17 @@
177 163 $this->remove_control('height');
178 164 }
179 165 public function render()
180 166 {
181 - $ID = $this->get_ID();
182 - $settings = $this->get_settings_for_display();
183 -
184 - $this->add_render_attribute('review-carousel', 'class', ['ui-e-carousel', "carousel-$ID"]);
185 - ?>
186 - <div class="ui-e-carousel swiper">
187 - <div class='swiper-wrapper'>
188 - <?php $this->TRAIT_render_logo_item(); ?>
189 - </div>
190 - <?php $this->TRAIT_render_carousel_navigations(); ?>
167 + $total_slides = count($this->get_settings_for_display('logo_list'));
168 + $this->TRAIT_render_center_loop_warning($total_slides);
169 +?>
170 + <div class="ui-e-carousel swiper">
171 + <div class='swiper-wrapper'>
172 + <?php $this->TRAIT_render_logo_item(); ?>
191 173 </div>
192 - <?php
174 + </div>
175 + <?php $this->TRAIT_render_carousel_navigations($total_slides); ?>
176 +<?php
193 177 }
194 178 }
195 -\Elementor\Plugin::instance()->widgets_manager->register(new LogoCarousel());
179 +\Elementor\Plugin::instance()->widgets_manager->register(new LogoCarousel());