<?php  

$wp_customize->add_section(
    'dinero_counter_section',
    array(
        'title' => __('Counterbox', 'luzuk-premium' ),
        'panel' => 'luzuk_premium_home_panel1',
        'priority' =>21
    )
); 

$wp_customize->add_setting('dinero_reset_counter_settings',array(
  'sanitize_callback'   => 'sanitize_text_field'
));
$wp_customize->add_control(new dinero_Reset_Custom_Control($wp_customize, 'dinero_reset_counter_settings',array(
  'type' => 'reset_control',
   'priority' => 1,
  'label' => __('Reset Counter Section Settings', 'dinero'),
  'description' => 'dinero_counter_reset_settings',
  'section' => 'dinero_counter_section'
)));

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

    $wp_customize->add_control(new luzuk_Tab_Control($wp_customize, 'luzuk_counter_nav', array(
       'section' => 'dinero_counter_section',
       'priority' => 1,
       'buttons' => array(
          array(
             'name' => esc_html__('General', 'luzuk-premium'),
            'icon' => 'dashicons dashicons-welcome-write-blog',
            'fields' => array(
                'dinero_counter_enable',
                'dinero_counter_maintitle',
                'dinero_counter_head_icon_enable',
                'dinero_counter_head_icon',
                'dinero_counter_subtitle',
                'dinero_counter_npp_count_heading',
                'dinero_counter_npp_count',
                'dinero_counter_page1',
                'dinero_counter_page_icon1',
                'dinero_counter_page_title_1',
                'dinero_counter_page_num_1',
                'dinero_counter_page_unit_1',
                'dinero_counter_page2',
                'dinero_counter_page_icon2',
                'dinero_counter_page_title_2',
                'dinero_counter_page_num_2',
                'dinero_counter_page_unit_2',
                'dinero_counter_page3',
                'dinero_counter_page_icon3',
                'dinero_counter_page_title_3',
                'dinero_counter_page_num_3',
                'dinero_counter_page_unit_3',
                'dinero_counter_page4',
                'dinero_counter_page_icon4',
                'dinero_counter_page_title_4',
                'dinero_counter_page_num_4',
                'dinero_counter_page_unit_4',
                'dinero_counter_page5',
                'dinero_counter_page_icon5',
                'dinero_counter_page_title_5',
                'dinero_counter_page_num_5',
                'dinero_counter_page_unit_5',
                'dinero_counter_page6',
                'dinero_counter_page_icon6',
                'dinero_counter_page_title_6',
                'dinero_counter_page_num_6',
                'dinero_counter_page_unit_6',
                'dinero_counter_page7',
                'dinero_counter_page_icon7',
                'dinero_counter_page_title_7',
                'dinero_counter_page_num_7',
                'dinero_counter_page_unit_7',
                'dinero_counter_page8',
                'dinero_counter_page_icon8',
                'dinero_counter_page_title_8',
                'dinero_counter_page_num_8',
                'dinero_counter_page_unit_8',
                'dinero_counter_page9',
                'dinero_counter_page_icon9',
                'dinero_counter_page_title_9',
                'dinero_counter_page_num_9',
                'dinero_counter_page_unit_9',
                'dinero_counter_page10',
                'dinero_counter_page_icon10',
                'dinero_counter_page_title_10',
                'dinero_counter_page_num_10',
                'dinero_counter_page_unit_10',
                'dinero_counter_page11',
                'dinero_counter_page_icon11',
                'dinero_counter_page_title_11',
                'dinero_counter_page_num_11',
                'dinero_counter_page_unit_11',
                'dinero_counter_page12',
                'dinero_counter_page_icon12',
                'dinero_counter_page_title_12',
                'dinero_counter_page_num_12',
                'dinero_counter_page_unit_12',
                'dinero_counter_page13',
                'dinero_counter_page_icon13',
                'dinero_counter_page_title_13',
                'dinero_counter_page_num_13',
                'dinero_counter_page_unit_13',
                'dinero_counter_page14',
                'dinero_counter_page_icon14',
                'dinero_counter_page_title_14',
                'dinero_counter_page_num_14',
                'dinero_counter_page_unit_14',
                'dinero_counter_page15',
                'dinero_counter_page_icon15',
                'dinero_counter_page_title_15',
                'dinero_counter_page_num_15',
                'dinero_counter_page_unit_15'
            ),
            'active' => true,
         ),
          array(
            'name' => esc_html__('Style', 'luzuk-premium'),
            'icon' => 'dashicons dashicons-art',
            'fields' => array(               
                'dinero_counter_section_bg_color',
                'dinero_counter_section_bg_image',
                'dinero_counter_image_opacity',                     
                'dinero_counter_box_onload_effects',
                 'dinero_counter_title_case',
                'dinero_counter_head_align',
                'dinero_counter_box_align',
                'dinero_counter_title_color1',
                'dinero_counter_title_color2',
                'dinero_counter_titleborder_color1',
                'dinero_counter_titleborder_color2',
                'dinero_counter_subtitle_color',           
            ),
         ),
          array(
            'name' => esc_html__('Layout', 'luzuk-premium'),
            'icon' => 'dashicons dashicons-layout',
            'fields' => array(
                 'dinero_counter_padding',
                'dinero_counter_section_t_padding',
                'dinero_counter_section_b_padding',
                'dinero_counter_section_width'               
            ),
         )
        ),
    )));

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

$wp_customize->add_setting(
    'dinero_counter_maintitle',
    array(
        'sanitize_callback' => 'luzuk_sanitize_text',
        'default'           => __( 'OUR INTRODUCTION', 'Luzuk' )
    )
);
$wp_customize->add_control(
    'dinero_counter_maintitle',
    array(
        'settings'      => 'dinero_counter_maintitle',
        'section'       => 'dinero_counter_section', 
        'type'          => 'text',
        'label'         => __( 'Section Heading', 'Luzuk' )
    )
);

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

$wp_customize->add_setting(
    'dinero_counter_subtitle',
    array(
        'sanitize_callback' => 'luzuk_sanitize_text',
        'default'           => __( 'Innovative and Preminum Service', 'Luzuk' )
    )
);
$wp_customize->add_control(
    'dinero_counter_subtitle',
    array(
        'settings'      => 'dinero_counter_subtitle',
        'section'       => 'dinero_counter_section', 
        'type'          => 'text',
        'label'         => __( 'Section Sub Heading', 'Luzuk' )
    )
);


$wp_customize->add_setting('dinero_counter_npp_count_heading',array('sanitize_callback' => 'luzuk_sanitize_text'));
$wp_customize->add_control(
    new luzuk_Customize_Heading(
        $wp_customize,
        'dinero_counter_npp_count_heading',
        array(
            'settings'      => 'dinero_counter_npp_count_heading',
            'section'       => 'dinero_counter_section',
            'label'         => __( 'Number of counter to show', 'Luzuk' ),
        )
    )
);    
$wp_customize->add_setting('dinero_counter_npp_count',array('sanitize_callback' => 'luzuk_sanitize_text','default' => 3));
$wp_customize->add_control(
    'dinero_counter_npp_count',
    array(
        'settings'      => 'dinero_counter_npp_count',
        'section'       => 'dinero_counter_section',
        'type'          => 'select',
        'label'         => __( 'Number of counter to show', 'Luzuk' ),
        'choices'=>array(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15)
    )
);

//FEATURED PAGES
for( $i = 1; $i <= 15; $i++ ){
    $wp_customize->add_setting(
        'dinero_counter_page'.$i,
        array(
            'sanitize_callback' => 'luzuk_sanitize_text'
        )
    );
    $wp_customize->add_control(
        new luzuk_Customize_Heading(
            $wp_customize,
            'dinero_counter_page'.$i,
            array(
                'settings'      => 'dinero_counter_page'.$i,
                'section'       => 'dinero_counter_section',
                'label'         => __( 'counter Page ', 'luzuk-premium' ).$i
            )
        )
    );

     $wp_customize->add_setting(
        'dinero_counter_page_icon'.$i,
        array(
            'default'           => 'fa fa-clock-o',
            'sanitize_callback' => 'luzuk_sanitize_text'
        )
    );        
    $wp_customize->add_control(
        new luzuk_Fontawesome_Icon_Chooser(
            $wp_customize,
            'dinero_counter_page_icon'.$i,
            array(
                'settings'      => 'dinero_counter_page_icon'.$i,
                'section'       => 'dinero_counter_section',
                'type'          => 'icon',
                'label'         => __( 'FontAwesome Icon', 'luzuk-premium' ),
            )
        )
    );


lzAddElement($wp_customize, 'dinero_counter_page_num_'.$i, 'dinero_counter_section', $type = 'text', $label="Counter Number", $callback ='sanitize_text_field', $default='26');
lzAddElement($wp_customize, 'dinero_counter_page_unit_'.$i, 'dinero_counter_section', $type = 'text', $label="Counter Unit", $callback ='luzuk_sanitize_text', $default='K');
lzAddElement($wp_customize, 'dinero_counter_page_title_'.$i, 'dinero_counter_section', $type = 'text', $label="Counter Text", $callback ='luzuk_sanitize_text', $default='Working Hours');
    
}

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

    $wp_customize->add_setting('dinero_counter_section_t_padding',array(
        'default' => '5',
        'sanitize_callback' => 'sanitize_text_field'
    ));
    $wp_customize->add_control('dinero_counter_section_t_padding',array(
    'type' => 'number',
    'label' => __('Top','dinero'),
    'section' => 'dinero_counter_section',
    ));
     $wp_customize->add_setting('dinero_counter_section_b_padding',array(
        'default' => '4',
        'sanitize_callback' => 'sanitize_text_field'
    ));
    $wp_customize->add_control('dinero_counter_section_b_padding',array(
    'type' => 'number',
    'label' => __('Bottom','dinero'),
    'section' => 'dinero_counter_section',
    ));

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

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

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


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

    $wp_customize->add_setting('dinero_counter_box_onload_effects',array(
        'default' => 'zoom-in',
        'sanitize_callback' => 'dinero_sanitize_choices',
    ));
    $wp_customize->add_control('dinero_counter_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_counter_section',
    ));

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


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

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

    $wp_customize->add_setting('dinero_counter_box_align',array(
        'default' => 'Left',
        'sanitize_callback' => 'dinero_sanitize_choices',
    ));
    $wp_customize->add_control('dinero_counter_box_align',array(
        'type' => 'select',
        'label' => __('Content Box Alignment','dinero'),
        'choices' => array (
            'Center' => __('Center','dinero'),
            'Left' => __('Left','dinero'),
            'Right' => __('Right','dinero')
        ),
        'section' => 'dinero_counter_section',
    ));

addColorPalatOption($wp_customize, 'dinero_counter_heading_color1', 'dinero_counter_section', 'Heading color', '');
addColorPalatOption($wp_customize, 'dinero_counter_heading_color2', 'dinero_counter_section', 'Heading color', '');

addColorPalatOption($wp_customize, 'dinero_counter_headingborder_color1', 'dinero_counter_section', 'Heading border color', '');
addColorPalatOption($wp_customize, 'dinero_counter_headingborder_color2', 'dinero_counter_section', 'Heading border color', '');

addColorPalatOption($wp_customize, 'dinero_counter_subheading_color', 'dinero_counter_section', 'Subheading color ', '');
?>