- echo "<tr class='$class'>";
-
- $blogname = ( is_subdomain_install() ) ? str_replace( '.' . get_current_site()->domain, '', $blog['domain'] ) : $blog['path'];
-
- list( $columns, $hidden ) = $this->get_column_info();
-
- foreach ( $columns as $column_name => $column_display_name ) {
- $style = '';
- if ( in_array( $column_name, $hidden ) )
- $style = ' style="display:none;"';
-
- switch ( $column_name ) {
- case 'cb': ?>
- <th scope="row" class="check-column">
- <?php if ( ! is_main_site( $blog['blog_id'] ) ) : ?>
- <label class="screen-reader-text" for="blog_<?php echo $blog['blog_id']; ?>"><?php printf( __( 'Select %s' ), $blogname ); ?></label>
- <input type="checkbox" id="blog_<?php echo $blog['blog_id'] ?>" name="allblogs[]" value="<?php echo esc_attr( $blog['blog_id'] ) ?>" />
- <?php endif; ?>
- </th>
- <?php
- break;
-
- case 'id':?>
- <th scope="row">
- <?php echo $blog['blog_id'] ?>
- </th>
- <?php
- break;
-
- case 'blogname':
- echo "<td class='column-$column_name $column_name'$style>"; ?>
- <a href="<?php echo esc_url( network_admin_url( 'site-info.php?id=' . $blog['blog_id'] ) ); ?>" class="edit"><?php echo $blogname . $blog_state; ?></a>
- <?php
- if ( 'list' != $mode ) {
- switch_to_blog( $blog['blog_id'] );
- echo '<p>' . sprintf( _x( '%1$s – <em>%2$s</em>', '%1$s: site name. %2$s: site tagline.' ), get_option( 'blogname' ), get_option( 'blogdescription ' ) ) . '</p>';
- restore_current_blog();
- }
-
- // Preordered.
- $actions = array(
- 'edit' => '', 'backend' => '',
- 'activate' => '', 'deactivate' => '',
- 'archive' => '', 'unarchive' => '',
- 'spam' => '', 'unspam' => '',
- 'delete' => '',
- 'visit' => '',
- );
-
- $actions['edit'] = '<span class="edit"><a href="' . esc_url( network_admin_url( 'site-info.php?id=' . $blog['blog_id'] ) ) . '">' . __( 'Edit' ) . '</a></span>';
- $actions['backend'] = "<span class='backend'><a href='" . esc_url( get_admin_url( $blog['blog_id'] ) ) . "' class='edit'>" . __( 'Dashboard' ) . '</a></span>';
- if ( get_current_site()->blog_id != $blog['blog_id'] ) {
- if ( get_blog_status( $blog['blog_id'], 'deleted' ) == '1' )
- $actions['activate'] = '<span class="activate"><a href="' . esc_url( wp_nonce_url( network_admin_url( 'sites.php?action=confirm&action2=activateblog&id=' . $blog['blog_id'] . '&msg=' . urlencode( sprintf( __( 'You are about to activate the site %s' ), $blogname ) ) ), 'confirm' ) ) . '">' . __( 'Activate' ) . '</a></span>';
- else
- $actions['deactivate'] = '<span class="activate"><a href="' . esc_url( wp_nonce_url( network_admin_url( 'sites.php?action=confirm&action2=deactivateblog&id=' . $blog['blog_id'] . '&msg=' . urlencode( sprintf( __( 'You are about to deactivate the site %s' ), $blogname ) ) ), 'confirm') ) . '">' . __( 'Deactivate' ) . '</a></span>';
-
- if ( get_blog_status( $blog['blog_id'], 'archived' ) == '1' )
- $actions['unarchive'] = '<span class="archive"><a href="' . esc_url( wp_nonce_url( network_admin_url( 'sites.php?action=confirm&action2=unarchiveblog&id=' . $blog['blog_id'] . '&msg=' . urlencode( sprintf( __( 'You are about to unarchive the site %s.' ), $blogname ) ) ), 'confirm') ) . '">' . __( 'Unarchive' ) . '</a></span>';
- else
- $actions['archive'] = '<span class="archive"><a href="' . esc_url( wp_nonce_url( network_admin_url( 'sites.php?action=confirm&action2=archiveblog&id=' . $blog['blog_id'] . '&msg=' . urlencode( sprintf( __( 'You are about to archive the site %s.' ), $blogname ) ) ), 'confirm') ) . '">' . _x( 'Archive', 'verb; site' ) . '</a></span>';
-
- if ( get_blog_status( $blog['blog_id'], 'spam' ) == '1' )
- $actions['unspam'] = '<span class="spam"><a href="' . esc_url( wp_nonce_url( network_admin_url( 'sites.php?action=confirm&action2=unspamblog&id=' . $blog['blog_id'] . '&msg=' . urlencode( sprintf( __( 'You are about to unspam the site %s.' ), $blogname ) ) ), 'confirm') ) . '">' . _x( 'Not Spam', 'site' ) . '</a></span>';
- else
- $actions['spam'] = '<span class="spam"><a href="' . esc_url( wp_nonce_url( network_admin_url( 'sites.php?action=confirm&action2=spamblog&id=' . $blog['blog_id'] . '&msg=' . urlencode( sprintf( __( 'You are about to mark the site %s as spam.' ), $blogname ) ) ), 'confirm') ) . '">' . _x( 'Spam', 'site' ) . '</a></span>';
-
- if ( current_user_can( 'delete_site', $blog['blog_id'] ) )
- $actions['delete'] = '<span class="delete"><a href="' . esc_url( wp_nonce_url( network_admin_url( 'sites.php?action=confirm&action2=deleteblog&id=' . $blog['blog_id'] . '&msg=' . urlencode( sprintf( __( 'You are about to delete the site %s.' ), $blogname ) ) ), 'confirm') ) . '">' . __( 'Delete' ) . '</a></span>';
- }
-
- $actions['visit'] = "<span class='view'><a href='" . esc_url( get_home_url( $blog['blog_id'], '/' ) ) . "' rel='permalink'>" . __( 'Visit' ) . '</a></span>';
-
- /**
- * Filter the action links displayed for each site in the Sites list table.
- *
- * The 'Edit', 'Dashboard', 'Delete', and 'Visit' links are displayed by
- * default for each site. The site's status determines whether to show the
- * 'Activate' or 'Deactivate' link, 'Unarchive' or 'Archive' links, and
- * 'Not Spam' or 'Spam' link for each site.
- *
- * @since 3.1.0
- *
- * @param array $actions An array of action links to be displayed.
- * @param int $blog_id The site ID.
- * @param string $blogname Site path, formatted depending on whether it is a sub-domain
- * or subdirectory multisite install.
- */
- $actions = apply_filters( 'manage_sites_action_links', array_filter( $actions ), $blog['blog_id'], $blogname );
- echo $this->row_actions( $actions );
- ?>
- </td>
- <?php
- break;
-
- case 'lastupdated':
- echo "<td class='$column_name column-$column_name'$style>";
- 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
- break;
- case 'registered':
- echo "<td class='$column_name column-$column_name'$style>";
- if ( $blog['registered'] == '0000-00-00 00:00:00' )
- echo '—';
- else
- echo mysql2date( $date, $blog['registered'] );
- ?>
- </td>
- <?php
- break;
- case 'users':
- echo "<td class='$column_name column-$column_name'$style>";
- $blogusers = get_users( array( 'blog_id' => $blog['blog_id'], 'number' => 6) );
- if ( is_array( $blogusers ) ) {
- $blogusers_warning = '';
- if ( count( $blogusers ) > 5 ) {
- $blogusers = array_slice( $blogusers, 0, 5 );
- $blogusers_warning = __( 'Only showing first 5 users.' ) . ' <a href="' . esc_url( network_admin_url( 'site-users.php?id=' . $blog['blog_id'] ) ) . '">' . __( 'More' ) . '</a>';
- }
- foreach ( $blogusers as $user_object ) {
- echo '<a href="' . esc_url( network_admin_url( 'user-edit.php?user_id=' . $user_object->ID ) ) . '">' . esc_html( $user_object->user_login ) . '</a> ';
- if ( 'list' != $mode )
- echo '( ' . $user_object->user_email . ' )';
- echo '<br />';
- }
- if ( $blogusers_warning != '' )
- echo '<strong>' . $blogusers_warning . '</strong><br />';
- }
- ?>
- </td>
- <?php
- break;
-
- case 'plugins': ?>
- <?php if ( has_filter( 'wpmublogsaction' ) ) {
- echo "<td class='$column_name column-$column_name'$style>";
- /**
- * Fires inside the auxiliary 'Actions' column of the Sites list table.
- *
- * By default this column is hidden unless something is hooked to the action.
- *
- * @since MU
- *
- * @param int $blog_id The site ID.
- */
- do_action( 'wpmublogsaction', $blog['blog_id'] ); ?>
- </td>
- <?php }
- break;
-
- default:
- echo "<td class='$column_name column-$column_name'$style>";
- /**
- * Fires for each registered custom column in the Sites list table.
- *
- * @since 3.1.0
- *
- * @param string $column_name The name of the column to display.
- * @param int $blog_id The site ID.
- */
- do_action( 'manage_sites_custom_column', $column_name, $blog['blog_id'] );
- echo "</td>";
- break;
- }