<?php
/**
 * Createing an about us pannel for customizer
 */

// START ABOUT SECTION 
    $wp_customize->add_section(
        'lz_fitness_premium_aboutus_section',
        array(
            'title' => __( 'About Us Section', 'lz-fitness-premium' ),
            'panel' => 'lz_fitness_premium_home_panel'
        )
    );
    // ENABLE/DISABLE FEATURED SECTION
    $wp_customize->add_setting(
        'lz_fitness_premium_aboutus_section_disable',
        array(
            'sanitize_callback' => 'lz_fitness_sanitize_text',
        )
    );
    $wp_customize->add_control(
        new lz_fitness_Switch_Control(
            $wp_customize,
            'lz_fitness_premium_aboutus_section_disable',
            array(
                'settings'      => 'lz_fitness_premium_aboutus_section_disable',
                'section'       => 'lz_fitness_premium_aboutus_section',
                'label'         => __( 'Disable Section', 'lz-fitness-premium' ),
                'on_off_label'  => array(
                    'on' => __( 'Yes', 'lz-fitness-premium' ),
                    'off' => __( 'No', 'lz-fitness-premium' )
                ),
            )
        )
    );

    // Manage the background SECTION
    // $wp_customize->add_setting(
    //     'lz_fitness_aboutus_title_heading1',
    //     array(
    //         'sanitize_callback' => 'lz_fitness_sanitize_text'
    //     )
    // );
    // $wp_customize->add_control(
    //     new lz_fitness_Customize_Heading(
    //         $wp_customize,
    //         'lz_fitness_aboutus_title_heading1',
    //         array(
    //             'settings'      => 'lz_fitness_aboutus_title_heading1',
    //             'section'       => 'lz_fitness_premium_aboutus_section',
    //             'label'         => __( 'Manage background', 'lz-fitness-premium' ),
    //         )
    //     )
    // );
    // $wp_customize->add_setting(
    //     'lz_fitness_premium_aboutus_section_background',
    //     array(
    //         'sanitize_callback' => 'lz_fitness_sanitize_text',
    //     )
    // );
    // $wp_customize->add_control(
    //     new lz_fitness_Switch_Control(
    //         $wp_customize,
    //         'lz_fitness_premium_aboutus_section_background',
    //         array(
    //             'settings'      => 'lz_fitness_premium_aboutus_section_background',
    //             'section'       => 'lz_fitness_premium_aboutus_section',
    //             'label'         => __( 'Manage background by', 'lz-fitness-premium' ),
    //             'on_off_label'  => array(
    //                 'on' => __( 'Image', 'lz-fitness-premium' ),
    //                 'off' => __( 'Color', 'lz-fitness-premium' )
    //             ),
    //         )
    //     )
    // );
    // $wp_customize->add_setting(
    //     'lz_fitness_about_bg_color',
    //     array(
    //         'default'           => '#fff',
    //         'sanitize_callback' => 'sanitize_hex_color',
    //         'priority' => 1
    //     )
    // );
    // $wp_customize->add_control(
    //     new WP_Customize_Color_Control(
    //         $wp_customize,
    //         'lz_fitness_about_bg_color',
    //         array(
    //             'settings'      => 'lz_fitness_about_bg_color',
    //             'section'       => 'lz_fitness_premium_aboutus_section',
    //             'label'         => __( 'Background Color ', 'lz-fitness-premium' ),
    //         )
    //     )
    // );
    // $wp_customize->add_setting(
    //     'lz_fitness_about_bg_image',
    //     array(
    //         'sanitize_callback' => 'esc_url_raw'
    //     )
    // );
    // $wp_customize->add_control(
    //     new WP_Customize_Image_Control(
    //         $wp_customize,
    //         'lz_fitness_about_bg_image',
    //         array(
    //             'section' => 'lz_fitness_premium_aboutus_section',
    //             'settings' => 'lz_fitness_about_bg_image',
    //             'label' => __( 'Background Image ', 'lz-fitness-premium' ),
    //             'description' => __('Recommended Image Size: 1900X600px', 'lz-fitness-premium')
    //         )
    //     )
    // );
backgroundManager($wp_customize, 'about', 'lz_fitness_premium_aboutus_section', $color='#eef1f2',get_template_directory_uri().'/images/aboutus.jpg', 'color');  

    $wp_customize->add_setting(
        'lz_fitness_aboutus_title_heading',
        array(
            'sanitize_callback' => 'lz_fitness_sanitize_text'
        )
    ); 
    $wp_customize->add_control(
        new lz_fitness_Customize_Heading(
            $wp_customize,
            'lz_fitness_aboutus_title_heading',
            array(
                'settings'      => 'lz_fitness_aboutus_title_heading',
                'section'       => 'lz_fitness_premium_aboutus_section',
                'label'         => __( 'ABOUT Title & Sub Title', 'lz-fitness-premium' ),
            )
        )
    );   
    lzAddElement($wp_customize, 'lz_fitness_about_sub_title', 'lz_fitness_premium_aboutus_section', 'textarea', $label="Title", 'lz_fitness_sanitize_text', 'About Us');
 
    $wp_customize->add_setting(
        'lz_fitness_aboutus_title',
        array(
            'sanitize_callback' => 'lz_fitness_sanitize_text',
            'default'           => __( 'WHAT WE CAN DO FOR YOU', 'lz-fitness-premium' )
        )
    );
    $wp_customize->add_control(
        'lz_fitness_aboutus_title',
        array(
            'settings'      => 'lz_fitness_aboutus_title',
            'section'       => 'lz_fitness_premium_aboutus_section',
            'type'          => 'text',
            'label'         => __( 'Sub Title for section', 'lz-fitness-premium' )
        )
    );
    
    // $wp_customize->add_setting(
    //     'lz_fitness_aboutus_text',
    //     array(
    //         'sanitize_callback'=>'lz_fitness_sanitize_text',
    //         'default'=> __('Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat', 'lz-fitness-premium')
    //     )
    // );
    // $wp_customize->add_control(
    //     'lz_fitness_aboutus_text',
    //     array(
    //         'settings' =>'lz_fitness_aboutus_text',
    //         'section' => 'lz_fitness_premium_aboutus_section',
    //         'type'=> 'textarea',
    //         'label'=> __('Content for the section', 'lz-fitness-premium')
    //     )
    // );

    $wp_customize->add_setting('lz_fitness_about_npp_heading',array('sanitize_callback' => 'lz_fitness_sanitize_text'));
$wp_customize->add_control(
    new lz_fitness_Customize_Heading(
        $wp_customize,
        'lz_fitness_about_npp_heading',
        array(
            'settings'      => 'lz_fitness_about_npp_heading',
            'section'       => 'lz_fitness_premium_aboutus_section',
            'label'         => __( 'Number Of about Plans', 'lz-fitness-premium' ),
        )
    )
);    
$wp_customize->add_setting('lz_fitness_about_npp_count',array('sanitize_callback' => 'lz_fitness_sanitize_text','default' => 2));
$wp_customize->add_control(
    'lz_fitness_about_npp_count',
    array(
        'settings'      => 'lz_fitness_about_npp_count',
        'section'       => 'lz_fitness_premium_aboutus_section',
        'type'          => 'select',
        'label'         => __( 'Number of plan to show', 'lz-fitness-premium' ),
        'choices'=>array(1,2,3,4,5,6)
    )
);

//about PAGES
for( $i = 1; $i <= 6; $i++ ){
    $wp_customize->add_setting(
        'lz_fitness_about_header'.$i,
        array(
            'sanitize_callback' => 'lz_fitness_sanitize_text'
        )
    );
    $wp_customize->add_control(
        new lz_fitness_Customize_Heading(
            $wp_customize,
            'lz_fitness_about_header'.$i,
            array(
                'settings'      => 'lz_fitness_about_header'.$i,
                'section'       => 'lz_fitness_premium_aboutus_section',
                'label'         => __( 'about Page ', 'lz-fitness-premium' ).$i
            )
        )
    );

    //lzAddImageElement($wp_customize, 'lz_fitness_about_page_icon'.$i, 'lz_fitness_premium_aboutus_section', $label="Recommended Image Size: 150X150px");

lzAddElement($wp_customize, 'lz_fitness_about_page_title_'.$i, 'lz_fitness_premium_aboutus_section', $type = 'text', $label="Title", $callback ='lz_fitness_sanitize_text', $default='Planning');

lzAddElement($wp_customize, 'lz_fitness_about_page_description_'.$i, 'lz_fitness_premium_aboutus_section', $type = 'textarea', $label="Description", $callback ='lz_fitness_sanitize_text', $default='Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book Lorem Ipsum has been.');

    
    // $wp_customize->add_setting(
    //     'lz_fitness_about_page'.$i,
    //     array(
    //         'sanitize_callback' => 'absint'
    //     )
    // );
    // $wp_customize->add_control(
    //     'lz_fitness_about_page'.$i,
    //     array(
    //         'settings'      => 'lz_fitness_about_page'.$i,
    //         'section'       => 'lz_fitness_premium_aboutus_section',
    //         'type'          => 'dropdown-pages',
    //         'label'         => __( 'Select a Page', 'lz-fitness-premium' )
    //     )
    // );
    $wp_customize->add_setting(
        'lz_fitness_about_page_icon'.$i,
        array(
            'default'           => 'fa fa-calendar-o',
            'sanitize_callback' => 'lz_fitness_sanitize_text'
        )
    );        
    $wp_customize->add_control(
        new lz_fitness_Fontawesome_Icon_Chooser(
            $wp_customize,
            'lz_fitness_about_page_icon'.$i,
            array(
                'settings'      => 'lz_fitness_about_page_icon'.$i,
                'section'       => 'lz_fitness_premium_aboutus_section',
                'type'          => 'icon',
                'label'         => __( 'FontAwesome Icon', 'lz-fitness-premium' ),
            )
        )
    );  
    lzAddElement($wp_customize, 'lz_fitness_about_page_url_'.$i, 'lz_fitness_premium_aboutus_section', $type = 'text', $label="Button Link", $callback ='esc_url', $default='Add link here');

    /*code for button text*/
    $wp_customize->add_setting(
        'lz_fitness_about_page_button_title_'.$i,
        array(
            'sanitize_callback'=>'lz_fitness_sanitize_text',
            'default'=> __('Read More', 'lz-fitness-premium')
        )
    );
    $wp_customize->add_control(
        'lz_fitness_about_page_button_title_'.$i,
        array(
            'settings' =>'lz_fitness_about_page_button_title_'.$i,
            'section' => 'lz_fitness_premium_aboutus_section',
            'type'=> 'text',
            'label'=> __('Button Text', 'lz-fitness-premium')
        )
    );


}
// End Feature section 

  //main Heading color
    addColorPalatOption($wp_customize, 'lz_fitness_about_MainHeadingColor', 'lz_fitness_premium_aboutus_section', 'Heading color ', '#ffffff');
    // Heading color
    addColorPalatOption($wp_customize, 'lz_fitness_about_SubHeadingColor', 'lz_fitness_premium_aboutus_section', 'Sub Heading color ', '#ffffff');
    // Title color
    addColorPalatOption($wp_customize, 'lz_fitness_about_TitleColor', 'lz_fitness_premium_aboutus_section', 'Title color', '#000000');
    
    // Text color
    addColorPalatOption($wp_customize, 'lz_fitness_about_TextColor', 'lz_fitness_premium_aboutus_section', 'Text color', '#333333');
    // Icon color
    addColorPalatOption($wp_customize, 'lz_fitness_about_IconColor', 'lz_fitness_premium_aboutus_section', 'Icon color', '#000000');
     // Icon color
    addColorPalatOption($wp_customize, 'lz_fitness_about_ButtonTextColor', 'lz_fitness_premium_aboutus_section', 'Button Text color', '#7854c0');
    addColorPalatOption($wp_customize, 'lz_fitness_about_ButtonBorderColor', 'lz_fitness_premium_aboutus_section', 'Button Border color', '#7854c0');