| @@ -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\Testimonial_Trait; |
| 6 | 8 | use UiCoreElements\Utils\Animation_Trait; |
| @@ -52,9 +54,9 @@ | ||
| 52 | 54 | 'grid', |
| 53 | 55 | 'animation', // hover animations |
| 54 | 56 | 'entrance', // entrance basic style |
| 55 | 57 | ]; |
| 56 | - if(!class_exists('\UiCore\Core') && !class_exists('\UiCoreAnimate\Base')){ | |
| 58 | + if (!class_exists('\UiCore\Core') && !class_exists('\UiCoreAnimate\Base')) { | |
| 57 | 59 | $styles['e-animations'] = [ // entrance animations |
| 58 | 60 | 'external' => true, |
| 59 | 61 | ]; |
| 60 | 62 | } |
| @@ -74,8 +76,13 @@ | ||
| 74 | 76 | ], |
| 75 | 77 | ] |
| 76 | 78 | ]; |
| 77 | 79 | } |
| 80 | + public function has_widget_inner_wrapper(): bool | |
| 81 | + { | |
| 82 | + // TODO: remove after Optmized Markup experiment is merged to the core | |
| 83 | + return ! \Elementor\Plugin::$instance->experiments->is_feature_active('e_optimized_markup'); | |
| 84 | + } | |
| 78 | 85 | protected function register_controls() |
| 79 | 86 | { |
| 80 | 87 | |
| 81 | 88 | $this->TRAIT_register_testimonial_repeater_controls('Testimonial Grid Items'); // Repeater Controls |
| @@ -87,23 +94,23 @@ | ||
| 87 | 94 | 'tab' => Controls_Manager::TAB_CONTENT, |
| 88 | 95 | ] |
| 89 | 96 | ); |
| 90 | 97 | |
| 91 | - $this->TRAIT_register_specific_testimonial_controls('layout'); | |
| 92 | - $this->TRAIT_register_grid_layout_controls(); | |
| 93 | - $this->TRAIT_register_testimonial_additional_controls(); // Content Additional Controls | |
| 98 | + $this->TRAIT_register_specific_testimonial_controls('layout'); | |
| 99 | + $this->TRAIT_register_grid_layout_controls(); | |
| 100 | + $this->TRAIT_register_testimonial_additional_controls(); // Content Additional Controls | |
| 94 | 101 | |
| 95 | 102 | $this->end_controls_section(); |
| 96 | 103 | |
| 97 | 104 | $this->start_controls_section( |
| 98 | - 'section_style_review_items', | |
| 99 | - [ | |
| 100 | - 'label' => esc_html__( 'Items', 'uicore-elements' ), | |
| 101 | - 'tab' => Controls_Manager::TAB_STYLE, | |
| 102 | - ] | |
| 103 | - ); | |
| 105 | + 'section_style_review_items', | |
| 106 | + [ | |
| 107 | + 'label' => esc_html__('Items', 'uicore-elements'), | |
| 108 | + 'tab' => Controls_Manager::TAB_STYLE, | |
| 109 | + ] | |
| 110 | + ); | |
| 104 | 111 | |
| 105 | - $this->TRAIT_register_all_item_style_controls(false); | |
| 112 | + $this->TRAIT_register_all_item_style_controls(false); | |
| 106 | 113 | |
| 107 | 114 | $this->end_controls_section(); |
| 108 | 115 | |
| 109 | 116 | $this->TRAIT_register_style_controls(); // Other Components Style Controls |
| @@ -115,9 +122,9 @@ | ||
| 115 | 122 | 'tab' => Controls_Manager::TAB_STYLE, |
| 116 | 123 | ] |
| 117 | 124 | ); |
| 118 | 125 | |
| 119 | - $this->TRAIT_register_testimonial_animation_controls(); | |
| 126 | + $this->TRAIT_register_testimonial_animation_controls(); | |
| 120 | 127 | |
| 121 | 128 | $this->end_controls_section(); |
| 122 | 129 | } |
| 123 | 130 | public function render() |
| @@ -123,17 +130,19 @@ | ||
| 123 | 130 | public function render() |
| 124 | 131 | { |
| 125 | 132 | $settings = $this->get_settings_for_display(); |
| 126 | 133 | $layout = $settings['layout']; |
| 127 | - $masonry = $settings['masonry'] === 'yes' ? 'ui-e-maso' : ''; | |
| 134 | + $masonry = $this->is_option('masonry', 'yes') | |
| 135 | + ? 'ui-e-maso' | |
| 136 | + : ''; | |
| 128 | 137 | |
| 129 | 138 | $this->add_render_attribute('review-card', 'class', ['ui-e-grid', $masonry]); |
| 130 | - ?> | |
| 139 | +?> | |
| 131 | 140 | <div <?php $this->print_render_attribute_string('review-card'); ?>> |
| 132 | - <?php foreach ( $settings['review_items'] as $index => $item ) : ?> | |
| 133 | - <?php $this->TRAIT_render_review_item($item, $layout); ?> | |
| 141 | + <?php foreach ($settings['review_items'] as $index => $item) : ?> | |
| 142 | + <?php $this->TRAIT_render_review_item($item, $layout); ?> | |
| 134 | 143 | <?php endforeach; ?> |
| 135 | 144 | </div> |
| 136 | - <?php | |
| 145 | +<?php | |
| 137 | 146 | } |
| 138 | 147 | } |
| 139 | -\Elementor\Plugin::instance()->widgets_manager->register(new TestimonialGrid()); | |
| 148 | +\Elementor\Plugin::instance()->widgets_manager->register(new TestimonialGrid()); | |