<?php
/**
* Layouts Settings.
*
* @package Local Supermarket
*/

$local_supermarket_default = local_supermarket_get_default_theme_options();

// Layout Section.
$wp_customize->add_section( 'local_supermarket_layout_setting',
	array(
	'title'      => esc_html__( 'Sidebar Settings', 'local-supermarket' ),
	'priority'   => 20,
	'capability' => 'edit_theme_options',
	'panel'      => 'local_supermarket_theme_option_panel',
	)
);

$wp_customize->add_setting( 'local_supermarket_global_sidebar_layout',
    array(
    'default'           => $local_supermarket_default['local_supermarket_global_sidebar_layout'],
    'capability'        => 'edit_theme_options',
    'sanitize_callback' => 'local_supermarket_sanitize_sidebar_option',
    )
);
$wp_customize->add_control( 'local_supermarket_global_sidebar_layout',
    array(
    'label'       => esc_html__( 'Global Sidebar Layout', 'local-supermarket' ),
    'section'     => 'local_supermarket_layout_setting',
    'type'        => 'select',
    'choices'     => array(
        'right-sidebar' => esc_html__( 'Right Sidebar', 'local-supermarket' ),
        'left-sidebar'  => esc_html__( 'Left Sidebar', 'local-supermarket' ),
        'no-sidebar'    => esc_html__( 'No Sidebar', 'local-supermarket' ),
        ),
    )
);

$wp_customize->add_setting('local_supermarket_page_sidebar_layout', array(
    'default'           => $local_supermarket_default['local_supermarket_global_sidebar_layout'],
    'capability'        => 'edit_theme_options',
    'sanitize_callback' => 'local_supermarket_sanitize_sidebar_option',
));

$wp_customize->add_control('local_supermarket_page_sidebar_layout', array(
    'label'       => esc_html__('Single Page Sidebar Layout', 'local-supermarket'),
    'section'     => 'local_supermarket_layout_setting',
    'type'        => 'select',
    'choices'     => array(
        'right-sidebar' => esc_html__('Right Sidebar', 'local-supermarket'),
        'left-sidebar'  => esc_html__('Left Sidebar', 'local-supermarket'),
        'no-sidebar'    => esc_html__('No Sidebar', 'local-supermarket'),
    ),
));

$wp_customize->add_setting('local_supermarket_post_sidebar_layout', array(
    'default'           => $local_supermarket_default['local_supermarket_global_sidebar_layout'],
    'capability'        => 'edit_theme_options',
    'sanitize_callback' => 'local_supermarket_sanitize_sidebar_option',
));

$wp_customize->add_control('local_supermarket_post_sidebar_layout', array(
    'label'       => esc_html__('Single Post Sidebar Layout', 'local-supermarket'),
    'section'     => 'local_supermarket_layout_setting',
    'type'        => 'select',
    'choices'     => array(
        'right-sidebar' => esc_html__('Right Sidebar', 'local-supermarket'),
        'left-sidebar'  => esc_html__('Left Sidebar', 'local-supermarket'),
        'no-sidebar'    => esc_html__('No Sidebar', 'local-supermarket'),
    ),
));

$wp_customize->add_setting('local_supermarket_sticky_sidebar',
    array(
        'default'           => true,
        'capability' => 'edit_theme_options',
        'sanitize_callback' => 'local_supermarket_sanitize_checkbox',
    )
);
$wp_customize->add_control('local_supermarket_sticky_sidebar',
    array(
        'label' => esc_html__('Enable/Disable Sticky Sidebar', 'local-supermarket'),
        'section' => 'local_supermarket_layout_setting',
        'type' => 'checkbox',
    )
);