<?php
/**
* Header Banner Options.
*
* @package Trucking Company
*/

$trucking_company_default = trucking_company_get_default_theme_options();
$trucking_company_post_category_list = trucking_company_post_category_list();

$wp_customize->add_section( 'trucking_company_header_banner_setting',
    array(
    'title'      => esc_html__( 'Slider Settings', 'trucking-company' ),
    'priority'   => 10,
    'capability' => 'edit_theme_options',
    'panel'      => 'trucking_company_theme_home_pannel',
    )
);

$wp_customize->add_setting('trucking_company_display_header_title',
    array(
        'default' => $trucking_company_default['trucking_company_display_header_title'],
        'capability' => 'edit_theme_options',
        'sanitize_callback' => 'trucking_company_sanitize_checkbox',
    )
);
$wp_customize->add_control('trucking_company_display_header_title',
    array(
        'label' => esc_html__('Enable / Disable Title', 'trucking-company'),
        'section' => 'title_tagline',
        'type' => 'checkbox',
    )
);

// Show/Hide Site Logo
$wp_customize->add_setting('trucking_company_display_logo', array(
    'default'           => false,
    'capability'        => 'edit_theme_options',
    'sanitize_callback' => 'trucking_company_sanitize_checkbox',
));
$wp_customize->add_control('trucking_company_display_logo', array(
    'label'    => esc_html__('Enable / Disable Site Logo', 'trucking-company'),
    'section'  => 'title_tagline',
    'type'     => 'checkbox',
));

// Show/Hide Site Title
$wp_customize->add_setting('trucking_company_display_title', array(
    'default'           => true,
    'capability'        => 'edit_theme_options',
    'sanitize_callback' => 'trucking_company_sanitize_checkbox',
));
$wp_customize->add_control('trucking_company_display_title', array(
    'label'    => esc_html__('Enable / Disable Site Title', 'trucking-company'),
    'section'  => 'title_tagline',
    'type'     => 'checkbox',
));

// Show/Hide Site Tagline
$wp_customize->add_setting('trucking_company_display_header_text',
    array(
        'default'           => false,
        'capability' => 'edit_theme_options',
        'sanitize_callback' => 'trucking_company_sanitize_checkbox',
    )
);
$wp_customize->add_control('trucking_company_display_header_text',
    array(
        'label' => esc_html__('Enable / Disable Site Tagline', 'trucking-company'),
        'section' => 'title_tagline',
        'type' => 'checkbox',
    )
);

$wp_customize->add_setting('trucking_company_header_banner',
    array(
        'default' => $trucking_company_default['trucking_company_header_banner'],
        'capability' => 'edit_theme_options',
        'sanitize_callback' => 'trucking_company_sanitize_checkbox',
    )
);
$wp_customize->add_control('trucking_company_header_banner',
    array(
        'label' => esc_html__('Enable Slider', 'trucking-company'),
        'section' => 'trucking_company_header_banner_setting',
        'type' => 'checkbox',
    )
);

$wp_customize->add_setting( 'trucking_company_header_banner_cat',
    array(
    'default'           => '',
    'capability'        => 'edit_theme_options',
    'sanitize_callback' => 'trucking_company_sanitize_select',
    )
);
$wp_customize->add_control( 'trucking_company_header_banner_cat',
    array(
    'label'       => esc_html__( 'Slider Post Category', 'trucking-company' ),
    'section'     => 'trucking_company_header_banner_setting',
    'type'        => 'select',
    'choices'     => $trucking_company_post_category_list,
    )
);


/* About Us */


$wp_customize->add_section( 'trucking_company_header_category_setting',
    array(
    'title'      => esc_html__( 'About Us Settings', 'trucking-company' ),
    'priority'   => 10,
    'capability' => 'edit_theme_options',
    'panel'      => 'trucking_company_theme_home_pannel',
    )
);

$wp_customize->add_setting('trucking_company_services',
    array(
        'default' => $trucking_company_default['trucking_company_services'],
        'capability' => 'edit_theme_options',
        'sanitize_callback' => 'trucking_company_sanitize_checkbox',
    )
);
$wp_customize->add_control('trucking_company_services',
    array(
        'label' => esc_html__('Enable About Us Section', 'trucking-company'),
        'section' => 'trucking_company_header_category_setting',
        'type' => 'checkbox',
    )
);

$wp_customize->add_setting( 'trucking_company_services_section_title',
    array(
    'default' => $trucking_company_default['trucking_company_services_section_title'],
    'capability'        => 'edit_theme_options',
    'sanitize_callback' => 'sanitize_text_field',
    )
);
$wp_customize->add_control( 'trucking_company_services_section_title',
    array(
    'label'    => esc_html__( 'Main Title', 'trucking-company' ),
    'section'  => 'trucking_company_header_category_setting',
    'type'     => 'text',
    )
);

$wp_customize->add_setting( 'trucking_company_services_section_short_title',
    array(
    'default' => $trucking_company_default['trucking_company_services_section_short_title'],
    'capability'        => 'edit_theme_options',
    'sanitize_callback' => 'sanitize_text_field',
    )
);
$wp_customize->add_control( 'trucking_company_services_section_short_title',
    array(
    'label'    => esc_html__( 'Short Title', 'trucking-company' ),
    'section'  => 'trucking_company_header_category_setting',
    'type'     => 'text',
    )
);

$wp_customize->add_setting( 'trucking_company_services_section_text',
    array(
    'default' => $trucking_company_default['trucking_company_services_section_text'],
    'capability'        => 'edit_theme_options',
    'sanitize_callback' => 'sanitize_text_field',
    )
);
$wp_customize->add_control( 'trucking_company_services_section_text',
    array(
    'label'    => esc_html__( 'Content Text', 'trucking-company' ),
    'section'  => 'trucking_company_header_category_setting',
    'type'     => 'text',
    )
);

for ($trucking_company_i=1; $trucking_company_i <= 6; $trucking_company_i++) { 

    $wp_customize->add_setting( 'trucking_company_services_section_progress_name'.$trucking_company_i,
        array(
        'default'           => '',
        'capability'        => 'edit_theme_options',
        'sanitize_callback' => 'sanitize_text_field',
        )
    );
    $wp_customize->add_control( 'trucking_company_services_section_progress_name'.$trucking_company_i,
        array(
        'label'    => esc_html__( 'Progress Bar Name ', 'trucking-company' ).$trucking_company_i,
        'section'  => 'trucking_company_header_category_setting',
        'type'     => 'text',
        )
    );

    $wp_customize->add_setting( 'trucking_company_services_section_progress_count'.$trucking_company_i,
        array(
        'default'           => '',
        'capability'        => 'edit_theme_options',
        'sanitize_callback' => 'sanitize_text_field',
        )
    );
    $wp_customize->add_control( 'trucking_company_services_section_progress_count'.$trucking_company_i,
        array(
        'label'    => esc_html__( 'Progress Bar Count ', 'trucking-company' ).$trucking_company_i,
        'section'  => 'trucking_company_header_category_setting',
        'type'     => 'text',
        )
    );

}

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

$wp_customize->add_control( 
    new WP_Customize_Image_Control( $wp_customize, 'trucking_company_services_section_image',
    array(
        'label'     => esc_html__( 'Add Image', 'trucking-company' ),
        'settings'  => 'trucking_company_services_section_image',
        'section'   => 'trucking_company_header_category_setting'
        )
    )
);