<?php

/* 
 * anirohotellight Theme Customizer - Panel "Theme Options"
 *
 * @package anirohotellight
 */

//***************************************************************************** 
//Add panel 'Theme Options'
//*****************************************************************************
        $wp_customize->add_panel( 'anirohotellight_theme_options_panel', array(
          'title' => __( 'Theme options', 'aniro-hotel-light' ),
          'description' => __( 'Theme options.', 'aniro-hotel-light' ),
          'priority' => 52, 
        ) ); 

//*****************************************************************************
// Add section 'Layouts options'
//*****************************************************************************
	$wp_customize->add_section( 'anirohotellight-theme-options-section', array(
		'title' => __( 'Layouts options', 'aniro-hotel-light' ),
		'panel' => 'anirohotellight_theme_options_panel',
		'description' => __( 'Change layout options.', 'aniro-hotel-light' ),
	));        
	// Create sidebar layout setting
	$wp_customize->add_setting('anirohotellight_layout', array(
			'default' => 'sidebar-right',
			'type' => 'theme_mod',
			'sanitize_callback' => 'anirohotellight_sanitize_layout', 
			'transport' => 'postMessage'
		)
	);

	// Add sidebar layout controls
	$wp_customize->add_control('anirohotellight_layout',
		array(
                        'section' => 'anirohotellight-theme-options-section',
			'type' => 'radio',
			'label' => __( 'Sidebar position', 'aniro-hotel-light' ),
			'choices' => array(
				'no-sidebar' => __( 'No sidebar', 'aniro-hotel-light' ),
				'sidebar-left' => __( 'Left sidebar', 'aniro-hotel-light' ),
				'sidebar-right' => __( 'Right sidebar (default)', 'aniro-hotel-light' )
			),	
		)
	);        
                  
//*****************************************************************************
// Add section 'Sticky post options'
//*****************************************************************************/
	$wp_customize->add_section( 'anirohotellight-sticky-post-section', array(
		'title' => __( 'Sticky posts options', 'aniro-hotel-light' ),
		'panel' => 'anirohotellight_theme_options_panel',
		'description' => __( 'Change sticky posts options.', 'aniro-hotel-light' ),
	));        
	// Create sticky post setting
	$wp_customize->add_setting('anirohotellight-sticky-post', array(
			'default' => 'square-check',
			'type' => 'theme_mod',
			'sanitize_callback' => 'anirohotellight_sanitize_sticky_post', 
		)
	);

	// Add sticky post controls
	$wp_customize->add_control('anirohotellight-sticky-post',
		array(
                        'section' => 'anirohotellight-sticky-post-section',
			'type' => 'radio',
			'label' => __( 'Mark sticky posts', 'aniro-hotel-light' ),
			'choices' => array(
				'square-check' => __( 'Show square (check)', 'aniro-hotel-light' ),
                                'square-pin' => __( 'Show square (pin)', 'aniro-hotel-light' ),
                                'none' => __( 'Do not mark sticky posts', 'aniro-hotel-light' )
                            
			),	
		)
	);               
            
//*****************************************************************************
// Add section 'Blog type'
//*****************************************************************************
	$wp_customize->add_section( 'anirohotellight-front-page-type-section', array(
		'title' => __( 'Blog type', 'aniro-hotel-light' ),
		'panel' => 'anirohotellight_theme_options_panel',
		'description' => __( 'Change blog type.', 'aniro-hotel-light' ),
	));        
	// Create blog type setting
	$wp_customize->add_setting('anirohotellight_front_page_type',
		array(
			'default' => 'front-page-type3',
			'type' => 'theme_mod',
			'sanitize_callback' => 'anirohotellight_sanitize_front_page_type'
		)
	);
	// Add blog type controls
	$wp_customize->add_control('anirohotellight_front_page_type',
		array(
                        'section' => 'anirohotellight-front-page-type-section',
			'type' => 'radio',
			'label' => __( 'Blog type', 'aniro-hotel-light' ),
			'choices' => array(
				'front-page-type1' => __( 'Articles are large', 'aniro-hotel-light' ),
				'front-page-type2' => __( 'Articles have an average size (Pictures are on the left)', 'aniro-hotel-light' ),
                                'front-page-type3' => __( 'Articles have an average size (The position of the pictures alternates)', 'aniro-hotel-light' )
			),	
		)
	);        
        
    // How many words show in articles on front page
	$wp_customize->add_setting('anirohotellight_number_of_words_frontpage', array(
            'default'	        => 35,
            'sanitize_callback' => 'anirohotellight_sanitize_number'
            ));
	$wp_customize->add_control('anirohotellight_number_of_words_frontpage', array(
            'section' => 'anirohotellight-front-page-type-section', 
            'label' => __('How many words show in articles','aniro-hotel-light'), 
            'type'        => 'number',
            'settings' => 'anirohotellight_number_of_words_frontpage', 
            'input_attrs' => array(
                    'min'   => 5,
                    'max'   => 80,
                    'step'  => 1,
                    'style' => 'margin-bottom: 15px; padding: 15px;',)
            ));
  
//******************************************************************************       
// Add copyright text in footer
//******************************************************************************

	$wp_customize->add_section('anirohotellight_copyright_text_section', array(
			'title'     => __( 'Copyright text', 'aniro-hotel-light' ),
			'priority'  => 200,
                        'panel' => 'anirohotellight_theme_options_panel',
			'description' => __( 'Add Copyright text to footer.', 'aniro-hotel-light'),
		)
	);
        //Copyright
	$wp_customize->add_setting('anirohotellight_years', array(
			'default'            => '',
			'sanitize_callback'  => 'anirohotellight_sanitize_text'
		)
	);
	$wp_customize->add_control('anirohotellight_years', array(
			'section'  => 'anirohotellight_copyright_text_section',
			'label'    => 'Years:',
			'type'     => 'text'
		)
	);
        //All Rights Reserved
	$wp_customize->add_setting('anirohotellight_all_rights_text', array(
			'default'            => 'All Rights Reserved.',
			'sanitize_callback'  => 'anirohotellight_sanitize_text'
		)
	);
	$wp_customize->add_control('anirohotellight_all_rights_text', array(
			'section'  => 'anirohotellight_copyright_text_section',
			'label'    => 'Copyright:',
			'type'     => 'text'
		)
	);
        //Hide copyright
        $wp_customize->add_setting('anirohotellight_hide_copyright', array(
                        'default'    =>  '',
			'sanitize_callback'  => 'anirohotellight_sanitize_checkbox'
		));
        $wp_customize->add_control('anirohotellight_hide_copyright', array(
                'type' => 'checkbox',
                'label' =>  __( 'Hide copyright.', 'aniro-hotel-light' ),
                'section' => 'anirohotellight_copyright_text_section',
            )
        );    