Skip to:
Content

BuddyPress.org

Ticket #1183: patch_2.patch

File patch_2.patch, 20.2 KB (added by GIGALinux, 15 years ago)
  • bp-activity.php

     
    5959       
    6060        $bp->activity->table_name = $wpdb->base_prefix . 'bp_activity_user_activity_cached';
    6161        $bp->activity->slug = BP_ACTIVITY_SLUG;
     62        $bp->activity->title = apply_filters( 'bp_activity_title', __( 'Activity', 'buddypress' ) );
    6263               
    6364        /* Register this in the active components array */
    6465        $bp->active_components[$bp->activity->slug] = $bp->activity->id;
     
    8687        global $bp;
    8788
    8889        /* Add 'Activity' to the main navigation */
    89         bp_core_new_nav_item( array( 'name' => __( 'Activity', 'buddypress' ), 'slug' => $bp->activity->slug, 'position' => 10, 'screen_function' => 'bp_activity_screen_my_activity', 'default_subnav_slug' => 'just-me', 'item_css_id' => $bp->activity->id ) );
     90        bp_core_new_nav_item( array( 'name' => $bp->activity->title, 'slug' => $bp->activity->slug, 'position' => 10, 'screen_function' => 'bp_activity_screen_my_activity', 'default_subnav_slug' => 'just-me', 'item_css_id' => $bp->activity->id ) );
    9091
    9192        $activity_link = $bp->loggedin_user->domain . $bp->activity->slug . '/';
    9293
  • bp-blogs.php

     
    116116        $bp->blogs->table_name_blogmeta = $wpdb->base_prefix . 'bp_user_blogs_blogmeta';
    117117        $bp->blogs->format_notification_function = 'bp_blogs_format_notifications';
    118118        $bp->blogs->slug = BP_BLOGS_SLUG;
     119        $bp->blogs->title = apply_filters( 'bp_blogs_title', __( 'Blogs', 'buddypress' ) );
     120        $bp->blogs->directory_title = apply_filters( 'bp_blogs_directory_title', __( 'Blog Directory', 'buddypress' ) );
    119121       
    120122        /* Register this in the active components array */
    121123        $bp->active_components[$bp->blogs->slug] = $bp->blogs->id;
     
    126128add_action( 'admin_menu', 'bp_blogs_setup_globals', 2 );
    127129
    128130function bp_blogs_setup_root_component() {
    129         /* Register 'groups' as a root component */
     131        /* Register 'blogs' as a root component */
    130132        bp_core_add_root_component( BP_BLOGS_SLUG );
    131133}
    132134add_action( 'plugins_loaded', 'bp_blogs_setup_root_component', 2 );
     
    144146        global $bp;
    145147       
    146148        /* Add 'Blogs' to the main navigation */
    147         bp_core_new_nav_item( array( 'name' => __( 'Blogs', 'buddypress' ), 'slug' => $bp->blogs->slug, 'position' => 30, 'screen_function' => 'bp_blogs_screen_my_blogs', 'default_subnav_slug' => 'my-blogs', 'item_css_id' => $bp->blogs->id ) );
     149        bp_core_new_nav_item( array( 'name' => $bp->blogs->title, 'slug' => $bp->blogs->slug, 'position' => 30, 'screen_function' => 'bp_blogs_screen_my_blogs', 'default_subnav_slug' => 'my-blogs', 'item_css_id' => $bp->blogs->id ) );
    148150       
    149151        $blogs_link = $bp->loggedin_user->domain . $bp->blogs->slug . '/';
    150152       
     
    184186}
    185187add_action( 'wp', 'bp_blogs_directory_blogs_setup', 2 );
    186188
     189/**
     190 * bp_blogs_setup_main_nav()
     191 *
     192 * Adds the blogs directory to the main navigation at top of the theme
     193 *
     194 * @package BuddyPress Blogs
     195 * @global $bp The global BuddyPress settings variable created in bp_core_setup_globals()
     196 * @uses bp_is_page() Returns true if the current user being viewed is equal to the slug provided
     197 * @uses site_url() Returns the site urls with the added value
     198 */
     199function bp_blogs_setup_main_nav() {
     200        global $bp;
     201       
     202        if((int) get_site_option( 'bp-disable-blogs-directory' ))
     203                return;
     204       
     205        $selected = bp_is_page( BP_BLOGS_SLUG ) ? 'class="selected"' : '';
     206        $title = $bp->blogs->title;
     207       
     208        echo "<li$selected><a href=\"" . site_url( BP_BLOGS_SLUG ) . "\" title=\"$title\">$title</a></li>";     
     209}
     210add_action( 'bp_nav_items', 'bp_blogs_setup_main_nav', 5 );
    187211
     212
    188213/********************************************************************************
    189214 * Screen Functions
    190215 *
  • bp-core.php

     
    340340
    341341                /* Add 'Profile' to the main navigation */
    342342                bp_core_new_nav_item( array(
    343                         'name' => __('Profile', 'buddypress'),
     343                        'name' => apply_filters( 'bp_profile_title', __( 'Profile', 'buddypress' ) ),
    344344                        'slug' => $bp->core->profile->slug,
    345345                        'position' => 20,
    346346                        'screen_function' => 'bp_core_catch_profile_uri',
     
    372372add_action( 'plugins_loaded', 'bp_core_setup_nav' );
    373373add_action( 'admin_menu', 'bp_core_setup_nav' );
    374374
     375/**
     376 * bp_core_main_nav_blog()
     377 *
     378 * Adds the main blog to the main navigation at top of the theme
     379 *
     380 * @package BuddyPress Core
     381 * @uses bp_is_page() Returns true if the current user being viewed is equal to the slug provided
     382 * @uses site_url() Returns the site urls with the added value
     383 */
     384function bp_core_main_nav_blog() {
     385        $selected = bp_is_page( BP_HOME_BLOG_SLUG ) ? 'class="selected"' : '';
     386        $title = apply_filters( 'bp_mainblog_title', __( 'Blog', 'buddypress' ) );
     387       
     388        echo "<li$selected><a href=\"" . site_url( BP_HOME_BLOG_SLUG ) . "\" title=\"$title\">$title</a></li>";
     389}
     390add_action( 'bp_nav_items', 'bp_core_main_nav_blog', 1 );
    375391
     392/**
     393 * bp_core_main_nav_members()
     394 *
     395 * Adds the main blog to the main navigation at top of the theme
     396 *
     397 * @package BuddyPress Core
     398 * @global $bp The global BuddyPress settings variable created in bp_core_setup_globals()
     399 * @uses bp_is_page() Returns true if the current user being viewed is equal to the slug provided
     400 * @uses site_url() Returns the site urls with the added value
     401 */
     402function bp_core_main_nav_members() {
     403        global $bp;
     404       
     405        if((int) get_site_option( 'bp-disable-members-directory' ))
     406                return;
     407       
     408        $selected = bp_is_page( BP_MEMBERS_SLUG ) ? 'class="selected"' : '';
     409        $title = apply_filters( 'bp_members_title', __( 'Members', 'buddypress' ) );
     410       
     411        echo "<li$selected><a href=\"" . site_url( BP_MEMBERS_SLUG ) . "\" title=\"$title\">$title</a></li>";   
     412}
     413add_action( 'bp_nav_items', 'bp_core_main_nav_members', 2 );
     414
    376415/********************************************************************************
    377416 * Screen Functions
    378417 *
     
    17691808        if ( file_exists( $mofile ) )
    17701809                load_textdomain( 'buddypress', $mofile );
    17711810}
    1772 add_action ( 'plugins_loaded', 'bp_core_load_buddypress_textdomain', 9 );
     1811add_action ( 'plugins_loaded', 'bp_core_load_buddypress_textdomain', 1 );
    17731812
    17741813function bp_core_add_ajax_hook() {
    17751814        /* Theme only, we already have the wp_ajax_ hook firing in wp-admin */
  • bp-core/bp-core-settings.php

     
    99        /* Set up settings as a sudo-component for identification and nav selection */
    1010        $bp->settings->id = 'settings';
    1111        $bp->settings->slug = BP_SETTINGS_SLUG;
     12        $bp->settings->title = apply_filters( 'bp_settings_title', __( 'Settings', 'buddypress' ) );
    1213       
    1314        /* Register this in the active components array */
    1415        $bp->active_components[$bp->settings->slug] = $bp->settings->id;
    1516
    1617        /* Add the settings navigation item */
    17         bp_core_new_nav_item( array( 'name' => __('Settings', 'buddypress'), 'slug' => $bp->settings->slug, 'position' => 100, 'show_for_displayed_user' => false, 'screen_function' => 'bp_core_screen_general_settings', 'default_subnav_slug' => 'general' ) );
     18        bp_core_new_nav_item( array( 'name' => $bp->settings->title, 'slug' => $bp->settings->slug, 'position' => 100, 'show_for_displayed_user' => false, 'screen_function' => 'bp_core_screen_general_settings', 'default_subnav_slug' => 'general' ) );
    1819
    1920        $settings_link = $bp->loggedin_user->domain . 'settings/';
    2021       
  • bp-core/bp-core-templatetags.php

     
    489489                        $title = __( 'Blog', 'buddypress' );
    490490
    491491        } else if ( !empty( $bp->displayed_user->fullname ) ) {
    492                 $title = strip_tags( $bp->displayed_user->fullname . ' &#8212; ' . ucwords( $bp->current_component ) . ' &#8212; ' . $bp->bp_options_nav[$bp->current_component][$bp->current_action]['name'] );
     492                $title = strip_tags( $bp->displayed_user->fullname . ' &#8212; ' . $bp->{$bp->current_component}->title . ' &#8212; ' . $bp->bp_options_nav[$bp->current_component][$bp->current_action]['name'] );
    493493        } else if ( $bp->is_single_item ) {
    494                 $title = ucwords( $bp->current_component ) . ' &#8212; ' . $bp->bp_options_title;
     494                $title = $bp->{$bp->current_component}->title . ' &#8212; ' . $bp->bp_options_title;
    495495        } else if ( $bp->is_directory ) {
    496                 if ( !$bp->current_component )
    497                         $title = sprintf( __( '%s Directory', 'buddypress' ), ucwords( BP_MEMBERS_SLUG ) );
     496                if ( !$bp->current_component || "members" == $bp->current_component )
     497                        $title = apply_filters( 'bp_members_directory_title', __( 'Members Directory', 'buddypress' ) );
    498498                else
    499                         $title = sprintf( __( '%s Directory', 'buddypress' ), ucwords( $bp->current_component ) );
     499                        $title = $bp->{$bp->current_component}->directory_title;
     500        } else if ( BP_REGISTER_SLUG == $bp->current_component ) {
     501                $title = apply_filters( 'bp_signup_title', __( 'Sign Up', 'buddypress' ) );
     502        } else if ( BP_ACTIVATION_SLUG == $bp->current_component ) {
     503                $title = apply_filters( 'bp_activation_title', __( 'Activation', 'buddypress' ) );
    500504        } else {
    501505                global $post;
    502506                $title = get_the_title($post->ID);
  • bp-forums.php

     
    2222        $bp->forums->image_base = BP_PLUGIN_URL . '/bp-forums/images';
    2323        $bp->forums->bbconfig = get_site_option( 'bb-config-location' );
    2424        $bp->forums->slug = BP_FORUMS_SLUG;
     25        $bp->forums->title = apply_filters( 'bp_forums_title', __( 'Forums', 'buddypress' ) );
     26        $bp->forums->directory_title = apply_filters( 'bp_groups_directory_title', __( 'Forum Directory', 'buddypress' ) );
    2527       
    2628        /* Register this in the active components array */
    2729        $bp->active_components[$bp->forums->slug] = $bp->forums->id;
     
    6769}
    6870add_action( 'wp', 'bp_forums_directory_forums_setup', 2 );
    6971
     72function bp_forums_setup_main_nav() {
     73        global $bp;
     74       
     75        if((int) get_site_option( 'bp-disable-forums-directory' ))
     76                return;
     77       
     78        $selected = bp_is_page( BP_FORUMS_SLUG ) ? 'class="selected"' : '';
     79        $title = $bp->forums->title;
     80       
     81        echo "<li$selected><a href=\"" . site_url( BP_FORUMS_SLUG ) . "\" title=\"$title\">$title</a></li>";   
     82}
     83add_action( 'bp_nav_items', 'bp_groups_setup_main_nav', 14 );
     84
    7085function bp_forums_add_admin_menu() {
    7186        global $bp;
    7287       
  • bp-forums/bp-forums-admin.php

     
    6262                       
    6363                                switch ( $result ) {
    6464                                        case 1:
    65                                                 _e( 'All done! Configuration settings have been saved to the file <code>bb-config.php</code> in the root of your WordPress install.' );
     65                                                _e( 'All done! Configuration settings have been saved to the file <code>bb-config.php</code> in the root of your WordPress install.', 'buddypress' );
    6666                                                break;
    6767                                        default:
    6868                                                // Just write the contents to screen
  • bp-friends.php

     
    4545        $bp->friends->table_name = $wpdb->base_prefix . 'bp_friends';
    4646        $bp->friends->format_notification_function = 'friends_format_notifications';
    4747        $bp->friends->slug = BP_FRIENDS_SLUG;
     48        $bp->friends->title = apply_filters( 'bp_friends_title', __( 'Friends', 'buddypress' ) );
    4849       
    4950        /* Register this in the active components array */
    5051        $bp->active_components[$bp->friends->slug] = $bp->friends->id;
     
    7071        global $bp;
    7172       
    7273        /* Add 'Friends' to the main navigation */
    73         bp_core_new_nav_item( array( 'name' => __('Friends', 'buddypress'), 'slug' => $bp->friends->slug, 'position' => 60, 'screen_function' => 'friends_screen_my_friends', 'default_subnav_slug' => 'my-friends', 'item_css_id' => $bp->friends->id ) );
     74        bp_core_new_nav_item( array( 'name' => $bp->friends->title, 'slug' => $bp->friends->slug, 'position' => 60, 'screen_function' => 'friends_screen_my_friends', 'default_subnav_slug' => 'my-friends', 'item_css_id' => $bp->friends->id ) );
    7475       
    7576        $friends_link = $bp->loggedin_user->domain . $bp->friends->slug . '/';
    7677       
  • bp-groups.php

     
    130130        $bp->groups->table_name_groupmeta = $wpdb->base_prefix . 'bp_groups_groupmeta';
    131131        $bp->groups->format_notification_function = 'groups_format_notifications';
    132132        $bp->groups->slug = BP_GROUPS_SLUG;
     133        $bp->groups->title = apply_filters( 'bp_groups_title', __( 'Groups', 'buddypress' ) );
     134        $bp->groups->directory_title = apply_filters( 'bp_groups_directory_title', __( 'Groups Directory', 'buddypress' ) );
    133135
    134136        /* Register this in the active components array */
    135137        $bp->active_components[$bp->groups->slug] = $bp->groups->id;
     
    211213        }
    212214
    213215        /* Add 'Groups' to the main navigation */
    214         bp_core_new_nav_item( array( 'name' => __('Groups', 'buddypress'), 'slug' => $bp->groups->slug, 'position' => 70, 'screen_function' => 'groups_screen_my_groups', 'default_subnav_slug' => 'my-groups', 'item_css_id' => $bp->groups->id ) );
     216        bp_core_new_nav_item( array( 'name' => $bp->groups->title, 'slug' => $bp->groups->slug, 'position' => 70, 'screen_function' => 'groups_screen_my_groups', 'default_subnav_slug' => 'my-groups', 'item_css_id' => $bp->groups->id ) );
    215217       
    216218        $groups_link = $bp->loggedin_user->domain . $bp->groups->slug . '/';
    217219       
     
    297299add_action( 'plugins_loaded', 'groups_setup_nav' );
    298300add_action( 'admin_menu', 'groups_setup_nav' );
    299301
     302function bp_groups_setup_main_nav() {
     303        global $bp;
     304       
     305        if((int) get_site_option( 'bp-disable-groups-directory' ))
     306                return;
     307       
     308        $selected = bp_is_page( BP_GROUPS_SLUG ) ? 'class="selected"' : '';
     309        $title = $bp->groups->title;
     310       
     311        echo "<li$selected><a href=\"" . site_url( BP_GROUPS_SLUG ) . "\" title=\"$title\">$title</a></li>";   
     312}
     313add_action( 'bp_nav_items', 'bp_groups_setup_main_nav', 13 );
     314
    300315function groups_directory_groups_setup() {
    301316        global $bp;
    302317
  • bp-messages.php

     
    8484        $bp->messages->format_activity_function = 'messages_format_activity';
    8585        $bp->messages->format_notification_function = 'messages_format_notifications';
    8686        $bp->messages->slug = BP_MESSAGES_SLUG;
    87 
     87        $bp->messages->title = apply_filters( 'bp_messages_title', __( 'Messages', 'buddypress' ) );
     88       
    8889        /* Register this in the active components array */
    8990        $bp->active_components[$bp->messages->slug] = $bp->messages->id;
    9091
     
    115116        }
    116117
    117118        /* Add 'Messages' to the main navigation */
    118         bp_core_new_nav_item( array( 'name' => __('Messages', 'buddypress'), 'slug' => $bp->messages->slug, 'position' => 50, 'show_for_displayed_user' => false, 'screen_function' => 'messages_screen_inbox', 'default_subnav_slug' => 'inbox', 'item_css_id' => $bp->messages->id ) );
     119        bp_core_new_nav_item( array( 'name' => $bp->messages->title, 'slug' => $bp->messages->slug, 'position' => 50, 'show_for_displayed_user' => false, 'screen_function' => 'messages_screen_inbox', 'default_subnav_slug' => 'inbox', 'item_css_id' => $bp->messages->id ) );
    119120       
    120121        $messages_link = $bp->loggedin_user->domain . $bp->messages->slug . '/';
    121122       
  • bp-status.php

     
    1111        /* For internal identification */
    1212        $bp->status->id = 'status';
    1313        $bp->status->slug = BP_STATUS_SLUG;
     14        $bp->status->title = apply_filters( 'bp_status_title', __( 'Status', 'buddypress' ) );
    1415       
    1516        /* Register this in the active components array */
    1617        $bp->active_components[$bp->status->slug] = $bp->status->id;
  • bp-themes/bp-sn-parent/header.php

     
    8484       
    8585                        <ul id="nav">
    8686                                <li<?php if ( bp_is_page( 'home' ) ) : ?> class="selected"<?php endif; ?>><a href="<?php echo get_option('home') ?>" title="<?php _e( 'Home', 'buddypress' ) ?>"><?php _e( 'Home', 'buddypress' ) ?></a></li>
    87                                 <li<?php if ( bp_is_page( BP_HOME_BLOG_SLUG ) ) : ?> class="selected"<?php endif; ?>><a href="<?php echo get_option('home') ?>/<?php echo BP_HOME_BLOG_SLUG ?>" title="<?php _e( 'Blog', 'buddypress' ) ?>"><?php _e( 'Blog', 'buddypress' ) ?></a></li>
    88                                 <li<?php if ( bp_is_page( BP_MEMBERS_SLUG ) ) : ?> class="selected"<?php endif; ?>><a href="<?php echo get_option('home') ?>/<?php echo BP_MEMBERS_SLUG ?>" title="<?php _e( 'Members', 'buddypress' ) ?>"><?php _e( 'Members', 'buddypress' ) ?></a></li>
    89 
    90                                 <?php if ( function_exists( 'groups_install' ) ) : ?>
    91                                         <li<?php if ( bp_is_page( BP_GROUPS_SLUG ) ) : ?> class="selected"<?php endif; ?>><a href="<?php echo get_option('home') ?>/<?php echo BP_GROUPS_SLUG ?>" title="<?php _e( 'Groups', 'buddypress' ) ?>"><?php _e( 'Groups', 'buddypress' ) ?></a></li>
    92                                 <?php endif; ?>
    93 
    94                                 <?php if ( function_exists( 'groups_install' ) && ( function_exists( 'bp_forums_setup' ) && !(int) get_site_option( 'bp-disable-forum-directory' ) ) ) : ?>
    95                                         <li<?php if ( bp_is_page( BP_FORUMS_SLUG ) ) : ?> class="selected"<?php endif; ?>><a href="<?php echo get_option('home') ?>/<?php echo BP_FORUMS_SLUG ?>" title="<?php _e( 'Forums', 'buddypress' ) ?>"><?php _e( 'Forums', 'buddypress' ) ?></a></li>
    96                                 <?php endif; ?>
    9787                               
    98                                 <?php if ( function_exists( 'bp_blogs_install' ) ) : ?>
    99                                         <li<?php if ( bp_is_page( BP_BLOGS_SLUG ) ) : ?> class="selected"<?php endif; ?>><a href="<?php echo get_option('home') ?>/<?php echo BP_BLOGS_SLUG ?>" title="<?php _e( 'Blogs', 'buddypress' ) ?>"><?php _e( 'Blogs', 'buddypress' ) ?></a></li>
    100                                 <?php endif; ?>
    101 
    10288                                <?php do_action( 'bp_nav_items' ); ?>
    10389                        </ul>
    10490
  • bp-wire.php

     
    2121
    2222        /* For internal identification */
    2323        $bp->wire->id = 'wire';
    24        
    2524        $bp->wire->slug = BP_WIRE_SLUG;
    26        
     25        $bp->wire->title = apply_filters( 'bp_wire_title', __( 'Wire', 'buddypress' ) );
     26
    2727        /* Register this in the active components array */
    2828        $bp->active_components[$bp->wire->slug] = $bp->wire->id;
    2929
     
    4040                return false;
    4141               
    4242        /* Add 'Wire' to the main navigation */
    43         bp_core_new_nav_item( array( 'name' => __('Wire', 'buddypress'), 'slug' => $bp->wire->slug, 'position' => 40, 'screen_function' => 'bp_wire_screen_latest', 'default_subnav_slug' => 'all-posts', 'item_css_id' => $bp->wire->id ) );
     43        bp_core_new_nav_item( array( 'name' => $bp->wire->title, 'slug' => $bp->wire->slug, 'position' => 40, 'screen_function' => 'bp_wire_screen_latest', 'default_subnav_slug' => 'all-posts', 'item_css_id' => $bp->wire->id ) );
    4444
    4545        $wire_link = $bp->loggedin_user->domain . $bp->wire->slug . '/';
    4646       
  • bp-xprofile.php

     
    141141
    142142        $bp->profile->format_notification_function = 'xprofile_format_notifications';
    143143        $bp->profile->slug = BP_XPROFILE_SLUG;
     144        $bp->profile->title = apply_filters( 'bp_profile_title', __( 'Profile', 'buddypress' ) );
    144145
    145146        /* Register this in the active components array */
    146147        $bp->active_components[$bp->profile->slug] = $bp->profile->id;
     
    204205        global $bp;
    205206       
    206207        /* Add 'Profile' to the main navigation */
    207         bp_core_new_nav_item( array( 'name' => __( 'Profile', 'buddypress' ), 'slug' => $bp->profile->slug, 'position' => 20, 'screen_function' => 'xprofile_screen_display_profile', 'default_subnav_slug' => 'public', 'item_css_id' => $bp->profile->id ) );
     208        bp_core_new_nav_item( array( 'name' => $bp->profile->title, 'slug' => $bp->profile->slug, 'position' => 20, 'screen_function' => 'xprofile_screen_display_profile', 'default_subnav_slug' => 'public', 'item_css_id' => $bp->profile->id ) );
    208209
    209210        $profile_link = $bp->loggedin_user->domain . $bp->profile->slug . '/';
    210211