<?php
/**
 * Customizer helper that defines functions related to the Customizer panel, sections, and settings.
 * 
 * @package Blogbuster 
 */

// Exit if accessed directly
if ( ! defined( 'ABSPATH' ) ) {
    exit;
}

/*---------------------------- General Panel Choices --------------------------------*/

    if ( ! function_exists( 'blogbuster_site_container_layout_choices' ) ) :

        /**
         * Returns the choices for the site container layout.
         *
         * @since 1.0.0
         */
        function blogbuster_site_container_layout_choices() {

            $site_container_layout = apply_filters( 'blogbuster_site_container_layout_choices',
                array(
                    'full-width'    => array(
                        'title'     => __( 'Full Width', 'blogbuster' ),
                        'src'       => get_template_directory_uri() . '/inc/customizer/assets/images/full-width.png'
                    ),
                    'boxed'         => array(
                        'title'     => __( 'Boxed', 'blogbuster' ),
                        'src'       => get_template_directory_uri() . '/inc/customizer/assets/images/boxed.png'
                    ),
                    'separate'         => array(
                        'title'     => __( 'Separate', 'blogbuster' ),
                        'src'       => get_template_directory_uri() . '/inc/customizer/assets/images/seperate.png'
                    )
                )
            );

            return $site_container_layout;

        }

    endif;

    if ( ! function_exists( 'blogbuster_preloader_style_choices' ) ) :

        /**
         * Returns the choices for the preloader styles.
         *
         * @since 1.0.0
         */
        function blogbuster_preloader_style_choices() {

            $preloader_styles = apply_filters( 'blogbuster_preloader_style_choices',
                array(
                    'three_bounce'    => array(
                        'title'     => __( 'Style 1', 'blogbuster' ),
                        'src'       => get_template_directory_uri() . '/inc/customizer/assets/images/three-bounce-preloader.gif'
                    ),
                    'wave'         => array(
                        'title'     => __( 'Style 2', 'blogbuster' ),
                        'src'       => get_template_directory_uri() . '/inc/customizer/assets/images/wave-preloader.gif'
                    ),
                    'folding_cube'         => array(
                        'title'     => __( 'Style 3', 'blogbuster' ),
                        'src'       => get_template_directory_uri() . '/inc/customizer/assets/images/folding-cube-preloader.gif'
                    )
                )
            );

            return $preloader_styles;

        }

    endif;

    if ( ! function_exists( 'blogbuster_sidebar_layout_choices' ) ) :

        /**
         * Returns the choices for the archive sidebar layout.
         *
         * @since 1.0.0
         */
        function blogbuster_sidebar_layout_choices() {

            $sidebar_layouts = apply_filters( 'blogbuster_sidebar_layout_choices',
                array(
                    'right-sidebar'    => array(
                        'title'     => __( 'Right Sidebar', 'blogbuster' ),
                        'src'       => get_template_directory_uri() . '/inc/customizer/assets/images/right-sidebar.png'
                    ),
                    'left-sidebar'  => array(
                        'title'     => __( 'Left Sidebar', 'blogbuster' ),
                        'src'       => get_template_directory_uri() . '/inc/customizer/assets/images/left-sidebar.png'
                    ),
                    'both-sidebar'  => array(
                        'title'     => __( 'Both Sidebar', 'blogbuster' ),
                        'src'       => get_template_directory_uri() . '/inc/customizer/assets/images/both-sidebar.png'
                    ),
                    'no-sidebar'  => array(
                        'title'     => __( 'No Sidebar', 'blogbuster' ),
                        'src'       => get_template_directory_uri() . '/inc/customizer/assets/images/no-sidebar.png'
                    ),
                    'no-sidebar-center'  => array(
                        'title'     => __( 'No Sidebar Center', 'blogbuster' ),
                        'src'       => get_template_directory_uri() . '/inc/customizer/assets/images/no-sidebar-center.png'
                    )
                )
            );

            return $sidebar_layouts;

        }

    endif;

    if ( ! function_exists( 'blogbuster_scroll_top_arrow_choices' ) ) :

        /**
         * Returns the choices for the scroll top arrow.
         *
         * @since 1.0.0
         */
        function blogbuster_scroll_top_arrow_choices() {

            $scroll_top_arrow = apply_filters( 'blogbuster_scroll_top_arrow_choices',
                array(
                    'fa-arrow-up'  => array(
                        'title' => __( 'Arrow 1', 'blogbuster' ),
                        'icon'  => 'fas fa-arrow-up'
                    ),
                    'fa-circle-up'  => array(
                        'title' => __( 'Arrow 2', 'blogbuster' ),
                        'icon'  => 'fas fa-circle-up'
                    ),
                    'fa-chevron-up'  => array(
                        'title' => __( 'Arrow 3', 'blogbuster' ),
                        'icon'  => 'fas fa-chevron-up'
                    ),
                )
            );

            return $scroll_top_arrow;

        }

    endif;

/*---------------------------- Header Panel Choices ---------------------------------*/

    if ( ! function_exists( 'blogbuster_site_identity_tabs_choices' ) ) :

        /**
         * Returns choices for the Site Identity tab fields in the header.
         *
         * @since 1.0.0
         */
        function blogbuster_site_identity_tabs_choices() {

            $site_identity_tabs = apply_filters( 'blogbuster_site_identity_tabs_choices',
                array(
                    'general'   => array(
                        'title'     => __( 'General', 'blogbuster' ),
                        'fields'    => array(
                            'custom_logo',
                            'blogname',
                            'blogdescription',
                            'display_header_text',
                        )
                    ),
                    'design'    => array(
                        'title' => __( 'Design', 'blogbuster' ),
                        'fields'    => array(
                            'header_textcolor'
                        )
                    )
                )
            );

            return $site_identity_tabs;

        }

    endif;

    if ( ! function_exists( 'blogbuster_site_mode_choices' ) ) :

        /**
         * Returns the choices for the site mode.
         *
         * @since 1.0.0
         */
        function blogbuster_site_mode_choices() {

            $site_mode_choices = apply_filters( 'blogbuster_site_mode_choices',
                array(
                    'light-mode'    => __( 'Light', 'blogbuster' ),
                    'dark-mode'     => __( 'Dark', 'blogbuster' ),
                )
            );

            return $site_mode_choices;

        }

    endif;

/*---------------------------------- Innerpage Panel Choices -----------------------------------*/

    if ( ! function_exists( 'blogbuster_archive_page_style_choices' ) ) :

        /**
         * Returns choices for the archive page style.
         *
         * @since 1.0.0
         */
        function blogbuster_archive_page_style_choices() {

            $blogbuster_archive_page_style = apply_filters( 'blogbuster_archive_page_style_choices',
                array(
                    'archive-style--classic'  => __( 'Classic', 'blogbuster' ),
                    'archive-style--grid'     => __( 'Grid', 'blogbuster' ),
                    'archive-style--list'     => __( 'List', 'blogbuster' )
                )
            );

            return $blogbuster_archive_page_style;

        }

    endif;

    if ( ! function_exists( 'blogbuster_archive_read_more_type_choices' ) ) :

        /**
         * Returns choices for the archive read more type.
         *
         * @since 1.0.0
         */
        function blogbuster_archive_read_more_type_choices() {

            $archive_read_more_type = apply_filters( 'blogbuster_archive_read_more_type_choices',
                array(
                    'icon'  => __( 'Icon', 'blogbuster' ),
                    'text'  => __( 'Text', 'blogbuster' )
                )
            );

            return $archive_read_more_type;

        }

    endif;

    if ( ! function_exists( 'blogbuster_archive_read_more_icon_choices' ) ) :

        /**
         * Returns the choices for the archive read more icon.
         *
         * @since 1.0.0
         */
        function blogbuster_archive_read_more_icon_choices() {

            $archive_read_more_icon = apply_filters( 'blogbuster_archive_read_more_icon_choices',
                array(
                    'fa-forward'  => array(
                        'title' => __( 'Icon 1', 'blogbuster' ),
                        'icon'  => 'fas fa-forward'
                    ),
                    'fa-chevron-right'  => array(
                        'title' => __( 'Icon 2', 'blogbuster' ),
                        'icon'  => 'fas fa-chevron-right'
                    )
                )
            );

            return $archive_read_more_icon;

        }

    endif;

/*---------------------------------- Footer Panel Choices -----------------------------------*/

    if ( ! function_exists( 'blogbuster_footer_widget_area_layout_choices' ) ) :

        /**
         * Returns choices for the widget area fields in the footer.
         *
         * @since 1.0.0
         */
        function blogbuster_footer_widget_area_layout_choices() {

            $widget_area_layout = apply_filters( 'blogbuster_footer_widget_area_layout_choices',
                array(
                    'column-one'  => array(
                        'title'     => __( 'Layout 1', 'blogbuster' ),
                        'src'       => get_template_directory_uri() . '/inc/customizer/assets/images/footer-1.png'
                    ),
                    'column-two'  => array(
                        'title'     => __( 'Layout 2', 'blogbuster' ),
                        'src'       => get_template_directory_uri() . '/inc/customizer/assets/images/footer-2.png'
                    ),
                    'column-three'  => array(
                        'title'     => __( 'Layout 2', 'blogbuster' ),
                        'src'       => get_template_directory_uri() . '/inc/customizer/assets/images/footer-3.png'
                    ),
                    'column-four'  => array(
                        'title'     => __( 'Layout 2', 'blogbuster' ),
                        'src'       => get_template_directory_uri() . '/inc/customizer/assets/images/footer-4.png'
                    )
                )
            );

            return $widget_area_layout;

        }

    endif;

/*---------------------------------- Upgrade Control Choices -----------------------------------*/
    
    if ( ! function_exists( 'blogbuster_upgrade_choices' ) ) :

        /**
         * Returns choices for the upgrade to pro.
         *
         * @since 1.0.0
         */
        function blogbuster_upgrade_choices( $setting_id ) {

            $upgrade_info_lists = array(
                'preloader'     => array( __( '15+ Styles', 'blogbuster' ), __( 'Device visibility', 'blogbuster' ) ),
                'social_icon'   => array( __( 'Add unlimited social icons field.', 'blogbuster' ), __( '2 different icon layout.', 'blogbuster' ), __( 'Custom icon size.', 'blogbuster' ), __( 'More icons with official color.', 'blogbuster' ) ),
                'typography'    => array( __( '950+ Google Fonts', 'blogbuster' ), __( 'Adjustable font size', 'blogbuster' ), __( 'Font Color Option', 'blogbuster' ) ),
                'scroll_top'    => array( __( '10+ Arrow Icons', 'blogbuster' ), __( 'Alignment Options', 'blogbuster' ), __( 'Device visibility', 'blogbuster' ), __( 'Color Option', 'blogbuster' ), __( 'Advance Design Option', 'blogbuster' ) ),
                'header_main'    => array( __( '3 more layouts', 'blogbuster' ), __( 'Device visibility for social icons', 'blogbuster' ), __( 'Live search option with different layout', 'blogbuster' ), __( 'Dynamic background options.', 'blogbuster' ) ),
                'front_featured'  => array( __( 'Add unlimited items.', 'blogbuster' ), __( '2 more layouts', 'blogbuster' ), __( 'Carousel setting option.', 'blogbuster' ) ),
                'front_stikcy'  => array( __( '2 more layouts', 'blogbuster' ) ),
                'archive' => array( __( '2 different post layout on each page style.', 'blogbuster' ), __( 'Two different Pagination Types', 'blogbuster' ), __( 'Adjustable excerpt length.', 'blogbuster' ) ),
                'single_post' => array( __( '2 More Post Layouts', 'blogbuster' ),  __( '2 More author box layout', 'blogbuster' ),  __( 'Extra options for post navigation', 'blogbuster' ), __( '2 More Layout for related posts', 'blogbuster' ), __( 'Extra options for related posts section', 'blogbuster' ) )
            );

            $setting_id = explode( 'blogbuster_', $setting_id );
            $setting_id = $setting_id[1];

            return $upgrade_info_lists[$setting_id];

        }

    endif;