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 +73 -64 1.2.0 → 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;
@@ -51,9 +53,9 @@
51 53 'carousel',
52 54 'animation', // hover animations
53 55 'entrance', // entrance basic style
54 56 ];
55 - if(!class_exists('\UiCore\Core') && !class_exists('\UiCoreAnimate\Base')){
57 + if (!class_exists('\UiCore\Core') && !class_exists('\UiCoreAnimate\Base')) {
56 58 $styles['e-animations'] = [ // entrance animations
57 59 'external' => true,
58 60 ];
59 61 }
@@ -62,8 +64,13 @@
62 64 public function get_scripts()
63 65 {
64 66 return $this->TRAIT_get_carousel_scripts();
65 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 + }
66 73 protected function register_controls()
67 74 {
68 75
69 76 $this->TRAIT_register_logo_repeater_controls('Logo Carousel Items'); // Repeater Controls
@@ -68,18 +75,18 @@
68 75
69 76 $this->TRAIT_register_logo_repeater_controls('Logo Carousel Items'); // Repeater Controls
70 77
71 78 $this->start_controls_section(
72 - 'section_carousel_settings',
73 - [
74 - 'label' => __('Carousel Settings', 'uicore-elements'),
75 - ]
76 - );
79 + 'section_carousel_settings',
80 + [
81 + 'label' => __('Carousel Settings', 'uicore-elements'),
82 + ]
83 + );
77 84
78 - $this->TRAIT_register_carousel_additional_controls(); // Carousel Additionals
79 - $this->TRAIT_register_logo_adittional_controls();
80 - $this->add_control('add_carousel_divider',['type' => Controls_Manager::DIVIDER,]);
81 - $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
82 89
83 90 $this->end_controls_section();
84 91
85 92 $this->TRAIT_register_navigation_controls(); // Navigation settings
@@ -84,48 +91,48 @@
84 91
85 92 $this->TRAIT_register_navigation_controls(); // Navigation settings
86 93
87 94 $this->start_controls_section(
88 - 'section_style_review_items',
89 - [
90 - 'label' => esc_html__( 'Logo Carousel', 'uicore-elements' ),
91 - 'tab' => Controls_Manager::TAB_STYLE,
92 - ]
93 - );
95 + 'section_style_review_items',
96 + [
97 + 'label' => esc_html__('Logo Carousel', 'uicore-elements'),
98 + 'tab' => Controls_Manager::TAB_STYLE,
99 + ]
100 + );
94 101
95 - $this->start_controls_tabs( 'tabs_item_style' );
102 + $this->start_controls_tabs('tabs_item_style');
96 103
97 - $this->start_controls_tab(
98 - 'tab_item_normal',
99 - [
100 - 'label' => esc_html__( 'Normal', 'uicore-elements' ),
101 - ]
102 - );
103 - $this->TRAIT_register_normal_item_style_controls(false);
104 - $this->TRAIT_register_logos_image_style_controls('normal');
105 - $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();
106 113
107 - $this->start_controls_tab(
108 - 'tab_item_hover',
109 - [
110 - 'label' => esc_html__( 'Hover', 'uicore-elements' ),
111 - ]
112 - );
113 - $this->TRAIT_register_hover_item_style_controls(false);
114 - $this->TRAIT_register_logos_image_style_controls('hover');
115 - $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();
116 123
117 - $this->start_controls_tab(
118 - 'tab_item_active',
119 - [
120 - 'label' => esc_html__( 'Active', 'uicore-elements' ),
121 - ]
122 - );
123 - $this->TRAIT_register_active_item_style_controls(false);
124 - $this->TRAIT_register_logos_image_style_controls('active');
125 - $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();
126 133
127 - $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()
128 135
129 136 $this->end_controls_section();
130 137
131 138 $this->TRAIT_register_navigation_style_controls(); // Carousel Navigation Styles
@@ -137,19 +144,19 @@
137 144 'tab' => Controls_Manager::TAB_STYLE,
138 145 ]
139 146 );
140 147
141 - $this->TRAIT_register_entrance_animations_controls();
142 - $this->TRAIT_register_hover_animation_control(
143 - 'Item Hover Animation',
144 - [],
145 - ['underline']
146 - );
147 - $this->TRAIT_register_hover_animation_control(
148 - 'Logo Hover Animation',
149 - [],
150 - ['underline']
151 - );
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 + );
152 159
153 160 $this->end_controls_section();
154 161
155 162 // Remove unused logo control
@@ -156,15 +163,17 @@
156 163 $this->remove_control('height');
157 164 }
158 165 public function render()
159 166 {
160 - ?>
161 - <div class="ui-e-carousel swiper">
162 - <div class='swiper-wrapper'>
163 - <?php $this->TRAIT_render_logo_item(); ?>
164 - </div>
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(); ?>
165 173 </div>
166 - <?php $this->TRAIT_render_carousel_navigations(); ?>
167 - <?php
174 + </div>
175 + <?php $this->TRAIT_render_carousel_navigations($total_slides); ?>
176 +<?php
168 177 }
169 178 }
170 -\Elementor\Plugin::instance()->widgets_manager->register(new LogoCarousel());
179 +\Elementor\Plugin::instance()->widgets_manager->register(new LogoCarousel());