<?php

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

$this->add_control(
    'layout_three_title',
    [
        'label' => __('Title', 'ostech-addon'),
        'type' => \Elementor\Controls_Manager::TEXTAREA,
        'label_block' => true,
        'default' => __('Default Title', 'ostech-addon'),
    ]
);

ostech_elementor_heading_option($this, 'Title', 'h3', 'layout_three');

$this->add_control(
    'layout_three_subtitle',
    [
        'label' => __('Subtitle', 'ostech-addon'),
        'type' => \Elementor\Controls_Manager::TEXTAREA,
        'label_block' => true,
        'default' => __('Default Subtitle', 'ostech-addon'),
    ]
);

$this->add_control(
    'layout_three_summary',
    [
        'label' => __('Summary', 'ostech-addon'),
        'type' => \Elementor\Controls_Manager::TEXTAREA,
        'label_block' => true,
        'default' => __('Default Summary', 'ostech-addon'),
    ]
);

$this->add_control(
    'layout_three_feature_title',
    [
        'label' => __('Feature Title', 'ostech-addon'),
        'type' => \Elementor\Controls_Manager::TEXT,
        'label_block' => true,
        'default' => __('Default Title', 'ostech-addon'),
    ]
);

$layout_three_features_list = new \Elementor\Repeater();

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


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

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

$layout_three_progressbar_list = new \Elementor\Repeater();

$layout_three_progressbar_list->add_control(
    'title',
    [
        'label' => __('Title', 'ostech-addon'),
        'type' => \Elementor\Controls_Manager::TEXTAREA,
        'rows' => '2',
        'placeholder' => __('Add title', 'ostech-addon'),
        'default' => __('Marketing', 'ostech-addon'),
        'label_block' => true
    ]
);

$layout_three_progressbar_list->add_control(
    'progressbar_count',
    [
        'label' => __('Progressbar Count', 'ostech-addon'),
        'type' => \Elementor\Controls_Manager::SLIDER,
        'size_units' => ['count'],
        'range' => [
            'count' => [
                'min' => 1,
                'max' => 100,
                'step' => 1,
            ],
        ],
        'default' => [
            'unit' => 'count',
            'size' => 75,
        ],
    ]
);


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


$layout_three_social = new \Elementor\Repeater();

$layout_three_social->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_three_social->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_three_social',
    [
        'label' => __('Social Icons', 'ostech-addon'),
        'type' => \Elementor\Controls_Manager::REPEATER,
        'fields' => $layout_three_social->get_controls(),
        'prevent_empty' => false,
        'default' => [
            [
                'social_url' => [
                    'url' => '#',
                    'is_external' => false,
                    'nofollow' => false,
                ],
            ],
        ],

    ]
);

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


$this->end_controls_section();
