Skip to content

Commit fe922bc

Browse files
committed
Some more MS cleanups. see #12460
git-svn-id: https://develop.svn.wordpress.org/trunk@13965 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 76049e4 commit fe922bc

File tree

3 files changed

+35
-61
lines changed

3 files changed

+35
-61
lines changed

wp-admin/ms-admin.php

Lines changed: 14 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,17 @@
11
<?php
2-
require_once('admin.php');
2+
require_once( './admin.php' );
33

44
if ( !is_multisite() )
5-
wp_die( __('Multisite support is not enabled.') );
5+
wp_die( __( 'Multisite support is not enabled.' ) );
66

7-
$title = __('Network Admin');
8-
$parent_file = 'ms-admin.php';
9-
10-
function index_css() {
11-
wp_admin_css( 'css/dashboard' );
12-
}
13-
add_action( 'admin_head', 'index_css' );
7+
if ( ! current_user_can( 'manage_network' ) )
8+
wp_die( __( 'You do not have permission to access this page.' ) );
149

15-
require_once('admin-header.php');
10+
$title = __( 'Network Admin' );
11+
$parent_file = 'ms-admin.php';
1612

17-
if ( ! current_user_can( 'manage_network' ) )
18-
wp_die( __('You do not have permission to access this page.') );
13+
require_once( './admin-header.php' );
1914

20-
global $wpdb;
2115
$c_users = get_user_count();
2216
$c_blogs = get_blog_count();
2317

@@ -32,33 +26,32 @@ function index_css() {
3226
<h2><?php echo esc_html( $title ); ?></h2>
3327

3428
<ul class="subsubsub">
35-
<li><a href="ms-sites.php#form-add-blog" class="rbutton"><strong><?php _e('Create a New Site'); ?></strong></a> | </li>
36-
<li><a href="ms-users.php#form-add-user" class="rbutton"><?php _e('Create a New User'); ?></a></li>
29+
<li><a href="ms-sites.php#form-add-site"><?php _e( 'Create a New Site' ); ?></a> |</li>
30+
<li><a href="ms-users.php#form-add-user"><?php _e( 'Create a New User' ); ?></a></li>
3731
</ul>
38-
<br clear='all' />
32+
<br class="clear" />
3933

4034
<p class="youhave"><?php echo $sentence; ?></p>
41-
<?php do_action('wpmuadminresult', ''); ?>
35+
<?php do_action( 'wpmuadminresult', '' ); ?>
4236

4337
<form name="searchform" action="ms-users.php" method="get">
4438
<p>
4539
<input type="hidden" name="action" value="users" />
4640
<input type="text" name="s" value="" size="17" />
47-
<input class="button" type="submit" name="submit" value="<?php esc_attr_e("Search Users"); ?>" />
41+
<input class="button" type="submit" name="submit" value="<?php esc_attr_e( 'Search Users' ); ?>" />
4842
</p>
4943
</form>
5044

5145
<form name="searchform" action="ms-sites.php" method="get">
5246
<p>
5347
<input type="hidden" name="action" value="blogs" />
5448
<input type="text" name="s" value="" size="17" />
55-
<input class="button" type="submit" name="blog_name" value="<?php esc_attr_e("Search Sites"); ?>" />
49+
<input class="button" type="submit" name="blog_name" value="<?php esc_attr_e( 'Search Sites' ); ?>" />
5650
</p>
5751
</form>
5852

5953
<?php do_action( 'mu_rightnow_end' ); ?>
6054
<?php do_action( 'mu_activity_box_end' ); ?>
61-
</div><!-- rightnow -->
6255
</div>
6356

64-
<?php include('admin-footer.php'); ?>
57+
<?php include( './admin-footer.php' ); ?>

wp-admin/ms-sites.php

Lines changed: 18 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -118,41 +118,23 @@
118118
<th scope="row"><?php _e('Last Updated') ?></th>
119119
<td><input name="blog[last_updated]" type="text" id="blog_last_updated" value="<?php echo esc_attr( $details->last_updated ) ?>" size="40" /></td>
120120
</tr>
121+
<?php
122+
if ( $is_main_site )
123+
$checked_fields = array( 'public' => __( 'Public' ) );
124+
else
125+
$checked_fields = array(
126+
'public' => __('Public'),
127+
'archived' => __('Archived'),
128+
'spam' => __('Spam'),
129+
'deleted' => __('Deleted'),
130+
'mature' => __('Mature'),
131+
);
132+
133+
foreach ( $checked_fields as $field_key => $field_label ) {
134+
?>
121135
<tr class="form-field">
122-
<th scope="row"><?php _e('Public') ?></th>
123-
<td>
124-
<label><input type="radio" style="width:20px;" name="blog[public]" value="1" <?php checked( $details->public, 1 ); ?> /> <?php _e( 'Yes' ) ?></label>
125-
<label><input type="radio" style="width:20px;" name="blog[public]" value="0" <?php checked( $details->public, 0 ); ?> /> <?php _e( 'No' ) ?></label>
126-
</td>
127-
</tr>
128-
<?php if ( ! $is_main_site ) { ?>
129-
<tr class="form-field">
130-
<th scope="row"><?php _e( 'Archived' ); ?></th>
131-
<td>
132-
<label><input type="radio" style="width:20px;" name="blog[archived]" value="1" <?php checked( $details->archived, 1 ); ?> /> <?php _e( 'Yes' ) ?></label>
133-
<label><input type="radio" style="width:20px;" name="blog[archived]" value="0" <?php checked( $details->archived, 0 ); ?> /> <?php _e( 'No' ) ?></label>
134-
</td>
135-
</tr>
136-
<tr class="form-field">
137-
<th scope="row"><?php _e( 'Spam' ); ?></th>
138-
<td>
139-
<label><input type="radio" style="width:20px;" name="blog[spam]" value="1" <?php checked( $details->spam, 1 ); ?> /> <?php _e( 'Yes' ) ?></label>
140-
<label><input type="radio" style="width:20px;" name="blog[spam]" value="0" <?php checked( $details->spam, 0 ); ?> /> <?php _e( 'No' ) ?></label>
141-
</td>
142-
</tr>
143-
<tr class="form-field">
144-
<th scope="row"><?php _e( 'Deleted' ); ?></th>
145-
<td>
146-
<label><input type="radio" style="width:20px;" name="blog[deleted]" value="1" <?php checked( $details->deleted, 1 ); ?> /> <?php _e( 'Yes' ) ?></label>
147-
<label><input type="radio" style="width:20px;" name="blog[deleted]" value="0" <?php checked( $details->deleted, 0 ); ?> /> <?php _e( 'No' ) ?></label>
148-
</td>
149-
</tr>
150-
<tr class="form-field">
151-
<th scope="row"><?php _e( 'Mature' ); ?></th>
152-
<td>
153-
<label><input type="radio" style="width:20px;" name="blog[mature]" value="1" <?php checked( $details->mature, 1 ); ?> /> <?php _e( 'Yes' ) ?></label>
154-
<label><input type="radio" style="width:20px;" name="blog[mature]" value="0" <?php checked( $details->mature, 0); ?> /> <?php _e( 'No' ) ?></label>
155-
</td>
136+
<th scope="row"><label for="blog_<?php echo $field_key; ?>"><?php echo $field_label; ?></label></th>
137+
<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>
156138
</tr>
157139
<?php } ?>
158140
</table>
@@ -691,9 +673,8 @@
691673
</form>
692674
</div>
693675

694-
<div class="wrap">
695-
<a name="form-add-site"></a>
696-
<h2><?php _e( 'Add Site' ) ?></h2>
676+
<div id="form-add-site" class="wrap">
677+
<h3><?php _e( 'Add Site' ) ?></h3>
697678
<form method="post" action="ms-edit.php?action=addblog">
698679
<?php wp_nonce_field( 'add-blog' ) ?>
699680
<table class="form-table">

wp-admin/ms-users.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -330,9 +330,9 @@
330330
<?php
331331
if ( apply_filters( 'show_adduser_fields', true ) ) :
332332
?>
333-
<div class="wrap">
334-
<h2><?php _e( 'Add user' ) ?></h2>
335-
<form action="ms-edit.php?action=adduser" method="post" id="form-add-user">
333+
<div class="wrap" id="form-add-user">
334+
<h3><?php _e( 'Add User' ) ?></h3>
335+
<form action="ms-edit.php?action=adduser" method="post">
336336
<table class="form-table">
337337
<tr class="form-field form-required">
338338
<th scope="row"><?php _e( 'Username' ) ?></th>

0 commit comments

Comments
 (0)