<?php

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

$layout_three_faq = new \Elementor\Repeater();

$layout_three_faq->add_control(
    'question',
    [
        'label' => __('Question', 'ostech-addon'),
        'type' => \Elementor\Controls_Manager::TEXT,
        'placeholder' => __('Add Question', 'ostech-addon'),
        'default' => __('Default Question', 'ostech-addon'),
        'label_block' => true,
    ]
);

ostech_elementor_heading_option($layout_three_faq, 'Question Title', 'h4', 'layout_three');

$layout_three_faq->add_control(
    'answer',
    [
        'label' => __('Answer', 'ostech-addon'),
        'type' => \Elementor\Controls_Manager::TEXTAREA,
        'placeholder' => __('Add Answer', 'ostech-addon'),
        'default' => __('Default Answer', 'ostech-addon'),
        'label_block' => true,
    ]
);

$layout_three_faq->add_control(
    'active_status',
    [
        'label' => __('Is active?', 'ostech-addon'),
        'type' => \Elementor\Controls_Manager::SWITCHER,
        'label_on' => __('Yes', 'ostech-addon'),
        'label_off' => __('No', 'ostech-addon'),
        'return_value' => 'yes',
        'default' => 'no',
    ]
);

$this->add_control(
    'layout_three_faq_lists',
    [
        'label' => __('FAQ', 'ostech-addon'),
        'type' => \Elementor\Controls_Manager::REPEATER,
        'fields' => $layout_three_faq->get_controls(),
        'prevent_empty' => false,
        'title_field' => '{{{ question }}}',
    ]
);

$this->end_controls_section();
