<?php
/**
 * Createing an featured new pannel for customizer
 *
 */

// START featured new SECTION 
    $wp_customize->add_section(
        'luzuk_premium_featured_new_section',
        array(
            'title' => __( 'Featured New Section', 'luzuk-premium' ),
            'panel' => 'luzuk_premium_home_panel'
        )
    );
    // ENABLE/DISABLE FEATURED  NEW SECTION
    $wp_customize->add_setting(
        'luzuk_premium_featured_new_section_disable',
        array(
            'sanitize_callback' => 'luzuk_sanitize_text',
        )
    );
    $wp_customize->add_control(
        new luzuk_Switch_Control(
            $wp_customize,
            'luzuk_premium_featured_new_section_disable',
            array(
                'settings'      => 'luzuk_premium_featured_new_section_disable',
                'section'       => 'luzuk_premium_featured_new_section',
                'label'         => __( 'Disable Section', 'luzuk-premium' ),
                'on_off_label'  => array(
                    'on' => __( 'Yes', 'luzuk-premium' ),
                    'off' => __( 'No', 'luzuk-premium' )
                ),
            )
        )
    );

backgroundManager($wp_customize, 'featurednew', 'luzuk_premium_featured_new_section', $color='#303030', get_template_directory_uri().'/images/default-gray.png', 'img');

    $wp_customize->add_setting(
    'services_new_title_sub_title_heading',
    array(
        'sanitize_callback' => 'luzuk_sanitize_text'
    )
);
$wp_customize->add_control(
    new luzuk_Customize_Heading(
        $wp_customize,
        'services_new_title_sub_title_heading',
        array(
            'settings'      => 'services_new_title_sub_title_heading',
            'section'       => 'luzuk_premium_featured_new_section',
            'label'         => __( 'Section Title', 'gurukul' ),
        )
    )
);    
$wp_customize->add_setting(
    'services_new_title',
    array(
        'sanitize_callback' => 'luzuk_sanitize_text',
        'default'           => __( 'Our Features', 'gurukul' )
    )
);
$wp_customize->add_control(
    'services_new_title',
    array(
        'settings'      => 'services_new_title',
        'section'       => 'luzuk_premium_featured_new_section',
        'type'          => 'text',
        'label'         => __( 'Title', 'gurukul' )
    )
);

    // Heading color
    addColorPalatOption($wp_customize, 'services_new_HeadingColor', 'luzuk_premium_featured_new_section', 'Heading color', '#fff');
   
  // Title color
    addColorPalatOption($wp_customize, 'services_new_TitleColor', 'luzuk_premium_featured_new_section', 'Title color', '#fff');
      // Description color
    addColorPalatOption($wp_customize, 'services_new_DescColor', 'luzuk_premium_featured_new_section', 'Description color', '#fff');
    // Icon color
    addColorPalatOption($wp_customize, 'services_new_IconColor', 'luzuk_premium_featured_new_section', 'Icon color', '#303030');
    
$wp_customize->add_setting('services_new_npp_heading',array('sanitize_callback' => 'luzuk_sanitize_text'));
$wp_customize->add_control(
    new luzuk_Customize_Heading(
        $wp_customize,
        'services_new_npp_heading',
        array(
            'settings'      => 'services_new_npp_heading',
            'section'       => 'luzuk_premium_featured_new_section',
            'label'         => __( 'Number Of featured new Plans', 'gurukul' ),
        )
    )
);    
$wp_customize->add_setting('services_new_npp_count',array('sanitize_callback' => 'luzuk_sanitize_text','default' => 2));
$wp_customize->add_control(
    'services_new_npp_count',
    array(
        'settings'      => 'services_new_npp_count',
        'section'       => 'luzuk_premium_featured_new_section',
        'type'          => 'select',
        'label'         => __( 'Number of plan to show', 'gurukul' ),
        'choices'=>array(1,2,3,4,5,6)
    )
);

//FEATURED PAGES
for( $i = 1; $i <= 6; $i++ ){
    $wp_customize->add_setting(
        'services_new_header'.$i,
        array(
            'sanitize_callback' => 'luzuk_sanitize_text'
        )
    );
    $wp_customize->add_control(
        new luzuk_Customize_Heading(
            $wp_customize,
            'services_new_header'.$i,
            array(
                'settings'      => 'services_new_header'.$i,
                'section'       => 'luzuk_premium_featured_new_section',
                'label'         => __( 'featured new Page ', 'gurukul' ).$i
            )
        )
    );

lzAddElement($wp_customize, 'services_new_page_title_'.$i, 'luzuk_premium_featured_new_section', $type = 'text', $label="Title", $callback ='luzuk_sanitize_text', $default='Innovations & research');
lzAddElement($wp_customize, 'services_new_page_description_'.$i, 'luzuk_premium_featured_new_section', $type = 'textarea', $label="Description", $callback ='luzuk_sanitize_text', $default='Lorem ipsum dolor sit amet, consectetuer adipiscing elit, nonummy nibh euismod tincidunt ut laoreet dolore. ');

    // $wp_customize->add_setting(
    //     'services_page'.$i,
    //     array(
    //         'sanitize_callback' => 'absint'
    //     )
    // );
    // $wp_customize->add_control(
    //     'services_page'.$i,
    //     array(
    //         'settings'      => 'services_page'.$i,
    //         'section'       => 'services_section',
    //         'type'          => 'dropdown-pages',
    //         'label'         => __( 'Select a Page', 'gurukul' )
    //     )
    // );
    
    $wp_customize->add_setting(
        'services_new_page_icon'.$i,
        array(
            'default'           => 'fa fa-file-text',
            'sanitize_callback' => 'luzuk_sanitize_text'
        )
    );        
    $wp_customize->add_control(
        new luzuk_Fontawesome_Icon_Chooser(
            $wp_customize,
            'services_new_page_icon'.$i,
            array(
                'settings'      => 'services_new_page_icon'.$i,
                'section'       => 'luzuk_premium_featured_new_section',
                'type'          => 'icon',
                'label'         => __( 'FontAwesome Icon', 'gurukul' ),
            )
        )
    );
    
    //my edit code
    // $wp_customize->add_control( 
    // 'services_page', 
    // array(
    // 'settings'=> 'services_page', 
    // 'section' => 'services_section', 
    // 'type'=>'select', 
    // 'label'=>__('Link to featured page', 'lz-featured-premium'), 
    // //'choices'=>$lz_featured_page_choice 
    //  ) 
    // );
    
    $wp_customize->add_setting(
    'services_new_image_heading', 
    array(
    'sanitize_callback' => 'luzuk_sanitize_text' 
        ) 
    ); 
    
    $wp_customize->add_control(
    new luzuk_Customize_Heading(
    $wp_customize, 
    'services_new_image_heading', 
    array(
    'settings' => 'services_new_image_heading', 
    'section' => 'luzuk_premium_featured_new_section', 
    'label' => __( 'Right Image', 'lz-featured-premium' ), 
            ) 
        ) 
    ); 
    
    $wp_customize->add_setting(
    'services_new_image', 
    array( 
    'sanitize_callback' => 'esc_url_raw' 
        ) 
    );
    
    $wp_customize->add_control(
    new WP_Customize_Image_Control(
    $wp_customize, 
    'services_new_image', 
    array(
    'section' => 'luzuk_premium_featured_new_section',
    'settings' => 'services_new_image',
    'description' => __('Recommended Image Size: 500X600px', 'lz-featured-premium') 
            )
        ) 
    );

  
  
}
// End Feature section s