<?php
/**
 * Register Post Slider section, settings and controls for Theme Customizer
 *
 */
if ( ! defined( 'ABSPATH' ) ) {
    exit; // Exit if accessed directly.
}
// Add Theme Colors section to Customizer
add_action( 'customize_register', 'pmthemes_customize_register_slider_settings' );

function pmthemes_customize_register_slider_settings( $wp_customize ) {
    // Get Default Fonts from settings
    $theme_def = pmthemes_default_options();
	// Add Sections for Slider Settings
	$wp_customize->add_section( 'pmthemes_section_slider', array(
        'title'    => __( 'Slider Settings', 'pmthemes' ),
		'description' => __( 'The slideshow displays your featured posts, which you can configure on the "Featured Content" section above.', 'pmthemes' ),
        'priority' => 7,
		'panel' => 'pmthemes_options_panel' 
		)
	);
	// Add settings and controls for Post Slider
	$wp_customize->add_setting( 'pmthemes_theme_options[slider_activated]', array(
        'default'           => '',
		'type'           	=> 'option',
        'transport'         => 'refresh',
        'sanitize_callback' => 'esc_attr'
        )
    );
    $wp_customize->add_control( new Pmthemes_Customize_Header_Control(
        $wp_customize, 'pmthemes_control_slider_activated', array(
            'label' => __( 'Activate Featured Post Slider', 'pmthemes' ),
            'section' => 'pmthemes_section_slider',
            'settings' => 'pmthemes_theme_options[slider_activated]',
            'priority' => 1
            )
        )
    );
	$wp_customize->add_setting( 'pmthemes_theme_options[slider_activated_front_page]', array(
        'default'           => $theme_def['slider_activated_front_page'],
		'type'           	=> 'option',
        'transport'         => 'refresh',
        'sanitize_callback' => 'pmthemes_sanitize_checkbox'
		)
	);
    $wp_customize->add_control( 'pmthemes_control_slider_activated_frontpage', array(
        'label'    => __( 'Display Slider on Magazine Front Page template.', 'pmthemes' ),
        'section'  => 'pmthemes_section_slider',
        'settings' => 'pmthemes_theme_options[slider_activated_front_page]',
        'type'     => 'checkbox',
		'priority' => 2
		)
	);
	$wp_customize->add_setting( 'pmthemes_theme_options[slider_activated_blog]', array(
        'default'           => $theme_def['slider_activated_blog'],
		'type'           	=> 'option',
        'transport'         => 'refresh',
        'sanitize_callback' => 'pmthemes_sanitize_checkbox'
		)
	);
    $wp_customize->add_control( 'pmthemes_control_slider_activated_blog', array(
        'label'    => __( 'Display Slider on normal blog index.', 'pmthemes' ),
        'section'  => 'pmthemes_section_slider',
        'settings' => 'pmthemes_theme_options[slider_activated_blog]',
        'type'     => 'checkbox',
		'priority' => 3
		)
	);
	$wp_customize->add_setting( 'pmthemes_theme_options[show_slider_content]', array(
        'default'           => $theme_def['show_slider_content'],
		'type'           	=> 'option',
        'transport'         => 'refresh',
        'sanitize_callback' => 'pmthemes_sanitize_checkbox'
		)
	);
    $wp_customize->add_control( 'pmthemes_control_show_slider_content', array(
        'label'    => __( 'Display Slider Content.', 'pmthemes' ),
        'section'  => 'pmthemes_section_slider',
        'settings' => 'pmthemes_theme_options[show_slider_content]',
        'type'     => 'checkbox',
		'priority' => 4
		)
	);

	$wp_customize->add_setting( 'pmthemes_theme_options[slider_animation]', array(
        'default'           => $theme_def['slider_animation'],
		'type'           	=> 'option',
        'transport'         => 'refresh',
        'sanitize_callback' => 'pmthemes_sanitize_slider_animation'
		)
	);
    $wp_customize->add_control( 'pmthemes_control_slider_animation', array(
        'label'    => __( 'Slider Animation', 'pmthemes' ),
        'section'  => 'pmthemes_section_slider',
        'settings' => 'pmthemes_theme_options[slider_animation]',
        'type'     => 'radio',
		'priority' => 4,
        'choices'  => array(
            'horizontal' => __( 'Horizontal Slider', 'pmthemes' ),
            'fade' => __( 'Fade Slider', 'pmthemes' )
			)
		)
	);
	
}

?>