<?php

/* 
 * Aniro Hotel Theme Customizer - Panel "Front Page Testimonials"
 *
 * @package anirohotellight
 */

//******************************************************************************       
// Add Panel "Front Page Testimonials"
//******************************************************************************

$wp_customize->add_panel( 'front_page_testimonials', array(
  'title' => __( 'Front page section "Testimonials"', 'aniro-hotel-light' ),
  'description' => __( 'Front page section "Testimonials" - options.', 'aniro-hotel-light' ),
  'priority' => 48, 
) );


//******************************************************************************  
//Add section 'Front page Testimonials'
//******************************************************************************  

$wp_customize->add_section( 'front_page_testimonials' , array(
    'title' => __( 'Front page testimonials', 'aniro-hotel-light' ),
    'panel' => 'front_page_testimonials',
    'priority' => 1,
    'description' => __( 'Front page testimonials.', 'aniro-hotel-light' )
) );     
 
/*******************************************************************************************/        
//Testimonials Title
	$wp_customize->add_setting('anirohotellight_testimonials_title', array(
			'default'            => 'Testimonials',
			'sanitize_callback'  => 'anirohotellight_sanitize_text'
		)
	);
	$wp_customize->add_control('anirohotellight_testimonials_title', array(
			'section'  => 'front_page_testimonials',
			'label'    => 'Title for testimonials:',
			'type'     => 'text'
		)
	);
        
//******************************************************************************  
//Add section "Testimonials - background"
//******************************************************************************              
$wp_customize->add_section( 'front_page_testimonials_bg' , array(
    'title' => __( 'Testimonials - background', 'aniro-hotel-light' ),
    'panel' => 'front_page_testimonials',
    'priority' => 1,
    'description' => __( 'Add background image for section "Testimonials".', 'aniro-hotel-light' )
) );    

//image    
            $wp_customize->add_setting( 'anirohotellight_testimonials_bg', array(
                    'default-image' => '',
                    'sanitize_callback' => 'anirohotellight_sanitize_uri',
            ));

            $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'anirohotellight_testimonials_bg', array( 
                    'label'    => __( 'Add background image for testimonials section - the recommended image size is 1300x500px', 'aniro-hotel-light' ),
                    'type'           => 'image',
                    'section'  => 'front_page_testimonials_bg', 
                    'settings' => 'anirohotellight_testimonials_bg',
            ))); 
//add color for filtr
$wp_customize->add_setting( 'anirohotellight_testimonials_bg_filtr', array(
        'default'     => '#d2691e',
        'sanitize_callback' => 'sanitize_hex_color',
    )
);
$wp_customize->add_control(
    new WP_Customize_Color_Control($wp_customize, 'anirohotellight_testimonials_bg_filtr', array(
            'label'      => __( 'Select the filter color for the background image', 'aniro-hotel-light' ),
            'section'    => 'front_page_testimonials_bg',
            'settings'   => 'anirohotellight_testimonials_bg_filtr'
        )
    )
);

//select the transparency for the filter
	$wp_customize->add_setting( 'anirohotellight_testimonials_bg_filtr_alpha', array(
	    'sanitize_callback' => 'anirohotellight_sanitize_float',
            'default'	        => 1,
	));

	$wp_customize->add_control ( 'anirohotellight_testimonials_bg_filtr_alpha', array( 
		'type'        => 'number',
                'label'    => __( 'Select the transparency for the filter', 'aniro-hotel-light' ),
		'section'  => 'front_page_testimonials_bg', 
		'settings' => 'anirohotellight_testimonials_bg_filtr_alpha',  
                'input_attrs' => array(
                    'min'   => 0,
                    'max'   => 1,
                    'step'  => 0.1,
                    'style' => 'margin-bottom: 15px; padding: 15px;',
        ),
	));        

//******************************************************************************  
//Add section "Show/hide section"
//******************************************************************************  

$wp_customize->add_section( 'front_page_show_hide_testimonials_section' , array(
    'title' => __( 'Show/hide section', 'aniro-hotel-light' ),
    'panel' => 'front_page_testimonials',
    'priority' => 100,
    'description' => __( 'Show/hide this section.', 'aniro-hotel-light' )
) );            
        
        
/*********************************************/        
// Show/hide panel with telephone number
            $wp_customize->add_setting('front_page_show_hide_testimonials', array(
                 'default'    =>  '',
                 'sanitize_callback'  => 'anirohotellight_sanitize_checkbox',
            ));

            $wp_customize->add_control('front_page_show_hide_testimonials', array(
                    'type' => 'checkbox',
                    'label' => __( 'Hide this section?', 'aniro-hotel-light' ),
                    'section' => 'front_page_show_hide_testimonials_section',
                )
            );                   