<?php

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

$layout_feature_two = new \Elementor\Repeater();

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

ostech_elementor_heading_option($layout_feature_two, 'Title', 'h3', 'layout_two');

$layout_feature_two->add_control(
    'subtitle',
    [
        'label' => __('SubTitle', 'ostech-addon'),
        'type' => \Elementor\Controls_Manager::TEXT,
        'placeholder' => __('Add title', 'ostech-addon'),
        'default' => __('Default Title', 'ostech-addon'),
        'label_block' => true
    ]
);

ostech_elementor_heading_option($layout_feature_two, 'Sub Title', 'h4', 'layout_two');

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

$layout_feature_two->add_control(
    'icon',
    [
        'label' => __('Icon', 'ostech-addon'),
        'type' => \Elementor\Controls_Manager::ICONS,
        'default' => [
            'value' => 'icon-shield-2',
            'library' => 'custom-icon',
        ],
    ]
);

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

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

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

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

$this->end_controls_section();
