<?php
/**
* Header Banner Options.
*
* @package Travel Destination
*/

$travel_destination_default = travel_destination_get_default_theme_options();
$travel_destination_post_category_list = travel_destination_post_category_list();

$wp_customize->add_section( 'header_banner_setting',
    array(
    'title'      => esc_html__( 'Banner Settings', 'travel-destination' ),
    'priority'   => 10,
    'capability' => 'edit_theme_options',
    'panel'      => 'theme_home_pannel',
    )
);

// Show/Hide Site Logo
$wp_customize->add_setting('travel_destination_display_logo', array(
    'default'           => false,
    'capability'        => 'edit_theme_options',
    'sanitize_callback' => 'travel_destination_sanitize_checkbox',
));
$wp_customize->add_control('travel_destination_display_logo', array(
    'label'    => esc_html__('Enable / Disable Site Logo', 'travel-destination'),
    'section'  => 'title_tagline',
    'type'     => 'checkbox',
));

// Show/Hide Site Title
$wp_customize->add_setting('travel_destination_display_title', array(
    'default'           => true,
    'capability'        => 'edit_theme_options',
    'sanitize_callback' => 'travel_destination_sanitize_checkbox',
));
$wp_customize->add_control('travel_destination_display_title', array(
    'label'    => esc_html__('Enable / Disable Site Title', 'travel-destination'),
    'section'  => 'title_tagline',
    'type'     => 'checkbox',
));

// Show/Hide Site Tagline
$wp_customize->add_setting('travel_destination_display_header_text',
    array(
        'default'           => false,
        'capability' => 'edit_theme_options',
        'sanitize_callback' => 'travel_destination_sanitize_checkbox',
    )
);
$wp_customize->add_control('travel_destination_display_header_text',
    array(
        'label' => esc_html__('Enable / Disable Site Tagline', 'travel-destination'),
        'section' => 'title_tagline',
        'type' => 'checkbox',
    )
);

$wp_customize->add_setting('travel_destination_header_slider',
    array(
        'default' => $travel_destination_default['travel_destination_header_slider'],
        'capability' => 'edit_theme_options',
        'sanitize_callback' => 'travel_destination_sanitize_checkbox',
    )
);
$wp_customize->add_control('travel_destination_header_slider',
    array(
        'label' => esc_html__('Enable Banner', 'travel-destination'),
        'section' => 'header_banner_setting',
        'type' => 'checkbox',
    )
);

$wp_customize->add_setting('travel_destination_banner_background_image',
    array(
        'default' => $travel_destination_default['travel_destination_banner_background_image'],
        'sanitize_callback' => 'esc_url_raw',
    )
);
$wp_customize->add_control(
    new WP_Customize_Image_Control( $wp_customize,'travel_destination_banner_background_image',
        array(
            'label' => __('Banner Background Image','travel-destination'),
            'section' => 'header_banner_setting',
            'settings' => 'travel_destination_banner_background_image',
        )
    )
);

$wp_customize->add_setting( 'travel_destination_banner_heading',
    array(
    'default'           => $travel_destination_default['travel_destination_banner_heading'],
    'capability'        => 'edit_theme_options',
    'sanitize_callback' => 'sanitize_text_field',
    )
);
$wp_customize->add_control( 'travel_destination_banner_heading',
    array(
    'label'    => esc_html__( 'Banner Heading ', 'travel-destination' ),
    'section'  => 'header_banner_setting',
    'type'     => 'text',
    )
);

$wp_customize->add_setting( 'travel_destination_banner_content',
    array(
    'default'           => $travel_destination_default['travel_destination_banner_content'],
    'capability'        => 'edit_theme_options',
    'sanitize_callback' => 'sanitize_text_field',
    )
);
$wp_customize->add_control( 'travel_destination_banner_content',
    array(
    'label'    => esc_html__( 'Banner Content ', 'travel-destination' ),
    'section'  => 'header_banner_setting',
    'type'     => 'text',
    )
);

$wp_customize->add_setting( 'travel_destination_banner_rating_number',
    array(
    'default'           => $travel_destination_default['travel_destination_banner_rating_number'],
    'capability'        => 'edit_theme_options',
    'sanitize_callback' => 'sanitize_text_field',
    )
);
$wp_customize->add_control( 'travel_destination_banner_rating_number',
    array(
    'label'    => esc_html__( 'Banner Rating Number ', 'travel-destination' ),
    'section'  => 'header_banner_setting',
    'type'     => 'text',
    )
);

$wp_customize->add_setting( 'travel_destination_banner_rating_text',
    array(
    'default'           => $travel_destination_default['travel_destination_banner_rating_text'],
    'capability'        => 'edit_theme_options',
    'sanitize_callback' => 'sanitize_text_field',
    )
);
$wp_customize->add_control( 'travel_destination_banner_rating_text',
    array(
    'label'    => esc_html__( 'Banner Rating Text ', 'travel-destination' ),
    'section'  => 'header_banner_setting',
    'type'     => 'text',
    )
);

$wp_customize->add_setting('travel_destination_banner_team_image_1',
    array(
        'default' => $travel_destination_default['travel_destination_banner_team_image_1'],
        'sanitize_callback' => 'esc_url_raw',
    )
);
$wp_customize->add_control(
    new WP_Customize_Image_Control( $wp_customize,'travel_destination_banner_team_image_1',
        array(
            'label' => __('Testimonial Image 1','travel-destination'),
            'section' => 'header_banner_setting',
            'settings' => 'travel_destination_banner_team_image_1',
        )
    )
);

$wp_customize->add_setting('travel_destination_banner_team_image_2',
    array(
        'default' => $travel_destination_default['travel_destination_banner_team_image_2'],
        'sanitize_callback' => 'esc_url_raw',
    )
);
$wp_customize->add_control(
    new WP_Customize_Image_Control( $wp_customize,'travel_destination_banner_team_image_2',
        array(
            'label' => __('Testimonial Image 2','travel-destination'),
            'section' => 'header_banner_setting',
            'settings' => 'travel_destination_banner_team_image_2',
        )
    )
);

$wp_customize->add_setting('travel_destination_banner_team_image_3',
    array(
        'default' => $travel_destination_default['travel_destination_banner_team_image_3'],
        'sanitize_callback' => 'esc_url_raw',
    )
);
$wp_customize->add_control(
    new WP_Customize_Image_Control( $wp_customize,'travel_destination_banner_team_image_3',
        array(
            'label' => __('Testimonial Image 3','travel-destination'),
            'section' => 'header_banner_setting',
            'settings' => 'travel_destination_banner_team_image_3',
        )
    )
);

$wp_customize->add_setting('travel_destination_banner_team_image_4',
    array(
        'default' => $travel_destination_default['travel_destination_banner_team_image_4'],
        'sanitize_callback' => 'esc_url_raw',
    )
);
$wp_customize->add_control(
    new WP_Customize_Image_Control( $wp_customize,'travel_destination_banner_team_image_4',
        array(
            'label' => __('Testimonial Image 4','travel-destination'),
            'section' => 'header_banner_setting',
            'settings' => 'travel_destination_banner_team_image_4',
        )
    )
);

// Tour Packages Setting

$wp_customize->add_section( 'product_column_setting',
    array(
    'title'      => esc_html__( 'Tour Packages Setting', 'travel-destination' ),
    'priority'   => 10,
    'capability' => 'edit_theme_options',
    'panel'      => 'theme_home_pannel',
    )
);

$wp_customize->add_setting( 'travel_destination_team_section_title',
    array(
    'default'           => $travel_destination_default['travel_destination_team_section_title'],
    'capability'        => 'edit_theme_options',
    'sanitize_callback' => 'sanitize_text_field',
    )
);
$wp_customize->add_control( 'travel_destination_team_section_title',
    array(
    'label'    => esc_html__( 'Tour Packages Heading ', 'travel-destination' ),
    'section'  => 'product_column_setting',
    'type'     => 'text',
    )
);

$wp_customize->add_setting( 'travel_destination_team_section_subtitle',
    array(
    'default'           => $travel_destination_default['travel_destination_team_section_subtitle'],
    'capability'        => 'edit_theme_options',
    'sanitize_callback' => 'sanitize_text_field',
    )
);
$wp_customize->add_control( 'travel_destination_team_section_subtitle',
    array(
    'label'    => esc_html__( 'Tour Packages Content ', 'travel-destination' ),
    'section'  => 'product_column_setting',
    'type'     => 'text',
    )
);



$categories = get_categories();
$cat_post = array();
$cat_post[]= 'select';
$m = 0;
foreach($categories as $category){
    if($m==0){
        $default = $category->slug;
        $m++;
    }
    $cat_post[$category->slug] = $category->name;
}

$wp_customize->add_setting('travel_destination_locations_post_cat',array(
    'default'   => 'uncategorized',
    'sanitize_callback' => 'travel_destination_sanitize_select',
));
$wp_customize->add_control('travel_destination_locations_post_cat' ,array(
    'type'    => 'select',
    'choices' => $cat_post,
    'label' => __('Select Category to display Showcase','travel-destination'),
    'section' => 'product_column_setting',
));

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

    $wp_customize->add_setting( 'travel_destination_tour_rating'.$travel_destination_i,
        array(
        'default'           => '',
        'capability'        => 'edit_theme_options',
        'sanitize_callback' => 'sanitize_text_field',
        )
    );
    $wp_customize->add_control( 'travel_destination_tour_rating'.$travel_destination_i,
        array(
        'label'    => esc_html__( 'Tour Rating ', 'travel-destination' ) .$travel_destination_i,
        'section'  => 'product_column_setting',
        'type'     => 'text',
        )
    );

    $wp_customize->add_setting('travel_destination_tour_team_image'.$travel_destination_i,
        array(
            'default' => '',
            'sanitize_callback' => 'esc_url_raw',
        )
    );
    $wp_customize->add_control(
        new WP_Customize_Image_Control( $wp_customize,'travel_destination_tour_team_image'.$travel_destination_i,
            array(
                'label' => __('Team Image','travel-destination') .$travel_destination_i,
                'section' => 'product_column_setting',
                'settings' => 'travel_destination_tour_team_image'.$travel_destination_i,
            )
        )
    );

    $wp_customize->add_setting( 'travel_destination_tour_location'.$travel_destination_i,
        array(
        'default'           => '',
        'capability'        => 'edit_theme_options',
        'sanitize_callback' => 'sanitize_text_field',
        )
    );
    $wp_customize->add_control( 'travel_destination_tour_location'.$travel_destination_i,
        array(
        'label'    => esc_html__( 'Tour Location ', 'travel-destination' ) .$travel_destination_i,
        'section'  => 'product_column_setting',
        'type'     => 'text',
        )
    );

    $wp_customize->add_setting( 'travel_destination_tour_price'.$travel_destination_i,
        array(
        'default'           => '',
        'capability'        => 'edit_theme_options',
        'sanitize_callback' => 'sanitize_text_field',
        )
    );
    $wp_customize->add_control( 'travel_destination_tour_price'.$travel_destination_i,
        array(
        'label'    => esc_html__( 'Tour Price ', 'travel-destination' ) .$travel_destination_i,
        'section'  => 'product_column_setting',
        'type'     => 'text',
        )
    );
    
}