<?php

/* 
 * anirohotellight Theme Customizer - Panel "Front Page Header"
 *
 * @package anirohotellight
 */

//******************************************************************************       
// Add Panel Front Page Header
//******************************************************************************

$wp_customize->add_panel( 'front_page_header', array(
  'title' => esc_html__( 'Front page section "Header"', 'aniro-hotel-light' ),
  'description' => esc_html__( 'Front page section "Header" options.', 'aniro-hotel-light' ),
  'priority' => 32, 
) );


//******************************************************************************  
//Add section "Front page header"
//******************************************************************************  

$wp_customize->add_section( 'front_page_header' , array(
    'title' => esc_html__( 'Slider', 'aniro-hotel-light' ),
    'panel' => 'front_page_header',
    'description' => esc_html__( 'Slider options.', 'aniro-hotel-light' )
) );     
//******************************************************************************    
    //Slider's type           
    $wp_customize->add_setting( 'anirohotellight_slider_index_type', array(
            'default' => 'type-index-1',
            'sanitize_callback' => 'anirohotellight_sanitize_slider_type_index'
        )
    );
    $wp_customize->add_control( 'anirohotellight_slider_index_type', array(
            'type' => 'radio',
            'label' => esc_html__( 'Slider type:', 'aniro-hotel-light' ),
            'section' => 'front_page_header',
            'choices' => array(
                'type-index-1' => esc_html__( 'Sliding images', 'aniro-hotel-light' ),
                'type-index-2' => esc_html__( 'Fade images', 'aniro-hotel-light' )
            )
        )
    );  
      
//add color for filtr
$wp_customize->add_setting( 'anirohotellight_slider_bg_filtr', array(
        'default'     => '#000',
        'sanitize_callback' => 'sanitize_hex_color',
    )
);
$wp_customize->add_control(
    new WP_Customize_Color_Control($wp_customize, 'anirohotellight_slider_bg_filtr', array(
            'label'      => esc_html__( 'Select the filter color for the slider images', 'aniro-hotel-light' ),
            'section'    => 'front_page_header',
            'settings'   => 'anirohotellight_slider_bg_filtr'
        )
    )
);

//select the transparency for the filter
	$wp_customize->add_setting( 'anirohotellight_slider_bg_filtr_alpha', array(
	    'sanitize_callback' => 'anirohotellight_sanitize_float',
            'default'	        => 0,
	));

	$wp_customize->add_control ( 'anirohotellight_slider_bg_filtr_alpha', array( 
		'type'        => 'number',
                'label'    => esc_html__( 'Select the transparency for the filter', 'aniro-hotel-light' ),
		'section'  => 'front_page_header', 
		'settings' => 'anirohotellight_slider_bg_filtr_alpha',  
                'input_attrs' => array(
                    'min'   => 0,
                    'max'   => 1,
                    'step'  => 0.1,
                    'style' => 'margin-bottom: 15px; padding: 15px;',
        ),
	));           
    
   /*******************************************************************************************/        
    $wp_customize->add_setting('anirohotellight-slider-info', array(
            'type'              => 'info_control',
            'sanitize_callback' => 'esc_attr'            
        )
    );
    $wp_customize->add_control( new Second_Info( $wp_customize, 'anirohotellight-slider-info', array(
        'label' => esc_html__('Add images and text in slider:', 'aniro-hotel-light'),
        'section' => 'front_page_header',
        'settings' => 'anirohotellight-slider-info'
        ) )
    );            
    
    //For slide 1
   /*******************************************************************************************/        
    $wp_customize->add_setting('anirohotellight-slider-info', array(
            'type'              => 'info_control',
            'sanitize_callback' => 'esc_attr'           
        )
    );
    $wp_customize->add_control( new Second_Info( $wp_customize, 'anirohotellight-slider-info', array(
        'label' => esc_html__('Slide 1:', 'aniro-hotel-light'),
        'section' => 'front_page_header',
        'settings' => 'anirohotellight-slider-info'
        ) )
    );      
    
  
//Main text
	$wp_customize->add_setting('anirohotellight_slider_text_1', array(
			'default'            => '',
			'sanitize_callback'  => 'wp_filter_nohtml_kses'
		)
	);
	$wp_customize->add_control('anirohotellight_slider_text_1', array(
			'section'  => 'front_page_header',
                        'label'    => esc_html__( 'Text for image in slide 1:', 'aniro-hotel-light' ),
			'type'     => 'text'
		)
	);       
    
//Link
	$wp_customize->add_setting('anirohotellight_slider_link_1', array(
			'default'            => '',
			'sanitize_callback'  => 'esc_url_raw'
		)
	);
	$wp_customize->add_control('anirohotellight_slider_link_1', array(
			'section'  => 'front_page_header',
                        'label'    => esc_html__( 'Button: link for button in slide 1:', 'aniro-hotel-light' ),
			'type'     => 'url'
		)
	);
//Link text
	$wp_customize->add_setting('anirohotellight_slider_link_text_1', array(
			'default'            => '',
			'sanitize_callback'  => 'wp_filter_nohtml_kses'
		)
	);
	$wp_customize->add_control('anirohotellight_slider_link_text_1', array(
			'section'  => 'front_page_header',
                        'label'    => esc_html__( 'Button: text for button in slide 1:', 'aniro-hotel-light' ),
			'type'     => 'text'
		)
	);     
/*********************************************/        
// Show/hide button in slider 1
            $wp_customize->add_setting('front_page_show_hide_btn_slide_1', array(
                 'default'    =>  '',
                 'sanitize_callback'  => 'anirohotellight_sanitize_checkbox',
            ));

            $wp_customize->add_control('front_page_show_hide_btn_slide_1', array(
                    'type' => 'checkbox',
                    'label' => esc_html__( 'Hide this button?', 'aniro-hotel-light' ),
                    'section' => 'front_page_header',
                )
            );               
//image    
            $wp_customize->add_setting( 'anirohotellight_slider_img_1', array(
                    'default' => '',
                    'sanitize_callback' => 'esc_url_raw',
            ));

            $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'anirohotellight_slider_img_1', array( 
                    'label'    => esc_html__( 'Add image 1 - the recommended image size is 1300x500px', 'aniro-hotel-light' ),
                    'type'           => 'image',
                    'section'  => 'front_page_header', 
                    'settings' => 'anirohotellight_slider_img_1',
            ))); 
            
    //For slide 2         
   /*******************************************************************************************/        
    $wp_customize->add_setting('anirohotellight-slide2-info', array(
            'type'              => 'info_control',
            'sanitize_callback' => 'esc_attr',            
        )
    );
    $wp_customize->add_control( new Second_Info( $wp_customize, 'anirohotellight-slide2-info', array(
        'label' => esc_html__('Slide 2:', 'aniro-hotel-light'),
        'section' => 'front_page_header',
        'settings' => 'anirohotellight-slide2-info',
        ) )
    );                  
   
//Text
	$wp_customize->add_setting('anirohotellight_slider_text_2', array(
			'default'            => '',
			'sanitize_callback'  => 'wp_filter_nohtml_kses'
		)
	);
	$wp_customize->add_control('anirohotellight_slider_text_2', array(
			'section'  => 'front_page_header',
                        'label' => esc_html__('Text for image in slide 2:', 'aniro-hotel-light'),
			'type'     => 'text'
		)
	);
//Link
	$wp_customize->add_setting('anirohotellight_slider_link_2', array(
			'default'            => '',
			'sanitize_callback'  => 'esc_url_raw'
		)
	);
	$wp_customize->add_control('anirohotellight_slider_link_2', array(
			'section'  => 'front_page_header',
                        'label' => esc_html__('Button: link for button in slide 2:', 'aniro-hotel-light'),
			'type'     => 'url'
		)
	);
//Link text
	$wp_customize->add_setting('anirohotellight_slider_link_text_2', array(
			'default'            => '',
			'sanitize_callback'  => 'wp_filter_nohtml_kses'
		)
	);
	$wp_customize->add_control('anirohotellight_slider_link_text_2', array(
			'section'  => 'front_page_header',
                        'label' => esc_html__('Button: text for button in slide 2:', 'aniro-hotel-light'),
			'type'     => 'text'
		)
	); 
/*********************************************/        
// Show/hide button in slider 2
            $wp_customize->add_setting('front_page_show_hide_btn_slide_2', array(
                 'default'    =>  '',
                 'sanitize_callback'  => 'anirohotellight_sanitize_checkbox',
            ));

            $wp_customize->add_control('front_page_show_hide_btn_slide_2', array(
                    'type' => 'checkbox',
                    'label' => esc_html__( 'Hide this button?', 'aniro-hotel-light' ),
                    'section' => 'front_page_header',
                )
            );               
//image    
            $wp_customize->add_setting( 'anirohotellight_slider_img_2', array(
                    'default' => '',
                    'sanitize_callback' => 'esc_url_raw',
            ));

            $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'anirohotellight_slider_img_2', array( 
                    'label'    => esc_html__( 'Add image 2 - the recommended image size is 1300x500px', 'aniro-hotel-light' ),
                    'type'           => 'image',
                    'section'  => 'front_page_header', 
                    'settings' => 'anirohotellight_slider_img_2',
            )));       
