<?php

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

$layout_five_sliders = new \Elementor\Repeater();

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

$layout_five_sliders->add_control(
    'title',
    [
        'label' => __('Title', 'ostech-addon'),
        'type' => \Elementor\Controls_Manager::TEXTAREA,
        'rows' => '2',
        'placeholder' => __('Awesome Title', 'ostech-addon'),
        'default' => __('Default Title', 'ostech-addon'),
    ]
);

ostech_elementor_heading_option($layout_five_sliders, 'Title', 'h2', 'layout_five');

$layout_five_sliders->add_control(
    'sub_title',
    [
        'label' => __('Sub Title', 'ostech-addon'),
        'type' => \Elementor\Controls_Manager::TEXTAREA,
        'rows' => '2',
        'placeholder' => __('Add Sub Title', 'ostech-addon'),
        'default' => __('Default Sub Title', 'ostech-addon'),
    ]
);

ostech_elementor_heading_option($layout_five_sliders, 'Sub Title', 'h5', 'layout_five');

$layout_five_sliders->add_control(
    'summary',
    [
        'label' => __('Summary', 'ostech-addon'),
        'type' => \Elementor\Controls_Manager::TEXTAREA,
        'rows' => '2',
        'placeholder' => __('Add Summary', 'ostech-addon'),
        'default' => __('Default Summary', 'ostech-addon'),
    ]
);

$layout_five_sliders->add_control(
    'button_label',
    [
        'label' => __('Button Label', 'ostech-addon'),
        'type' => \Elementor\Controls_Manager::TEXT,
        'default' => __('Discover More', 'ostech-addon'),
        'label_block' => true,
    ]
);

$layout_five_sliders->add_control(
    'button_url',
    [
        'label' => __('Button Url', 'ostech-addon'),
        'type' => \Elementor\Controls_Manager::URL,
        'placeholder' => __('#', 'ostech-addon'),
        'show_external' => false,
        'default' => [
            'url' => '#',
            'is_external' => false,
            'nofollow' => false,
        ],
        'show_label' => true,
    ]
);

$layout_five_sliders->add_control(
    'button_icon',
    [
        'label' => __('Button Icon', 'ostech-addon'),
        'type' => \Elementor\Controls_Manager::ICONS,
        'default' => [
            'value' => 'ostech-icons-two-up-right-arrow',
            'library' => 'font-awesome',
        ],
    ]
);

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

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

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

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

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

$this->add_control(
    'layout_five_sliders',
    [
        'label' => __('Main Slider', 'ostech-addon'),
        'type' => \Elementor\Controls_Manager::REPEATER,
        'fields' => $layout_five_sliders->get_controls(),
        'prevent_empty' => false,
        'title_field' => '{{{ title }}}',
    ]
);


$layout_five_social_icons = new \Elementor\Repeater();

$layout_five_social_icons->add_control(
    'social_icon',
    [
        'label' => __('Select Icon', 'ostech-addon'),
        'type' => \Elementor\Controls_Manager::ICONS,
        'default' => [
            'value' => 'fab fa-facebook-f',
            'library' => 'brand',
        ],
        'label_block' => true,
    ]
);

$layout_five_social_icons->add_control(
    'social_url',
    [
        'label' => __('Add Url', 'ostech-addon'),
        'type' => \Elementor\Controls_Manager::URL,
        'placeholder' => __('#', 'ostech-addon'),
        'show_external' => false,
        'default' => [
            'url' => '#',
            'is_external' => false,
            'nofollow' => false,
        ],
        'show_label' => false,
    ]
);

$this->add_control(
    'layout_five_social_icons',
    [
        'label' => __('Social Icons', 'ostech-addon'),
        'type' => \Elementor\Controls_Manager::REPEATER,
        'fields' => $layout_five_social_icons->get_controls(),
        'prevent_empty' => false,
        'default' => [
            [
                'social_url' => [
                    'url' => '#',
                    'is_external' => false,
                    'nofollow' => false,
                ],
            ],
        ],
    ]
);

$this->end_controls_section();
