<?php  
// TESTIMONIALS SECTION START HERE 

$wp_customize->add_section(
    'testimonials_area',
    array(
        'title'         => __( 'Testimonial Section', 'luzuk Premium' ),
        'panel'   => 'luzuk_premium_home_panel',
    )
);

    //ENABLE/DISABLE TESTIMONIALS SECTION
$wp_customize->add_setting(
    'testimonials_area_disable',
    array(
        'sanitize_callback' => 'luzuk_sanitize_text',
        'default' => 'off'
    )
);
$wp_customize->add_control(
    new luzuk_Switch_Control(
        $wp_customize,
        'testimonials_area_disable',
        array(
            'settings'      => 'testimonials_area_disable',
            'section'       => 'testimonials_area',
            'label'         => __( 'Disable Section', 'luzuk Premium' ),
            'on_off_label'  => array(
                'on' => __( 'Yes', 'luzuk Premium' ),
                'off' => __( 'No', 'luzuk Premium' )
            )   
        ) 
    )
);
 
backgroundManager($wp_customize, 'testimonials', 'testimonials_area', $color='#fff', get_template_directory_uri().'/images/default-gray.png', 'img');

lzCustomLable($wp_customize, 'luzuk_sec_testsectionpadding', 'testimonials_area', 'Section Padding');

$wp_customize->add_setting(
    'testimonials_areaTpadding', 
    array(
        'sanitize_callback' => 'luzuk_sanitize_text',
        'default'           => __( '7em', 'luzuk Premium' )
    )
);
$wp_customize->add_control(
    'testimonials_areaTpadding',
    array(
        'settings'      => 'testimonials_areaTpadding',
        'section'       => 'testimonials_area',
        'type'          => 'text',
        'label'         => __( 'Top', 'luzuk Premium' )
    )
);
$wp_customize->add_setting(
    'testimonials_areaBpadding',
    array(
        'sanitize_callback' => 'luzuk_sanitize_text',
        'default'           => __( '4em', 'luzuk Premium' )
    )
);
$wp_customize->add_control(
    'testimonials_areaBpadding',
    array(
        'settings'      => 'testimonials_areaBpadding',
        'section'       => 'testimonials_area',
        'type'          => 'text',
        'label'         => __( 'Bottom', 'luzuk Premium' )
    )
);

lzCustomLable($wp_customize, 'testiarea_conwidth', 'testimonials_area', 'Section Width ');

$wp_customize->add_setting('testi_c_width',array('sanitize_callback' => 'luzuk_sanitize_text','default' => 'container'));
$wp_customize->add_control( new Luzuk_Custom_Select_Control( $wp_customize, 'testi_c_width', array(
    'label'    => __( '', 'luzuk' ),
    'section'  => 'testimonials_area', // Replace with your actual section ID
    'settings' => 'testi_c_width',
    'choices'=>array(
       'container' => 'Box Width',
       'container-fluid' => 'Full Width',
       
    )
) ) );


lzCustomLable($wp_customize, 'testiarea_subheadingcase', 'testimonials_area', 'Sub Heading Style');

$wp_customize->add_setting('testi_subtitle_case',array('sanitize_callback' => 'luzuk_sanitize_text','default' => 'uppercase'));
$wp_customize->add_control( new Luzuk_Custom_Select_Control( $wp_customize, 'testi_subtitle_case', array(
    'label'    => __( '', 'luzuk' ),
    'section'  => 'testimonials_area', // Replace with your actual section ID
    'settings' => 'testi_subtitle_case',
    'choices'=>array(
       'uppercase' => 'Uppercase',
       'lowercase' => 'Lowercase',
       'capitalize' => 'Capitalize',
    )
) ) );



lzCustomLable($wp_customize, 'testiarea_headingcase', 'testimonials_area', 'Heading Style');

$wp_customize->add_setting('testi_maintitle_case',array('sanitize_callback' => 'luzuk_sanitize_text','default' => 'uppercase'));
$wp_customize->add_control( new Luzuk_Custom_Select_Control( $wp_customize, 'testi_maintitle_case', array(
    'label'    => __( '', 'luzuk' ),
    'section'  => 'testimonials_area', // Replace with your actual section ID
    'settings' => 'testi_maintitle_case',
    'choices'=>array(
       'uppercase' => 'Uppercase',
       'lowercase' => 'Lowercase',
       'capitalize' => 'Capitalize',
    )
) ) );


$wp_customize->add_setting(
    'testi_title_subtitle_heading',
    array(
        'sanitize_callback' => 'luzuk_sanitize_text'
    )
);
$wp_customize->add_control(
    new luzuk_Customize_Heading(
        $wp_customize,
        'testi_title_subtitle_heading',
        array(
            'settings'      => 'testi_title_subtitle_heading',
            'section'       => 'testimonials_area',
            'label'         => __( 'Section Sub Heading & Sub Heading ', 'luzuk-premium' ),
        )
    )
);


$wp_customize->add_setting(
    'testi_subtitle',
    array(
        'sanitize_callback' => 'luzuk_sanitize_text',
        'default'           => __( 'Testimonials', 'luzuk-premium' )
    )
);
$wp_customize->add_control(
    'testi_subtitle',
    array(
        'settings'      => 'testi_subtitle',
        'section'       => 'testimonials_area',
        'type'          => 'text',
        'label'         => __( 'Sub Heading', 'luzuk-premium' )
    )
);


addColorPalatOption($wp_customize, 'tessec_subHeading', 'testimonials_area', 'Sub Heading Color', '#7FDB54');

$wp_customize->add_setting(
    'testi_title',
    array(
        'sanitize_callback' => 'luzuk_sanitize_text',
        'default'           => __( 'Trusted by 10,000+ happy customers worldwide', 'luzuk-premium' )
    )
);
$wp_customize->add_control(
    'testi_title',
    array(
        'settings'      => 'testi_title',
        'section'       => 'testimonials_area',
        'type'          => 'text',
        'label'         => __( 'Heading', 'luzuk-premium' )
    )
);

addColorPalatOption($wp_customize, 'tessec_Heading', 'testimonials_area', 'Heading Color', '#2F2F2F');


lzCustomLable($wp_customize, 'testi_dtbxclr', 'testimonials_area', 'Box Detail');

$wp_customize->add_setting( 'tsdtaisbx_display' , array( 'default' => true, 'transport' => 'refresh', ) ); 
$wp_customize->add_control( 'tsdtaisbx_display', array( 'label' => 'Detail Box Display', 'section' => 'testimonials_area', 'settings' => 'tsdtaisbx_display', 'type' => 'radio', 'choices' => array( 'show' => 'Show ', 'hide' => 'Hide ', ), ) ); 

$wp_customize->add_setting(
    'ph_image',
    array(
        'sanitize_callback' => 'esc_url_raw'
    )
);

$wp_customize->add_control(
    new WP_Customize_Image_Control(
        $wp_customize,
        'ph_image',
        array(
            'section' => 'testimonials_area',
            'settings' => 'ph_image',
            'description' => __('Recommended Image Size: 50X50', 'luzuk-premium')
        )
    )
);

$wp_customize->add_setting(
    'ph_txt',
    array(
        'sanitize_callback' => 'luzuk_sanitize_text',
        'default'           => __( 'Phone Number', 'luzuk-premium' )
    )
);
$wp_customize->add_control(
    'ph_txt',
    array(
        'settings'      => 'ph_txt',
        'section'       => 'testimonials_area',
        'type'          => 'text',
        'label'         => __( 'Phone Text', 'luzuk-premium' )
    )
);

$wp_customize->add_setting(
    'ph_num',
    array(
        'sanitize_callback' => 'luzuk_sanitize_text',
        'default'           => __( '+(123) 456 789 00', 'luzuk-premium' )
    )
);
$wp_customize->add_control(
    'ph_num',
    array(
        'settings'      => 'ph_num',
        'section'       => 'testimonials_area',
        'type'          => 'text',
        'label'         => __( 'Phone Number', 'luzuk-premium' )
    )
);


addColorPalatOption($wp_customize, 'tessec_dticnclr', 'testimonials_area', 'Icon Color', '#fff');

addColorPalatOption($wp_customize, 'tessec_dticnBGclr', 'testimonials_area', 'Icon BG Color', '#7FDB54');

addColorPalatOption($wp_customize, 'tessec_dttxtclr', 'testimonials_area', 'Phone Text Color', '#202020');

addColorPalatOption($wp_customize, 'tessec_dtnumclr', 'testimonials_area', 'Phone Number Color', '#202020');

addColorPalatOption($wp_customize, 'tessec_dtnumhvclr', 'testimonials_area', 'Phone Number Hover Color', '#7FDB54');

$TesimonialsSingleChoice[] = 'select';
if(!is_array($TesimonialsSingleChoice)){
    $wp_customize->add_setting('testimonials_area_lbl', array('sanitize_callback'=>'luzuk_sanitize_text'));
    $wp_customize->add_control(
        new luzuk_Info_Text( 
            $wp_customize,
            'testimonials_area_lbl',
            array(
                'settings'      => 'testimonials_area_lbl',
                'section'       => 'testimonials_area',
                'label'         => __( 'Note:', 'luzuk 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.', 'luzuk Premium' ),
            )
        )
    );
}
$wp_customize->add_setting('luzuk_premium_testimonials_area_lbl', array('sanitize_callback'=>'luzuk_sanitize_text'));
$wp_customize->add_control(
    new luzuk_Info_Text( 
        $wp_customize,
        'luzuk_premium_testimonials_area_lbl',
        array(
            'settings'      => 'luzuk_premium_testimonials_area_lbl',
            'section'       => 'testimonials_area',
            'label'         => __( 'Note:', 'luzuk Premium' ), 
            'description'   => __( 'Just place the shortcode "[TESTIMONIALS]" in your page to list the Testimonials in a page ', 'luzuk Premium' ),
        )
    )
);
//TESTIMONIALS PAGES
for( $i = 1; $i < 10; $i++ ){
    $wp_customize->add_setting(
        'luzuk_testimonials_heading'.$i,
        array(
            'sanitize_callback' => 'luzuk_sanitize_text'
        )
    );
    $wp_customize->add_control(
        new luzuk_Customize_Heading(
            $wp_customize,
            'luzuk_testimonials_heading'.$i,
            array(
                'settings'      => 'luzuk_testimonials_heading'.$i,
                'section'       => 'testimonials_area',
                'label'         => __( 'Testimonial ', 'luzuk Premium' ).$i,
            )
        )
    );
    $wp_customize->add_setting(
        'testimonials_page'.$i,
        array(
            'sanitize_callback' => 'absint'
        )
    );
    $wp_customize->add_control(
        'testimonials_page'.$i,
        array(
            'settings'      => 'testimonials_page'.$i,
            'section'       => 'testimonials_area',
            'type'=> 'select',
            'label'         => __( 'Select A Client Testimonial', 'luzuk Premium' ),
            'choices' => $TesimonialsSingleChoice,
        )
    );
}


lzCustomLable($wp_customize, 'clientcolor', 'testimonials_area', 'Testimonial Section Color');

addColorPalatOption($wp_customize, 'tes_bxbgclr', 'testimonials_area', 'Box BG Color', '#fff');

addColorPalatOption($wp_customize, 'tes_bxbrdclr', 'testimonials_area', 'Box Border Color', '#ccc');

addColorPalatOption($wp_customize, 'tes_sectextclr', 'testimonials_area', ' Text Color', '#000');

addColorPalatOption($wp_customize, 'tes_secNameclr', 'testimonials_area', 'Client Name Color', '#000');

addColorPalatOption($wp_customize, 'tes_secdeginclr', 'testimonials_area', 'Client Designation Color', '#545454');


// *****Star*******
// Heading (optional visual heading above the star rating control)
$wp_customize->add_setting('test_star_heading', array(
    'sanitize_callback' => 'luzuk_sanitize_text',
));

$wp_customize->add_control(
    new luzuk_Customize_Heading(
        $wp_customize,
        'test_star_heading',
        array(
            'settings' => 'test_star_heading',
            'section'  => 'testimonials_area', // This section must exist
            'label'    => __('Star Rating', 'luzuk-premium'),
        )
    )
);

$wp_customize->add_setting('testimonial_star_rating', array(
    'sanitize_callback' => 'sanitize_text_field',
    'default' => '5'
));
$wp_customize->add_control('testimonial_star_rating', array(
    'label' => __('Select Default Rating (1 to 5)', 'yourtheme'),
    'section' => 'testimonials_area',
    'type' => 'select',
    'choices' => array(
        '1' => '1 Star',
        '2' => '2 Stars',
        '3' => '3 Stars',
        '4' => '4 Stars',
        '5' => '5 Stars',
    ),
));


addColorPalatOption($wp_customize, 'testi_strClr', 'testimonials_area', 'Star Color', '#000');

addColorPalatOption($wp_customize, 'testi_stractClr', 'testimonials_area', 'Star Active Color', '#7FDB54');


lzCustomLable($wp_customize, 'luzuk_secssbtnclr', 'testimonials_area', 'Slider Dot Color');

addColorPalatOption($wp_customize, 'tes_slidedotsclr', 'testimonials_area', 'Slider Dots Color ', '#000');

addColorPalatOption($wp_customize, 'tes_slideactdotsclr', 'testimonials_area', 'Slider Active Dots Color', '#7FDB54');
