<?php

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

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

$this->add_control(
    'layout_five_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_five');

$this->add_control(
    'layout_five_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_five');


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

$layout_five_testimonial = new \Elementor\Repeater();

$layout_five_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_five_testimonial, 'Testimonial Name', 'h5', 'layout_five');

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

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

$layout_five_testimonial->add_control(
    'rating',
    [
        'label' => __('Average 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_five_testimonial->add_control(
    'image_one',
    [
        'label' => __('Image One', 'ostech-addon'),
        'type' => \Elementor\Controls_Manager::MEDIA,
        'default' => [],
    ]
);

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

$layout_five_testimonial->add_control(
    'shape_one',
    [
        'label' => __('Shape One', 'ostech-addon'),
        'type' => \Elementor\Controls_Manager::MEDIA,
        'default' => [],
    ]
);

$layout_five_testimonial->add_control(
    'shape_two',
    [
        'label' => __('Shape Two', 'ostech-addon'),
        'type' => \Elementor\Controls_Manager::MEDIA,
        'default' => [],
    ]
);

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

$this->add_control(
    'layout_five_bg_shape',
    [
        'label' => __('Background Shape', 'ostech-addon'),
        'type' => \Elementor\Controls_Manager::MEDIA,
        'default' => [],
    ]
);

$this->end_controls_section();
