<?php

/* 
 * anirohotellight Theme Customizer - Panel "Front Page About us"
 *
 * @package anirohotellight
 */

//******************************************************************************       
// Add Panel Front Page About us
//******************************************************************************

$wp_customize->add_panel( 'front_page_about', array(
  'title' => esc_html__( 'Front page section "About us"', 'aniro-hotel-light' ),
  'description' => esc_html__( 'Front page section "About us" - options.', 'aniro-hotel-light' ),
  'priority' => 36, 
) );


//******************************************************************************  
//Add section "About Us -text"
//******************************************************************************  
$wp_customize->add_section( 'front_page_about' , array(
    'title' => esc_html__( 'About us', 'aniro-hotel-light' ),
    'panel' => 'front_page_about',
    'priority' => 1,
    'description' => esc_html__( 'Add text.', 'aniro-hotel-light' )
) );     
 
   /*******************************************************************************************/        
//About us Title
	$wp_customize->add_setting('anirohotellight_about_title', array(
			'default'            => 'More about Aniro Hotel',
			'sanitize_callback'  => 'wp_filter_nohtml_kses'
		)
	);
	$wp_customize->add_control('anirohotellight_about_title', array(
			'section'  => 'front_page_about',
			'label'    => 'Title for about us section:',
			'type'     => 'text'
		)
	);       
        
    /*******************************************************************************************/ 
//Button text
	$wp_customize->add_setting('anirohotellight_about_btn_text', array(
			'default'            => 'Read more about hotel',
			'sanitize_callback'  => 'wp_filter_nohtml_kses'
		)
	);
	$wp_customize->add_control('anirohotellight_about_btn_text', array(
			'section'  => 'front_page_about',
			'label'    => 'Text for link that will show page "About"',
			'type'     => 'text'
		)
	);
          /*******************************************************************************************/        
//Button link
	$wp_customize->add_setting('anirohotellight_about_btn_link', array(
			'default'            => '',
			'sanitize_callback'  => 'esc_url_raw'
		)
	);
	$wp_customize->add_control('anirohotellight_about_btn_link', array(
			'section'  => 'front_page_about',
			'label'    => 'Link to page "About"',
			'type'     => 'url'
		)
	);                
        
/*About us text */
		$wp_customize->add_setting( 'anirohotellight_about_text', array(
			'sanitize_callback' => 'wp_filter_nohtml_kses',
			'default' => 'Text about Aniro Hotel  ...',
		));

		$wp_customize->add_control( 'anirohotellight_about_text', array(
			'type'	=>	'textarea',
			'label'    => esc_html__( 'Text', 'aniro-hotel-light' ),
			'section'  => 'front_page_about',
		));
                
//image1    
            $wp_customize->add_setting( 'anirohotellight_about_img_1', array(
                    'default' => '',
                    'sanitize_callback' => 'esc_url_raw',
            ));

            $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'anirohotellight_about_img_1', array( 
                    'label'    => esc_html__( 'Add image 1', 'aniro-hotel-light' ),
                    'type'           => 'image',
                    'section'  => 'front_page_about', 
                    'settings' => 'anirohotellight_about_img_1',
            )));   
//image2    
            $wp_customize->add_setting( 'anirohotellight_about_img_2', array(
                    'default' => '',
                    'sanitize_callback' => 'esc_url_raw',
            ));

            $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'anirohotellight_about_img_2', array( 
                    'label'    => esc_html__( 'Add image 2', 'aniro-hotel-light' ),
                    'type'           => 'image',
                    'section'  => 'front_page_about', 
                    'settings' => 'anirohotellight_about_img_2',
            )));  
//image3    
            $wp_customize->add_setting( 'anirohotellight_about_img_3', array(
                    'default' => '',
                    'sanitize_callback' => 'esc_url_raw',
            ));

            $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'anirohotellight_about_img_3', array( 
                    'label'    => esc_html__( 'Add image 3', 'aniro-hotel-light' ),
                    'type'           => 'image',
                    'section'  => 'front_page_about', 
                    'settings' => 'anirohotellight_about_img_3',
            ))); 
                                      
//******************************************************************************  
//Add section "Show/hide section"
//******************************************************************************  

$wp_customize->add_section( 'front_page_show_hide_about_section' , array(
    'title' => esc_html__( 'Show/hide section', 'aniro-hotel-light' ),
    'panel' => 'front_page_about',
    'priority' => 100,
    'description' => esc_html__( 'Show/hide this section.', 'aniro-hotel-light' )
) );            
        
        
/*********************************************/        
// Show/hide this section
            $wp_customize->add_setting('front_page_show_hide_about', array(
                 'default'    =>  '',
                 'sanitize_callback'  => 'anirohotellight_sanitize_checkbox',
            ));

            $wp_customize->add_control('front_page_show_hide_about', array(
                    'type' => 'checkbox',
                    'label' => esc_html__( 'Hide this section?', 'aniro-hotel-light' ),
                    'section' => 'front_page_show_hide_about_section',
                )
            );    
            
// Show/hide 3 images
            $wp_customize->add_setting('front_page_show_hide_about_images', array(
                 'default'    =>  '',
                 'sanitize_callback'  => 'anirohotellight_sanitize_checkbox',
            ));

            $wp_customize->add_control('front_page_show_hide_about_images', array(
                    'type' => 'checkbox',
                    'label' => esc_html__( 'Hide image section?', 'aniro-hotel-light' ),
                    'section' => 'front_page_show_hide_about_section',
                )
            );                