Update ms-sites UI. Props ocean90. see #12460

git-svn-id: http://svn.automattic.com/wordpress/trunk@13609 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2010-03-06 18:31:10 +00:00
parent e35acd21f7
commit b2c3ace49a
4 changed files with 259 additions and 112 deletions

View File

@ -410,6 +410,8 @@ function set_screen_options() {
switch ( $map_option ) { switch ( $map_option ) {
case 'edit_per_page': case 'edit_per_page':
case 'ms_sites_per_page':
case 'ms_users_per_page':
case 'edit_comments_per_page': case 'edit_comments_per_page':
case 'upload_per_page': case 'upload_per_page':
case 'categories_per_page': case 'categories_per_page':

View File

@ -3767,6 +3767,12 @@ function screen_options($screen) {
case 'edit-pages': case 'edit-pages':
$per_page_label = __('Pages per page:'); $per_page_label = __('Pages per page:');
break; break;
case 'ms-sites':
$per_page_label = __('Sites per page:');
break;
case 'ms-users':
$per_page_label = __('Users per page:');
break;
case 'edit-comments': case 'edit-comments':
$per_page_label = __('Comments per page:'); $per_page_label = __('Comments per page:');
break; break;

View File

@ -221,6 +221,9 @@ switch ( $_GET['action'] ) {
// rewrite rules can't be flushed during switch to blog // rewrite rules can't be flushed during switch to blog
delete_option( 'rewrite_rules' ); delete_option( 'rewrite_rules' );
// update blogs count
delete_site_transient( "blog_count" );
// update blogs table // update blogs table
$blog_data = stripslashes_deep($_POST[ 'blog' ]); $blog_data = stripslashes_deep($_POST[ 'blog' ]);
update_blog_details($id, $blog_data); update_blog_details($id, $blog_data);
@ -292,35 +295,52 @@ switch ( $_GET['action'] ) {
if ( $id != '0' && $id != $current_site->blog_id ) if ( $id != '0' && $id != $current_site->blog_id )
wpmu_delete_blog( $id, true ); wpmu_delete_blog( $id, true );
wp_redirect( add_query_arg( array('updated' => 'true', 'action' => 'delete'), $_POST[ 'ref' ] ) ); wp_redirect( add_query_arg( array('updated' => 'true', 'action' => 'delete'), $_POST[ 'ref' ] ) );
exit(); exit();
break; break;
case "allblogs": case "allblogs":
check_admin_referer('allblogs'); if ( isset($_POST['doaction']) || isset($_POST['doaction2']) ) {
check_admin_referer('bulk-sites');
if ( ! current_user_can( 'manage_sites' ) ) if ( ! current_user_can( 'manage_sites' ) )
wp_die( __('You do not have permission to access this page.') ); wp_die( __('You do not have permission to access this page.') );
if ( $_GET['action'] != -1 || $_POST['action2'] != -1 )
$doaction = $doaction = ($_POST['action'] != -1) ? $_POST['action'] : $_POST['action2'];
foreach ( (array) $_POST[ 'allblogs' ] as $key => $val ) { foreach ( (array) $_POST[ 'allblogs' ] as $key => $val ) {
if ( $val != '0' && $val != $current_site->blog_id ) { if ( $val != '0' && $val != $current_site->blog_id ) {
if ( isset($_POST['allblog_delete']) ) { switch ( $doaction ) {
$blogfunction = 'all_delete'; case 'delete':
wpmu_delete_blog( $val, true ); $blogfunction = 'all_delete';
} elseif ( isset($_POST['allblog_spam']) ) { wpmu_delete_blog( $val, true );
$blogfunction = 'all_spam'; break;
update_blog_status( $val, "spam", '1', 0 ); case 'spam':
set_time_limit(60); $blogfunction = 'all_spam';
} elseif ( isset($_POST['allblog_notspam']) ) { update_blog_status( $val, "spam", '1', 0 );
$blogfunction = 'all_notspam'; set_time_limit(60);
update_blog_status( $val, "spam", '0', 0 ); break;
set_time_limit(60); case 'notspam':
$blogfunction = 'all_notspam';
update_blog_status( $val, "spam", '0', 0 );
set_time_limit(60);
break;
} }
} } else {
} wp_die( __('You are not allowed to change one of this sites.') );
exit();
};
};
wp_redirect( add_query_arg( array('updated' => 'true', 'action' => $blogfunction), $_SERVER['HTTP_REFERER'] ) ); wp_redirect( add_query_arg( array('updated' => 'true', 'action' => $blogfunction), $_SERVER['HTTP_REFERER'] ) );
exit(); exit();
} else {
wp_redirect( admin_url("ms-sites.php") );
}
break; break;
case "archiveblog": case "archiveblog":
@ -397,7 +417,6 @@ switch ( $_GET['action'] ) {
case "unmature": case "unmature":
update_blog_status( $id, 'mature', '0' ); update_blog_status( $id, 'mature', '0' );
do_action( 'unmature_blog', $id ); do_action( 'unmature_blog', $id );
wp_redirect( add_query_arg( array('updated' => 'true', 'action' => 'umature'), $_POST['ref'] ) ); wp_redirect( add_query_arg( array('updated' => 'true', 'action' => 'umature'), $_POST['ref'] ) );
exit(); exit();
break; break;

View File

@ -156,7 +156,7 @@ switch ( $action ) {
<p class="submit" style="margin:-15px 0 -5px 230px;"><input type="submit" name="Submit" value="<?php esc_attr_e('Update Options') ?>" /></p> <p class="submit" style="margin:-15px 0 -5px 230px;"><input type="submit" name="Submit" value="<?php esc_attr_e('Update Options') ?>" /></p>
</div></div> </div></div>
<div id="blogedit_blogoptions" class="postbox " > <div id="blogedit_blogoptions" class="postbox" >
<h3 class='hndle'><span><?php printf( __('Site options (%soptions)'), $blog_prefix ); ?></span></h3> <h3 class='hndle'><span><?php printf( __('Site options (%soptions)'), $blog_prefix ); ?></span></h3>
<div class="inside"> <div class="inside">
<table class="form-table"> <table class="form-table">
@ -178,7 +178,7 @@ switch ( $action ) {
?> ?>
<tr class="form-field"> <tr class="form-field">
<th scope="row"><?php echo ucwords( str_replace( "_", " ", $option->option_name ) ) ?></th> <th scope="row"><?php echo ucwords( str_replace( "_", " ", $option->option_name ) ) ?></th>
<td><textarea rows="5" cols="40" name="option[<?php echo esc_attr($option->option_name) ?>]" type="text" id="<?php echo esc_attr($option->option_name) ?>"<?php echo $disabled ?>><?php echo esc_html( $option->option_value ) ?></textarea></td> <td><textarea rows="5" cols="40" name="option[<?php echo esc_attr($option->option_name) ?>]" id="<?php echo esc_attr($option->option_name) ?>"<?php echo $disabled ?>><?php echo esc_html( $option->option_value ) ?></textarea></td>
</tr> </tr>
<?php <?php
} else { } else {
@ -311,7 +311,7 @@ switch ( $action ) {
<div class="inside"> <div class="inside">
<table class="form-table"> <table class="form-table">
<?php do_action( 'wpmueditblogaction', $id ); ?> <?php do_action( 'wpmueditblogaction', $id ); ?>
</table> </table>
<p class="submit" style="margin:-15px 0 -5px 230px;"><input type="submit" name="Submit" value="<?php esc_attr_e('Update Options') ?>" /></p> <p class="submit" style="margin:-15px 0 -5px 230px;"><input type="submit" name="Submit" value="<?php esc_attr_e('Update Options') ?>" /></p>
</div></div> </div></div>
@ -326,27 +326,46 @@ switch ( $action ) {
// List blogs // List blogs
case 'list': case 'list':
default: default:
$apage = ( isset($_GET['apage'] ) && intval( $_GET['apage'] ) ) ? absint( $_GET['apage'] ) : 1; $pagenum = isset( $_GET['paged'] ) ? absint( $_GET['paged'] ) : 0;
$num = ( isset($_GET['num'] ) && intval( $_GET['num'] ) ) ? absint( $_GET['num'] ) : 15; if ( empty($pagenum) )
$s = isset($_GET['s']) ? esc_attr( trim( $_GET[ 's' ] ) ) : ''; $pagenum = 1;
$like_s = like_escape($s);
$per_page = (int) get_user_option( 'ms_sites_per_page' );
if ( empty( $per_page ) || $per_page < 1 )
$per_page = 15;
$per_page = apply_filters( 'ms_sites_per_page', $per_page );
$s = isset($_GET['s']) ? stripslashes( trim( $_GET[ 's' ] ) ) : '';
$like_s = esc_sql( like_escape( $s ) );
$query = "SELECT * FROM {$wpdb->blogs} WHERE site_id = '{$wpdb->siteid}' "; $query = "SELECT * FROM {$wpdb->blogs} WHERE site_id = '{$wpdb->siteid}' ";
if ( isset($_GET['blog_name']) ) { if ( isset( $_GET['blogstatus'] ) ) {
$query .= " AND ( {$wpdb->blogs}.domain LIKE '%{$like_s}%' OR {$wpdb->blogs}.path LIKE '%{$like_s}%' ) "; if ( 'deleted' == $_GET['blogstatus'] ) {
} elseif ( isset($_GET['blog_id']) ) { $query .= " AND {$wpdb->blogs}.deleted = '1' ";
$query .= " AND blog_id = '". absint( $_GET['blog_id'] )."' "; } elseif ( 'archived' == $_GET['blogstatus'] ) {
} elseif ( isset($_GET['blog_ip']) ) { $query .= " AND {$wpdb->blogs}.archived = '1' ";
$query = "SELECT * } elseif ( 'spam' == $_GET['blogstatus'] ) {
FROM {$wpdb->blogs}, {$wpdb->registration_log} $query .= " AND {$wpdb->blogs}.spam = '1' ";
WHERE site_id = '{$wpdb->siteid}' }
AND {$wpdb->blogs}.blog_id = {$wpdb->registration_log}.blog_id }
AND {$wpdb->registration_log}.IP LIKE ('%{$like_s}%')";
if ( isset( $_GET['searchaction'] ) ) {
if ( 'name' == $_GET['searchaction'] ) {
$query .= " AND ( {$wpdb->blogs}.domain LIKE '%{$like_s}%' OR {$wpdb->blogs}.path LIKE '%{$like_s}%' ) ";
} elseif ( 'id' == $_GET['searchaction'] ) {
$query .= " AND {$wpdb->blogs}.blog_id = '{$like_s}' ";
} elseif ( 'ip' == $_GET['searchaction'] ) {
$query = "SELECT *
FROM {$wpdb->blogs}, {$wpdb->registration_log}
WHERE site_id = '{$wpdb->siteid}'
AND {$wpdb->blogs}.blog_id = {$wpdb->registration_log}.blog_id
AND {$wpdb->registration_log}.IP LIKE ('%{$like_s}%')";
}
} }
$order_by = isset( $_GET['sortby'] ) ? $_GET['sortby'] : 'id'; $order_by = isset( $_GET['sortby'] ) ? $_GET['sortby'] : 'id';
if ( $order_by == 'registered' ) { if ( $order_by == 'registered' ) {
$query .= ' ORDER BY registered '; $query .= ' ORDER BY registered ';
} elseif ( $order_by == 'lastupdated' ) { } elseif ( $order_by == 'lastupdated' ) {
@ -355,67 +374,120 @@ switch ( $action ) {
$query .= ' ORDER BY domain '; $query .= ' ORDER BY domain ';
} else { } else {
$order_by = 'id'; $order_by = 'id';
$query .= ' ORDER BY ' . $wpdb->blogs . '.blog_id '; $query .= " ORDER BY {$wpdb->blogs}.blog_id ";
} }
$order = isset($_GET['order']) ? $_GET['order'] : 'ASC'; $order = ( isset( $_GET['order'] ) && 'DESC' == $_GET['order'] ) ? "DESC" : "ASC";
$order = ( 'DESC' == $order ) ? 'DESC' : 'ASC';
$query .= $order; $query .= $order;
if ( !empty($s) ) $total = $wpdb->get_var( str_replace('SELECT *', 'SELECT COUNT(blog_id)', $query) );
$total = $wpdb->get_var( str_replace('SELECT *', 'SELECT COUNT(blog_id)', $query) );
else
$total = $wpdb->get_var( "SELECT COUNT(blog_id) FROM {$wpdb->blogs} WHERE site_id = '{$wpdb->siteid}' ");
$query .= " LIMIT " . intval( ( $apage - 1 ) * $num) . ", " . intval( $num ); $query .= " LIMIT " . intval( ( $pagenum - 1 ) * $per_page) . ", " . intval( $per_page );
$blog_list = $wpdb->get_results( $query, ARRAY_A ); $blog_list = $wpdb->get_results( $query, ARRAY_A );
// Pagination $num_pages = ceil($total / $per_page);
$url2 = "&amp;order=" . $order . "&amp;sortby=" . $order_by . "&amp;s="; $page_links = paginate_links( array(
if ( !empty($_GET[ 'blog_ip' ]) ) 'base' => add_query_arg( 'paged', '%#%' ),
$url2 .= "&amp;ip_address=" . urlencode( $s );
else
$url2 .= $s . "&amp;ip_address=" . urlencode( $s );
$blog_navigation = paginate_links( array(
'base' => add_query_arg( 'apage', '%#%' ).$url2,
'format' => '', 'format' => '',
'total' => ceil($total / $num), 'prev_text' => __('&laquo;'),
'current' => $apage 'next_text' => __('&raquo;'),
'total' => $num_pages,
'current' => $pagenum
)); ));
if ( empty($_GET['mode']) )
$mode = 'list';
else
$mode = esc_attr( $_GET['mode'] );
// for subsubsub and $blog_list
$status_list = array( 'archived' => array( 'site-archived', __('Archived') ), 'spam' => array( 'site-spammed', __('Spam') ), 'deleted' => array( 'site-deleted', __('Deleted') ) );
?> ?>
<div class="wrap" style="position:relative;"> <div class="wrap">
<?php screen_icon(); ?> <?php screen_icon(); ?>
<h2><?php _e('Sites') ?></h2> <h2><?php _e('Sites') ?>
<a href="#form-add-site" class="button add-new-h2"><?php echo esc_html_x('Add New', 'sites'); ?></a>
<?php
if ( isset($_GET['s']) && $_GET['s'] )
printf( '<span class="subtitle">' . __('Search results for &#8220;%s&#8221;') . '</span>', esc_html( $s ) );
?>
</h2>
<ul class="subsubsub">
<?php
$status_links = array();
$status_class = '';
$count = get_blog_count();
if ( empty($_GET['blogstatus']) || $_GET['blogstatus'] == 'all' )
$status_class = ' class="current"';
$status_links[] = "<li><a href='ms-sites.php?blogstatus=all'$status_class>" . sprintf( __( 'All <span class="count">(%s)</span>' ), number_format_i18n( $count->all ) ) . '</a>';
foreach ( $status_list as $status => $col ) {
$status_class = '';
if ( empty( $count->$status ) )
continue;
if ( isset( $_GET['blogstatus'] ) && ( $_GET['blogstatus'] == $status ) )
$status_class = ' class="current"';
$status_links[] = "<li><a href='ms-sites.php?blogstatus=$status'$status_class>" . sprintf( $col[1] . ' <span class="count">(%s)</span>' , number_format_i18n( $count->$status ) ) . '</a>';
};
echo implode( " |</li>\n", $status_links ) . '</li>';
unset( $status_links );
?>
</ul>
<form action="ms-sites.php" method="get" id="ms-search"> <form action="ms-sites.php" method="get" id="ms-search">
<input type="hidden" name="action" value="blogs" /> <p class="search-box">
<input type="text" name="s" value="<?php echo($s); ?>" size="17" /> <input type="hidden" name="action" value="blogs" />
<input type="submit" class="button" name="blog_name" value="<?php esc_attr_e('Search blogs by name') ?>" /> <input type="text" name="s" value="<?php esc_attr_e( $s ); ?>" />
<input type="submit" class="button" name="blog_id" value="<?php esc_attr_e('by blog ID') ?>" /> <input type="submit" class="button" value="<?php esc_attr_e('Search Site by') ?>" />
<input type="submit" class="button" name="blog_ip" value="<?php esc_attr_e('by IP address') ?>" /> <select name="searchaction">
<option value="name" selected="selected"><?php _e('Name'); ?></option>
<option value="id"><?php _e('ID'); ?></option>
<option value="ip"><?php _e('IP address'); ?></option>
</select>
</p>
</form> </form>
<form id="form-blog-list" action="ms-edit.php?action=allblogs" method="post"> <form id="form-site-list" action="ms-edit.php?action=allblogs" method="post">
<input type="hidden" name="mode" value="<?php echo esc_attr($mode); ?>" />
<div class="tablenav"> <div class="tablenav">
<?php if ( $blog_navigation ) echo "<div class='tablenav-pages'>$blog_navigation</div>"; ?> <div class="alignleft actions">
<select name="action">
<div class="alignleft"> <option value="-1" selected="selected"><?php _e('Bulk Actions'); ?></option>
<input type="submit" value="<?php esc_attr_e('Delete') ?>" name="allblog_delete" class="button-secondary delete" /> <option value="delete"><?php _e('Delete'); ?></option>
<input type="submit" value="<?php esc_attr_e('Mark as Spam') ?>" name="allblog_spam" class="button-secondary" /> <option value="spam"><?php _e('Mark as Spam'); ?></option>
<input type="submit" value="<?php esc_attr_e('Not Spam') ?>" name="allblog_notspam" class="button-secondary" /> <option value="notspam"><?php _e('Not Spam'); ?></option>
<?php wp_nonce_field( 'allblogs' ); ?> </select>
<br class="clear" /> <input type="submit" value="<?php esc_attr_e('Apply'); ?>" name="doaction" id="doaction" class="button-secondary action" />
</div> <?php wp_nonce_field('bulk-sites'); ?>
</div> </div>
<br class="clear" /> <?php if ( $page_links ) { ?>
<div class="tablenav-pages">
<?php $page_links_text = sprintf( '<span class="displaying-num">' . __( 'Displaying %s&#8211;%s of %s' ) . '</span>%s',
number_format_i18n( ( $pagenum - 1 ) * $per_page + 1 ),
number_format_i18n( min( $pagenum * $per_page, $num_pages ) ),
number_format_i18n( $num_pages ),
$page_links
); echo $page_links_text; ?>
</div>
<?php } ?>
<div class="view-switch">
<a href="<?php echo esc_url(add_query_arg('mode', 'list', $_SERVER['REQUEST_URI'])) ?>"><img <?php if ( 'list' == $mode ) echo 'class="current"'; ?> id="view-switch-list" src="<?php echo esc_url( includes_url( 'images/blank.gif' ) ); ?>" width="20" height="20" title="<?php _e('List View') ?>" alt="<?php _e('List View') ?>" /></a>
<a href="<?php echo esc_url(add_query_arg('mode', 'excerpt', $_SERVER['REQUEST_URI'])) ?>"><img <?php if ( 'excerpt' == $mode ) echo 'class="current"'; ?> id="view-switch-excerpt" src="<?php echo esc_url( includes_url( 'images/blank.gif' ) ); ?>" width="20" height="20" title="<?php _e('Excerpt View') ?>" alt="<?php _e('Excerpt View') ?>" /></a>
</div>
<?php if ( isset($_GET['s']) && !empty($_GET['s']) ) : ?> </div>
<p><a href="ms-users.php?action=users&s=<?php echo urlencode( stripslashes( $s ) ) ?>"><?php _e('Search Users:') ?> <strong><?php echo stripslashes( $s ); ?></strong></a></p>
<?php endif; ?> <div class="clear"></div>
<?php <?php
// define the columns to display, the syntax is 'internal name' => 'display name' // define the columns to display, the syntax is 'internal name' => 'display name'
@ -432,35 +504,55 @@ switch ( $action ) {
$posts_columns['plugins'] = __('Actions'); $posts_columns['plugins'] = __('Actions');
$posts_columns = apply_filters('wpmu_blogs_columns', $posts_columns); $posts_columns = apply_filters('wpmu_blogs_columns', $posts_columns);
$sortby_url = "s=";
if ( !empty($_GET[ 'blog_ip' ]) )
$sortby_url .= "&ip_address=" . urlencode( $s );
else
$sortby_url .= urlencode( $s ) . "&ip_address=" . urlencode( $s );
?> ?>
<table width="100%" cellpadding="3" cellspacing="3" class="widefat"> <table class="widefat">
<thead> <thead>
<tr> <tr>
<th scope="col" class="check-column"></th> <th style="" class="manage-column column-cb check-column" id="cb" scope="col">
<?php foreach($posts_columns as $column_id => $column_display_name) { <input type="checkbox" />
$column_link = "<a href='ms-sites.php?{$sortby_url}&amp;sortby={$column_id}&amp;"; </th>
if ( $order_by == $column_id ) { <?php
$column_link .= ($order_by == 'DESC') ? 'order=ASC&amp;' : 'order=DESC&amp;'; foreach($posts_columns as $column_id => $column_display_name) {
} $column_link = "<a href='";
$column_link .= "apage={$apage}'>{$column_display_name}</a>"; $order2 = '';
if ( $order_by == $column_id )
$order2 = ($order == 'DESC') ? 'ASC' : 'DESC';
$column_link .= esc_url(add_query_arg( array('order' => $order2, 'paged' => $pagenum, 'sortby' => $column_id ), $_SERVER['REQUEST_URI'] ) );
$column_link .= "'>{$column_display_name}</a>";
$col_url = ($column_id == 'users' || $column_id == 'plugins') ? $column_display_name : $column_link; $col_url = ($column_id == 'users' || $column_id == 'plugins') ? $column_display_name : $column_link;
?> ?>
<th scope="col"><?php echo $col_url ?></th> <th scope="col">
<?php echo $col_url ?>
</th>
<?php } ?> <?php } ?>
</tr> </tr>
</thead> </thead>
<tfoot>
<tr>
<th class="manage-column column-cb check-column" id="cb" scope="col">
<input type="checkbox" />
</th>
<?php foreach($posts_columns as $column_id => $column_display_name) {
$column_link = "<a href='";
$order2 = '';
if ( $order_by == $column_id )
$order2 = ($order == 'DESC') ? 'ASC' : 'DESC';
$column_link .= esc_url(add_query_arg( array('order' => $order2, 'paged' => $pagenum, 'sortby' => $column_id ), remove_query_arg( array('action', 'updated'), $_SERVER['REQUEST_URI'] ) ) );
$column_link .= "'>{$column_display_name}</a>";
$col_url = ($column_id == 'users' || $column_id == 'plugins') ? $column_display_name : $column_link;
?>
<th scope="col">
<?php echo $col_url ?>
</th>
<?php } ?>
</tr>
</tfoot>
<tbody id="the-list"> <tbody id="the-list">
<?php <?php
if ( $blog_list ) { if ( $blog_list ) {
$status_list = array( 'archived' => array( 'site-archived', __('Archived') ), 'spam' => array( 'site-spammed', __('Spam') ), 'deleted' => array( 'site-deleted', __('Deleted') ) );
$class = ''; $class = '';
foreach ( $blog_list as $blog ) { foreach ( $blog_list as $blog ) {
$class = ('alternate' == $class) ? '' : 'alternate'; $class = ('alternate' == $class) ? '' : 'alternate';
@ -500,10 +592,12 @@ switch ( $action ) {
break; break;
case 'blogname': ?> case 'blogname': ?>
<td valign="top"> <td class="column-title">
<a href="ms-sites.php?action=editblog&amp;id=<?php echo $blog['blog_id'] ?>" class="edit"><?php echo $blogname; echo $blog_state?></a> <a href="ms-sites.php?action=editblog&amp;id=<?php echo $blog['blog_id'] ?>" class="edit"><?php echo $blogname; echo $blog_state?></a>
<br/>
<?php <?php
if ( 'list' != $mode )
echo '<p>' . get_blog_option( $blog['blog_id'], 'blogname' ) . '- <em>' . get_blog_option( $blog['blog_id'], 'blogdescription ' ) . '</em></p>';
$actions = array(); $actions = array();
$actions[] = '<a href="ms-sites.php?action=editblog&amp;id=' . $blog['blog_id'] . '" class="edit">' . __('Edit') . '</a>'; $actions[] = '<a href="ms-sites.php?action=editblog&amp;id=' . $blog['blog_id'] . '" class="edit">' . __('Edit') . '</a>';
$actions[] = "<a href='" . get_admin_url($blog['blog_id']) . "' class='edit'>" . __('Backend') . '</a>'; $actions[] = "<a href='" . get_admin_url($blog['blog_id']) . "' class='edit'>" . __('Backend') . '</a>';
@ -539,17 +633,21 @@ switch ( $action ) {
case 'lastupdated': ?> case 'lastupdated': ?>
<td valign="top"> <td valign="top">
<?php echo ( $blog['last_updated'] == '0000-00-00 00:00:00' ) ? __("Never") : mysql2date(__('Y-m-d \<\b\r \/\> g:i:s a'), $blog['last_updated']); ?> <?php
</td> if ( 'list' == $mode )
$date = 'Y/m/d';
else
$date = 'Y/m/d \<\b\r \/\> g:i:s a';
echo ( $blog['last_updated'] == '0000-00-00 00:00:00' ) ? __("Never") : mysql2date( __( $date ), $blog['last_updated'] ); ?>
</td>
<?php <?php
break; break;
case 'registered': ?> case 'registered': ?>
<td valign="top"> <td valign="top">
<?php echo mysql2date(__('Y-m-d \<\b\r \/\> g:i:s a'), $blog['registered']); ?> <?php echo mysql2date(__( $date ), $blog['registered'] ); ?>
</td> </td>
<?php <?php
break; break;
case 'users': ?> case 'users': ?>
<td valign="top"> <td valign="top">
<?php <?php
@ -560,8 +658,12 @@ switch ( $action ) {
$blogusers = array_slice( $blogusers, 0, 5 ); $blogusers = array_slice( $blogusers, 0, 5 );
$blogusers_warning = __( 'Only showing first 5 users.' ) . ' <a href="' . get_admin_url($blog['blog_id'], 'users.php') . '">' . __( 'More' ) . '</a>'; $blogusers_warning = __( 'Only showing first 5 users.' ) . ' <a href="' . get_admin_url($blog['blog_id'], 'users.php') . '">' . __( 'More' ) . '</a>';
} }
foreach ( $blogusers as $key => $val ) foreach ( $blogusers as $key => $val ) {
echo '<a href="user-edit.php?user_id=' . $val->user_id . '">' . $val->user_login . '</a> ('.$val->user_email.')<br />'; echo '<a href="user-edit.php?user_id=' . $val->user_id . '">' . $val->user_login . '</a> ';
if ( 'list' != $mode )
echo '(' . $val->user_email . ')';
echo '<br />';
}
if ( $blogusers_warning != '' ) if ( $blogusers_warning != '' )
echo '<strong>' . $blogusers_warning . '</strong><br />'; echo '<strong>' . $blogusers_warning . '</strong><br />';
} }
@ -592,7 +694,7 @@ switch ( $action ) {
<?php <?php
} }
} else { ?> } else { ?>
<tr style='background-color: <?php echo $bgcolor; ?>'> <tr>
<td colspan="8"><?php _e('No blogs found.') ?></td> <td colspan="8"><?php _e('No blogs found.') ?></td>
</tr> </tr>
<?php <?php
@ -601,34 +703,52 @@ switch ( $action ) {
</tbody> </tbody>
</table> </table>
<div class="tablenav">
<?php
if ( $page_links )
echo "<div class='tablenav-pages'>$page_links_text</div>";
?>
<div class="alignleft actions">
<select name="action2">
<option value="-1" selected="selected"><?php _e('Bulk Actions'); ?></option>
<option value="delete"><?php _e('Delete'); ?></option>
<option value="spam"><?php _e('Mark as Spam'); ?></option>
<option value="notspam"><?php _e('Not Spam'); ?></option>
</select>
<input type="submit" value="<?php esc_attr_e('Apply'); ?>" name="doaction2" id="doaction2" class="button-secondary action" />
</div>
<br class="clear" />
</div>
</form> </form>
</div> </div>
<div class="wrap"> <div class="wrap">
<a name="form-add-blog"></a> <a name="form-add-site"></a>
<h2><?php _e('Add Site') ?></h2> <h2><?php _e('Add Site') ?></h2>
<form method="post" action="ms-edit.php?action=addblog"> <form method="post" action="ms-edit.php?action=addblog">
<?php wp_nonce_field('add-blog') ?> <?php wp_nonce_field('add-blog') ?>
<table class="form-table"> <table class="form-table">
<tr class="form-field form-required"> <tr class="form-field form-required">
<th style="text-align:center;" scope='row'><?php _e('Site Address') ?></th> <th scope='row'><?php _e('Site Address') ?></th>
<td> <td>
<?php if ( is_subdomain_install() ) { ?> <?php if ( is_subdomain_install() ) { ?>
<input name="blog[domain]" type="text" title="<?php _e('Domain') ?>"/>.<?php echo $current_site->domain;?> <input name="blog[domain]" type="text" class="regular-text" title="<?php _e('Domain') ?>"/>.<?php echo $current_site->domain;?>
<?php } else { <?php } else {
echo $current_site->domain . $current_site->path ?><input name="blog[domain]" type="text" title="<?php _e('Domain') ?>"/> echo $current_site->domain . $current_site->path ?><input name="blog[domain]" class="regular-text" type="text" title="<?php _e('Domain') ?>"/>
<?php } <?php }
echo "<p>" . __( 'Only the characters a-z and 0-9 recommended.' ) . "</p>"; echo "<p>" . __( 'Only the characters a-z and 0-9 recommended.' ) . "</p>";
?> ?>
</td> </td>
</tr> </tr>
<tr class="form-field form-required"> <tr class="form-field form-required">
<th style="text-align:center;" scope='row'><?php _e('Site Title') ?></th> <th scope='row'><?php _e('Site Title') ?></th>
<td><input name="blog[title]" type="text" size="20" title="<?php _e('Title') ?>"/></td> <td><input name="blog[title]" type="text" class="regular-text" title="<?php _e('Title') ?>"/></td>
</tr> </tr>
<tr class="form-field form-required"> <tr class="form-field form-required">
<th style="text-align:center;" scope='row'><?php _e('Admin Email') ?></th> <th scope='row'><?php _e('Admin Email') ?></th>
<td><input name="blog[email]" type="text" size="20" title="<?php _e('Email') ?>"/></td> <td><input name="blog[email]" type="text" class="regular-text" title="<?php _e('Email') ?>"/></td>
</tr> </tr>
<tr class="form-field"> <tr class="form-field">
<td colspan='2'><?php _e('A new user will be created if the above email address is not in the database.') ?><br /><?php _e('The username and password will be mailed to this email address.') ?></td> <td colspan='2'><?php _e('A new user will be created if the above email address is not in the database.') ?><br /><?php _e('The username and password will be mailed to this email address.') ?></td>