<?php
/**
* Layouts Settings.
*
* @package Digital Media
*/

$digital_media_default = digital_media_get_default_theme_options();

// Layout Section.
$wp_customize->add_section( 'digital_media_layout_setting',
	array(
	'title'      => esc_html__( 'Sidebar Settings', 'digital-media' ),
	'priority'   => 20,
	'capability' => 'edit_theme_options',
	'panel'      => 'digital_media_theme_option_panel',
	)
);

$wp_customize->add_setting( 'digital_media_global_sidebar_layout',
    array(
    'default'           => $digital_media_default['digital_media_global_sidebar_layout'],
    'capability'        => 'edit_theme_options',
    'sanitize_callback' => 'digital_media_sanitize_sidebar_option',
    )
);
$wp_customize->add_control( 'digital_media_global_sidebar_layout',
    array(
    'label'       => esc_html__( 'Global Sidebar Layout', 'digital-media' ),
    'section'     => 'digital_media_layout_setting',
    'type'        => 'select',
    'choices'     => array(
        'right-sidebar' => esc_html__( 'Right Sidebar', 'digital-media' ),
        'left-sidebar'  => esc_html__( 'Left Sidebar', 'digital-media' ),
        'no-sidebar'    => esc_html__( 'No Sidebar', 'digital-media' ),
        ),
    )
);

$wp_customize->add_setting('digital_media_page_sidebar_layout', array(
    'default'           => $digital_media_default['digital_media_global_sidebar_layout'],
    'capability'        => 'edit_theme_options',
    'sanitize_callback' => 'digital_media_sanitize_sidebar_option',
));

$wp_customize->add_control('digital_media_page_sidebar_layout', array(
    'label'       => esc_html__('Single Page Sidebar Layout', 'digital-media'),
    'section'     => 'digital_media_layout_setting',
    'type'        => 'select',
    'choices'     => array(
        'right-sidebar' => esc_html__('Right Sidebar', 'digital-media'),
        'left-sidebar'  => esc_html__('Left Sidebar', 'digital-media'),
        'no-sidebar'    => esc_html__('No Sidebar', 'digital-media'),
    ),
));

$wp_customize->add_setting('digital_media_post_sidebar_layout', array(
    'default'           => $digital_media_default['digital_media_global_sidebar_layout'],
    'capability'        => 'edit_theme_options',
    'sanitize_callback' => 'digital_media_sanitize_sidebar_option',
));

$wp_customize->add_control('digital_media_post_sidebar_layout', array(
    'label'       => esc_html__('Single Post Sidebar Layout', 'digital-media'),
    'section'     => 'digital_media_layout_setting',
    'type'        => 'select',
    'choices'     => array(
        'right-sidebar' => esc_html__('Right Sidebar', 'digital-media'),
        'left-sidebar'  => esc_html__('Left Sidebar', 'digital-media'),
        'no-sidebar'    => esc_html__('No Sidebar', 'digital-media'),
    ),
));

$wp_customize->add_setting('digital_media_sticky_sidebar',
    array(
        'default'           => true,
        'capability' => 'edit_theme_options',
        'sanitize_callback' => 'digital_media_sanitize_checkbox',
    )
);
$wp_customize->add_control('digital_media_sticky_sidebar',
    array(
        'label' => esc_html__('Enable/Disable Sticky Sidebar', 'digital-media'),
        'section' => 'digital_media_layout_setting',
        'type' => 'checkbox',
    )
);