Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
02/10/2012 01:17:51 AM (13 years ago)
Author:
johnjamesjacoby
Message:

Remove unneeded globals and clean up some code in Groups component. See #3989.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-groups/bp-groups-notifications.php

    r5431 r5689  
    44
    55function groups_notification_group_updated( $group_id ) {
    6     global $bp;
    76
    87    $group    = groups_get_group( array( 'group_id' => $group_id ) );
     
    4746
    4847function groups_notification_new_membership_request( $requesting_user_id, $admin_id, $group_id, $membership_id ) {
    49     global $bp;
    5048
    5149    bp_core_add_notification( $requesting_user_id, $admin_id, 'groups', 'new_membership_request', $group_id );
     
    5553
    5654    $requesting_user_name = bp_core_get_user_displayname( $requesting_user_id );
    57     $group = groups_get_group( array( 'group_id' => $group_id ) );
    58 
    59     $ud = bp_core_get_core_userdata($admin_id);
    60     $requesting_ud = bp_core_get_core_userdata($requesting_user_id);
    61 
     55    $group                = groups_get_group( array( 'group_id' => $group_id ) );
     56
     57    $ud             = bp_core_get_core_userdata( $admin_id );
     58    $requesting_ud  = bp_core_get_core_userdata( $requesting_user_id );
    6259    $group_requests = bp_get_group_permalink( $group ) . 'admin/membership-requests';
    6360    $profile_link   = bp_core_get_user_domain( $requesting_user_id );
     
    9693
    9794function groups_notification_membership_request_completed( $requesting_user_id, $group_id, $accepted = true ) {
    98     global $bp;
    9995
    10096    // Post a screen notification first.
     
    153149
    154150function groups_notification_promoted_member( $user_id, $group_id ) {
    155     global $bp;
    156151
    157152    if ( groups_is_user_admin( $user_id, $group_id ) ) {
     
    202197
    203198function groups_notification_group_invites( &$group, &$member, $inviter_user_id ) {
    204     global $bp;
    205 
    206     $inviter_ud = bp_core_get_core_userdata( $inviter_user_id );
     199
     200    // @todo $inviter_up may be used for caching, test without it
     201    $inviter_ud   = bp_core_get_core_userdata( $inviter_user_id );
    207202    $inviter_name = bp_core_get_userlink( $inviter_user_id, true, false, true );
    208203    $inviter_link = bp_core_get_user_domain( $inviter_user_id );
     
    219214            return false;
    220215
    221         $invited_ud = bp_core_get_core_userdata($invited_user_id);
    222 
     216        $invited_ud    = bp_core_get_core_userdata($invited_user_id);
    223217        $settings_link = bp_core_get_user_domain( $invited_user_id ) . bp_get_settings_slug() . '/notifications/';
    224         $invited_link = bp_core_get_user_domain( $invited_user_id );
    225         $invites_link = trailingslashit( $invited_link . bp_get_groups_slug() . '/invites' );
     218        $invited_link  = bp_core_get_user_domain( $invited_user_id );
     219        $invites_link  = trailingslashit( $invited_link . bp_get_groups_slug() . '/invites' );
    226220
    227221        // Set up and send the message
Note: See TracChangeset for help on using the changeset viewer.