<?php

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


$this->add_control(
    'layout_five_icon',
    [
        'label' => __('Section Icon', 'ostech-addon'),
        'type' => \Elementor\Controls_Manager::ICONS,
        'default' => [
            'value' => 'icon-manhattan',
            'library' => 'font-awesome',
        ],
    ]
);

$this->add_control(
    'layout_five_sec_title',
    [
        'label' => __('Section Title', 'ostech-addon'),
        'type' => \Elementor\Controls_Manager::TEXTAREA,
        'placeholder' => __('Add title', 'ostech-addon'),
        'default' => __('Default 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,
        'placeholder' => __('Add sub title', 'ostech-addon'),
        'default' => __('Default Sub Title', 'ostech-addon'),
    ]
);

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

$this->add_control(
    'layout_five_select_wpcf7_form',
    [
        'label'       => esc_html__('Select your contact form 7', 'ostech-addon'),
        'label_block' => true,
        'type'        => \Elementor\Controls_Manager::SELECT,
        'options'     => ostech_post_query('wpcf7_contact_form'),
    ]
);


$layout_five_content_list = new \Elementor\Repeater();

$layout_five_content_list->add_control(
    'title',
    [
        'label' => __('Title', 'ostech-addon'),
        'type' => \Elementor\Controls_Manager::TEXT,
        'rows' => '2',
        'placeholder' => __('Add Title', 'ostech-addon'),
        'default' => __('Have question?', 'ostech-addon'),
        'label_block' => true,
    ]
);

$layout_five_content_list->add_control(
    'number',
    [
        'label' => __('Number', 'ostech-addon'),
        'type' => \Elementor\Controls_Manager::TEXT,
        'rows' => '2',
        'placeholder' => __('Add Number', 'ostech-addon'),
        'default' => __('59', 'ostech-addon'),
        'label_block' => true,
    ]
);

$layout_five_content_list->add_control(
    'operator',
    [
        'label' => __('Operator', 'ostech-addon'),
        'type' => \Elementor\Controls_Manager::TEXT,
        'rows' => '2',
        'placeholder' => __('Add Operator', 'ostech-addon'),
        'default' => __('K', 'ostech-addon'),
        'label_block' => true,
    ]
);

$layout_five_content_list->add_control(
    'icon',
    [
        'label' => __('Icon', 'ostech-addon'),
        'type' => \Elementor\Controls_Manager::ICONS,
        'default' => [
            'value' => 'icon-phone-call',
            'library' => 'font-awesome',
        ],
    ]
);

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

$layout_five_content_list->add_control(
    'image',
    [
        'label' => __('Image One', 'ostech-addon'),
        'type' => \Elementor\Controls_Manager::MEDIA,
        'default' => [
            'url' => \Elementor\Utils::get_placeholder_image_src(),
        ],
        'condition' => [
            'active_status' => 'yes'
        ]
    ]
);

$layout_five_content_list->add_control(
    'shape_one',
    [
        'label' => __('Shape One', 'ostech-addon'),
        'type' => \Elementor\Controls_Manager::MEDIA,
        'default' => [
            'url' => \Elementor\Utils::get_placeholder_image_src(),
        ],
        'condition' => [
            'active_status' => 'yes'
        ]
    ]
);

$layout_five_content_list->add_control(
    'shape_two',
    [
        'label' => __('Shape Two', 'ostech-addon'),
        'type' => \Elementor\Controls_Manager::MEDIA,
        'default' => [
            'url' => \Elementor\Utils::get_placeholder_image_src(),
        ],
        'condition' => [
            'active_status' => 'yes'
        ]
    ]
);

$this->add_control(
    'layout_five_content_list',
    [
        'label' => __('Contact Info', 'ostech-addon'),
        'type' => \Elementor\Controls_Manager::REPEATER,
        'fields' => $layout_five_content_list->get_controls(),
        'prevent_empty' => false,
    ]
);

$this->add_control(
    'layout_five_bg_image_one',
    [
        'label' => __('Background Image One', 'ostech-addon'),
        'type' => \Elementor\Controls_Manager::MEDIA,
        'default' => [
            'url' => \Elementor\Utils::get_placeholder_image_src(),
        ]
    ]
);

$this->add_control(
    'layout_five_bg_image_two',
    [
        'label' => __('Background Image Two', 'ostech-addon'),
        'type' => \Elementor\Controls_Manager::MEDIA,
        'default' => [
            'url' => \Elementor\Utils::get_placeholder_image_src(),
        ]
    ]
);
$this->end_controls_section();
