<?php 
// TESTIMONIALS SECTION START HERE 
/*============TESTIMONIALS SECTION PANEL============*/
$wp_customize->add_section(
    'lz_fitness_testimonials_section',
    array(
        'title'         => __( 'Testimonials Section', 'lz-fitness-premium' ),
        'panel'   => 'lz_fitness_premium_home_panel',
    )
);
    //ENABLE/DISABLE TESTIMONIALS SECTION
$wp_customize->add_setting(
    'lz_fitness_testimonials_section_disable',
    array(
        'sanitize_callback' => 'lz_fitness_sanitize_text',
        'default' => 'off'
    )
);
$wp_customize->add_control(
    new lz_fitness_Switch_Control(
        $wp_customize,
        'lz_fitness_testimonials_section_disable',
        array(
            'settings'      => 'lz_fitness_testimonials_section_disable',
            'section'       => 'lz_fitness_testimonials_section',
            'label'         => __( 'Disable Section', 'lz-fitness-premium' ),
            'on_off_label'  => array(
                'on' => __( 'Yes', 'lz-fitness-premium' ),
                'off' => __( 'No', 'lz-fitness-premium' )
            )   
        ) 
    )
);
backgroundManager($wp_customize, 'testimonials', 'lz_fitness_testimonials_section', $color='#82B440');

//backgroundManager($wp_customize, 'testimonials', 'lz_fitness_testimonials_section', $color='#fff');

$wp_customize->add_setting(
    'lz_fitness_testimonials_title_subtitle_heading',
    array(
        'sanitize_callback' => 'lz_fitness_sanitize_text',
    )
);
$wp_customize->add_control(
    new lz_fitness_Customize_Heading(
        $wp_customize,
       'lz_fitness_testimonials_title_subtitle_heading',
       array(
           'settings'      => 'lz_fitness_testimonials_title_subtitle_heading',
           'section'       => 'lz_fitness_testimonials_section',
           'label'         => __( 'Section Title', 'lz-fitness-premium' ),
       )
   )
);
$wp_customize->add_setting(
    'lz_fitness_testimonials_title',
    array(
       'sanitize_callback' => 'lz_fitness_sanitize_text',
        'default'           => __( 'CLIENT’s TESTIMONIALS', 'lz-fitness-premium' )
    )
);
$wp_customize->add_control(
    'lz_fitness_testimonials_title',
    array(
       'settings'      => 'lz_fitness_testimonials_title',
       'section'       => 'lz_fitness_testimonials_section',
       'type'          => 'text',
       'label'         => __( 'Title', 'lz-fitness-premium' )
    )
);
// Heading color
addColorPalatOption($wp_customize, 'lz_fitness_testimonials_TitleColor', 'lz_fitness_testimonials_section', 'Heading color', '#ffffff');
// Title color
addColorPalatOption($wp_customize, 'lz_fitness_testimonials_HeadingColor', 'lz_fitness_testimonials_section', 'Title color', '#82B440');
// Text color
addColorPalatOption($wp_customize, 'lz_fitness_testimonials_TextColor', 'lz_fitness_testimonials_section', 'Text color', '#424242');

if(!is_array($lzFitnessTesimonialsSingleChoice)){
    $wp_customize->add_setting('lz_fitness_testimonials_section_lbl', array('sanitize_callback'=>'lz_fitness_sanitize_text'));
    $wp_customize->add_control(
        new lz_fitness_Info_Text( 
            $wp_customize,
            'lz_fitness_testimonials_section_lbl',
            array(
                'settings'      => 'lz_fitness_testimonials_section_lbl',
                'section'       => 'lz_fitness_testimonials_section',
                'label'         => __( 'Note:', 'lz-fitness-premium' ), 
                'description'   => __( '<strong>Changes will not reflect unless you select the Testimonials.</strong> <br/>Please add the Testimonials from "Testimonials menu" and then select Testimonial to show information.', 'lz-fitness-premium' ),
            )
        )
    );
}
$wp_customize->add_setting('lz_fitness_premium_testimonials_section_lbl', array('sanitize_callback'=>'lz_fitness_sanitize_text'));
$wp_customize->add_control(
    new lz_fitness_Info_Text( 
        $wp_customize,
        'lz_fitness_premium_testimonials_section_lbl',
        array(
            'settings'      => 'lz_fitness_premium_testimonials_section_lbl',
            'section'       => 'lz_fitness_testimonials_section',
            'label'         => __( 'Note:', 'lz-fitness-premium' ), 
            'description'   => __( 'Just place the shortcode "[TESTIMONIALS]" in your page to list the Testimonials in a page ', 'lz-fitness-premium' ),
        )
    )
);
//TESTIMONIALS PAGES
for( $i = 1; $i < 5; $i++ ){
    $wp_customize->add_setting(
        'lz_fitness_testimonials_heading'.$i,
        array(
            'sanitize_callback' => 'lz_fitness_sanitize_text'
        )
    );
    $wp_customize->add_control(
        new lz_fitness_Customize_Heading(
            $wp_customize,
            'lz_fitness_testimonials_heading'.$i,
            array(
                'settings'      => 'lz_fitness_testimonials_heading'.$i,
                'section'       => 'lz_fitness_testimonials_section',
                'label'         => __( 'Client Testimonials ', 'lz-fitness-premium' ).$i,
            )
        )
    );
    $wp_customize->add_setting(
        'lz_fitness_testimonials_page'.$i,
        array(
            'sanitize_callback' => 'absint'
        )
    );
    $wp_customize->add_control(
        'lz_fitness_testimonials_page'.$i,
        array(
            'settings'      => 'lz_fitness_testimonials_page'.$i,
            'section'       => 'lz_fitness_testimonials_section',
            'type'=> 'select',
            'label'         => __( 'Select a Client Testimonials', 'lz-fitness-premium' ),
            'choices' => $lzFitnessTesimonialsSingleChoice,
        )
    );
}

// TESTIMONIALS SECTION END HERE 