<?php
/***********************THEME SERVICE SECTION ********************/
/******************************************************/

$wp_customize->add_section('swiftpress_service_section', array(
    'priority'      => 6,
    'title'         =>__('Service Section', 'swiftpress'),
    'panel'         => 'swiftpress_home_options'
    ));

$wp_customize->add_setting( 'service_enable', array(
			    'capability'        => 'edit_theme_options',
			    'default'           => '1',
			    'sanitize_callback' => 'swiftpress_theme_sanitize_text'
	) );

	$wp_customize->add_control( 'service_enable', array(
			    'settings' => 'service_enable',
			    'label'    =>  __( 'Enable/Disable Service Section', 'swiftpress' ),
			    'section'  => 'swiftpress_service_section',
			    'type'     => 'radio',
			    'choices'  => array(
			        '1' => __( 'Enable', 'swiftpress' ),
			        '2' => __( 'Disable', 'swiftpress' ),
			       
			        ),
			    'priority'              => 20
	) );

$wp_customize->add_setting('service_title',array(
    'sanitize_callback' => 'swiftpress_theme_sanitize_text',
    'capability' => 'edit_theme_options',
    'default' => __('Our Services','swiftpress'),
    'transport'=>'postMessage'
    ));

$wp_customize->add_control('service_title',array(
    'label'     =>__('Service Title', 'swiftpress'),
    'section'   => 'swiftpress_service_section',
    'type'      => 'text',
    'capability' => 'edit_theme_options',
    'priority'              => 20
    ));

$wp_customize->add_setting('service_content',array(
    'sanitize_callback' => 'swiftpress_theme_sanitize_text',
    'capability' => 'edit_theme_options',
    'transport'=>'postMessage',
    'default' => __('Service to Swift Plus , Simple yet complete theme for business','swiftpress')
    ));

$wp_customize->add_control('service_content',array(
    'label'     =>__('Service Description', 'swiftpress'),
    'section'   => 'swiftpress_service_section',
    'type'      => 'textarea',
    'capability' => 'edit_theme_options',
    'priority'              => 20
    ));

$wp_customize->add_setting( 'swiftpress_service_section_icon1', array(
    'capability'        => 'edit_theme_options',
    'default'           => 'fa fa-magic',
    'sanitize_callback' => 'swiftpress_theme_sanitize_text'
) );

$wp_customize->add_control( 'swiftpress_service_section_icon1', array(
    'label'                 =>  __( 'Icon For services 1', 'swiftpress' ),
    'description'           => sprintf( __( 'Use font awesome icon: Eg: %s. %sSee more here%s', 'swiftpress' ), 'fa fa-magic','<a href="'.esc_url('http://fontawesome.io/icons/').'" target="_blank">','</a>' ),
    'section'               => 'swiftpress_service_section',
    'type'                  => 'text',
    'priority'              => 20,
    'settings' => 'swiftpress_service_section_icon1',
) );

$wp_customize->add_setting( 'swiftpress_service_section_icon2', array(
    'capability'        => 'edit_theme_options',
    'default'           => 'fa fa-magic',
    'sanitize_callback' => 'swiftpress_theme_sanitize_text'
) );

$wp_customize->add_control( 'swiftpress_service_section_icon2', array(
    'label'                 =>  __( 'Icon For services 2', 'swiftpress' ),
    'section'               => 'swiftpress_service_section',
    'type'                  => 'text',
    'priority'              => 20,
    'settings' => 'swiftpress_service_section_icon2',
) );
$wp_customize->add_setting( 'swiftpress_service_section_icon3', array(
    'capability'        => 'edit_theme_options',
    'default'           => 'fa fa-magic',
    'sanitize_callback' => 'swiftpress_theme_sanitize_text'
) );

$wp_customize->add_control( 'swiftpress_service_section_icon3', array(
    'label'                 =>  __( 'Icon For services 3', 'swiftpress' ),
    'section'               => 'swiftpress_service_section',
    'type'                  => 'text',
    'priority'              => 20,
    'settings' => 'swiftpress_service_section_icon3',
) );


$wp_customize->add_setting( 'swiftpress_service_section_page1', array(
    'capability'        => 'edit_theme_options',
    'default'           => 0,
    'sanitize_callback' => 'swiftpress_sanitize_post'
) );
$wp_customize->add_control( 'swiftpress_service_section_page1', array(
    'label'                 =>  __( 'Select Page For services 1', 'swiftpress' ),
    'section'               => 'swiftpress_service_section',
    'type'                  => 'dropdown-pages',
    'priority'              => 20,
    'settings' => 'swiftpress_service_section_page1',
) );


$wp_customize->add_setting( 'swiftpress_service_section_page2', array(
    'capability'        => 'edit_theme_options',
    'default'           => 0,
    'sanitize_callback' => 'swiftpress_sanitize_post'
) );

$wp_customize->add_control( 'swiftpress_service_section_page2', array(
    'label'                 =>  __( 'Select Page For services 2', 'swiftpress' ),
    'section'               => 'swiftpress_service_section',
    'type'                  => 'dropdown-pages',
    'priority'              => 20,
    'settings' => 'swiftpress_service_section_page2',
) );


$wp_customize->add_setting( 'swiftpress_service_section_page3', array(
    'capability'        => 'edit_theme_options',
    'default'           => 0,
    'sanitize_callback' => 'swiftpress_sanitize_post'
) );

$wp_customize->add_control( 'swiftpress_service_section_page3', array(
    'label'                 =>  __( 'Select Page For services 3', 'swiftpress' ),
    'section'               => 'swiftpress_service_section',
    'type'                  => 'dropdown-pages',
    'priority'              => 20,
    'settings' => 'swiftpress_service_section_page3',
) );


$wp_customize->add_setting('service_background', array(
    'default' => '',
    'capability' => 'edit_theme_options',
    'sanitize_callback' => 'swiftpress_theme_sanitize_text'
    ));

 $wp_customize->add_control(new WP_Customize_Image_Control($wp_customize, 'service_background', array(
    'label' => __('Upload Background Image For Service Section', 'swiftpress'),
    'section' => 'swiftpress_service_section',
    'setting' => 'service_background',
    'priority'              => 20
    )));