Changeset 15481
- Timestamp:
- 07/30/2010 08:34:54 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 14 added
- 7 edited
- 7 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/admin-header.php
r14999 r15481 12 12 13 13 get_admin_page_title(); 14 14 15 $title = esc_html( strip_tags( $title ) ); 16 15 17 wp_user_settings(); 16 18 wp_menu_unfold(); 19 20 // Save the ID of the last blog admin area visited if super admin. 21 if ( is_multisite() && !is_network_admin() && is_super_admin() ) { 22 $last_blog = get_user_option('last-blog-admin-visited'); 23 if ( $last_blog != $blog_id ) 24 update_user_option(get_current_user_id(), 'last-blog-admin-visited', $blog_id, true); 25 unset($last_blog); 26 } 27 17 28 ?> 18 29 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> … … 87 98 <div id="wphead"> 88 99 <?php 89 $blog_name = get_bloginfo('name', 'display'); 100 101 if ( is_network_admin() ) 102 $blog_name = esc_html($current_site->site_name); 103 else 104 $blog_name = get_bloginfo('name', 'display'); 90 105 if ( '' == $blog_name ) { 91 106 $blog_name = ' '; … … 112 127 <span id="site-title"><?php echo $blog_name ?></span> 113 128 </a> 114 <?php if ( current_user_can('manage_options') && '1' != get_option('blog_public') ): ?>129 <?php if ( !is_network_admin() && current_user_can('manage_options') && '1' != get_option('blog_public') ): ?> 115 130 <a id="privacy-on-link" href="options-privacy.php" title="<?php echo esc_attr( apply_filters('privacy_on_link_title', __('Your site is asking search engines not to index its content') ) ); ?>"><?php echo apply_filters('privacy_on_link_text', __('Search Engines Blocked') ); ?></a> 116 131 <?php endif; ?> … … 124 139 $links = array(); 125 140 $links[5] = sprintf(__('Howdy, <a href="%1$s" title="Edit your profile">%2$s</a>'), 'profile.php', $user_identity); 126 $links[15] = '| <a href="' . wp_logout_url() . '" title="' . __('Log Out') . '">' . __('Log Out') . '</a>'; 141 if ( is_multisite() && is_super_admin() ) { 142 if ( !is_network_admin() ) 143 $links[10] = '| <a href="' . network_admin_url() . '" title="' . esc_attr__('Network Admin') . '">' . __('Network Admin') . '</a>'; 144 elseif ($last_blog = get_user_option('last-blog-admin-visited') ) 145 $links[10] = '| <a href="' . get_admin_url($last_blog) . '" title="' . esc_attr__('Site Admin') . '">' . __('Site Admin') . '</a>'; 146 } 147 $links[15] = '| <a href="' . wp_logout_url() . '" title="' . esc_attr__('Log Out') . '">' . __('Log Out') . '</a>'; 127 148 128 149 $links = apply_filters('admin_user_info_links', $links, $current_user); … … 133 154 </div> 134 155 135 <?php favorite_actions($current_screen); ?>156 <?php !is_network_admin() ? favorite_actions($current_screen) : ''; ?> 136 157 </div> 137 158 </div> -
trunk/wp-admin/admin.php
r15387 r15481 14 14 if ( !defined('WP_ADMIN') ) 15 15 define('WP_ADMIN', TRUE); 16 17 if ( !defined('WP_NETWORK_ADMIN') ) 18 define('WP_NETWORK_ADMIN', FALSE); 16 19 17 20 if ( isset($_GET['import']) && !defined('WP_LOAD_IMPORTERS') ) … … 91 94 $taxnow = ''; 92 95 93 require(ABSPATH . 'wp-admin/menu.php'); 96 if ( WP_NETWORK_ADMIN ) 97 require(ABSPATH . 'wp-admin/network/menu.php'); 98 else 99 require(ABSPATH . 'wp-admin/menu.php'); 94 100 95 101 if ( current_user_can( 'manage_options' ) ) -
trunk/wp-admin/menu.php
r15424 r15481 26 26 $awaiting_mod = $awaiting_mod->moderated; 27 27 28 if ( is_multisite() && is_super_admin() ) { 29 /* translators: Network menu item */ 30 $menu[0] = array(__('Super Admin'), 'manage_network', 'ms-admin.php', '', 'menu-top menu-top-first menu-icon-site', 'menu-site', 'div'); 31 $submenu[ 'ms-admin.php' ][1] = array( __('Admin'), 'manage_network', 'ms-admin.php' ); 32 /* translators: Sites menu item */ 33 $submenu[ 'ms-admin.php' ][5] = array( __('Sites'), 'manage_sites', 'ms-sites.php' ); 34 $submenu[ 'ms-admin.php' ][10] = array( __('Users'), 'manage_network_users', 'ms-users.php' ); 35 $submenu[ 'ms-admin.php' ][20] = array( __('Themes'), 'manage_network_themes', 'ms-themes.php' ); 36 $submenu[ 'ms-admin.php' ][25] = array( __('Options'), 'manage_network_options', 'ms-options.php' ); 37 $submenu[ 'ms-admin.php' ][30] = array( __('Update'), 'manage_network', 'ms-upgrade-network.php' ); 38 39 $menu[1] = array( '', 'read', 'separator1', '', 'wp-menu-separator' ); 40 41 $menu[2] = array( __('Dashboard'), 'read', 'index.php', '', 'menu-top menu-icon-dashboard', 'menu-dashboard', 'div' ); 42 } else { 43 $menu[2] = array( __('Dashboard'), 'read', 'index.php', '', 'menu-top menu-top-first menu-icon-dashboard', 'menu-dashboard', 'div' ); 44 } 28 $menu[2] = array( __('Dashboard'), 'read', 'index.php', '', 'menu-top menu-top-first menu-icon-dashboard', 'menu-dashboard', 'div' ); 45 29 46 30 if ( is_multisite() || is_super_admin() ) { … … 235 219 $_wp_real_parent_file['wpmu-admin.php'] = 'ms-admin.php'; 236 220 237 do_action('_admin_menu'); 238 239 // Create list of page plugin hook names. 240 foreach ($menu as $menu_page) { 241 if ( false !== $pos = strpos($menu_page[2], '?') ) { 242 // Handle post_type=post|page|foo pages. 243 $hook_name = substr($menu_page[2], 0, $pos); 244 $hook_args = substr($menu_page[2], $pos + 1); 245 wp_parse_str($hook_args, $hook_args); 246 // Set the hook name to be the post type. 247 if ( isset($hook_args['post_type']) ) 248 $hook_name = $hook_args['post_type']; 249 else 250 $hook_name = basename($hook_name, '.php'); 251 unset($hook_args); 252 } else { 253 $hook_name = basename($menu_page[2], '.php'); 254 } 255 $hook_name = sanitize_title($hook_name); 256 257 // ensure we're backwards compatible 258 $compat = array( 259 'index' => 'dashboard', 260 'edit' => 'posts', 261 'post' => 'posts', 262 'upload' => 'media', 263 'link-manager' => 'links', 264 'edit-pages' => 'pages', 265 'page' => 'pages', 266 'edit-comments' => 'comments', 267 'options-general' => 'settings', 268 'themes' => 'appearance', 269 ); 270 271 if ( isset($compat[$hook_name]) ) 272 $hook_name = $compat[$hook_name]; 273 elseif ( !$hook_name ) 274 continue; 275 276 $admin_page_hooks[$menu_page[2]] = $hook_name; 277 } 278 unset($menu_page); 279 280 $_wp_submenu_nopriv = array(); 281 $_wp_menu_nopriv = array(); 282 // Loop over submenus and remove pages for which the user does not have privs. 283 foreach ( array( 'submenu' ) as $sub_loop ) { 284 foreach ($$sub_loop as $parent => $sub) { 285 foreach ($sub as $index => $data) { 286 if ( ! current_user_can($data[1]) ) { 287 unset(${$sub_loop}[$parent][$index]); 288 $_wp_submenu_nopriv[$parent][$data[2]] = true; 289 } 290 } 291 unset($index, $data); 292 293 if ( empty(${$sub_loop}[$parent]) ) 294 unset(${$sub_loop}[$parent]); 295 } 296 unset($sub, $parent); 297 } 298 unset($sub_loop); 299 300 // Loop over the top-level menu. 301 // Menus for which the original parent is not accessible due to lack of privs will have the next 302 // submenu in line be assigned as the new menu parent. 303 foreach ( $menu as $id => $data ) { 304 if ( empty($submenu[$data[2]]) ) 305 continue; 306 $subs = $submenu[$data[2]]; 307 $first_sub = array_shift($subs); 308 $old_parent = $data[2]; 309 $new_parent = $first_sub[2]; 310 // If the first submenu is not the same as the assigned parent, 311 // make the first submenu the new parent. 312 if ( $new_parent != $old_parent ) { 313 $_wp_real_parent_file[$old_parent] = $new_parent; 314 $menu[$id][2] = $new_parent; 315 316 foreach ($submenu[$old_parent] as $index => $data) { 317 $submenu[$new_parent][$index] = $submenu[$old_parent][$index]; 318 unset($submenu[$old_parent][$index]); 319 } 320 unset($submenu[$old_parent], $index); 321 322 if ( isset($_wp_submenu_nopriv[$old_parent]) ) 323 $_wp_submenu_nopriv[$new_parent] = $_wp_submenu_nopriv[$old_parent]; 324 } 325 } 326 unset($id, $data, $subs, $first_sub, $old_parent, $new_parent); 327 328 do_action('admin_menu', ''); 329 330 // Remove menus that have no accessible submenus and require privs that the user does not have. 331 // Run re-parent loop again. 332 foreach ( $menu as $id => $data ) { 333 if ( ! current_user_can($data[1]) ) 334 $_wp_menu_nopriv[$data[2]] = true; 335 336 // If submenu is empty... 337 if ( empty($submenu[$data[2]]) ) { 338 // And user doesn't have privs, remove menu. 339 if ( isset( $_wp_menu_nopriv[$data[2]] ) ) { 340 unset($menu[$id]); 341 } 342 } 343 } 344 unset($id, $data); 345 346 // Remove any duplicated seperators 347 $seperator_found = false; 348 foreach ( $menu as $id => $data ) { 349 if ( 0 == strcmp('wp-menu-separator', $data[4] ) ) { 350 if (false == $seperator_found) { 351 $seperator_found = true; 352 } else { 353 unset($menu[$id]); 354 $seperator_found = false; 355 } 356 } else { 357 $seperator_found = false; 358 } 359 } 360 unset($id, $data); 361 362 function add_cssclass($add, $class) { 363 $class = empty($class) ? $add : $class .= ' ' . $add; 364 return $class; 365 } 366 367 function add_menu_classes($menu) { 368 369 $first = $lastorder = false; 370 $i = 0; 371 $mc = count($menu); 372 foreach ( $menu as $order => $top ) { 373 $i++; 374 375 if ( 0 == $order ) { // dashboard is always shown/single 376 $menu[0][4] = add_cssclass('menu-top-first', $top[4]); 377 $lastorder = 0; 378 continue; 379 } 380 381 if ( 0 === strpos($top[2], 'separator') ) { // if separator 382 $first = true; 383 $c = $menu[$lastorder][4]; 384 $menu[$lastorder][4] = add_cssclass('menu-top-last', $c); 385 continue; 386 } 387 388 if ( $first ) { 389 $c = $menu[$order][4]; 390 $menu[$order][4] = add_cssclass('menu-top-first', $c); 391 $first = false; 392 } 393 394 if ( $mc == $i ) { // last item 395 $c = $menu[$order][4]; 396 $menu[$order][4] = add_cssclass('menu-top-last', $c); 397 } 398 399 $lastorder = $order; 400 } 401 402 return apply_filters( 'add_menu_classes', $menu ); 403 } 404 405 uksort($menu, "strnatcasecmp"); // make it all pretty 406 407 if ( apply_filters('custom_menu_order', false) ) { 408 $menu_order = array(); 409 foreach ( $menu as $menu_item ) { 410 $menu_order[] = $menu_item[2]; 411 } 412 unset($menu_item); 413 $default_menu_order = $menu_order; 414 $menu_order = apply_filters('menu_order', $menu_order); 415 $menu_order = array_flip($menu_order); 416 $default_menu_order = array_flip($default_menu_order); 417 418 function sort_menu($a, $b) { 419 global $menu_order, $default_menu_order; 420 $a = $a[2]; 421 $b = $b[2]; 422 if ( isset($menu_order[$a]) && !isset($menu_order[$b]) ) { 423 return -1; 424 } elseif ( !isset($menu_order[$a]) && isset($menu_order[$b]) ) { 425 return 1; 426 } elseif ( isset($menu_order[$a]) && isset($menu_order[$b]) ) { 427 if ( $menu_order[$a] == $menu_order[$b] ) 428 return 0; 429 return ($menu_order[$a] < $menu_order[$b]) ? -1 : 1; 430 } else { 431 return ($default_menu_order[$a] <= $default_menu_order[$b]) ? -1 : 1; 432 } 433 } 434 435 usort($menu, 'sort_menu'); 436 unset($menu_order, $default_menu_order); 437 } 438 439 $menu = add_menu_classes($menu); 440 441 if ( !user_can_access_admin_page() ) { 442 do_action('admin_page_access_denied'); 443 wp_die( __('You do not have sufficient permissions to access this page.') ); 444 } 221 // ensure we're backwards compatible 222 $compat = array( 223 'index' => 'dashboard', 224 'edit' => 'posts', 225 'post' => 'posts', 226 'upload' => 'media', 227 'link-manager' => 'links', 228 'edit-pages' => 'pages', 229 'page' => 'pages', 230 'edit-comments' => 'comments', 231 'options-general' => 'settings', 232 'themes' => 'appearance', 233 ); 234 235 require(ABSPATH . 'wp-admin/includes/menu.php'); 445 236 446 237 ?> -
trunk/wp-admin/network/index.php
r15473 r15481 17 17 18 18 $title = __( 'Network Admin' ); 19 $parent_file = ' ms-admin.php';19 $parent_file = 'index.php'; 20 20 21 21 add_contextual_help($current_screen, … … 29 29 ); 30 30 31 require_once( '. /admin-header.php' );31 require_once( '../admin-header.php' ); 32 32 33 33 $c_users = get_user_count(); … … 45 45 46 46 <ul class="subsubsub"> 47 <li><a href=" ms-sites.php#form-add-site"><?php _e( 'Create a New Site' ); ?></a> |</li>48 <li><a href=" ms-users.php#form-add-user"><?php _e( 'Create a New User' ); ?></a></li>47 <li><a href="sites.php#form-add-site"><?php _e( 'Create a New Site' ); ?></a> |</li> 48 <li><a href="users.php#form-add-user"><?php _e( 'Create a New User' ); ?></a></li> 49 49 </ul> 50 50 <br class="clear" /> … … 53 53 <?php do_action( 'wpmuadminresult', '' ); ?> 54 54 55 <form name="searchform" action=" ms-users.php" method="get">55 <form name="searchform" action="users.php" method="get"> 56 56 <p> 57 57 <input type="hidden" name="action" value="users" /> … … 61 61 </form> 62 62 63 <form name="searchform" action=" ms-sites.php" method="get">63 <form name="searchform" action="sites.php" method="get"> 64 64 <p> 65 65 <input type="hidden" name="action" value="blogs" /> … … 74 74 </div> 75 75 76 <?php include( '. /admin-footer.php' ); ?>76 <?php include( '../admin-footer.php' ); ?> -
trunk/wp-admin/network/settings.php
r15473 r15481 17 17 18 18 $title = __( 'Network Options' ); 19 $parent_file = ' ms-admin.php';19 $parent_file = 'settings.php'; 20 20 21 21 add_contextual_help($current_screen, … … 34 34 ); 35 35 36 include( '. /admin-header.php' );36 include( '../admin-header.php' ); 37 37 38 38 if (isset($_GET['updated'])) { … … 46 46 <?php screen_icon(); ?> 47 47 <h2><?php _e( 'Network Options' ) ?></h2> 48 <form method="post" action=" ms-edit.php?action=siteoptions">48 <form method="post" action="edit.php?action=siteoptions"> 49 49 <?php wp_nonce_field( 'siteoptions' ); ?> 50 50 <h3><?php _e( 'Operational Settings' ); ?></h3> … … 316 316 </div> 317 317 318 <?php include( '. /admin-footer.php' ); ?>318 <?php include( '../admin-footer.php' ); ?> -
trunk/wp-admin/network/sites.php
r15473 r15481 17 17 18 18 $title = __( 'Sites' ); 19 $parent_file = ' ms-admin.php';19 $parent_file = 'sites.php'; 20 20 21 21 if ( isset( $_GET['action'] ) && 'editblog' == $_GET['action'] ) { … … 49 49 wp_enqueue_script( 'admin-forms' ); 50 50 51 require_once( '. /admin-header.php' );51 require_once( '../admin-header.php' ); 52 52 53 53 $id = isset( $_GET['id'] ) ? intval( $_GET['id'] ) : 0; … … 117 117 <?php screen_icon(); ?> 118 118 <h2><?php _e( 'Edit Site' ); ?> - <a href="<?php echo esc_url( get_home_url( $id ) ); ?>"><?php echo esc_url( get_home_url( $id ) ); ?></a></h2> 119 <form method="post" action=" ms-edit.php?action=updateblog">119 <form method="post" action="edit.php?action=updateblog"> 120 120 <?php wp_nonce_field( 'editblog' ); ?> 121 121 <input type="hidden" name="id" value="<?php echo esc_attr( $id ) ?>" /> … … 426 426 </h2> 427 427 428 <form action=" ms-sites.php" method="get" id="ms-search">428 <form action="sites.php" method="get" id="ms-search"> 429 429 <p class="search-box"> 430 430 <input type="hidden" name="action" value="blogs" /> … … 439 439 </form> 440 440 441 <form id="form-site-list" action=" ms-edit.php?action=allblogs" method="post">441 <form id="form-site-list" action="edit.php?action=allblogs" method="post"> 442 442 <input type="hidden" name="mode" value="<?php echo esc_attr( $mode ); ?>" /> 443 443 <div class="tablenav"> … … 563 563 case 'blogname': ?> 564 564 <td class="column-title"> 565 <a href="<?php echo esc_url( admin_url( 'ms-sites.php?action=editblog&id=' . $blog['blog_id'] ) ); ?>" class="edit"><?php echo $blogname . $blog_state; ?></a>565 <a href="<?php echo esc_url( network_admin_url( 'sites.php?action=editblog&id=' . $blog['blog_id'] ) ); ?>" class="edit"><?php echo $blogname . $blog_state; ?></a> 566 566 <?php 567 567 if ( 'list' != $mode ) … … 578 578 ); 579 579 580 $actions['edit'] = '<span class="edit"><a href="' . esc_url( admin_url( 'ms-sites.php?action=editblog&id=' . $blog['blog_id'] ) ) . '">' . __( 'Edit' ) . '</a></span>';580 $actions['edit'] = '<span class="edit"><a href="' . esc_url( network_admin_url( 'sites.php?action=editblog&id=' . $blog['blog_id'] ) ) . '">' . __( 'Edit' ) . '</a></span>'; 581 581 $actions['backend'] = "<span class='backend'><a href='" . esc_url( get_admin_url($blog['blog_id']) ) . "' class='edit'>" . __( 'Backend' ) . '</a></span>'; 582 582 if ( $current_site->blog_id != $blog['blog_id'] ) { 583 583 if ( get_blog_status( $blog['blog_id'], 'deleted' ) == '1' ) 584 $actions['activate'] = '<span class="activate"><a href="' . esc_url( admin_url( 'ms-edit.php?action=confirm&action2=activateblog&id=' . $blog['blog_id'] . '&msg=' . urlencode( sprintf( __( 'You are about to activate the site %s' ), $blogname ) ) ) ) . '">' . __( 'Activate' ) . '</a></span>';584 $actions['activate'] = '<span class="activate"><a href="' . esc_url( network_admin_url( 'edit.php?action=confirm&action2=activateblog&id=' . $blog['blog_id'] . '&msg=' . urlencode( sprintf( __( 'You are about to activate the site %s' ), $blogname ) ) ) ) . '">' . __( 'Activate' ) . '</a></span>'; 585 585 else 586 $actions['deactivate'] = '<span class="activate"><a href="' . esc_url( admin_url( 'ms-edit.php?action=confirm&action2=deactivateblog&id=' . $blog['blog_id'] . '&msg=' . urlencode( sprintf( __( 'You are about to deactivate the site %s' ), $blogname ) ) ) ) . '">' . __( 'Deactivate' ) . '</a></span>';586 $actions['deactivate'] = '<span class="activate"><a href="' . esc_url( network_admin_url( 'edit.php?action=confirm&action2=deactivateblog&id=' . $blog['blog_id'] . '&msg=' . urlencode( sprintf( __( 'You are about to deactivate the site %s' ), $blogname ) ) ) ) . '">' . __( 'Deactivate' ) . '</a></span>'; 587 587 588 588 if ( get_blog_status( $blog['blog_id'], 'archived' ) == '1' ) 589 $actions['unarchive'] = '<span class="archive"><a href="' . esc_url( admin_url( 'ms-edit.php?action=confirm&action2=unarchiveblog&id=' . $blog['blog_id'] . '&msg=' . urlencode( sprintf( __( 'You are about to unarchive the site %s.' ), $blogname ) ) ) ) . '">' . __( 'Unarchive' ) . '</a></span>';589 $actions['unarchive'] = '<span class="archive"><a href="' . esc_url( network_admin_url( 'edit.php?action=confirm&action2=unarchiveblog&id=' . $blog['blog_id'] . '&msg=' . urlencode( sprintf( __( 'You are about to unarchive the site %s.' ), $blogname ) ) ) ) . '">' . __( 'Unarchive' ) . '</a></span>'; 590 590 else 591 $actions['archive'] = '<span class="archive"><a href="' . esc_url( admin_url( 'ms-edit.php?action=confirm&action2=archiveblog&id=' . $blog['blog_id'] . '&msg=' . urlencode( sprintf( __( 'You are about to archive the site %s.' ), $blogname ) ) ) ) . '">' . _x( 'Archive', 'verb; site' ) . '</a></span>';591 $actions['archive'] = '<span class="archive"><a href="' . esc_url( network_admin_url( 'edit.php?action=confirm&action2=archiveblog&id=' . $blog['blog_id'] . '&msg=' . urlencode( sprintf( __( 'You are about to archive the site %s.' ), $blogname ) ) ) ) . '">' . _x( 'Archive', 'verb; site' ) . '</a></span>'; 592 592 593 593 if ( get_blog_status( $blog['blog_id'], 'spam' ) == '1' ) 594 $actions['unspam'] = '<span class="spam"><a href="' . esc_url( admin_url( 'ms-edit.php?action=confirm&action2=unspamblog&id=' . $blog['blog_id'] . '&msg=' . urlencode( sprintf( __( 'You are about to unspam the site %s.' ), $blogname ) ) ) ) . '">' . _x( 'Not Spam', 'site' ) . '</a></span>';594 $actions['unspam'] = '<span class="spam"><a href="' . esc_url( network_admin_url( 'edit.php?action=confirm&action2=unspamblog&id=' . $blog['blog_id'] . '&msg=' . urlencode( sprintf( __( 'You are about to unspam the site %s.' ), $blogname ) ) ) ) . '">' . _x( 'Not Spam', 'site' ) . '</a></span>'; 595 595 else 596 $actions['spam'] = '<span class="spam"><a href="' . esc_url( admin_url( 'ms-edit.php?action=confirm&action2=spamblog&id=' . $blog['blog_id'] . '&msg=' . urlencode( sprintf( __( 'You are about to mark the site %s as spam.' ), $blogname ) ) ) ) . '">' . _x( 'Spam', 'site' ) . '</a></span>';597 598 $actions['delete'] = '<span class="delete"><a href="' . esc_url( admin_url( 'ms-edit.php?action=confirm&action2=deleteblog&id=' . $blog['blog_id'] . '&msg=' . urlencode( sprintf( __( 'You are about to delete the site %s.' ), $blogname ) ) ) ) . '">' . __( 'Delete' ) . '</a></span>';596 $actions['spam'] = '<span class="spam"><a href="' . esc_url( network_admin_url( 'edit.php?action=confirm&action2=spamblog&id=' . $blog['blog_id'] . '&msg=' . urlencode( sprintf( __( 'You are about to mark the site %s as spam.' ), $blogname ) ) ) ) . '">' . _x( 'Spam', 'site' ) . '</a></span>'; 597 598 $actions['delete'] = '<span class="delete"><a href="' . esc_url( network_admin_url( 'edit.php?action=confirm&action2=deleteblog&id=' . $blog['blog_id'] . '&msg=' . urlencode( sprintf( __( 'You are about to delete the site %s.' ), $blogname ) ) ) ) . '">' . __( 'Delete' ) . '</a></span>'; 599 599 } 600 600 … … 710 710 <div id="form-add-site" class="wrap"> 711 711 <h3><?php _e( 'Add Site' ) ?></h3> 712 <form method="post" action=" ms-edit.php?action=addblog">712 <form method="post" action="edit.php?action=addblog"> 713 713 <?php wp_nonce_field( 'add-blog', '_wpnonce_add-blog' ) ?> 714 714 <table class="form-table"> … … 745 745 } // end switch( $action ) 746 746 747 include( '. /admin-footer.php' ); ?>747 include( '../admin-footer.php' ); ?> -
trunk/wp-admin/network/themes.php
r15473 r15481 14 14 15 15 $title = __( 'Network Themes' ); 16 $parent_file = ' ms-admin.php';16 $parent_file = 'themes.php'; 17 17 18 18 add_contextual_help($current_screen, … … 25 25 ); 26 26 27 require_once( '. /admin-header.php' );27 require_once( '../admin-header.php' ); 28 28 29 29 if ( isset( $_GET['updated'] ) ) { … … 37 37 ?> 38 38 <div class="wrap"> 39 <form action="<?php echo esc_url( admin_url( 'ms-edit.php?action=updatethemes' ) ); ?>" method="post">39 <form action="<?php echo esc_url( network_admin_url( 'edit.php?action=updatethemes' ) ); ?>" method="post"> 40 40 <?php screen_icon(); ?> 41 41 <h2><?php _e( 'Network Themes' ) ?></h2> … … 97 97 </div> 98 98 99 <?php include( '. /admin-footer.php' ); ?>99 <?php include( '../admin-footer.php' ); ?> -
trunk/wp-admin/network/upgrade.php
r15473 r15481 8 8 */ 9 9 10 require_once(' admin.php');10 require_once('./admin.php'); 11 11 12 12 if ( !is_multisite() ) … … 16 16 17 17 $title = __( 'Update Network' ); 18 $parent_file = ' ms-admin.php';18 $parent_file = 'upgrade.php'; 19 19 20 20 add_contextual_help($current_screen, … … 27 27 ); 28 28 29 require_once(' admin-header.php');29 require_once('../admin-header.php'); 30 30 31 31 if ( ! current_user_can( 'manage_network' ) ) … … 67 67 <!-- 68 68 function nextpage() { 69 location.href = " ms-upgrade-network.php?action=upgrade&n=<?php echo ($n + 5) ?>";69 location.href = "upgrade.php?action=upgrade&n=<?php echo ($n + 5) ?>"; 70 70 } 71 71 setTimeout( "nextpage()", 250 ); … … 76 76 default: 77 77 ?><p><?php _e( 'You can update all the sites on your network through this page. It works by calling the update script of each site automatically. Hit the link below to update.' ); ?></p> 78 <p><a class="button" href=" ms-upgrade-network.php?action=upgrade"><?php _e("Update Network"); ?></a></p><?php78 <p><a class="button" href="upgrade.php?action=upgrade"><?php _e("Update Network"); ?></a></p><?php 79 79 do_action( 'wpmu_upgrade_page' ); 80 80 break; … … 83 83 </div> 84 84 85 <?php include('. /admin-footer.php'); ?>85 <?php include('../admin-footer.php'); ?> -
trunk/wp-admin/network/users.php
r15473 r15481 17 17 18 18 $title = __( 'Users' ); 19 $parent_file = ' ms-admin.php';19 $parent_file = 'users.php'; 20 20 21 21 add_contextual_help($current_screen, … … 35 35 wp_enqueue_script( 'admin-forms' ); 36 36 37 require_once( '. /admin-header.php' );37 require_once( '../admin-header.php' ); 38 38 39 39 if ( isset( $_GET['updated'] ) && $_GET['updated'] == 'true' && ! empty( $_GET['action'] ) ) { … … 131 131 </h2> 132 132 133 <form action=" ms-users.php" method="get" class="search-form">133 <form action="users.php" method="get" class="search-form"> 134 134 <p class="search-box"> 135 135 <input type="text" name="s" value="<?php echo esc_attr( $s ); ?>" class="search-input" id="user-search-input" /> … … 138 138 </form> 139 139 140 <form id="form-user-list" action=' ms-edit.php?action=allusers' method='post'>140 <form id="form-user-list" action='edit.php?action=allusers' method='post'> 141 141 <input type="hidden" name="mode" value="<?php echo esc_attr( $mode ); ?>" /> 142 142 <div class="tablenav"> … … 245 245 ?> 246 246 <td class="username column-username"> 247 <?php echo $avatar; ?><strong><a href="<?php echo esc_url( admin_url( $edit_link ) ); ?>" class="edit"><?php echo stripslashes( $user['user_login'] ); ?></a><?php247 <?php echo $avatar; ?><strong><a href="<?php echo esc_url( network_admin_url( $edit_link ) ); ?>" class="edit"><?php echo stripslashes( $user['user_login'] ); ?></a><?php 248 248 if ( in_array( $user['user_login'], $super_admins ) ) 249 249 echo ' - ' . __( 'Super admin' ); … … 251 251 <br/> 252 252 <div class="row-actions"> 253 <span class="edit"><a href="<?php echo esc_url( admin_url( $edit_link ) ); ?>"><?php _e( 'Edit' ); ?></a></span>253 <span class="edit"><a href="<?php echo esc_url( network_admin_url( $edit_link ) ); ?>"><?php _e( 'Edit' ); ?></a></span> 254 254 <?php if ( ! in_array( $user['user_login'], $super_admins ) ) { ?> 255 | <span class="delete"><a href="<?php echo $delete = esc_url( admin_url( add_query_arg( '_wp_http_referer', urlencode( stripslashes( $_SERVER['REQUEST_URI'] ) ), wp_nonce_url( ' ms-edit.php', 'deleteuser' ) . '&action=deleteuser&id=' . $user['ID'] ) ) ); ?>" class="delete"><?php _e( 'Delete' ); ?></a></span>255 | <span class="delete"><a href="<?php echo $delete = esc_url( admin_url( add_query_arg( '_wp_http_referer', urlencode( stripslashes( $_SERVER['REQUEST_URI'] ) ), wp_nonce_url( 'edit.php', 'deleteuser' ) . '&action=deleteuser&id=' . $user['ID'] ) ) ); ?>" class="delete"><?php _e( 'Delete' ); ?></a></span> 256 256 <?php } ?> 257 257 </div> … … 288 288 foreach ( (array) $blogs as $key => $val ) { 289 289 $path = ( $val->path == '/' ) ? '' : $val->path; 290 echo '<a href="'. esc_url( admin_url( 'ms-sites.php?action=editblog&id=' . $val->userblog_id ) ) .'">' . str_replace( '.' . $current_site->domain, '', $val->domain . $path ) . '</a>';290 echo '<a href="'. esc_url( network_admin_url( 'sites.php?action=editblog&id=' . $val->userblog_id ) ) .'">' . str_replace( '.' . $current_site->domain, '', $val->domain . $path ) . '</a>'; 291 291 echo ' <small class="row-actions">'; 292 292 293 293 // Edit 294 echo '<a href="'. esc_url( admin_url( 'ms-sites.php?action=editblog&id=' . $val->userblog_id ) ) .'">' . __( 'Edit' ) . '</a> | ';294 echo '<a href="'. esc_url( network_admin_url( 'sites.php?action=editblog&id=' . $val->userblog_id ) ) .'">' . __( 'Edit' ) . '</a> | '; 295 295 296 296 // View … … 355 355 <div class="wrap" id="form-add-user"> 356 356 <h3><?php _e( 'Add User' ) ?></h3> 357 <form action=" ms-edit.php?action=adduser" method="post">357 <form action="edit.php?action=adduser" method="post"> 358 358 <table class="form-table"> 359 359 <tr class="form-field form-required"> … … 376 376 <?php endif; ?> 377 377 378 <?php include( '. /admin-footer.php' ); ?>378 <?php include( '../admin-footer.php' ); ?> -
trunk/wp-admin/plugins.php
r15324 r15481 123 123 $parent_file = 'plugins.php'; 124 124 125 require_once( './admin-header.php' );125 require_once( ABSPATH . 'wp-admin/admin-header.php' ); 126 126 127 127 echo '<div class="wrap">'; … … 220 220 if ( ! isset($_REQUEST['verify-delete']) ) { 221 221 wp_enqueue_script('jquery'); 222 require_once( './admin-header.php');222 require_once(ABSPATH . 'wp-admin/admin-header.php'); 223 223 ?> 224 224 <div class="wrap"> … … 328 328 $title = __('Plugins'); 329 329 330 require_once( './admin-header.php');330 require_once(ABSPATH . 'wp-admin/admin-header.php'); 331 331 332 332 $invalid = validate_active_plugins(); … … 346 346 <?php 347 347 if ( !isset($_GET['charsout']) && wp_verify_nonce($_GET['_error_nonce'], 'plugin-activation-error_' . $plugin) ) { ?> 348 <iframe style="border:0" width="100%" height="70px" src="<?php echo admin_url('plugins.php?action=error_scrape&plugin=' . esc_attr($plugin) . '&_wpnonce=' . esc_attr($_GET['_error_nonce'])); ?>"></iframe>348 <iframe style="border:0" width="100%" height="70px" src="<?php echo 'plugins.php?action=error_scrape&plugin=' . esc_attr($plugin) . '&_wpnonce=' . esc_attr($_GET['_error_nonce']); ?>"></iframe> 349 349 <?php 350 350 } … … 385 385 $recently_activated = get_option('recently_activated', array()); 386 386 $upgrade_plugins = array(); 387 $network_plugins = array();388 387 $mustuse_plugins = $dropins_plugins = array(); 389 if ( ! is_multisite() || current_user_can('manage_network_plugins') ) {388 if ( ! is_multisite() || ( is_network_admin() && current_user_can('manage_network_plugins') ) ) { 390 389 if ( apply_filters( 'show_advanced_plugins', true, 'mustuse' ) ) 391 390 $mustuse_plugins = get_mu_plugins(); … … 414 413 415 414 foreach ( (array) $all_plugins as $plugin_file => $plugin_data) { 415 if ( is_network_admin() ) 416 $is_active = is_plugin_active_for_network($plugin_file); 417 else 418 $is_active = is_plugin_active($plugin_file); 416 419 // Filter into individual sections 417 if ( is_ multisite() && is_network_only_plugin( $plugin_file ) && !current_user_can( 'manage_network_plugins') ) {420 if ( is_plugin_active_for_network($plugin_file) && !is_network_admin() ) { 418 421 unset( $all_plugins[ $plugin_file ] ); 419 422 continue; 420 } elseif ( is_plugin_active_for_network($plugin_file) ) { 421 $network_plugins[ $plugin_file ] = $plugin_data; 422 } elseif ( is_plugin_active($plugin_file) ) { 423 } elseif ( is_multisite() && is_network_only_plugin( $plugin_file ) && !current_user_can( 'manage_network_plugins' ) ) { 424 unset( $all_plugins[ $plugin_file ] ); 425 continue; 426 } elseif ( $is_active ) { 423 427 $active_plugins[ $plugin_file ] = $plugin_data; 424 428 } else { 425 if ( isset( $recently_activated[ $plugin_file ] ) ) // Was the plugin recently activated?429 if ( !is_network_admin() && isset( $recently_activated[ $plugin_file ] ) ) // Was the plugin recently activated? 426 430 $recent_plugins[ $plugin_file ] = $plugin_data; 427 431 $inactive_plugins[ $plugin_file ] = $plugin_data; … … 440 444 $total_recent_plugins = count($recent_plugins); 441 445 $total_upgrade_plugins = count($upgrade_plugins); 442 $total_network_plugins = count($network_plugins);443 446 $total_mustuse_plugins = count($mustuse_plugins); 444 447 $total_dropins_plugins = count($dropins_plugins); … … 544 547 545 548 if ( 'mustuse' == $context ) { 549 if ( is_multisite() && !is_network_admin() ) 550 continue; 546 551 $is_active = true; 547 552 } elseif ( 'dropins' == $context ) { 553 if ( is_multisite() && !is_network_admin() ) 554 continue; 548 555 $dropins = _get_dropins(); 549 556 $plugin_name = $plugin_file; … … 564 571 } else { 565 572 $is_active_for_network = is_plugin_active_for_network($plugin_file); 566 $is_active = $is_active_for_network || is_plugin_active( $plugin_file ); 567 if ( $is_active_for_network && !is_super_admin() ) 573 if ( is_network_admin() ) 574 $is_active = $is_active_for_network; 575 else 576 $is_active = is_plugin_active( $plugin_file ); 577 578 if ( $is_active_for_network && !is_super_admin() && !is_network_admin() ) 568 579 continue; 569 580 570 if ( $is_active) {581 if ( is_network_admin() ) { 571 582 if ( $is_active_for_network ) { 572 if ( is_super_admin() )583 if ( current_user_can( 'manage_network_plugins' ) ) 573 584 $actions['network_deactivate'] = '<a href="' . wp_nonce_url('plugins.php?action=deactivate&networkwide=1&plugin=' . $plugin_file . '&plugin_status=' . $context . '&paged=' . $page, 'deactivate-plugin_' . $plugin_file) . '" title="' . __('Deactivate this plugin') . '">' . __('Network Deactivate') . '</a>'; 574 585 } else { 575 $actions['deactivate'] = '<a href="' . wp_nonce_url('plugins.php?action=deactivate&plugin=' . $plugin_file . '&plugin_status=' . $context . '&paged=' . $page, 'deactivate-plugin_' . $plugin_file) . '" title="' . __('Deactivate this plugin') . '">' . __('Deactivate') . '</a>'; 586 if ( current_user_can( 'manage_network_plugins' ) ) 587 $actions['network_activate'] = '<a href="' . wp_nonce_url('plugins.php?action=activate&networkwide=1&plugin=' . $plugin_file . '&plugin_status=' . $context . '&paged=' . $page, 'activate-plugin_' . $plugin_file) . '" title="' . __('Activate this plugin for all sites in this network') . '" class="edit">' . __('Network Activate') . '</a>'; 588 if ( current_user_can('delete_plugins') ) 589 $actions['delete'] = '<a href="' . wp_nonce_url('plugins.php?action=delete-selected&checked[]=' . $plugin_file . '&plugin_status=' . $context . '&paged=' . $page, 'bulk-manage-plugins') . '" title="' . __('Delete this plugin') . '" class="delete">' . __('Delete') . '</a>'; 576 590 } 577 591 } else { 578 if ( is_multisite() && is_network_only_plugin( $plugin_file ) ) 579 $actions['network_only'] = '<span title="' . __('This plugin can only be activated for all sites in a network') . '">' . __('Network Only') . '</span>'; 580 else 592 if ( $is_active ) { 593 $actions['deactivate'] = '<a href="' . wp_nonce_url('plugins.php?action=deactivate&plugin=' . $plugin_file . '&plugin_status=' . $context . '&paged=' . $page, 'deactivate-plugin_' . $plugin_file) . '" title="' . __('Deactivate this plugin') . '">' . __('Deactivate') . '</a>'; 594 } else { 595 if ( is_network_only_plugin( $plugin_file ) && !is_network_admin() ) 596 continue; 597 581 598 $actions['activate'] = '<a href="' . wp_nonce_url('plugins.php?action=activate&plugin=' . $plugin_file . '&plugin_status=' . $context . '&paged=' . $page, 'activate-plugin_' . $plugin_file) . '" title="' . __('Activate this plugin') . '" class="edit">' . __('Activate') . '</a>'; 582 599 583 if ( is_multisite() && current_user_can( 'manage_network_plugins' ) ) 584 $actions['network_activate'] = '<a href="' . wp_nonce_url('plugins.php?action=activate&networkwide=1&plugin=' . $plugin_file . '&plugin_status=' . $context . '&paged=' . $page, 'activate-plugin_' . $plugin_file) . '" title="' . __('Activate this plugin for all sites in this network') . '" class="edit">' . __('Network Activate') . '</a>'; 585 586 if ( current_user_can('delete_plugins') ) 587 $actions['delete'] = '<a href="' . wp_nonce_url('plugins.php?action=delete-selected&checked[]=' . $plugin_file . '&plugin_status=' . $context . '&paged=' . $page, 'bulk-manage-plugins') . '" title="' . __('Delete this plugin') . '" class="delete">' . __('Delete') . '</a>'; 588 } // end if $is_active 600 if ( current_user_can('delete_plugins') ) 601 $actions['delete'] = '<a href="' . wp_nonce_url('plugins.php?action=delete-selected&checked[]=' . $plugin_file . '&plugin_status=' . $context . '&paged=' . $page, 'bulk-manage-plugins') . '" title="' . __('Delete this plugin') . '" class="delete">' . __('Delete') . '</a>'; 602 } // end if $is_active 603 } // end if is_network_admin() 589 604 590 605 if ( current_user_can('edit_plugins') && is_writable(WP_PLUGIN_DIR . '/' . $plugin_file) ) … … 690 705 <?php do_action( 'pre_current_active_plugins', $all_plugins ) ?> 691 706 692 <form method="post" action=" <?php echo admin_url('plugins.php') ?>">707 <form method="post" action="plugins.php"> 693 708 <?php wp_nonce_field('bulk-manage-plugins') ?> 694 709 <input type="hidden" name="plugin_status" value="<?php echo esc_attr($status) ?>" /> … … 784 799 785 800 <?php 786 include( './admin-footer.php');787 ?> 801 include(ABSPATH . 'wp-admin/admin-footer.php'); 802 ?> -
trunk/wp-admin/user-edit.php
r15135 r15481 85 85 wp_update_user( get_object_vars( $user ) ); 86 86 delete_option( $current_user->ID . '_new_email' ); 87 wp_redirect( add_query_arg( array('updated' => 'true'), admin_url( 'profile.php' ) ) );87 wp_redirect( add_query_arg( array('updated' => 'true'), self_admin_url( 'profile.php' ) ) ); 88 88 die(); 89 89 } 90 90 } elseif ( is_multisite() && IS_PROFILE_PAGE && !empty( $_GET['dismiss'] ) && $current_user->ID . '_new_email' == $_GET['dismiss'] ) { 91 91 delete_option( $current_user->ID . '_new_email' ); 92 wp_redirect( add_query_arg( array('updated' => 'true'), admin_url( 'profile.php' ) ) );92 wp_redirect( add_query_arg( array('updated' => 'true'), self_admin_url( 'profile.php' ) ) ); 93 93 die(); 94 94 } … … 139 139 delete_user_meta( $user_id, $blog_prefix . 'capabilities' ); 140 140 141 if ( is_multisite() && !IS_PROFILE_PAGE && current_user_can( 'manage_network_options' ) && !isset($super_admins) && empty( $_POST['super_admin'] ) == is_super_admin( $user_id ) )141 if ( is_multisite() && is_network_admin() & !IS_PROFILE_PAGE && current_user_can( 'manage_network_options' ) && !isset($super_admins) && empty( $_POST['super_admin'] ) == is_super_admin( $user_id ) ) 142 142 empty( $_POST['super_admin'] ) ? revoke_super_admin( $user_id ) : grant_super_admin( $user_id ); 143 143 } … … 156 156 wp_die(__('You do not have permission to edit this user.')); 157 157 158 include ( 'admin-header.php');158 include (ABSPATH . 'wp-admin/admin-header.php'); 159 159 ?> 160 160 … … 178 178 <h2><?php echo esc_html( $title ); ?></h2> 179 179 180 <form id="your-profile" action="<?php echo esc_url( admin_url( IS_PROFILE_PAGE ? 'profile.php' : 'user-edit.php' ) ); ?>" method="post"<?php do_action('user_edit_form_tag'); ?>>180 <form id="your-profile" action="<?php echo esc_url( self_admin_url( IS_PROFILE_PAGE ? 'profile.php' : 'user-edit.php' ) ); ?>" method="post"<?php do_action('user_edit_form_tag'); ?>> 181 181 <?php wp_nonce_field('update-user_' . $user_id) ?> 182 182 <?php if ( $wp_http_referer ) : ?> … … 246 246 ?> 247 247 </select> 248 <?php if ( is_multisite() && current_user_can( 'manage_network_options' ) && !isset($super_admins) ) { ?>248 <?php if ( is_multisite() && is_network_admin() && current_user_can( 'manage_network_options' ) && !isset($super_admins) ) { ?> 249 249 <p><label><input type="checkbox" id="super_admin" name="super_admin"<?php checked( is_super_admin( $profileuser->ID ) ); ?> /> <?php _e( 'Grant this user super admin privileges for the Network.'); ?></label></p> 250 250 <?php } ?> … … 308 308 if ( $new_email && $new_email != $current_user->user_email ) : ?> 309 309 <div class="updated inline"> 310 <p><?php printf( __('There is a pending change of your e-mail to <code>%1$s</code>. <a href="%2$s">Cancel</a>'), $new_email['newemail'], esc_url( admin_url( 'profile.php?dismiss=' . $current_user->ID . '_new_email' ) ) ); ?></p>310 <p><?php printf( __('There is a pending change of your e-mail to <code>%1$s</code>. <a href="%2$s">Cancel</a>'), $new_email['newemail'], esc_url( self_admin_url( 'profile.php?dismiss=' . $current_user->ID . '_new_email' ) ) ); ?></p> 311 311 </div> 312 312 <?php endif; ?> … … 399 399 </script> 400 400 <?php 401 include( './admin-footer.php');402 ?> 401 include( ABSPATH . 'wp-admin/admin-footer.php'); 402 ?> -
trunk/wp-includes/link-template.php
r15411 r15481 2133 2133 */ 2134 2134 function network_admin_url( $path = '', $scheme = 'admin' ) { 2135 $url = network_site_url('wp-admin/ ', $scheme);2135 $url = network_site_url('wp-admin/network/', $scheme); 2136 2136 2137 2137 if ( !empty($path) && is_string($path) && strpos($path, '..') === false ) … … 2139 2139 2140 2140 return apply_filters('network_admin_url', $url, $path); 2141 } 2142 2143 /** 2144 * Retrieve the url to the admin area for either the current blog or the network depending on context. 2145 * 2146 * @package WordPress 2147 * @since 3.1.0 2148 * 2149 * @param string $path Optional path relative to the admin url 2150 * @param string $scheme The scheme to use. Default is 'admin', which obeys force_ssl_admin() and is_ssl(). 'http' or 'https' can be passed to force those schemes. 2151 * @return string Admin url link with optional path appended 2152 */ 2153 function self_admin_url($path = '', $scheme = 'admin') { 2154 if ( is_network_admin() ) 2155 return network_admin_url($path, $scheme); 2156 else 2157 return admin_url($path, $scheme); 2141 2158 } 2142 2159 -
trunk/wp-includes/load.php
r15240 r15481 570 570 571 571 /** 572 * Whether the current request is in WordPress network admin Panel 573 * 574 * Does not inform on whether the user is a network admin! Use capability checks to 575 * tell if the user should be accessing a section or not. 576 * 577 * @since 3.1.0 578 * 579 * @return bool True if inside WordPress network administration pages. 580 */ 581 function is_network_admin() { 582 if ( defined( 'WP_NETWORK_ADMIN' ) ) 583 return WP_NETWORK_ADMIN; 584 return false; 585 } 586 587 /** 572 588 * Whether Multisite support is enabled 573 589 *
Note: See TracChangeset
for help on using the changeset viewer.