<?php
/**
 * Theme Customizer Controls
 *
 * @package Jungle Eco Tours
 */

if ( ! function_exists( 'jungle_eco_tours_customizer_header_register' ) ) :
function jungle_eco_tours_customizer_header_register( $wp_customize ) {

    $wp_customize->add_section(
        'jungle_eco_tours_home_header_settings',
        array (
            'priority'      => 25,
            'capability'    => 'edit_theme_options',
            'title'         => esc_html__( 'Header Settings', 'jungle-eco-tours' )
        )
    );
    
    // Title label
    $wp_customize->add_setting( 
        'jungle_eco_tours_label_social_meida_settings_title', 
        array(
            'sanitize_callback' => 'jungle_eco_tours_sanitize_title',
        ) 
    );

    $wp_customize->add_control( 
        new Jungle_Eco_Tours_Title_Info_Control( $wp_customize, 'jungle_eco_tours_label_social_meida_settings_title', 
        array(
            'label'       => esc_html__( 'Social Media Links', 'jungle-eco-tours' ),
            'section'     => 'jungle_eco_tours_home_header_settings',
            'type'        => 'jungle-eco-tours-title',
            'settings'    => 'jungle_eco_tours_label_social_meida_settings_title',
        ) 
    ));

    // Facebook Link
    $wp_customize->add_setting(
        'jungle_eco_tours_social_media1_heading',
        array(
            'default'           => 'www.facebook.com',
            'sanitize_callback' => 'esc_url_raw',
        )
    );

    $wp_customize->add_control(
        'jungle_eco_tours_social_media1_heading',
        array(
            'label'           => sprintf( esc_html__( 'Facebook Link', 'jungle-eco-tours' ), ),
            'section'         => 'jungle_eco_tours_home_header_settings',
            'settings'        => 'jungle_eco_tours_social_media1_heading' ,
            'type'            => 'url',
        )
    );

    // Instagram Link
    $wp_customize->add_setting(
        'jungle_eco_tours_social_media2_heading',
        array(
            'default'           => 'www.instagram.com',
            'sanitize_callback' => 'esc_url_raw',
        )
    );

    $wp_customize->add_control(
        'jungle_eco_tours_social_media2_heading',
        array(
            'label'           => sprintf( esc_html__( 'Instagram Link', 'jungle-eco-tours' ), ),
            'section'         => 'jungle_eco_tours_home_header_settings',
            'settings'        => 'jungle_eco_tours_social_media2_heading' ,
            'type'            => 'url',
        )
    );

    // Twitter Link
    $wp_customize->add_setting(
        'jungle_eco_tours_social_media3_heading',
        array(
            'default'           => 'www.twitter.com',
            'sanitize_callback' => 'esc_url_raw',
        )
    );

    $wp_customize->add_control(
        'jungle_eco_tours_social_media3_heading',
        array(
            'label'           => sprintf( esc_html__( 'Twitter Link', 'jungle-eco-tours' ), ),
            'section'         => 'jungle_eco_tours_home_header_settings',
            'settings'        => 'jungle_eco_tours_social_media3_heading' ,
            'type'            => 'url',
        )
    );

    // Youtube Link
    $wp_customize->add_setting(
        'jungle_eco_tours_social_media4_heading',
        array(
            'default'           => 'www.youtube.com',
            'sanitize_callback' => 'esc_url_raw',
        )
    );

    $wp_customize->add_control(
        'jungle_eco_tours_social_media4_heading',
        array(
            'label'           => sprintf( esc_html__( 'Youtube Link', 'jungle-eco-tours' ), ),
            'section'         => 'jungle_eco_tours_home_header_settings',
            'settings'        => 'jungle_eco_tours_social_media4_heading' ,
            'type'            => 'url',
        )
    );

    // Pinterest Link
    $wp_customize->add_setting(
        'jungle_eco_tours_social_media5_heading',
        array(
            'default'           => 'www.pinterest.com',
            'sanitize_callback' => 'esc_url_raw',
        )
    );

    $wp_customize->add_control(
        'jungle_eco_tours_social_media5_heading',
        array(
            'label'           => sprintf( esc_html__( 'Pinterest Link', 'jungle-eco-tours' ), ),
            'section'         => 'jungle_eco_tours_home_header_settings',
            'settings'        => 'jungle_eco_tours_social_media5_heading' ,
            'type'            => 'url',
        )
    );

    // Linkedin Link
    $wp_customize->add_setting(
        'jungle_eco_tours_social_media6_heading',
        array(
            'default'           => 'www.linkedin.com',
            'sanitize_callback' => 'esc_url_raw',
        )
    );

    $wp_customize->add_control(
        'jungle_eco_tours_social_media6_heading',
        array(
            'label'           => sprintf( esc_html__( 'Linkedin Link', 'jungle-eco-tours' ), ),
            'section'         => 'jungle_eco_tours_home_header_settings',
            'settings'        => 'jungle_eco_tours_social_media6_heading' ,
            'type'            => 'url',
        )
    );

    // Title label
    $wp_customize->add_setting( 
        'jungle_eco_tours_label_header_settings_title', 
        array(
            'sanitize_callback' => 'jungle_eco_tours_sanitize_title',
        ) 
    );

    $wp_customize->add_control( 
        new Jungle_Eco_Tours_Title_Info_Control( $wp_customize, 'jungle_eco_tours_label_header_settings_title', 
        array(
            'label'       => esc_html__( 'Contact Detail', 'jungle-eco-tours' ),
            'section'     => 'jungle_eco_tours_home_header_settings',
            'type'        => 'jungle-eco-tours-title',
            'settings'    => 'jungle_eco_tours_label_header_settings_title',
        ) 
    ));

    $wp_customize->add_setting(
        'jungle_eco_tours_topbar_email_id',
        array(
            'default'           => 'adventureinfo@example.com',
            'sanitize_callback' => 'sanitize_text_field',
        )
    );

    $wp_customize->add_control(
        'jungle_eco_tours_topbar_email_id',
        array(
            'label'           => sprintf( esc_html__( 'Email Id', 'jungle-eco-tours' ), ),
            'section'         => 'jungle_eco_tours_home_header_settings',
            'settings'        => 'jungle_eco_tours_topbar_email_id' ,
            'type'            => 'text',
        )
    );

    $wp_customize->add_setting(
        'jungle_eco_tours_topbar_address',
        array(
            'default'           => '775 Rolling Green Rd.',
            'sanitize_callback' => 'sanitize_text_field',
        )
    );

    $wp_customize->add_control(
        'jungle_eco_tours_topbar_address',
        array(
            'label'           => sprintf( esc_html__( 'Address', 'jungle-eco-tours' ), ),
            'section'         => 'jungle_eco_tours_home_header_settings',
            'settings'        => 'jungle_eco_tours_topbar_address' ,
            'type'            => 'text',
        )
    );

    // Title label
    $wp_customize->add_setting( 
        'jungle_eco_tours_label_header_search_settings_title', 
        array(
            'sanitize_callback' => 'jungle_eco_tours_sanitize_title',
        ) 
    );

    $wp_customize->add_control( 
        new Jungle_Eco_Tours_Title_Info_Control( $wp_customize, 'jungle_eco_tours_label_header_search_settings_title', 
        array(
            'label'       => esc_html__( 'Search Bar', 'jungle-eco-tours' ),
            'section'     => 'jungle_eco_tours_home_header_settings',
            'type'        => 'jungle-eco-tours-title',
            'settings'    => 'jungle_eco_tours_label_header_search_settings_title',
        ) 
    ));

     // Hide Search bar
    $wp_customize->add_setting(
        'jungle_eco_tours_search_hide',
        array(
            'type' => 'theme_mod',
            'default'           => true,
            'sanitize_callback' => 'jungle_eco_tours_sanitize_checkbox'
        )
    );

    $wp_customize->add_control(
        new Jungle_Eco_Tours_Toggle_Control( $wp_customize, 'jungle_eco_tours_search_hide', 
        array(
            'settings'      => 'jungle_eco_tours_search_hide',
            'section'       => 'jungle_eco_tours_home_header_settings',
            'type'          => 'jungle-eco-tours-toggle',
            'label'         => esc_html__( 'Show\Hide Search', 'jungle-eco-tours' ),
            'description'   => '',           
        )
    ));
    
     // header Button
    $wp_customize->add_setting(
        'jungle_eco_tours_header_button_link',
        array(
            'default'           => '#',
            'sanitize_callback' => 'esc_url_raw',
        )
    );

    $wp_customize->add_control(
        'jungle_eco_tours_header_button_link',
        array(
            'label'           => sprintf( esc_html__( 'Header Button Link', 'jungle-eco-tours' ), ),
            'section'         => 'jungle_eco_tours_home_header_settings',
            'settings'        => 'jungle_eco_tours_header_button_link' ,
            'type'            => 'url',
        )
    );
}
endif;

add_action( 'customize_register', 'jungle_eco_tours_customizer_header_register' );