PluginProbe
UiCore Elements – Free widgets and templates for Elementor / 1.2.3
UiCore Elements – Free widgets and templates for Elementor v1.2.3
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 / logo-grid.php

logo-grid.php in UiCore Elements – Free widgets and templates for Elementor 1.2.3, at includes/widgets/logo-grid.php

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