Changeset 4586
- Timestamp:
- 07/04/2011 05:37:22 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 4 added
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-core/bp-core-adminbar.php
r4564 r4586 10 10 */ 11 11 12 /** 13 * Unhook the WordPress core menus. We will be adding our own to replace these. 14 * 15 * @todo Single blog/post/group/user/forum/activity menus 16 * @todo Admin/moderator menus12 if ( !defined( 'BP_USE_WP_ADMIN_BAR' ) || defined( 'DOING_AJAX' ) ) 13 return; 14 15 /** 16 * Unhook the WordPress core menus. 17 17 * 18 18 * @since BuddyPress (r4151) … … 23 23 */ 24 24 function bp_admin_bar_remove_wp_menus() { 25 25 26 remove_action( 'admin_bar_menu', 'wp_admin_bar_my_account_menu', 10 ); 26 27 remove_action( 'admin_bar_menu', 'wp_admin_bar_my_sites_menu', 20 ); 28 remove_action( 'admin_bar_menu', 'wp_admin_bar_dashboard_view_site_menu', 25 ); 29 27 30 // Don't show the 'Edit Page' menu on BP pages 28 if ( !bp_is_blog_page() ) 31 if ( !bp_is_blog_page() ) 29 32 remove_action( 'admin_bar_menu', 'wp_admin_bar_edit_menu', 30 ); 30 33 31 /*remove_action( 'admin_bar_menu', 'wp_admin_bar_my_sites_menu', 20 ); 32 remove_action( 'admin_bar_menu', 'wp_admin_bar_edit_menu', 30 ); 33 remove_action( 'admin_bar_menu', 'wp_admin_bar_shortlink_menu', 80 ); 34 remove_action( 'admin_bar_menu', 'wp_admin_bar_shortlink_menu', 80 ); 35 remove_action( 'admin_bar_menu', 'wp_admin_bar_updates_menu', 70 ); 34 36 35 37 if ( !is_network_admin() && !is_user_admin() ) { 36 remove_action( 'admin_bar_menu', 'wp_admin_bar_new_content_menu', 40 ); 37 remove_action( 'admin_bar_menu', 'wp_admin_bar_comments_menu', 50 ); 38 remove_action( 'admin_bar_menu', 'wp_admin_bar_appearance_menu', 60 ); 38 remove_action( 'admin_bar_menu', 'wp_admin_bar_comments_menu', 50 ); 39 remove_action( 'admin_bar_menu', 'wp_admin_bar_appearance_menu', 60 ); 39 40 } 40 41 41 remove_action( 'admin_bar_menu', 'wp_admin_bar_updates_menu', 70 );*/ 42 } 43 if ( defined( 'BP_USE_WP_ADMIN_BAR' ) ) 44 add_action( 'bp_init', 'bp_admin_bar_remove_wp_menus', 2 ); 45 46 42 remove_action( 'admin_bar_menu', 'wp_admin_bar_updates_menu', 70 ); 43 } 44 add_action( 'bp_init', 'bp_admin_bar_remove_wp_menus', 2 ); 45 46 /** 47 * Add a menu for the root site of this BuddyPress network 48 * 49 * @global type $bp 50 * @global type $wp_admin_bar 51 * @return If in ajax 52 */ 53 function bp_admin_bar_root_site() { 54 global $bp, $wp_admin_bar; 55 56 // Create the root blog menu 57 $wp_admin_bar->add_menu( array( 58 'id' => 'bp-root-blog', 59 'title' => get_blog_option( BP_ROOT_BLOG, 'blogname' ), 60 'href' => bp_get_root_domain() 61 ) ); 62 63 // Logged in user 64 if ( is_user_logged_in() ) { 65 66 // Dashboard links 67 if ( is_super_admin() ) { 68 69 // Add site admin link 70 $wp_admin_bar->add_menu( array( 71 'id' => 'dashboard', 72 'parent' => 'bp-root-blog', 73 'title' => __( 'Admin Dashboard', 'buddypress' ), 74 'href' => get_admin_url( BP_ROOT_BLOG ) 75 ) ); 76 77 // Add network admin link 78 if ( is_multisite() ) { 79 80 // Link to the network admin dashboard 81 $wp_admin_bar->add_menu( array( 82 'id' => 'network-dashboard', 83 'parent' => 'bp-root-blog', 84 'title' => __( 'Network Dashboard', 'buddypress' ), 85 'href' => network_admin_url() 86 ) ); 87 } 88 } 89 } 90 } 91 add_action( 'bp_setup_admin_bar', 'bp_admin_bar_root_site', 3 ); 92 93 /** 94 * Add the "My Sites/[Site Name]" menu and all submenus. 95 */ 96 function bp_admin_bar_my_sites_menu() { 97 global $wpdb, $wp_admin_bar; 98 99 /* Add the 'My Sites' menu if the user has more than one site. */ 100 if ( count( $wp_admin_bar->user->blogs ) <= 1 ) 101 return; 102 103 $wp_admin_bar->add_menu( array( 'id' => 'my-blogs', 'title' => __( 'My Sites' ), 'href' => admin_url( 'my-sites.php' ) ) ); 104 105 $default = includes_url( 'images/wpmini-blue.png' ); 106 107 foreach ( (array)$wp_admin_bar->user->blogs as $blog ) { 108 // @todo Replace with some favicon lookup. 109 //$blavatar = '<img src="' . esc_url( blavatar_url( blavatar_domain( $blog->siteurl ), 'img', 16, $default ) ) . '" alt="Blavatar" width="16" height="16" />'; 110 $blavatar = '<img src="' . esc_url( $default ) . '" alt="' . esc_attr__( 'Blavatar' ) . '" width="16" height="16" class="blavatar"/>'; 111 112 $blogname = empty( $blog->blogname ) ? $blog->domain : $blog->blogname; 113 114 $wp_admin_bar->add_menu( array( 'parent' => 'my-blogs', 'id' => 'blog-' . $blog->userblog_id, 'title' => $blavatar . $blogname, 'href' => get_admin_url( $blog->userblog_id ) ) ); 115 $wp_admin_bar->add_menu( array( 'parent' => 'blog-' . $blog->userblog_id, 'id' => 'blog-' . $blog->userblog_id . '-d', 'title' => __( 'Dashboard' ), 'href' => get_admin_url( $blog->userblog_id ) ) ); 116 117 if ( current_user_can_for_blog( $blog->userblog_id, 'edit_posts' ) ) { 118 $wp_admin_bar->add_menu( array( 'parent' => 'blog-' . $blog->userblog_id, 'id' => 'blog-' . $blog->userblog_id . '-n', 'title' => __( 'New Post' ), 'href' => get_admin_url( $blog->userblog_id, 'post-new.php' ) ) ); 119 $wp_admin_bar->add_menu( array( 'parent' => 'blog-' . $blog->userblog_id, 'id' => 'blog-' . $blog->userblog_id . '-c', 'title' => __( 'Manage Comments' ), 'href' => get_admin_url( $blog->userblog_id, 'edit-comments.php' ) ) ); 120 } 121 122 $wp_admin_bar->add_menu( array( 'parent' => 'blog-' . $blog->userblog_id, 'id' => 'blog-' . $blog->userblog_id . '-v', 'title' => __( 'Visit Site' ), 'href' => get_home_url( $blog->userblog_id ) ) ); 123 } 124 } 125 add_action( 'bp_setup_admin_bar', 'bp_admin_bar_my_sites_menu', 3 ); 126 127 /** 128 * Add edit comments link with awaiting moderation count bubble 129 */ 130 function bp_admin_bar_comments_menu( $wp_admin_bar ) { 131 global $wp_admin_bar; 132 133 if ( !current_user_can( 'edit_posts' ) ) 134 return; 135 136 $awaiting_mod = wp_count_comments(); 137 $awaiting_mod = $awaiting_mod->moderated; 138 139 $awaiting_mod = $awaiting_mod ? "<span id='ab-awaiting-mod' class='pending-count'>" . number_format_i18n( $awaiting_mod ) . "</span>" : ''; 140 $wp_admin_bar->add_menu( array( 'parent' => 'dashboard', 'id' => 'comments', 'title' => sprintf( __( 'Comments %s' ), $awaiting_mod ), 'href' => admin_url( 'edit-comments.php' ) ) ); 141 } 142 add_action( 'bp_setup_admin_bar', 'bp_admin_bar_comments_menu', 3 ); 143 144 /** 145 * Add "Appearance" menu with widget and nav menu submenu 146 */ 147 function bp_admin_bar_appearance_menu() { 148 global $wp_admin_bar; 149 150 // You can have edit_theme_options but not switch_themes. 151 if ( !current_user_can( 'switch_themes' ) && !current_user_can( 'edit_theme_options' ) ) 152 return; 153 154 $wp_admin_bar->add_menu( array( 'parent' => 'dashboard', 'id' => 'appearance', 'title' => __( 'Appearance' ), 'href' => admin_url( 'themes.php' ) ) ); 155 156 if ( !current_user_can( 'edit_theme_options' ) ) 157 return; 158 159 if ( current_user_can( 'switch_themes' ) ) 160 $wp_admin_bar->add_menu( array( 'parent' => 'appearance', 'id' => 'themes', 'title' => __( 'Themes' ), 'href' => admin_url( 'themes.php' ) ) ); 161 162 if ( current_theme_supports( 'widgets' ) ) 163 $wp_admin_bar->add_menu( array( 'parent' => 'appearance', 'id' => 'widgets', 'title' => __( 'Widgets' ), 'href' => admin_url( 'widgets.php' ) ) ); 164 165 if ( current_theme_supports( 'menus' ) || current_theme_supports( 'widgets' ) ) 166 $wp_admin_bar->add_menu( array( 'parent' => 'appearance', 'id' => 'menus', 'title' => __( 'Menus' ), 'href' => admin_url( 'nav-menus.php' ) ) ); 167 168 if ( current_theme_supports( 'custom-background' ) ) 169 $wp_admin_bar->add_menu( array( 'parent' => 'appearance', 'id' => 'background', 'title' => __( 'Background' ), 'href' => admin_url( 'themes.php?page=custom-background' ) ) ); 170 171 if ( current_theme_supports( 'custom-header' ) ) 172 $wp_admin_bar->add_menu( array( 'parent' => 'appearance', 'id' => 'header', 'title' => __( 'Header' ), 'href' => admin_url( 'themes.php?page=custom-header' ) ) ); 173 } 174 add_action( 'bp_setup_admin_bar', 'bp_admin_bar_appearance_menu', 3 ); 175 176 /** 177 * Provide an update link if theme/plugin/core updates are available 178 */ 179 function bp_admin_bar_updates_menu() { 180 global $wp_admin_bar; 181 182 if ( !current_user_can( 'install_plugins' ) ) 183 return; 184 185 $plugin_update_count = $theme_update_count = $wordpress_update_count = 0; 186 $update_plugins = get_site_transient( 'update_plugins' ); 187 if ( !empty( $update_plugins->response ) ) 188 $plugin_update_count = count( $update_plugins->response ); 189 $update_themes = get_site_transient( 'update_themes' ); 190 if ( !empty( $update_themes->response ) ) 191 $theme_update_count = count( $update_themes->response ); 192 /* @todo get_core_updates() is only available on admin page loads 193 $update_wordpress = get_core_updates( array('dismissed' => false) ); 194 if ( !empty($update_wordpress) && !in_array( $update_wordpress[0]->response, array('development', 'latest') ) ) 195 $wordpress_update_count = 1; 196 */ 197 198 $update_count = $plugin_update_count + $theme_update_count + $wordpress_update_count; 199 200 if ( !$update_count ) 201 return; 202 203 $update_title = array( ); 204 if ( $wordpress_update_count ) 205 $update_title[] = sprintf( __( '%d WordPress Update' ), $wordpress_update_count ); 206 if ( $plugin_update_count ) 207 $update_title[] = sprintf( _n( '%d Plugin Update', '%d Plugin Updates', $plugin_update_count ), $plugin_update_count ); 208 if ( $theme_update_count ) 209 $update_title[] = sprintf( _n( '%d Theme Update', '%d Theme Updates', $theme_update_count ), $theme_update_count ); 210 211 $update_title = !empty( $update_title ) ? esc_attr( implode( ', ', $update_title ) ) : ''; 212 213 $update_title = "<span title='$update_title'>"; 214 $update_title .= sprintf( __( 'Updates %s' ), "<span id='ab-updates' class='update-count'>" . number_format_i18n( $update_count ) . '</span>' ); 215 $update_title .= '</span>'; 216 217 $wp_admin_bar->add_menu( array( 'parent' => 'dashboard', 'id' => 'updates', 'title' => $update_title, 'href' => network_admin_url( 'update-core.php' ) ) ); 218 } 219 add_action( 'bp_setup_admin_bar', 'bp_admin_bar_updates_menu', 3 ); 220 221 /** 222 * Handle the Admin Bar CSS 223 */ 224 function bp_core_load_admin_bar_css() { 225 global $wp_version; 226 227 // Admin bar styles 228 if ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) 229 $stylesheet = BP_PLUGIN_URL . '/bp-core/css/admin-bar.dev.css'; 230 else 231 $stylesheet = BP_PLUGIN_URL . '/bp-core/css/admin-bar.css'; 232 233 wp_enqueue_style( 'bp-admin-bar', apply_filters( 'bp_core_admin_bar_css', $stylesheet ), array( 'admin-bar' ), BP_VERSION ); 234 235 if ( !is_rtl() ) 236 return; 237 238 if ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) 239 $stylesheet = BP_PLUGIN_URL . '/bp-core/css/admin_bar-rtl.dev.css'; 240 else 241 $stylesheet = BP_PLUGIN_URL . '/bp-core/css/admin_bar-rtl.css'; 242 243 wp_enqueue_style( 'bp-admin-bar-rtl', apply_filters( 'bp_core_admin_bar_rtl_css', $stylesheet ), array( 'bp-admin-bar' ), BP_VERSION ); 244 } 245 add_action( 'bp_init', 'bp_core_load_admin_bar_css' ); 47 246 48 247 ?> -
trunk/bp-core/bp-core-functions.php
r4585 r4586 17 17 * @return mixed The value for the option 18 18 */ 19 function bp_get_option( $option_name, $default = false) {19 function bp_get_option( $option_name, $default = '' ) { 20 20 $value = get_blog_option( bp_get_option_blog_id( $option_name ), $option_name, $default ); 21 21 -
trunk/bp-core/bp-core-loader.php
r4559 r4586 138 138 // Fetches all of the core BuddyPress settings in one fell swoop 139 139 if ( empty( $bp->site_options ) ) 140 $bp->site_options = bp_core_get_ site_options();140 $bp->site_options = bp_core_get_root_options(); 141 141 142 142 // The names of the core WordPress pages used to display BuddyPress content -
trunk/bp-forums/bp-forums-loader.php
r4321 r4586 133 133 // Additional menu if friends is active 134 134 $sub_nav[] = array( 135 'name' => __( ' Started', 'buddypress' ),135 'name' => __( 'Topics Started', 'buddypress' ), 136 136 'slug' => 'topics', 137 137 'parent_url' => $forums_link, … … 199 199 $wp_admin_nav[] = array( 200 200 'parent' => 'my-account-' . $this->id, 201 'title' => __( ' My Topics', 'buddypress' ),201 'title' => __( 'Topics Started', 'buddypress' ), 202 202 'href' => trailingslashit( $forums_link . 'topics' ) 203 203 ); … … 206 206 $wp_admin_nav[] = array( 207 207 'parent' => 'my-account-' . $this->id, 208 'title' => __( ' MyReplies', 'buddypress' ),208 'title' => __( 'Replies', 'buddypress' ), 209 209 'href' => trailingslashit( $forums_link . 'replies' ) 210 210 ); … … 213 213 $wp_admin_nav[] = array( 214 214 'parent' => 'my-account-' . $this->id, 215 'title' => __( ' My Favorites', 'buddypress' ),215 'title' => __( 'Favorite Topics', 'buddypress' ), 216 216 'href' => trailingslashit( $forums_link . 'favorites' ) 217 217 ); … … 232 232 if ( bp_is_forums_component() ) { 233 233 if ( bp_is_my_profile() ) { 234 $bp->bp_options_title = __( ' MyForums', 'buddypress' );234 $bp->bp_options_title = __( 'Forums', 'buddypress' ); 235 235 } else { 236 236 $bp->bp_options_avatar = bp_core_fetch_avatar( array( -
trunk/bp-friends/bp-friends-loader.php
r4381 r4586 107 107 // Add the subnav items to the friends nav item 108 108 $sub_nav[] = array( 109 'name' => __( ' My Friends', 'buddypress' ),109 'name' => __( 'Friendships', 'buddypress' ), 110 110 'slug' => 'my-friends', 111 111 'parent_url' => $friends_link, … … 167 167 $wp_admin_nav[] = array( 168 168 'parent' => 'my-account-' . $this->id, 169 'title' => __( ' My Friends', 'buddypress' ),169 'title' => __( 'Friendships', 'buddypress' ), 170 170 'href' => trailingslashit( $friends_link ) 171 171 ); … … 193 193 if ( bp_is_friends_component() ) { 194 194 if ( bp_is_my_profile() ) { 195 $bp->bp_options_title = __( ' My Friends', 'buddypress' );195 $bp->bp_options_title = __( 'Friendships', 'buddypress' ); 196 196 } else { 197 197 $bp->bp_options_avatar = bp_core_fetch_avatar( array( -
trunk/bp-groups/bp-groups-adminbar.php
r4570 r4586 29 29 return false; 30 30 31 // Group avatar 32 $avatar = bp_core_fetch_avatar( array( 33 'object' => 'group', 34 'type' => 'thumb', 35 'avatar_dir' => 'group-avatars', 36 'item_id' => $bp->groups->current_group->id, 37 'width' => 16, 38 'height' => 16 39 ) ); 40 41 // Unique ID for the 'My Account' menu 42 $bp->group_admin_menu_id = ( ! empty( $avatar ) ) ? 'group-admin-with-avatar' : 'group-admin'; 43 31 44 // Add the top-level Group Admin button 32 45 $wp_admin_bar->add_menu( array( 33 'id' => 'group-admin',34 'title' => __( 'Group Admin', 'buddypress'),35 'href' => bp_ displayed_user_domain()46 'id' => $bp->group_admin_menu_id, 47 'title' => $avatar . bp_get_current_group_name(), 48 'href' => bp_get_group_permalink( $bp->groups->current_group ) 36 49 ) ); 37 50 38 51 // Group Admin > Edit details 39 52 $wp_admin_bar->add_menu( array( 40 'parent' => 'group-admin',53 'parent' => $bp->group_admin_menu_id, 41 54 'id' => 'edit-details', 42 'title' => __( "Edit Details", 'buddypress' ),55 'title' => __( 'Edit Details', 'buddypress' ), 43 56 'href' => bp_get_groups_action_link( 'admin/edit-details' ) 44 57 ) ); … … 46 59 // Group Admin > Group settings 47 60 $wp_admin_bar->add_menu( array( 48 'parent' => 'group-admin',61 'parent' => $bp->group_admin_menu_id, 49 62 'id' => 'group-settings', 50 'title' => __( "Group Settings", 'buddypress' ),63 'title' => __( 'Edit Settings', 'buddypress' ), 51 64 'href' => bp_get_groups_action_link( 'admin/group-settings' ) 52 65 ) ); … … 54 67 // Group Admin > Group avatar 55 68 $wp_admin_bar->add_menu( array( 56 'parent' => 'group-admin',69 'parent' => $bp->group_admin_menu_id, 57 70 'id' => 'group-avatar', 58 'title' => __( "Group Avatar", 'buddypress' ),71 'title' => __( 'Edit Avatar', 'buddypress' ), 59 72 'href' => bp_get_groups_action_link( 'admin/group-avatar' ) 60 73 ) ); … … 63 76 if ( bp_is_active( 'friends' ) ) { 64 77 $wp_admin_bar->add_menu( array( 65 'parent' => 'group-admin',78 'parent' => $bp->group_admin_menu_id, 66 79 'id' => 'manage-invitations', 67 'title' => __( "Manage Invitations", 'buddypress' ),80 'title' => __( 'Manage Invitations', 'buddypress' ), 68 81 'href' => bp_get_groups_action_link( 'send-invites' ) 69 82 ) ); … … 72 85 // Group Admin > Manage members 73 86 $wp_admin_bar->add_menu( array( 74 'parent' => 'group-admin',87 'parent' => $bp->group_admin_menu_id, 75 88 'id' => 'manage-members', 76 'title' => __( "Manage Members", 'buddypress' ),89 'title' => __( 'Manage Members', 'buddypress' ), 77 90 'href' => bp_get_groups_action_link( 'admin/manage-members' ) 78 91 ) ); … … 81 94 if ( bp_get_group_status( $bp->groups->current_group ) == 'private' ) { 82 95 $wp_admin_bar->add_menu( array( 83 'parent' => 'group-admin',96 'parent' => $bp->group_admin_menu_id, 84 97 'id' => 'membership-requests', 85 'title' => __( "Membership Requests", 'buddypress' ),98 'title' => __( 'Membership Requests', 'buddypress' ), 86 99 'href' => bp_get_groups_action_link( 'admin/membership-requests' ) 87 100 ) ); … … 90 103 // Delete Group 91 104 $wp_admin_bar->add_menu( array( 92 'parent' => 'group-admin',105 'parent' => $bp->group_admin_menu_id, 93 106 'id' => 'delete-group', 94 'title' => __( "Delete Group", 'buddypress' ),107 'title' => __( 'Delete Group', 'buddypress' ), 95 108 'href' => bp_get_groups_action_link( 'admin/delete-group' ) 96 109 ) ); -
trunk/bp-groups/bp-groups-loader.php
r4570 r4586 235 235 // Add the My Groups nav item 236 236 $sub_nav[] = array( 237 'name' => __( 'M y Groups', 'buddypress' ),237 'name' => __( 'Memberships', 'buddypress' ), 238 238 'slug' => 'my-groups', 239 239 'parent_url' => $groups_link, … … 246 246 // Add the Group Invites nav item 247 247 $sub_nav[] = array( 248 'name' => __( 'Invitations', 248 'name' => __( 'Invitations', 'buddypress' ), 249 249 'slug' => 'invites', 250 250 'parent_url' => $groups_link, … … 263 263 // Add 'Groups' to the main navigation 264 264 $main_nav = array( 265 'name' => __( ' Groups', 'buddypress' ),265 'name' => __( 'Memberships', 'buddypress' ), 266 266 'slug' => $this->current_group->slug, 267 267 'position' => -1, // Do not show in BuddyBar … … 402 402 $wp_admin_nav[] = array( 403 403 'parent' => 'my-account-' . $this->id, 404 'title' => __( 'M y Groups', 'buddypress' ),404 'title' => __( 'Memberships', 'buddypress' ), 405 405 'href' => trailingslashit( $groups_link ) 406 406 ); … … 429 429 if ( bp_is_my_profile() && !bp_is_single_item() ) { 430 430 431 $bp->bp_options_title = __( 'M y Groups', 'buddypress' );431 $bp->bp_options_title = __( 'Memberships', 'buddypress' ); 432 432 433 433 } else if ( !bp_is_my_profile() && !bp_is_single_item() ) { -
trunk/bp-groups/bp-groups-template.php
r4559 r4586 1242 1242 ?> 1243 1243 <?php if ( $bp->is_item_admin || $bp->is_item_mod ) { ?> 1244 <li<?php if ( 'edit-details' == $current_tab || empty( $current_tab ) ) : ?> class="current"<?php endif; ?>><a href="<?php echo bp_get_root_domain() . '/' . $bp->groups->root_slug ?>/<?php echo $group->slug ?>/admin/edit-details"><?php _e( 'Edit Details', 'buddypress')?></a></li>1244 <li<?php if ( 'edit-details' == $current_tab || empty( $current_tab ) ) : ?> class="current"<?php endif; ?>><a href="<?php echo bp_get_root_domain() . '/' . $bp->groups->root_slug ?>/<?php echo $group->slug ?>/admin/edit-details"><?php _e( 'Details', 'buddypress' ); ?></a></li> 1245 1245 <?php } ?> 1246 1246 … … 1249 1249 return false; 1250 1250 ?> 1251 <li<?php if ( 'group-settings' == $current_tab ) : ?> class="current"<?php endif; ?>><a href="<?php echo bp_get_root_domain() . '/' . $bp->groups->root_slug ?>/<?php echo $group->slug ?>/admin/group-settings"><?php _e( 'Group Settings', 'buddypress')?></a></li>1252 <li<?php if ( 'group-avatar' == $current_tab ) : ?> class="current"<?php endif; ?>><a href="<?php echo bp_get_root_domain() . '/' . $bp->groups->root_slug ?>/<?php echo $group->slug ?>/admin/group-avatar"><?php _e( 'Group Avatar', 'buddypress')?></a></li>1253 <li<?php if ( 'manage-members' == $current_tab ) : ?> class="current"<?php endif; ?>><a href="<?php echo bp_get_root_domain() . '/' . $bp->groups->root_slug ?>/<?php echo $group->slug ?>/admin/manage-members"><?php _e( 'Manage Members', 'buddypress')?></a></li>1251 <li<?php if ( 'group-settings' == $current_tab ) : ?> class="current"<?php endif; ?>><a href="<?php echo bp_get_root_domain() . '/' . $bp->groups->root_slug ?>/<?php echo $group->slug ?>/admin/group-settings"><?php _e( 'Settings', 'buddypress' ); ?></a></li> 1252 <li<?php if ( 'group-avatar' == $current_tab ) : ?> class="current"<?php endif; ?>><a href="<?php echo bp_get_root_domain() . '/' . $bp->groups->root_slug ?>/<?php echo $group->slug ?>/admin/group-avatar"><?php _e( 'Avatar', 'buddypress' ); ?></a></li> 1253 <li<?php if ( 'manage-members' == $current_tab ) : ?> class="current"<?php endif; ?>><a href="<?php echo bp_get_root_domain() . '/' . $bp->groups->root_slug ?>/<?php echo $group->slug ?>/admin/manage-members"><?php _e( 'Members', 'buddypress' ); ?></a></li> 1254 1254 1255 1255 <?php if ( $groups_template->group->status == 'private' ) : ?> 1256 <li<?php if ( 'membership-requests' == $current_tab ) : ?> class="current"<?php endif; ?>><a href="<?php echo bp_get_root_domain() . '/' . $bp->groups->root_slug ?>/<?php echo $group->slug ?>/admin/membership-requests"><?php _e( 'Membership Requests', 'buddypress')?></a></li>1256 <li<?php if ( 'membership-requests' == $current_tab ) : ?> class="current"<?php endif; ?>><a href="<?php echo bp_get_root_domain() . '/' . $bp->groups->root_slug ?>/<?php echo $group->slug ?>/admin/membership-requests"><?php _e( 'Requests', 'buddypress' ); ?></a></li> 1257 1257 <?php endif; ?> 1258 1258 1259 1259 <?php do_action( 'groups_admin_tabs', $current_tab, $group->slug ) ?> 1260 1260 1261 <li<?php if ( 'delete-group' == $current_tab ) : ?> class="current"<?php endif; ?>><a href="<?php echo bp_get_root_domain() . '/' . $bp->groups->root_slug ?>/<?php echo $group->slug ?>/admin/delete-group"><?php _e( 'Delete Group', 'buddypress')?></a></li>1261 <li<?php if ( 'delete-group' == $current_tab ) : ?> class="current"<?php endif; ?>><a href="<?php echo bp_get_root_domain() . '/' . $bp->groups->root_slug ?>/<?php echo $group->slug ?>/admin/delete-group"><?php _e( 'Delete', 'buddypress' ); ?></a></li> 1262 1262 <?php 1263 1263 } -
trunk/bp-members/bp-members-adminbar.php
r4570 r4586 22 22 return; 23 23 24 // Create the root blog menu25 $wp_admin_bar->add_menu( array(26 'id' => 'bp-root-blog',27 'title' => get_blog_option( BP_ROOT_BLOG, 'blogname' ),28 'href' => bp_get_root_domain()29 ) );30 31 24 // Logged in user 32 25 if ( is_user_logged_in() ) { 33 34 // Dashboard links35 if ( is_super_admin() ) {36 37 // Add site admin link38 $wp_admin_bar->add_menu( array(39 'parent' => 'bp-root-blog',40 'title' => __( 'Admin Dashboard', 'buddypress' ),41 'href' => get_admin_url( BP_ROOT_BLOG )42 ) );43 44 // Add network admin link45 if ( is_multisite() ) {46 47 // Link to the network admin dashboard48 $wp_admin_bar->add_menu( array(49 'parent' => 'bp-root-blog',50 'title' => __( 'Network Dashboard', 'buddypress' ),51 'href' => network_admin_url()52 ) );53 }54 }55 26 56 27 // User avatar … … 68 39 $wp_admin_bar->add_menu( array( 69 40 'id' => $bp->my_account_menu_id, 70 'title' => $avatar . bp_get_ user_firstname( $bp->loggedin_user->fullname),41 'title' => $avatar . bp_get_loggedin_user_fullname(), 71 42 'href' => $bp->loggedin_user->domain 72 43 ) ); … … 103 74 */ 104 75 function bp_members_user_admin_menu() { 105 global $ wp_admin_bar;76 global $bp, $wp_admin_bar; 106 77 107 78 // Only show if viewing a user … … 113 84 return false; 114 85 86 // User avatar 87 $avatar = bp_core_fetch_avatar( array( 88 'item_id' => $bp->displayed_user->id, 89 'email' => $bp->displayed_user->userdata->user_email, 90 'width' => 16, 91 'height' => 16 92 ) ); 93 94 // Unique ID for the 'My Account' menu 95 $bp->user_admin_menu_id = ( ! empty( $avatar ) ) ? 'user-admin-with-avatar' : 'user-admin'; 96 115 97 // Add the top-level User Admin button 116 98 $wp_admin_bar->add_menu( array( 117 'id' => 'user-admin',118 'title' => __( 'User Admin', 'buddypress'),99 'id' => $bp->user_admin_menu_id, 100 'title' => $avatar . bp_get_displayed_user_fullname(), 119 101 'href' => bp_displayed_user_domain() 120 102 ) ); … … 122 104 // User Admin > Edit this user's profile 123 105 $wp_admin_bar->add_menu( array( 124 'parent' => 'user-admin',106 'parent' => $bp->user_admin_menu_id, 125 107 'id' => 'edit-profile', 126 'title' => sprintf( __( "Edit %s's Profile", 'buddypress' ), bp_get_displayed_user_fullname()),108 'title' => __( "Edit Profile", 'buddypress' ), 127 109 'href' => bp_get_members_component_link( 'profile', 'edit' ) 128 110 ) ); … … 130 112 // User Admin > Edit this user's avatar 131 113 $wp_admin_bar->add_menu( array( 132 'parent' => 'user-admin',114 'parent' => $bp->user_admin_menu_id, 133 115 'id' => 'change-avatar', 134 'title' => sprintf( __( "Edit %s's Avatar", 'buddypress' ), bp_get_displayed_user_fullname() ), 135 'href' => bp_get_members_component_link( 'profile', 'change-avatar' ) 136 ) ); 137 138 // User Admin > Edit this user's avatar 139 $wp_admin_bar->add_menu( array( 140 'parent' => 'user-admin', 141 'id' => 'change-avatar', 142 'title' => sprintf( __( "Edit %s's Avatar", 'buddypress' ), bp_get_displayed_user_fullname() ), 116 'title' => __( "Edit Avatar", 'buddypress' ), 143 117 'href' => bp_get_members_component_link( 'profile', 'change-avatar' ) 144 118 ) ); … … 147 121 if ( !bp_core_is_user_spammer( bp_displayed_user_id() ) ) { 148 122 $wp_admin_bar->add_menu( array( 149 'parent' => 'user-admin',123 'parent' => $bp->user_admin_menu_id, 150 124 'id' => 'spam-user', 151 'title' => __( "Mark as Spammer", 'buddypress' ),125 'title' => __( 'Mark as Spammer', 'buddypress' ), 152 126 'href' => wp_nonce_url( bp_displayed_user_domain() . 'admin/mark-spammer/', 'mark-unmark-spammer' ), 153 127 'meta' => array( 'onclick' => 'confirm(" ' . __( 'Are you sure you want to mark this user as a spammer?', 'buddypress' ) . '");' ) … … 155 129 } else { 156 130 $wp_admin_bar->add_menu( array( 157 'parent' => 'user-admin',131 'parent' => $bp->user_admin_menu_id, 158 132 'id' => 'unspam-user', 159 'title' => __( "Not a Spammer", 'buddypress' ),133 'title' => __( 'Not a Spammer', 'buddypress' ), 160 134 'href' => wp_nonce_url( bp_displayed_user_domain() . 'admin/unmark-spammer/', 'mark-unmark-spammer' ), 161 135 'meta' => array( 'onclick' => 'confirm(" ' . __( 'Are you sure you want to mark this user as not a spammer?', 'buddypress' ) . '");' ) … … 165 139 // User Admin > Delete Account 166 140 $wp_admin_bar->add_menu( array( 167 'parent' => 'user-admin',141 'parent' => $bp->user_admin_menu_id, 168 142 'id' => 'delete-user', 169 'title' => sprintf( __( "Delete %s's Account", 'buddypress' ), bp_get_displayed_user_fullname()),143 'title' => __( 'Delete Account', 'buddypress' ), 170 144 'href' => wp_nonce_url( bp_displayed_user_domain() . 'admin/delete-user/', 'delete-user' ), 171 145 'meta' => array( 'onclick' => 'confirm(" ' . __( "Are you sure you want to delete this user's account?", 'buddypress' ) . '");' ) -
trunk/bp-messages/bp-messages-loader.php
r4381 r4586 125 125 126 126 $sub_nav[] = array( 127 'name' => __( 'Sent Messages', 'buddypress' ),127 'name' => __( 'Sent', 'buddypress' ), 128 128 'slug' => 'sentbox', 129 129 'parent_url' => $messages_link, -
trunk/bp-xprofile/bp-xprofile-loader.php
r4381 r4586 135 135 // Edit Profile 136 136 $sub_nav[] = array( 137 'name' => __( 'Edit Profile', 'buddypress' ),137 'name' => __( 'Edit', 'buddypress' ), 138 138 'slug' => 'edit', 139 139 'parent_url' => $profile_link, … … 184 184 $wp_admin_nav[] = array( 185 185 'parent' => 'my-account-' . $this->id, 186 'title' => __( 'View My Profile', 'buddypress' ),186 'title' => __( 'View', 'buddypress' ), 187 187 'href' => trailingslashit( $profile_link . 'public' ) 188 188 ); … … 191 191 $wp_admin_nav[] = array( 192 192 'parent' => 'my-account-' . $this->id, 193 'title' => __( 'Edit My Profile', 'buddypress' ),193 'title' => __( 'Edit', 'buddypress' ), 194 194 'href' => trailingslashit( $profile_link . 'edit' ) 195 195 ); … … 198 198 $wp_admin_nav[] = array( 199 199 'parent' => 'my-account-' . $this->id, 200 'title' => __( 'Change MyAvatar', 'buddypress' ),200 'title' => __( 'Change Avatar', 'buddypress' ), 201 201 'href' => trailingslashit( $profile_link . 'change-avatar' ) 202 202 );
Note: See TracChangeset
for help on using the changeset viewer.