<?php
/**
* Header Banner Options.
*
* @package Car Rental Service
*/

$car_rental_service_default = car_rental_service_get_default_theme_options();
$car_rental_service_post_category_list = car_rental_service_post_category_list();

$wp_customize->add_section( 'car_rental_service_header_banner_setting',
    array(
    'title'      => esc_html__( 'Slider Settings', 'car-rental-service' ),
    'priority'   => 10,
    'capability' => 'edit_theme_options',
    'panel'      => 'car_rental_service_theme_home_pannel',
    )
);

// Show/Hide Site Logo
$wp_customize->add_setting('car_rental_service_display_logo', array(
    'default'           => false,
    'capability'        => 'edit_theme_options',
    'sanitize_callback' => 'car_rental_service_sanitize_checkbox',
));
$wp_customize->add_control('car_rental_service_display_logo', array(
    'label'    => esc_html__('Enable / Disable Site Logo', 'car-rental-service'),
    'section'  => 'title_tagline',
    'type'     => 'checkbox',
));

// Show/Hide Site Title
$wp_customize->add_setting('car_rental_service_display_title', array(
    'default'           => true,
    'capability'        => 'edit_theme_options',
    'sanitize_callback' => 'car_rental_service_sanitize_checkbox',
));
$wp_customize->add_control('car_rental_service_display_title', array(
    'label'    => esc_html__('Enable / Disable Site Title', 'car-rental-service'),
    'section'  => 'title_tagline',
    'type'     => 'checkbox',
));

// Show/Hide Site Tagline
$wp_customize->add_setting('car_rental_service_display_header_text',
    array(
        'default'           => false,
        'capability' => 'edit_theme_options',
        'sanitize_callback' => 'car_rental_service_sanitize_checkbox',
    )
);
$wp_customize->add_control('car_rental_service_display_header_text',
    array(
        'label' => esc_html__('Enable / Disable Site Tagline', 'car-rental-service'),
        'section' => 'title_tagline',
        'type' => 'checkbox',
    )
);

$wp_customize->add_setting('car_rental_service_header_banner',
    array(
        'default' => $car_rental_service_default['car_rental_service_header_banner'],
        'capability' => 'edit_theme_options',
        'sanitize_callback' => 'car_rental_service_sanitize_checkbox',
    )
);
$wp_customize->add_control('car_rental_service_header_banner',
    array(
        'label' => esc_html__('Enable Slider', 'car-rental-service'),
        'section' => 'car_rental_service_header_banner_setting',
        'type' => 'checkbox',
    )
);

$wp_customize->add_setting('car_rental_service_banner_background_image',
    array(
        'default' => $car_rental_service_default['car_rental_service_banner_background_image'],
        'sanitize_callback' => 'esc_url_raw',
    )
);
$wp_customize->add_control(
    new WP_Customize_Image_Control( $wp_customize,'car_rental_service_banner_background_image',
        array(
            'label' => __('Slider Background Image','car-rental-service'),
            'section' => 'car_rental_service_header_banner_setting',
            'settings' => 'car_rental_service_banner_background_image',
        )
    )
);

$wp_customize->add_setting( 'car_rental_service_header_banner_cat',
    array(
    'default'           => '',
    'capability'        => 'edit_theme_options',
    'sanitize_callback' => 'car_rental_service_sanitize_select',
    )
);
$wp_customize->add_control( 'car_rental_service_header_banner_cat',
    array(
    'label'       => esc_html__( 'Slider Post Category', 'car-rental-service' ),
    'section'     => 'car_rental_service_header_banner_setting',
    'type'        => 'select',
    'choices'     => $car_rental_service_post_category_list,
    )
);

$wp_customize->add_setting( 'car_rental_service_slider_section_short_title',
    array(
    'default' => $car_rental_service_default['car_rental_service_slider_section_short_title'],
    'capability'        => 'edit_theme_options',
    'sanitize_callback' => 'sanitize_text_field',
    )
);
$wp_customize->add_control( 'car_rental_service_slider_section_short_title',
    array(
    'label'    => esc_html__( 'Short Title', 'car-rental-service' ),
    'section'  => 'car_rental_service_header_banner_setting',
    'type'     => 'text',
    )
);


/* Why Choose Us */


$wp_customize->add_section( 'car_rental_service_header_category_setting',
    array(
    'title'      => esc_html__( 'Why Choose Us Settings', 'car-rental-service' ),
    'priority'   => 10,
    'capability' => 'edit_theme_options',
    'panel'      => 'car_rental_service_theme_home_pannel',
    )
);

$wp_customize->add_setting('car_rental_service_services',
    array(
        'default' => $car_rental_service_default['car_rental_service_services'],
        'capability' => 'edit_theme_options',
        'sanitize_callback' => 'car_rental_service_sanitize_checkbox',
    )
);
$wp_customize->add_control('car_rental_service_services',
    array(
        'label' => esc_html__('Enable Why Choose Us Section', 'car-rental-service'),
        'section' => 'car_rental_service_header_category_setting',
        'type' => 'checkbox',
    )
);

$wp_customize->add_setting( 'car_rental_service_services_section_title',
    array(
    'default' => $car_rental_service_default['car_rental_service_services_section_title'],
    'capability'        => 'edit_theme_options',
    'sanitize_callback' => 'sanitize_text_field',
    )
);
$wp_customize->add_control( 'car_rental_service_services_section_title',
    array(
    'label'    => esc_html__( 'Main Title', 'car-rental-service' ),
    'section'  => 'car_rental_service_header_category_setting',
    'type'     => 'text',
    )
);

$wp_customize->add_setting( 'car_rental_service_services_section_short_title',
    array(
    'default' => $car_rental_service_default['car_rental_service_services_section_short_title'],
    'capability'        => 'edit_theme_options',
    'sanitize_callback' => 'sanitize_text_field',
    )
);
$wp_customize->add_control( 'car_rental_service_services_section_short_title',
    array(
    'label'    => esc_html__( 'Short Title', 'car-rental-service' ),
    'section'  => 'car_rental_service_header_category_setting',
    'type'     => 'text',
    )
);

$wp_customize->add_setting( 'car_rental_service_services_section_text',
    array(
    'default' => $car_rental_service_default['car_rental_service_services_section_text'],
    'capability'        => 'edit_theme_options',
    'sanitize_callback' => 'sanitize_text_field',
    )
);
$wp_customize->add_control( 'car_rental_service_services_section_text',
    array(
    'label'    => esc_html__( 'Content Text', 'car-rental-service' ),
    'section'  => 'car_rental_service_header_category_setting',
    'type'     => 'text',
    )
);

for ($i=1; $i <= 3; $i++) { 

    $wp_customize->add_setting( 'car_rental_service_services_section_progress_name'.$i,
        array(
        'default'           => 'Car Rentals',
        'capability'        => 'edit_theme_options',
        'sanitize_callback' => 'sanitize_text_field',
        )
    );
    $wp_customize->add_control( 'car_rental_service_services_section_progress_name'.$i,
        array(
        'label'    => esc_html__( 'Progress Bar Name ', 'car-rental-service' ).$i,
        'section'  => 'car_rental_service_header_category_setting',
        'type'     => 'text',
        )
    );

    $wp_customize->add_setting( 'car_rental_service_services_section_progress_count'.$i,
        array(
        'default'           => '50%',
        'capability'        => 'edit_theme_options',
        'sanitize_callback' => 'sanitize_text_field',
        )
    );
    $wp_customize->add_control( 'car_rental_service_services_section_progress_count'.$i,
        array(
        'label'    => esc_html__( 'Progress Bar Count ', 'car-rental-service' ).$i,
        'section'  => 'car_rental_service_header_category_setting',
        'type'     => 'text',
        )
    );

}

$wp_customize->add_setting('car_rental_service_services_section_image',
    array(
        'default' => $car_rental_service_default['car_rental_service_services_section_image'],
        'sanitize_callback' => 'esc_url_raw',
    )
);

$wp_customize->add_control( 
    new WP_Customize_Image_Control( $wp_customize, 'car_rental_service_services_section_image',
    array(
        'label'     => esc_html__( 'Add Image', 'car-rental-service' ),
        'settings'  => 'car_rental_service_services_section_image',
        'section'   => 'car_rental_service_header_category_setting'
        )
    )
);