<?php
/**
 * Createing a bog pannel for customizer
 *
 *
 */
$categories = get_categories(array('hide_empty' => 0));
foreach ($categories as $category) {
	$cat[$category->term_id] = $category->cat_name;
}
/****************************/
// START BLOG SECTION FOR HOME PAGE
/*============BLOG PANEL============*/
$wp_customize->add_section(
	'blog_area',
	array(
		'title' => __( 'Blog Section', 'luzuk-premium' ),
		'panel' => 'luzuk_premium_home_panel',
     	//'priority' => '50',
	)
);
//ENABLE/DISABLE BLOG SECTION
$wp_customize->add_setting(
	'blog_section_disable',
	array(
		'sanitize_callback' => 'luzuk_sanitize_text',
		'default' => 'off'
	)
);
$wp_customize->add_control(
	new luzuk_Switch_Control(
		$wp_customize,
		'blog_section_disable',
		array(
			'settings'      => 'blog_section_disable',
			'section'       => 'blog_area',
			'label'         => __( 'Disable Section', 'luzuk-premium' ),
			'on_off_label'  => array(
				'on' => __( 'Yes', 'luzuk-premium' ),
				'off' => __( 'No', 'luzuk-premium' )
			)   
		)
	)
);


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


lzCustomLable($wp_customize, 'blog_area_blogsectionpadding', 'blog_area', 'Set Padding For Section:');

$wp_customize->add_setting(
    'blog_areaTpadding',
    array(
        'sanitize_callback' => 'luzuk_sanitize_text',
        'default'           => __( '2em', 'luzuk-premium' )
    )
);
$wp_customize->add_control(
    'blog_areaTpadding',
    array(
        'settings'      => 'blog_areaTpadding',
        'section'       => 'blog_area',
        'type'          => 'text',
        'label'         => __( 'Section Top Padding', 'luzuk-premium' )
    )
);
$wp_customize->add_setting(
    'blog_areaBpadding',
    array(
        'sanitize_callback' => 'luzuk_sanitize_text',
        'default'           => __( '2em', 'luzuk-premium' )
    )
);
$wp_customize->add_control(
    'blog_areaBpadding',
    array(
        'settings'      => 'blog_areaBpadding',
        'section'       => 'blog_area',
        'type'          => 'text',
        'label'         => __( 'Section Bottom Padding', 'luzuk-premium' )
    )
);

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


$wp_customize->add_setting(
    'blog_title',
    array(
        'sanitize_callback' => 'luzuk_sanitize_text',
        'default'           => __( 'Latest Event', 'luzuk-premium' )
    )
);
$wp_customize->add_control(
    'blog_title',
    array(
        'settings'      => 'blog_title',
        'section'       => 'blog_area',
        'type'          => 'text',
        'label'         => __( 'Heading for section', 'luzuk-premium' )
    )
);

addColorPalatOption($wp_customize, 'blogarea_heading_color', 'blog_area', 'Heading Color', '#000');


$wp_customize->add_setting(
    'blog_subtitle',
    array(
        'sanitize_callback' => 'luzuk_sanitize_text',
        'default'           => __( 'It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout.', 'luzuk-premium' )
    )
);
$wp_customize->add_control(
    'blog_subtitle',
    array(
        'settings'      => 'blog_subtitle',
        'section'       => 'blog_area',
        'type'          => 'textarea',
        'label'         => __( 'Sub Heading Text', 'luzuk-premium' )
    )
);


addColorPalatOption($wp_customize, 'blogarea_secsubtitle_color', 'blog_area', 'Section Sub Heading Color', '#878586');

//BLOG SETTINGS
$wp_customize->add_setting(
	'blog_post_count',
	array(
		'default'           => '3',
		'sanitize_callback' => 'luzuk_sanitize_choices'
	)
);
$wp_customize->add_control(
	new luzuk_Dropdown_Chooser(
		$wp_customize,
		'blog_post_count',
		array(
			'settings'      => 'blog_post_count',
			'section'       => 'blog_area',
			'label'         => __( 'Number of Posts to show', 'luzuk-premium' ),
			'choices'       => $luzuk_post_count_choice
		)
	)
);
$wp_customize->add_setting(
	'blog_cat_exclude',
	array(
		'sanitize_callback' => 'luzuk_sanitize_text'
	)
);
$wp_customize->add_control(
	new luzuk_Customize_Checkbox_Multiple(
		$wp_customize,
		'blog_cat_exclude',
		array(
			'label' => __('Exclude Category from Blog Posts', 'luzuk-premium'),
			'section' => 'blog_area',
			'settings' => 'blog_cat_exclude',
			'choices' => $luzuk_cat
		)
	)
);
// END BLOG SECTION FOR HOME PAGE
/****************************/


// CREATING A BLOG SECTION IN CUSTOMIZER FOR BLOG PAGES
$wp_customize->add_section(
	'premium_blog_area',
	array(
		'title' => __( 'Blog Page Settings', 'luzuk-premium' ),
        // 'panel' => 'luzuk_premium_home_panel'
		'priority' =>19
	)
);

$wp_customize->add_setting('blog_categories_settings', array('sanitize_callback' => 'luzuk_sanitize_text'));
$wp_customize->add_control('blog_categories_settings', array(
    'settings' => 'blog_categories_settings',
    'label'    => __('Posts on Blog Page', 'luzuk-premium'),
    'section'  => 'lpremium_blog_area',
    'type'     => 'radio',
    'choices'  => array(
        '0' => __('Excerpts','luzuk-premium'),
        '1' => __('Full Posts','luzuk-premium'),
    ),
));
// ADDING THE CATEGORY TO SELECT
$wp_customize->add_setting('luzuk_blog_cat_exclude', array('sanitize_callback' => 'luzuk_sanitize_text'));
$wp_customize->add_control(
	new luzuk_Customize_Checkbox_Multiple(
		$wp_customize,
		'luzuk_blog_cat_exclude',
		array(
			'label' => __('Exclude Category from Blog Posts Page', 'luzuk-premium'),
			'section' => 'premium_blog_area',
			'settings' => 'luzuk_blog_cat_exclude',
			'choices' => $cat
		)
	)
);

lzCustomLable($wp_customize, 'blog_area_blogcolor', 'blog_area', 'Section Color');

addColorPalatOption($wp_customize, 'blogarea_cdatebgclr', 'blog_area', 'Blog Date Background Color', '#f27968');

addColorPalatOption($wp_customize, 'blogarea_cdatebghvclr', 'blog_area', 'Blog Date Background Hover Color', '#000');

addColorPalatOption($wp_customize, 'blogarea_cdateclr', 'blog_area', 'Blog Date Color', '#fff');

addColorPalatOption($wp_customize, 'blogarea_cimgclr', 'blog_area', 'Blog Image Background Color', '#fcecec');

addColorPalatOption($wp_customize, 'blogarea_cimgbrdclr', 'blog_area', 'Blog Image Border Color', '#fff');

addColorPalatOption($wp_customize, 'blogarea_contentbox_color', 'blog_area', 'Blog Content Box Color', '#fff');

addColorPalatOption($wp_customize, 'blogarea_commenticon_color', 'blog_area', 'Blog Admin & Comment Text & Border Color', '#000');

addColorPalatOption($wp_customize, 'blogarea_admi_comment_color', 'blog_area', 'Blog Admin & Comment Icon Color', '#f27968');

addColorPalatOption($wp_customize, 'blogarea_Title_color', 'blog_area', 'Blog Title Color', '#000');

addColorPalatOption($wp_customize, 'blogarea_Titlehover_color', 'blog_area', 'Blog Title Hover Color', '#f27968');

addColorPalatOption($wp_customize, 'blogarea_text_color', 'blog_area', 'Blog Text Color', '#a3a3a3');

lzCustomLable($wp_customize, 'blog_sec_sbtnlr', 'blog_area', 'Section Button Color & Setting:');

$wp_customize->add_setting(
    'homepageblog_txt1',
    array(
        'sanitize_callback' => 'luzuk_sanitize_text',
        'default'           => __( 'Read More', 'luzuk-premium' )
    )
);
$wp_customize->add_control(
    'homepageblog_txt1',
    array(
        'settings'      => 'homepageblog_txt1',
        'section'       => 'blog_area',
        'type'          => 'text',
        'label'         => __( 'Button Text', 'luzuk-premium' )
    )
);

 addColorPalatOption($wp_customize, 'blog_secbtntxtClr', 'blog_area', 'Section Button Text Color ', '#fff');

addColorPalatOption($wp_customize, 'blog_secbtntxthvClr', 'blog_area', 'Section Button Text Hover Color ', '#f27968');

addColorPalatOption($wp_customize, 'blog_secbtnbrdClr', 'blog_area', 'Section Button Border Color ', '#fff');

addColorPalatOption($wp_customize, 'blog_secbtnbgClr', 'blog_area', 'Section Button Background Color ', '#f27968');

addColorPalatOption($wp_customize, 'blog_secbtnbghvClr', 'blog_area', 'Section Button Background Hover Color ', '#f1f1f1');

?>