<?php
/**
 * Banner Section Settings
 *
 * @package aster_it_courses
 */

// Add Banner Section
$wp_customize->add_section(
	'aster_it_courses_banner_section',
	array(
		'panel'    => 'aster_it_courses_front_page_options',
		'title'    => esc_html__( 'Banner Section', 'aster-it-courses' ),
		'priority' => 10,
	)
);

// Enable Banner Section
$wp_customize->add_setting(
	'aster_it_courses_enable_banner_section',
	array(
		'default'           => false,
		'sanitize_callback' => 'aster_it_courses_sanitize_switch',
	)
);

$wp_customize->add_control(
	new Aster_IT_Courses_Toggle_Switch_Custom_Control(
		$wp_customize,
		'aster_it_courses_enable_banner_section',
		array(
			'label'    => esc_html__( 'Enable Banner Section', 'aster-it-courses' ),
			'section'  => 'aster_it_courses_banner_section',
			'settings' => 'aster_it_courses_enable_banner_section',
		)
	)
);

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

$wp_customize->add_control( new Aster_IT_Courses_Separator_Custom_Control( $wp_customize, 'aster_it_courses_banner_separators', array(
	'label' => __( 'Select Banner Category', 'aster-it-courses' ),
	'section' => 'aster_it_courses_banner_section',
	'settings' => 'aster_it_courses_banner_separators',
	'active_callback' => 'aster_it_courses_is_banner_slider_section_enabled',
)));

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

$wp_customize->add_control(
	new Aster_IT_Courses_Customize_Category_Dropdown_Control(
		$wp_customize,
		'aster_it_courses_banner_slider_category',
		array(
			'label'    => __( 'Select Banner Category', 'aster-it-courses' ),
			'section'  => 'aster_it_courses_banner_section',
			'settings' => 'aster_it_courses_banner_slider_category',
			'active_callback' => 'aster_it_courses_is_banner_slider_section_enabled',
		)
	)
);

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

$wp_customize->add_control(
	'aster_it_courses_banner_button_label',
	array(
		'label'           => esc_html__( 'Button Label', 'aster-it-courses'  ),
		'section'         => 'aster_it_courses_banner_section',
		'settings'        => 'aster_it_courses_banner_button_label',
		'type'            => 'text',
		'active_callback' => 'aster_it_courses_is_banner_slider_section_enabled',
	)
);

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

$wp_customize->add_control(
	'aster_it_courses_banner_button_link',
	array(
		'label'           => esc_html__( 'Button Link', 'aster-it-courses' ),
		'section'         => 'aster_it_courses_banner_section',
		'settings'        => 'aster_it_courses_banner_button_link',
		'type'            => 'url',
		'active_callback' => 'aster_it_courses_is_banner_slider_section_enabled',
	)
);


$wp_customize->add_setting('aster_it_courses_right_image_text', array(
	'default'           => '',
	'sanitize_callback' => 'sanitize_text_field',
));
$wp_customize->add_control('aster_it_courses_right_image_text', array(
	'label'    => __('Review Text', 'aster-it-courses'),
	'section'  => 'aster_it_courses_banner_section',
	'type'     => 'text',
	'active_callback' => 'aster_it_courses_is_banner_slider_section_enabled',
));

$wp_customize->add_setting('aster_it_courses_slider_team_image_1',
	array(
		'sanitize_callback' => 'esc_url_raw',
	)
);
$wp_customize->add_control(
	new WP_Customize_Image_Control( $wp_customize,'aster_it_courses_slider_team_image_1',
		array(
			'label' => __('Review Image 1','aster-it-courses'),
			'section' => 'aster_it_courses_banner_section',
			'settings' => 'aster_it_courses_slider_team_image_1',
			'active_callback' => 'aster_it_courses_is_banner_slider_section_enabled',
		)
	)
);

$wp_customize->add_setting('aster_it_courses_slider_team_image_2',
	array(
		'sanitize_callback' => 'esc_url_raw',
	)
);
$wp_customize->add_control(
	new WP_Customize_Image_Control( $wp_customize,'aster_it_courses_slider_team_image_2',
		array(
			'label' => __('Review Image 2','aster-it-courses'),
			'section' => 'aster_it_courses_banner_section',
			'settings' => 'aster_it_courses_slider_team_image_2',
			'active_callback' => 'aster_it_courses_is_banner_slider_section_enabled',
		)
	)
);

$wp_customize->add_setting('aster_it_courses_slider_team_image_3',
	array(
		'sanitize_callback' => 'esc_url_raw',
	)
);
$wp_customize->add_control(
	new WP_Customize_Image_Control( $wp_customize,'aster_it_courses_slider_team_image_3',
		array(
			'label' => __('Review Image 3','aster-it-courses'),
			'section' => 'aster_it_courses_banner_section',
			'settings' => 'aster_it_courses_slider_team_image_3',
			'active_callback' => 'aster_it_courses_is_banner_slider_section_enabled',
		)
	)
);

// Banner Button Label Color
$wp_customize->add_setting(
	'aster_it_courses_banner_btn_color',
	array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color',
	)
);
$wp_customize->add_control(new WP_Customize_Color_Control($wp_customize,'aster_it_courses_banner_btn_color',array(
			'label' => __('Banner Button Label Color','aster-it-courses'),
			'section' => 'aster_it_courses_banner_section',
			'settings' => 'aster_it_courses_banner_btn_color',
			'active_callback' => 'aster_it_courses_is_banner_slider_section_enabled',
		)
	)
);

// Banner Button Background Color
$wp_customize->add_setting('aster_it_courses_banner_btn_bg_color',array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color',
	)
);
$wp_customize->add_control(new WP_Customize_Color_Control($wp_customize,'aster_it_courses_banner_btn_bg_color',array(
			'label' => __('Banner Button Background Color','aster-it-courses'),
			'section' => 'aster_it_courses_banner_section',
			'settings' => 'aster_it_courses_banner_btn_bg_color',
			'active_callback' => 'aster_it_courses_is_banner_slider_section_enabled',
		)
	)
);

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

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