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

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

    $wp_customize->add_section(
        'jungle_eco_tours_home_about_settings',
        array (
            'priority'      => 25,
            'capability'    => 'edit_theme_options',
            'title'         => esc_html__( 'About Us Settings', 'jungle-eco-tours' )
        )
    );

    // Title label
    $wp_customize->add_setting( 
        'jungle_eco_tours_label_about_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_about_settings_title', 
        array(
            'label'       => esc_html__( 'About Us Settings', 'jungle-eco-tours' ),
            'section'     => 'jungle_eco_tours_home_about_settings',
            'type'        => 'jungle-eco-tours-title',
            'settings'    => 'jungle_eco_tours_label_about_settings_title',
        ) 
    ));

    $wp_customize->add_setting(
        'jungle_eco_tours_about_left_image',
        array(
            'default'           => '',
            'sanitize_callback' => 'jungle_eco_tours_sanitize_image',

        )
    );
    
    $wp_customize->add_control(
        new WP_Customize_Image_Control(
            $wp_customize, 'jungle_eco_tours_about_left_image', 
            array(
                'label'           => sprintf( esc_html__( 'Left Image', 'jungle-eco-tours' ), ),
                'settings'  => 'jungle_eco_tours_about_left_image',
                'section'   => 'jungle_eco_tours_home_about_settings'
            ) 
        )
    );

    $wp_customize->add_setting(
        'jungle_eco_tours_about_right_image',
        array(
            'default'           => '',
            'sanitize_callback' => 'jungle_eco_tours_sanitize_image',

        )
    );
    
    $wp_customize->add_control(
        new WP_Customize_Image_Control(
            $wp_customize, 'jungle_eco_tours_about_right_image', 
            array(
                'label'           => sprintf( esc_html__( 'Right Image', 'jungle-eco-tours' ), ),
                'settings'  => 'jungle_eco_tours_about_right_image',
                'section'   => 'jungle_eco_tours_home_about_settings'
            ) 
        )
    );

    $wp_customize->add_setting(
        'jungle_eco_tours_about_small_heading',
        array(
            'default'           => '',
            'sanitize_callback' => 'sanitize_text_field',
        )
    );

    $wp_customize->add_control(
        'jungle_eco_tours_about_small_heading',
        array(
            'label'           => sprintf( esc_html__( 'Small Heading', 'jungle-eco-tours' ), ),
            'section'         => 'jungle_eco_tours_home_about_settings',
            'settings'        => 'jungle_eco_tours_about_small_heading' ,
            'type'            => 'text',
        )
    );

    $wp_customize->add_setting(
        'jungle_eco_tours_about_main_heading',
        array(
            'default'           => '',
            'sanitize_callback' => 'sanitize_text_field',
        )
    );

    $wp_customize->add_control(
        'jungle_eco_tours_about_main_heading',
        array(
            'label'           => sprintf( esc_html__( 'Main Heading', 'jungle-eco-tours' ), ),
            'section'         => 'jungle_eco_tours_home_about_settings',
            'settings'        => 'jungle_eco_tours_about_main_heading' ,
            'type'            => 'text',
        )
    );

    $wp_customize->add_setting(
        'jungle_eco_tours_about_text1',
        array(
            'default'           => '',
            'sanitize_callback' => 'sanitize_text_field',
        )
    );

    $wp_customize->add_control(
        'jungle_eco_tours_about_text1',
        array(
            'label'           => sprintf( esc_html__( 'Text 1', 'jungle-eco-tours' ), ),
            'section'         => 'jungle_eco_tours_home_about_settings',
            'settings'        => 'jungle_eco_tours_about_text1' ,
            'type'            => 'text',
        )
    );

    $wp_customize->add_setting(
        'jungle_eco_tours_about_text2',
        array(
            'default'           => '',
            'sanitize_callback' => 'sanitize_text_field',
        )
    );

    $wp_customize->add_control(
        'jungle_eco_tours_about_text2',
        array(
            'label'           => sprintf( esc_html__( 'Text 2', 'jungle-eco-tours' ), ),
            'section'         => 'jungle_eco_tours_home_about_settings',
            'settings'        => 'jungle_eco_tours_about_text2' ,
            'type'            => 'text',
        )
    );

    $wp_customize->add_setting(
        'jungle_eco_tours_about_button_link',
        array(
            'default'           => '',
            'sanitize_callback' => 'esc_url_raw',
        )
    );

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

add_action( 'customize_register', 'jungle_eco_tours_customizer_home_about_register' );