<?php 
/**
 * Createing an about us pannel for customizer
 *
 */
// causes SECTION START HERE 
/*============causes SECTION PANEL============*/
$wp_customize->add_section(
	'lz_fitness_causes_section',
	array(
		'title'         => __( 'Our Events Section', 'gurukul' ),
		'panel'   => 'lz_fitness_premium_home_panel',
	)
);
// ENABLE/DISABLE TEAM SECTION
$wp_customize->add_setting(
	'lz_fitness_causes_section_disable',
	array(
		'sanitize_callback' => 'lz_fitness_sanitize_text',
		'default' => 'off'
	)
);
$wp_customize->add_control(
	new lz_fitness_Switch_Control(
		$wp_customize,
		'lz_fitness_causes_section_disable',
		array(
			'settings'      => 'lz_fitness_causes_section_disable',
			'section'       => 'lz_fitness_causes_section',
			'label'         => __( 'Disable Section', 'gurukul' ),
			'on_off_label'  => array(
				'on' => __( 'Yes', 'gurukul' ),
				'off' => __( 'No', 'gurukul' )
			)   
		)
	)
);
//backgroundManager($wp_customize, 'causes', 'lz_fitness_causes_section', $color='#00a3f4');
backgroundManager($wp_customize, 'causes', 'lz_fitness_causes_section', $color='#efefef');

$wp_customize->add_setting(
	'lz_fitness_causes_title_subtitle_heading',
	array(
		'sanitize_callback' => 'lz_fitness_sanitize_text',
	)
);
$wp_customize->add_control(
	new lz_fitness_Customize_Heading(
		$wp_customize,
		'lz_fitness_causes_title_subtitle_heading',
		array(
			'settings'      => 'lz_fitness_causes_title_subtitle_heading',
			'section'       => 'lz_fitness_causes_section',
			'label'         => __( 'Section Title & Sub Title', 'gurukul' ),
		)
	)
);

$wp_customize->add_setting(
	'lz_fitness_causes_title',
	array(
		'sanitize_callback' => 'lz_fitness_sanitize_text',
		'default'           => __( 'OUR EVENTS', 'gurukul' )
	)
);
$wp_customize->add_control(
	'lz_fitness_causes_title',
	array(
		'settings'      => 'lz_fitness_causes_title',
		'section'       => 'lz_fitness_causes_section', 
		'type'          => 'text',
		'label'         => __( 'Title for section', 'gurukul' )
	)
);
$wp_customize->add_setting(
	'lz_fitness_causes_sub_title',
	array(
		'sanitize_callback' => 'lz_fitness_sanitize_text',
		'default'           => __( 'There are many variations passes Lorem Ipsum available but the majority have suffered alteation some form.', 'gurukul' )
	)
);
$wp_customize->add_control(
	'lz_fitness_causes_sub_title',
	array(
		'settings'      => 'lz_fitness_causes_sub_title',
		'section'       => 'lz_fitness_causes_section',
		'type'          => 'textarea',
		'label'         => __( 'Sub Title', 'gurukul' )
	)
);


$wp_customize->add_setting('lz_fitness_causes_npp_heading',array('sanitize_callback' => 'lz_fitness_sanitize_text'));
$wp_customize->add_control(
	new lz_fitness_Customize_Heading(
		$wp_customize,
		'lz_fitness_causes_npp_heading',
		array(
			'settings'      => 'lz_fitness_causes_npp_heading',
			'section'       => 'lz_fitness_causes_section',
			'label'         => __( 'Number Of Events to show', 'gurukul' ),
		)
	)
);    
$wp_customize->add_setting('lz_fitness_causes_npp_count',array('sanitize_callback' => 'lz_fitness_sanitize_text','default' => 1));
$wp_customize->add_control(
	'lz_fitness_causes_npp_count',
	array(
		'settings'      => 'lz_fitness_causes_npp_count',
		'section'       => 'lz_fitness_causes_section',
		'type'          => 'select',
		'label'         => __( 'Number of Events to show', 'gurukul' ),
		'choices'=>array(1,2,3,4,5,6)
	)
);

// $wp_customize->add_setting(
//         'lz_fitness_causes_page',
//         array(
//             'sanitize_callback'=> 'absint',
//             'default' => __('causes Readmore Link', 'gurukul')
//         )
//     );
//     $wp_customize->add_control(
//         'lz_fitness_causes_page',
//         array(
//             'settings'=> 'lz_fitness_causes_page',
//             'section' => 'lz_fitness_causes_section',
//             'type'=>'select',
//             'label'=>__('Link to causes page', 'gurukul'),
//             'choices'=>$lz_fitness_page_choice
//         )
//     );

// causes PAGES
for( $i = 1; $i <= 6; $i++ ){
	$wp_customize->add_setting(
		'lz_fitness_causes_heading'.$i,
		array(
			'sanitize_callback' => 'lz_fitness_sanitize_text'
		)
	);
	$wp_customize->add_control(
		new lz_fitness_Customize_Heading(
			$wp_customize,
			'lz_fitness_causes_heading'.$i,
			array(
				'settings'      => 'lz_fitness_causes_heading'.$i,
				'section'       => 'lz_fitness_causes_section',
				'label'         => __( 'Event', 'gurukul' ).$i,
			)
		)
	);
	if(is_array($lzFitnesscausesSingleChoice)){
		$wp_customize->add_setting(
			'lz_fitness_causes_page'.$i,
			array(
				'sanitize_callback' => 'absint'
			)
		);
		$wp_customize->add_control(
			'lz_fitness_causes_page'.$i,
			array(
				'settings'      => 'lz_fitness_causes_page'.$i,
				'section'       => 'lz_fitness_causes_section',
				'type'=> 'select',
				'label'         => __( 'Select a event', 'gurukul' ),
				'choices' => $lzFitnesscausesSingleChoice,
			)
		);
	}else{
		$wp_customize->add_setting('lz_fitness_causes_section_lbl'.$i, array('sanitize_callback'=>'lz_fitness_sanitize_text'));
		$wp_customize->add_control(
			new lz_fitness_Info_Text( 
				$wp_customize,
				'lz_fitness_causes_section_lbl'.$i,
				array(
					'settings'		=> 'lz_fitness_causes_section_lbl'.$i,
					'section'		=> 'lz_fitness_causes_section',
					'label'			=> __( 'Note:', 'gurukul' ),	
					'description'	=> __( '<strong>Changes will not reflect unless you select the event.</strong> <br/>Please add the events from "events menu" and then select events to show information.', 'gurukul' ),
				)
			)
		);
	}
	// Title color
 addColorPalatOption($wp_customize, 'lz_fitness_causes_TitleColor', 'lz_fitness_causes_section', 'Text color', '#323030');

 // $wp_customize->add_setting(
 //        'lz_fitness_causes_page',
 //        array(
 //            'sanitize_callback'=> 'absint',
 //            'default' => __('causes Readmore Link', 'gurukul')
 //        )
 //    );
 //    $wp_customize->add_control(
 //        'lz_fitness_causes_page',
 //        array(
 //            'settings'=> 'lz_fitness_causes_page',
 //            'section' => 'lz_fitness_causes_section',
 //            'type'=>'select',
 //            'label'=>__('Link to causes page', 'gurukul'),
 //            'choices'=>$lz_fitness_page_choice
 //        )
 //    );
}

//FEATURED PAGES
for( $i = 1; $i <= 1; $i++ ){

    // $wp_customize->add_setting(
    //     'lz_fitness_causes_page_header'.$i,
    //     array(
    //         'sanitize_callback' => 'lz_fitness_sanitize_text'
    //     )
    // );
    // $wp_customize->add_control(
    //     new lz_fitness_Customize_Heading(
    //         $wp_customize,
    //         'lz_fitness_causes_page_header'.$i,
    //         array(
    //             'settings'      => 'lz_fitness_causes_page_header'.$i,
    //             'section'       => 'lz_fitness_causes_section',
    //             'label'         => __( 'Button Details '.$i, 'gurukul' )
    //         )
    //     )
    // );

   //  lzAddElement($wp_customize, 'causes_button_url_'.$i, 'lz_fitness_causes_section', $type = 'text', $label="Button Link".$i."&nbsp;", $callback ='esc_url', $default='Add link here');


	/*code for button text*/
	// $wp_customize->add_setting(
 //        'lz_fitness_causes_button'.$i,
 //        array(
 //            'sanitize_callback'=>'lz_fitness_sanitize_text',
 //            'default'=> __('View all causes', 'gurukul')
 //        )
 //    );
 //    $wp_customize->add_control(
 //        'lz_fitness_causes_button'.$i,
 //        array(
 //            'settings' =>'lz_fitness_causes_button'.$i,
 //            'section' => 'lz_fitness_causes_section',
 //            'type'=> 'text',
 //            'label'=> __('Button Text', 'gurukul')
 //        )
 //    );

}
// TEAM SECTION END HERE 
// Heading color
addColorPalatOption($wp_customize, 'lz_fitness_causes_HeadingColor', 'lz_fitness_causes_section', 'Heading color', '#ffffff');
addColorPalatOption($wp_customize, 'lz_fitness_causes_SpanHeadingColor', 'lz_fitness_causes_section', 'Sub Heading color', '#2b2b2b');
// Heading color
    addColorPalatOption($wp_customize, 'lz_fitness_causes_spanBackgroundColor', 'lz_fitness_causes_section', 'Heading Background color', '#69489d');
// outline color 
    addColorPalatOption($wp_customize, 'lz_fitness_causes_spanoulineHeadingColor', 'lz_fitness_causes_section', 'Outline Color', '#69489d');

// Text color
addColorPalatOption($wp_customize, 'lz_fitness_causes_TitleColor', 'lz_fitness_causes_section', 'Title color', '#212121');

// Text color
addColorPalatOption($wp_customize, 'lz_fitness_causes_TextColor', 'lz_fitness_causes_section', 'Text color', '#212121');
// Text color
addColorPalatOption($wp_customize, 'lz_fitness_causes_DateTextColor', 'lz_fitness_causes_section', 'Date & Day Text color', '#69489d');
// Text color
//addColorPalatOption($wp_customize, 'lz_fitness_causes_DayTextColor', 'lz_fitness_causes_section', 'Day Text color', '#d5337d');
// Text color
addColorPalatOption($wp_customize, 'lz_fitness_causes_spanDayTextColor', 'lz_fitness_causes_section', 'Year & Timing Text color', '#a1a1a1');


$wp_customize->add_setting(
    'featurbtntxt',
    array(
        'sanitize_callback'=>'lz_fitness_sanitize_text',
        'default'=> __('Read More', 'lz-fitness-premium')
    )
);
$wp_customize->add_control(
    'featurbtntxt',
    array(
        'settings' =>'featurbtntxt',
        'section' => 'lz_fitness_causes_section',
        'type'=> 'text',
        'label'=> __('Button Text', 'lz-fitness-premium')
    )
);
// Text color
addColorPalatOption($wp_customize, 'lz_fitness_causes_ButtonTextColor', 'lz_fitness_causes_section', 'Button Text color', '#69489d');
// Text color
addColorPalatOption($wp_customize, 'lz_fitness_causes_ButtonborderColor', 'lz_fitness_causes_section', 'Button Border color', '#69489d');
// Text color
addColorPalatOption($wp_customize, 'lz_fitness_causes_BoxColor', 'lz_fitness_causes_section', 'Event Box Background color', '#ffffff');

// Text color
addColorPalatOption($wp_customize, 'lz_fitness_causes_ButtonHoverColor', 'lz_fitness_causes_section', 'Button Hover Background Color', '#69489d');
// Text color
addColorPalatOption($wp_customize, 'lz_fitness_causes_ButtonHovertextColor', 'lz_fitness_causes_section', 'Button Hover Text Color', '#ffffff');