WordPress.org

Make WordPress Core

Changeset 15481


Ignore:
Timestamp:
07/30/10 20:34:54 (7 years ago)
Author:
ryan
Message:

Network Admin, first pass. see #14435

Location:
trunk
Files:
14 added
7 edited
7 copied

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/admin-header.php

    r14999 r15481  
    1212 
    1313get_admin_page_title(); 
     14 
    1415$title = esc_html( strip_tags( $title ) ); 
     16 
    1517wp_user_settings(); 
    1618wp_menu_unfold(); 
     19 
     20// Save the ID of the last blog admin area visited if super admin. 
     21if ( 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 
    1728?> 
    1829<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
     
    8798<div id="wphead"> 
    8899<?php 
    89 $blog_name = get_bloginfo('name', 'display'); 
     100 
     101if ( is_network_admin() ) 
     102    $blog_name = esc_html($current_site->site_name); 
     103else 
     104    $blog_name = get_bloginfo('name', 'display'); 
    90105if ( '' == $blog_name ) { 
    91106    $blog_name = '&nbsp;'; 
     
    112127        <span id="site-title"><?php echo $blog_name ?></span> 
    113128    </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') ): ?> 
    115130    <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> 
    116131<?php endif; ?> 
     
    124139$links = array(); 
    125140$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>'; 
     141if ( 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>'; 
    127148 
    128149$links = apply_filters('admin_user_info_links', $links, $current_user); 
     
    133154</div> 
    134155 
    135 <?php favorite_actions($current_screen); ?> 
     156<?php !is_network_admin() ? favorite_actions($current_screen) : ''; ?> 
    136157</div> 
    137158</div> 
  • trunk/wp-admin/admin.php

    r15387 r15481  
    1414if ( !defined('WP_ADMIN') ) 
    1515    define('WP_ADMIN', TRUE); 
     16 
     17if ( !defined('WP_NETWORK_ADMIN') ) 
     18    define('WP_NETWORK_ADMIN', FALSE); 
    1619 
    1720if ( isset($_GET['import']) && !defined('WP_LOAD_IMPORTERS') ) 
     
    9194    $taxnow = ''; 
    9295 
    93 require(ABSPATH . 'wp-admin/menu.php'); 
     96if ( WP_NETWORK_ADMIN ) 
     97    require(ABSPATH . 'wp-admin/network/menu.php'); 
     98else 
     99    require(ABSPATH . 'wp-admin/menu.php'); 
    94100 
    95101if ( current_user_can( 'manage_options' ) ) 
  • trunk/wp-admin/menu.php

    r15424 r15481  
    2626$awaiting_mod = $awaiting_mod->moderated; 
    2727 
    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' ); 
    4529 
    4630if ( is_multisite() || is_super_admin() ) { 
     
    235219$_wp_real_parent_file['wpmu-admin.php'] = 'ms-admin.php'; 
    236220 
    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 
     235require(ABSPATH . 'wp-admin/includes/menu.php'); 
    445236 
    446237?> 
  • trunk/wp-admin/network/index.php

    r15473 r15481  
    1717 
    1818$title = __( 'Network Admin' ); 
    19 $parent_file = 'ms-admin.php'; 
     19$parent_file = 'index.php'; 
    2020 
    2121add_contextual_help($current_screen, 
     
    2929); 
    3030 
    31 require_once( './admin-header.php' ); 
     31require_once( '../admin-header.php' ); 
    3232 
    3333$c_users = get_user_count(); 
     
    4545 
    4646    <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> 
    4949    </ul> 
    5050    <br class="clear" /> 
     
    5353    <?php do_action( 'wpmuadminresult', '' ); ?> 
    5454 
    55     <form name="searchform" action="ms-users.php" method="get"> 
     55    <form name="searchform" action="users.php" method="get"> 
    5656        <p> 
    5757            <input type="hidden" name="action" value="users" /> 
     
    6161    </form> 
    6262 
    63     <form name="searchform" action="ms-sites.php" method="get"> 
     63    <form name="searchform" action="sites.php" method="get"> 
    6464        <p> 
    6565            <input type="hidden" name="action" value="blogs" /> 
     
    7474</div> 
    7575 
    76 <?php include( './admin-footer.php' ); ?> 
     76<?php include( '../admin-footer.php' ); ?> 
  • trunk/wp-admin/network/settings.php

    r15473 r15481  
    1717 
    1818$title = __( 'Network Options' ); 
    19 $parent_file = 'ms-admin.php'; 
     19$parent_file = 'settings.php'; 
    2020 
    2121add_contextual_help($current_screen, 
     
    3434); 
    3535 
    36 include( './admin-header.php' ); 
     36include( '../admin-header.php' ); 
    3737 
    3838if (isset($_GET['updated'])) { 
     
    4646    <?php screen_icon(); ?> 
    4747    <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"> 
    4949        <?php wp_nonce_field( 'siteoptions' ); ?> 
    5050        <h3><?php _e( 'Operational Settings' ); ?></h3> 
     
    316316</div> 
    317317 
    318 <?php include( './admin-footer.php' ); ?> 
     318<?php include( '../admin-footer.php' ); ?> 
  • trunk/wp-admin/network/sites.php

    r15473 r15481  
    1717 
    1818$title = __( 'Sites' ); 
    19 $parent_file = 'ms-admin.php'; 
     19$parent_file = 'sites.php'; 
    2020 
    2121if ( isset( $_GET['action'] ) && 'editblog' == $_GET['action'] ) { 
     
    4949wp_enqueue_script( 'admin-forms' ); 
    5050 
    51 require_once( './admin-header.php' ); 
     51require_once( '../admin-header.php' ); 
    5252 
    5353$id = isset( $_GET['id'] ) ? intval( $_GET['id'] ) : 0; 
     
    117117        <?php screen_icon(); ?> 
    118118        <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"> 
    120120            <?php wp_nonce_field( 'editblog' ); ?> 
    121121            <input type="hidden" name="id" value="<?php echo esc_attr( $id ) ?>" /> 
     
    426426        </h2> 
    427427 
    428         <form action="ms-sites.php" method="get" id="ms-search"> 
     428        <form action="sites.php" method="get" id="ms-search"> 
    429429        <p class="search-box"> 
    430430        <input type="hidden" name="action" value="blogs" /> 
     
    439439        </form> 
    440440 
    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"> 
    442442        <input type="hidden" name="mode" value="<?php echo esc_attr( $mode ); ?>" /> 
    443443        <div class="tablenav"> 
     
    563563                            case 'blogname': ?> 
    564564                                <td class="column-title"> 
    565                                     <a href="<?php echo esc_url( admin_url( 'ms-sites.php?action=editblog&amp;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&amp;id=' . $blog['blog_id'] ) ); ?>" class="edit"><?php echo $blogname . $blog_state; ?></a> 
    566566                                    <?php 
    567567                                    if ( 'list' != $mode ) 
     
    578578                                    ); 
    579579 
    580                                     $actions['edit']    = '<span class="edit"><a href="' . esc_url( admin_url( 'ms-sites.php?action=editblog&amp;id=' . $blog['blog_id'] ) ) . '">' . __( 'Edit' ) . '</a></span>'; 
     580                                    $actions['edit']    = '<span class="edit"><a href="' . esc_url( network_admin_url( 'sites.php?action=editblog&amp;id=' . $blog['blog_id'] ) ) . '">' . __( 'Edit' ) . '</a></span>'; 
    581581                                    $actions['backend'] = "<span class='backend'><a href='" . esc_url( get_admin_url($blog['blog_id']) ) . "' class='edit'>" . __( 'Backend' ) . '</a></span>'; 
    582582                                    if ( $current_site->blog_id != $blog['blog_id'] ) { 
    583583                                        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&amp;action2=activateblog&amp;id=' . $blog['blog_id'] . '&amp;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&amp;action2=activateblog&amp;id=' . $blog['blog_id'] . '&amp;msg=' . urlencode( sprintf( __( 'You are about to activate the site %s' ), $blogname ) ) ) ) . '">' . __( 'Activate' ) . '</a></span>'; 
    585585                                        else 
    586                                             $actions['deactivate']  = '<span class="activate"><a href="' . esc_url( admin_url( 'ms-edit.php?action=confirm&amp;action2=deactivateblog&amp;id=' . $blog['blog_id'] . '&amp;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&amp;action2=deactivateblog&amp;id=' . $blog['blog_id'] . '&amp;msg=' . urlencode( sprintf( __( 'You are about to deactivate the site %s' ), $blogname ) ) ) ) . '">' . __( 'Deactivate' ) . '</a></span>'; 
    587587 
    588588                                        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&amp;action2=unarchiveblog&amp;id=' .  $blog['blog_id'] . '&amp;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&amp;action2=unarchiveblog&amp;id=' .  $blog['blog_id'] . '&amp;msg=' . urlencode( sprintf( __( 'You are about to unarchive the site %s.' ), $blogname ) ) ) ) . '">' . __( 'Unarchive' ) . '</a></span>'; 
    590590                                        else 
    591                                             $actions['archive'] = '<span class="archive"><a href="' . esc_url( admin_url( 'ms-edit.php?action=confirm&amp;action2=archiveblog&amp;id=' . $blog['blog_id'] . '&amp;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&amp;action2=archiveblog&amp;id=' . $blog['blog_id'] . '&amp;msg=' . urlencode( sprintf( __( 'You are about to archive the site %s.' ), $blogname ) ) ) ) . '">' . _x( 'Archive', 'verb; site' ) . '</a></span>'; 
    592592 
    593593                                        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&amp;action2=unspamblog&amp;id=' . $blog['blog_id'] . '&amp;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&amp;action2=unspamblog&amp;id=' . $blog['blog_id'] . '&amp;msg=' . urlencode( sprintf( __( 'You are about to unspam the site %s.' ), $blogname ) ) ) ) . '">' . _x( 'Not Spam', 'site' ) . '</a></span>'; 
    595595                                        else 
    596                                             $actions['spam']    = '<span class="spam"><a href="' . esc_url( admin_url( 'ms-edit.php?action=confirm&amp;action2=spamblog&amp;id=' . $blog['blog_id'] . '&amp;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&amp;action2=deleteblog&amp;id=' . $blog['blog_id'] . '&amp;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&amp;action2=spamblog&amp;id=' . $blog['blog_id'] . '&amp;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&amp;action2=deleteblog&amp;id=' . $blog['blog_id'] . '&amp;msg=' . urlencode( sprintf( __( 'You are about to delete the site %s.' ), $blogname ) ) ) ) . '">' . __( 'Delete' ) . '</a></span>'; 
    599599                                    } 
    600600 
     
    710710        <div id="form-add-site" class="wrap"> 
    711711            <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"> 
    713713                <?php wp_nonce_field( 'add-blog', '_wpnonce_add-blog' ) ?> 
    714714                <table class="form-table"> 
     
    745745} // end switch( $action ) 
    746746 
    747 include( './admin-footer.php' ); ?> 
     747include( '../admin-footer.php' ); ?> 
  • trunk/wp-admin/network/themes.php

    r15473 r15481  
    1414 
    1515$title = __( 'Network Themes' ); 
    16 $parent_file = 'ms-admin.php'; 
     16$parent_file = 'themes.php'; 
    1717 
    1818add_contextual_help($current_screen, 
     
    2525); 
    2626 
    27 require_once( './admin-header.php' ); 
     27require_once( '../admin-header.php' ); 
    2828 
    2929if ( isset( $_GET['updated'] ) ) { 
     
    3737?> 
    3838<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"> 
    4040        <?php screen_icon(); ?> 
    4141        <h2><?php _e( 'Network Themes' ) ?></h2> 
     
    9797</div> 
    9898 
    99 <?php include( './admin-footer.php' ); ?> 
     99<?php include( '../admin-footer.php' ); ?> 
  • trunk/wp-admin/network/upgrade.php

    r15473 r15481  
    88 */ 
    99 
    10 require_once('admin.php'); 
     10require_once('./admin.php'); 
    1111 
    1212if ( !is_multisite() ) 
     
    1616 
    1717$title = __( 'Update Network' ); 
    18 $parent_file = 'ms-admin.php'; 
     18$parent_file = 'upgrade.php'; 
    1919 
    2020add_contextual_help($current_screen, 
     
    2727); 
    2828 
    29 require_once('admin-header.php'); 
     29require_once('../admin-header.php'); 
    3030 
    3131if ( ! current_user_can( 'manage_network' ) ) 
     
    6767        <!-- 
    6868        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) ?>"; 
    7070        } 
    7171        setTimeout( "nextpage()", 250 ); 
     
    7676    default: 
    7777        ?><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><?php 
     78        <p><a class="button" href="upgrade.php?action=upgrade"><?php _e("Update Network"); ?></a></p><?php 
    7979        do_action( 'wpmu_upgrade_page' ); 
    8080    break; 
     
    8383</div> 
    8484 
    85 <?php include('./admin-footer.php'); ?> 
     85<?php include('../admin-footer.php'); ?> 
  • trunk/wp-admin/network/users.php

    r15473 r15481  
    1717 
    1818$title = __( 'Users' ); 
    19 $parent_file = 'ms-admin.php'; 
     19$parent_file = 'users.php'; 
    2020 
    2121add_contextual_help($current_screen, 
     
    3535wp_enqueue_script( 'admin-forms' ); 
    3636 
    37 require_once( './admin-header.php' ); 
     37require_once( '../admin-header.php' ); 
    3838 
    3939if ( isset( $_GET['updated'] ) && $_GET['updated'] == 'true' && ! empty( $_GET['action'] ) ) { 
     
    131131    </h2> 
    132132 
    133     <form action="ms-users.php" method="get" class="search-form"> 
     133    <form action="users.php" method="get" class="search-form"> 
    134134        <p class="search-box"> 
    135135        <input type="text" name="s" value="<?php echo esc_attr( $s ); ?>" class="search-input" id="user-search-input" /> 
     
    138138    </form> 
    139139 
    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'> 
    141141        <input type="hidden" name="mode" value="<?php echo esc_attr( $mode ); ?>" /> 
    142142        <div class="tablenav"> 
     
    245245                                ?> 
    246246                                <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><?php 
     247                                    <?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 
    248248                                    if ( in_array( $user['user_login'], $super_admins ) ) 
    249249                                        echo ' - ' . __( 'Super admin' ); 
     
    251251                                    <br/> 
    252252                                    <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> 
    254254                                        <?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' ) . '&amp;action=deleteuser&amp;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' ) . '&amp;action=deleteuser&amp;id=' . $user['ID'] ) ) ); ?>" class="delete"><?php _e( 'Delete' ); ?></a></span> 
    256256                                        <?php } ?> 
    257257                                    </div> 
     
    288288                                        foreach ( (array) $blogs as $key => $val ) { 
    289289                                            $path   = ( $val->path == '/' ) ? '' : $val->path; 
    290                                             echo '<a href="'. esc_url( admin_url( 'ms-sites.php?action=editblog&amp;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&amp;id=' . $val->userblog_id  ) ) .'">' . str_replace( '.' . $current_site->domain, '', $val->domain . $path ) . '</a>'; 
    291291                                            echo ' <small class="row-actions">'; 
    292292 
    293293                                            // Edit 
    294                                             echo '<a href="'. esc_url( admin_url( 'ms-sites.php?action=editblog&amp;id=' . $val->userblog_id  ) ) .'">' . __( 'Edit' ) . '</a> | '; 
     294                                            echo '<a href="'. esc_url( network_admin_url( 'sites.php?action=editblog&amp;id=' . $val->userblog_id  ) ) .'">' . __( 'Edit' ) . '</a> | '; 
    295295 
    296296                                            // View 
     
    355355<div class="wrap" id="form-add-user"> 
    356356    <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"> 
    358358    <table class="form-table"> 
    359359        <tr class="form-field form-required"> 
     
    376376<?php endif; ?> 
    377377 
    378 <?php include( './admin-footer.php' ); ?> 
     378<?php include( '../admin-footer.php' ); ?> 
  • trunk/wp-admin/plugins.php

    r15324 r15481  
    123123            $parent_file = 'plugins.php'; 
    124124 
    125             require_once( './admin-header.php' ); 
     125            require_once( ABSPATH . 'wp-admin/admin-header.php' ); 
    126126 
    127127            echo '<div class="wrap">'; 
     
    220220            if ( ! isset($_REQUEST['verify-delete']) ) { 
    221221                wp_enqueue_script('jquery'); 
    222                 require_once('./admin-header.php'); 
     222                require_once(ABSPATH . 'wp-admin/admin-header.php'); 
    223223                ?> 
    224224            <div class="wrap"> 
     
    328328$title = __('Plugins'); 
    329329 
    330 require_once('./admin-header.php'); 
     330require_once(ABSPATH . 'wp-admin/admin-header.php'); 
    331331 
    332332$invalid = validate_active_plugins(); 
     
    346346    <?php 
    347347        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&amp;plugin=' . esc_attr($plugin) . '&amp;_wpnonce=' . esc_attr($_GET['_error_nonce'])); ?>"></iframe> 
     348    <iframe style="border:0" width="100%" height="70px" src="<?php echo 'plugins.php?action=error_scrape&amp;plugin=' . esc_attr($plugin) . '&amp;_wpnonce=' . esc_attr($_GET['_error_nonce']); ?>"></iframe> 
    349349    <?php 
    350350        } 
     
    385385$recently_activated = get_option('recently_activated', array()); 
    386386$upgrade_plugins = array(); 
    387 $network_plugins = array(); 
    388387$mustuse_plugins = $dropins_plugins = array(); 
    389 if ( ! is_multisite() || current_user_can('manage_network_plugins') ) { 
     388if ( ! is_multisite() || ( is_network_admin() && current_user_can('manage_network_plugins') ) ) { 
    390389    if ( apply_filters( 'show_advanced_plugins', true, 'mustuse' ) ) 
    391390        $mustuse_plugins = get_mu_plugins(); 
     
    414413 
    415414foreach ( (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); 
    416419    // 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() ) { 
    418421        unset( $all_plugins[ $plugin_file ] ); 
    419422        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 ) { 
    423427        $active_plugins[ $plugin_file ] = $plugin_data; 
    424428    } 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? 
    426430            $recent_plugins[ $plugin_file ] = $plugin_data; 
    427431        $inactive_plugins[ $plugin_file ] = $plugin_data; 
     
    440444$total_recent_plugins = count($recent_plugins); 
    441445$total_upgrade_plugins = count($upgrade_plugins); 
    442 $total_network_plugins = count($network_plugins); 
    443446$total_mustuse_plugins = count($mustuse_plugins); 
    444447$total_dropins_plugins = count($dropins_plugins); 
     
    544547 
    545548        if ( 'mustuse' == $context ) { 
     549            if ( is_multisite() && !is_network_admin() ) 
     550                continue; 
    546551            $is_active = true; 
    547552        } elseif ( 'dropins' == $context ) { 
     553            if ( is_multisite() && !is_network_admin() ) 
     554                continue; 
    548555            $dropins = _get_dropins(); 
    549556            $plugin_name = $plugin_file; 
     
    564571        } else { 
    565572            $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() ) 
    568579                continue; 
    569580 
    570             if ( $is_active ) { 
     581            if ( is_network_admin() ) { 
    571582                if ( $is_active_for_network ) { 
    572                     if ( is_super_admin() ) 
     583                    if ( current_user_can( 'manage_network_plugins' ) ) 
    573584                        $actions['network_deactivate'] = '<a href="' . wp_nonce_url('plugins.php?action=deactivate&amp;networkwide=1&amp;plugin=' . $plugin_file . '&amp;plugin_status=' . $context . '&amp;paged=' . $page, 'deactivate-plugin_' . $plugin_file) . '" title="' . __('Deactivate this plugin') . '">' . __('Network Deactivate') . '</a>'; 
    574585                } else { 
    575                     $actions['deactivate'] = '<a href="' . wp_nonce_url('plugins.php?action=deactivate&amp;plugin=' . $plugin_file . '&amp;plugin_status=' . $context . '&amp;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&amp;networkwide=1&amp;plugin=' . $plugin_file . '&amp;plugin_status=' . $context . '&amp;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&amp;checked[]=' . $plugin_file . '&amp;plugin_status=' . $context . '&amp;paged=' . $page, 'bulk-manage-plugins') . '" title="' . __('Delete this plugin') . '" class="delete">' . __('Delete') . '</a>'; 
    576590                } 
    577591            } 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&amp;plugin=' . $plugin_file . '&amp;plugin_status=' . $context . '&amp;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 
    581598                    $actions['activate'] = '<a href="' . wp_nonce_url('plugins.php?action=activate&amp;plugin=' . $plugin_file . '&amp;plugin_status=' . $context . '&amp;paged=' . $page, 'activate-plugin_' . $plugin_file) . '" title="' . __('Activate this plugin') . '" class="edit">' . __('Activate') . '</a>'; 
    582599 
    583                 if ( is_multisite() && current_user_can( 'manage_network_plugins' ) ) 
    584                     $actions['network_activate'] = '<a href="' . wp_nonce_url('plugins.php?action=activate&amp;networkwide=1&amp;plugin=' . $plugin_file . '&amp;plugin_status=' . $context . '&amp;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&amp;checked[]=' . $plugin_file . '&amp;plugin_status=' . $context . '&amp;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&amp;checked[]=' . $plugin_file . '&amp;plugin_status=' . $context . '&amp;paged=' . $page, 'bulk-manage-plugins') . '" title="' . __('Delete this plugin') . '" class="delete">' . __('Delete') . '</a>'; 
     602                } // end if $is_active 
     603             } // end if is_network_admin() 
    589604 
    590605            if ( current_user_can('edit_plugins') && is_writable(WP_PLUGIN_DIR . '/' . $plugin_file) ) 
     
    690705<?php do_action( 'pre_current_active_plugins', $all_plugins ) ?> 
    691706 
    692 <form method="post" action="<?php echo admin_url('plugins.php') ?>"> 
     707<form method="post" action="plugins.php"> 
    693708<?php wp_nonce_field('bulk-manage-plugins') ?> 
    694709<input type="hidden" name="plugin_status" value="<?php echo esc_attr($status) ?>" /> 
     
    784799 
    785800<?php 
    786 include('./admin-footer.php'); 
    787 ?> 
     801include(ABSPATH . 'wp-admin/admin-footer.php'); 
     802?> 
  • trunk/wp-admin/user-edit.php

    r15135 r15481  
    8585        wp_update_user( get_object_vars( $user ) ); 
    8686        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' ) ) ); 
    8888        die(); 
    8989    } 
    9090} elseif ( is_multisite() && IS_PROFILE_PAGE && !empty( $_GET['dismiss'] ) && $current_user->ID . '_new_email' == $_GET['dismiss'] ) { 
    9191    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' ) ) ); 
    9393    die(); 
    9494} 
     
    139139        delete_user_meta( $user_id, $blog_prefix . 'capabilities' ); 
    140140 
    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 ) ) 
    142142        empty( $_POST['super_admin'] ) ? revoke_super_admin( $user_id ) : grant_super_admin( $user_id ); 
    143143} 
     
    156156    wp_die(__('You do not have permission to edit this user.')); 
    157157 
    158 include ('admin-header.php'); 
     158include (ABSPATH . 'wp-admin/admin-header.php'); 
    159159?> 
    160160 
     
    178178<h2><?php echo esc_html( $title ); ?></h2> 
    179179 
    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'); ?>> 
    181181<?php wp_nonce_field('update-user_' . $user_id) ?> 
    182182<?php if ( $wp_http_referer ) : ?> 
     
    246246?> 
    247247</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) ) { ?> 
    249249<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> 
    250250<?php } ?> 
     
    308308    if ( $new_email && $new_email != $current_user->user_email ) : ?> 
    309309    <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> 
    311311    </div> 
    312312    <?php endif; ?> 
     
    399399</script> 
    400400<?php 
    401 include('./admin-footer.php'); 
    402 ?> 
     401include( ABSPATH . 'wp-admin/admin-footer.php'); 
     402?> 
  • trunk/wp-includes/link-template.php

    r15411 r15481  
    21332133*/ 
    21342134function network_admin_url( $path = '', $scheme = 'admin' ) { 
    2135     $url = network_site_url('wp-admin/', $scheme); 
     2135    $url = network_site_url('wp-admin/network/', $scheme); 
    21362136 
    21372137    if ( !empty($path) && is_string($path) && strpos($path, '..') === false ) 
     
    21392139 
    21402140    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*/ 
     2153function 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); 
    21412158} 
    21422159 
  • trunk/wp-includes/load.php

    r15240 r15481  
    570570 
    571571/** 
     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 */ 
     581function is_network_admin() { 
     582    if ( defined( 'WP_NETWORK_ADMIN' ) ) 
     583        return WP_NETWORK_ADMIN; 
     584    return false; 
     585} 
     586 
     587/** 
    572588 * Whether Multisite support is enabled 
    573589 * 
Note: See TracChangeset for help on using the changeset viewer.