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

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


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

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

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

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

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

        return $output;
    }
endif;


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

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

        return $output;
    }
endif;


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

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

        return $output;
    }
endif;


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

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

        return $output;
    }
endif;

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

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

if ( ! function_exists( 'mezze_sortable_sections' ) ) :
    /**
     * List of sections Control options
     * @return array List of Sections control options.
     */
    function mezze_sortable_sections() {
        $sections = array(
            'slider'    => esc_html__( 'Main Slider', 'mezze' ),
            'about'     => esc_html__( 'About Us', 'mezze' ),
            'special_menu' => esc_html__( 'Special Menu', 'mezze' ),
            'service'   => esc_html__( 'Services', 'mezze' ),
            'blog'      => esc_html__( 'Blog', 'mezze' ),
        );
        return apply_filters( 'mezze_sortable_sections', $sections );
    }
endif;

if ( ! function_exists( 'mezze_special_menu_content_type' ) ) :
    /**
     * Special Menu Options
     * @return array site special menu options
     */
    function mezze_special_menu_content_type() {
        $mezze_special_menu_content_type = array(
            'page'      => esc_html__( 'Page', 'mezze' ),
        );

        if ( class_exists( 'WooCommerce' ) ) {
            $mezze_special_menu_content_type = array_merge( $mezze_special_menu_content_type, array(
                'product'   => esc_html__( 'Product', 'mezze' ),
                ) );
        }

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


        return $output;
    }
endif;
