<?php
/**
 * Createing a bog pannel for customizer
 *
 *
 */
$lz_fitness_categories = get_categories(array('hide_empty' => 0));
foreach ($lz_fitness_categories as $lz_fitness_category) {
	$lz_fitness_cat[$lz_fitness_category->term_id] = $lz_fitness_category->cat_name;
}
/****************************/
// START BLOG SECTION FOR HOME PAGE
/*============BLOG PANEL============*/
$wp_customize->add_section(
	'lz_fitness_blog_section',
	array(
		'title' => __( 'Latest Blog Section', 'lz-fitness-premium' ),
		'panel' => 'lz_fitness_premium_home_panel',
     	//'priority' => '50',
	)
);
//ENABLE/DISABLE BLOG SECTION
$wp_customize->add_setting(
	'lz_fitness_blog_section_disable',
	array(
		'sanitize_callback' => 'lz_fitness_sanitize_text',
		'default' => 'off'
	)
);
$wp_customize->add_control(
	new lz_fitness_Switch_Control(
		$wp_customize,
		'lz_fitness_blog_section_disable',
		array(
			'settings'      => 'lz_fitness_blog_section_disable', 
			'section'       => 'lz_fitness_blog_section',
			'label'         => __( 'Disable Section', 'lz-fitness-premium' ),
			'on_off_label'  => array(
				'on' => __( 'Yes', 'lz-fitness-premium' ),
				'off' => __( 'No', 'lz-fitness-premium' )
			)   
		)
	)
);

//backgroundManager($wp_customize, 'blog', 'lz_fitness_blog_section', $color='#a556d4');
backgroundManager($wp_customize, 'blog', 'lz_fitness_blog_section', $color='#ffffff');  

//backgroundManager($wp_customize, 'blog', 'lz_fitness_blog_section', $color='#a556d4');
//backgroundManager($wp_customize, 'blog', 'lz_fitness_blog_section', $color='#ffffff', get_template_directory_uri().'/images/blogbanner.png', 'img');

$wp_customize->add_setting(
	'lz_fitness_blog_title_subtitle_heading',
	array(
		'sanitize_callback' => 'lz_fitness_sanitize_text'
	)
);
$wp_customize->add_control(
	new lz_fitness_Customize_Heading(
		$wp_customize,
		'lz_fitness_blog_title_subtitle_heading',
		array(
			'settings'      => 'lz_fitness_blog_title_subtitle_heading',
			'section'       => 'lz_fitness_blog_section',
			'label'         => __( 'Section Title', 'lz-fitness-premium' ),
		)
	)
);
$wp_customize->add_setting(
	'lz_fitness_blog_sub_title',
	array(
		'sanitize_callback' => 'lz_fitness_sanitize_text',
		'default'           => __( 'Lorem Ipsum is simply dummy text of the printing', 'lz-fitness-premium' )
	)
);
$wp_customize->add_control(
	'lz_fitness_blog_sub_title',
	array(
		'settings'      => 'lz_fitness_blog_sub_title',
		'section'       => 'lz_fitness_blog_section',
		'type'          => 'textarea',
		'label'         => __( 'Title', 'lz-fitness-premium' )
	)
);


$wp_customize->add_setting(
	'lz_fitness_blog_title',
	array(
		'sanitize_callback' => 'lz_fitness_sanitize_text',
		'default'           => __( 'LATEST BLOG', 'lz-fitness-premium' )
	)
);
$wp_customize->add_control(
	'lz_fitness_blog_title',
	array(
		'settings'      => 'lz_fitness_blog_title',
		'section'       => 'lz_fitness_blog_section',
		'type'          => 'text',
		'label'         => __( 'Sub Title', 'lz-fitness-premium' )
	)
);
// Sub Heading color
addColorPalatOption($wp_customize, 'lz_fitness_blog_SubHeadingColor', 'lz_fitness_blog_section', ' Heading color', '#7854c0');
// Heading color
addColorPalatOption($wp_customize, 'lz_fitness_blog_HeadingColor', 'lz_fitness_blog_section', 'Sub Heading color', '#191919');

// Title color
addColorPalatOption($wp_customize, 'lz_fitness_blog_TitleColor', 'lz_fitness_blog_section', 'Title color', '#7854c0');

// Text color
addColorPalatOption($wp_customize, 'lz_fitness_blog_TextColor', 'lz_fitness_blog_section', 'Text color', '#333333');


addColorPalatOption($wp_customize, 'lz_fitness_blog_BlogbtntxtTextColor', 'lz_fitness_blog_section', 'Button Text color', '#ffffff');
addColorPalatOption($wp_customize, 'lz_fitness_blog_BlogbtnbgssColor', 'lz_fitness_blog_section', 'Button Background color', '#7854c0');



//BLOG SETTINGS
$wp_customize->add_setting(
	'lz_fitness_blog_post_count',
	array(
		'default'           => '3',
		'sanitize_callback' => 'lz_fitness_sanitize_choices'
	)
);
$wp_customize->add_control(
	new lz_fitness_Dropdown_Chooser(
		$wp_customize,
		'lz_fitness_blog_post_count',
		array(
			'settings'      => 'lz_fitness_blog_post_count',
			'section'       => 'lz_fitness_blog_section',
			'label'         => __( 'Number of Posts to show', 'lz-fitness-premium' ),
			'choices'       => $lz_fitness_post_count_choice
		)
	)
);
$wp_customize->add_setting(
	'lz_fitness_blog_cat_exclude',
	array(
		'sanitize_callback' => 'lz_fitness_sanitize_text'
	)
);
$wp_customize->add_control(
	new lz_fitness_Customize_Checkbox_Multiple(
		$wp_customize,
		'lz_fitness_blog_cat_exclude',
		array(
			'label' => __('Exclude Category from Blog Posts', 'lz-fitness-premium'),
			'section' => 'lz_fitness_blog_section',
			'settings' => 'lz_fitness_blog_cat_exclude',
			'choices' => $lz_fitness_cat
		)
	)
);
// END BLOG SECTION FOR HOME PAGE
/****************************/


// CREATING A BLOG SECTION IN CUSTOMIZER FOR BLOG PAGES
$wp_customize->add_section(
	'lz_fitness_premium_blog_section',
	array(
		'title' => __( 'Blog Page Settings', 'lz-fitness-premium' ),
        // 'panel' => 'lz_fitness_premium_home_panel'
		'priority' =>19
	)
);
// ENABLE/DISABLE FEATURED SECTION
/*$wp_customize->add_setting(
	'lz_fitness_premium_blog_section_disable',
	array(
		'sanitize_callback' => 'lz_fitness_sanitize_text',
	)
);
$wp_customize->add_control(
	new lz_fitness_Switch_Control(
		$wp_customize,
		'lz_fitness_premium_blog_section_disable',
		array(
			'settings'      => 'lz_fitness_premium_blog_section_disable',
			'section'       => 'lz_fitness_premium_blog_section',
			'label'         => __( 'Show Title and description at top', 'lz-fitness-premium' ),
			'on_off_label'  => array(
				'on' => __( 'Yes', 'lz-fitness-premium' ),
				'off' => __( 'No', 'lz-fitness-premium' )
			),
		)
	)
);*/
/*
$wp_customize->add_setting(
	'lz_fitness_blog_title_heading',
	array(
		'sanitize_callback' => 'lz_fitness_sanitize_text'
	)
);
$wp_customize->add_control(
	new lz_fitness_Customize_Heading(
		$wp_customize,
		'lz_fitness_blog_title_heading',
		array(
			'settings'      => 'lz_fitness_blog_title_heading',
			'section'       => 'lz_fitness_premium_blog_section',
			'label'         => __( 'Blog Title & description', 'lz-fitness-premium' ),
		)
	)
);
//BLOG PAGE TITLE
$wp_customize->add_setting('lz_fitness_blog_title', array('sanitize_callback' => 'lz_fitness_sanitize_text'));
$wp_customize->add_control('lz_fitness_blog_title', array('settings'=>'lz_fitness_blog_title', 'section'=>'lz_fitness_premium_blog_section','type'=>'text', 'label'=> __('Blog page title', 'lz-fitness-premium')));
// BLOG PAGE DESCRIPTION
$wp_customize->add_setting('lz_fitness_blog_desc', array('sanitize_callback' => 'lz_fitness_sanitize_text'));
$wp_customize->add_control('lz_fitness_blog_desc', array('settings'=>'lz_fitness_blog_desc', 'section'=>'lz_fitness_premium_blog_section','type'=>'textarea', 'label'=> __('Blog page description', 'lz-fitness-premium')));*/

$wp_customize->add_setting('lz_fitness_blog_categories_settings', array('sanitize_callback' => 'lz_fitness_sanitize_text'));
$wp_customize->add_control('lz_fitness_blog_categories_settings', array(
    'settings' => 'lz_fitness_blog_categories_settings',
    'label'    => __('Posts on Blog Page', 'lz-fitness-premium'),
    'section'  => 'lz_fitness_premium_blog_section',
    'type'     => 'radio',
    'choices'  => array(
        '0' => __('Excerpts','lz-fitness-premium'),
        '1' => __('Full Posts','lz-fitness-premium'),
    ),
));
// ADDING THE CATEGORY TO SELECT
$wp_customize->add_setting('lz_fitness_blog_categories', array('sanitize_callback' => 'lz_fitness_sanitize_text'));
$wp_customize->add_control(
	new lz_fitness_Customize_Checkbox_Multiple(
		$wp_customize,
		'lz_fitness_blog_categories',
		array(
			'label' => __('Exclude Category from Blog Posts', 'lz-fitness-premium'),
			'section' => 'lz_fitness_premium_blog_section',
			'settings' => 'lz_fitness_blog_categories',
			'choices' => $lz_fitness_cat
		)
	)
);



