<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" /><style type="text/css"><!--
#msg dl { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fc0 solid; padding: 6px; }
#msg ul, pre { overflow: auto; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<title>[16601] trunk/wp-admin/includes:
Fix problems with hidden columns on network users screen.</title>
</head>
<body>
<div id="msg">
<dl>
<dt>Revision</dt> <dd><a href="http://trac.wordpress.org/changeset/16601">16601</a></dd>
<dt>Author</dt> <dd>scribu</dd>
<dt>Date</dt> <dd>2010-11-28 17:39:44 +0000 (Sun, 28 Nov 2010)</dd>
</dl>
<h3>Log Message</h3>
<pre>Fix problems with hidden columns on network users screen. Props ocean90. See <a href="http://trac.wordpress.org/ticket/14579">#14579</a></pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkwpadminincludesclasswpmssiteslisttablephp">trunk/wp-admin/includes/class-wp-ms-sites-list-table.php</a></li>
<li><a href="#trunkwpadminincludesclasswpmsthemeslisttablephp">trunk/wp-admin/includes/class-wp-ms-themes-list-table.php</a></li>
<li><a href="#trunkwpadminincludesclasswpmsuserslisttablephp">trunk/wp-admin/includes/class-wp-ms-users-list-table.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkwpadminincludesclasswpmssiteslisttablephp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/includes/class-wp-ms-sites-list-table.php (16600 => 16601)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/includes/class-wp-ms-sites-list-table.php        2010-11-26 22:05:54 UTC (rev 16600)
+++ trunk/wp-admin/includes/class-wp-ms-sites-list-table.php        2010-11-28 17:39:44 UTC (rev 16601)
</span><span class="lines">@@ -310,12 +310,12 @@
</span><span class="cx">                                         break;
</span><span class="cx">
</span><span class="cx">                                 case 'plugins': ?>
</span><del>-                                                <?php if ( has_filter( 'wpmublogsaction' ) ) {
-                                                echo "<td valign='top'class='$column_name column-$column_name'$style>";
-                                                        do_action( 'wpmublogsaction', $blog['blog_id'] ); ?>
-                                                </td>
-                                                <?php } ?>
-                                        <?php break;
</del><ins>+                                        <?php if ( has_filter( 'wpmublogsaction' ) ) {
+                                        echo "<td valign='top' class='$column_name column-$column_name'$style>";
+                                                do_action( 'wpmublogsaction', $blog['blog_id'] ); ?>
+                                        </td>
+                                        <?php }
+                                        break;
</ins><span class="cx">                                         
</span><span class="cx">                                 default:
</span><span class="cx">                                         echo "<td class='$column_name column-$column_name'$style>";
</span></span></pre></div>
<a id="trunkwpadminincludesclasswpmsthemeslisttablephp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/includes/class-wp-ms-themes-list-table.php (16600 => 16601)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/includes/class-wp-ms-themes-list-table.php        2010-11-26 22:05:54 UTC (rev 16600)
+++ trunk/wp-admin/includes/class-wp-ms-themes-list-table.php        2010-11-28 17:39:44 UTC (rev 16601)
</span><span class="lines">@@ -334,7 +334,7 @@
</span><span class="cx">
</span><span class="cx">                                         echo "</div></td>";
</span><span class="cx">                                         break;
</span><del>-                                        break;
</del><ins>+
</ins><span class="cx">                                 default:
</span><span class="cx">                                         echo "<td class='$column_name column-$column_name'$style>";
</span><span class="cx">                                         do_action( 'manage_themes_custom_column', $column_name, $theme_key, $theme );
</span></span></pre></div>
<a id="trunkwpadminincludesclasswpmsuserslisttablephp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/includes/class-wp-ms-users-list-table.php (16600 => 16601)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/includes/class-wp-ms-users-list-table.php        2010-11-26 22:05:54 UTC (rev 16600)
+++ trunk/wp-admin/includes/class-wp-ms-users-list-table.php        2010-11-28 17:39:44 UTC (rev 16601)
</span><span class="lines">@@ -17,7 +17,7 @@
</span><span class="cx">         }
</span><span class="cx">
</span><span class="cx">         function prepare_items() {
</span><del>-                global $usersearch, $role, $wpdb;
</del><ins>+                global $usersearch, $role, $wpdb, $mode;
</ins><span class="cx">
</span><span class="cx">                 $usersearch = isset( $_REQUEST['s'] ) ? $_REQUEST['s'] : '';
</span><span class="cx">
</span><span class="lines">@@ -55,6 +55,8 @@
</span><span class="cx">                 if ( isset( $_REQUEST['order'] ) )
</span><span class="cx">                         $args['order'] = $_REQUEST['order'];
</span><span class="cx">
</span><ins>+                $mode = empty( $_REQUEST['mode'] ) ? 'list' : $_REQUEST['mode'];
+
</ins><span class="cx">                 // Query the user IDs for this page
</span><span class="cx">                 $wp_user_search = new WP_User_Query( $args );
</span><span class="cx">
</span><span class="lines">@@ -109,7 +111,7 @@
</span><span class="cx">         function get_columns() {
</span><span class="cx">                 $users_columns = array(
</span><span class="cx">                         'cb' => '<input type="checkbox" />',
</span><del>-                        'login' => __( 'Username' ),
</del><ins>+                        'username' => __( 'Username' ),
</ins><span class="cx">                         'name' => __( 'Name' ),
</span><span class="cx">                         'email' => __( 'E-mail' ),
</span><span class="cx">                         'registered' => _x( 'Registered', 'user' ),
</span><span class="lines">@@ -122,7 +124,7 @@
</span><span class="cx">
</span><span class="cx">         function get_sortable_columns() {
</span><span class="cx">                 return array(
</span><del>-                        'login' => 'login',
</del><ins>+                        'username' => 'login',
</ins><span class="cx">                         'name' => 'name',
</span><span class="cx">                         'email' => 'email',
</span><span class="cx">                         'registered' => 'id',
</span><span class="lines">@@ -132,10 +134,10 @@
</span><span class="cx">         function display_rows() {
</span><span class="cx">                 global $current_site, $mode;
</span><span class="cx">
</span><del>-                $class = '';
</del><ins>+                $alt = '';
</ins><span class="cx">                 $super_admins = get_super_admins();
</span><span class="cx">                 foreach ( $this->items as $user ) {
</span><del>-                        $class = ( 'alternate' == $class ) ? '' : 'alternate';
</del><ins>+                        $alt = ( 'alternate' == $alt ) ? '' : 'alternate';
</ins><span class="cx">
</span><span class="cx">                         $status_list = array( 'spam' => 'site-spammed', 'deleted' => 'site-deleted' );
</span><span class="cx">
</span><span class="lines">@@ -145,17 +147,20 @@
</span><span class="cx">                         }
</span><span class="cx">
</span><span class="cx">                         ?>
</span><del>-                        <tr class="<?php echo $class; ?>">
</del><ins>+                        <tr class="<?php echo $alt; ?>">
</ins><span class="cx">                         <?php
</span><span class="cx">
</span><span class="cx">                         list( $columns, $hidden ) = $this->get_column_info();
</span><span class="cx">
</span><span class="cx">                         foreach ( $columns as $column_name => $column_display_name ) :
</span><ins>+                                $class = "class='$column_name column-$column_name'";
+
</ins><span class="cx">                                 $style = '';
</span><span class="cx">                                 if ( in_array( $column_name, $hidden ) )
</span><span class="cx">                                         $style = ' style="display:none;"';
</span><span class="cx">
</span><span class="cx">                                 $attributes = "$class$style";
</span><ins>+                                
</ins><span class="cx">
</span><span class="cx">                                 switch ( $column_name ) {
</span><span class="cx">                                         case 'cb': ?>
</span><span class="lines">@@ -165,18 +170,11 @@
</span><span class="cx">                                         <?php
</span><span class="cx">                                         break;
</span><span class="cx">
</span><del>-                                        case 'id': ?>
-                                                <th valign="top" scope="row">
-                                                        <?php echo $user->ID ?>
-                                                </th>
-                                        <?php
-                                        break;
-
-                                        case 'login':
</del><ins>+                                        case 'username':
</ins><span class="cx">                                                 $avatar        = get_avatar( $user->user_email, 32 );
</span><span class="cx">                                                 $edit_link = ( get_current_user_id() == $user->ID ) ? 'profile.php' : 'user-edit.php?user_id=' . $user->ID;
</span><del>-                                                ?>
-                                                <td class="username column-username">
</del><ins>+
+                                                echo "<td $attributes>"; ?>
</ins><span class="cx">                                                         <?php echo $avatar; ?><strong><a href="<?php echo esc_url( self_admin_url( $edit_link ) ); ?>" class="edit"><?php echo stripslashes( $user->user_login ); ?></a><?php
</span><span class="cx">                                                         if ( in_array( $user->user_login, $super_admins ) )
</span><span class="cx">                                                                 echo ' - ' . __( 'Super Admin' );
</span><span class="lines">@@ -197,14 +195,12 @@
</span><span class="cx">                                         <?php
</span><span class="cx">                                         break;
</span><span class="cx">
</span><del>-                                        case 'name': ?>
-                                                <td class="name column-name"><?php echo "$user->first_name $user->last_name"; ?></td>
-                                        <?php
</del><ins>+                                        case 'name':
+                                                echo "<td $attributes>$user->first_name $user->last_name</td>";
</ins><span class="cx">                                         break;
</span><span class="cx">
</span><del>-                                        case 'email': ?>
-                                                <td class="email column-email"><a href="mailto:<?php echo $user->user_email ?>"><?php echo $user->user_email ?></a></td>
-                                        <?php
</del><ins>+                                        case 'email':
+                                                echo "<td $attributes><a href='mailto:$user->user_email'>$user->user_email</a></td>";
</ins><span class="cx">                                         break;
</span><span class="cx">
</span><span class="cx">                                         case 'registered':
</span><span class="lines">@@ -212,16 +208,13 @@
</span><span class="cx">                                                         $date = 'Y/m/d';
</span><span class="cx">                                                 else
</span><span class="cx">                                                         $date = 'Y/m/d \<\b\r \/\> g:i:s a';
</span><del>-                                        ?>
-                                                <td><?php echo mysql2date( $date, $user->user_registered ); ?></td>
-                                        <?php
</del><ins>+
+                                                echo "<td $attributes>" . mysql2date( $date, $user->user_registered ) . "</td>";
</ins><span class="cx">                                         break;
</span><span class="cx">
</span><span class="cx">                                         case 'blogs':
</span><span class="cx">                                                 $blogs = get_blogs_of_user( $user->ID, true );
</span><del>-                                                ?>
-                                                <td>
-                                                        <?php
</del><ins>+                                                echo "<td $attributes>";
</ins><span class="cx">                                                         if ( is_array( $blogs ) ) {
</span><span class="cx">                                                                 foreach ( (array) $blogs as $key => $val ) {
</span><span class="cx">                                                                         $path        = ( $val->path == '/' ) ? '' : $val->path;
</span><span class="lines">@@ -245,9 +238,10 @@
</span><span class="cx">                                         <?php
</span><span class="cx">                                         break;
</span><span class="cx">
</span><del>-                                        default: ?>
-                                                <td><?php echo apply_filters( 'manage_users_custom_column', '', $column_name, $user->ID ); ?></td>
-                                        <?php
</del><ins>+                                        default:
+                                                echo "<td $attributes>";
+                                                echo apply_filters( 'manage_users_custom_column', '', $column_name, $user->ID );
+                                                echo "</td>";
</ins><span class="cx">                                         break;
</span><span class="cx">                                 }
</span><span class="cx">                         endforeach
</span></span></pre>
</div>
</div>
</body>
</html>