Your IP : 216.73.216.0


Current Path : /home/goldnueh/netsetsolution.com/wp-content/plugins/zeinet-addon/includes/Widgets/
Upload File :
Current File : /home/goldnueh/netsetsolution.com/wp-content/plugins/zeinet-addon/includes/Widgets/Gallery.php

<?php

namespace Layerdrops\Zeinet\Widgets;


class Gallery extends \Elementor\Widget_Base
{
    public function get_name()
    {
        return 'zeinet-gallery';
    }

    public function get_title()
    {
        return __('Gallery', 'zeinet-addon');
    }

    public function get_icon()
    {
        return 'eicon-cogs';
    }

    public function get_categories()
    {
        return ['zeinet-category'];
    }

    protected function register_controls()
    {
        $this->start_controls_section(
            'layout_section',
            [
                'label' => __('Layout', 'zeinet-addon'),
                'tab' => \Elementor\Controls_Manager::TAB_CONTENT,
            ]
        );

        $this->add_control(
            'layout_type',
            [
                'label' => __('Select Layout', 'zeinet-addon'),
                'type' => \Elementor\Controls_Manager::SELECT2,
                'default' => 'layout_one',
                'options' => [
                    'layout_one' => __('Layout One', 'zeinet-addon'),
                    'layout_two' => __('Layout Two', 'zeinet-addon'),
                ]
            ]
        );


        $this->end_controls_section();

        $this->start_controls_section(
            'content_section',
            [
                'label' => __('Content', 'zeinet-addon'),
                'tab' => \Elementor\Controls_Manager::TAB_CONTENT,
            ]
        );

        $gallery_images = new \Elementor\Repeater();

        $gallery_images->add_control(
            'image',
            [
                'label' => __('Add Image', 'zeinet-addon'),
                'type' => \Elementor\Controls_Manager::MEDIA,
            ]
        );

        $this->add_control(
            'gallery_images',
            [
                'label' => __('Gallery Items', 'zeinet-addon'),
                'type' => \Elementor\Controls_Manager::REPEATER,
                'prevent_empty' => false,
                'condition' => [
                    'layout_type' => ['layout_one', 'layout_two']
                ],
                'fields' => $gallery_images->get_controls(),
            ]
        );

        $this->end_controls_section();

        zeinet_get_elementor_carousel_options($this, ['layout_two']);
    }

    protected function render()
    {
        $settings = $this->get_settings_for_display();
        include zeinet_get_template('gallery-one.php');
        include zeinet_get_template('gallery-two.php');
    }
}