- <tr class="<?php echo $alt; ?>">
- <?php
-
- list( $columns, $hidden ) = $this->get_column_info();
-
- foreach ( $columns as $column_name => $column_display_name ) :
- $class = "class='$column_name column-$column_name'";
-
- $style = '';
- if ( in_array( $column_name, $hidden ) )
- $style = ' style="display:none;"';
-
- $attributes = "$class$style";
-
- switch ( $column_name ) {
- case 'cb': ?>
- <th scope="row" class="check-column">
- <label class="screen-reader-text" for="blog_<?php echo $user->ID; ?>"><?php echo sprintf( __( 'Select %s' ), $user->user_login ); ?></label>
- <input type="checkbox" id="blog_<?php echo $user->ID ?>" name="allusers[]" value="<?php echo esc_attr( $user->ID ) ?>" />
- </th>
- <?php
- break;
-
- case 'username':
- $avatar = get_avatar( $user->user_email, 32 );
- $edit_link = esc_url( add_query_arg( 'wp_http_referer', urlencode( wp_unslash( $_SERVER['REQUEST_URI'] ) ), get_edit_user_link( $user->ID ) ) );
-
- echo "<td $attributes>"; ?>
- <?php echo $avatar; ?><strong><a href="<?php echo $edit_link; ?>" class="edit"><?php echo $user->user_login; ?></a><?php
- if ( in_array( $user->user_login, $super_admins ) )
- echo ' - ' . __( 'Super Admin' );
- ?></strong>
- <br/>
- <?php
- $actions = array();
- $actions['edit'] = '<a href="' . $edit_link . '">' . __( 'Edit' ) . '</a>';
-
- if ( current_user_can( 'delete_user', $user->ID ) && ! in_array( $user->user_login, $super_admins ) ) {
- $actions['delete'] = '<a href="' . $delete = esc_url( network_admin_url( add_query_arg( '_wp_http_referer', urlencode( wp_unslash( $_SERVER['REQUEST_URI'] ) ), wp_nonce_url( 'users.php', 'deleteuser' ) . '&action=deleteuser&id=' . $user->ID ) ) ) . '" class="delete">' . __( 'Delete' ) . '</a>';
- }
-
- /**
- * Filter the action links displayed under each user
- * in the Network Admin Users list table.
- *
- * @since 3.2.0
- *
- * @param array $actions An array of action links to be displayed.
- * Default 'Edit', 'Delete'.
- * @param WP_User $user WP_User object.
- */
- $actions = apply_filters( 'ms_user_row_actions', $actions, $user );
- echo $this->row_actions( $actions );
- ?>
- </td>
- <?php
- break;
-
- case 'name':
- echo "<td $attributes>$user->first_name $user->last_name</td>";
- break;
-
- case 'email':
- echo "<td $attributes><a href='mailto:$user->user_email'>$user->user_email</a></td>";
- break;
-
- case 'registered':
- if ( 'list' == $mode )
- $date = 'Y/m/d';
- else
- $date = 'Y/m/d \<\b\r \/\> g:i:s a';
-
- echo "<td $attributes>" . mysql2date( $date, $user->user_registered ) . "</td>";
- break;
-
- case 'blogs':
- $blogs = get_blogs_of_user( $user->ID, true );
- echo "<td $attributes>";
- if ( is_array( $blogs ) ) {
- foreach ( (array) $blogs as $key => $val ) {
- if ( !can_edit_network( $val->site_id ) )
- continue;
-
- $path = ( $val->path == '/' ) ? '' : $val->path;
- echo '<span class="site-' . $val->site_id . '" >';
- echo '<a href="'. esc_url( network_admin_url( 'site-info.php?id=' . $val->userblog_id ) ) .'">' . str_replace( '.' . get_current_site()->domain, '', $val->domain . $path ) . '</a>';
- echo ' <small class="row-actions">';
- $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 )
- $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>';
-
- /**
- * Filter the action links displayed next the sites a user belongs to
- * in the Network Admin Users list table.
- *
- * @since 3.1.0
- *
- * @param array $actions An array of action links to be displayed.
- * Default 'Edit', 'View'.
- * @param int $userblog_id The site ID.
- */
- $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></span><br/>';
- }
- }
- ?>
- </td>
- <?php
- break;
-
- default:
- echo "<td $attributes>";
- /** This filter is documented in wp-admin/includes/class-wp-users-list-table.php */
- echo apply_filters( 'manage_users_custom_column', '', $column_name, $user->ID );
- echo "</td>";
- break;
- }
- endforeach
- ?>