# uicore-elements/1.0.3/includes/widgets/logo-grid.php

UiCore Elements – Free widgets and templates for Elementor, version 1.0.3. 182 lines.

- Page: https://pluginprobe.com/plugins/uicore-elements/1.0.3/code/includes/widgets/logo-grid.php
- Raw: https://pluginprobe.com/plugins/uicore-elements/1.0.3/raw/includes/widgets/logo-grid.php
- Modified: 2024-04-09T08:41:48+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/uicore-elements/1.0.3/code/includes/widgets/logo-grid.php#L10-L20`.

```php
<?php
namespace UiCoreElements;

use Elementor\Controls_Manager;
use UiCoreElements\UiCoreWidget;
use UiCoreElements\Utils\Animation_Trait;
use UiCoreElements\Utils\Grid_Trait;
use UiCoreElements\Utils\Logo_Trait;

defined('ABSPATH') || exit();

class Logo_Grid extends UiCoreWidget {

    use Animation_Trait;
    use Grid_Trait;
    use Logo_Trait;

    public function get_name()
    {
        return 'uicore-logo-grid';
    }
    public function get_title()
    {
        return esc_html__( 'Logo Grid', 'uicore-elements' );
    }
    public function get_icon()
    {
        return 'eicon-logo ui-e-widget';
    }
    public function get_categories()
    {
        return ['uicore'];
    }
    public function get_keywords()
    {
        return [ 'logo', 'grid', 'client', 'brand', 'showcase' ];
    }
    public function get_styles()
    {
        return [
            'logo-grid',
            'animation',
            'entrance',
            'e-animations' => [
                'condition' => [
                    'animation_assets' => 'false'
                ],
                'external' => true,
            ]
        ];
    }
    public function get_scripts()
    {
        return [
            'logo-grid',
            'entrance' => [
                'condition' => [
                    'animate_items' => 'ui-e-grid-animate'
                ],
            ]
        ];
    }
    protected function register_controls()
    {

        $this->register_logo_repeater_controls('Logos'); // Repeater Controls

        $this->start_controls_section(
            'section_grid_settings',
            [
                'label' => __( 'Grid Settings', 'uicore-elements' ),
                'tab'   => Controls_Manager::TAB_CONTENT,
            ]
        );

            $this->add_control(
                'layout',
                [
                    'label'          => __( 'Grid Layout', 'uicore-elements' ),
                    'type'           => Controls_Manager::SELECT,
                    'options'        => [
                        'inner-border' => __( 'Inner Border', 'uicore-elements' ),
                        'outer-border' => __( 'Outer Border', 'uicore-elements' ),
                        'divider'      => __( 'Inner Divider', 'uicore-elements' ),
                    ],
                    'default'        => 'inner-border',
                    'frontend_available' => true,
                    'style_transfer' => true, // enables the param to be copied/pasted even without selector => []
                    'render_type'    => 'template',
                ]
            );
            $this->add_responsive_control(
                'columns',
                [
                    'label'           => __( 'Columns', 'uicore-elements' ),
                    'type'            => Controls_Manager::SELECT,
                    'desktop_default' => 4,
                    'tablet_default'  => 2,
                    'mobile_default'  => 2,
                    'options'         => [
                        1 => '1',
                        2 => '2',
                        3 => '3',
                        4 => '4',
                        5 => '5',
                        6 => '6',
                        7 => '7',
                        8 => '8',
                    ],
                    'render_type' => 'template',
                    'frontend_available' => true,
                    'selectors' => [
                        '{{WRAPPER}} .ui-e-grid' => 'grid-template-columns: repeat({{VALUE}}, minmax(0, 1fr))',
                    ],
                ]
            );
            $this->register_grid_layout_controls(false, [], false, false, ['layout' => 'inner-border']); // Grid controls without maso and columns

        $this->end_controls_section();

        $this->start_controls_section(
            'section_logo_settings',
            [
                'label' => __( 'Logo Settings', 'uicore-elements' ),
                'tab'   => Controls_Manager::TAB_CONTENT,
            ]
        );

            $this->register_logo_adittional_controls();

        $this->end_controls_section();

        $this->start_controls_section(
            'section_logo_grid',
            [
                'label' => __( 'Logo Grid', 'uicore-elements' ),
                'tab'   => Controls_Manager::TAB_STYLE,
            ]
        );

            $this->register_logos_grid_style_controls();

        $this->end_controls_section();

        $this->start_controls_section(
            'animation_style_grid',
            [
                'label' => __( 'Animations', 'uicore-elements' ),
                'tab'   => Controls_Manager::TAB_STYLE,
            ]
        );

            $this->TRAIT_register_entrace_asset_helper();
            $this->TRAIT_register_entrance_animations_controls();
            $this->TRAIT_register_hover_animation_control(
                'Item Hover Animation',
                [],
                ['underline']
            );
            $this->TRAIT_register_hover_animation_control(
                'Logo Hover Animation',
                [],
                ['underline']
            );

        $this->end_controls_section();
    }
    protected function render()
    {

        if(empty( $this->get_settings_for_display('logo_list'))) {
            return;
        }

        ?>
            <div class='ui-e-grid'>
                <?php $this->render_logo_item(); ?>
            </div>
        <?php
    }
}
\Elementor\Plugin::instance()->widgets_manager->register(new Logo_Grid());
```
