<?php
/**
 * Sidebar Spacing Options for our theme.
 *
 * @package     Astra
 * @author      Brainstorm Force
 * @copyright   Copyright (c) 2015, Brainstorm Force
 * @link        http://www.brainstormforce.com
 * @since       Astra 1.2.0
 */

if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

/**
 * Option: Divider
 */
$wp_customize->add_control(
	new Astra_Control_Heading(
		$wp_customize, ASTRA_THEME_SETTINGS . '[divider-section-sidebar-spacing]', array(
			'type'     => 'ast-heading',
			'section'  => 'section-sidebars',
			'label'    => __( 'Spacing', 'astra-addon' ),
			'priority' => 25,
			'settings' => array(),
		)
	)
);
/**
 * Option - Sidebar Space
 */
$wp_customize->add_setting(
	ASTRA_THEME_SETTINGS . '[sidebar-outside-spacing]', array(
		'default'           => astra_get_option( 'sidebar-outside-spacing' ),
		'type'              => 'option',
		'transport'         => 'postMessage',
		'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_responsive_spacing' ),
	)
);
$wp_customize->add_control(
	new Astra_Control_Responsive_Spacing(
		$wp_customize, ASTRA_THEME_SETTINGS . '[sidebar-outside-spacing]', array(
			'type'           => 'ast-responsive-spacing',
			'section'        => 'section-sidebars',
			'priority'       => 25,
			'label'          => __( 'Space Outside Sidebar', 'astra-addon' ),
			'linked_choices' => true,
			'unit_choices'   => array( 'px', 'em', '%' ),
			'choices'        => array(
				'top'    => __( 'Top', 'astra-addon' ),
				'right'  => __( 'Right', 'astra-addon' ),
				'bottom' => __( 'Bottom', 'astra-addon' ),
				'left'   => __( 'Left', 'astra-addon' ),
			),
		)
	)
);

/**
 * Option - Two Boxed Sidebar Space
 */
$wp_customize->add_setting(
	ASTRA_THEME_SETTINGS . '[sidebar-inside-spacing]', array(
		'default'           => astra_get_option( 'sidebar-inside-spacing' ),
		'type'              => 'option',
		'transport'         => 'postMessage',
		'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_responsive_spacing' ),
	)
);
$wp_customize->add_control(
	new Astra_Control_Responsive_Spacing(
		$wp_customize, ASTRA_THEME_SETTINGS . '[sidebar-inside-spacing]', array(
			'type'           => 'ast-responsive-spacing',
			'section'        => 'section-sidebars',
			'priority'       => 25,
			'label'          => __( 'Space Inside Sidebar', 'astra-addon' ),
			'linked_choices' => true,
			'unit_choices'   => array( 'px', 'em', '%' ),
			'choices'        => array(
				'top'    => __( 'Top', 'astra-addon' ),
				'right'  => __( 'Right', 'astra-addon' ),
				'bottom' => __( 'Bottom', 'astra-addon' ),
				'left'   => __( 'Left', 'astra-addon' ),
			),
		)
	)
);
