<?php
$wp_customize->add_section(
    'homepage_slider_banner_option',
    array(
        'title' => __('Slider Banner', 'newsmarks'),
        'panel' => 'front_page_theme_options_panel',
    )
);

/* Home Page Layout */
$wp_customize->add_setting(
    'newsmarks_options[enable_slider_banner_section]',
    array(
        'default' => $newsmarks_default['enable_slider_banner_section'],
        'sanitize_callback' => 'newsmarks_sanitize_checkbox',
    )
);
$wp_customize->add_control(
    'newsmarks_options[enable_slider_banner_section]',
    array(
        'label' => __('Enable Slider Banner Section', 'newsmarks'),
        'section' => 'homepage_slider_banner_option',
        'type' => 'checkbox',
    )
);

$wp_customize->add_setting(
    'newsmarks_options[number_of_slider_post]',
    array(
        'default' => $newsmarks_default['number_of_slider_post'],
        'sanitize_callback' => 'newsmarks_sanitize_select',
    )
);
$wp_customize->add_control(
    'newsmarks_options[number_of_slider_post]',
    array(
        'label' => __('Post In Slider', 'newsmarks'),
        'section' => 'homepage_slider_banner_option',
        'type' => 'select',
        'choices' => array(
            '3' => __('3', 'newsmarks'),
            '4' => __('4', 'newsmarks'),
            '5' => __('5', 'newsmarks'),
            '6' => __('6', 'newsmarks'),
        ),
    )
);


$wp_customize->add_setting(
    'newsmarks_options[banner_section_cat]',
    array(
        'default'           => $newsmarks_default['banner_section_cat'],
        'sanitize_callback' => 'absint',
    )
);
$wp_customize->add_control(
    new Newsmarks_Dropdown_Taxonomies_Control(
        $wp_customize,
        'newsmarks_options[banner_section_cat]',
        array(
            'label'           => __( 'Choose slider Post Category', 'newsmarks' ),
            'description'     => __( 'Leave Empty if you don\'t want the posts to be category specific', 'newsmarks' ),
            'section'         => 'homepage_slider_banner_option',
        )
    )
);


$wp_customize->add_setting(
    'newsmarks_options[enable_banner_post_description]',
    array(
        'default' => $newsmarks_default['enable_banner_post_description'],
        'sanitize_callback' => 'newsmarks_sanitize_checkbox',
    )
);
$wp_customize->add_control(
    'newsmarks_options[enable_banner_post_description]',
    array(
        'label' => __('Enable Post Description', 'newsmarks'),
        'section' => 'homepage_slider_banner_option',
        'type' => 'checkbox',
    )
);


$wp_customize->add_setting(
    'newsmarks_options[enable_banner_overlay]',
    array(
        'default' => $newsmarks_default['enable_banner_overlay'],
        'sanitize_callback' => 'newsmarks_sanitize_checkbox',
    )
);
$wp_customize->add_control(
    'newsmarks_options[enable_banner_overlay]',
    array(
        'label' => __('Enable Banner Overlay', 'newsmarks'),
        'section' => 'homepage_slider_banner_option',
        'type' => 'checkbox',
    )
);

$wp_customize->add_setting(
    'newsmarks_options[banner_button_text]',
    array(
        'default' => $newsmarks_default['banner_button_text'],
        'sanitize_callback' => 'sanitize_text_field',
    )
);
$wp_customize->add_control(
    'newsmarks_options[banner_button_text]',
    array(
        'label' => __('Banner Button Text', 'newsmarks'),
        'section' => 'homepage_slider_banner_option',
        'type' => 'text',
    )
);




$wp_customize->add_setting(
    'newsmarks_section_seperator_banner',
    array(
        'default'           => '',
        'capability'        => 'edit_theme_options',
        'sanitize_callback' => 'sanitize_text_field'
    )
);

$wp_customize->add_control(
    new Newsmarks_Seperator_Control(
        $wp_customize,
        'newsmarks_section_seperator_banner',
        array(
            'label'         => esc_html__( 'Banner Slider Meta', 'newsmarks' ),
            'settings' => 'newsmarks_section_seperator_banner',
            'section' => 'homepage_slider_banner_option',
        )
    )
);


$wp_customize->add_setting(
    'newsmarks_options[enable_banner_slider_author_meta]',
    array(
        'default' => $newsmarks_default['enable_banner_slider_author_meta'],
        'sanitize_callback' => 'newsmarks_sanitize_checkbox',
    )
);
$wp_customize->add_control(
    'newsmarks_options[enable_banner_slider_author_meta]',
    array(
        'label' => esc_html__('Display Author Meta', 'newsmarks'),
        'section' => 'homepage_slider_banner_option',
        'type' => 'checkbox',
    )
);
$wp_customize->add_setting(
    'newsmarks_options[select_banner_slider_author_meta]',
    array(
        'default' => $newsmarks_default['select_banner_slider_author_meta'],
        'sanitize_callback' => 'newsmarks_sanitize_select',
    )
);
$wp_customize->add_control(
    'newsmarks_options[select_banner_slider_author_meta]',
    array(
        'label' => esc_html__('Select Author Meta', 'newsmarks'),
        'section' => 'homepage_slider_banner_option',
        'type' => 'select',
        'choices' => newsmarks_author_meta(),
    )
);
$wp_customize->add_setting(
    'newsmarks_options[banner_slider_author_meta_title]',
    array(
        'default' => $newsmarks_default['banner_slider_author_meta_title'],
        'sanitize_callback' => 'sanitize_text_field',
    )
);
$wp_customize->add_control(
    'newsmarks_options[banner_slider_author_meta_title]',
    array(
        'label' => __('Author Meta Text', 'newsmarks'),
        'section' => 'homepage_slider_banner_option',
        'type' => 'text',
    )
);
$wp_customize->add_setting(
    'newsmarks_options[enable_banner_slider_date_meta]',
    array(
        'default' => $newsmarks_default['enable_banner_slider_date_meta'],
        'sanitize_callback' => 'newsmarks_sanitize_checkbox',
    )
);
$wp_customize->add_control(
    'newsmarks_options[enable_banner_slider_date_meta]',
    array(
        'label' => esc_html__('Display Published Date', 'newsmarks'),
        'section' => 'homepage_slider_banner_option',
        'type' => 'checkbox',
    )
);
$wp_customize->add_setting(
    'newsmarks_options[select_banner_slider_date]',
    array(
        'default' => $newsmarks_default['select_banner_slider_date'],
        'sanitize_callback' => 'newsmarks_sanitize_select',
    )
);
$wp_customize->add_control(
    'newsmarks_options[select_banner_slider_date]',
    array(
        'label' => esc_html__('Select Single Date Meta', 'newsmarks'),
        'section' => 'homepage_slider_banner_option',
        'type' => 'select',
        'choices' => newsmarks_date_meta(),
    )
);
$wp_customize->add_setting(
    'newsmarks_options[select_banner_slider_date_meta_title]',
    array(
        'default' => $newsmarks_default['select_banner_slider_date_meta_title'],
        'sanitize_callback' => 'sanitize_text_field',
    )
);
$wp_customize->add_control(
    'newsmarks_options[select_banner_slider_date_meta_title]',
    array(
        'label' => __('Date Text', 'newsmarks'),
        'section' => 'homepage_slider_banner_option',
        'type' => 'text',
    )
);
$wp_customize->add_setting(
    'newsmarks_options[select_banner_slider_date_format]',
    array(
        'default' => $newsmarks_default['select_banner_slider_date_format'],
        'sanitize_callback' => 'newsmarks_sanitize_select',
    )
);
$wp_customize->add_control(
    'newsmarks_options[select_banner_slider_date_format]',
    array(
        'label' => esc_html__('Select Date Format', 'newsmarks'),
        'section' => 'homepage_slider_banner_option',
        'type' => 'select',
        'choices' => newsmarks_get_date_formats(),
    )
);
$wp_customize->add_setting(
    'newsmarks_options[enable_banner_slider_category_meta]',
    array(
        'default' => $newsmarks_default['enable_banner_slider_category_meta'],
        'sanitize_callback' => 'newsmarks_sanitize_checkbox',
    )
);
$wp_customize->add_control(
    'newsmarks_options[enable_banner_slider_category_meta]',
    array(
        'label' => esc_html__('Enable Category Meta', 'newsmarks'),
        'section' => 'homepage_slider_banner_option',
        'type' => 'checkbox',
    )
);
$wp_customize->add_setting(
    'newsmarks_options[select_banner_slider_number_of_category]',
    array(
        'default' => $newsmarks_default['select_banner_slider_number_of_category'],
        'sanitize_callback' => 'absint',
    )
);
$wp_customize->add_control(
    'newsmarks_options[select_banner_slider_number_of_category]',
    array(
        'label' => __('Number of Category', 'newsmarks'),
        'section' => 'homepage_slider_banner_option',
        'type' => 'number',
    )
);
$wp_customize->add_setting(
    'newsmarks_options[banner_slider_category_label]',
    array(
        'default' => $newsmarks_default['banner_slider_category_label'],
        'sanitize_callback' => 'sanitize_text_field',
    )
);
$wp_customize->add_control(
    'newsmarks_options[banner_slider_category_label]',
    array(
        'label' => __('Category Label', 'newsmarks'),
        'section' => 'homepage_slider_banner_option',
        'type' => 'text',
    )
);

$wp_customize->add_setting(
    'newsmarks_options[select_banner_slider_category_color]',
    array(
        'default' => $newsmarks_default['select_banner_slider_category_color'],
        'sanitize_callback' => 'newsmarks_sanitize_select',
    )
);
$wp_customize->add_control(
    'newsmarks_options[select_banner_slider_category_color]',
    array(
        'label' => esc_html__('Select Category Color', 'newsmarks'),
        'section' => 'homepage_slider_banner_option',
        'type' => 'select',
        'choices' => newsmarks_category_color(),
    )
);