<!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': ?&gt;
</span><del>-                                                &lt;?php if ( has_filter( 'wpmublogsaction' ) ) {
-                                                echo &quot;&lt;td valign='top'class='$column_name column-$column_name'$style&gt;&quot;;
-                                                        do_action( 'wpmublogsaction', $blog['blog_id'] ); ?&gt;
-                                                &lt;/td&gt;
-                                                &lt;?php } ?&gt;
-                                        &lt;?php break;
</del><ins>+                                        &lt;?php if ( has_filter( 'wpmublogsaction' ) ) {
+                                        echo &quot;&lt;td valign='top' class='$column_name column-$column_name'$style&gt;&quot;;
+                                                do_action( 'wpmublogsaction', $blog['blog_id'] ); ?&gt;
+                                        &lt;/td&gt;
+                                        &lt;?php }
+                                        break;
</ins><span class="cx">                                         
</span><span class="cx">                                 default:
</span><span class="cx">                                         echo &quot;&lt;td class='$column_name column-$column_name'$style&gt;&quot;;
</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 &quot;&lt;/div&gt;&lt;/td&gt;&quot;;
</span><span class="cx">                                         break;
</span><del>-                                        break;
</del><ins>+
</ins><span class="cx">                                 default:
</span><span class="cx">                                         echo &quot;&lt;td class='$column_name column-$column_name'$style&gt;&quot;;
</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'         =&gt; '&lt;input type=&quot;checkbox&quot; /&gt;',
</span><del>-                        'login'      =&gt; __( 'Username' ),
</del><ins>+                        'username'   =&gt; __( 'Username' ),
</ins><span class="cx">                         'name'       =&gt; __( 'Name' ),
</span><span class="cx">                         'email'      =&gt; __( 'E-mail' ),
</span><span class="cx">                         'registered' =&gt; _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'      =&gt; 'login',
</del><ins>+                        'username'   =&gt; 'login',
</ins><span class="cx">                         'name'       =&gt; 'name',
</span><span class="cx">                         'email'      =&gt; 'email',
</span><span class="cx">                         'registered' =&gt; '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-&gt;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' =&gt; 'site-spammed', 'deleted' =&gt; '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">                         ?&gt;
</span><del>-                        &lt;tr class=&quot;&lt;?php echo $class; ?&gt;&quot;&gt;
</del><ins>+                        &lt;tr class=&quot;&lt;?php echo $alt; ?&gt;&quot;&gt;
</ins><span class="cx">                         &lt;?php
</span><span class="cx"> 
</span><span class="cx">                         list( $columns, $hidden ) = $this-&gt;get_column_info();
</span><span class="cx"> 
</span><span class="cx">                         foreach ( $columns as $column_name =&gt; $column_display_name ) :
</span><ins>+                                $class = &quot;class='$column_name column-$column_name'&quot;;
+
</ins><span class="cx">                                 $style = '';
</span><span class="cx">                                 if ( in_array( $column_name, $hidden ) )
</span><span class="cx">                                         $style = ' style=&quot;display:none;&quot;';
</span><span class="cx"> 
</span><span class="cx">                                 $attributes = &quot;$class$style&quot;;
</span><ins>+                                
</ins><span class="cx"> 
</span><span class="cx">                                 switch ( $column_name ) {
</span><span class="cx">                                         case 'cb': ?&gt;
</span><span class="lines">@@ -165,18 +170,11 @@
</span><span class="cx">                                         &lt;?php
</span><span class="cx">                                         break;
</span><span class="cx"> 
</span><del>-                                        case 'id': ?&gt;
-                                                &lt;th valign=&quot;top&quot; scope=&quot;row&quot;&gt;
-                                                        &lt;?php echo $user-&gt;ID ?&gt;
-                                                &lt;/th&gt;
-                                        &lt;?php
-                                        break;
-
-                                        case 'login':
</del><ins>+                                        case 'username':
</ins><span class="cx">                                                 $avatar        = get_avatar( $user-&gt;user_email, 32 );
</span><span class="cx">                                                 $edit_link = ( get_current_user_id() == $user-&gt;ID ) ? 'profile.php' : 'user-edit.php?user_id=' . $user-&gt;ID;
</span><del>-                                                ?&gt;
-                                                &lt;td class=&quot;username column-username&quot;&gt;
</del><ins>+
+                                                echo &quot;&lt;td $attributes&gt;&quot;; ?&gt;
</ins><span class="cx">                                                         &lt;?php echo $avatar; ?&gt;&lt;strong&gt;&lt;a href=&quot;&lt;?php echo esc_url( self_admin_url( $edit_link ) ); ?&gt;&quot; class=&quot;edit&quot;&gt;&lt;?php echo stripslashes( $user-&gt;user_login ); ?&gt;&lt;/a&gt;&lt;?php
</span><span class="cx">                                                         if ( in_array( $user-&gt;user_login, $super_admins ) )
</span><span class="cx">                                                                 echo ' - ' . __( 'Super Admin' );
</span><span class="lines">@@ -197,14 +195,12 @@
</span><span class="cx">                                         &lt;?php
</span><span class="cx">                                         break;
</span><span class="cx"> 
</span><del>-                                        case 'name': ?&gt;
-                                                &lt;td class=&quot;name column-name&quot;&gt;&lt;?php echo &quot;$user-&gt;first_name $user-&gt;last_name&quot;; ?&gt;&lt;/td&gt;
-                                        &lt;?php
</del><ins>+                                        case 'name':
+                                                echo &quot;&lt;td $attributes&gt;$user-&gt;first_name $user-&gt;last_name&lt;/td&gt;&quot;;
</ins><span class="cx">                                         break;
</span><span class="cx"> 
</span><del>-                                        case 'email': ?&gt;
-                                                &lt;td class=&quot;email column-email&quot;&gt;&lt;a href=&quot;mailto:&lt;?php echo $user-&gt;user_email ?&gt;&quot;&gt;&lt;?php echo $user-&gt;user_email ?&gt;&lt;/a&gt;&lt;/td&gt;
-                                        &lt;?php
</del><ins>+                                        case 'email':
+                                                echo &quot;&lt;td $attributes&gt;&lt;a href='mailto:$user-&gt;user_email'&gt;$user-&gt;user_email&lt;/a&gt;&lt;/td&gt;&quot;;
</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 \&lt;\b\r \/\&gt; g:i:s a';
</span><del>-                                        ?&gt;
-                                                &lt;td&gt;&lt;?php echo mysql2date( $date, $user-&gt;user_registered ); ?&gt;&lt;/td&gt;
-                                        &lt;?php
</del><ins>+
+                                                echo &quot;&lt;td $attributes&gt;&quot; . mysql2date( $date, $user-&gt;user_registered ) . &quot;&lt;/td&gt;&quot;;
</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-&gt;ID, true );
</span><del>-                                                ?&gt;
-                                                &lt;td&gt;
-                                                        &lt;?php
</del><ins>+                                                echo &quot;&lt;td $attributes&gt;&quot;;
</ins><span class="cx">                                                         if ( is_array( $blogs ) ) {
</span><span class="cx">                                                                 foreach ( (array) $blogs as $key =&gt; $val ) {
</span><span class="cx">                                                                         $path        = ( $val-&gt;path == '/' ) ? '' : $val-&gt;path;
</span><span class="lines">@@ -245,9 +238,10 @@
</span><span class="cx">                                         &lt;?php
</span><span class="cx">                                         break;
</span><span class="cx"> 
</span><del>-                                        default: ?&gt;
-                                                &lt;td&gt;&lt;?php echo apply_filters( 'manage_users_custom_column', '', $column_name, $user-&gt;ID ); ?&gt;&lt;/td&gt;
-                                        &lt;?php
</del><ins>+                                        default:
+                                                echo &quot;&lt;td $attributes&gt;&quot;;
+                                                echo apply_filters( 'manage_users_custom_column', '', $column_name, $user-&gt;ID );
+                                                echo &quot;&lt;/td&gt;&quot;;
</ins><span class="cx">                                         break;
</span><span class="cx">                                 }
</span><span class="cx">                         endforeach
</span></span></pre>
</div>
</div>

</body>
</html>