Skip to:
Content

BuddyPress.org

Changeset 545


Ignore:
Timestamp:
11/14/2008 12:03:53 PM (16 years ago)
Author:
apeatling
Message:

Fixing error feedback when no groups match a search.
Fixed admin access to group editing.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-groups.php

    r544 r545  
    526526    if ( $bp['current_component'] == $bp['groups']['slug'] && $bp['action_variables'][0] == 'edit-details' ) {
    527527   
    528         if ( !$bp['is_item_mod'] )
    529             return false;
    530        
    531         // If the edit form has been submitted, save the edited details
    532         if ( isset( $_POST['save'] ) ) {
    533             if ( !groups_edit_base_group_details( $_POST['group-id'], $_POST['group-name'], $_POST['group-desc'], $_POST['group-news'], (int)$_POST['group-notify-members'] ) ) {
    534                 bp_core_add_message( __( 'There was an error updating group details, please try again.', 'buddypress' ), 'error' );
    535             } else {
    536                 bp_core_add_message( __( 'Group details were successfully updated.', 'buddypress' ) );
    537             }
    538             bp_core_redirect( $_SERVER['HTTP_REFERER'] );
    539         }
    540 
    541         bp_catch_uri( 'groups/admin/edit-details' );
     528        if ( $bp['is_item_admin'] || $bp['is_item_mod']  ) {
     529       
     530            // If the edit form has been submitted, save the edited details
     531            if ( isset( $_POST['save'] ) ) {
     532                if ( !groups_edit_base_group_details( $_POST['group-id'], $_POST['group-name'], $_POST['group-desc'], $_POST['group-news'], (int)$_POST['group-notify-members'] ) ) {
     533                    bp_core_add_message( __( 'There was an error updating group details, please try again.', 'buddypress' ), 'error' );
     534                } else {
     535                    bp_core_add_message( __( 'Group details were successfully updated.', 'buddypress' ) );
     536                }
     537                bp_core_redirect( $_SERVER['HTTP_REFERER'] );
     538            }
     539
     540            bp_catch_uri( 'groups/admin/edit-details' );
     541           
     542        }
    542543    }
    543544}
  • trunk/bp-groups/bp-groups-templatetags.php

    r540 r545  
    414414    global $bp;
    415415   
    416     if ( $bp['current_action'] == 'group-finder' )
     416    if ( $bp['current_action'] == 'my-groups' && $_POST['group-filter-box'] == '' )
     417        return true;
     418   
     419    return false;
     420}
     421
     422function bp_group_show_no_results_message() {
     423    global $bp;
     424   
     425    if ( ( $bp['current_action'] == 'my-groups' && $_POST['group-filter-box'] == '' ) || ( $bp['current_action'] == 'group-finder' && $_POST['groupfinder-search-box'] == '' ) )
    417426        return false;
    418427   
    419     return true;
     428    return true;   
    420429}
    421430
     
    9991008        if ( $this->member_count )
    10001009            return true;
    1001        
     1010
    10021011        return false;
    10031012    }
     
    10471056        $groups_template->group = new BP_Groups_Group( $group_id );
    10481057   
    1049 
    10501058    $members_template = new BP_Groups_Group_Members_Template( $groups_template->group->id, $num_per_page, $exclude_admins_mods, $exclude_banned );
    10511059
Note: See TracChangeset for help on using the changeset viewer.