Move the network version of Tools > Network to the network admin. props wpdavis, fixes #15461.

git-svn-id: http://svn.automattic.com/wordpress/trunk@16453 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
nacin 2010-11-18 05:24:13 +00:00
parent b68b0a5f01
commit d6002995a7
4 changed files with 34 additions and 8 deletions

View File

@ -198,7 +198,7 @@ $menu[75] = array( __('Tools'), 'edit_posts', 'tools.php', '', 'menu-top menu-ic
$submenu['tools.php'][15] = array( __('Export'), 'import', 'export.php' ); $submenu['tools.php'][15] = array( __('Export'), 'import', 'export.php' );
if ( is_multisite() && !is_main_site() ) if ( is_multisite() && !is_main_site() )
$submenu['tools.php'][25] = array( __('Delete Site'), 'manage_options', 'ms-delete-site.php' ); $submenu['tools.php'][25] = array( __('Delete Site'), 'manage_options', 'ms-delete-site.php' );
if ( ( ! is_multisite() || defined( 'MULTISITE' ) ) && defined('WP_ALLOW_MULTISITE') && WP_ALLOW_MULTISITE && is_super_admin() ) if ( ! is_multisite() && defined('WP_ALLOW_MULTISITE') && WP_ALLOW_MULTISITE && is_super_admin() )
$submenu['tools.php'][50] = array(__('Network'), 'manage_options', 'network.php'); $submenu['tools.php'][50] = array(__('Network'), 'manage_options', 'network.php');
$menu[80] = array( __('Settings'), 'manage_options', 'options-general.php', '', 'menu-top menu-icon-settings', 'menu-settings', 'div' ); $menu[80] = array( __('Settings'), 'manage_options', 'options-general.php', '', 'menu-top menu-icon-settings', 'menu-settings', 'div' );

View File

@ -89,8 +89,13 @@ function get_clean_basedomain() {
if ( ! network_domain_check() && ( ! defined( 'WP_ALLOW_MULTISITE' ) || ! WP_ALLOW_MULTISITE ) ) if ( ! network_domain_check() && ( ! defined( 'WP_ALLOW_MULTISITE' ) || ! WP_ALLOW_MULTISITE ) )
wp_die( __( 'You must define the <code>WP_ALLOW_MULTISITE</code> constant as true in your wp-config.php file to allow creation of a Network.' ) ); wp_die( __( 'You must define the <code>WP_ALLOW_MULTISITE</code> constant as true in your wp-config.php file to allow creation of a Network.' ) );
if ( is_network_admin() ) {
$title = __( 'Network Setup' );
$parent_file = 'settings.php';
} else {
$title = __( 'Create a Network of WordPress Sites' ); $title = __( 'Create a Network of WordPress Sites' );
$parent_file = 'tools.php'; $parent_file = 'tools.php';
}
add_contextual_help($current_screen, add_contextual_help($current_screen,
'<p>' . __('This screen allows you to configure a network as having subdomains (<code>site1.example.com</code>) or subdirectories (<code>example.com/site1</code>). Subdomains require wildcard subdomains to be enabled in Apache and DNS records, if your host allows it.') . '</p>' . '<p>' . __('This screen allows you to configure a network as having subdomains (<code>site1.example.com</code>) or subdirectories (<code>example.com/site1</code>). Subdomains require wildcard subdomains to be enabled in Apache and DNS records, if your host allows it.') . '</p>' .
@ -105,10 +110,10 @@ add_contextual_help($current_screen,
'<p>' . __('<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>' '<p>' . __('<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>'
); );
include( './admin-header.php' ); include( ABSPATH . 'wp-admin/admin-header.php' );
?> ?>
<div class="wrap"> <div class="wrap">
<?php screen_icon(); ?> <?php screen_icon('tools'); ?>
<h2><?php echo esc_html( $title ); ?></h2> <h2><?php echo esc_html( $title ); ?></h2>
<?php <?php
@ -306,8 +311,9 @@ function network_step2( $errors = false ) {
if ( is_multisite() ) { if ( is_multisite() ) {
$subdomain_install = is_subdomain_install(); $subdomain_install = is_subdomain_install();
?> ?>
<div class="updated"><p><strong><?php _e( 'Notice: The Network feature is already enabled.' ); ?></strong> <?php _e( 'The original configuration steps are shown here for reference.' ); ?></p></div> <p><?php _e( 'The original configuration steps are shown here for reference.' ); ?></p>
<?php } else { <?php
} else {
$subdomain_install = (bool) $wpdb->get_var( "SELECT meta_value FROM $wpdb->sitemeta WHERE site_id = 1 AND meta_key = 'subdomain_install'" ); $subdomain_install = (bool) $wpdb->get_var( "SELECT meta_value FROM $wpdb->sitemeta WHERE site_id = 1 AND meta_key = 'subdomain_install'" );
?> ?>
<div class="error"><p><strong><?php _e('Warning:'); ?></strong> <?php _e( 'An existing WordPress network was detected.' ); ?></p></div> <div class="error"><p><strong><?php _e('Warning:'); ?></strong> <?php _e( 'An existing WordPress network was detected.' ); ?></p></div>
@ -527,4 +533,4 @@ if ( $_POST ) {
?> ?>
</div> </div>
<?php include( './admin-footer.php' ); ?> <?php include( ABSPATH . 'wp-admin/admin-footer.php' ); ?>

View File

@ -37,6 +37,10 @@ $submenu['plugins.php'][15] = array( _x('Editor', 'plugin editor'), 'edit_plugin
$menu[25] = array(__('Settings'), 'manage_network_options', 'settings.php', '', 'menu-top menu-icon-settings', 'menu-settings', 'div'); $menu[25] = array(__('Settings'), 'manage_network_options', 'settings.php', '', 'menu-top menu-icon-settings', 'menu-settings', 'div');
if ( defined( 'MULTISITE' ) && defined( 'WP_ALLOW_MULTISITE' ) && WP_ALLOW_MULTISITE ) {
$submenu['settings.php'][5] = array( __('Settings'), 'manage_network_options', 'settings.php' );
$submenu['settings.php'][10] = array( __('Network Setup'), 'manage_network_options', 'setup.php' );
}
$update_themes = get_site_transient( 'update_themes' ); $update_themes = get_site_transient( 'update_themes' );
if ( !empty($update_themes->response) ) if ( !empty($update_themes->response) )

View File

@ -0,0 +1,16 @@
<?php
/**
* Network Setup administration panel.
*
* @package WordPress
* @subpackage Multisite
* @since 3.1.0
*/
/** Load WordPress Administration Bootstrap */
require_once( './admin.php' );
if ( ! is_multisite() )
wp_die( __( 'Multisite support is not enabled.' ) );
require( '../network.php' );