<?php
/**
 * Forest Nature: Customizer-home-page
 *
 * @subpackage Forest Nature
 * @since 1.0
 */

//  Home Page Panel
	$wp_customize->add_panel( 'forest_nature_custompage_panel', array(
		'title' => esc_html__( 'Custom Page Settings', 'forest-nature' ),
		'priority' => 2,
	));
	// Header
    $wp_customize->add_section('forest_nature_header',array(
        'title' => __('Header', 'forest-nature'),
        'panel' => 'forest_nature_custompage_panel',
    ) );
    $wp_customize->add_setting( 'forest_nature_section_contact_heading', array(
			'default'           => '',
			'transport'         => 'refresh',
			'sanitize_callback' => 'sanitize_text_field',
	) );
	$wp_customize->add_control( new Forest_Nature_Customizer_Customcontrol_Section_Heading( $wp_customize, 'forest_nature_section_contact_heading', array(
		'label'       => esc_html__( 'Header Settings', 'forest-nature' ),	
		'description' => __( 'Add contact info in the below feilds', 'forest-nature' ),		
		'section'     => 'forest_nature_header',
		'settings'    => 'forest_nature_section_contact_heading',
	) ) );
	$wp_customize->add_setting('forest_nature_call_text',array(
		'default' => '',
		'sanitize_callback' => 'sanitize_text_field'
	));
	$wp_customize->add_control('forest_nature_call_text',array(
		'label' => esc_html__('Call Text','forest-nature'),
		'section' => 'forest_nature_header',
		'setting' => 'forest_nature_call_text',
		'type'    => 'text'
	));
	$wp_customize->add_setting('forest_nature_call_phone_number',array(
		'default' => '',
		'sanitize_callback' => 'forest_nature_sanitize_phone_number'
	));
	$wp_customize->add_control('forest_nature_call_phone_number',array(
		'label' => esc_html__('Phone Number','forest-nature'),
		'section' => 'forest_nature_header',
		'setting' => 'forest_nature_call_phone_number',
		'type'    => 'text'
	));
	$wp_customize->add_setting('forest_nature_call_icon',array(
		'default'	=> '',
		'sanitize_callback'	=> 'sanitize_text_field'
	));
	$wp_customize->add_control(new Forest_Nature_Fontawesome_Icon_Chooser(
        $wp_customize,'forest_nature_call_icon',array(
		'label'	=> __('Add Phone Icon','forest-nature'),
		'transport' => 'refresh',
		'section'	=> 'forest_nature_header',
		'setting'	=> 'forest_nature_call_icon',
		'type'		=> 'icon'
	)));
	$wp_customize->add_setting('forest_nature_mail_text',array(
		'default' => '',
		'sanitize_callback' => 'sanitize_text_field'
	));
	$wp_customize->add_control('forest_nature_mail_text',array(
		'label' => esc_html__('Email Text','forest-nature'),
		'section' => 'forest_nature_header',
		'setting' => 'forest_nature_mail_text',
		'type'    => 'text'
	));
	$wp_customize->add_setting('forest_nature_mail_email_address',array(
		'default' => '',
		'sanitize_callback' => 'sanitize_email'
	));
	$wp_customize->add_control('forest_nature_mail_email_address',array(
		'label' => esc_html__('Email Address','forest-nature'),
		'section' => 'forest_nature_header',
		'setting' => 'forest_nature_mail_email_address',
		'type'    => 'text'
	));
	$wp_customize->add_setting('forest_nature_mail_icon',array(
		'default'	=> '',
		'sanitize_callback'	=> 'sanitize_text_field'
	));
	$wp_customize->add_control(new Forest_Nature_Fontawesome_Icon_Chooser(
        $wp_customize,'forest_nature_mail_icon',array(
		'label'	=> __('Add Email Icon','forest-nature'),
		'transport' => 'refresh',
		'section'	=> 'forest_nature_header',
		'setting'	=> 'forest_nature_mail_icon',
		'type'		=> 'icon'
	)));
	$wp_customize->add_setting('forest_nature_location_text',array(
		'default' => '',
		'sanitize_callback' => 'sanitize_text_field'
	));
	$wp_customize->add_control('forest_nature_location_text',array(
		'label' => esc_html__('Location Text','forest-nature'),
		'section' => 'forest_nature_header',
		'setting' => 'forest_nature_location_text',
		'type'    => 'text'
	));
	$wp_customize->add_setting('forest_nature_location_address',array(
		'default' => '',
		'sanitize_callback' => 'sanitize_text_field'
	));
	$wp_customize->add_control('forest_nature_location_address',array(
		'label' => esc_html__('Location Address','forest-nature'),
		'section' => 'forest_nature_header',
		'setting' => 'forest_nature_location_address',
		'type'    => 'text'
	));
	$wp_customize->add_setting('forest_nature_address_url',array(
		'default' => '',
		'sanitize_callback' => 'esc_url_raw'
	));
	$wp_customize->add_control('forest_nature_address_url',array(
		'label' => esc_html__('Add Map URL','forest-nature'),
		'section' => 'forest_nature_header',
		'setting' => 'forest_nature_address_url',
		'type'    => 'url'
	));
	$wp_customize->add_setting('forest_nature_location_icon',array(
		'default'	=> '',
		'sanitize_callback'	=> 'sanitize_text_field'
	));
	$wp_customize->add_control(new Forest_Nature_Fontawesome_Icon_Chooser(
        $wp_customize,'forest_nature_location_icon',array(
		'label'	=> __('Add Location Icon','forest-nature'),
		'transport' => 'refresh',
		'section'	=> 'forest_nature_header',
		'setting'	=> 'forest_nature_location_icon',
		'type'		=> 'icon'
	)));
	$wp_customize->add_setting('forest_nature_timing_text',array(
		'default' => '',
		'sanitize_callback' => 'sanitize_text_field'
	));
	$wp_customize->add_control('forest_nature_timing_text',array(
		'label' => esc_html__('Timing Text','forest-nature'),
		'section' => 'forest_nature_header',
		'setting' => 'forest_nature_timing_text',
		'type'    => 'text'
	));
	$wp_customize->add_setting('forest_nature_timing_open_time',array(
		'default' => '',
		'sanitize_callback' => 'sanitize_text_field'
	));
	$wp_customize->add_control('forest_nature_timing_open_time',array(
		'label' => esc_html__('Opening Timing','forest-nature'),
		'section' => 'forest_nature_header',
		'setting' => 'forest_nature_timing_open_time',
		'type'    => 'text'
	));
	$wp_customize->add_setting('forest_nature_timimg_icon',array(
		'default'	=> '',
		'sanitize_callback'	=> 'sanitize_text_field'
	));
	$wp_customize->add_control(new Forest_Nature_Fontawesome_Icon_Chooser(
        $wp_customize,'forest_nature_timimg_icon',array(
		'label'	=> __('Add Opening Timing Icon','forest-nature'),
		'transport' => 'refresh',
		'section'	=> 'forest_nature_header',
		'setting'	=> 'forest_nature_timimg_icon',
		'type'		=> 'icon'
	)));
	$wp_customize->add_setting('forest_nature_top_heading',array(
		'default' => '',
		'sanitize_callback' => 'sanitize_text_field'
	));
	$wp_customize->add_control('forest_nature_top_heading',array(
		'label' => esc_html__('top Text','forest-nature'),
		'section' => 'forest_nature_header',
		'setting' => 'forest_nature_top_heading',
		'type'    => 'text',
	));

    //Slider
	$wp_customize->add_section( 'forest_nature_slider_section' , array(
    	'title'      => __( 'Slider Settings', 'forest-nature' ),
    	'panel' => 'forest_nature_custompage_panel',
	) );
	$wp_customize->add_setting( 'forest_nature_section_slide_heading', array(
			'default'           => '',
			'transport'         => 'refresh',
			'sanitize_callback' => 'sanitize_text_field',
	) );
	$wp_customize->add_control( new Forest_Nature_Customizer_Customcontrol_Section_Heading( $wp_customize, 'forest_nature_section_slide_heading', array(
		'label'       => esc_html__( 'Slider Settings', 'forest-nature' ),
		'description' => __( 'Slider Image Dimension ( 1600px x 650px )', 'forest-nature' ),		
		'section'     => 'forest_nature_slider_section',
		'settings'    => 'forest_nature_section_slide_heading',
	) ) );
	$wp_customize->add_setting(
		'forest_nature_slider_arrows',
		array(
			'type'                 => 'option',
			'capability'           => 'edit_theme_options',
			'theme_supports'       => '',
			'default'              => '1',
			'transport'            => 'refresh',
			'sanitize_callback'    => 'forest_nature_callback_sanitize_switch',
		)
	);
	$wp_customize->add_control(
		new Forest_Nature_Customizer_Customcontrol_Switch(
			$wp_customize,
			'forest_nature_slider_arrows',
			array(
				'settings'        => 'forest_nature_slider_arrows',
				'section'         => 'forest_nature_slider_section',
				'label'           => __( 'Check To show Slider', 'forest-nature' ),				
				'choices'		  => array(
					'1'      => __( 'On', 'forest-nature' ),
					'off'    => __( 'Off', 'forest-nature' ),
				),
				'active_callback' => '',
			)
		)
	);
	$wp_customize->add_setting('forest_nature_slide_heading',array(
		'default' => '',
		'sanitize_callback' => 'sanitize_text_field'
	));
	$wp_customize->add_control('forest_nature_slide_heading',array(
		'label' => esc_html__('Slider Sub Heading','forest-nature'),
		'section' => 'forest_nature_slider_section',
		'setting' => 'forest_nature_slide_heading',
		'type'    => 'text',
	));

	$wp_customize->add_setting('forest_nature_slider_sub_heading_color', array(
	    'default' => '#ffffff',
	    'sanitize_callback' => 'sanitize_hex_color',
	    'transport' => 'refresh',
	));

	$wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'forest_nature_slider_sub_heading_color', array(
	    'section' => 'forest_nature_slider_section',
	    'label' => esc_html__('Slider Sub Heading Color', 'forest-nature'),
	)));

	$wp_customize->add_setting('forest_nature_slider_count',array(
		'default'	=> '',
		'sanitize_callback'	=> 'sanitize_text_field'
	));
	$wp_customize->add_control('forest_nature_slider_count',array(
		'label'	=> esc_html__('Slider Count','forest-nature'),
		'section'	=> 'forest_nature_slider_section',
		'type'		=> 'number',
	));

	$categories = get_categories();
	$cats = array();
	$i = 0;
	$cat_post[]= 'select';
	foreach($categories as $category){
		if($i==0){
		  $default = $category->slug;
		  $i++;
		}
		$cat_post[$category->slug] = $category->name;
	}
	$wp_customize->add_setting('forest_nature_post_setting',array(
		'default' => 'select',
		'sanitize_callback' => 'forest_nature_sanitize_select',
	));
	$wp_customize->add_control('forest_nature_post_setting',array(
		'type'    => 'select',
		'choices' => $cat_post,
		'label' => esc_html__('Select Category to display slider','forest-nature'),
		'section' => 'forest_nature_slider_section',
	));

	$wp_customize->add_setting('forest_nature_slider_heading_color', array(
	    'default' => '#ffffff',
	    'sanitize_callback' => 'sanitize_hex_color',
	    'transport' => 'refresh',
	));

	$wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'forest_nature_slider_heading_color', array(
	    'section' => 'forest_nature_slider_section',
	    'label' => esc_html__('Slider Title Color', 'forest-nature'),
	)));

	$wp_customize->add_setting(
		'forest_nature_slider_excerpt_show_hide',
		array(
			'type'                 => 'option',
			'capability'           => 'edit_theme_options',
			'theme_supports'       => '',
			'default'              => '1',
			'transport'            => 'refresh',
			'sanitize_callback'    => 'forest_nature_callback_sanitize_switch',
		)
	);
	$wp_customize->add_control(
		new Forest_Nature_Customizer_Customcontrol_Switch(
			$wp_customize,
			'forest_nature_slider_excerpt_show_hide',
			array(
				'settings'        => 'forest_nature_slider_excerpt_show_hide',
				'section'         => 'forest_nature_slider_section',
				'label'           => __( 'Show Hide excerpt', 'forest-nature' ),				
				'choices'		  => array(
					'1'      => __( 'On', 'forest-nature' ),
					'off'    => __( 'Off', 'forest-nature' ),
				),
			)
		)
	);
	$wp_customize->add_setting('forest_nature_slider_excerpt_count',array(
		'default'=> 30,
		'transport' => 'refresh',
		'sanitize_callback' => 'forest_nature_sanitize_integer'
	));
	$wp_customize->add_control(new Forest_Nature_Slider_Custom_Control( $wp_customize, 'forest_nature_slider_excerpt_count',array(
		'label' => esc_html__( 'Excerpt Limit','forest-nature' ),
		'section'=> 'forest_nature_slider_section',
		'settings'=>'forest_nature_slider_excerpt_count',
		'input_attrs' => array(
			'reset'			   => 30,
            'step'             => 1,
			'min'              => 0,
			'max'              => 50,
        ),
	)));
	$wp_customize->add_setting('forest_nature_slider_excerpt_color', array(
	    'default' => '#ffffff',
	    'sanitize_callback' => 'sanitize_hex_color',
	    'transport' => 'refresh',
	));

	$wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'forest_nature_slider_excerpt_color', array(
	    'section' => 'forest_nature_slider_section',
	    'label' => esc_html__('Slider Excerpt Color', 'forest-nature'),
	)));
	$wp_customize->add_setting(
		'forest_nature_slider_button_show_hide',
		array(
			'type'                 => 'option',
			'capability'           => 'edit_theme_options',
			'theme_supports'       => '',
			'default'              => '1',
			'transport'            => 'refresh',
			'sanitize_callback'    => 'forest_nature_callback_sanitize_switch',
		)
	);
	$wp_customize->add_control(
		new Forest_Nature_Customizer_Customcontrol_Switch(
			$wp_customize,
			'forest_nature_slider_button_show_hide',
			array(
				'settings'        => 'forest_nature_slider_button_show_hide',
				'section'         => 'forest_nature_slider_section',
				'label'           => __( 'Show Hide Button', 'forest-nature' ),				
				'choices'		  => array(
					'1'      => __( 'On', 'forest-nature' ),
					'off'    => __( 'Off', 'forest-nature' ),
				),
			)
		)
	);
	$wp_customize->add_setting('forest_nature_slider_read_more',array(
		'default' => 'Read More',
		'sanitize_callback' => 'sanitize_text_field'
	)); 
	$wp_customize->add_control('forest_nature_slider_read_more',array(
		'label' => esc_html__('Button Text','forest-nature'),
		'section' => 'forest_nature_slider_section',
		'setting' => 'forest_nature_slider_read_more',
		'type'    => 'text',
	));

	$wp_customize->add_setting('forest_nature_slider_content_alignment',array(
        'default' => 'LEFT-ALIGN',
        'sanitize_callback' => 'forest_nature_sanitize_choices'
	));
	$wp_customize->add_control('forest_nature_slider_content_alignment',array(
		'type' => 'radio',
		'label'     => __('Slider Content Alignment', 'forest-nature'),
		'section' => 'forest_nature_slider_section',
		'type' => 'select',
		'choices' => array(
			'LEFT-ALIGN' => __('LEFT','forest-nature'),
            'CENTER-ALIGN' => __('CENTER','forest-nature'),
            'RIGHT-ALIGN' => __('RIGHT','forest-nature'),
		),
	) );
	$wp_customize->add_setting('forest_nature_slider_overlay', array(
	    'default' => '#000000',
	    'sanitize_callback' => 'sanitize_hex_color',
	    'transport' => 'refresh',
	));

	$wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'forest_nature_slider_overlay', array(
	    'section' => 'forest_nature_slider_section',
	    'label' => esc_html__('Slider Overlay Color', 'forest-nature'),
	)));
	$wp_customize->add_setting('forest_nature_slider_opacity',array(
        'default' => '0.5',
        'sanitize_callback' => 'forest_nature_sanitize_choices'
	));
	$wp_customize->add_control('forest_nature_slider_opacity',array(
		'type' => 'radio',
		'label'     => __('Slider Opacity', 'forest-nature'),
		'section' => 'forest_nature_slider_section',
		'type' => 'select',
		'choices' => array(
			'0' => __('0','forest-nature'),
			'0.1' => __('0.1','forest-nature'),
			'0.2' => __('0.2','forest-nature'),
			'0.3' => __('0.3','forest-nature'),
			'0.4' => __('0.4','forest-nature'),
			'0.5' => __('0.5','forest-nature'),
			'0.6' => __('0.6','forest-nature'),
			'0.7' => __('0.7','forest-nature'),
			'0.8' => __('0.8','forest-nature'),
			'0.9' => __('0.9','forest-nature'),
			'1' => __('1','forest-nature')
		),
	) );

	// About Section
	$wp_customize->add_section( 'forest_nature_services_section' , array(
    	'title'      => __( 'About Us Section Settings', 'forest-nature' ),
    	'panel' => 'forest_nature_custompage_panel',
	) );
	$wp_customize->add_setting( 'forest_nature_section_about_heading', array(
		'default'           => '',
		'transport'         => 'refresh',
		'sanitize_callback' => 'sanitize_text_field',
	) );
	$wp_customize->add_control( new Forest_Nature_Customizer_Customcontrol_Section_Heading( $wp_customize, 'forest_nature_section_about_heading', array(
		'label'       => esc_html__( 'About Us Settings', 'forest-nature' ),
		'section'     => 'forest_nature_services_section',
		'settings'    => 'forest_nature_section_about_heading',
	) ) );
	$wp_customize->add_setting(
		'forest_nature_about_enable',
		array(
			'type'                 => 'option',
			'capability'           => 'edit_theme_options',
			'theme_supports'       => '',
			'default'              => '1',
			'transport'            => 'refresh',
			'sanitize_callback'    => 'forest_nature_callback_sanitize_switch',
		)
	);
	$wp_customize->add_control(
		new Forest_Nature_Customizer_Customcontrol_Switch(
			$wp_customize,
			'forest_nature_about_enable',
			array(
				'settings'        => 'forest_nature_about_enable',
				'section'         => 'forest_nature_services_section',
				'label'           => __( 'Check To show Section', 'forest-nature' ),				
				'choices'		  => array(
					'1'      => __( 'On', 'forest-nature' ),
					'off'    => __( 'Off', 'forest-nature' ),
				),
				'active_callback' => '',
			)
		)
	);
    $wp_customize->add_setting('forest_nature_services_heading',array(
		'default'	=> '',
		'sanitize_callback'	=> 'sanitize_text_field'
	));
	$wp_customize->add_control('forest_nature_services_heading',array(
		'label'	=> esc_html__('Add Heading','forest-nature'),
		'section'	=> 'forest_nature_services_section',
		'type'		=> 'text',
	));
	$wp_customize->add_setting('forest_nature_about_us_settigs',array(
		'sanitize_callback' => 'forest_nature_sanitize_dropdown_pages',
	));
	$wp_customize->add_control('forest_nature_about_us_settigs',array(
		'type'    => 'dropdown-pages',
		'label' => __('Select Page','forest-nature'),
		'section' => 'forest_nature_services_section',
	));

	//Footer
    $wp_customize->add_section( 'forest_nature_footer_copyright', array(
    	'title' => esc_html__( 'Footer Text', 'forest-nature' ),
    	'panel' => 'forest_nature_custompage_panel',
	) );
	$wp_customize->add_setting( 'forest_nature_section_footer_heading', array(
		'default'           => '',
		'transport'         => 'refresh',
		'sanitize_callback' => 'sanitize_text_field',
	) );
	$wp_customize->add_control( new Forest_Nature_Customizer_Customcontrol_Section_Heading( $wp_customize, 'forest_nature_section_footer_heading', array(
		'label'       => esc_html__( 'Footer Settings', 'forest-nature' ),		
		'section'     => 'forest_nature_footer_copyright',
		'settings'    => 'forest_nature_section_footer_heading',
	) ) );
    $wp_customize->add_setting('forest_nature_footer_text',array(
			'default'	=> 'Forest Nature WordPress Theme',
			'sanitize_callback'	=> 'sanitize_text_field'
	));
	$wp_customize->add_control('forest_nature_footer_text',array(
			'label'	=> esc_html__('Copyright Text','forest-nature'),
			'section'	=> 'forest_nature_footer_copyright',
			'type'		=> 'textarea'
	));
	$wp_customize->add_setting('forest_nature_footer_content_alignment',array(
        'default' => 'CENTER-ALIGN',
        'sanitize_callback' => 'forest_nature_sanitize_choices'
	));
	$wp_customize->add_control('forest_nature_footer_content_alignment',array(
		'type' => 'radio',
		'label'     => __('Footer Content Alignment', 'forest-nature'),
		'section' => 'forest_nature_footer_copyright',
		'type' => 'select',
		'choices' => array(
			'LEFT-ALIGN' => __('LEFT','forest-nature'),
            'CENTER-ALIGN' => __('CENTER','forest-nature'),
            'RIGHT-ALIGN' => __('RIGHT','forest-nature'),
		),
	) );

	$wp_customize->add_setting(
		'forest_nature_footer_widgets_show_hide',
		array(
			'type'                 => 'option',
			'capability'           => 'edit_theme_options',
			'theme_supports'       => '',
			'default'              => '1',
			'transport'            => 'refresh',
			'sanitize_callback'    => 'forest_nature_callback_sanitize_switch',
		)
	);
	$wp_customize->add_control(
		new Forest_Nature_Customizer_Customcontrol_Switch(
			$wp_customize,
			'forest_nature_footer_widgets_show_hide',
			array(
				'settings'        => 'forest_nature_footer_widgets_show_hide',
				'section'         => 'forest_nature_footer_copyright',
				'label'           => __( 'Check To show Footer Widgets', 'forest-nature' ),
				'choices'		  => array(
					'1'      => __( 'On', 'forest-nature' ),
					'off'    => __( 'Off', 'forest-nature' ),
				),
				'active_callback' => '',
			)
		)
	);

	$wp_customize->add_setting('forest_nature_footer_widget',array(
        'default' => '4',
        'sanitize_callback' => 'forest_nature_sanitize_choices'
	));
	$wp_customize->add_control('forest_nature_footer_widget',array(
		'type' => 'radio',
		'label'     => __('Footer Per Column', 'forest-nature'),
		'section' => 'forest_nature_footer_copyright',
		'type' => 'select',
		'choices' => array(
			'1' => __('1','forest-nature'),
            '2' => __('2','forest-nature'),
            '3' => __('3','forest-nature'),
            '4' => __('4','forest-nature'),
		)
	) );