Some more MS cleanups. see #12460

git-svn-id: https://develop.svn.wordpress.org/trunk@13965 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Nacin 2010-04-03 11:15:51 +00:00
parent 76049e428d
commit fe922bc76d
3 changed files with 36 additions and 62 deletions

View File

@ -1,23 +1,17 @@
<?php
require_once('admin.php');
require_once( './admin.php' );
if ( !is_multisite() )
wp_die( __('Multisite support is not enabled.') );
$title = __('Network Admin');
$parent_file = 'ms-admin.php';
function index_css() {
wp_admin_css( 'css/dashboard' );
}
add_action( 'admin_head', 'index_css' );
require_once('admin-header.php');
wp_die( __( 'Multisite support is not enabled.' ) );
if ( ! current_user_can( 'manage_network' ) )
wp_die( __('You do not have permission to access this page.') );
wp_die( __( 'You do not have permission to access this page.' ) );
$title = __( 'Network Admin' );
$parent_file = 'ms-admin.php';
require_once( './admin-header.php' );
global $wpdb;
$c_users = get_user_count();
$c_blogs = get_blog_count();
@ -32,19 +26,19 @@ $sentence = sprintf( __( 'You have %1$s and %2$s.' ), $blog_text, $user_text );
<h2><?php echo esc_html( $title ); ?></h2>
<ul class="subsubsub">
<li><a href="ms-sites.php#form-add-blog" class="rbutton"><strong><?php _e('Create a New Site'); ?></strong></a> | </li>
<li><a href="ms-users.php#form-add-user" class="rbutton"><?php _e('Create a New User'); ?></a></li>
<li><a href="ms-sites.php#form-add-site"><?php _e( 'Create a New Site' ); ?></a> |</li>
<li><a href="ms-users.php#form-add-user"><?php _e( 'Create a New User' ); ?></a></li>
</ul>
<br clear='all' />
<br class="clear" />
<p class="youhave"><?php echo $sentence; ?></p>
<?php do_action('wpmuadminresult', ''); ?>
<?php do_action( 'wpmuadminresult', '' ); ?>
<form name="searchform" action="ms-users.php" method="get">
<p>
<input type="hidden" name="action" value="users" />
<input type="text" name="s" value="" size="17" />
<input class="button" type="submit" name="submit" value="<?php esc_attr_e("Search Users"); ?>" />
<input class="button" type="submit" name="submit" value="<?php esc_attr_e( 'Search Users' ); ?>" />
</p>
</form>
@ -52,13 +46,12 @@ $sentence = sprintf( __( 'You have %1$s and %2$s.' ), $blog_text, $user_text );
<p>
<input type="hidden" name="action" value="blogs" />
<input type="text" name="s" value="" size="17" />
<input class="button" type="submit" name="blog_name" value="<?php esc_attr_e("Search Sites"); ?>" />
<input class="button" type="submit" name="blog_name" value="<?php esc_attr_e( 'Search Sites' ); ?>" />
</p>
</form>
<?php do_action( 'mu_rightnow_end' ); ?>
<?php do_action( 'mu_activity_box_end' ); ?>
</div><!-- rightnow -->
</div>
<?php include('admin-footer.php'); ?>
<?php include( './admin-footer.php' ); ?>

View File

@ -118,41 +118,23 @@ switch ( $action ) {
<th scope="row"><?php _e('Last Updated') ?></th>
<td><input name="blog[last_updated]" type="text" id="blog_last_updated" value="<?php echo esc_attr( $details->last_updated ) ?>" size="40" /></td>
</tr>
<?php
if ( $is_main_site )
$checked_fields = array( 'public' => __( 'Public' ) );
else
$checked_fields = array(
'public' => __('Public'),
'archived' => __('Archived'),
'spam' => __('Spam'),
'deleted' => __('Deleted'),
'mature' => __('Mature'),
);
foreach ( $checked_fields as $field_key => $field_label ) {
?>
<tr class="form-field">
<th scope="row"><?php _e('Public') ?></th>
<td>
<label><input type="radio" style="width:20px;" name="blog[public]" value="1" <?php checked( $details->public, 1 ); ?> /> <?php _e( 'Yes' ) ?></label>
<label><input type="radio" style="width:20px;" name="blog[public]" value="0" <?php checked( $details->public, 0 ); ?> /> <?php _e( 'No' ) ?></label>
</td>
</tr>
<?php if ( ! $is_main_site ) { ?>
<tr class="form-field">
<th scope="row"><?php _e( 'Archived' ); ?></th>
<td>
<label><input type="radio" style="width:20px;" name="blog[archived]" value="1" <?php checked( $details->archived, 1 ); ?> /> <?php _e( 'Yes' ) ?></label>
<label><input type="radio" style="width:20px;" name="blog[archived]" value="0" <?php checked( $details->archived, 0 ); ?> /> <?php _e( 'No' ) ?></label>
</td>
</tr>
<tr class="form-field">
<th scope="row"><?php _e( 'Spam' ); ?></th>
<td>
<label><input type="radio" style="width:20px;" name="blog[spam]" value="1" <?php checked( $details->spam, 1 ); ?> /> <?php _e( 'Yes' ) ?></label>
<label><input type="radio" style="width:20px;" name="blog[spam]" value="0" <?php checked( $details->spam, 0 ); ?> /> <?php _e( 'No' ) ?></label>
</td>
</tr>
<tr class="form-field">
<th scope="row"><?php _e( 'Deleted' ); ?></th>
<td>
<label><input type="radio" style="width:20px;" name="blog[deleted]" value="1" <?php checked( $details->deleted, 1 ); ?> /> <?php _e( 'Yes' ) ?></label>
<label><input type="radio" style="width:20px;" name="blog[deleted]" value="0" <?php checked( $details->deleted, 0 ); ?> /> <?php _e( 'No' ) ?></label>
</td>
</tr>
<tr class="form-field">
<th scope="row"><?php _e( 'Mature' ); ?></th>
<td>
<label><input type="radio" style="width:20px;" name="blog[mature]" value="1" <?php checked( $details->mature, 1 ); ?> /> <?php _e( 'Yes' ) ?></label>
<label><input type="radio" style="width:20px;" name="blog[mature]" value="0" <?php checked( $details->mature, 0); ?> /> <?php _e( 'No' ) ?></label>
</td>
<th scope="row"><label for="blog_<?php echo $field_key; ?>"><?php echo $field_label; ?></label></th>
<td><input type="checkbox" name="blog[<?php echo $field_key; ?>]" id="blog_<?php echo $field_key; ?>" value="<?php echo $details->$field_key; ?>"<?php checked( $details->$field_key ); ?> /></td>
</tr>
<?php } ?>
</table>
@ -691,9 +673,8 @@ switch ( $action ) {
</form>
</div>
<div class="wrap">
<a name="form-add-site"></a>
<h2><?php _e( 'Add Site' ) ?></h2>
<div id="form-add-site" class="wrap">
<h3><?php _e( 'Add Site' ) ?></h3>
<form method="post" action="ms-edit.php?action=addblog">
<?php wp_nonce_field( 'add-blog' ) ?>
<table class="form-table">

View File

@ -330,9 +330,9 @@ if ( isset( $_GET['updated'] ) && $_GET['updated'] == 'true' && ! empty( $_GET['
<?php
if ( apply_filters( 'show_adduser_fields', true ) ) :
?>
<div class="wrap">
<h2><?php _e( 'Add user' ) ?></h2>
<form action="ms-edit.php?action=adduser" method="post" id="form-add-user">
<div class="wrap" id="form-add-user">
<h3><?php _e( 'Add User' ) ?></h3>
<form action="ms-edit.php?action=adduser" method="post">
<table class="form-table">
<tr class="form-field form-required">
<th scope="row"><?php _e( 'Username' ) ?></th>