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

function mediapulse_theme_footer_panel_customizer ( $wp_customize ) {

    $wp_customize->add_section('news_theme_footer',
        array(
            'title'         => esc_html__('Theme Footer', 'mediapulse' ),
            'priority'      => 4
        )
    );

    /* Theme Footer General Tab */
    // enable/disable footer widgets
    $wp_customize->add_setting('footer_widgets_show',
        array(
			'type'				=> 'theme_mod',
            'default'           => true,
            'sanitize_callback' => 'mediapulse_sanitize_checkbox'
        )
    );
    $wp_customize->add_control(new mediapulse_Toggle_Control( $wp_customize, 'footer_widgets_show',
        array(
            'label'     =>  esc_html__( 'Enable/Disable Footer Widgets', 'mediapulse'),
            'section'   =>  'news_theme_footer',
            'settings'   =>  'footer_widgets_show',
            'type'      =>  'toggle',
            'priority'  =>  1
        )
    ));

    // footer widgets layout
    $wp_customize->add_setting( 'footer_widget_layout',
        array(
			'type'				=> 'theme_mod',
            'default'           =>  3,
            'capability'        =>  'edit_theme_options',
            'sanitize_callback' =>  'mediapulse_sanitize_select'
        )
    );
    $wp_customize->add_control( new mediapulse_Image_Radio_Button_Custom_Control( $wp_customize, 'footer_widget_layout',
        array(
            'label'             =>  esc_html__( 'Widgets Layout', 'mediapulse'  ),
            'section'           =>  'news_theme_footer',
            'settings'           =>  'footer_widget_layout',
            'priority'          =>  2,
            'choices'           => array(
                                    6 => array('image' => trailingslashit( get_template_directory_uri() ) . '/lib/customizer/assets/img/2-col.png'),
                                    4 => array('image' => trailingslashit( get_template_directory_uri() ) . '/lib/customizer/assets/img/3-col.png'),
                                    3 => array('image' => trailingslashit( get_template_directory_uri() ) . '/lib/customizer/assets/img/4-col.png')   
                                )
        )
    ));
		
		$wp_customize->add_setting( 'footer_text', array(
			'type'              => 'theme_mod',
			'default'           => '',
			'sanitize_callback' => 'wp_filter_nohtml_kses',
			'capability'        => 'edit_theme_options',
		) );

		$wp_customize->add_control( 'footer_text', array(
			'label'    => __( 'Footer Text', 'mediapulse' ),
			'type'     => 'text',
			'section'  => 'news_theme_footer',
			'settings' => 'footer_text',
		) );
		
		$wp_customize->add_setting( 'footer_url', array(
			'type'              => 'theme_mod',
			'default'           => '',
			'sanitize_callback' => 'wp_filter_nohtml_kses',
			'capability'        => 'edit_theme_options',
		) );

		$wp_customize->add_control( 'footer_url', array(
			'label'    => __( 'Footer URL', 'mediapulse' ),
			'type'     => 'text',
			'section'  => 'news_theme_footer',
			'settings' => 'footer_url',
		) );



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