<?php
/**
 * Theme Header Panel Customizer
 *
 * @package mediapulse
*/

function mediapulse_theme_setting_panel_customizer ( $wp_customize ) {

    $wp_customize->add_section('news_theme_layout',
        array(
            'title'         => esc_html__('Theme Layout', 'mediapulse' ),
            'priority'      => 3
        )
    );

    // enable/disable site title
        $wp_customize->add_setting( 'theme_layout',
            array(
                'default'           => 'wide',
                'capability'        => 'edit_theme_options',
                'sanitize_callback' => 'mediapulse_sanitize_select'
            )
        );
        $wp_customize->add_control( new mediapulse_Image_Radio_Button_Custom_Control( $wp_customize, 'theme_layout',
            array(
                'label'     => esc_html__( 'Theme Layout', 'mediapulse' ),
                'section'   => 'news_theme_layout',
                'priority'  => 1,
                'choices'   => 
                array(
                    'boxed' => array('image' => trailingslashit( get_template_directory_uri() ) . '/lib/customizer/assets/img/boxed.png'),
                    'wide' => array('image' => trailingslashit( get_template_directory_uri() ) . '/lib/customizer/assets/img/wide.png')
                    
                )
            )
        ));
		
		/* sidebar layout */
		$wp_customize->add_section('news_sidebar_layout',
        array(
            'title'         => esc_html__('Sidebar Layout', 'mediapulse' ),
            'priority'      => 3
        )
		);

		$wp_customize->add_setting( 'blog_layout',
            array(
				'type'				=> 'theme_mod',
                'default'           => 'right',
                'capability'        => 'edit_theme_options',
                'sanitize_callback' => 'mediapulse_sanitize_select'
            )
        );
        $wp_customize->add_control( new mediapulse_Image_Radio_Button_Custom_Control( $wp_customize, 'blog_layout',
            array(
                'label'     => esc_html__( 'Blog/Archive/Category Layout', 'mediapulse' ),
                'section'   => 'news_theme_layout',
                'priority'  => 1,
                'choices'   => 
                array(
                    'left' => array('image' => trailingslashit( get_template_directory_uri() ) . '/lib/customizer/assets/img/left.jpg'),
                    'right' => array('image' => trailingslashit( get_template_directory_uri() ) . '/lib/customizer/assets/img/right.jpg'),
                    'full' => array('image' => trailingslashit( get_template_directory_uri() ) . '/lib/customizer/assets/img/full.jpg'),
                    
                )
            )
        ));

		$wp_customize->add_setting( 'single_layout',
            array(
				'type'				=> 'theme_mod',
                'default'           => 'right',
                'capability'        => 'edit_theme_options',
                'sanitize_callback' => 'mediapulse_sanitize_select'
            )
        );
        $wp_customize->add_control( new mediapulse_Image_Radio_Button_Custom_Control( $wp_customize, 'single_layout',
            array(
                'label'     => esc_html__( 'Single Layout', 'mediapulse' ),
                'section'   => 'news_theme_layout',
                'priority'  => 1,
                'choices'   => 
                array(
                    'left' => array('image' => trailingslashit( get_template_directory_uri() ) . '/lib/customizer/assets/img/left.jpg'),
                    'right' => array('image' => trailingslashit( get_template_directory_uri() ) . '/lib/customizer/assets/img/right.jpg'),
                    'full' => array('image' => trailingslashit( get_template_directory_uri() ) . '/lib/customizer/assets/img/full.jpg'),
                    
                )
            )
        ));
		
		$wp_customize->add_setting( 'page_layout',
            array(
				'type'				=> 'theme_mod',
                'default'           => 'right',
                'capability'        => 'edit_theme_options',
                'sanitize_callback' => 'mediapulse_sanitize_select'
            )
        );
        $wp_customize->add_control( new mediapulse_Image_Radio_Button_Custom_Control( $wp_customize, 'page_layout',
            array(
                'label'     => esc_html__( 'Page Layout', 'mediapulse' ),
                'section'   => 'news_theme_layout',
                'priority'  => 1,
                'choices'   => 
                array(
                    'left' => array('image' => trailingslashit( get_template_directory_uri() ) . '/lib/customizer/assets/img/left.jpg'),
                    'right' => array('image' => trailingslashit( get_template_directory_uri() ) . '/lib/customizer/assets/img/right.jpg'),
                    'full' => array('image' => trailingslashit( get_template_directory_uri() ) . '/lib/customizer/assets/img/full.jpg'),
                    
                )
            )
        ));
    

}
add_action( 'customize_register', 'mediapulse_theme_setting_panel_customizer' );