<?php

$this->start_controls_section(
    'layout_six_content_section',
    [
        'label' => __('Content', 'ostech-addon'),
        'tab' => \Elementor\Controls_Manager::TAB_CONTENT,
        'condition' => [
            'layout_type' => 'layout_six'
        ]
    ]
);

$this->add_control(
    'layout_six_title_image',
    [
        'label' => __('Title Image', 'ostech-addon'),
        'type' => \Elementor\Controls_Manager::MEDIA,
    ]
);

$this->add_control(
    'layout_six_sec_title',
    [
        'label' => __('Section Title', 'ostech-addon'),
        'type' => \Elementor\Controls_Manager::TEXTAREA,
        'default' => __('Awesome Title', 'ostech-addon'),
    ]
);

ostech_elementor_heading_option($this, 'Section Title', 'h3', 'layout_six');

$this->add_control(
    'layout_six_sec_sub_title',
    [
        'label' => __('Section Sub Title', 'ostech-addon'),
        'type' => \Elementor\Controls_Manager::TEXTAREA,
        'default' => __('Awesome Sub Title', 'ostech-addon'),
    ]
);

ostech_elementor_heading_option($this, 'Section Sub Title', 'h6', 'layout_six');

$layout_six_testimonial = new \Elementor\Repeater();

$layout_six_testimonial->add_control(
    'name',
    [
        'label' => __('Name', 'ostech-addon'),
        'type' => \Elementor\Controls_Manager::TEXT,
        'default' => __('Kevin martin', 'ostech-addon'),
        'label_block' => true
    ]
);

ostech_elementor_heading_option($layout_six_testimonial, 'Testimonial Name', 'h3', 'layout_six');

$layout_six_testimonial->add_control(
    'designation',
    [
        'label' => __('Designation', 'ostech-addon'),
        'type' => \Elementor\Controls_Manager::TEXT,
        'default' => __('Customer', 'ostech-addon'),
        'label_block' => true
    ]
);

$layout_six_testimonial->add_control(
    'testimonial',
    [
        'label' => __('Testimonial', 'ostech-addon'),
        'type' => \Elementor\Controls_Manager::TEXTAREA,
        'default' => __('Default Testimonial Content', 'ostech-addon'),
    ]
);

$layout_six_testimonial->add_control(
    'rating',
    [
        'label' => __('Rating', 'ostech-addon'),
        'type' => \Elementor\Controls_Manager::SLIDER,
        'size_units' => ['count'],
        'range' => [
            'count' => [
                'min' => 1,
                'max' => 5,
                'step' => 1,
            ],
        ],
        'default' => [
            'unit' => 'count',
            'size' => 5,
        ],
    ]
);

$layout_six_testimonial->add_control(
    'image',
    [
        'label' => __('Image', 'ostech-addon'),
        'type' => \Elementor\Controls_Manager::MEDIA,
        'default' => [],
    ]
);

$layout_six_testimonial->add_control(
    'shape',
    [
        'label' => __('shape', 'ostech-addon'),
        'type' => \Elementor\Controls_Manager::MEDIA,
        'default' => [],
    ]
);


$this->add_control(
    'layout_six_testimonials',
    [
        'label' => __('Testimonial Items', 'ostech-addon'),
        'prevent_empty' => false,
        'type' => \Elementor\Controls_Manager::REPEATER,
        'fields' => $layout_six_testimonial->get_controls(),
        'title_field' => '{{{ name }}}',
    ]
);

$this->end_controls_section();
