<?php

namespace Layerdrops\Ostech\Widgets;


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

    public function get_title()
    {
        return __('Portfolio', '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'),
                    // 'layout_six' => __('Layout Six', 'ostech-addon'),
                    // 'layout_seven' => __('Layout Seven', 'ostech-addon'),
                    // 'layout_eight' => __('Layout Eight', 'ostech-addon'),
                ]
            ]
        );

        $this->end_controls_section();

        include ostech_get_elementor_option('portfolio-one-option.php');
        include ostech_get_elementor_option('portfolio-two-option.php'); // layout four,five
        include ostech_get_elementor_option('portfolio-three-option.php');
        // include ostech_get_elementor_option('portfolio-five-option.php');
        // include ostech_get_elementor_option('portfolio-six-option.php');
        // include ostech_get_elementor_option('portfolio-seven-option.php');
        // include ostech_get_elementor_option('portfolio-eight-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, 'Section Title', '{{WRAPPER}} .sec-title__title', ['layout_one', 'layout_three', 'layout_two', 'layout_eight']);
        ostech_elementor_general_style_options($this, 'Section Sub Title', '{{WRAPPER}} .sec-title__tagline', ['layout_one', 'layout_three', 'layout_two', 'layout_eight']);

        ostech_elementor_general_style_options($this, 'Title', '{{WRAPPER}} .project-one__content__title,{{WRAPPER}} .project-two__content__title, .project-three__item__title', ['layout_one', 'layout_three', 'layout_four', 'layout_two', 'layout_five', 'layout_six', 'layout_seven', 'layout_eight']);

        ostech_elementor_general_style_options($this, 'Tag Line', '{{WRAPPER}} .project-one__content__text,{{WRAPPER}} .project-two__content__text,{{WRAPPER}} .project-three__item__subtitle', ['layout_one', 'layout_two', 'layout_three', 'layout_four', 'layout_five', 'layout_six', 'layout_seven', 'layout_eight']);

        ostech_elementor_general_style_options($this, 'Date', '{{WRAPPER}} .project-three__item__text', ['layout_three']);

        $this->end_controls_section();

        ostech_get_elementor_carousel_options($this, ['layout_four', 'layout_eight']);
        ostech_elementor_column_count_options($this, ['layout_one', 'layout_two', 'layout_five']);
    }

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