<?php
/**
 * Theme Options Panel.
 *
 * @package United Blog
 */

$default = united_blog_get_default_theme_options();

/*slider and its property section*/

require get_template_directory().'/inc/customizer/ticker-post.php';
require get_template_directory().'/inc/customizer/front-page-banner.php';
require get_template_directory().'/inc/customizer/featured-author.php';


require get_template_directory().'/inc/customizer/general-section-setting.php';
require get_template_directory().'/inc/customizer/header-customizer.php';
require get_template_directory().'/inc/customizer/front-page.php';
require get_template_directory().'/inc/customizer/archive-customizer.php';
require get_template_directory().'/inc/customizer/single-customizer.php';
require get_template_directory().'/inc/customizer/suggested-blog.php';
require get_template_directory().'/inc/customizer/color.php';
require get_template_directory().'/inc/customizer/social-share.php';

// Add Theme Options Panel.
$wp_customize->add_panel('theme_general_panel',
	array(
		'title'      => esc_html__('General Settings', 'united-blog'),
		'priority'   => 10,
		'capability' => 'edit_theme_options',
	)
);

$wp_customize->add_panel('front_page_panel',
	array(
		'title'      => esc_html__('Front Page Sections', 'united-blog'),
		'priority'   => 50,
		'capability' => 'edit_theme_options',
	)
);


// Add Theme Options Panel.
$wp_customize->add_panel('theme_option_panel',
    array(
        'title'      => esc_html__('Theme Options', 'united-blog'),
        'priority'   => 200,
        'capability' => 'edit_theme_options',
    )
);

/*layout management section start */
$wp_customize->add_section('theme_option_section_settings',
	array(
		'title'      => esc_html__('Global Sidebar Layout', 'united-blog'),
		'priority'   => 10,
		'capability' => 'edit_theme_options',
		'panel'      => 'theme_option_panel',
	)
);

/*Global Layout*/
$wp_customize->add_setting('global_layout',
	array(
		'default'           => $default['global_layout'],
		'capability'        => 'edit_theme_options',
		'sanitize_callback' => 'united_blog_sanitize_select',
	)
);
$wp_customize->add_control('global_layout',
	array(
		'label'          => esc_html__('Sidebar Options', 'united-blog'),
		'section'        => 'theme_option_section_settings',
		'choices'        => array(
			'left-sidebar'  => esc_html__('Left Sidebar', 'united-blog'),
			'right-sidebar' => esc_html__('Right Sidebar', 'united-blog'),
			'no-sidebar'    => esc_html__('No Sidebar', 'united-blog'),
		),
		'type'     => 'select',
		'priority' =>20,
	)
);

// Footer Section.
$wp_customize->add_section('footer_section',
	array(
		'title'      => esc_html__('Footer Options', 'united-blog'),
		'priority'   => 130,
		'capability' => 'edit_theme_options',
		'panel'      => 'theme_option_panel',
	)
);

// Setting copyright_text.
$wp_customize->add_setting('copyright_text',
	array(
		'default'           => $default['copyright_text'],
		'capability'        => 'edit_theme_options',
		'sanitize_callback' => 'sanitize_text_field',
	)
);
$wp_customize->add_control('copyright_text',
	array(
		'label'    => esc_html__('Footer Copyright Text', 'united-blog'),
		'section'  => 'footer_section',
		'type'     => 'text',
		'priority' => 120,
	)
);


$wp_customize->add_setting('enable_footer_widget',
    array(
        'default'           => $default['enable_footer_widget'],
        'sanitize_callback' => 'united_blog_sanitize_checkbox',
    )
);
$wp_customize->add_control('enable_footer_widget',
    array(
        'label'       => __( 'Show Footer widgetarea', 'united-blog' ),
        'section'     => 'footer_section',
        'type'     => 'checkbox',
    )
);

// Option to choose footer column layout.
$wp_customize->add_setting(
    'footer_column_layout',
    array(
        'default'           => $default['footer_column_layout'],
        'sanitize_callback' => 'united_blog_sanitize_radio',
    )
);
$wp_customize->add_control(
    new United_Blog_Custom_Radio_Image_Control(
        $wp_customize,
        'footer_column_layout',
        array(
            'label'       => __( 'Footer Column Layout', 'united-blog' ),
            'description' => __( 'Some footer widgetareas will not be used based on the footer column layout chosen. Also make sure to insert at least one widget on the respective widgetarea for it to display.', 'united-blog' ),
            'section'     => 'footer_section',
            'choices'     => united_blog_get_footer_layouts(),
            'priority'    => 40,
        )
    )
);

$wp_customize->add_setting('enable_footer_social_menu',
    array(
        'default'           => $default['enable_footer_social_menu'],
        'sanitize_callback' => 'united_blog_sanitize_checkbox',
    )
);
$wp_customize->add_control('enable_footer_social_menu',
    array(
        'label'       => __( 'Enable Footer Social Menu', 'united-blog' ),
        'description' => __( 'Show social menu in the footer area', 'united-blog' ),
        'section'     => 'footer_section',
        'type'        => 'checkbox',
        'priority'    => 130,
    )
);

$wp_customize->add_setting('footer_social_menu_display',
    array(
        'default'           => 'theme_color',
        'sanitize_callback' => 'united_blog_sanitize_select',
    )
);
$wp_customize->add_control('footer_social_menu_display',
    array(
        'label'       => __( 'Footer Social Menu Display', 'united-blog' ),
        'description' => __( 'Choose how to display the social menu icons', 'united-blog' ),
        'section'     => 'footer_section',
        'type'        => 'select',
        'choices'     => array(
            'theme_color' => __('Use Theme Color', 'united-blog'),
            'brand_color' => __('Use Brand Color', 'united-blog'),
            'brand_background_color' => __('Use Background Color', 'united-blog'),
        ),
        'priority'    => 135,
    )
);
