<?php

namespace Layerdrops\Ostech\Widgets;


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

    public function get_title()
    {
        return __('Testimonials', '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('testimonial-one-option.php');
        include ostech_get_elementor_option('testimonial-two-option.php');
        include ostech_get_elementor_option('testimonial-three-option.php');
        // include ostech_get_elementor_option('testimonial-four-option.php');
        // include ostech_get_elementor_option('testimonial-five-option.php');
        // include ostech_get_elementor_option('testimonial-six-option.php');
        // include ostech_get_elementor_option('testimonial-seven-option.php');
        // include ostech_get_elementor_option('testimonial-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,{{WRAPPER}} .sec-title-two__title', ['layout_two', 'layout_three', 'layout_five', 'layout_seven', 'layout_eight']);


        ostech_elementor_general_style_options($this, 'Section Sub Title', '{{WRAPPER}} .sec-title__tagline,{{WRAPPER}} .sec-title-two__tagline', ['layout_two', 'layout_three', 'layout_five', 'layout_seven', 'layout_eight']);


        ostech_elementor_general_style_options($this, 'Section Summary', '{{WRAPPER}} .testimonials-one--home__text,{{WRAPPER}} .testimonials-three__content__text,{{WRAPPER}} .testimonial-three__text', ['layout_three', 'layout_five']);

        ostech_elementor_general_style_options($this, 'Name', '{{WRAPPER}} .testimonials-one__item__name,
        {{WRAPPER}} .testimonial-two__item__author__title,{{WRAPPER}} .testimonials-two__meta__name,{{WRAPPER}} .testimonial-three__item__author__name,{{WRAPPER}} .testimonials-four__title,{{WRAPPER}} .testimonials-four__title,{{WRAPPER}} .testimonials-four__title', ['layout_one', 'layout_two', 'layout_three', 'layout_four', 'layout_five', 'layout_seven', 'layout_eight']);


        ostech_elementor_general_style_options($this, 'Designation', '{{WRAPPER}} .testimonials-one__item__deg,{{WRAPPER}} .testimonial-two__item__author__deg,{{WRAPPER}} .testimonial-three__item__author__deg,{{WRAPPER}} .testimonials-four__designation,{{WRAPPER}} .testimonials-four__designation,{{WRAPPER}} .testimonials-four__designation', ['layout_one', 'layout_two', 'layout_three', 'layout_four', 'layout_five', 'layout_seven', 'layout_eight']);
        ostech_elementor_general_style_options($this, 'Testimonial', '{{WRAPPER}} .testimonials-one__item__text,{{WRAPPER}} .testimonial-two__item__text,{{WRAPPER}} .testimonial-three__item__text,{{WRAPPER}} .testimonials-four__quote,{{WRAPPER}} .testimonials-four__quote,{{WRAPPER}} .testimonials-four__quote', ['layout_one', 'layout_two', 'layout_three', 'layout_four', 'layout_five', 'layout_seven', 'layout_eight']);

        ostech_elementor_general_style_options($this, 'Rating', '{{WRAPPER}} .testimonial-two__item__star,{{WRAPPER}} .testimonial-three__item__star', ['layout_two', 'layout_three']);

        ostech_elementor_button_style_options($this, 'Button', '{{WRAPPER}} .ostech-btn', '{{WRAPPER}} .ostech-btn::before,{{WRAPPER}} .ostech-btn::after', ['layout_three']);

        $this->end_controls_section();

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

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