Changeset 15769
- Timestamp:
- 10/09/2010 12:22:00 PM (14 years ago)
- Location:
- trunk/wp-includes
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/admin-bar.php
r15760 r15769 103 103 104 104 /** 105 * Use the $wp_admin_bar global to add the "My Blogs/[BlogName]" menu and all submenus.105 * Use the $wp_admin_bar global to add the "My Sites/[Site Name]" menu and all submenus. 106 106 */ 107 107 function wp_admin_bar_my_blogs_menu() { … … 111 111 return false; 112 112 113 /* Add the 'My Dashboards' menu if the user has more than one blog. */113 /* Add the 'My Dashboards' menu if the user has more than one site. */ 114 114 if ( count( $wp_admin_bar->user->blogs ) > 1 ) { 115 $wp_admin_bar->add_menu( array( 'id' => 'my-blogs', 'title' => __( 'My Blogs' ), 'href' => $wp_admin_bar->user->account_domain ) );115 $wp_admin_bar->add_menu( array( 'id' => 'my-blogs', 'title' => __( 'My Sites' ), 'href' => $wp_admin_bar->user->account_domain ) ); 116 116 117 117 $default = includes_url('images/wpmini-blue.png'); … … 138 138 $wp_admin_bar->add_menu( array( 'parent' => 'blog-' . $blog->userblog_id, 'id' => 'blog-' . $blog->userblog_id . '-n', 'title' => __( 'New Post' ), 'href' => constant( 'PROTO' ) . $blogdomain . '/wp-admin/post-new.php' ) ); 139 139 // @todo, stats plugins should add this: 140 //$wp_admin_bar->add_menu( array( 'parent' => 'blog-' . $blog->userblog_id, 'id' => 'blog-' . $blog->userblog_id . '-s', 'title' => __( ' BlogStats' ), 'href' => constant( 'PROTO' ) . $blogdomain . '/wp-admin/index.php?page=stats' ) );140 //$wp_admin_bar->add_menu( array( 'parent' => 'blog-' . $blog->userblog_id, 'id' => 'blog-' . $blog->userblog_id . '-s', 'title' => __( 'Site Stats' ), 'href' => constant( 'PROTO' ) . $blogdomain . '/wp-admin/index.php?page=stats' ) ); 141 141 $wp_admin_bar->add_menu( array( 'parent' => 'blog-' . $blog->userblog_id, 'id' => 'blog-' . $blog->userblog_id . '-c', 'title' => __( 'Manage Comments' ), 'href' => constant( 'PROTO' ) . $blogdomain . '/wp-admin/edit-comments.php' ) ); 142 $wp_admin_bar->add_menu( array( 'parent' => 'blog-' . $blog->userblog_id, 'id' => 'blog-' . $blog->userblog_id . '-v', 'title' => __( 'Read Blog' ), 'href' => constant( 'PROTO' ) . $blogdomain ) );142 $wp_admin_bar->add_menu( array( 'parent' => 'blog-' . $blog->userblog_id, 'id' => 'blog-' . $blog->userblog_id . '-v', 'title' => __( 'Read Site' ), 'href' => constant( 'PROTO' ) . $blogdomain ) ); 143 143 } 144 144 $counter++; 145 145 } 146 146 147 /* Add the "Manage Blogs" menu item */148 // @todo, use dashboard blog.149 $wp_admin_bar->add_menu( array( 'parent' => 'my-blogs', 'id' => 'manage-blogs', 'title' => __( 'Manage Blogs' ), admin_url('my-sites.php') ) );150 151 /* Add the 'My Dashboard' menu if the user only has one blog. */147 /* Add the "Manage Sites" menu item */ 148 // @todo, use dashboard site. 149 $wp_admin_bar->add_menu( array( 'parent' => 'my-blogs', 'id' => 'manage-blogs', 'title' => __( 'Manage Sites' ), admin_url('my-sites.php') ) ); 150 151 /* Add the 'My Dashboard' menu if the user only has one site. */ 152 152 } else { 153 $wp_admin_bar->add_menu( array( 'id' => 'my-blogs', 'title' => __( 'My Blog' ), 'href' => $wp_admin_bar->user->account_domain ) );153 $wp_admin_bar->add_menu( array( 'id' => 'my-blogs', 'title' => __( 'My Site' ), 'href' => $wp_admin_bar->user->account_domain ) ); 154 154 155 155 $wp_admin_bar->add_menu( array( 'parent' => 'my-blogs', 'id' => 'blog-1-d', 'title' => __( 'Dashboard' ), 'href' => admin_url() ) ); 156 156 $wp_admin_bar->add_menu( array( 'parent' => 'my-blogs', 'id' => 'blog-1-n', 'title' => __( 'New Post' ), 'href' => admin_url('post-new.php') ) ); 157 157 // @todo Stats plugins should add this. 158 //$wp_admin_bar->add_menu( array( 'parent' => 'my-blogs', 'id' => 'blog-1-s', 'title' => __( ' BlogStats' ), 'href' => admin_ur;('index.php?page=stats') ) );158 //$wp_admin_bar->add_menu( array( 'parent' => 'my-blogs', 'id' => 'blog-1-s', 'title' => __( 'Site Stats' ), 'href' => admin_ur;('index.php?page=stats') ) ); 159 159 $wp_admin_bar->add_menu( array( 'parent' => 'my-blogs', 'id' => 'blog-1-c', 'title' => __( 'Manage Comments' ), 'href' => admin_url('edit-comments.php') ) ); 160 $wp_admin_bar->add_menu( array( 'parent' => 'my-blogs', 'id' => 'blog-1-v', 'title' => __( 'Read Blog' ), 'href' => home_url() ) );160 $wp_admin_bar->add_menu( array( 'parent' => 'my-blogs', 'id' => 'blog-1-v', 'title' => __( 'Read Site' ), 'href' => home_url() ) ); 161 161 } 162 162 } … … 164 164 165 165 /** 166 * Show the blavatar of the current blogas a separator.166 * Show the blavatar of the current site as a separator. 167 167 */ 168 168 function wp_admin_bar_blog_separator() { … … 174 174 $default = includes_url('images/wpmini-blue.png'); 175 175 176 $wp_admin_bar->add_menu( array( 'id' => 'blog', 'title' => '<img class="avatar" src="' . $default . '" alt="' . __( 'Current blogavatar' ) . '" width="16" height="16" />', 'href' => home_url() ) );176 $wp_admin_bar->add_menu( array( 'id' => 'blog', 'title' => '<img class="avatar" src="' . $default . '" alt="' . __( 'Current site avatar' ) . '" width="16" height="16" />', 'href' => home_url() ) ); 177 177 } 178 178 add_action( 'wp_before_admin_bar_render', 'wp_admin_bar_blog_separator', 40 ); 179 179 180 180 /** 181 * Use the $wp_admin_bar global to add a menu for bloginfo, accessable to all users.181 * Use the $wp_admin_bar global to add a menu for site info, accessable to all users. 182 182 */ 183 183 function wp_admin_bar_bloginfo_menu() { … … 187 187 return false; 188 188 189 /* Add the BlogInfo menu */190 $wp_admin_bar->add_menu( array( 'id' => 'bloginfo', 'title' => __( ' BlogInfo' ), 'href' => '' ) );189 /* Add the Site Info menu */ 190 $wp_admin_bar->add_menu( array( 'id' => 'bloginfo', 'title' => __( 'Site Info' ), 'href' => '' ) ); 191 191 192 192 $wp_admin_bar->add_menu( array( 'parent' => 'bloginfo', 'title' => __( 'Get Shortlink' ), 'href' => '', 'meta' => array( 'onclick' => 'javascript:function wpcomshort() { var url=document.location;var links=document.getElementsByTagName('link');var found=0;for(var i = 0, l; l = links[i]; i++){if(l.getAttribute('rel')=='shortlink') {found=l.getAttribute('href');break;}}if (!found) {for (var i = 0; l = document.links[i]; i++) {if (l.getAttribute('rel') == 'shortlink') {found = l.getAttribute('href');break;}}}if (found) {prompt('URL:', found);} else {alert('No shortlink available for this page'); } } wpcomshort(); return false;' ) ) ); -
trunk/wp-includes/admin-bar/admin-bar-superadmin.php
r15671 r15769 30 30 wp_admin_bar_build_snackmenu(); 31 31 32 /* Get the settings we need for the current blog*/32 /* Get the settings we need for the current site */ 33 33 $matureaction = $current_blog->mature ? 'unmatureblog' : 'matureblog'; 34 34 $maturetext = $current_blog->mature ? esc_attr__('Unmark as mature') : esc_attr__('Mark as mature'); 35 $suspendtext = $current_blog->spam ? esc_attr('Unsuspend blog') : esc_attr('Suspend blog');35 $suspendtext = $current_blog->spam ? esc_attr('Unsuspend site') : esc_attr('Suspend site'); 36 36 $suspendaction = $current_blog->spam ? 'unspamblog' : 'spamblog'; 37 $mature_url = admin_url( "ms-edit.php?action=confirm&action2={$matureaction}&id={$current_blog->blog_id}&msg=" . urlencode( 'Are you sure you want to ' . strtolower( $maturetext ) . " {$current_blog->domain} as mature?" ) );38 $suspend_url = admin_url( "ms-edit.php?action=confirm&action2={$suspendaction}&id={$current_blog->blog_id}&msg=" . urlencode( 'Are you sure you want to ' . strtolower( $suspendtext ) . " {$current_blog->domain} ?" ) );37 $mature_url = network_admin_url( "edit.php?action=confirm&action2={$matureaction}&id={$current_blog->blog_id}&msg=" . urlencode( 'Are you sure you want to ' . strtolower( $maturetext ) . " {$current_blog->domain} as mature?" ) ); 38 $suspend_url = network_admin_url( "edit.php?action=confirm&action2={$suspendaction}&id={$current_blog->blog_id}&msg=" . urlencode( 'Are you sure you want to ' . strtolower( $suspendtext ) . " {$current_blog->domain} ?" ) ); 39 39 40 40 /* Add the submenu items to the Super Admin menu */ 41 $wp_admin_bar->add_menu( array( 'parent' => 'superadmin', 'title' => __( ' BlogDashboard' ), 'href' => admin_url(), 'position' => 10 ) );42 $wp_admin_bar->add_menu( array( 'parent' => 'superadmin', 'title' => __( ' Blog Options' ), 'href' => admin_url( "ms-sites.php?action=blogs&searchaction=id&s={$current_blog->blog_id}" ), 'position' => 30 ) );41 $wp_admin_bar->add_menu( array( 'parent' => 'superadmin', 'title' => __( 'Site Dashboard' ), 'href' => admin_url(), 'position' => 10 ) ); 42 $wp_admin_bar->add_menu( array( 'parent' => 'superadmin', 'title' => __( 'Site Options' ), 'href' => network_admin_url( "sites.php?action=blogs&searchaction=id&s={$current_blog->blog_id}" ), 'position' => 30 ) ); 43 43 $wp_admin_bar->add_menu( array( 'parent' => 'superadmin', 'title' => "$maturetext", 'href' => $mature_url, 'position' => 50 ) ); 44 44 $wp_admin_bar->add_menu( array( 'parent' => 'superadmin', 'title' => "$suspendtext", 'href' => $suspend_url, 'position' => 80 ) );
Note: See TracChangeset
for help on using the changeset viewer.