Skip to:
Content

BuddyPress.org

Changeset 4638


Ignore:
Timestamp:
07/09/2011 10:58:18 PM (13 years ago)
Author:
boonebgorges
Message:

Cleans up use of BP_x_SLUG, replacing with wrapper functions where possible

Location:
trunk
Files:
13 edited

Legend:

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

    r4628 r4638  
    3939
    4040            $message_link = bp_activity_get_permalink( $activity_id );
    41             $settings_link = bp_core_get_user_domain( $receiver_user_id ) .  BP_SETTINGS_SLUG . '/notifications/';
     41            $settings_link = bp_core_get_user_domain( $receiver_user_id ) . bp_get_settings_slug() . '/notifications/';
    4242
    4343            $poster_name = stripslashes( $poster_name );
     
    8585        $poster_name = bp_core_get_user_displayname( $commenter_id );
    8686        $thread_link = bp_activity_get_permalink( $activity_id );
    87         $settings_link = bp_core_get_user_domain( $original_activity->user_id ) .  BP_SETTINGS_SLUG . '/notifications/';
     87        $settings_link = bp_core_get_user_domain( $original_activity->user_id ) . bp_get_settings_slug() . '/notifications/';
    8888
    8989        $poster_name = stripslashes( $poster_name );
     
    130130        $poster_name = bp_core_get_user_displayname( $commenter_id );
    131131        $thread_link = bp_activity_get_permalink( $activity_id );
    132         $settings_link = bp_core_get_user_domain( $parent_comment->user_id ) .  BP_SETTINGS_SLUG . '/notifications/';
     132        $settings_link = bp_core_get_user_domain( $parent_comment->user_id ) . bp_get_settings_slug() . '/notifications/';
    133133
    134134        // Set up and send the message
  • trunk/bp-core/bp-core-catchuri.php

    r4630 r4638  
    198198
    199199    // Search doesn't have an associated page, so we check for it separately
    200     if ( !empty( $bp_uri[0] ) && ( BP_SEARCH_SLUG == $bp_uri[0] ) ) {
     200    if ( !empty( $bp_uri[0] ) && ( bp_get_search_slug() == $bp_uri[0] ) ) {
    201201        $matches[]   = 1;
    202202        $match       = new stdClass;
    203203        $match->key  = 'search';
    204         $match->slug = BP_SEARCH_SLUG;
     204        $match->slug = bp_get_search_slug();
    205205    }
    206206
  • trunk/bp-core/bp-core-functions.php

    r4631 r4638  
    808808    global $bp;
    809809
    810     if ( BP_SEARCH_SLUG != $bp->current_component )
     810    if ( !bp_is_current_component( bp_get_search_slug() ) )
    811811        return;
    812812
  • trunk/bp-core/bp-core-template.php

    r4602 r4638  
    222222
    223223function bp_search_form_action() {
    224     global $bp;
    225 
    226     return apply_filters( 'bp_search_form_action', bp_get_root_domain() . '/' . BP_SEARCH_SLUG );
     224    return apply_filters( 'bp_search_form_action', bp_get_root_domain() . '/' . bp_get_search_slug() );
    227225}
    228226
     
    594592}
    595593
     594/**
     595 * Output the search slug
     596 *
     597 * @package BuddyPress
     598 * @since 1.3
     599 *
     600 * @uses bp_get_search_slug()
     601 */
     602function bp_search_slug() {
     603    echo bp_get_search_slug();
     604}
     605    /**
     606     * Return the search slug
     607     *
     608     * @package BuddyPress
     609     * @since 1.3
     610     */
     611    function bp_get_search_slug() {
     612        global $bp;
     613
     614        return apply_filters( 'bp_get_search_slug', BP_SEARCH_SLUG );
     615    }
     616
    596617/** is_() functions to determine the current page *****************************/
    597618
  • trunk/bp-friends/bp-friends-notifications.php

    r4602 r4638  
    1212    $initiator_ud = get_userdata( $initiator_id );
    1313
    14     $all_requests_link = bp_core_get_user_domain( $friend_id ) . BP_FRIENDS_SLUG . '/requests/';
    15     $settings_link = bp_core_get_user_domain( $friend_id ) .  BP_SETTINGS_SLUG . '/notifications';
     14    $all_requests_link = bp_core_get_user_domain( $friend_id ) . bp_get_friends_slug() . '/requests/';
     15    $settings_link = bp_core_get_user_domain( $friend_id ) .  bp_get_settings_slug() . '/notifications';
    1616
    1717    $initiator_link = bp_core_get_user_domain( $initiator_id );
     
    5757
    5858    $friend_link = bp_core_get_user_domain( $friend_id );
    59     $settings_link = bp_core_get_user_domain( $initiator_id ) .  BP_SETTINGS_SLUG . '/notifications';
     59    $settings_link = bp_core_get_user_domain( $initiator_id ) . bp_get_settings_slug() . '/notifications';
    6060
    6161    // Set up and send the message
  • trunk/bp-groups/bp-groups-notifications.php

    r4605 r4638  
    1717        $to = $ud->user_email;
    1818
    19         $group_link = site_url( $bp->groups->slug . '/' . $group->slug );
    20         $settings_link = bp_core_get_user_domain( $user_id ) .  BP_SETTINGS_SLUG . '/notifications/';
     19        $group_link = site_url( bp_get_groups_root_slug(). '/' . $group->slug );
     20        $settings_link = bp_core_get_user_domain( $user_id ) . bp_get_settings_slug() . '/notifications/';
    2121
    2222        $message = sprintf( __(
     
    5959    $group_requests = bp_get_group_permalink( $group ) . 'admin/membership-requests';
    6060    $profile_link = bp_core_get_user_domain( $requesting_user_id );
    61     $settings_link = bp_core_get_user_domain( $requesting_user_id ) .  BP_SETTINGS_SLUG . '/notifications/';
     61    $settings_link = bp_core_get_user_domain( $requesting_user_id ) . bp_get_settings_slug() . '/notifications/';
    6262
    6363    // Set up and send the message
     
    108108
    109109    $group_link = bp_get_group_permalink( $group );
    110     $settings_link = bp_core_get_user_domain( $requesting_user_id ) .  BP_SETTINGS_SLUG . '/notifications/';
     110    $settings_link = bp_core_get_user_domain( $requesting_user_id ) . bp_get_settings_slug() . '/notifications/';
    111111
    112112    // Set up and send the message
     
    168168
    169169    $group_link = bp_get_group_permalink( $group );
    170     $settings_link = bp_core_get_user_domain( $user_id ) .  BP_SETTINGS_SLUG . '/notifications/';
     170    $settings_link = bp_core_get_user_domain( $user_id ) . bp_get_settings_slug() . '/notifications/';
    171171
    172172    // Set up and send the message
     
    216216        $invited_ud = bp_core_get_core_userdata($invited_user_id);
    217217
    218         $settings_link = bp_core_get_user_domain( $invited_user_id ) .  BP_SETTINGS_SLUG . '/notifications/';
     218        $settings_link = bp_core_get_user_domain( $invited_user_id ) . bp_get_settings_slug() . '/notifications/';
    219219        $invited_link = bp_core_get_user_domain( $invited_user_id );
    220220        $invites_link = $invited_link . $bp->groups->slug . '/invites';
     
    276276
    277277            $message_link = bp_activity_get_permalink( $activity_id );
    278             $settings_link = bp_core_get_user_domain( $receiver_user_id ) .  BP_SETTINGS_SLUG . '/notifications/';
     278            $settings_link = bp_core_get_user_domain( $receiver_user_id ) . bp_get_settings_slug() . '/notifications/';
    279279
    280280            $poster_name = stripslashes( $poster_name );
  • trunk/bp-groups/bp-groups-screens.php

    r4605 r4638  
    454454    global $bp;
    455455
    456     if ( !bp_is_current_component( BP_GROUPS_SLUG ) || !bp_is_current_action( 'admin' ) )
     456    if ( !bp_is_current_component( 'groups' ) || !bp_is_current_action( 'admin' ) )
    457457        return false;
    458458
  • trunk/bp-groups/bp-groups-template.php

    r4586 r4638  
    26782678        global $invites_template;
    26792679
    2680         return wp_nonce_url( site_url( BP_GROUPS_SLUG . '/' . $invites_template->invite->group_id . '/invites/remove/' . $invites_template->invite->user->id ), 'groups_invite_uninvite_user' );
     2680        return wp_nonce_url( site_url( bp_get_groups_slug() . '/' . $invites_template->invite->group_id . '/invites/remove/' . $invites_template->invite->user->id ), 'groups_invite_uninvite_user' );
    26812681    }
    26822682
  • trunk/bp-members/bp-members-template.php

    r4632 r4638  
    6565 * @since BuddyPress {unknown}
    6666 *
    67  * @uses bp_get_members_slug()
     67 * @uses bp_get_signup_slug()
    6868 */
    6969function bp_signup_slug() {
     
    9797 * @since BuddyPress {unknown}
    9898 *
    99  * @uses bp_get_members_slug()
     99 * @uses bp_get_activate_slug()
    100100 */
    101101function bp_activate_slug() {
  • trunk/bp-messages/bp-messages-notifications.php

    r4602 r4638  
    1515        // User data and links
    1616        $ud            = get_userdata( $recipient->user_id );
    17         $message_link  = bp_core_get_user_domain( $recipient->user_id ) . BP_MESSAGES_SLUG .'/';
    18         $settings_link = bp_core_get_user_domain( $recipient->user_id ) .  BP_SETTINGS_SLUG . '/notifications/';
     17        $message_link  = bp_core_get_user_domain( $recipient->user_id ) . bp_get_messages_slug() .'/';
     18        $settings_link = bp_core_get_user_domain( $recipient->user_id ) . bp_get_settings_slug() . '/notifications/';
    1919
    2020        // Sender info
  • trunk/bp-messages/bp-messages-template.php

    r4622 r4638  
    718718    extract( $r, EXTR_SKIP );
    719719
    720     if ( !$thread_id && $bp->current_component == BP_MESSAGES_SLUG && 'view' == $bp->current_action )
     720    if ( !$thread_id && bp_is_current_component( 'messages' ) && bp_is_current_action( 'view' ) )
    721721        $thread_id = (int)$bp->action_variables[0];
    722722
  • trunk/bp-themes/bp-default/blogs/index.php

    r4466 r4638  
    1919        <form action="" method="post" id="blogs-directory-form" class="dir-form">
    2020
    21             <h3><?php _e( 'Site Directory', 'buddypress' ); ?><?php if ( is_user_logged_in() && bp_blog_signup_enabled() ) : ?> &nbsp;<a class="button" href="<?php echo bp_get_root_domain() . '/' . BP_BLOGS_SLUG . '/create/' ?>"><?php _e( 'Create a Site', 'buddypress' ); ?></a><?php endif; ?></h3>
     21            <h3><?php _e( 'Site Directory', 'buddypress' ); ?><?php if ( is_user_logged_in() && bp_blog_signup_enabled() ) : ?> &nbsp;<a class="button" href="<?php echo bp_get_root_domain() . '/' . bp_get_blogs_slug() . '/create/' ?>"><?php _e( 'Create a Site', 'buddypress' ); ?></a><?php endif; ?></h3>
    2222
    2323            <div id="blog-dir-search" class="dir-search" role="search">
     
    3333                    <?php if ( is_user_logged_in() && bp_get_total_blog_count_for_user( bp_loggedin_user_id() ) ) : ?>
    3434
    35                         <li id="blogs-personal"><a href="<?php echo bp_loggedin_user_domain() . BP_BLOGS_SLUG . '/my-blogs/' ?>"><?php printf( __( 'My Sites (%s)', 'buddypress' ), bp_get_total_blog_count_for_user( bp_loggedin_user_id() ) ); ?></a></li>
     35                        <li id="blogs-personal"><a href="<?php echo bp_loggedin_user_domain() . bp_get_blogs_slug() . '/my-blogs/' ?>"><?php printf( __( 'My Sites (%s)', 'buddypress' ), bp_get_total_blog_count_for_user( bp_loggedin_user_id() ) ); ?></a></li>
    3636
    3737                    <?php endif; ?>
  • trunk/bp-themes/bp-default/members/index.php

    r4452 r4638  
    3333                    <?php if ( is_user_logged_in() && bp_is_active( 'friends' ) && bp_get_total_friend_count( bp_loggedin_user_id() ) ) : ?>
    3434
    35                         <li id="members-personal"><a href="<?php echo bp_loggedin_user_domain() . BP_FRIENDS_SLUG . '/my-friends/' ?>"><?php printf( __( 'My Friends (%s)', 'buddypress' ), bp_get_total_friend_count( bp_loggedin_user_id() ) ); ?></a></li>
     35                        <li id="members-personal"><a href="<?php echo bp_loggedin_user_domain() . bp_get_friends_slug() . '/my-friends/' ?>"><?php printf( __( 'My Friends (%s)', 'buddypress' ), bp_get_total_friend_count( bp_loggedin_user_id() ) ); ?></a></li>
    3636
    3737                    <?php endif; ?>
Note: See TracChangeset for help on using the changeset viewer.