<?php
	$wp_customize->add_section('advance_education_pro_slider_section',array(
		'title'	=> __('Slider Settings','advance-education-pro'),
		'description'	=> __('Add slider images here.','advance-education-pro'),
		'priority'	=> null,
		'panel' => 'advance_education_pro_panel_id',
	));
	$wp_customize->add_setting('advance_education_pro_slider_enabledisable',array(
        'default'=> 'Enable',
        'sanitize_callback' => 'advance_education_pro_sanitize_choices'
    ));
	$wp_customize->add_control('advance_education_pro_slider_enabledisable', array(
        'type' => 'radio',
        'label' => 'Do you want this section',
        'section' => 'advance_education_pro_slider_section',
        'choices' => array(
            'Enable' => 'Enable',
            'Disable' => 'Disable'
        ),
    ));
	$wp_customize->add_setting('advance_education_pro_slide_number',array(
		'default'	=> '',
		'sanitize_callback'	=> 'sanitize_text_field',
	));
	$wp_customize->add_control('advance_education_pro_slide_number',array(
		'label'	=> __('Number of slides to show','advance-education-pro'),
		'section'	=> 'advance_education_pro_slider_section',
		'type'		=> 'number'
	));
	$count =  get_theme_mod('advance_education_pro_slide_number');
		
	for($i=1, $j=1; $i<=$count; $i++, $j++) {
		if($j>=5){ $j=1; }
		$wp_customize->add_setting( 'advance_education_pro_slider_section_settings'.$i,
		    array(
		    'default' => '',
		    'transport' => 'postMessage',
		    'sanitize_callback' => 'advance_education_pro_text_sanitization'
		 ));
		 $wp_customize->add_control( new Themeshopy_Seperator_custom_Control( $wp_customize, 'advance_education_pro_slider_section_settings'.$i,
		    array(
		    'label' => __('Slider Settings ','advance-education-pro').$i,
		    'section' => 'advance_education_pro_slider_section'
		)));

		$wp_customize->add_setting('advance_education_pro_slide_image'.$i,array(
			'default'	=> '',
			'sanitize_callback'	=> 'esc_url_raw',
		));
		$wp_customize->add_control(new WP_Customize_Image_Control($wp_customize,'advance_education_pro_slide_image'.$i,
	        array(
	            'label' => __('Slider Image ','advance-education-pro').$i.__(' (1600x562)','advance-education-pro'),
	            'section' => 'advance_education_pro_slider_section',
	            'settings' => 'advance_education_pro_slide_image'.$i
		)));
		$wp_customize->add_setting('advance_education_pro_slide_heading'.$i,array(
			'default'	=> '',
			'sanitize_callback'	=> 'sanitize_text_field',
		));
		$wp_customize->add_control('advance_education_pro_slide_heading'.$i,array(
			'label' => __('Slide Title','advance-education-pro').$i,
			'section' => 'advance_education_pro_slider_section',
			'setting'	=> 'advance_education_pro_slide_heading'.$i,
			'type'	=> 'text'
		));
		$wp_customize->add_setting('advance_education_pro_slide_heading_first'.$i,array(
			'default'	=> '',
			'sanitize_callback'	=> 'sanitize_text_field',
		));
		$wp_customize->add_control('advance_education_pro_slide_heading_first'.$i,array(
			'label' => __('Slide Sub Title','advance-education-pro').$i,
			'section' => 'advance_education_pro_slider_section',
			'setting'	=> 'advance_education_pro_slide_heading_first'.$i,
			'type'	=> 'text'
		));
		$wp_customize->add_setting('advance_education_pro_slide_text'.$i,array(
			'default'	=> '',
			'sanitize_callback'	=> 'sanitize_textarea_field',
		));
		$wp_customize->add_control('advance_education_pro_slide_text'.$i,array(
			'label' => __('Slide Text','advance-education-pro').$i,
			'section' => 'advance_education_pro_slider_section',
			'setting'	=> 'advance_education_pro_slide_text'.$i,
			'type'	=> 'textarea'
		));
		$wp_customize->add_setting('advance_education_pro_slider_read_more_button_text'.$i,array(
			'default'	=> '',
			'sanitize_callback'	=> 'sanitize_textarea_field',
		));
		$wp_customize->add_control('advance_education_pro_slider_read_more_button_text'.$i,array(
			'label' => __('Slide Button Text','advance-education-pro').$i,
			'section' => 'advance_education_pro_slider_section',
			'setting'	=> 'advance_education_pro_slider_read_more_button_text'.$i,
			'type'	=> 'text'
		));
		$wp_customize->add_setting('advance_education_pro_slider_read_more_button_link'.$i,array(
			'default'	=> '',
			'sanitize_callback'	=> 'sanitize_textarea_field',
		));
		$wp_customize->add_control('advance_education_pro_slider_read_more_button_link'.$i,array(
			'label' => __('Slide Button Link','advance-education-pro').$i,
			'section' => 'advance_education_pro_slider_section',
			'setting'	=> 'advance_education_pro_slider_read_more_button_link'.$i,
			'type'	=> 'text'
		));
	}

	// Other Settings
	$wp_customize->add_setting('advance_education_pro_slide_delay',array(
		'default'	=> '1000',
		'sanitize_callback'	=> 'sanitize_text_field',
	));
	$wp_customize->add_control('advance_education_pro_slide_delay',array(
		'label'	=> __('Slide Delay','advance-education-pro'),
		'section'	=> 'advance_education_pro_slider_section',
		'description' => __('interval is in milliseconds. 1000 = 1 second -> so 1000 * 10 = 10 seconds', 'advance-education-pro'),
		'type'		=> 'number'
	));

	$wp_customize->add_setting( 'advance_education_pro_slide_remove_fade',
	   array(
	      'default' => 0,
	      'transport' => 'refresh',
	      'sanitize_callback' => 'advance_education_pro_switch_sanitization'
	));	 
	$wp_customize->add_control( new advance_education_pro_Toggle_Switch_Custom_control( $wp_customize, 'advance_education_pro_slide_remove_fade',
	   array(
	      'label' => esc_html__( 'Remove Fade Slider','advance-education-pro' ),
	      'section' => 'advance_education_pro_slider_section'
	)));
	 //content layout
	$wp_customize->add_setting('advance_education_pro_slider_content_option',array(
        'default' => __('center','advance-education-pro'),
        'sanitize_callback' => 'sanitize_text_field'
	));
	$wp_customize->add_control(new advance_education_pro_Image_Radio_Control($wp_customize, 'advance_education_pro_slider_content_option', array(
        'type' => 'select',
        'label' => __('Slider Content Layouts','advance-education-pro'),
        'section' => 'advance_education_pro_slider_section',
        'choices' => array(
            'Left' => get_template_directory_uri().'/assets/images/slider-content1.png',
            'Center' => get_template_directory_uri().'/assets/images/slider-content2.png',
            'Right' => get_template_directory_uri().'/assets/images/slider-content3.png',
    ))));
    //Opacity
	$wp_customize->add_setting('advance_education_pro_slide_opacity_color',array(
      'default'              => 1,
      'sanitize_callback' => 'advance_education_pro_sanitize_choices'
	));

	$wp_customize->add_control( 'advance_education_pro_slide_opacity_color', array(
	'label'       => esc_html__( 'Slider Image Opacity','advance-education-pro' ),
	'section'     => 'advance_education_pro_slider_section',
	'type'        => 'select',
	'settings'    => 'advance_education_pro_slide_opacity_color',
	'choices' => array(
      '0' =>  esc_attr('0','advance-education-pro'),
      '0.1' =>  esc_attr('0.1','advance-education-pro'),
      '0.2' =>  esc_attr('0.2','advance-education-pro'),
      '0.3' =>  esc_attr('0.3','advance-education-pro'),
      '0.4' =>  esc_attr('0.4','advance-education-pro'),
      '0.5' =>  esc_attr('0.5','advance-education-pro'),
      '0.6' =>  esc_attr('0.6','advance-education-pro'),
      '0.7' =>  esc_attr('0.7','advance-education-pro'),
      '0.8' =>  esc_attr('0.8','advance-education-pro'),
      '0.9' =>  esc_attr('0.9','advance-education-pro'),
      '1' =>  esc_attr('1','advance-education-pro')
	),
	));

	$wp_customize->add_setting( 'advance_education_pro_slider_color_settings',
	    array(
	    'default' => '',
	    'transport' => 'postMessage',
	    'sanitize_callback' => 'advance_education_pro_text_sanitization'
	));
	$wp_customize->add_control( new Themeshopy_Seperator_custom_Control( $wp_customize, 'advance_education_pro_slider_color_settings',
	    array(
	    'label' => __('Section Content Color and Font Settings','advance-education-pro'),
	    'section' => 'advance_education_pro_slider_section'
	)));

	$wp_customize->add_setting( 'advance_education_pro_slidermainHeading_color', array(
		'default' => '',
		'sanitize_callback'	=> 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'advance_education_pro_slidermainHeading_color', array(
		'label' => __('Slider Top Heading Color', 'advance-education-pro'),
		'section' => 'advance_education_pro_slider_section',
		'settings' => 'advance_education_pro_slidermainHeading_color',
	)));
	//This is Slider Heading FontFamily picker setting
	$wp_customize->add_setting('advance_education_pro_slidermainHeading_font_family',array(
	  'default' => '',
	  'capability' => 'edit_theme_options',
	  'sanitize_callback' => 'advance_education_pro_sanitize_choices'
	));
	$wp_customize->add_control(
	    'advance_education_pro_slidermainHeading_font_family', array(
	    'section'  => 'advance_education_pro_slider_section',
	    'label'    => __( 'Slider Top Heading Fonts','advance-education-pro'),
	    'type'     => 'select',
	    'choices'  => $font_array,
	));

	// This is Slider Heading Color picker setting
	$wp_customize->add_setting( 'advance_education_pro_sliderHeading_color', array(
		'default' => '',
		'sanitize_callback'	=> 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'advance_education_pro_sliderHeading_color', array(
		'label' => __('Slider Heading Color', 'advance-education-pro'),
		'section' => 'advance_education_pro_slider_section',
		'settings' => 'advance_education_pro_sliderHeading_color',
	)));
	//This is Slider Heading FontFamily picker setting
	$wp_customize->add_setting('advance_education_pro_sliderHeading_font_family',array(
	  'default' => '',
	  'capability' => 'edit_theme_options',
	  'sanitize_callback' => 'advance_education_pro_sanitize_choices'
	));
	$wp_customize->add_control(
	    'advance_education_pro_sliderHeading_font_family', array(
	    'section'  => 'advance_education_pro_slider_section',
	    'label'    => __( 'Slider Heading Fonts','advance-education-pro'),
	    'type'     => 'select',
	    'choices'  => $font_array,
	));
	// This is Slider Text Color picker setting
	$wp_customize->add_setting( 'advance_education_pro_slidertext_color', array(
		'default' => '',
		'sanitize_callback'	=> 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'advance_education_pro_slidertext_color', array(
		'label' => __('Slider Text Color', 'advance-education-pro'),
		'section' => 'advance_education_pro_slider_section',
		'settings' => 'advance_education_pro_slidertext_color',
	)));
	//This is Slider Text FontFamily picker setting
	$wp_customize->add_setting('advance_education_pro_slidertext_font_family',array(
	  'default' => '',
	  'capability' => 'edit_theme_options',
	  'sanitize_callback' => 'advance_education_pro_sanitize_choices'
	));
	$wp_customize->add_control(
	    'advance_education_pro_slidertext_font_family', array(
	    'section'  => 'advance_education_pro_slider_section',
	    'label'    => __( 'Slider Text Fonts','advance-education-pro'),
	    'type'     => 'select',
	    'choices'  => $font_array,
	));

 	$wp_customize->add_setting('advance_education_pro_slider_arrows',array(
        'default' => 'true',
        'sanitize_callback'	=> 'sanitize_text_field'
    ));
    $wp_customize->add_control('advance_education_pro_slider_arrows',array(
        'type' => 'checkbox',
        'label' => __('Show / Hide Next & Previous Arrows','advance-education-pro'),
        'section' => 'advance_education_pro_slider_section',
    ));
?>