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

$vintuna_default = vintuna_get_default_theme_options();
$vintuna_page_lists = vintuna_page_lists();
$vintuna_post_category_list = vintuna_post_category_list();

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


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

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


$wp_customize->add_setting( 'addvertisement_section_title',
    array(
    'default'           => $vintuna_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', 'vintuna' ),
    'section'     => 'main_header_setting',
    'type'        => 'text',
    'active_callback' => 'vintuna_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', 'vintuna' ),
            'section'    => 'main_header_setting',
            'active_callback' => 'vintuna_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', 'vintuna'),
        'section' => 'main_header_setting',
        'type' => 'text',
        'active_callback' => 'vintuna_header_ad_ac',
    )
);

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

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

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