<?php
/**
 * Highlights options.
 *
 * @package Magazine Bell
 */

$default = magazine_bell_get_default_theme_options();

// Highlights Section
$wp_customize->add_section( 'section_home_highlights',
	array(
		'title'      => __( 'Highlights News', 'magazine-bell' ),
		'capability' => 'edit_theme_options',
		'panel'      => 'home_page_panel',
		)
);

$wp_customize->add_setting( 'theme_options[disable_highlights_section]',
	array(
		'default'           => $default['disable_highlights_section'],
		'type'              => 'theme_mod',
		'capability'        => 'edit_theme_options',
		'sanitize_callback' => 'magazine_bell_sanitize_switch_control',
	)
);
$wp_customize->add_control( new Magazine_Bell_Switch_Control( $wp_customize, 'theme_options[disable_highlights_section]',
    array(
		'label' 	=> __('Disable Highlights Section', 'magazine-bell'),
		'section'    			=> 'section_home_highlights',
		'on_off_label' 		=> magazine_bell_switch_options(),
    )
) );
//Highlights Section title
$wp_customize->add_setting('theme_options[highlights_title]', 
	array(
	'default'           => $default['highlights_title'],
	'type'              => 'theme_mod',
	'capability'        => 'edit_theme_options',	
	'sanitize_callback' => 'sanitize_text_field'
	)
);

$wp_customize->add_control('theme_options[highlights_title]', 
	array(
	'label'       => __('Section Title', 'magazine-bell'),
	'section'     => 'section_home_highlights',   
	'settings'    => 'theme_options[highlights_title]',
	'active_callback' => 'magazine_bell_highlights_active',		
	'type'        => 'text'
	)
);

// Add arrow enable setting and control.
$wp_customize->add_setting( 'theme_options[highlights_content_align]', array(
	'default'           => $default['highlights_content_align'],
	'sanitize_callback' => 'magazine_bell_sanitize_select',
) );

$wp_customize->add_control( 'theme_options[highlights_content_align]', array(
	'label'             => esc_html__( 'Choose Content Align', 'magazine-bell' ),
	'section'           => 'section_home_highlights',
	'type'              => 'radio',
	'active_callback' => 'magazine_bell_highlights_active',
	'choices'				=> array( 
		'content-right'     => esc_html__( 'Right Side', 'magazine-bell' ), 
		'content-center'     => esc_html__( 'Center Side', 'magazine-bell' ), 
		'content-left'     => esc_html__( 'Left Side', 'magazine-bell' ), 
		'content-justify'     => esc_html__( 'Justify', 'magazine-bell' )
		)
) );


// Add posted on enable setting and control.
$wp_customize->add_setting( 'theme_options[highlights_posted_on_enable]', array(
	'default'           => $default['highlights_posted_on_enable'],
	'sanitize_callback' => 'magazine_bell_sanitize_checkbox',
) );

$wp_customize->add_control( 'theme_options[highlights_posted_on_enable]', array(
	'label'             => esc_html__( 'Enable Date', 'magazine-bell' ),
	'section'           => 'section_home_highlights',
	'type'              => 'checkbox',
	'active_callback' => 'magazine_bell_highlights_active',
) );

// Enable dot
$wp_customize->add_setting( 'theme_options[highlights_dot]',
	array(
		'default' 			=> $default['highlights_dot'],
		'type'              => 'theme_mod',
		'capability'        => 'edit_theme_options',
		'sanitize_callback' => 'magazine_bell_sanitize_switch_control',
	)
);
$wp_customize->add_control( new Magazine_Bell_Switch_Control( $wp_customize, 'theme_options[highlights_dot]',
    array(
		'label' 	=> __('Disable Highlights Dots', 'magazine-bell'),
		'section'    			=> 'section_home_highlights',
		'on_off_label' 		=> magazine_bell_switch_options(),
		'active_callback' => 'magazine_bell_highlights_active',
    )
) );


// Setting  Highlights Category.
$wp_customize->add_setting( 'theme_options[highlights_category]',
	array(

	'capability'        => 'edit_theme_options',
	'sanitize_callback' => 'absint',
	)
);
$wp_customize->add_control(
	new Magazine_Bell_Dropdown_Taxonomies_Control( $wp_customize, 'theme_options[highlights_category]',
		array(
		'label'    => __( 'Select Category', 'magazine-bell' ),
		'section'  => 'section_home_highlights',
		'settings' => 'theme_options[highlights_category]',	
		'active_callback' => 'magazine_bell_highlights_active',		
		)
	)
);
