<?php
/**
 * Createing an Facility pannel for customizer
 *
 */

// START FACILITY SECTION 
    $wp_customize->add_section(
        'luzuk_them_premium_facility_section',
        array(
            'title' => __( 'Our Facility Section', 'lz-fitness-premium' ),
            'panel' => 'luzuk_them_premium_home_panel'
        )
    );
    // ENABLE/DISABLE FEATURED SECTION
    $wp_customize->add_setting(
        'luzuk_them_premium_facility_section_disable',
        array(
            'sanitize_callback' => 'luzuk_them_sanitize_text',
        )
    );
    $wp_customize->add_control(
        new luzuk_them_Switch_Control(
            $wp_customize,
            'luzuk_them_premium_facility_section_disable',
            array(
                'settings'      => 'luzuk_them_premium_facility_section_disable',
                'section'       => 'luzuk_them_premium_facility_section',
                'label'         => __( 'Disable Section', 'lz-fitness-premium' ),
                'on_off_label'  => array(
                    'on' => __( 'Yes', 'lz-fitness-premium' ),
                    'off' => __( 'No', 'lz-fitness-premium' )
                ),
            )
        )
    );


lzCustomLable($wp_customize, 'luzuk_them_sec_fewwordspadding', 'luzuk_them_premium_facility_section', 'Set Section Padding :');

$wp_customize->add_setting(
    'secfacilityTpadding',
    array(
        'sanitize_callback' => 'luzuk_them_sanitize_text',
        'default'           => __( '6em', 'lz-fitness-premium' )
    )
);
$wp_customize->add_control(
    'secfacilityTpadding',
    array(
        'settings'      => 'secfacilityTpadding',
        'section'       => 'luzuk_them_premium_facility_section',
        'type'          => 'text',
        'label'         => __( 'Section Top Padding', 'lz-fitness-premium' )
    )
);
$wp_customize->add_setting(
    'secfacilityBpadding',
    array(
        'sanitize_callback' => 'luzuk_them_sanitize_text',
        'default'           => __( '6em', 'lz-fitness-premium' )
    )
);
$wp_customize->add_control(
    'secfacilityBpadding',
    array(
        'settings'      => 'secfacilityBpadding',
        'section'       => 'luzuk_them_premium_facility_section',
        'type'          => 'text',
        'label'         => __( 'Section Bottom Padding', 'lz-fitness-premium' )
    )
);

$wp_customize->add_setting(
    'secfacilityLpadding',
    array(
        'sanitize_callback' => 'luzuk_them_sanitize_text',
        'default'           => __( '0em', 'lz-fitness-premium' )
    )
);
$wp_customize->add_control(
    'secfacilityLpadding',
    array(
        'settings'      => 'secfacilityLpadding',
        'section'       => 'luzuk_them_premium_facility_section',
        'type'          => 'text',
        'label'         => __( 'Section Left Padding', 'lz-fitness-premium' )
    )
);
$wp_customize->add_setting(
    'secfacilityRpadding',
    array(
        'sanitize_callback' => 'luzuk_them_sanitize_text',
        'default'           => __( '0em', 'lz-fitness-premium' )
    )
);
$wp_customize->add_control(
    'secfacilityRpadding',
    array(
        'settings'      => 'secfacilityRpadding',
        'section'       => 'luzuk_them_premium_facility_section',
        'type'          => 'text',
        'label'         => __( 'Section Right Padding', 'lz-fitness-premium' )
    )
);

backgroundManager($wp_customize, 'facility', 'luzuk_them_premium_facility_section', $color='#332931', get_template_directory_uri().'/images/default-gray.png', 'img');

    $wp_customize->add_setting(
    'luzuk_them_facility_title_sub_title_heading',
    array(
        'sanitize_callback' => 'luzuk_them_sanitize_text'
    )
);
$wp_customize->add_control(
    new luzuk_them_Customize_Heading(
        $wp_customize,
        'luzuk_them_facility_title_sub_title_heading',
        array(
            'settings'      => 'luzuk_them_facility_title_sub_title_heading',
            'section'       => 'luzuk_them_premium_facility_section',
            'label'         => __( 'Section Title', 'niwas' ),
        )
    )
);    
$wp_customize->add_setting(
    'luzuk_them_facility_title',
    array(
        'sanitize_callback' => 'luzuk_them_sanitize_text',
        'default'           => __( 'Our Facility', 'niwas' )
    )
);
$wp_customize->add_control(
    'luzuk_them_facility_title',
    array(
        'settings'      => 'luzuk_them_facility_title',
        'section'       => 'luzuk_them_premium_facility_section',
        'type'          => 'text',
        'label'         => __( 'Title', 'niwas' )
    )
);



// $wp_customize->add_setting(
//     'luzuk_them_facility_sub_title',
//     array(
//         'sanitize_callback' => 'luzuk_them_sanitize_text',
//         'default'           => __( 'Our Facility', 'Luzuk Premium' )
//     )
// );
// $wp_customize->add_control(
//     'luzuk_them_facility_sub_title',
//     array(
//         'settings'      => 'luzuk_them_facility_sub_title',
//         'section'       => 'luzuk_them_premium_facility_section',
//         'type'          => 'text',
//         'label'         => __( 'Sub Title', 'Luzuk Premium' )
//     )
// );
 
  // Heading color
    addColorPalatOption($wp_customize, 'secfacility_HeadingColor', 'luzuk_them_premium_facility_section', 'Heading color', '#ffffff');

 // Heading border color
addColorPalatOption($wp_customize, 'facility_HeadingborderColor', 'luzuk_them_premium_facility_section', 'Heading border color', '#fb6f58');





     
$wp_customize->add_setting('luzuk_them_facility_npp_heading',array('sanitize_callback' => 'luzuk_them_sanitize_text'));
$wp_customize->add_control(
    new luzuk_them_Customize_Heading(
        $wp_customize,
        'luzuk_them_facility_npp_heading',
        array(
            'settings'      => 'luzuk_them_facility_npp_heading',
            'section'       => 'luzuk_them_premium_facility_section',
            'label'         => __( 'Number Of Facility Plans', 'niwas' ),
        )
    )
);    
$wp_customize->add_setting('luzuk_them_facility_npp_count',array('sanitize_callback' => 'luzuk_them_sanitize_text','default' => 8));
$wp_customize->add_control(
    'luzuk_them_facility_npp_count',
    array(
        'settings'      => 'luzuk_them_facility_npp_count',
        'section'       => 'luzuk_them_premium_facility_section',
        'type'          => 'select',
        'label'         => __( 'Number of plan to show', 'niwas' ),
        'choices'=>array(1,2,3,4,5,6,7,8,9,10,11,12)
    )
);

//FEATURED PAGES
for( $i = 1; $i <= 12; $i++ ){
    $wp_customize->add_setting(
        'luzuk_them_facility_header'.$i,
        array(
            'sanitize_callback' => 'luzuk_them_sanitize_text'
        )
    );
    $wp_customize->add_control(
        new luzuk_them_Customize_Heading(
            $wp_customize,
            'luzuk_them_facility_header'.$i,
            array(
                'settings'      => 'luzuk_them_facility_header'.$i,
                'section'       => 'luzuk_them_premium_facility_section',
                'label'         => __( 'facility Page ', 'niwas' ).$i
            )
        )
    );

    $wp_customize->add_setting(
        'luzuk_them_facility_page_icon'.$i,
        array(
            'default'           => 'fa fa-wifi',
            'sanitize_callback' => 'luzuk_them_sanitize_text'
        )
    );        
    $wp_customize->add_control(
        new luzuk_them_Fontawesome_Icon_Chooser(
            $wp_customize,
            'luzuk_them_facility_page_icon'.$i,
            array(
                'settings'      => 'luzuk_them_facility_page_icon'.$i,
                'section'       => 'luzuk_them_premium_facility_section',
                'type'          => 'icon',
                'label'         => __( 'FontAwesome Icon', 'niwas' ),
            )
        )
    );

lzAddElement($wp_customize, 'luzuk_them_facility_page_title_'.$i, 'luzuk_them_premium_facility_section', $type = 'text', $label="Title", $callback ='luzuk_them_sanitize_text', $default='Free Wifi');

lzAddElement($wp_customize, 'luzuk_them_facility_page_description_'.$i, 'luzuk_them_premium_facility_section', $type = 'textarea', $label="Description", $callback ='luzuk_them_sanitize_text', $default='Lorem ipsum dolor sit amet, cosectetuer adipiscing elit.');

    //lzAddElement($wp_customize, 'luzuk_them_facility_page_url_'.$i, 'luzuk_them_premium_facility_section', $type = 'text', $label="Button Link", $callback ='esc_url', $default='Add link here');

    /*code for button text*/
    // $wp_customize->add_setting(
    //     'luzuk_them_facility_page_button_title_'.$i,
    //     array(
    //         'sanitize_callback'=>'luzuk_them_sanitize_text',
    //         'default'=> __('READ MORE', 'lz-fitness-premium')
    //     )
    // );
    // $wp_customize->add_control(
    //     'luzuk_them_facility_page_button_title_'.$i,
    //     array(
    //         'settings' =>'luzuk_them_facility_page_button_title_'.$i,
    //         'section' => 'luzuk_them_premium_facility_section',
    //         'type'=> 'text',
    //         'label'=> __('Button Text', 'lz-fitness-premium')
    //     )
    // );
    
}
    // Icon color
    addColorPalatOption($wp_customize, 'facility_IconColor', 'luzuk_them_premium_facility_section', 'Icon color', '#ffffff');

     // Title color
    addColorPalatOption($wp_customize, 'facility_titleColor', 'luzuk_them_premium_facility_section', 'Title color', '#ffffff');

     // Description color
    addColorPalatOption($wp_customize, 'facility_descriptionColor', 'luzuk_them_premium_facility_section', 'Description color', '#ffffff');


       // facility top border color
    addColorPalatOption($wp_customize, 'facility_boxborderColor', 'luzuk_them_premium_facility_section', 'Facility box border color', '#61575f');
  
