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

// Add Slider Section
$wp_customize->add_section(
	'lawyer_consultant_firm_slider_section',
	array(
		'panel'    => 'lawyer_consultant_firm_front_page_options',
		'title'    => esc_html__( 'Slider Section', 'lawyer-consultant-firm' ),
		'priority' => 10,
	)
);

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

$wp_customize->add_control(
	new Lawyer_Consultant_Firm_Toggle_Switch_Custom_Control(
		$wp_customize,
		'lawyer_consultant_firm_enable_slider_section',
		array(
			'label'    => esc_html__( 'Enable Slider Section', 'lawyer-consultant-firm' ),
			'section'  => 'lawyer_consultant_firm_slider_section',
			'settings' => 'lawyer_consultant_firm_enable_slider_section',
		)
	)
);

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

$wp_customize->add_control(
	'lawyer_consultant_firm_slider_heading',
	array(
		'label'           => esc_html__( 'Slider Sub Heading', 'lawyer-consultant-firm' ),
		'section'         => 'lawyer_consultant_firm_slider_section',
		'settings'        => 'lawyer_consultant_firm_slider_heading',
		'type'            => 'text',
		'active_callback' => 'lawyer_consultant_firm_is_slider_slider_section_enabled',
	)
);

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

$wp_customize->add_control( new Lawyer_Consultant_Firm_Separator_Custom_Control( $wp_customize, 'lawyer_consultant_firm_slider_separators', array(
	'label' => __( 'Select Slider Category', 'lawyer-consultant-firm' ),
	'section' => 'lawyer_consultant_firm_slider_section',
	'settings' => 'lawyer_consultant_firm_slider_separators',
	'active_callback' => 'lawyer_consultant_firm_is_slider_slider_section_enabled',
)));

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

$wp_customize->add_control(
	new Lawyer_Consultant_Firm_Customize_Category_Dropdown_Control(
		$wp_customize,
		'lawyer_consultant_firm_slider_slider_category',
		array(
			'label'    => __( 'Select Slider Category', 'lawyer-consultant-firm' ),
			'section'  => 'lawyer_consultant_firm_slider_section',
			'settings' => 'lawyer_consultant_firm_slider_slider_category',
			'active_callback' => 'lawyer_consultant_firm_is_slider_slider_section_enabled',
		)
	)
);

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

$wp_customize->add_control(
	'lawyer_consultant_firm_slider_button_label',
	array(
		'label'           => esc_html__( 'Button Label', 'lawyer-consultant-firm'  ),
		'section'         => 'lawyer_consultant_firm_slider_section',
		'settings'        => 'lawyer_consultant_firm_slider_button_label',
		'type'            => 'text',
		'active_callback' => 'lawyer_consultant_firm_is_slider_slider_section_enabled',
	)
);

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

$wp_customize->add_control(
	'lawyer_consultant_firm_slider_button_link',
	array(
		'label'           => esc_html__( 'Button Link', 'lawyer-consultant-firm' ),
		'section'         => 'lawyer_consultant_firm_slider_section',
		'settings'        => 'lawyer_consultant_firm_slider_button_link',
		'type'            => 'url',
		'active_callback' => 'lawyer_consultant_firm_is_slider_slider_section_enabled',
	)
);

// Slider Button Label Color
$wp_customize->add_setting('lawyer_consultant_firm_slider_btn_color',array(
		'default'           => '',
		'sanitize_callback' => 'sanitize_hex_color',
	)
);
$wp_customize->add_control(new WP_Customize_Color_Control($wp_customize,'lawyer_consultant_firm_slider_btn_color',array(
			'label'           => __('Slider Button Label Color', 'lawyer-consultant-firm'),
			'section'         => 'lawyer_consultant_firm_slider_section',
			'settings'        => 'lawyer_consultant_firm_slider_btn_color',
			'active_callback' => 'lawyer_consultant_firm_is_slider_slider_section_enabled',
		)
	)
);
// Slider Button Background Color
$wp_customize->add_setting('lawyer_consultant_firm_slider_btn_bg_color',array(
		'default'           => '',
		'sanitize_callback' => 'sanitize_hex_color',
	)
);
$wp_customize->add_control(new WP_Customize_Color_Control($wp_customize,'lawyer_consultant_firm_slider_btn_bg_color',array(
			'label'           => __('Slider Button Background Color', 'lawyer-consultant-firm'),
			'section'         => 'lawyer_consultant_firm_slider_section',
			'settings'        => 'lawyer_consultant_firm_slider_btn_bg_color',
			'active_callback' => 'lawyer_consultant_firm_is_slider_slider_section_enabled',
		)
	)
);

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

$wp_customize->add_control(
	'lawyer_consultant_firm_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(LAWYER_CONSULTANT_FIRM_PREMIUM_PAGE) ." '>Upgrade Pro</a>
				</div>
			</div>
		",
		'section' => 'lawyer_consultant_firm_slider_section'
	)
);