<?php
/**
* Header Banner Options.
*
* @package Omega Hair Salon
*/

$omega_hair_salon_default = omega_hair_salon_get_default_theme_options();
$omega_hair_salon_post_category_list = omega_hair_salon_post_category_list();

$wp_customize->add_section( 'omega_hair_salon_header_banner_setting',
    array(
    'title'      => esc_html__( 'Slider Settings', 'omega-hair-salon' ),
    'priority'   => 10,
    'capability' => 'edit_theme_options',
    'panel'      => 'omega_hair_salon_theme_home_pannel',
    )
);

// Show/Hide Site Logo
$wp_customize->add_setting('omega_hair_salon_display_logo', array(
    'default'           => false,
    'capability'        => 'edit_theme_options',
    'sanitize_callback' => 'omega_hair_salon_sanitize_checkbox',
));
$wp_customize->add_control('omega_hair_salon_display_logo', array(
    'label'    => esc_html__('Enable / Disable Site Logo', 'omega-hair-salon'),
    'section'  => 'title_tagline',
    'type'     => 'checkbox',
));

// Show/Hide Site Title
$wp_customize->add_setting('omega_hair_salon_display_title', array(
    'default'           => true,
    'capability'        => 'edit_theme_options',
    'sanitize_callback' => 'omega_hair_salon_sanitize_checkbox',
));
$wp_customize->add_control('omega_hair_salon_display_title', array(
    'label'    => esc_html__('Enable / Disable Site Title', 'omega-hair-salon'),
    'section'  => 'title_tagline',
    'type'     => 'checkbox',
));

// Show/Hide Site Tagline
$wp_customize->add_setting('omega_hair_salon_display_header_text',
    array(
        'default'           => false,
        'capability' => 'edit_theme_options',
        'sanitize_callback' => 'omega_hair_salon_sanitize_checkbox',
    )
);
$wp_customize->add_control('omega_hair_salon_display_header_text',
    array(
        'label' => esc_html__('Enable / Disable Site Tagline', 'omega-hair-salon'),
        'section' => 'title_tagline',
        'type' => 'checkbox',
    )
);

$wp_customize->add_setting('omega_hair_salon_header_banner',
    array(
        'default' => $omega_hair_salon_default['omega_hair_salon_header_banner'],
        'capability' => 'edit_theme_options',
        'sanitize_callback' => 'omega_hair_salon_sanitize_checkbox',
    )
);
$wp_customize->add_control('omega_hair_salon_header_banner',
    array(
        'label' => esc_html__('Enable Slider', 'omega-hair-salon'),
        'section' => 'omega_hair_salon_header_banner_setting',
        'type' => 'checkbox',
    )
);

$wp_customize->add_setting('omega_hair_salon_banner_left_image',
    array(
        'default' => $omega_hair_salon_default['omega_hair_salon_banner_left_image'],
        'sanitize_callback' => 'esc_url_raw',
    )
);
$wp_customize->add_control(
    new WP_Customize_Image_Control( $wp_customize,'omega_hair_salon_banner_left_image',
        array(
            'label' => __('Slider Left Image ','omega-hair-salon'),
            'section' => 'omega_hair_salon_header_banner_setting',
            'settings' => 'omega_hair_salon_banner_left_image',
        )
    )
);

$wp_customize->add_setting( 'omega_hair_salon_banner_short_heading',
    array(
    'default'           => $omega_hair_salon_default['omega_hair_salon_banner_short_heading'],
    'capability'        => 'edit_theme_options',
    'sanitize_callback' => 'sanitize_text_field',
    )
);
$wp_customize->add_control( 'omega_hair_salon_banner_short_heading',
    array(
    'label'    => esc_html__( 'Short Heading', 'omega-hair-salon' ),
    'section'  => 'omega_hair_salon_header_banner_setting',
    'type'     => 'text',
    )
);

$wp_customize->add_setting( 'omega_hair_salon_header_banner_cat',
    array(
    'default'           => 'Slider',
    'capability'        => 'edit_theme_options',
    'sanitize_callback' => 'omega_hair_salon_sanitize_select',
    )
);
$wp_customize->add_control( 'omega_hair_salon_header_banner_cat',
    array(
    'label'       => esc_html__( 'Slider Post Category', 'omega-hair-salon' ),
    'section'     => 'omega_hair_salon_header_banner_setting',
    'type'        => 'select',
    'choices'     => $omega_hair_salon_post_category_list,
    )
);

// Pricing Plans Settings

$wp_customize->add_section( 'omega_hair_salon_pricing_plans_setting',
    array(
    'title'      => esc_html__( 'Pricing Plans Settings', 'omega-hair-salon' ),
    'priority'   => 10,
    'capability' => 'edit_theme_options',
    'panel'      => 'omega_hair_salon_theme_home_pannel',
    )
);

$wp_customize->add_setting( 'omega_hair_salon_pricing_plans_section_title',
    array(
    'default'           => $omega_hair_salon_default['omega_hair_salon_pricing_plans_section_title'],
    'capability'        => 'edit_theme_options',
    'sanitize_callback' => 'sanitize_text_field',
    )
);
$wp_customize->add_control( 'omega_hair_salon_pricing_plans_section_title',
    array(
    'label'    => esc_html__( 'Price Title', 'omega-hair-salon' ),
    'section'  => 'omega_hair_salon_pricing_plans_setting',
    'type'     => 'text',
    )
);

$wp_customize->add_setting( 'omega_hair_salon_pricing_plans_section_sub_title',
    array(
    'default'           => $omega_hair_salon_default['omega_hair_salon_pricing_plans_section_sub_title'],
    'capability'        => 'edit_theme_options',
    'sanitize_callback' => 'sanitize_text_field',
    )
);
$wp_customize->add_control( 'omega_hair_salon_pricing_plans_section_sub_title',
    array(
    'label'    => esc_html__( 'Price Heading', 'omega-hair-salon' ),
    'section'  => 'omega_hair_salon_pricing_plans_setting',
    'type'     => 'text',
    )
);


for($i=1; $i<= 2; $i++) {

    $wp_customize->add_setting('omega_hair_salon_price_list_tab_title'.$i,array(
      'default' => 'Collection'.$i,
      'sanitize_callback' => 'sanitize_text_field',
    ));
    $wp_customize->add_control('omega_hair_salon_price_list_tab_title'.$i,array(
      'label' => __('Price Tab Heading','omega-hair-salon').$i,
      'section' => 'omega_hair_salon_pricing_plans_setting',
      'setting' => 'omega_hair_salon_price_list_tab_title'.$i,
      '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('omega_hair_salon_category_tab1',array(
        'default'   => 'uncategorized',
        'sanitize_callback' => 'omega_hair_salon_sanitize_select',
    ));
    $wp_customize->add_control('omega_hair_salon_category_tab1' ,array(
        'type'    => 'select',
        'choices' => $cat_post,
        'label' => __('Select Category to display Pricing Plans','omega-hair-salon'),
        'section' => 'omega_hair_salon_pricing_plans_setting',
    ));

    $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('omega_hair_salon_category_tab2',array(
        'default'   => 'uncategorized',
        'sanitize_callback' => 'omega_hair_salon_sanitize_select',
    ));
    $wp_customize->add_control('omega_hair_salon_category_tab2',array(
        'type'    => 'select',
        'choices' => $cat_post,
        'label' => __('Select Category to display Pricing Plans','omega-hair-salon'),
        'section' => 'omega_hair_salon_pricing_plans_setting',
    ));

    $wp_customize->add_setting('omega_hair_salon_tab_section_right_image',
        array(
            'default'           => $omega_hair_salon_default['omega_hair_salon_tab_section_right_image'],
            'sanitize_callback' => 'esc_url_raw',
        )
    );
    $wp_customize->add_control(
        new WP_Customize_Image_Control( $wp_customize,'omega_hair_salon_tab_section_right_image',
            array(
                'label' => __('Price Right Image ','omega-hair-salon'),
                'section' => 'omega_hair_salon_pricing_plans_setting',
                'settings' => 'omega_hair_salon_tab_section_right_image',
            )
        )
    );