<?php
/**
* Layouts Settings.
*
* @package Car Booking
*/

$car_booking_default = car_booking_get_default_theme_options();

// Layout Section.
$wp_customize->add_section( 'car_booking_layout_setting',
	array(
	'title'      => esc_html__( 'Sidebar Settings', 'car-booking' ),
	'priority'   => 20,
	'capability' => 'edit_theme_options',
	'panel'      => 'car_booking_theme_option_panel',
	)
);

$wp_customize->add_setting( 'car_booking_global_sidebar_layout',
    array(
    'default'           => $car_booking_default['car_booking_global_sidebar_layout'],
    'capability'        => 'edit_theme_options',
    'sanitize_callback' => 'car_booking_sanitize_sidebar_option',
    )
);
$wp_customize->add_control( 'car_booking_global_sidebar_layout',
    array(
    'label'       => esc_html__( 'Global Sidebar Layout', 'car-booking' ),
    'section'     => 'car_booking_layout_setting',
    'type'        => 'select',
    'choices'     => array(
        'right-sidebar' => esc_html__( 'Right Sidebar', 'car-booking' ),
        'left-sidebar'  => esc_html__( 'Left Sidebar', 'car-booking' ),
        'no-sidebar'    => esc_html__( 'No Sidebar', 'car-booking' ),
        ),
    )
);

$wp_customize->add_setting('car_booking_page_sidebar_layout', array(
    'default'           => $car_booking_default['car_booking_global_sidebar_layout'],
    'capability'        => 'edit_theme_options',
    'sanitize_callback' => 'car_booking_sanitize_sidebar_option',
));

$wp_customize->add_control('car_booking_page_sidebar_layout', array(
    'label'       => esc_html__('Single Page Sidebar Layout', 'car-booking'),
    'section'     => 'car_booking_layout_setting',
    'type'        => 'select',
    'choices'     => array(
        'right-sidebar' => esc_html__('Right Sidebar', 'car-booking'),
        'left-sidebar'  => esc_html__('Left Sidebar', 'car-booking'),
        'no-sidebar'    => esc_html__('No Sidebar', 'car-booking'),
    ),
));

$wp_customize->add_setting('car_booking_post_sidebar_layout', array(
    'default'           => $car_booking_default['car_booking_global_sidebar_layout'],
    'capability'        => 'edit_theme_options',
    'sanitize_callback' => 'car_booking_sanitize_sidebar_option',
));

$wp_customize->add_control('car_booking_post_sidebar_layout', array(
    'label'       => esc_html__('Single Post Sidebar Layout', 'car-booking'),
    'section'     => 'car_booking_layout_setting',
    'type'        => 'select',
    'choices'     => array(
        'right-sidebar' => esc_html__('Right Sidebar', 'car-booking'),
        'left-sidebar'  => esc_html__('Left Sidebar', 'car-booking'),
        'no-sidebar'    => esc_html__('No Sidebar', 'car-booking'),
    ),
));

$wp_customize->add_setting('car_booking_sticky_sidebar',
    array(
        'default'           => true,
        'capability' => 'edit_theme_options',
        'sanitize_callback' => 'car_booking_sanitize_checkbox',
    )
);
$wp_customize->add_control('car_booking_sticky_sidebar',
    array(
        'label' => esc_html__('Enable/Disable Sticky Sidebar', 'car-booking'),
        'section' => 'car_booking_layout_setting',
        'type' => 'checkbox',
    )
);