<?php
/**
 * Theme Palace options
 *
 * @package Theme Palace
 * @subpackage  Top Event
 * @since  Top Event 1.0.0
 */

/**
 * List of pages for page choices.
 * @return Array Array of page ids and name.
 */
function top_event_page_choices() {
    $pages = get_pages();
    $choices = array();
    $choices[0] = esc_html__( '--Select--', 'top-event' );
    foreach ( $pages as $page ) {
        $choices[ $page->ID ] = $page->post_title;
    }
    return  $choices;
}

/**
 * List of posts for post choices.
 * @return Array Array of post ids and name.
 */
function top_event_post_choices() {
    $posts = get_posts( array( 'numberposts' => -1 ) );
    $choices = array();
    $choices[0] = esc_html__( '--Select--', 'top-event' );
    foreach ( $posts as $post ) {
        $choices[ $post->ID ] = $post->post_title;
    }
    wp_reset_postdata();
    return  $choices;
}

/**
 * List of events for post choices.
 * @return Array Array of post ids and name.
 */
function top_event_event_choices() {
    $posts = get_posts( array( 'numberposts' => -1, 'post_type' => 'tp-event' ) );
    $choices = array();
    $choices[0] = esc_html__( '--Select--', 'top-event' );
    foreach ( $posts as $post ) {
        $choices[ $post->ID ] = $post->post_title;
    }
    return  $choices;
}

/**
 * List of category for category choices.
 * @return Array Array of post ids and name.
 */
function top_event_category_choices() {
    $tax_args = array(
        'hierarchical' => 0,
        'taxonomy'     => 'category',
    );
    $taxonomies = get_categories( $tax_args );
    $choices = array();
    $choices[0] = esc_html__( '--Select--', 'top-event' );
    foreach ( $taxonomies as $tax ) {
        $choices[ $tax->term_id ] = $tax->name;
    }
    return  $choices;
}




if ( ! function_exists( 'top_event_site_layout' ) ) :
    /**
     * Site Layout
     * @return array site layout options
     */
    function top_event_site_layout() {
        $top_event_site_layout = array(
            'wide'          => esc_url( get_template_directory_uri() . '/assets/images/full.png' ),
            'boxed-layout'  => esc_url( get_template_directory_uri() . '/assets/images/boxed.png' ),
        );

        $output = apply_filters( 'top_event_site_layout', $top_event_site_layout );
        return $output;
    }
endif;

if ( ! function_exists( 'top_event_selected_sidebar' ) ) :
    /**
     * Sidebars options
     * @return array Sidbar positions
     */
    function top_event_selected_sidebar() {
        $top_event_selected_sidebar = array(
            'sidebar-1'             => esc_html__( 'Default Sidebar', 'top-event' ),
            'optional-sidebar'      => esc_html__( 'Optional Sidebar 1', 'top-event' ),
            'optional-sidebar-2'    => esc_html__( 'Optional Sidebar 2', 'top-event' ),
        );

        $output = apply_filters( 'top_event_selected_sidebar', $top_event_selected_sidebar );

        return $output;
    }
endif;


if ( ! function_exists( 'top_event_global_sidebar_position' ) ) :
    /**
     * Global Sidebar position
     * @return array Global Sidebar positions
     */
    function top_event_global_sidebar_position() {
        $top_event_global_sidebar_position = array(
            'right-sidebar' => esc_url( get_template_directory_uri() . '/assets/images/right.png' ),
            'no-sidebar'    => esc_url( get_template_directory_uri() . '/assets/images/full.png' ),
        );

        $output = apply_filters( 'top_event_global_sidebar_position', $top_event_global_sidebar_position );

        return $output;
    }
endif;


if ( ! function_exists( 'top_event_sidebar_position' ) ) :
    /**
     * Sidebar position
     * @return array Sidbar positions
     */
    function top_event_sidebar_position() {
        $top_event_sidebar_position = array(
            'right-sidebar'         => esc_url( get_template_directory_uri() . '/assets/images/right.png' ),
            'no-sidebar'            => esc_url( get_template_directory_uri() . '/assets/images/full.png' ),
            'no-sidebar-content'    => esc_url( get_template_directory_uri() . '/assets/images/boxed.png' ),
        );

        $output = apply_filters( 'top_event_sidebar_position', $top_event_sidebar_position );

        return $output;
    }
endif;

if ( ! function_exists( 'top_event_pagination_options' ) ) :
    /**
     * Pagination
     * @return array site pagination options
     */
    function top_event_pagination_options() {
        $top_event_pagination_options = array(
            'numeric'   => esc_html__( 'Numeric', 'top-event' ),
            'default'   => esc_html__( 'Default(Older/Newer)', 'top-event' ),
        );

        $output = apply_filters( 'top_event_pagination_options', $top_event_pagination_options );

        return $output;
    }
endif;


if ( ! function_exists( 'top_event_switch_options' ) ) :
    /**
     * List of custom Switch Control options
     * @return array List of switch control options.
     */
    function top_event_switch_options() {
        $arr = array(
            'on'        => esc_html__( 'Enable', 'top-event' ),
            'off'       => esc_html__( 'Disable', 'top-event' )
        );
        return apply_filters( 'top_event_switch_options', $arr );
    }
endif;

if ( ! function_exists( 'top_event_hide_options' ) ) :
    /**
     * List of custom Switch Control options
     * @return array List of switch control options.
     */
    function top_event_hide_options() {
        $arr = array(
            'on'        => esc_html__( 'Yes', 'top-event' ),
            'off'       => esc_html__( 'No', 'top-event' )
        );
        return apply_filters( 'top_event_hide_options', $arr );
    }
endif;

if ( ! function_exists( 'top_event_promotion_content_type' ) ) :
    /**
     * Destination Options
     * @return array site gallery options
     */
    function top_event_promotion_content_type() {
        $top_event_promotion_content_type = array(
            'page'      => esc_html__( 'Page', 'top-event' ),
        );

        if ( class_exists( 'TP_Education' ) ) {
            $top_event_promotion_content_type = array_merge( $top_event_promotion_content_type,array(
                'event'   => esc_html__( 'Event', 'top-event' ),
                )
            );
        }


        $output = apply_filters( 'top_event_promotion_content_type', $top_event_promotion_content_type );


        return $output;
    }
endif;

if ( ! function_exists( 'top_event_slider_content_type' ) ) :
    /**
     * Special Offer Options
     * @return array site event options
     */
    function top_event_slider_content_type() {
        $top_event_slider_content_type = array(
            'page'      => esc_html__( 'Page', 'top-event' ),
        );

        if ( class_exists( 'TP_Education' ) ) {
            $top_event_slider_content_type = array_merge( $top_event_slider_content_type,array(
                'event'   => esc_html__( 'Event', 'top-event' ),
                )
            );
        }

        $output = apply_filters( 'top_event_slider_content_type', $top_event_slider_content_type );


        return $output;
    }
endif;

if ( ! function_exists( 'top_event_event_content_type' ) ) :
    /**
     * Special Offer Options
     * @return array site event options
     */
    function top_event_event_content_type() {
        $top_event_event_content_type = array(
            'page'      => esc_html__( 'Page', 'top-event' ),
        );

        if ( class_exists( 'TP_Education' ) ) {
            $top_event_event_content_type = array_merge( $top_event_event_content_type,array(
                'event-category'   => esc_html__( 'Event Category', 'top-event' ),
                )
            );
        }

        $output = apply_filters( 'top_event_event_content_type', $top_event_event_content_type );


        return $output;
    }
endif;
