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-grid.php +82 -80 1.0.3 → 1.3.18 View file →
@@ -1,5 +1,6 @@
1 1 <?php
2 +
2 3 namespace UiCoreElements;
3 4
4 5 use Elementor\Controls_Manager;
5 6 use UiCoreElements\UiCoreWidget;
@@ -8,9 +9,10 @@
8 9 use UiCoreElements\Utils\Logo_Trait;
9 10
10 11 defined('ABSPATH') || exit();
11 12
12 -class Logo_Grid extends UiCoreWidget {
13 +class Logo_Grid extends UiCoreWidget
14 +{
13 15
14 16 use Animation_Trait;
15 17 use Grid_Trait;
16 18 use Logo_Trait;
@@ -20,9 +22,9 @@
20 22 return 'uicore-logo-grid';
21 23 }
22 24 public function get_title()
23 25 {
24 - return esc_html__( 'Logo Grid', 'uicore-elements' );
26 + return esc_html__('Logo Grid', 'uicore-elements');
25 27 }
26 28 public function get_icon()
27 29 {
28 30 return 'eicon-logo ui-e-widget';
@@ -32,23 +34,24 @@
32 34 return ['uicore'];
33 35 }
34 36 public function get_keywords()
35 37 {
36 - return [ 'logo', 'grid', 'client', 'brand', 'showcase' ];
38 + return ['logo', 'grid', 'client', 'brand', 'showcase'];
37 39 }
38 40 public function get_styles()
39 41 {
40 - return [
42 + $styles = [
41 43 'logo-grid',
42 - 'animation',
43 - 'entrance',
44 - 'e-animations' => [
45 - 'condition' => [
46 - 'animation_assets' => 'false'
47 - ],
44 + 'grid',
45 + 'animation', // hover animations
46 + 'entrance', // entrance basic style
47 + ];
48 + if (!class_exists('\UiCore\Core') && !class_exists('\UiCoreAnimate\Base')) {
49 + $styles['e-animations'] = [ // entrance animations
48 50 'external' => true,
49 - ]
50 - ];
51 + ];
52 + }
53 + return $styles;
51 54 }
52 55 public function get_scripts()
53 56 {
54 57 return [
@@ -59,75 +62,56 @@
59 62 ],
60 63 ]
61 64 ];
62 65 }
66 + public function has_widget_inner_wrapper(): bool
67 + {
68 + // TODO: remove after Optmized Markup experiment is merged to the core
69 + return ! \Elementor\Plugin::$instance->experiments->is_feature_active('e_optimized_markup');
70 + }
63 71 protected function register_controls()
64 72 {
65 73
66 - $this->register_logo_repeater_controls('Logos'); // Repeater Controls
74 + $this->TRAIT_register_logo_repeater_controls('Logos'); // Repeater Controls
67 75
68 76 $this->start_controls_section(
69 77 'section_grid_settings',
70 78 [
71 - 'label' => __( 'Grid Settings', 'uicore-elements' ),
79 + 'label' => __('Grid Settings', 'uicore-elements'),
72 80 'tab' => Controls_Manager::TAB_CONTENT,
73 81 ]
74 82 );
75 83
76 - $this->add_control(
77 - 'layout',
78 - [
79 - 'label' => __( 'Grid Layout', 'uicore-elements' ),
80 - 'type' => Controls_Manager::SELECT,
81 - 'options' => [
82 - 'inner-border' => __( 'Inner Border', 'uicore-elements' ),
83 - 'outer-border' => __( 'Outer Border', 'uicore-elements' ),
84 - 'divider' => __( 'Inner Divider', 'uicore-elements' ),
85 - ],
86 - 'default' => 'inner-border',
87 - 'frontend_available' => true,
88 - 'style_transfer' => true, // enables the param to be copied/pasted even without selector => []
89 - 'render_type' => 'template',
90 - ]
91 - );
92 - $this->add_responsive_control(
93 - 'columns',
94 - [
95 - 'label' => __( 'Columns', 'uicore-elements' ),
96 - 'type' => Controls_Manager::SELECT,
97 - 'desktop_default' => 4,
98 - 'tablet_default' => 2,
99 - 'mobile_default' => 2,
100 - 'options' => [
101 - 1 => '1',
102 - 2 => '2',
103 - 3 => '3',
104 - 4 => '4',
105 - 5 => '5',
106 - 6 => '6',
107 - 7 => '7',
108 - 8 => '8',
109 - ],
110 - 'render_type' => 'template',
111 - 'frontend_available' => true,
112 - 'selectors' => [
113 - '{{WRAPPER}} .ui-e-grid' => 'grid-template-columns: repeat({{VALUE}}, minmax(0, 1fr))',
114 - ],
115 - ]
116 - );
117 - $this->register_grid_layout_controls(false, [], false, false, ['layout' => 'inner-border']); // Grid controls without maso and columns
84 + $this->add_control(
85 + 'layout',
86 + [
87 + 'label' => __('Grid Layout', 'uicore-elements'),
88 + 'type' => Controls_Manager::SELECT,
89 + 'options' => [
90 + 'inner-border' => __('Inner Border', 'uicore-elements'),
91 + 'outer-border' => __('Outer Border', 'uicore-elements'),
92 + 'divider' => __('Inner Divider', 'uicore-elements'),
93 + ],
94 + 'default' => 'inner-border',
95 + 'frontend_available' => true,
96 + 'style_transfer' => true, // enables the param to be copied/pasted even without selector => []
97 + 'render_type' => 'template',
98 + ]
99 + );
118 100
101 + $this->TRAIT_register_grid_layout_controls();
102 +
119 103 $this->end_controls_section();
120 104
121 105 $this->start_controls_section(
122 106 'section_logo_settings',
123 107 [
124 - 'label' => __( 'Logo Settings', 'uicore-elements' ),
108 + 'label' => __('Logo Settings', 'uicore-elements'),
125 109 'tab' => Controls_Manager::TAB_CONTENT,
126 110 ]
127 111 );
128 112
129 - $this->register_logo_adittional_controls();
113 + $this->TRAIT_register_logo_adittional_controls();
130 114
131 115 $this->end_controls_section();
132 116
133 117 $this->start_controls_section(
@@ -132,14 +116,14 @@
132 116
133 117 $this->start_controls_section(
134 118 'section_logo_grid',
135 119 [
136 - 'label' => __( 'Logo Grid', 'uicore-elements' ),
120 + 'label' => __('Logo Grid', 'uicore-elements'),
137 121 'tab' => Controls_Manager::TAB_STYLE,
138 122 ]
139 123 );
140 124
141 - $this->register_logos_grid_style_controls();
125 + $this->TRAIT_register_logos_grid_style_controls();
142 126
143 127 $this->end_controls_section();
144 128
145 129 $this->start_controls_section(
@@ -144,39 +128,57 @@
144 128
145 129 $this->start_controls_section(
146 130 'animation_style_grid',
147 131 [
148 - 'label' => __( 'Animations', 'uicore-elements' ),
132 + 'label' => __('Animations', 'uicore-elements'),
149 133 'tab' => Controls_Manager::TAB_STYLE,
150 134 ]
151 135 );
152 136
153 - $this->TRAIT_register_entrace_asset_helper();
154 - $this->TRAIT_register_entrance_animations_controls();
155 - $this->TRAIT_register_hover_animation_control(
156 - 'Item Hover Animation',
157 - [],
158 - ['underline']
159 - );
160 - $this->TRAIT_register_hover_animation_control(
161 - 'Logo Hover Animation',
162 - [],
163 - ['underline']
164 - );
137 + $this->TRAIT_register_entrance_animations_controls();
138 + $this->TRAIT_register_hover_animation_control(
139 + 'Item Hover Animation',
140 + [],
141 + ['underline']
142 + );
143 + $this->TRAIT_register_hover_animation_control(
144 + 'Logo Hover Animation',
145 + [],
146 + ['underline']
147 + );
165 148
166 149 $this->end_controls_section();
150 +
151 + // Updates and removes grid component controls
152 + $this->update_control('columns', [
153 + 'default' => 4,
154 + 'desktop_default' => 4,
155 + 'tablet_default' => 2,
156 + 'mobile_default' => 2,
157 + 'render_type' => 'template',
158 + 'frontend_available' => true,
159 + 'selectors' => [
160 + '{{WRAPPER}} .ui-e-grid' => 'grid-template-columns: repeat({{VALUE}}, minmax(0, 1fr))',
161 + ],
162 + ]);
163 + $this->update_control('gap', [
164 + 'condition' => [
165 + 'layout' => 'inner-border'
166 + ],
167 + ]);
168 + $this->remove_control('masonry');
167 169 }
168 170 protected function render()
169 171 {
170 172
171 - if(empty( $this->get_settings_for_display('logo_list'))) {
173 + if (empty($this->get_settings_for_display('logo_list'))) {
172 174 return;
173 175 }
174 176
175 - ?>
176 - <div class='ui-e-grid'>
177 - <?php $this->render_logo_item(); ?>
178 - </div>
179 - <?php
177 +?>
178 + <div class='ui-e-grid'>
179 + <?php $this->TRAIT_render_logo_item(); ?>
180 + </div>
181 +<?php
180 182 }
181 183 }
182 -\Elementor\Plugin::instance()->widgets_manager->register(new Logo_Grid());
184 +\Elementor\Plugin::instance()->widgets_manager->register(new Logo_Grid());