More MS cleanups. props ocean90. see #12460

git-svn-id: http://svn.automattic.com/wordpress/trunk@13953 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
nacin 2010-04-03 00:10:44 +00:00
parent c905fc1420
commit eb14ca3036
5 changed files with 54 additions and 50 deletions

View File

@ -17,8 +17,6 @@ if ( isset( $_GET['h'] ) && $_GET['h'] != '' && get_option( 'delete_blog_hash' )
}
}
$action = isset( $_POST['action'] ) ? $_POST['action'] : 'splash';
$title = __( 'Delete Site' );
$parent_file = 'tools.php';
require_once( './admin-header.php' );

View File

@ -1,17 +1,17 @@
<?php
require_once( './admin.php' );
if ( !is_multisite() )
if ( ! is_multisite() )
wp_die( __( 'Multisite support is not enabled.' ) );
if ( ! current_user_can( 'manage_network_options' ) )
wp_die( __( 'You do not have permission to access this page.' ) );
$title = __( 'Network Options' );
$parent_file = 'ms-admin.php';
include( './admin-header.php' );
if ( ! current_user_can( 'manage_network_options' ) )
wp_die( __( 'You do not have permission to access this page.' ) );
if (isset($_GET['updated'])) {
?>
<div id="message" class="updated fade"><p><?php _e( 'Options saved.' ) ?></p></div>

View File

@ -4,6 +4,9 @@ require_once( './admin.php' );
if ( !is_multisite() )
wp_die( __( 'Multisite support is not enabled.' ) );
if ( ! current_user_can( 'manage_sites' ) )
wp_die( __( 'You do not have permission to access this page.' ) );
$title = __( 'Sites' );
$parent_file = 'ms-admin.php';
@ -11,9 +14,6 @@ wp_enqueue_script( 'admin-forms' );
require_once( './admin-header.php' );
if ( ! current_user_can( 'manage_sites' ) )
wp_die( __( 'You do not have permission to access this page.' ) );
$id = isset( $_GET['id'] ) ? intval( $_GET['id'] ) : 0;
if ( isset( $_GET['updated'] ) && $_GET['updated'] == 'true' && ! empty( $_GET['action'] ) ) {
@ -22,10 +22,10 @@ if ( isset( $_GET['updated'] ) && $_GET['updated'] == 'true' && ! empty( $_GET['
<?php
switch ( $_GET['action'] ) {
case 'all_notspam':
_e( 'Sites mark as not spam.' );
_e( 'Sites removed from spam.' );
break;
case 'all_spam':
_e( 'Sites mark as spam.' );
_e( 'Sites marked as spam.' );
break;
case 'all_delete':
_e( 'Sites deleted.' );
@ -49,16 +49,16 @@ if ( isset( $_GET['updated'] ) && $_GET['updated'] == 'true' && ! empty( $_GET['
_e( 'Site deactivated.' );
break;
case 'unspam':
_e( 'Site mark as not spam.' );
_e( 'Site removed from spam.' );
break;
case 'spam':
_e( 'Site mark as spam.' );
_e( 'Site marked as spam.' );
break;
case 'unmature':
_e( 'Site mark as not mature.' );
_e( 'Site marked as not mature.' );
break;
case 'mature':
_e( 'Site mark as mature.' );
_e( 'Site marked as mature.' );
break;
default:
_e( 'Settings saved.' );
@ -125,6 +125,7 @@ switch ( $action ) {
<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>
@ -132,13 +133,6 @@ switch ( $action ) {
<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( '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>
</tr>
<tr class="form-field">
<th scope="row"><?php _e( 'Spam' ); ?></th>
<td>
@ -153,6 +147,14 @@ switch ( $action ) {
<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>
</tr>
<?php } ?>
</table>
<p class="submit" style="text-align:center;"><input type="submit" name="Submit" value="<?php esc_attr_e( 'Update Options' ) ?>" /></p>
</div>
@ -549,35 +551,39 @@ switch ( $action ) {
if ( 'list' != $mode )
echo '<p>' . sprintf( _x( '%1$s &#8211; <em>%2$s', '%1$s: site name. %2$s: site tagline.' ), get_blog_option( $blog['blog_id'], 'blogname' ), get_blog_option( $blog['blog_id'], 'blogdescription ' ) ) . '</em></p>';
$actions = array();
$actions[] = '<span class="edit"><a href="' . esc_url( admin_url( 'ms-sites.php?action=editblog&amp;id=' . $blog['blog_id'] ) ) . '">' . __( 'Edit' ) . '</a><span>';
$actions[] = "<span class='backend'><a href='" . esc_url( get_admin_url($blog['blog_id']) ) . "' class='edit'>" . __( 'Backend' ) . '</a></span>';
// Preordered.
$actions = array(
'edit' => '', 'backend' => '',
'activate' => '', 'deactivate' => '',
'archive' => '', 'unarchive' => '',
'spam' => '', 'unspam' => '',
'delete' => '',
'visit' => '',
);
$actions['edit'] = '<span class="edit"><a href="' . esc_url( admin_url( 'ms-sites.php?action=editblog&amp;id=' . $blog['blog_id'] ) ) . '">' . __( 'Edit' ) . '</a><span>';
$actions['backend'] = "<span class='backend'><a href='" . esc_url( get_admin_url($blog['blog_id']) ) . "' class='edit'>" . __( 'Backend' ) . '</a></span>';
if ( $current_site->blog_id != $blog['blog_id'] ) {
if ( get_blog_status( $blog['blog_id'], 'deleted' ) == '1' )
$actions[] = '<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>';
$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>';
else
$actions[] = '<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>';
$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>';
if ( get_blog_status( $blog['blog_id'], 'archived' ) == '1' )
$actions[] = '<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>';
$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>';
else
$actions[] = '<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 ) ) ) ) . '">' . __( 'Archive' ) . '</a></span>';
$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 ) ) ) ) . '">' . __( 'Archive' ) . '</a></span>';
if ( get_blog_status( $blog['blog_id'], 'spam' ) == '1' )
$actions[] = '<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 ) ) ) ) . '">' . __( 'Not Spam' ) . '</a></span>';
$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 ) ) ) ) . '">' . __( 'Not Spam' ) . '</a></span>';
else
$actions[] = '<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 ) ) ) ) . '">' . __( 'Spam' ) . '</a></span>';
if ( get_blog_status( $blog['blog_id'], 'mature' ) == '1' )
$actions[] = '<span class="mature"><a href="' . esc_url( admin_url( 'ms-edit.php?action=confirm&amp;action2=unmatureblog&amp;id=' . $blog['blog_id'] . '&amp;msg=' . urlencode( sprintf( __( "You are about to unmature the site %s." ), $blogname ) ) ) ) . '">' . __( 'Not Mature' ) . '</a></span>';
else
$actions[] = '<span class="mature"><a href="' . esc_url( admin_url( 'ms-edit.php?action=confirm&amp;action2=matureblog&amp;id=' . $blog['blog_id'] . '&amp;msg=' . urlencode( sprintf( __( "You are about to mark the site %s as mature." ), $blogname ) ) ) ) . '">' . __( 'Mature' ) . '</a></span>';
$actions[] = '<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>';
$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 ) ) ) ) . '">' . __( 'Spam' ) . '</a></span>';
$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>';
}
$actions[] = "<span class='view'><a href='" . esc_url( get_home_url( $blog['blog_id'] ) ) . "' rel='permalink'>" . __( 'Visit' ) . '</a>';
$actions['visit'] = "<span class='view'><a href='" . esc_url( get_home_url( $blog['blog_id'] ) ) . "' rel='permalink'>" . __( 'Visit' ) . '</a>';
$actions = array_filter( $actions );
if ( count( $actions ) ) : ?>
<div class="row-actions">
<?php echo implode( ' | ', $actions ); ?>
@ -600,7 +606,7 @@ switch ( $action ) {
break;
case 'registered': ?>
<td valign="top">
<?php
<?php
if ( $blog['registered'] == '0000-00-00 00:00:00' )
echo '&#x2014;';
else

View File

@ -1,13 +1,13 @@
<?php
require_once( './admin.php' );
if ( ! current_user_can( 'manage_network_themes' ) )
wp_die( __( 'You do not have permission to access this page.' ) );
$title = __( 'Network Themes' );
$parent_file = 'ms-admin.php';
require_once( './admin-header.php' );
if ( ! current_user_can( 'manage_network_themes' ) )
wp_die( __( 'You do not have permission to access this page.' ) );
if ( isset( $_GET['updated'] ) ) {
?>
<div id="message" class="updated fade"><p><?php _e( 'Site themes saved.' ) ?></p></div>

View File

@ -4,6 +4,9 @@ require_once( './admin.php' );
if ( !is_multisite() )
wp_die( __( 'Multisite support is not enabled.' ) );
if ( ! current_user_can( 'manage_network_users' ) )
wp_die( __( 'You do not have permission to access this page.' ) );
$title = __( 'Users' );
$parent_file = 'ms-admin.php';
@ -11,9 +14,6 @@ wp_enqueue_script( 'admin-forms' );
require_once( './admin-header.php' );
if ( ! current_user_can( 'manage_network_users' ) )
wp_die( __( 'You do not have permission to access this page.' ) );
if ( isset( $_GET['updated'] ) && $_GET['updated'] == 'true' && ! empty( $_GET['action'] ) ) {
?>
<div id="message" class="updated fade"><p>
@ -26,7 +26,7 @@ if ( isset( $_GET['updated'] ) && $_GET['updated'] == 'true' && ! empty( $_GET['
_e( 'Users marked as spam.' );
break;
case 'all_notspam':
_e( 'Users marked as not spam.' );
_e( 'Users removed from spam.' );
break;
case 'all_delete':
_e( 'Users deleted.' );