Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
01/24/2010 02:29:57 PM (16 years ago)
Author:
apeatling
Message:

Fixes #1661

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-themes/bp-default/_inc/ajax.php

    r2413 r2422  
    1010 */
    1111
    12 function bp_dtheme_content_filter() {
    13         global $bp;
    14 
    15         $content = esc_attr( $_POST['content'] );
    16         $type = esc_attr( $_POST['type'] );
     12function bp_dtheme_object_filter() {
     13        global $bp;
     14
     15        $object = esc_attr( $_POST['object'] );
    1716        $filter = esc_attr( $_POST['filter'] );
    1817        $page = esc_attr( $_POST['page'] );
    1918        $search_terms = esc_attr( $_POST['search_terms'] );
    2019
     20        /**
     21         * Scope is the scope of results to use, either all (everything) or personal (just mine).
     22         * For example if the object is groups, it would be all groups, or just groups I belong to.
     23         */
     24        $scope = esc_attr( $_POST['scope'] );
     25
    2126        /* Plugins can pass extra parameters and use the bp_dtheme_ajax_querystring_content_filter filter to parse them */
    2227        $extras = esc_attr( $_POST['extras'] );
     
    2934                $filter = 'active';
    3035
    31         if ( empty( $type ) )
    32                 $type = 'all';
    33 
    3436        $bp->ajax_querystring = 'type=' . $filter . '&page=' . $page;
    3537
     
    3739                $bp->ajax_querystring .= '&search_terms=' . $search_terms;
    3840
    39         if ( $type != 'all' || $bp->displayed_user->id ) {
     41        if ( $scope != 'all' || $bp->displayed_user->id ) {
    4042                $user_id = ( $bp->displayed_user->id ) ? $bp->displayed_user->id : $bp->loggedin_user->id;
    4143                $bp->ajax_querystring .= '&user_id=' . $user_id;
     
    4446        $bp->ajax_querystring = apply_filters( 'bp_dtheme_ajax_querystring_content_filter', $bp->ajax_querystring, $extras );
    4547
    46         locate_template( array( "$content/$content-loop.php" ), true );
    47 }
    48 add_action( 'wp_ajax_members_filter', 'bp_dtheme_content_filter' );
    49 add_action( 'wp_ajax_groups_filter', 'bp_dtheme_content_filter' );
    50 add_action( 'wp_ajax_blogs_filter', 'bp_dtheme_content_filter' );
    51 add_action( 'wp_ajax_forums_filter', 'bp_dtheme_content_filter' );
     48        locate_template( array( "$object/$object-loop.php" ), true );
     49}
     50add_action( 'wp_ajax_members_filter', 'bp_dtheme_object_filter' );
     51add_action( 'wp_ajax_groups_filter', 'bp_dtheme_object_filter' );
     52add_action( 'wp_ajax_blogs_filter', 'bp_dtheme_object_filter' );
     53add_action( 'wp_ajax_forums_filter', 'bp_dtheme_object_filter' );
    5254
    5355function bp_dtheme_post_update() {
Note: See TracChangeset for help on using the changeset viewer.