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

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

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

    if ( ! function_exists( 'purenote_site_container_layout_choices' ) ) :

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

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

            return $site_container_layout;

        }

    endif;

    if ( ! function_exists( 'purenote_preloader_style_choices' ) ) :

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

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

            return $preloader_styles;

        }

    endif;

    
    
    if ( ! function_exists( 'purenote_scroll_top_arrow_choices' ) ) :

        /**
         * function to return choices of scroll top arrow.
         *
         * @since 1.0.0
         */
        function purenote_scroll_top_arrow_choices() {

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

            return $scroll_top_arrow;

        }

    endif;

    
    if ( ! function_exists( 'purenote_sidebar_layout_choices' ) ) :

        /**
         * function to return choices for archive sidebar layouts.
         *
         * @since 1.0.0
         */
        function purenote_sidebar_layout_choices() {

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

            return $sidebar_layouts;

        }

    endif;

    
 if ( ! function_exists( 'purenote_posts_date_style_choices' ) ) :

        /**
         * function to return choices for posts date style
         *
         * @since 1.0.0
         */
        function purenote_posts_date_style_choices() {

            $posts_date_style_choices = apply_filters( 'purenote_posts_date_style_choices',
                array(
                    'publish'   => __( 'Published date', 'purenote' ),
                    'modify'    => __( 'Updated date', 'purenote' )
                )
            );

            return $posts_date_style_choices;

        }

    endif;

    if ( ! function_exists( 'purenote_posts_date_format_choices' ) ) :

        /**
         * function to return choices for posts date format
         *
         * @since 1.0.0
         */
        function purenote_posts_date_format_choices() {

            $posts_date_format_choices = apply_filters( 'purenote_posts_date_format_choices',
                array(
                    'default'       => __( 'Default by WordPress', 'purenote' ),
                    'format_one'    => __( 'Theme Format One', 'purenote' )
                )
            );

            return $posts_date_format_choices;

        }

    endif;

    if ( ! function_exists( 'purenote_posts_thumbnail_hover_effect_choices' ) ) :

        /**
         * function to return choices for posts thumbnail hover effect
         *
         * @since 1.0.0
         */
        function purenote_posts_thumbnail_hover_effect_choices() {

            $posts_thumb_effect_choices = apply_filters( 'purenote_posts_thumbnail_hover_effect_choices',
                array(
                    'none'              => __( 'None', 'purenote' ),
                    'hover-effect--one' => __( 'Hover Effect One', 'purenote' ),
                )
            );

            return $posts_thumb_effect_choices;

        }

    endif;

    if ( ! function_exists( 'purenote_posts_order_by_choices' ) ) :
        /**
         * function to return choices of posts order by.
         *
         * @since 1.0.0
         */
        function purenote_posts_order_by_choices() {
            $posts_order_by = apply_filters( 'purenote_posts_order_by_choices',
                array(
                    'date-desc'     => __( 'Newest - Oldest', 'purenote' ),
                    'date-asc'      => __( 'Oldest - Newest', 'purenote' ),
                    'title-asc'     => __( 'A - Z', 'purenote' ),
                    'title-desc'    => __( 'Z - A', 'purenote' ),
                    'rand-desc'     => __( 'Random', 'purenote' ),
                )
            );
            return $posts_order_by;
        }
    endif;
    if ( ! function_exists( 'purenote_posts_date_filter_choices' ) ) :
        /**
         * function to return choices of posts date filter.
         *
         * @since 1.0.0
         */
        function purenote_posts_date_filter_choices() {
            $posts_date_filter = apply_filters( 'purenote_posts_date_filter_choices',
                array(
                    'all'           => __( 'All', 'purenote' ),
                    'today'         => __( 'Today', 'purenote' ),
                    'this-week'     => __( 'This Week', 'purenote' ),
                    'last-week'     => __( 'Last Week', 'purenote' ),
                    'this-month'    => __( 'This Month', 'purenote' ),
                    'last-month'    => __( 'Last Month', 'purenote' )
                )
            );
            return $posts_date_filter;
        }
    endif;

    
    if ( ! function_exists( 'purenote_bg_type_choices' ) ) :

        /**
         * function to return choices for background type.
         *
         * @since 1.0.0
         */
        function purenote_bg_type_choices() {

            $bg_types = apply_filters( 'purenote_bg_type_choices',
                array(
                    'bg-none'   => __( 'None', 'purenote' ),
                    'bg-color'  => __( 'Color', 'purenote' ),
                    'bg-image'  => __( 'Image', 'purenote' ),
                )
            );

            return $bg_types;

        }

    endif;

/*---------------------------- Header Panel Choices ---------------------------------*/
    
        if ( ! function_exists( 'purenote_header_area_tabs_choices' ) ) :

        /**
         * function to return choices for header area tab fields.
         *
         * @since 1.0.0
         */
        function purenote_header_area_tabs_choices() {

            $header_tab_fields = apply_filters( 'purenote_header_area_tabs_choices',
                array(
                    'general'   => array(
                        'title'     => __( 'General', 'purenote' ),
                        'fields'    => array(
                            'purenote_header_top_enable',
                            'purenote_header_date_enable',
                            'purenote_header_date_format',
                            'purenote_header_social_icons_enable'
                        )
                    ),
                    'design'    => array(
                        'title' => __( 'Design', 'purenote' ),
                        'fields'    => array(
                            'purenote_header_bg_color',
                            'purenote_top_header_text_color',
                        )
                    )
                )
            );

            return $header_tab_fields;

        }

    endif;

    if ( ! function_exists( 'purenote_header_date_format_choices' ) ) :

        /**
         * function to return choices for header top date format.
         *
         * @since 1.0.0
         */
        function purenote_header_date_format_choices() {

            $header_top_tab_fields = apply_filters( 'purenote_header_date_format_choices',
                array(
                    'date_format_1' => __( '01 Jan, 2023', 'purenote' ),
                    'date_format_2' => __( '01 January, 2023', 'purenote' ),
                )
            );

            return $header_top_tab_fields;

        }

    endif;


    if ( ! function_exists( 'purenote_site_identity_tabs_choices' ) ) :

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

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

            return $site_identity_tabs;

        }

    endif;


/*---------------------------------- Frontpage Panel Choices -----------------------------------*/
    if ( ! function_exists( 'purenote_frontpage_banner_tabs_choices' ) ) :
        /**
         * function to return choices for frontpage banner tab fields.
         *
         * @since 1.0.0
         */
        function purenote_frontpage_banner_tabs_choices() {
            $frontpage_banner_tab_fields = apply_filters( 'purenote_frontpage_banner_tabs_choices',
                array(
                    'general'   => array(
                        'title'     => __( 'General', 'purenote' ),
                        'fields'    => array(
                            'purenote_banner_slider_heading',
                            'purenote_banner_slider_enable',
                            'purenote_banner_slider_category',
                            'purenote_banner_slider_order_by',
                            'purenote_banner_slider_date_filter',
                            'purenote_banner_timeline_heading',
                            'purenote_banner_timeline_enable',
                            'purenote_banner_timeline_title',
                            'purenote_banner_timeline_categories',
                            'purenote_banner_timeline_order_by',
                        )
                    ),
                    'design'    => array(
                        'title' => __( 'Design', 'purenote' ),
                        'fields'    => array(
                            'purenote_banner_bg_type',
                            'purenote_banner_bg_color',
                            'purenote_banner_bg_image'
                        )
                    )
                )
            );
            return $frontpage_banner_tab_fields;
        }
    endif;

    if ( ! function_exists( 'purenote_section_bg_type_choices' ) ) :
        /**
         * function to return choices of section background type.
         *
         * @since 1.0.0
         */
        function purenote_section_bg_type_choices() {
            $section_bg_type = apply_filters( 'purenote_section_bg_type_choices',
                array(
                    'color'   => __( 'Background Color', 'purenote' ),
                    'image'   => __( 'Background Image', 'purenote' )
                )
            );
            return $section_bg_type;
        }
    endif;

/*----------------------------------  WEB STORIES  ---------------------------------- */

if ( ! function_exists( 'purenote_frontpage_web_stories_tabs_choices' ) ) :

    /**
     * Tabs choices for Web Stories section
     */
    function purenote_frontpage_web_stories_tabs_choices() {
        return apply_filters( 'purenote_frontpage_web_stories_tabs_choices',
            array(
                'general' => array(
                    'title'  => esc_html__( 'General', 'purenote' ),
                    'fields' => array(
                        'purenote_web_stories_enable',
                        'purenote_web_stories_title',
                        'purenote_web_stories_orderby',
                        'purenote_web_stories_date_filter',
                    ),
                ),
                'style' => array(
                    'title'  => esc_html__( 'Style', 'purenote' ),
                    'fields' => array(
                        'purenote_web_stories_image_size',
                        'purenote_web_stories_hover_effect',
                    ),
                ),
            )
        );
    }

endif;


if ( ! function_exists( 'purenote_image_size_choices' ) ) :
    /**
     * Image size choices (used in multiple sections including Web Stories)
     */
    function purenote_image_size_choices() {
        return apply_filters( 'purenote_image_size_choices', array(
            'thumbnail' => esc_html__( 'Thumbnail', 'purenote' ),
            'medium'    => esc_html__( 'Medium', 'purenote' ),
            'large'     => esc_html__( 'Large', 'purenote' ),
            'full'      => esc_html__( 'Full', 'purenote' ),
        ) );
    }
endif;


if ( ! function_exists( 'purenote_hover_effect_choices' ) ) :
    /**
     * Hover effect choices for Web Stories (and reusable elsewhere)
     */
    function purenote_hover_effect_choices() {
        return apply_filters( 'purenote_hover_effect_choices', array(
            'zoom'      => esc_html__( 'Zoom', 'purenote' ),
            'lift'      => esc_html__( 'Lift', 'purenote' ),
            'opacity'   => esc_html__( 'Opacity', 'purenote' ),
            'grayscale' => esc_html__( 'Grayscale', 'purenote' ),
            'none'      => esc_html__( 'None', 'purenote' ),
        ) );
    }
endif;

/*---------------------------------- Innerpage Panel Choices -------------------------------*/
        if ( ! function_exists( 'purenote_archive_page_style_choices' ) ) :
            /**
             * Function to return choices for archive page style.
             * Innerpage > Archive Settings
             *
             * @since 1.0.0
             */
            function purenote_archive_page_style_choices() {
                $purenote_archive_page_style = apply_filters(
                    'purenote_archive_page_style_choices',
                    array(
                        'archive-style--classic' => array(
                            'title' => __( 'Classic', 'purenote' ),
                            'src'   => get_template_directory_uri() . '/inc/customizer/assets/images/archive-classic-layout.png',
                        ),
                        'archive-style--grid' => array(
                            'title' => __( 'Grid', 'purenote' ),
                            'src'   => get_template_directory_uri() . '/inc/customizer/assets/images/archive-grid-layout.png',
                        ),
                        'archive-style--list' => array(
                            'title' => __( 'List', 'purenote' ),
                            'src'   => get_template_directory_uri() . '/inc/customizer/assets/images/archive-list-layout.png',
                        ),
                    )
                );

                return $purenote_archive_page_style;
            }
        endif;


        if ( ! function_exists( 'purenote_single_posts_layout_choices' ) ) :

        /**
         * function to return choices of single posts layout.
         *
         * @since 1.0.0
         */
        function purenote_single_posts_layout_choices() {

            $posts_layout = apply_filters( 'purenote_single_posts_layout_choices',
                array(
                    'posts-layout--one'  => array(
                        'title'     => __( 'Layout 1', 'purenote' ),
                        'src'       => get_template_directory_uri() . '/inc/customizer/assets/images/single-layout-one.png'
                    ),
                    'posts-layout--two'  => array(
                        'title'     => __( 'Layout 2', 'purenote' ),
                        'src'       => get_template_directory_uri() . '/inc/customizer/assets/images/single-layout-two.png'
                    )
                )
            );

            return $posts_layout;

        }

    endif;

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

    if ( ! function_exists( 'purenote_footer_widget_area_layout_choices' ) ) :

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

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

            return $widget_area_layout;

        }

    endif;