<?php  

$wp_customize->add_section(
    'dinero_testimonials_section',
    array(
        'title' => __( 'Testimonials Setting', 'Luzuk' ),
        'panel' => 'luzuk_premium_home_panel1',
        'priority' =>27
    )
);

$wp_customize->add_setting('dinero_reset_testimonials_settings',array(
  'sanitize_callback'   => 'sanitize_text_field'
));
$wp_customize->add_control(new dinero_Reset_Custom_Control($wp_customize, 'dinero_reset_testimonials_settings',array(
  'type' => 'reset_control',
   'priority' => 1,
  'label' => __('Reset Testimonials Section Settings', 'dinero'),
  'description' => 'dinero_testimonials_reset_settings',
  'section' => 'dinero_testimonials_section'
)));


$wp_customize->add_setting('luzuk_testimonials_nav', array(
       'sanitize_callback' => 'wp_kses_post',
    ));

    $wp_customize->add_control(new luzuk_Tab_Control($wp_customize, 'luzuk_testimonials_nav', array(
       'section' => 'dinero_testimonials_section',
       'priority' => 1,
       'buttons' => array(
          array(
             'name' => esc_html__('General', 'luzuk-premium'),
            'icon' => 'dashicons dashicons-welcome-write-blog',
            'fields' => array(
                'dinero_testimonials_enable', 
                'dinero_testimonials_maintitle',
                'dinero_testimonials_head_icon_enable',
                'dinero_testimonials_head_icon',
                'dinero_testimonials_subtitle',
                'dinero_testimonials_area_lbl', 
                'dinero_testimonials_section_lbl',  
                'dinero_testimonials_npp_count',
                'dinero_testimonials_heading1',
                'dinero_testimonials_page1',
                'dinero_testimonials_heading2',
                'dinero_testimonials_page2',
                'dinero_testimonials_heading3',
                'dinero_testimonials_page3',
                'dinero_testimonials_heading4',
                'dinero_testimonials_page4',
                'dinero_testimonials_heading5',
                'dinero_testimonials_page5',
                'dinero_testimonials_heading6',
                'dinero_testimonials_page6',
                'dinero_testimonials_heading7',
                'dinero_testimonials_page7',
                'dinero_testimonials_heading8',
                'dinero_testimonials_page8',
                'dinero_testimonials_heading9',
                'dinero_testimonials_page9',
                'dinero_testimonials_heading10',
                'dinero_testimonials_page10',
                'dinero_testimonials_heading11',
                'dinero_testimonials_page11',
                'dinero_testimonials_heading12',
                'dinero_testimonials_page12'
            ),
            'active' => true,
         ),
          array(
            'name' => esc_html__('Style', 'luzuk-premium'),
            'icon' => 'dashicons dashicons-art',
            'fields' => array(                
                'dinero_testimonials_section_bg_color',
                'dinero_testimonials_section_bg_image',
                'dinero_testimonials_image_opacity',
                'dinero_testimonials_title_color1',
                'dinero_testimonials_title_color2',
                'dinero_testimonials_titleborder_color1',
                'dinero_testimonials_titleborder_color2',
                'dinero_testimonials_subtitle_color',
                'dinero_testimonials_title_case',
                'dinero_testimonials_head_align',
                'dinero_testimonials_content_align',
                'dinero_testimonials_box_onload_effects'
            ),
         ),
          array(
            'name' => esc_html__('Layout', 'luzuk-premium'),
            'icon' => 'dashicons dashicons-layout',
            'fields' => array(
                'dinero_testimonials_padding',
                'dinero_testimonials_section_t_padding',
                'dinero_testimonials_section_b_padding',
                'dinero_testimonials_section_width'
            ),
         )
        ),
    )));

$wp_customize->add_setting( 'dinero_testimonials_enable',array(
    'default' => true,
    'sanitize_callback' => 'dinero_switch_sanitization'
) );
$wp_customize->add_control( new Dinero_Toggle_Switch_Custom_Control( $wp_customize, 'dinero_testimonials_enable',array(
    'label' => __( 'Disable Section','dinero' ),
    'section' => 'dinero_testimonials_section'
)));

$wp_customize->add_setting(
    'dinero_testimonials_maintitle',
    array(
        'sanitize_callback' => 'luzuk_sanitize_text',
        'default'           => __( 'TESTIMONIAL', 'Luzuk' )
    )
);
$wp_customize->add_control(
    'dinero_testimonials_maintitle',
    array(
        'settings'      => 'dinero_testimonials_maintitle',
        'section'       => 'dinero_testimonials_section', 
        'type'          => 'text',
        'label'         => __( 'Section Heading', 'Luzuk' )
    )
);

$wp_customize->add_setting('dinero_testimonials_head_icon_enable',array(
        'default' => 'No',
        'sanitize_callback' => 'dinero_sanitize_choices',
    ));
    $wp_customize->add_control('dinero_testimonials_head_icon_enable',array(
        'type' => 'radio',
        'label' => __('Heading Icon Display','dinero'),
        'choices' => array (
            'No' => __('No','dinero'),
            'Yes' => __('Yes','dinero')        
        ),
        'section' => 'dinero_testimonials_section'
    ));
 $wp_customize->add_setting(
        'dinero_testimonials_head_icon',
        array(
            'default'           => 'fa fa-bell',
            'sanitize_callback' => 'luzuk_sanitize_text'
        )
    );        
    $wp_customize->add_control(
        new luzuk_Fontawesome_Icon_Chooser(
            $wp_customize,
            'dinero_testimonials_head_icon',
            array(
                'section'       => 'dinero_testimonials_section',
                'type'          => 'icon',
                'label'         => __( 'FontAwesome Icon', 'luzuk-premium' ),
                'active_callback' => 'dinero_testimonials_type_icon'
            )
        )
    );

$wp_customize->add_setting(
    'dinero_testimonials_subtitle',
    array(
        'sanitize_callback' => 'luzuk_sanitize_text',
        'default'           => __( 'What People Say about Business', 'Luzuk' )
    )
);
$wp_customize->add_control(
    'dinero_testimonials_subtitle',
    array(
        'settings'      => 'dinero_testimonials_subtitle',
        'section'       => 'dinero_testimonials_section', 
        'type'          => 'text',
        'label'         => __( 'Section Sub Heading', 'Luzuk' )
    )
);

$TesimonialsSingleChoice[] = 'select';
if(!is_array($TesimonialsSingleChoice)){
    $wp_customize->add_setting('dinero_testimonials_area_lbl', array('sanitize_callback'=>'luzuk_sanitize_text'));
    $wp_customize->add_control(
        new luzuk_Info_Text( 
            $wp_customize,
            'dinero_testimonials_area_lbl',
            array(
                'settings'      => 'dinero_testimonials_area_lbl',
                'section'       => 'dinero_testimonials_section',
                '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('dinero_testimonials_section_lbl', array('sanitize_callback'=>'luzuk_sanitize_text'));
$wp_customize->add_control(
    new luzuk_Info_Text( 
        $wp_customize,
        'dinero_testimonials_section_lbl',
        array(
            'settings'      => 'dinero_testimonials_section_lbl',
            'section'       => 'dinero_testimonials_section',
            'label'         => __( 'Note:', 'Luzuk Premium' ), 
            'description'   => __( 'Just place the shortcode "[TESTIMONIALS]" in your page to list the Testimonials in a page ', 'Luzuk Premium' ),
        )
    )
);

$wp_customize->add_setting('dinero_testimonials_npp_count',array('sanitize_callback' => 'luzuk_sanitize_text','default' => 3));
$wp_customize->add_control(
    'dinero_testimonials_npp_count',
    array(
        'settings'      => 'dinero_testimonials_npp_count',
        'section'       => 'dinero_testimonials_section',
        'type'          => 'select',
        'label'         => __( 'Number of Client to show', 'luzuk-premium' ),
        'choices'=>array(1,2,3,4,5,6,7,8,9,10,11,12)
    )
);

//TESTIMONIALS PAGES
for( $i = 1; $i<= 12; $i++ ){
    $wp_customize->add_setting(
        'dinero_testimonials_heading'.$i,
        array(
            'sanitize_callback' => 'luzuk_sanitize_text'
        )
    );
    $wp_customize->add_control(
        new luzuk_Customize_Heading(
            $wp_customize,
            'dinero_testimonials_heading'.$i,
            array(
                'settings'      => 'dinero_testimonials_heading'.$i,
                'section'       => 'dinero_testimonials_section',
                'label'         => __( 'Testimonial', 'Luzuk Premium' ).$i,
            )
        )
    );
    $wp_customize->add_setting(
        'dinero_testimonials_page'.$i,
        array(
            'sanitize_callback' => 'absint'
        )
    );
    $wp_customize->add_control(
        'dinero_testimonials_page'.$i,
        array(
            'settings'      => 'dinero_testimonials_page'.$i,
            'section'       => 'dinero_testimonials_section',
            'type'=> 'select',
            'label'         => __( 'Select A Client Testimonials', 'Luzuk Premium' ),
            'choices' => $TesimonialsSingleChoice,
        )
    );
}

// backgroundManager($wp_customize, 'testimonials', 'dinero_testimonials_section', $color='#fdfdfd',get_template_directory_uri().'/images/default-gray.png', 'img');

$wp_customize->add_setting( 'dinero_testimonials_section_bg_color', array(
       'default' => '',
       'sanitize_callback' => 'sanitize_hex_color'
    ));
    $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'dinero_testimonials_section_bg_color', array(
        'label' => __('Section Background Color','dinero'),
       'section' => 'dinero_testimonials_section',
    )));

    $wp_customize->add_setting( 'dinero_testimonials_section_bg_image', array(
       'default' => '',
       'sanitize_callback' => 'esc_url_raw'
    ));
    $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'dinero_testimonials_section_bg_image', array(
        'label' => __('Section Background Image','dinero'),
       'section' => 'dinero_testimonials_section',
    )));


     $wp_customize->add_setting('dinero_testimonials_image_opacity',array(
        'default' => 1,
        'sanitize_callback' => 'dinero_sanitize_float'
    ));
    $wp_customize->add_control(new dinero_Custom_Control( $wp_customize, 'dinero_testimonials_image_opacity',array(
    'label' => __('Background Opacity','dinero'),
    'section' => 'dinero_testimonials_section',
    'input_attrs' => array(
            'min' => 0,
            'max' => 1,
            'step' => 0.1,
        ),
    )));


    $wp_customize->add_setting('dinero_testimonials_box_onload_effects',array(
        'default' => 'wow zoomIn',
        'sanitize_callback' => 'dinero_sanitize_choices',
    ));
    $wp_customize->add_control('dinero_testimonials_box_onload_effects',array(
        'type' => 'select',
        'label' => __('Box Onload Transition Effects','dinero'),
        'choices' => array (
            'wow bounceInLeft' => __('Bounce In Left','dinero'),
            'wow bounceInRight' => __('Bounce In Right','dinero'),
            'wow bounceInUp' => __('Bounce In Up','dinero'),
            'wow bounceInDown' => __('Bounce In Down','dinero'),
            'wow zoomIn' => __('Zoom In','dinero'),
            'wow zoomOut' => __('Zoom Out','dinero'),
            'wow fadeInDown' => __('Fade In Down','dinero'),            
            'wow fadeInUp' => __('Fade In Up','dinero'),
            'wow fadeInLeft' => __('Fade In Left','dinero'),
            'wow fadeInRight' => __('Fade In Right','dinero'),
            'flip-up' => __('Flip Up','dinero')
        ),
        'section' => 'dinero_testimonials_section',
    ));


    $wp_customize->add_setting('dinero_testimonials_title_case',array(
        'default' => 'Capitalize',
        'sanitize_callback' => 'dinero_sanitize_choices',
    ));
    $wp_customize->add_control('dinero_testimonials_title_case',array(
        'type' => 'select',
        'label' => __('Testimonials Title Case','dinero'),
        'choices' => array (
            'Uppercase' => __('Uppercase','dinero'),
            'Lowercase' => __('Lowercase','dinero'),
            'Capitalize' => __('Capitalize','dinero')
        ),
        'section' => 'dinero_testimonials_section',
    ));

    $wp_customize->add_setting('dinero_testimonials_head_align',array(
        'default' => 'Left',
        'sanitize_callback' => 'dinero_sanitize_choices',
    ));
    $wp_customize->add_control('dinero_testimonials_head_align',array(
        'type' => 'select',
        'label' => __('Section Head Alignment','dinero'),
        'choices' => array (
            'Center' => __('Center','dinero'),
            'Left' => __('Left','dinero'),
            'Right' => __('Right','dinero')
        ),
        'section' => 'dinero_testimonials_section',
    ));


addColorPalatOption($wp_customize, 'dinero_testimonials_title_color1', 'dinero_testimonials_section', 'Section Heading color 1 ', '');

addColorPalatOption($wp_customize, 'dinero_testimonials_title_color2', 'dinero_testimonials_section', 'Section Heading color 2 ', '');

addColorPalatOption($wp_customize, 'dinero_testimonials_titleborder_color1', 'dinero_testimonials_section', 'Section Heading border color 1 ', '');

addColorPalatOption($wp_customize, 'dinero_testimonials_titleborder_color2', 'dinero_testimonials_section', 'Section Heading border color 2 ', '');

addColorPalatOption($wp_customize, 'dinero_testimonials_subtitle_color', 'dinero_testimonials_section', 'Section Sub Heading color ', '');



    $wp_customize->add_setting('dinero_testimonials_padding',array(
      'sanitize_callback'   => 'esc_html'
   ));
   $wp_customize->add_control('dinero_testimonials_padding',array(
      'label' => __('Section Padding','dinero'),
      'section' => 'dinero_testimonials_section'
   ));

    $wp_customize->add_setting('dinero_testimonials_section_t_padding',array(
        'default' => '1',
        'sanitize_callback' => 'sanitize_text_field'
    ));
    $wp_customize->add_control('dinero_testimonials_section_t_padding',array(
    'type' => 'number',
    'label' => __('Top','dinero'),
    'section' => 'dinero_testimonials_section',
    ));
     $wp_customize->add_setting('dinero_testimonials_section_b_padding',array(
        'default' => '3',
        'sanitize_callback' => 'sanitize_text_field'
    ));
    $wp_customize->add_control('dinero_testimonials_section_b_padding',array(
    'type' => 'number',
    'label' => __('Bottom','dinero'),
    'section' => 'dinero_testimonials_section',
    ));

    $wp_customize->add_setting('dinero_testimonials_section_width',array(
        'default' => 'Box Width',
        'sanitize_callback' => 'dinero_sanitize_choices',
    ));
    $wp_customize->add_control('dinero_testimonials_section_width',array(
        'type' => 'select',
        'label' => __('Section Width','dinero'),
        'choices' => array (
            'Box Width' => __('Box Width','dinero'),
            'Full Width' => __('Full Width','dinero')
        ),
        'section' => 'dinero_testimonials_section',
    ));

 ?>