|
|
|
|
@@ -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 – <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&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&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&action2=activateblog&id=' . $blog['blog_id'] . '&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&action2=activateblog&id=' . $blog['blog_id'] . '&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&action2=deactivateblog&id=' . $blog['blog_id'] . '&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&action2=deactivateblog&id=' . $blog['blog_id'] . '&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&action2=unarchiveblog&id=' . $blog['blog_id'] . '&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&action2=unarchiveblog&id=' . $blog['blog_id'] . '&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&action2=archiveblog&id=' . $blog['blog_id'] . '&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&action2=archiveblog&id=' . $blog['blog_id'] . '&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&action2=unspamblog&id=' . $blog['blog_id'] . '&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&action2=unspamblog&id=' . $blog['blog_id'] . '&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&action2=spamblog&id=' . $blog['blog_id'] . '&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&action2=unmatureblog&id=' . $blog['blog_id'] . '&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&action2=matureblog&id=' . $blog['blog_id'] . '&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&action2=deleteblog&id=' . $blog['blog_id'] . '&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&action2=spamblog&id=' . $blog['blog_id'] . '&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&action2=deleteblog&id=' . $blog['blog_id'] . '&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 '—';
|
|
|
|
|
else
|
|
|
|
|
|