<?php
/**
* Header Banner Options.
*
* @package Electrician Company
*/

$electrician_company_default = electrician_company_get_default_theme_options();
$electrician_company_post_category_list = electrician_company_post_category_list();

$wp_customize->add_section( 'electrician_company_header_slider_setting',
    array(
    'title'      => esc_html__( 'Slider Settings', 'electrician-company' ),
    'priority'   => 10,
    'capability' => 'edit_theme_options',
    'panel'      => 'electrician_company_theme_home_pannel',
    )
);

// Show/Hide Site Logo
$wp_customize->add_setting('electrician_company_display_logo', array(
    'default'           => false,
    'capability'        => 'edit_theme_options',
    'sanitize_callback' => 'electrician_company_sanitize_checkbox',
));
$wp_customize->add_control('electrician_company_display_logo', array(
    'label'    => esc_html__('Enable / Disable Site Logo', 'electrician-company'),
    'section'  => 'title_tagline',
    'type'     => 'checkbox',
));

// Show/Hide Site Title
$wp_customize->add_setting('electrician_company_display_title', array(
    'default'           => true,
    'capability'        => 'edit_theme_options',
    'sanitize_callback' => 'electrician_company_sanitize_checkbox',
));
$wp_customize->add_control('electrician_company_display_title', array(
    'label'    => esc_html__('Enable / Disable Site Title', 'electrician-company'),
    'section'  => 'title_tagline',
    'type'     => 'checkbox',
));

// Show/Hide Site Tagline
$wp_customize->add_setting('electrician_company_display_header_text',
    array(
        'default'           => false,
        'capability' => 'edit_theme_options',
        'sanitize_callback' => 'electrician_company_sanitize_checkbox',
    )
);
$wp_customize->add_control('electrician_company_display_header_text',
    array(
        'label' => esc_html__('Enable / Disable Site Tagline', 'electrician-company'),
        'section' => 'title_tagline',
        'type' => 'checkbox',
    )
);

$wp_customize->add_setting('electrician_company_header_slider',
    array(
        'default' => $electrician_company_default['electrician_company_header_slider'],
        'capability' => 'edit_theme_options',
        'sanitize_callback' => 'electrician_company_sanitize_checkbox',
    )
);
$wp_customize->add_control('electrician_company_header_slider',
    array(
        'label' => esc_html__('Enable Slider', 'electrician-company'),
        'section' => 'electrician_company_header_slider_setting',
        'type' => 'checkbox',
    )
);

$wp_customize->add_setting('electrician_company_banner_background_image',
    array(
        'default' => $electrician_company_default['electrician_company_banner_background_image'],
        'sanitize_callback' => 'esc_url_raw',
    )
);
$wp_customize->add_control(
    new WP_Customize_Image_Control( $wp_customize,'electrician_company_banner_background_image',
        array(
            'label' => __('Slider Background Image','electrician-company'),
            'section' => 'electrician_company_header_slider_setting',
            'settings' => 'electrician_company_banner_background_image',
        )
    )
);

$wp_customize->add_setting( 'electrician_company_slider_section_short_title',
    array(
    'default'           => $electrician_company_default['electrician_company_slider_section_short_title'],
    'capability'        => 'edit_theme_options',
    'sanitize_callback' => 'sanitize_text_field',
    )
);
$wp_customize->add_control( 'electrician_company_slider_section_short_title',
    array(
    'label'    => esc_html__( 'Slider Short Title', 'electrician-company' ),
    'section'  => 'electrician_company_header_slider_setting',
    'type'     => 'text',
    )
);

$wp_customize->add_setting( 'electrician_company_header_banner_cat',
    array(
    'default'           => '',
    'capability'        => 'edit_theme_options',
    'sanitize_callback' => 'electrician_company_sanitize_select',
    )
);
$wp_customize->add_control( 'electrician_company_header_banner_cat',
    array(
    'label'       => esc_html__( 'Slider Post Left Category', 'electrician-company' ),
    'section'     => 'electrician_company_header_slider_setting',
    'type'        => 'select',
    'choices'     => $electrician_company_post_category_list,
    )
);

// What We Do Settings

$wp_customize->add_section( 'electrician_company_about_us_setting',
    array(
    'title'      => esc_html__( 'What We Do Settings', 'electrician-company' ),
    'priority'   => 10,
    'capability' => 'edit_theme_options',
    'panel'      => 'electrician_company_theme_home_pannel',
    )
);

$wp_customize->add_setting('electrician_company_header_about_us',
    array(
        'default' => $electrician_company_default['electrician_company_header_about_us'],
        'capability' => 'edit_theme_options',
        'sanitize_callback' => 'electrician_company_sanitize_checkbox',
    )
);
$wp_customize->add_control('electrician_company_header_about_us',
    array(
        'label' => esc_html__('Enable What We Do', 'electrician-company'),
        'section' => 'electrician_company_about_us_setting',
        'type' => 'checkbox',
    )
);

$wp_customize->add_setting( 'electrician_company_about_us_section_title',
    array(
    'default'           => $electrician_company_default['electrician_company_about_us_section_title'],
    'capability'        => 'edit_theme_options',
    'sanitize_callback' => 'sanitize_text_field',
    )
);
$wp_customize->add_control( 'electrician_company_about_us_section_title',
    array(
    'label'    => esc_html__( 'What We Do Short Title', 'electrician-company' ),
    'section'  => 'electrician_company_about_us_setting',
    'type'     => 'text',
    )
);

$wp_customize->add_setting( 'electrician_company_about_us_section_sub_title',
    array(
    'default'           => $electrician_company_default['electrician_company_about_us_section_sub_title'],
    'capability'        => 'edit_theme_options',
    'sanitize_callback' => 'sanitize_text_field',
    )
);
$wp_customize->add_control( 'electrician_company_about_us_section_sub_title',
    array(
    'label'    => esc_html__( 'What We Do Heading', 'electrician-company' ),
    'section'  => 'electrician_company_about_us_setting',
    'type'     => 'text',
    )
);

$categories = get_categories();
$cat_post = array();
$cat_post[]= 'select';
$m = 0;
foreach($categories as $category){
    if($m==0){
        $default = $category->slug;
        $m++;
    }
    $cat_post[$category->slug] = $category->name;
}

$wp_customize->add_setting('electrician_company_video_section_left_post_cat',array(
    'default'   => 'select',
    'sanitize_callback' => 'electrician_company_sanitize_select',
));
$wp_customize->add_control('electrician_company_video_section_left_post_cat' ,array(
    'type'    => 'select',
    'choices' => $cat_post,
    'label' => __('Select Category to display What We Do','electrician-company'),
    'section' => 'electrician_company_about_us_setting',
));