<?php 
/**
 * Createing GALLERY pannel for customizer
 *
 */
// gallery SECTION START HERE 
$wp_customize->add_section(
	'gallery_section',
	array(
		'title'         => __( 'Gallery Section', 'Luzuk' ),
		'panel'   => 'lz_fitness_premium_home_panel',
	)
);
// ENABLE/DISABLE gallery SECTION
$wp_customize->add_setting(
	'gallery_section_disable',
	array(
		'sanitize_callback' => 'lz_fitness_sanitize_text',
		'default' => 'off'
	)
);
$wp_customize->add_control(
	new lz_fitness_Switch_Control(
		$wp_customize,
		'gallery_section_disable',
		array(
			'settings'      => 'gallery_section_disable',
			'section'       => 'gallery_section',
			'label'         => __( 'Disable Section', 'Luzuk' ),
			'on_off_label'  => array(
				'on' => __( 'Yes', 'Luzuk' ),
				'off' => __( 'No', 'Luzuk' )
			)   
		)
	)
);


backgroundManager($wp_customize, 'gallery', 'gallery_section', $color='#fff', get_template_directory_uri().'/images/default-gray.png', 'img');

addColorPalatOption($wp_customize, 'GallerySectionBrss_color', 'gallery_section', 'Section Border Color', '#2b2b2b');

lzCustomLable($wp_customize, 'gallerysection_padding', 'gallery_section', ' Section Padding Setting:');

$wp_customize->add_setting(
    'sec_gallerysectionTpadding',
    array(
        'sanitize_callback' => 'lz_fitness_sanitize_text',
        'default'           => __( '2em', 'Luzuk' )
    )
);
$wp_customize->add_control(
    'sec_gallerysectionTpadding',
    array(
        'settings'      => 'sec_gallerysectionTpadding',
        'section'       => 'gallery_section',
        'type'          => 'text',
        'label'         => __( 'Section Top Padding', 'Luzuk' )
    )
);
$wp_customize->add_setting(
    'sec_gallerysectionBpadding',
    array(
        'sanitize_callback' => 'lz_fitness_sanitize_text',
        'default'           => __( '6em', 'Luzuk' )
    )
);
$wp_customize->add_control(
    'sec_gallerysectionBpadding',
    array(
        'settings'      => 'sec_gallerysectionBpadding',
        'section'       => 'gallery_section',
        'type'          => 'text',
        'label'         => __( 'Section Bottom Padding', 'Luzuk' )
    )
);


$wp_customize->add_setting(
	'gallery_title_subtitle_heading',
	array(
		'sanitize_callback' => 'lz_fitness_sanitize_text',
	)
);
$wp_customize->add_control(
	new lz_fitness_Customize_Heading(
		$wp_customize,
		'gallery_title_subtitle_heading',
		array(
			'settings'      => 'gallery_title_subtitle_heading',
			'section'       => 'gallery_section',
			'label'         => __( 'Section Title & Text', 'Luzuk' ),
		)
	)
);


     $wp_customize->add_setting(
        'gallery_maintitle',
        array(
            'sanitize_callback' => 'lz_fitness_sanitize_text',
            'default'           => __( 'Our Gallery', 'lz_fitness Premium' )
        )
    );
    $wp_customize->add_control(
        'gallery_maintitle',
        array(
            'settings'      => 'gallery_maintitle',
            'section'       => 'gallery_section',
            'type'          => 'text',
            'label'         => __( 'Heading for section', 'lz_fitness Premium' )
        )
    );

addColorPalatOption($wp_customize, 'GallerySectionT_color', 'gallery_section', 'Select Section Heading color', '#2b2b2b');


 $wp_customize->add_setting(
        'gallery_text',
        array(
            'sanitize_callback' => 'lz_fitness_sanitize_text',
            'default'           => __( 'Lorem ipsum dolor sit amet', 'lz_fitness Premium' )
        )
    );
    $wp_customize->add_control(
        'gallery_text',
        array(
            'settings'      => 'gallery_text',
            'section'       => 'gallery_section',
            'type'          => 'textarea',
            'label'         => __( 'Section Text', 'lz_fitness Premium' )
        )
    );

      // Section Text color
    addColorPalatOption($wp_customize, 'GallerySectionSubT_color', 'gallery_section', 'Section Text color', '#888888');


$wp_customize->add_setting('galleryshortcode_lbl', array('sanitize_callback'=>'lz_fitness_sanitize_text'));
$wp_customize->add_control(
    new lz_fitness_Info_Text( 
        $wp_customize,
        'galleryshortcode_lbl',
        array(
            'settings'      => 'galleryshortcode_lbl',
            'section'       => 'gallery_section',
            'label'         => __( 'Note:', 'lz_fitness Premium' ),    
            'description'   => __( 'Just place the shortcode "[GALLERY]" in your page to list the Gallery in a page', 'lz_fitness Premium' ),
        )
    )
);

$wp_customize->add_setting('galleryimgcode_lbl', array('sanitize_callback'=>'lz_fitness_sanitize_text'));
$wp_customize->add_control(
    new lz_fitness_Info_Text( 
        $wp_customize,
        'galleryimgcode_lbl',
        array(
            'settings'      => 'galleryimgcode_lbl',
            'section'       => 'gallery_section',
            'label'         => __( 'Gallery Image Note:', 'lz_fitness Premium' ),    
            'description'   => __( 'Kindly add same size of Gallery images.', 'lz_fitness Premium' ),
        )
    )
);


// GALLERY PAGES
$lzFitnessGallerySingleChoice[] = 'select';
for( $i = 1; $i <= 12; $i++ ){
	$wp_customize->add_setting(
		'gallery_heading'.$i,
		array(
			'sanitize_callback' => 'lz_fitness_sanitize_text'
		)
	);
	$wp_customize->add_control(
		new lz_fitness_Customize_Heading(
			$wp_customize,
			'gallery_heading'.$i,
			array(
				'settings'      => 'gallery_heading'.$i,
				'section'       => 'gallery_section',
				'label'         => __( ' Image ', 'Luzuk' ).$i, 
			)
		)
	);
	if(is_array($lzFitnessGallerySingleChoice)){
		$wp_customize->add_setting(
			'gallery_page'.$i,
			array(
				'sanitize_callback' => 'absint'
			)
		);
		$wp_customize->add_control(
			'gallery_page'.$i,
			array(
				'settings'      => 'gallery_page'.$i,
				'section'       => 'gallery_section',
				'type'=> 'select',
				'label'         => __( 'Select a Gallery Image', 'Luzuk' ),
				'choices' => $lzFitnessGallerySingleChoice,
			)
		);
	}else{
		$wp_customize->add_setting('gallery_section_lbl'.$i, array('sanitize_callback'=>'lz_fitness_sanitize_text'));
		$wp_customize->add_control(
			new lz_fitness_Info_Text( 
				$wp_customize,
				'gallery_section_lbl'.$i,
				array(
					'settings'		=> 'gallery_section_lbl'.$i,
					'section'		=> 'gallery_section',
					'label'			=> __( 'Note:', 'Luzuk' ),	
					'description'	=> __( '<strong>Changes will not reflect unless you select the gallery Image.</strong> <br/>Please add the gallary gallery from "Gallary menu" and then select gallary Image to show information.', 'Luzuk' ),
				)
			)
		);
	}
}
addColorPalatOption($wp_customize, 'GallerySectionImgOverlay_color', 'gallery_section', 'Image Hover Overlay Background Color', '#7d52f9');
addColorPalatOption($wp_customize, 'GallerySectionImgOverlayIcon_color', 'gallery_section', 'Image Hover Overlay Icon Color', '#ffffff');