<?php
/**
 * Theme Customizer Controls
 *
 * @package Quantic
 */


if ( ! function_exists( 'quantic_customizer_home_banner_register' ) ) :
function quantic_customizer_home_banner_register( $wp_customize ) {
 	
 	$wp_customize->add_section(
        'quantic_home_banner_settings',
        array (
            'priority'      => 25,
            'capability'    => 'edit_theme_options',
            'title'         => esc_html__( 'Banner Settings', 'quantic' )
        )
    );

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

	$wp_customize->add_control( 
		new Quantic_Title_Info_Control( $wp_customize, 'quantic_label_banner_settings_title', 
		array(
		    'label'       => esc_html__( 'Banner Settings', 'quantic' ),
		    'section'     => 'quantic_home_banner_settings',
		    'type'        => 'quantic-title',
		    'settings'    => 'quantic_label_banner_settings_title',
		) 
	));

    // Button Image
    $wp_customize->add_setting(
        'quantic_banner_image',
        array(
            'default'           => '',
            'sanitize_callback' => 'quantic_sanitize_image',

        )
    );
    
    $wp_customize->add_control(
        new WP_Customize_Image_Control(
            $wp_customize, 'quantic_banner_image', 
            array(
                'label'           => sprintf( esc_html__( 'Banner Image', 'quantic' ), ),
                'settings'  => 'quantic_banner_image',
                'section'   => 'quantic_home_banner_settings'
            ) 
        )
    );

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

    $wp_customize->add_control(
        'quantic_banner_small_heading',
        array(
            'label'           => sprintf( esc_html__( 'Banner Small Heading', 'quantic' ), ),
            'section'         => 'quantic_home_banner_settings',
            'settings'        => 'quantic_banner_small_heading' ,
            'type'            => 'text',
        )
    );    

    // Banner Heading
	$wp_customize->add_setting(
        'quantic_banner_heading',
        array(
            'default'           => '',
            'sanitize_callback' => 'sanitize_text_field',
        )
    );

    $wp_customize->add_control(
        'quantic_banner_heading',
        array(
            'label'           => sprintf( esc_html__( 'Banner Heading', 'quantic' ), ),
            'section'         => 'quantic_home_banner_settings',
            'settings'        => 'quantic_banner_heading' ,
            'type'            => 'text',
        )
    );

    // Banner Text
    $wp_customize->add_setting(
        'quantic_banner_text',
        array(
            'default'           => '',
            'sanitize_callback' => 'sanitize_text_field',
        )
    );

    $wp_customize->add_control(
        'quantic_banner_text',
        array(
            'label'           => sprintf( esc_html__( 'Banner Text', 'quantic' ), ),
            'section'         => 'quantic_home_banner_settings',
            'settings'        => 'quantic_banner_text' ,
            'type'            => 'text',
        )
    );

    // Button Link
    $wp_customize->add_setting(
        'quantic_banner_button_link',
        array(
            'default'           => '',
            'sanitize_callback' => 'esc_url_raw',
        )
    );

    $wp_customize->add_control(
        'quantic_banner_button_link',
        array(
            'label'           => sprintf( esc_html__( 'Banner Button Link', 'quantic' ), ),
            'section'         => 'quantic_home_banner_settings',
            'settings'        => 'quantic_banner_button_link' ,
            'type'            => 'url',
        )
    );

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

    $wp_customize->add_control( 
        new Quantic_Title_Info_Control( $wp_customize, 'quantic_label_social_meida_settings_title', 
        array(
            'label'       => esc_html__( 'Social Media Links', 'quantic' ),
            'section'     => 'quantic_home_banner_settings',
            'type'        => 'quantic-title',
            'settings'    => 'quantic_label_social_meida_settings_title',
        ) 
    ));

    // Facebook Link
    $wp_customize->add_setting(
        'quantic_social_media1_heading',
        array(
            'default'           => '',
            'sanitize_callback' => 'esc_url_raw',
        )
    );

    $wp_customize->add_control(
        'quantic_social_media1_heading',
        array(
            'label'           => sprintf( esc_html__( 'Facebook Link', 'quantic' ), ),
            'section'         => 'quantic_home_banner_settings',
            'settings'        => 'quantic_social_media1_heading' ,
            'type'            => 'url',
        )
    );

    // Instagram Link
    $wp_customize->add_setting(
        'quantic_social_media2_heading',
        array(
            'default'           => '',
            'sanitize_callback' => 'esc_url_raw',
        )
    );

    $wp_customize->add_control(
        'quantic_social_media2_heading',
        array(
            'label'           => sprintf( esc_html__( 'Instagram Link', 'quantic' ), ),
            'section'         => 'quantic_home_banner_settings',
            'settings'        => 'quantic_social_media2_heading' ,
            'type'            => 'url',
        )
    );

    // Twitter Link
    $wp_customize->add_setting(
        'quantic_social_media3_heading',
        array(
            'default'           => '',
            'sanitize_callback' => 'esc_url_raw',
        )
    );

    $wp_customize->add_control(
        'quantic_social_media3_heading',
        array(
            'label'           => sprintf( esc_html__( 'Twitter Link', 'quantic' ), ),
            'section'         => 'quantic_home_banner_settings',
            'settings'        => 'quantic_social_media3_heading' ,
            'type'            => 'url',
        )
    );

    // Youtube Link
    $wp_customize->add_setting(
        'quantic_social_media4_heading',
        array(
            'default'           => '',
            'sanitize_callback' => 'esc_url_raw',
        )
    );

    $wp_customize->add_control(
        'quantic_social_media4_heading',
        array(
            'label'           => sprintf( esc_html__( 'Youtube Link', 'quantic' ), ),
            'section'         => 'quantic_home_banner_settings',
            'settings'        => 'quantic_social_media4_heading' ,
            'type'            => 'url',
        )
    );

    // Slider Content Alignment Setting
    $wp_customize->add_setting(
        'quantic_slider_content_alignment',
        array(
            'default'           => 'left',
            'sanitize_callback' => 'quantic_sanitize_select',
        )
    );

    $wp_customize->add_control(
        'quantic_slider_content_alignment',
        array(
            'label'    => esc_html__( 'Slider Content Alignment', 'quantic' ),
            'section'  => 'quantic_home_banner_settings',
            'settings' => 'quantic_slider_content_alignment',
            'type'     => 'select',
            'choices'  => array(
                'left'   => esc_html__( 'Left', 'quantic' ),
                'center' => esc_html__( 'Center', 'quantic' ),
                'right'  => esc_html__( 'Right', 'quantic' ),
            ),
        )
    );   
}
endif;

add_action( 'customize_register', 'quantic_customizer_home_banner_register' );