<?php
/**
 * Section Sortable options
 *
 * @package Theme Palace
 * @subpackage Raise Charity Pro
 * @since Raise Charity Pro 1.0.0
 */

// Add sidebar section
$wp_customize->add_section( 'raise_charity_pro_sortable', array(
	'title'               => esc_html__('Homepage Sortable','raise-charity-pro'),
	'description'         => esc_html__( 'Homepage Sortable options.', 'raise-charity-pro' ),
	'panel'               => 'raise_charity_pro_theme_options_panel',
) );

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

	$wp_customize->add_control( new raise_charity_Pro_Customize_Sortable_Control ( $wp_customize, 'raise_charity_pro_theme_options['.$list.'_sortable]', array(
		'label'               => esc_html__( 'Sort Homepage', 'raise-charity-pro' ),
		'description'         => esc_html__( 'Drag and Drop to sort the sections according to your preference.', 'raise-charity-pro' ),
		'section'             => 'raise_charity_pro_sortable',
		'type'                => 'sortable',
		'choices'			  => raise_charity_pro_sortable_sections(),
		'active_callback'	  => 'raise_charity_pro_is_'.$list.'_layout'

	) ) );
}
