<?php 

$wp_customize->add_section( 'enlightme_pro_home_layout', array(
	'title'             => esc_html__( 'Home Page Layout','enlightme-pro' ),
	'description'       => esc_html__( 'Home Page Layout option.', 'enlightme-pro' ),
	'panel'             => 'enlightme_pro_front_page_panel',
) );


$wp_customize->add_setting( 'enlightme_pro_theme_options[home_layout]', array(
		'default'           => $options['home_layout'],
		'sanitize_callback' => 'enlightme_pro_sanitize_select',
		'transport'			=> 'refresh'
	) );

$wp_customize->add_control( 'enlightme_pro_theme_options[home_layout]', array(
	'type'				=> 'radio',
	'label'             => esc_html__( 'Select Homepage layout', 'enlightme-pro' ),
	'section'           => 'enlightme_pro_home_layout',
	'choices'				 => array( 
		'default-design'     => esc_html__( 'Default Design', 'enlightme-pro' ),
		'second-design'      => esc_html__( 'Shop Design', 'enlightme-pro' ),
		'third-design'       => esc_html__( 'Blog Design', 'enlightme-pro' ),
		'fourth-design'      => esc_html__( 'Business Design', 'enlightme-pro' ),
		'fifth-design'       => esc_html__( 'Medical Design', 'enlightme-pro' ),
		)
) );

foreach ( array( 'default', 'second', 'third', 'fourth', 'fifth' ) as $list) {
	// Site layout setting and control.
	$wp_customize->add_setting( 'enlightme_pro_theme_options['.$list.'_sortable]', array(
		'default'			  => $options[$list.'_sortable'],
		'sanitize_callback'   => 'enlightme_pro_sanitize_sortable',
	) );

	$wp_customize->add_control( new Enlightme_Pro_Customize_Sortable_Control ( $wp_customize, 'enlightme_pro_theme_options['.$list.'_sortable]', array(
		'label'               => esc_html__( 'Sortable Homepage', 'enlightme-pro' ),
		'description'         => esc_html__( 'Drag and Drop to sort the sections according to your preference.', 'enlightme-pro' ),
		'section'             => 'enlightme_pro_home_layout',
		'type'                => 'sortable',
		'choices'			  => enlightme_pro_sortable_sections(),
		'active_callback'	  => 'enlightme_pro_is_'.$list.'_layout'

	) ) );
}