<?php 
$wp_customize->add_section(
    'project_area',
    array(
        'title'         => __( 'Project Section', 'Luzuk' ),
        'panel'   => 'luzuk_premium_home_panel',
    )
);

$wp_customize->add_setting(
    'project_area_disable',
    array(
        'sanitize_callback' => 'luzuk_sanitize_text',
        'default' => 'off'
    )
);
$wp_customize->add_control(
    new luzuk_Switch_Control(
        $wp_customize,
        'project_area_disable',
        array(
            'settings'      => 'project_area_disable',
            'section'       => 'project_area',
            'label'         => __( 'Disable Section', 'Luzuk' ),
            'on_off_label'  => array(
                'on' => __( 'Yes', 'Luzuk' ),
                'off' => __( 'No', 'Luzuk' )
            )   
        )
    )
);

backgroundManager($wp_customize, 'project', 'project_area', $color='#ffffff', get_template_directory_uri().'/images/default-gray.png', 'img');

lzCustomLable($wp_customize, 'luzuk_sec_projectectionpadding', 'project_area', 'Set Section Padding:');

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


$wp_customize->add_setting(
    'project_maintitle_subtitle_heading',
    array(
        'sanitize_callback' => 'luzuk_sanitize_text',
    )
);
$wp_customize->add_control(
    new luzuk_Customize_Heading(
        $wp_customize,
        'project_maintitle_subtitle_heading',
        array(
            'settings'      => 'project_maintitle_subtitle_heading',
            'section'       => 'project_area',
            'label'         => __( 'Section Heading & Sub Heading', 'Luzuk' ),
        )
    )
);


$wp_customize->add_setting(
    'project_subtitle',
    array(
        'sanitize_callback' => 'luzuk_sanitize_text',
        'default'           => __( 'Latest Project', 'Luzuk' )
    )
);
$wp_customize->add_control(
    'project_subtitle',
    array(
        'settings'      => 'project_subtitle',
        'section'       => 'project_area', 
        'type'          => 'text',
        'label'         => __( 'Section Sub Heading', 'Luzuk' )
    )
);

addColorPalatOption($wp_customize, 'projectareasubtitle', 'project_area', 'Sub Heading Color ', '#f04f55');


$wp_customize->add_setting(
    'project_maintitle',
    array(
        'sanitize_callback' => 'luzuk_sanitize_text',
        'default'           => __( 'Our Recent Project', 'Luzuk' )
    )
);
$wp_customize->add_control(
    'project_maintitle',
    array(
        'settings'      => 'project_maintitle',
        'section'       => 'project_area', 
        'type'          => 'text',
        'label'         => __( 'Section Heading', 'Luzuk' )
    )
);

addColorPalatOption($wp_customize, 'projectarattle', 'project_area', 'Section Heading Color ', '#000');


$wp_customize->add_setting('project_area_lbl2', array('sanitize_callback'=>'luzuk_sanitize_text'));
$wp_customize->add_control(
    new luzuk_Info_Text( 
        $wp_customize,
        'project_area_lbl2',
        array(
            'settings'      => 'project_area_lbl2',
            'section'       => 'project_area',
            'label'         => __( 'Note2:', 'Luzuk' ),  
            'description'   => __( 'Use Shortcode [PROJECT] to show all project in a page & images use same height(350*400px)', 'Luzuk' ),
        )
    )
);


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

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

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

lzCustomLable($wp_customize, 'projectcolor', 'project_area', 'Section Colors');


addColorPalatOption($wp_customize, 'projectecimgovrlayhv', 'project_area', 'Section Images Hover Color ', '#f04f55');

addColorPalatOption($wp_customize, 'projectectbxbrd', 'project_area', 'Section project Box Border Color ', '#f04f55');

addColorPalatOption($wp_customize, 'projectectxt', 'project_area', 'Section Box Sub Title Color ', '#f04f55'); 

addColorPalatOption($wp_customize, 'projectecttle', 'project_area', 'Section project Name Color ', '#000');

addColorPalatOption($wp_customize, 'projectecttlehv', 'project_area', 'Section project Name Hover Color ', '#f04f55');


