Skip to:
Content

BuddyPress.org

Changeset 4240


Ignore:
Timestamp:
04/22/2011 09:09:23 PM (14 years ago)
Author:
djpaul
Message:

Fix subnav link and highlighting when viewing a private message. Fixes #3169

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-core/bp-core-buddybar.php

    r4155 r4240  
    171171        'site_admin_only' => false, // Can only site admins see this nav item?
    172172        'position'        => 90,    // Index of where this nav item should be positioned
    173         'screen_function' => false  // The name of the function to run when clicked
     173        'screen_function' => false, // The name of the function to run when clicked
     174        'link'            => ''     // The link for the subnav item; optional, not usually required.
    174175    );
    175176
     
    181182        return false;
    182183
     184    if ( empty( $link ) )
     185        $link = $parent_url . $slug;
     186
    183187    // If this is for site admins only and the user is not one, don't create the subnav item
    184188    if ( $site_admin_only && !is_super_admin() )
     
    190194    $bp->bp_options_nav[$parent_slug][$slug] = array(
    191195        'name'            => $name,
    192         'link'            => $parent_url . $slug . '/',
     196        'link'            => trailingslashit( $link ),
    193197        'slug'            => $slug,
    194198        'css_id'          => $item_css_id,
  • trunk/bp-messages/bp-messages-actions.php

    r4237 r4240  
    4040    do_action( 'messages_action_view_message' );
    4141
    42     bp_core_new_subnav_item( array( 'name' => sprintf( __( 'From: %s', 'buddypress'), BP_Messages_Thread::get_last_sender($thread_id) ), 'slug' => "view/{$thread_id}", 'parent_url' => $bp->loggedin_user->domain . $bp->messages->slug . '/', 'parent_slug' => $bp->messages->slug, 'screen_function' => true, 'position' => 40, 'user_has_access' => bp_is_my_profile() ) );
     42    bp_core_new_subnav_item( array(
     43        'name'            => sprintf( __( 'From: %s', 'buddypress' ), BP_Messages_Thread::get_last_sender( $thread_id ) ),
     44        'slug'            => 'view',
     45        'parent_url'      => $bp->loggedin_user->domain . $bp->messages->slug . '/',
     46        'parent_slug'     => $bp->messages->slug,
     47        'screen_function' => true,
     48        'position'        => 40,
     49        'user_has_access' => bp_is_my_profile(),
     50        'link'            => $bp->loggedin_user->domain . $bp->messages->slug . '/view/' . (int) $thread_id
     51    ) );
     52
    4353    bp_core_load_template( apply_filters( 'messages_template_view_message', 'members/single/home' ) );
    4454}
     
    93103}
    94104add_action( 'bp_actions', 'messages_action_bulk_delete' );
    95 
    96105?>
Note: See TracChangeset for help on using the changeset viewer.