Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
09/13/2010 01:08:31 AM (15 years ago)
Author:
johnjamesjacoby
Message:

Committing patch from #2566 for easier review and testing. Adds BP_Button class and associated template tags. Also includes code formatting fixes, phpdoc, widget fixes when friends component is disabled, and possibly the kitchen sink.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/1.2/bp-messages/bp-messages-templatetags.php

    r3246 r3260  
    502502        global $bp;
    503503
    504         return apply_filters( 'bp_get_send_private_message_link', $bp->loggedin_user->domain . $bp->messages->slug . '/compose/?r=' . bp_core_get_username( $bp->displayed_user->user_id, $bp->displayed_user->userdata->user_nicename, $bp->displayed_user->userdata->user_login ) );
    505     }
     504        if ( bp_is_my_profile() || !is_user_logged_in() )
     505            return false;
     506
     507        return apply_filters( 'bp_get_send_private_message_link', wp_nonce_url( $bp->loggedin_user->domain . $bp->messages->slug . '/compose/?r=' . bp_core_get_username( $bp->displayed_user->user_id, $bp->displayed_user->userdata->user_nicename, $bp->displayed_user->userdata->user_login ) ) );
     508    }
     509
     510/**
     511 * bp_send_private_message_button()
     512 *
     513 * Explicitly named function to avoid confusion with public messages.
     514 *
     515 * @uses bp_get_send_message_button()
     516 * @since 1.2.6
     517 */
     518function bp_send_private_message_button() {
     519    echo bp_get_send_message_button();
     520}
    506521
    507522function bp_send_message_button() {
     
    509524}
    510525    function bp_get_send_message_button() {
    511         global $bp;
    512 
    513         if ( bp_is_my_profile() || !is_user_logged_in() )
    514             return false;
    515 
    516         return apply_filters( 'bp_get_send_message_button', '<div class="generic-button"><a class="send-message" title="' . __( 'Send Message', 'buddypress' ) . '" href="' . $bp->loggedin_user->domain . $bp->messages->slug . '/compose/?r=' . bp_core_get_username( $bp->displayed_user->user_id, $bp->displayed_user->userdata->user_nicename, $bp->displayed_user->userdata->user_login ) . '">' . __( 'Send Message', 'buddypress' ) . '</a></div>' );
     526        return apply_filters( 'bp_get_send_message_button',
     527            bp_get_button( array(
     528                'id'                => 'private_message',
     529                'component'         => 'messages',
     530                'must_be_logged_in' => true,
     531                'block_self'        => true,
     532                'wrapper_id'        => 'send-private-message',
     533                'link_href'         => bp_get_send_private_message_link(),
     534                'link_class'        => 'send-message',
     535                'link_title'        => __( 'Send a private message to this user.', 'buddypress' ),
     536                'link_text'         => __( 'Send Private Message', 'buddypress' )
     537            ) )
     538        );
    517539    }
    518540
Note: See TracChangeset for help on using the changeset viewer.