| @@ -1,5 +1,6 @@ | ||
| 1 | 1 | <?php |
| 2 | + | |
| 2 | 3 | namespace UiCoreElements; |
| 3 | 4 | |
| 4 | 5 | use Elementor\Controls_Manager; |
| 5 | 6 | use Elementor\Group_Control_Background; |
| @@ -58,9 +59,9 @@ | ||
| 58 | 59 | ], |
| 59 | 60 | 'animation', // hover animations |
| 60 | 61 | 'entrance', // entrance basic style |
| 61 | 62 | ]; |
| 62 | - if(!class_exists('\UiCore\Core') && !class_exists('\UiCoreAnimate\Base')){ | |
| 63 | + if (!class_exists('\UiCore\Core') && !class_exists('\UiCoreAnimate\Base')) { | |
| 63 | 64 | $styles['e-animations'] = [ // entrance animations |
| 64 | 65 | 'external' => true, |
| 65 | 66 | ]; |
| 66 | 67 | } |
| @@ -80,12 +81,13 @@ | ||
| 80 | 81 | ], |
| 81 | 82 | ] |
| 82 | 83 | ]; |
| 83 | 84 | } |
| 84 | - // TODO: remove or set as false, after 3.30, when the full deprecation of widget innet wrapper is ready | |
| 85 | - public function has_widget_inner_wrapper(): bool { | |
| 86 | - return true; | |
| 87 | - } | |
| 85 | + public function has_widget_inner_wrapper(): bool | |
| 86 | + { | |
| 87 | + // TODO: remove after Optmized Markup experiment is merged to the core | |
| 88 | + return ! \Elementor\Plugin::$instance->experiments->is_feature_active('e_optimized_markup'); | |
| 89 | + } | |
| 88 | 90 | protected function register_controls() |
| 89 | 91 | { |
| 90 | 92 | $this->TRAIT_register_gallery_repeater_controls('Content'); |
| 91 | 93 | $this->TRAIT_register_additional_controls(); |
| @@ -97,9 +99,9 @@ | ||
| 97 | 99 | 'tab' => Controls_Manager::TAB_CONTENT, |
| 98 | 100 | ] |
| 99 | 101 | ); |
| 100 | 102 | |
| 101 | - $this->TRAIT_register_grid_layout_controls(); | |
| 103 | + $this->TRAIT_register_grid_layout_controls(); | |
| 102 | 104 | |
| 103 | 105 | $this->end_controls_section(); |
| 104 | 106 | |
| 105 | 107 | $this->start_controls_section( |
| @@ -109,9 +111,9 @@ | ||
| 109 | 111 | 'tab' => Controls_Manager::TAB_STYLE, |
| 110 | 112 | ] |
| 111 | 113 | ); |
| 112 | 114 | |
| 113 | - $this->TRAIT_register_all_item_style_controls(false); | |
| 115 | + $this->TRAIT_register_all_item_style_controls(false); | |
| 114 | 116 | |
| 115 | 117 | $this->end_controls_section(); |
| 116 | 118 | |
| 117 | 119 | $this->TRAIT_register_filters_style_controls(); |
| @@ -144,10 +146,10 @@ | ||
| 144 | 146 | 'bottom' => 10, |
| 145 | 147 | 'left' => 10, |
| 146 | 148 | ], |
| 147 | 149 | 'selectors' => [ |
| 148 | - '{{WRAPPER}} .ui-e-content' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 149 | - ], | |
| 150 | + '{{WRAPPER}} .ui-e-content' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 151 | + ], | |
| 150 | 152 | ] |
| 151 | 153 | ); |
| 152 | 154 | $this->update_control( |
| 153 | 155 | 'item_border_radius', |
| @@ -182,29 +184,29 @@ | ||
| 182 | 184 | 'of' => 'item_border_border', |
| 183 | 185 | 'at' => 'before', |
| 184 | 186 | ]); |
| 185 | 187 | |
| 186 | - // normal background controls | |
| 187 | - $this->add_group_control( | |
| 188 | - Group_Control_Background::get_type(), | |
| 189 | - [ | |
| 190 | - 'name' => 'item_gallery_background', | |
| 191 | - 'selector' => '{{WRAPPER}} .ui-e-item', | |
| 192 | - 'condition' => [ | |
| 193 | - 'layout' => '', | |
| 194 | - ] | |
| 188 | + // normal background controls | |
| 189 | + $this->add_group_control( | |
| 190 | + Group_Control_Background::get_type(), | |
| 191 | + [ | |
| 192 | + 'name' => 'item_gallery_background', | |
| 193 | + 'selector' => '{{WRAPPER}} .ui-e-item', | |
| 194 | + 'condition' => [ | |
| 195 | + 'layout' => '', | |
| 195 | 196 | ] |
| 196 | - ); | |
| 197 | - $this->add_group_control( | |
| 198 | - Group_Control_Background::get_type(), | |
| 199 | - [ | |
| 200 | - 'name' => 'item_content_background', | |
| 201 | - 'selector' => '{{WRAPPER}} .ui-e-content', | |
| 202 | - 'condition' => [ | |
| 203 | - 'layout' => 'ui-e-overlay', | |
| 204 | - ] | |
| 197 | + ] | |
| 198 | + ); | |
| 199 | + $this->add_group_control( | |
| 200 | + Group_Control_Background::get_type(), | |
| 201 | + [ | |
| 202 | + 'name' => 'item_content_background', | |
| 203 | + 'selector' => '{{WRAPPER}} .ui-e-content', | |
| 204 | + 'condition' => [ | |
| 205 | + 'layout' => 'ui-e-overlay', | |
| 205 | 206 | ] |
| 206 | - ); | |
| 207 | + ] | |
| 208 | + ); | |
| 207 | 209 | |
| 208 | 210 | $this->end_injection(); |
| 209 | 211 | |
| 210 | 212 | $this->start_injection([ |
| @@ -211,29 +213,29 @@ | ||
| 211 | 213 | 'of' => 'item_hover_border_color', |
| 212 | 214 | 'at' => 'before', |
| 213 | 215 | ]); |
| 214 | 216 | |
| 215 | - // hover background controls | |
| 216 | - $this->add_group_control( | |
| 217 | - Group_Control_Background::get_type(), | |
| 218 | - [ | |
| 219 | - 'name' => 'item_gallery_hover_background', | |
| 220 | - 'selector' => '{{WRAPPER}} .ui-e-item:hover', | |
| 221 | - 'condition' => [ | |
| 222 | - 'layout' => '', | |
| 223 | - ] | |
| 217 | + // hover background controls | |
| 218 | + $this->add_group_control( | |
| 219 | + Group_Control_Background::get_type(), | |
| 220 | + [ | |
| 221 | + 'name' => 'item_gallery_hover_background', | |
| 222 | + 'selector' => '{{WRAPPER}} .ui-e-item:hover', | |
| 223 | + 'condition' => [ | |
| 224 | + 'layout' => '', | |
| 224 | 225 | ] |
| 225 | - ); | |
| 226 | - $this->add_group_control( | |
| 227 | - Group_Control_Background::get_type(), | |
| 228 | - [ | |
| 229 | - 'name' => 'item_content_hover_background', | |
| 230 | - 'selector' => '{{WRAPPER}} .ui-e-item:hover .ui-e-content', | |
| 231 | - 'condition' => [ | |
| 232 | - 'layout' => 'ui-e-overlay', | |
| 233 | - ] | |
| 226 | + ] | |
| 227 | + ); | |
| 228 | + $this->add_group_control( | |
| 229 | + Group_Control_Background::get_type(), | |
| 230 | + [ | |
| 231 | + 'name' => 'item_content_hover_background', | |
| 232 | + 'selector' => '{{WRAPPER}} .ui-e-item:hover .ui-e-content', | |
| 233 | + 'condition' => [ | |
| 234 | + 'layout' => 'ui-e-overlay', | |
| 234 | 235 | ] |
| 235 | - ); | |
| 236 | + ] | |
| 237 | + ); | |
| 236 | 238 | |
| 237 | 239 | $this->end_injection(); |
| 238 | 240 | } |
| 239 | 241 | public function render() |
| @@ -238,16 +240,16 @@ | ||
| 238 | 240 | } |
| 239 | 241 | public function render() |
| 240 | 242 | { |
| 241 | 243 | $settings = $this->get_settings_for_display(); |
| 242 | - $masonry = ( isset($settings['masonry']) && $settings['masonry'] === 'yes' ) ? 'ui-e-maso' : ''; | |
| 244 | + $masonry = $this->is_option('masonry', 'yes') ? 'ui-e-maso' : ''; | |
| 243 | 245 | |
| 244 | 246 | $this->TRAIT_render_gallery_filters($settings); |
| 245 | 247 | |
| 246 | - ?> | |
| 247 | - <div class='ui-e-grid ui-e-items-wrp <?php echo esc_attr($masonry) ;?>'> | |
| 248 | - <?php $this->TRAIT_render_gallery($settings); ?> | |
| 249 | - </div> | |
| 250 | - <?php | |
| 248 | +?> | |
| 249 | + <div class='ui-e-grid ui-e-items-wrp <?php echo esc_attr($masonry); ?>'> | |
| 250 | + <?php $this->TRAIT_render_gallery($settings); ?> | |
| 251 | + </div> | |
| 252 | +<?php | |
| 251 | 253 | } |
| 252 | 254 | } |
| 253 | -\Elementor\Plugin::instance()->widgets_manager->register(new GalleryGrid()); | |
| 255 | +\Elementor\Plugin::instance()->widgets_manager->register(new GalleryGrid()); | |