<?php
$wp_customize->add_section(
    'service_area',
    array(
        'title'         => __( 'Services Section', 'Luzuk' ),
        'panel'   => 'luzuk_premium_home_panel',
    )
);
$wp_customize->add_setting(
    'service_area_disable',
    array(
        'sanitize_callback' => 'luzuk_sanitize_text',
        'default' => 'off'
    )
);
$wp_customize->add_control(
    new luzuk_Switch_Control(
        $wp_customize,
        'service_area_disable',
        array(
            'settings'      => 'service_area_disable',
            'section'       => 'service_area',
            'label'         => __( 'Disable Section', 'Luzuk' ),
            'on_off_label'  => array(
                'on' => __( 'Yes', 'Luzuk' ),
                'off' => __( 'No', 'Luzuk' )
            )
        )
    )
);

backgroundManager($wp_customize, 'service', 'service_area', $color='#fff', get_template_directory_uri().'/images/default-gray.png', 'img');

lzCustomLable($wp_customize, 'luzuk_sec_servicessectionpadding', 'service_area', 'Set Section Padding:');

$wp_customize->add_setting(
    'service_areaTpadding',
    array(
        'sanitize_callback' => 'luzuk_sanitize_text',
        'default'           => __( '1em', 'luzuk-premium' )
    )
);
$wp_customize->add_control(
    'service_areaTpadding',
    array(
        'settings'      => 'service_areaTpadding',
        'section'       => 'service_area',
        'type'          => 'text',
        'label'         => __( 'Top Padding', 'luzuk-premium' )
    )
);

$wp_customize->add_setting(
    'service_areaBpadding',
    array(
        'sanitize_callback' => 'luzuk_sanitize_text',
        'default'           => __( '3em', 'luzuk-premium' )
    )
);
$wp_customize->add_control(
    'service_areaBpadding',
    array(
        'settings'      => 'service_areaBpadding',
        'section'       => 'service_area',
        'type'          => 'text',
        'label'         => __( 'Bottom Padding', 'luzuk-premium' )
    )
);

$wp_customize->add_setting(
    'ser_title_subtitle_heading',
    array(
        'sanitize_callback' => 'luzuk_sanitize_text'
    )
);
$wp_customize->add_control(
    new luzuk_Customize_Heading(
        $wp_customize,
        'ser_title_subtitle_heading',
        array(
            'settings'      => 'ser_title_subtitle_heading',
            'section'       => 'service_area',
            'label'         => __( 'Section Heading & Sub Heading', 'luzuk-premium' ),
        )
    )
);


$wp_customize->add_setting(
    'ser_title',
    array(
        'sanitize_callback' => 'luzuk_sanitize_text',
        'default'           => __( 'OUR SERVICES', 'luzuk-premium' )
    )
);
$wp_customize->add_control(
    'ser_title',
    array(
        'settings'      => 'ser_title',
        'section'       => 'service_area',
        'type'          => 'text',
        'label'         => __( 'Section Heading', 'luzuk-premium' )
    )
);

addColorPalatOption($wp_customize, 'services_titleclr', 'service_area', 'Section Heading Color ', '#000');

$wp_customize->add_setting('service_area_lbl2', array('sanitize_callback'=>'luzuk_sanitize_text'));
$wp_customize->add_control(
    new luzuk_Info_Text(
        $wp_customize,
        'service_area_lbl2',
        array(
            'settings'      => 'service_area_lbl2',
            'section'       => 'service_area',
            'label'         => __( 'Note:', 'Luzuk' ),
            'description'   => __( '{a} Use Shortcode [SERVICES] to show all services in a page.
             {b} Image use same height(370px*280px)', 'Luzuk' ),
        )
    )
);

// $wp_customize->add_setting('service_npp_heading',array('sanitize_callback' => 'luzuk_sanitize_text'));
// $wp_customize->add_control(
//     new luzuk_Customize_Heading(
//         $wp_customize,
//         'service_npp_heading',
//         array(
//             'settings'      => 'service_npp_heading',
//             'section'       => 'service_area',
//             'label'         => __( 'Number of Services to show', 'Luzuk' ),
//         )
//     )
// );

lzCustomLable($wp_customize, 'luzuk_Services_Numbershow', 'service_area', 'Number of Services to show');

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

$ServicesSingleChoice[] = 'Select';
for( $i = 1; $i <= 12; $i++ ){
    $wp_customize->add_setting(
        'services_heading'.$i,
        array(
            'sanitize_callback' => 'luzuk_sanitize_text'
        )
    );
    $wp_customize->add_control(
        new luzuk_Customize_Heading(
            $wp_customize,
            'services_heading'.$i,
            array(
                'settings'      => 'services_heading'.$i,
                'section'       => 'service_area',
                'label'         => __( 'Service Page ', 'Luzuk' ).$i,
            )
        )
    );
    if(is_array($ServicesSingleChoice)){
        $wp_customize->add_setting(
            'services_page'.$i,
            array(
                'sanitize_callback' => 'absint'
            )
        );
        $wp_customize->add_control(
            'services_page'.$i,
            array(
                'settings'      => 'services_page'.$i,
                'section'       => 'service_area',
                'type'=> 'select',
                'label'         => __( 'Select a Service Page ', 'Luzuk' ),
                'choices' => $ServicesSingleChoice,
            )
        );

// $wp_customize->add_setting(
//         'services_page_icon1'.$i,
//         array(
//             'default'           => 'fa fa-camera',
//             'sanitize_callback' => 'luzuk_sanitize_text'
//         )
//     );
//     $wp_customize->add_control(
//         new luzuk_Fontawesome_Icon_Chooser(
//             $wp_customize,
//             'services_page_icon1'.$i,
//             array(
//                 'settings'      => 'services_page_icon1'.$i,
//                 'section'       => 'service_area',
//                 'type'          => 'icon',
//                 'label'         => __( 'FontAwesome Icon', 'Luzuk' ),
//             )
//         )
//     );

    }else{
        $wp_customize->add_setting('service_area_lbl'.$i, array('sanitize_callback'=>'luzuk_sanitize_text'));
        $wp_customize->add_control(
            new luzuk_Info_Text(
                $wp_customize,
                'service_area_lbl'.$i,
                array(
                    'settings'      => 'service_area_lbl'.$i,
                    'section'       => 'service_area',
                    'label'         => __( 'Note:', 'Luzuk' ),
                    'description'   => __( '<strong>Changes will not reflect unless you select the Service Page.</strong> <br/>Please add the Services from "Services menu" and then select Services to show information.', 'Luzuk' ),
                )
            )
        );
    }

}

lzCustomLable($wp_customize, 'services_bxclr', 'service_area', 'Section Color');

addColorPalatOption($wp_customize, 'services_Sbxinghvclr', 'service_area', 'Section Image Hover Color ', '#718be3');

addColorPalatOption($wp_customize, 'services_Sbxclr', 'service_area', 'Section Box Background Color ', '#fff');

addColorPalatOption($wp_customize, 'services_ServicePageTitleColor', 'service_area', 'Section Title Color ', '#000');

addColorPalatOption($wp_customize, 'services_ServicePageTitlehvColor', 'service_area', 'Section Title Hover Color ', '#718be3');

addColorPalatOption($wp_customize, 'service_txtClr', 'service_area', 'Section Text Color ', '#a2a2a4');



lzCustomLable($wp_customize, 'services_btnsettclr', 'service_area', 'Section Button Setting');


$wp_customize->add_setting( 'service_button_display_ser' , array( 'default' => true, 'transport' => 'refresh', ) ); $wp_customize->add_control( 'service_button_display_ser', array( 'label' => 'Button Display', 'section' => 'service_area', 'settings' => 'service_button_display_ser', 'type' => 'radio', 'choices' => array( 'show' => 'Show Button', 'hide' => 'Hide Button', ), ) );
// end to show & hide button


$wp_customize->add_setting(
    'servicesbutton_ser',
    array(
        'sanitize_callback' => 'luzuk_sanitize_text',
        'default'           => __( 'READ MORE', 'luzuk-premium' )
    )
);
$wp_customize->add_control(
    'servicesbutton_ser',
    array(
        'settings'      => 'servicesbutton_ser',
        'section'       => 'service_area',
        'type'          => 'text',
        'label'         => __( 'Button Text', 'luzuk-premium' )
    )
);


addColorPalatOption($wp_customize, 'services_btninnerborderbackground', 'service_area', 'Button Background Color', '#fff');
addColorPalatOption($wp_customize, 'services_btninnerborderbackgroundhover', 'service_area', 'Button Background Hover Color', '#718be3');

addColorPalatOption($wp_customize, 'service_sectext', 'service_area', 'Section Button Text Color ', '#000');
addColorPalatOption($wp_customize, 'service_sectexthv', 'service_area', 'Section Button Text Hover Color ', '#fff');

addColorPalatOption($wp_customize, 'service_secbutton', 'service_area', 'Section Button Border Color ', '#718be3');
addColorPalatOption($wp_customize, 'service_secbuttonhv', 'service_area', 'Section Button Border Hover Color ', '#000');

addColorPalatOption($wp_customize, 'services_btninnerborderhover', 'service_area', 'Button Before & After Border Hover Color', '#fff');
