Make the list of actions that can be performed on a site in the User List in Network admin filterable.

Add classes for all core site status types to the view url.
Move the CSS to a css file rather than including it inline.
See #15558

git-svn-id: http://svn.automattic.com/wordpress/trunk@16607 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
westi 2010-11-29 13:31:42 +00:00
parent 2ac3a16aff
commit d2bce97ced
4 changed files with 34 additions and 17 deletions

View File

@ -1 +1 @@
#dashboard_right_now p.musub{margin-top:12px;border-top:1px solid #ececec;padding-left:16px;position:static;}#dashboard_right_now td.b a.musublink{font-size:16px;}#dashboard_right_now div.musubtable{border-top:none;}#dashboard_right_now div.musubtable .t{white-space:normal;}.ms-sites-php .postbox h3{cursor:auto;}.ms-sites-php .postbox .description{margin:10px 0 0;padding:0 10px 10px;border-bottom:1px solid #DFDFDF;}tr.site-deleted{background:#ff8573;}tr.site-spammed{background:#faa;}tr.site-archived{background:#ffebe8;}tr.site-mature{background:#fecac2;}
#dashboard_right_now p.musub{margin-top:12px;border-top:1px solid #ececec;padding-left:16px;position:static;}#dashboard_right_now td.b a.musublink{font-size:16px;}#dashboard_right_now div.musubtable{border-top:none;}#dashboard_right_now div.musubtable .t{white-space:normal;}.ms-sites-php .postbox h3{cursor:auto;}.ms-sites-php .postbox .description{margin:10px 0 0;padding:0 10px 10px;border-bottom:1px solid #DFDFDF;}tr.site-deleted,a.site-deleted{background:#ff8573;}tr.site-spammed,a.site-spammed{background:#faa;}tr.site-archived,a.site-archived{background:#ffebe8;}tr.site-mature,a.site-mature{background:#fecac2;}

View File

@ -30,15 +30,16 @@
}
/* Background Color for Site Status */
tr.site-deleted {
tr.site-deleted, a.site-deleted {
background: #ff8573;
}
tr.site-spammed {
tr.site-spammed, a.site-spammed {
background: #faa;
}
tr.site-archived {
tr.site-archived, a.site-archived {
background:#ffebe8;
}
tr.site-mature {
tr.site-mature, a.site-mature {
background: #fecac2;
}

View File

@ -217,20 +217,36 @@ class WP_MS_Users_List_Table extends WP_List_Table {
echo "<td $attributes>";
if ( is_array( $blogs ) ) {
foreach ( (array) $blogs as $key => $val ) {
$path = ( $val->path == '/' ) ? '' : $val->path;
if ( $current_site->id != $val->site_id ) continue;
$path = ( $val->path == '/' ) ? '' : $val->path;
echo '<a href="'. esc_url( network_admin_url( 'site-info.php?id=' . $val->userblog_id ) ) .'">' . str_replace( '.' . $current_site->domain, '', $val->domain . $path ) . '</a>';
echo ' <small class="row-actions">';
// Edit
echo '<a href="'. esc_url( network_admin_url( 'site-info.php?id=' . $val->userblog_id ) ) .'">' . __( 'Edit' ) . '</a> | ';
// View
echo '<a ';
$actions = array();
$actions['edit'] = '<a href="'. esc_url( network_admin_url( 'site-info.php?id=' . $val->userblog_id ) ) .'">' . __( 'Edit' ) . '</a>';
$class = '';
if ( get_blog_status( $val->userblog_id, 'spam' ) == 1 )
echo 'style="background-color: #faa" ';
echo 'href="' . esc_url( get_home_url( $val->userblog_id ) ) . '">' . __( 'View' ) . '</a>';
echo '</small><br />';
$class .= 'site-spammed ';
if ( get_blog_status( $val->userblog_id, 'mature' ) == 1 )
$class .= 'site-mature ';
if ( get_blog_status( $val->userblog_id, 'deleted' ) == 1 )
$class .= 'site-deleted ';
if ( get_blog_status( $val->userblog_id, 'archived' ) == 1 )
$class .= 'site-archived ';
$actions['view'] = '<a class="' . $class . '" href="' . esc_url( get_home_url( $val->userblog_id ) ) . '">' . __( 'View' ) . '</a>';
$actions = apply_filters('ms_user_list_site_actions', $actions, $val->userblog_id);
$i=0;
$action_count = count( $actions );
foreach ( $actions as $action => $link ) {
++$i;
( $i == $action_count ) ? $sep = '' : $sep = ' | ';
echo "<span class='$action'>$link$sep</span>";
}
echo '</small><br/>';
}
}
?>

View File

@ -500,7 +500,7 @@ function wp_default_styles( &$styles ) {
$styles->add( 'colors-fresh', "/wp-admin/css/colors-fresh$suffix.css", array(), $colors_version );
$styles->add( 'colors-classic', "/wp-admin/css/colors-classic$suffix.css", array(), $colors_version );
$styles->add( 'ms', "/wp-admin/css/ms$suffix.css", array(), '20100528' );
$styles->add( 'ms', "/wp-admin/css/ms$suffix.css", array(), '20101129' );
$styles->add( 'global', "/wp-admin/css/global$suffix.css", array(), '20101105' );
$styles->add( 'media', "/wp-admin/css/media$suffix.css", array(), '20101020' );
$styles->add( 'widgets', "/wp-admin/css/widgets$suffix.css", array(), '20100610' );