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

// START FACILITY SECTION 
    $wp_customize->add_section(
        'premium_facility_section',
        array(
            'title' => __( 'Facility Section', 'luzuk-premium' ),
            'panel' => 'luzuk_premium_home_panel'
        )
    );
    // ENABLE/DISABLE FEATURED SECTION
    $wp_customize->add_setting(
        'premium_facility_section_disable',
        array(
            'sanitize_callback' => 'luzuk_sanitize_text',
        )
    );
    $wp_customize->add_control(
        new luzuk_Switch_Control(
            $wp_customize,
            'premium_facility_section_disable',
            array(
                'settings'      => 'premium_facility_section_disable',
                'section'       => 'premium_facility_section',
                'label'         => __( 'Disable Section', 'luzuk-premium' ),
                'on_off_label'  => array(
                    'on' => __( 'Yes', 'luzuk-premium' ),
                    'off' => __( 'No', 'luzuk-premium' )
                ),
            )
        )
    );
backgroundManager($wp_customize, 'facility', 'premium_facility_section', $color='#fff', get_template_directory_uri().'/images/facility-bg.jpg', 'color');

 // overlay color
    addColorPalatOption($wp_customize, 'facility_overlayColor', 'premium_facility_section', 'Overlay color', '#D79800');

    $wp_customize->add_setting(
    'facility_title_sub_title_heading',
    array(
        'sanitize_callback' => 'luzuk_sanitize_text'
    )
);
$wp_customize->add_control(
    new luzuk_Customize_Heading(
        $wp_customize,
        'facility_title_sub_title_heading',
        array(
            'settings'      => 'facility_title_sub_title_heading',
            'section'       => 'premium_facility_section',
            'label'         => __( 'Section Title', 'luzuk-premium' ),
        )
    )
);   
$wp_customize->add_setting(
    'facility_title',
    array(
        'sanitize_callback' => 'luzuk_sanitize_text',
        'default'           => __( 'OUR FACILITIES', 'luzuk-premium' )
    )
);
$wp_customize->add_control(
    'facility_title',
    array(
        'settings'      => 'facility_title',
        'section'       => 'premium_facility_section',
        'type'          => 'text',
        'label'         => __( 'Title', 'luzuk-premium' )
    )
);

 // Heading color
addColorPalatOption($wp_customize, 'facility_HeadingColor', 'premium_facility_section', 'Heading color', '#fff');

    // Heading border color
addColorPalatOption($wp_customize, 'facility_HeadingborderColor', 'premium_facility_section', 'Section Heading border color', '#fff');

$wp_customize->add_setting('facility_npp_heading',array('sanitize_callback' => 'luzuk_sanitize_text'));
$wp_customize->add_control(
    new luzuk_Customize_Heading(
        $wp_customize,
        'facility_npp_heading',
        array(
            'settings'      => 'facility_npp_heading',
            'section'       => 'premium_facility_section',
            'label'         => __( 'Number Of Facility Plans', 'luzuk-premium' ),
        )
    )
);    
$wp_customize->add_setting('facility_npp_count',array('sanitize_callback' => 'luzuk_sanitize_text','default' => 3));
$wp_customize->add_control(
    'facility_npp_count',
    array(
        'settings'      => 'facility_npp_count',
        'section'       => 'premium_facility_section',
        'type'          => 'select',
        'label'         => __( 'Number of plan to show', 'luzuk-premium' ),
        'choices'=>array(1,2,3,4,5,6,7,8)
    )
);

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

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

lzAddElement($wp_customize, 'facility_page_title_'.$i, 'premium_facility_section', $type = 'text', $label="Title", $callback ='luzuk_sanitize_text', $default='Fast Delievery');
    
}

     // icon color
    addColorPalatOption($wp_customize, 'facility_iconColor', 'premium_facility_section', 'Icon color', '#D79800');

     // icon hover color
    addColorPalatOption($wp_customize, 'facility_iconhoverColor', 'premium_facility_section', 'Icon hover color', '#fff');

 // title color
    addColorPalatOption($wp_customize, 'facility_titleColor', 'premium_facility_section', 'Title color', '#2d2d2d');

 // title hover color
    addColorPalatOption($wp_customize, 'facility_titlehoverColor', 'premium_facility_section', 'Title hover color', '#fff');

 // box bg color
    addColorPalatOption($wp_customize, 'facility_boxbgColor', 'premium_facility_section', 'Box background color', '#fff');
    
 // box bg hover color
    addColorPalatOption($wp_customize, 'facility_boxbghoverColor', 'premium_facility_section', 'Box background hover color', '#2a2a2a');

// End facility section 