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

/**
 * List of pages for page choices.
 * @return Array Array of page ids and name.
 */
function teach_kiddo_page_choices() {
    $pages = get_pages();
    $choices = array();
    $choices[0] = esc_html__( '--Select--', 'teach-kiddo' );
    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 teach_kiddo_post_choices() {
    $posts = get_posts( array( 'numberposts' => -1 ) );
    $choices = array();
    $choices[0] = esc_html__( '--Select--', 'teach-kiddo' );
    foreach ( $posts as $post ) {
        $choices[ $post->ID ] = $post->post_title;
    }
    wp_reset_postdata();
    return  $choices;
}


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

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

/**
 * List of pages for page choices.
 * @return Array Array of page ids and name.
 */
function teach_kiddo_testimonial_choices() {
    $testimonials = get_posts( array( 'numberposts' => -1, 'post_type'=>'tp-testimonial' ) );
    $choices = array();
    $choices[0] = esc_html__( '--Select--', 'teach-kiddo' );
    foreach ( $testimonials as $testimonial ) {
        $choices[ $testimonial->ID ] = $testimonial->post_title;
    }
    return  $choices;
}


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

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

        return $output;
    }
endif;

if ( ! function_exists( 'teach_kiddo_site_layout' ) ) :
    /**
     * Site Layout
     * @return array site layout options
     */
    function teach_kiddo_site_layout() {
        $teach_kiddo_site_layout = array(
            'wide-layout'  => 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( 'teach_kiddo_site_layout', $teach_kiddo_site_layout );
        return $output;
    }
endif;


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

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

        return $output;
    }
endif;


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

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

        return $output;
    }
endif;


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

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

        return $output;
    }
endif;


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

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


if ( ! function_exists( 'teach_kiddo_popular_course_content_type' ) ) :
    /**
     * Destination Options
     * @return array site gallery options
     */
    function teach_kiddo_popular_course_content_type() {
        $teach_kiddo_popular_course_content_type = array(
            'page'      => esc_html__( 'Page', 'teach-kiddo' ),

        );

        if ( class_exists( 'TP_Education' ) ) {
            $teach_kiddo_popular_course_content_type_plugin = array();

            if ( post_type_exists( 'tp-course' ) ) {
                $teach_kiddo_popular_course_content_type_plugin['course'] = esc_html__('Course', 'teach-kiddo');
            }
        }
         if ( !class_exists('TP_Education')) {
            $teach_kiddo_popular_course_content_type_plugin = array();
        }
        $teach_kiddo_popular_course_content_type = array_merge( $teach_kiddo_popular_course_content_type, $teach_kiddo_popular_course_content_type_plugin );
        $output = apply_filters( 'teach_kiddo_popular_course_content_type', $teach_kiddo_popular_course_content_type );


        return $output;
    }
endif;

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

        if ( class_exists( 'TP_Education' ) ) {
            $custom_choices = array();
            if ( post_type_exists( 'tp-team' ) ) {
               $custom_choices['tp-team']   =  esc_html__( 'Team', 'teach-kiddo' );   
            }
        }
        if ( !class_exists('TP_Education')) {
            $custom_choices = array();
        }
        $teach_kiddo_popular_team_content_type = array_merge( $teach_kiddo_popular_team_content_type, $custom_choices );
        $output = apply_filters( 'teach_kiddo_popular_team_content_type', $teach_kiddo_popular_team_content_type );


        return $output;
    }
endif;


if ( ! function_exists( 'teach_kiddo_testimonial_content_type' ) ) :
    /**
     * Package Options
     * @return array site testimonial options
     */
    function teach_kiddo_testimonial_content_type() {
        $teach_kiddo_testimonial_content_type = array(
            'page'      => esc_html__( 'Page', 'teach-kiddo' ),
        );

        if ( class_exists( 'TP_Education' ) ) {
            $teach_kiddo_testimonial_content_type = array_merge( $teach_kiddo_testimonial_content_type, array(
                'testimonial'            => esc_html__( 'Testimonial', 'teach-kiddo' ),
                ) );
        }

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

        return $output;
    }
endif;