<?php
/**
* Header Options.
*
* @package NewsNation
*/

$newsnation_default = newsnation_get_default_theme_options();
$newsnation_page_lists = newsnation_page_lists();
$newsnation_post_category_list = newsnation_post_category_list();

// Header Advertise Area Section.
$wp_customize->add_section( 'main_header_setting',
	array(
	'title'      => esc_html__( 'Main Advertisement Settings', 'newsnation' ),
	'priority'   => 10,
	'capability' => 'edit_theme_options',
    'panel'      => 'theme_option_panel',
	)
);


$wp_customize->add_setting('ed_header_ad',
    array(
        'default' => $newsnation_default['ed_header_ad'],
        'capability' => 'edit_theme_options',
        'sanitize_callback' => 'newsnation_sanitize_checkbox',
    )
);
$wp_customize->add_control('ed_header_ad',
    array(
        'label' => esc_html__('Enable Top Advertisement Area', 'newsnation'),
        'section' => 'main_header_setting',
        'type' => 'checkbox',
    )
);

$wp_customize->add_setting(
    'ed_header_type',
    array(
        'default'           => $newsnation_default['ed_header_type'],
        'capability'        => 'edit_theme_options',
        'sanitize_callback' => 'newsnation_sanitize_select'
    )
);
$wp_customize->add_control('ed_header_type',
        array(
            'type'       => 'select',
            'section'       => 'main_header_setting',
            'label'         => esc_html__( 'Addvertisement Section Container', 'newsnation' ),
            'choices'       => array(
                'wpi-img-full-width-header'  => esc_html__( 'Full Page', 'newsnation' ),
                'wpi-img-boxed-header'  => esc_html__( 'Default', 'newsnation' ),
                'wpi-img-content-header'  => esc_html__( 'Contained', 'newsnation' ),
            ),
            'active_callback' => 'newsnation_header_ad_ac',
        )
);


$wp_customize->add_setting( 'addvertisement_section_title',
    array(
    'default'           => $newsnation_default['addvertisement_section_title'],
    'capability'        => 'edit_theme_options',
    'sanitize_callback' => 'sanitize_text_field',
    )
);
$wp_customize->add_control( 'addvertisement_section_title',
    array(
    'label'       => esc_html__( 'Addvertisement Section Title', 'newsnation' ),
    'section'     => 'main_header_setting',
    'type'        => 'text',
    'active_callback' => 'newsnation_header_ad_ac',
    )
);

$wp_customize->add_setting('header_ad_image',
    array(
        'default' => '',
        'sanitize_callback' => 'esc_url_raw'
    )
);
$wp_customize->add_control( new WP_Customize_Image_Control(
    $wp_customize,
    'header_ad_image',
        array(
            'label'      => esc_html__( 'Top Header AD Image', 'newsnation' ),
            'section'    => 'main_header_setting',
            'active_callback' => 'newsnation_header_ad_ac',
        )
    )
);

$wp_customize->add_setting('ed_header_link',
    array(
        'default' => '',
        'capability' => 'edit_theme_options',
        'sanitize_callback' => 'esc_url_raw',
    )
);
$wp_customize->add_control('ed_header_link',
    array(
        'label' => esc_html__('AD Image Link', 'newsnation'),
        'section' => 'main_header_setting',
        'type' => 'text',
        'active_callback' => 'newsnation_header_ad_ac',
    )
);

// Archive Layout.
$wp_customize->add_setting(
    'newsnation_header_bg_size',
    array(
        'default'           => $newsnation_default['newsnation_header_bg_size'],
        'capability'        => 'edit_theme_options',
        'sanitize_callback' => 'absint'
    )
);
$wp_customize->add_control('newsnation_header_bg_size',
        array(
            'type'       => 'select',
            'section'       => 'header_image',
            'label'         => esc_html__( 'Header BG Size', 'newsnation' ),
            'choices'       => array(
                '1'  => esc_html__( 'Small', 'newsnation' ),
                '2'  => esc_html__( 'Medium', 'newsnation' ),
                '3'  => esc_html__( 'Large', 'newsnation' ),
            )
        )
);

$wp_customize->add_setting('ed_header_bg_fixed',
    array(
        'default' => $newsnation_default['ed_header_bg_fixed'],
        'capability' => 'edit_theme_options',
        'sanitize_callback' => 'newsnation_sanitize_checkbox',
    )
);
$wp_customize->add_control('ed_header_bg_fixed',
    array(
        'label' => esc_html__('Enable Fixed BG', 'newsnation'),
        'section' => 'header_image',
        'type' => 'checkbox',
    )
);

$wp_customize->add_setting('ed_header_bg_overlay',
    array(
        'default' => $newsnation_default['ed_header_bg_overlay'],
        'capability' => 'edit_theme_options',
        'sanitize_callback' => 'newsnation_sanitize_checkbox',
    )
);
$wp_customize->add_control('ed_header_bg_overlay',
    array(
        'label' => esc_html__('Enable BG Overlay', 'newsnation'),
        'section' => 'header_image',
        'type' => 'checkbox',
    )
);