<?php
/**
* Header Banner Options.
*
* @package Solar Energy Engine
*/

$solar_energy_engine_default = solar_energy_engine_get_default_theme_options();
$solar_energy_engine_post_category_list = solar_energy_engine_post_category_list();

$wp_customize->add_section( 'solar_energy_engine_header_banner_setting',
    array(
    'title'      => esc_html__( 'Slider Settings', 'solar-energy-engine' ),
    'priority'   => 10,
    'capability' => 'edit_theme_options',
    'panel'      => 'solar_energy_engine_theme_home_pannel',
    )
);

$wp_customize->add_setting('solar_energy_engine_display_header_title',
    array(
        'default' => $solar_energy_engine_default['solar_energy_engine_display_header_title'],
        'capability' => 'edit_theme_options',
        'sanitize_callback' => 'solar_energy_engine_sanitize_checkbox',
    )
);
$wp_customize->add_control('solar_energy_engine_display_header_title',
    array(
        'label' => esc_html__('Enable / Disable Title', 'solar-energy-engine'),
        'section' => 'title_tagline',
        'type' => 'checkbox',
    )
);

// Show/Hide Site Logo
$wp_customize->add_setting('solar_energy_engine_display_logo', array(
    'default'           => false,
    'capability'        => 'edit_theme_options',
    'sanitize_callback' => 'solar_energy_engine_sanitize_checkbox',
));
$wp_customize->add_control('solar_energy_engine_display_logo', array(
    'label'    => esc_html__('Enable / Disable Site Logo', 'solar-energy-engine'),
    'section'  => 'title_tagline',
    'type'     => 'checkbox',
));

// Show/Hide Site Title
$wp_customize->add_setting('solar_energy_engine_display_title', array(
    'default'           => true,
    'capability'        => 'edit_theme_options',
    'sanitize_callback' => 'solar_energy_engine_sanitize_checkbox',
));
$wp_customize->add_control('solar_energy_engine_display_title', array(
    'label'    => esc_html__('Enable / Disable Site Title', 'solar-energy-engine'),
    'section'  => 'title_tagline',
    'type'     => 'checkbox',
));

// Show/Hide Site Tagline
$wp_customize->add_setting('solar_energy_engine_display_header_text',
    array(
        'default'           => false,
        'capability' => 'edit_theme_options',
        'sanitize_callback' => 'solar_energy_engine_sanitize_checkbox',
    )
);
$wp_customize->add_control('solar_energy_engine_display_header_text',
    array(
        'label' => esc_html__('Enable / Disable Site Tagline', 'solar-energy-engine'),
        'section' => 'title_tagline',
        'type' => 'checkbox',
    )
);

$wp_customize->add_setting('solar_energy_engine_header_banner',
    array(
        'default' => $solar_energy_engine_default['solar_energy_engine_header_banner'],
        'capability' => 'edit_theme_options',
        'sanitize_callback' => 'solar_energy_engine_sanitize_checkbox',
    )
);
$wp_customize->add_control('solar_energy_engine_header_banner',
    array(
        'label' => esc_html__('Enable Slider', 'solar-energy-engine'),
        'section' => 'solar_energy_engine_header_banner_setting',
        'type' => 'checkbox',
    )
);

$wp_customize->add_setting( 'solar_energy_engine_header_banner_cat',
    array(
    'default'           => '',
    'capability'        => 'edit_theme_options',
    'sanitize_callback' => 'solar_energy_engine_sanitize_select',
    )
);
$wp_customize->add_control( 'solar_energy_engine_header_banner_cat',
    array(
    'label'       => esc_html__( 'Slider Post Category', 'solar-energy-engine' ),
    'section'     => 'solar_energy_engine_header_banner_setting',
    'type'        => 'select',
    'choices'     => $solar_energy_engine_post_category_list,
    )
);

$wp_customize->add_setting( 'solar_energy_engine_video_button_link',
    array(
    'default' => 'https://www.youtube.com/watch?v=9xwazD5SyVg&pp=ygULZHVtbXkgdmlkZW8%3D',
    'capability'        => 'edit_theme_options',
    'sanitize_callback' => 'esc_url_raw',
    )
);
$wp_customize->add_control( 'solar_energy_engine_video_button_link',
    array(
    'label'    => esc_html__( 'Slider Embedded Video URL', 'solar-energy-engine' ),
    'section'  => 'solar_energy_engine_header_banner_setting',
    'type'     => 'url',
    )
);

$wp_customize->add_setting( 'solar_energy_engine_installation_text',
    array(
    'default' => $solar_energy_engine_default['solar_energy_engine_installation_text'],
    'capability'        => 'edit_theme_options',
    'sanitize_callback' => 'sanitize_text_field',
    )
);
$wp_customize->add_control( 'solar_energy_engine_installation_text',
    array(
    'label'    => esc_html__( 'Installation Text', 'solar-energy-engine' ),
    'section'  => 'solar_energy_engine_header_banner_setting',
    'type'     => 'text',
    )
);

$wp_customize->add_section( 'solar_energy_engine_header_category_setting',
    array(
    'title'      => esc_html__( 'Category Carousel Settings', 'solar-energy-engine' ),
    'priority'   => 10,
    'capability' => 'edit_theme_options',
    'panel'      => 'solar_energy_engine_theme_home_pannel',
    )
);


$wp_customize->add_setting('solar_energy_engine_category_section',
    array(
        'default' => $solar_energy_engine_default['solar_energy_engine_category_section'],
        'capability' => 'edit_theme_options',
        'sanitize_callback' => 'solar_energy_engine_sanitize_checkbox',
    )
);
$wp_customize->add_control('solar_energy_engine_category_section',
    array(
        'label' => esc_html__('Enable Category Section', 'solar-energy-engine'),
        'section' => 'solar_energy_engine_header_category_setting',
        'type' => 'checkbox',
    )
);

$wp_customize->add_setting( 'solar_energy_engine_cat_short_title',
    array(
    'default'           => $solar_energy_engine_default['solar_energy_engine_cat_short_title'],
    'capability'        => 'edit_theme_options',
    'sanitize_callback' => 'sanitize_text_field',
    )
);
$wp_customize->add_control( 'solar_energy_engine_cat_short_title',
    array(
    'label'    => esc_html__( 'Short Title', 'solar-energy-engine' ),
    'section'  => 'solar_energy_engine_header_category_setting',
    'type'     => 'text',
    )
);

$wp_customize->add_setting( 'solar_energy_engine_cat_main_title',
    array(
    'default'           => $solar_energy_engine_default['solar_energy_engine_cat_main_title'],
    'capability'        => 'edit_theme_options',
    'sanitize_callback' => 'sanitize_text_field',
    )
);
$wp_customize->add_control( 'solar_energy_engine_cat_main_title',
    array(
    'label'    => esc_html__( 'Title', 'solar-energy-engine' ),
    'section'  => 'solar_energy_engine_header_category_setting',
    'type'     => 'text',
    )
);

for ($x = 1; $x <= 10; $x++) {

    $wp_customize->add_setting( 'solar_energy_engine_category_cat_'.$x,
        array(
        'default'           => 'uncategorized',
        'capability'        => 'edit_theme_options',
        'sanitize_callback' => 'solar_energy_engine_sanitize_select',
        )
    );
    $wp_customize->add_control( 'solar_energy_engine_category_cat_'.$x,
        array(
        'label'       => esc_html__( 'Category ', 'solar-energy-engine' ).$x,
        'section'     => 'solar_energy_engine_header_category_setting',
        'type'        => 'select',
        'choices'     => $solar_energy_engine_post_category_list,
        )
    );

}