<?php

namespace Layerdrops\Ostech\Widgets;


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

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

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

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

    protected function register_controls()
    {

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

        $this->add_control(
            'layout_type',
            [
                'label' => __('Select Layout', 'ostech-addon'),
                'type' => \Elementor\Controls_Manager::SELECT2,
                'default' => 'layout_one',
                'options' => [
                    'layout_one' => __('Layout One', 'ostech-addon'),
                    // 'layout_two' => __('Layout Two', 'ostech-addon'),
                    'layout_three' => __('Layout Three', 'ostech-addon'),
                    'layout_four' => __('Layout Four', 'ostech-addon'),
                    // 'layout_five' => __('Layout Five', 'ostech-addon'),
                ]
            ]
        );

        $this->end_controls_section();

        include ostech_get_elementor_option('gallery-one-option.php');
        include ostech_get_elementor_option('gallery-two-option.php');
        include ostech_get_elementor_option('gallery-three-option.php');
        include ostech_get_elementor_option('gallery-four-option.php');
        include ostech_get_elementor_option('gallery-five-option.php');

        //General style
        $this->start_controls_section(
            'general_style',
            [
                'label' => esc_html__('Content Style', 'ostech-addon'),
                'tab' => \Elementor\Controls_Manager::TAB_STYLE,
            ]
        );

        ostech_elementor_general_style_options($this, 'Gallery Title', '{{WRAPPER}} .gallery-two__info__title', ['layout_five']);
        ostech_elementor_general_style_options($this, 'Background Color', '{{WRAPPER}} .gallery-two__info', ['layout_five'], 'background-color', false);

        $this->end_controls_section();

        ostech_get_elementor_carousel_options($this, ['layout_three']);
    }

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