<?php
/**
 * Slider Section Settings
 *
 * @package interior_services
 */

// Add Slider Section
$wp_customize->add_section(
	'interior_services_slider_section',
	array(
		'panel'    => 'interior_services_front_page_options',
		'title'    => esc_html__( 'Slider Section', 'interior-services' ),
		'priority' => 10,
	)
);

// Enable Slider Section
$wp_customize->add_setting(
	'interior_services_enable_slider_section',
	array(
		'default'           => false,
		'sanitize_callback' => 'interior_services_sanitize_switch',
	)
);

$wp_customize->add_control(
	new Interior_Services_Toggle_Switch_Custom_Control(
		$wp_customize,
		'interior_services_enable_slider_section',
		array(
			'label'    => esc_html__( 'Enable Slider Section', 'interior-services' ),
			'section'  => 'interior_services_slider_section',
			'settings' => 'interior_services_enable_slider_section',
		)
	)
);

// Add Separator Custom Control
$wp_customize->add_setting( 'interior_services_slider_separators', array(
	'sanitize_callback' => 'sanitize_text_field',
) );

$wp_customize->add_control( new Interior_Services_Separator_Custom_Control( $wp_customize, 'interior_services_slider_separators', array(
	'label' => __( 'Select Slider Category', 'interior-services' ),
	'section' => 'interior_services_slider_section',
	'settings' => 'interior_services_slider_separators',
	'active_callback' => 'interior_services_is_slider_section_enabled',
)));

// Slider Category Setting
$wp_customize->add_setting(
	'interior_services_slider_slider_category',
	array(
		'default'           => 'slider',
		'sanitize_callback' => 'sanitize_text_field',
	)
);

$wp_customize->add_control(
	new Interior_Services_Customize_Category_Dropdown_Control(
		$wp_customize,
		'interior_services_slider_slider_category',
		array(
			'label'    => __( 'Select Slider Category', 'interior-services' ),
			'section'  => 'interior_services_slider_section',
			'settings' => 'interior_services_slider_slider_category',
			'active_callback' => 'interior_services_is_slider_section_enabled',
		)
	)
);

//  Heading Label.
$wp_customize->add_setting(
	'interior_services_slider_heading',
	array(
		'default'           => '',
		'sanitize_callback' => 'sanitize_text_field',
	)
);

$wp_customize->add_control(
	'interior_services_slider_heading',
	array(
		'label'           => esc_html__( 'Slider Sub Heading', 'interior-services' ),
		'section'         => 'interior_services_slider_section',
		'settings'        => 'interior_services_slider_heading',
		'type'            => 'text',
		'active_callback' => 'interior_services_is_slider_section_enabled',
	)
);

// Button Label
$wp_customize->add_setting(
	'interior_services_slider_button_label',
	array(
		'default'           => '',
		'sanitize_callback' => 'sanitize_text_field',
	)
);

$wp_customize->add_control(
	'interior_services_slider_button_label',
	array(
		'label'           => esc_html__( 'Button Label', 'interior-services'  ),
		'section'         => 'interior_services_slider_section',
		'settings'        => 'interior_services_slider_button_label',
		'type'            => 'text',
		'active_callback' => 'interior_services_is_slider_section_enabled',
	)
);

// Button Link
$wp_customize->add_setting(
	'interior_services_slider_button_link',
	array(
		'default'           => '',
		'sanitize_callback' => 'esc_url_raw',
	)
);

$wp_customize->add_control(
	'interior_services_slider_button_link',
	array(
		'label'           => esc_html__( 'Button Link', 'interior-services' ),
		'section'         => 'interior_services_slider_section',
		'settings'        => 'interior_services_slider_button_link',
		'type'            => 'url',
		'active_callback' => 'interior_services_is_slider_section_enabled',
	)
);

// Slider Button Label Color
$wp_customize->add_setting(
	'interior_services_slider_btn_color',array(
		'default'           => '',
		'sanitize_callback' => 'sanitize_hex_color',
	)
);
$wp_customize->add_control(new WP_Customize_Color_Control($wp_customize,'interior_services_slider_btn_color',array(
			'label'           => __('Slider Button Label Color', 'interior-services'),
			'section'         => 'interior_services_slider_section',
			'settings'        => 'interior_services_slider_btn_color',
			'active_callback' => 'interior_services_is_slider_section_enabled',
		)
	)
);
// Slider Button Background Color
$wp_customize->add_setting('interior_services_slider_btn_bg_color',array(
		'default'           => '',
		'sanitize_callback' => 'sanitize_hex_color',
	)
);
$wp_customize->add_control(new WP_Customize_Color_Control($wp_customize,'interior_services_slider_btn_bg_color',array(
			'label'           => __('Slider Button Background Color', 'interior-services'),
			'section'         => 'interior_services_slider_section',
			'settings'        => 'interior_services_slider_btn_bg_color',
			'active_callback' => 'interior_services_is_slider_section_enabled',
		)
	)
);

$wp_customize->add_setting( 
	'interior_services_slider_settings_upgraded_features',
	array(
		'sanitize_callback' => 'sanitize_text_field'
	)
);

$wp_customize->add_control(
	'interior_services_slider_settings_upgraded_features', 
	array(
		'type'=> 'hidden',
		'description' => "
			<div class='customizer-upgraded-features'>
				<i class='fas fa-info-circle'></i>
				<span class='pro-text'>
					Unlock Premium <strong>Features</strong> ?<br>
					<a target='_blank' href='". esc_url(INTERIOR_SERVICES_PREMIUM_PAGE) ." '>Upgrade Pro</a>
				</div>
			</div>
		",
		'section' => 'interior_services_slider_section'
	)
);
