<?php
/**
 * Social_Charity Pages Settings panel at Theme Customizer
 *
 * @package Social_Charity
 * @since 1.0.0
 */

add_action( 'customize_register', 'social_charity_page_settings_register' );

function social_charity_page_settings_register( $wp_customize ) {
  require get_template_directory() .'/inc/repeater/class-repeater-settings.php';
  require get_template_directory() .'/inc/repeater/class-control-repeater.php';

	/**
     * Add Page Settings Panel
     *
     * @since 1.0.0
     */
    $wp_customize->add_panel(
     'social_charity_page_settings_panel',
     array(
         'priority'       => 40,
         'capability'     => 'edit_theme_options',
         'theme_supports' => '',
         'title'          => __( 'Page Template Settings', 'social-charity' ),
     )
 );

    /*----------------------------------------------------------------------------------------------------------------------------------------*/
	/**
     * Contact Page section
     *
     * @since 1.0.0
     */
    $wp_customize->add_section(
        'social_charity_contact_page_section',
        array(
        	'priority'       => 5,
        	'panel'          => 'social_charity_page_settings_panel',
        	'capability'     => 'edit_theme_options',
        	'theme_supports' => '',
            'title'          => __( 'Contact Page', 'social-charity' ),
            'description'    => __( 'Managed the content display at contact page.', 'social-charity' ),
        )
    );

   
    /**Contact Page Phone Number */
    $wp_customize->add_setting( 'social_charity_contact_phone_number', array(
        'capability'            => 'edit_theme_options',
        'default'               => '',
        'sanitize_callback'     => 'social_charitysanitize_phone_number'
    ) );

    $wp_customize->add_control( 'social_charity_contact_phone_number', array(
        'label'                 =>  __( 'Type Phone Number', 'social-charity' ),
         'description'           =>__('Eg:-  (+123) 456 7890','social-charity'),
        'section'               => 'social_charity_contact_page_section',
        'type'                  => 'text',
        'settings'              => 'social_charity_contact_phone_number',
    ) );

    /**Contact Page Email Address */
    $wp_customize->add_setting( 'social_charity_contact_email_address', array(
        'capability'            => 'edit_theme_options',
        'default'               => '',
        'sanitize_callback'     => 'sanitize_email'
    ) );

    $wp_customize->add_control( 'social_charity_contact_email_address', array(
        'label'                 =>  __( 'Type Email Address', 'social-charity' ),
        'description'           =>__('Eg:-  info.demo@email.com','social-charity'),
        'section'               => 'social_charity_contact_page_section',
        'type'                  => 'text',
        'settings'              => 'social_charity_contact_email_address',
    ) );

    /**Contact Page Main Address */
    $wp_customize->add_setting( 'social_charity_contact_main_address', array(
        'capability'            => 'edit_theme_options',
        'default'               => '',
        'sanitize_callback'     => 'sanitize_text_field'
    ) );

    $wp_customize->add_control( 'social_charity_contact_main_address', array(
        'label'                 =>  __( 'Type Main Address', 'social-charity' ),
         'description'           =>__('Eg:-  40 Barla Street 133/2 New York City, US','social-charity'),
        'section'               => 'social_charity_contact_page_section',
        'type'                  => 'text',
        'settings'              => 'social_charity_contact_main_address',
    ) );

    /**Contact Page Get In Touch Heading */
    $wp_customize->add_setting( 'social_charity_contact_gint_link_text', array(
        'capability'            => 'edit_theme_options',
        'default'               => '',
        'sanitize_callback'     => 'sanitize_text_field'
    ) );

    $wp_customize->add_control( 'social_charity_contact_gint_link_text', array(
        'label'                 =>  __( 'Type Get in touch Heading', 'social-charity' ),
        'description'           =>__('Eg:- Get in touch','social-charity'),
        'section'               => 'social_charity_contact_page_section',
        'type'                  => 'text',
        'settings'              => 'social_charity_contact_gint_link_text',
    ) );

    // Contact form
    $wp_customize->add_setting( 'social_charity_frontpage_contact_form_option', array(
        'capability'            => 'edit_theme_options',
        'default'               => '',
        'sanitize_callback'     => 'sanitize_text_field'
    ) );

    $wp_customize->add_control( 'social_charity_frontpage_contact_form_option', array(
        'label'                 =>  __( 'Contact Form Section Use Shortcode', 'social-charity' ),
        'description'           =>  __( 'eg [contact-form-7 id="108" title="Contact form 1"]', 'social-charity' ),
        'section'               => 'social_charity_contact_page_section',
        'type'                  => 'text',
        'settings' => 'social_charity_frontpage_contact_form_option',
    ) );
}