<!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>[12897] trunk/wp-admin/ms-sites.php: ms-sites cleanup.</title>
</head>
<body>
<div id="msg">
<dl>
<dt>Revision</dt> <dd><a href="http://trac.wordpress.org/changeset/12897">12897</a></dd>
<dt>Author</dt> <dd>ryan</dd>
<dt>Date</dt> <dd>2010-01-29 17:36:57 +0000 (Fri, 29 Jan 2010)</dd>
</dl>
<h3>Log Message</h3>
<pre>ms-sites cleanup. Add escaping. Use API instead of direct queries. Add blog status label to row title. see <a href="http://trac.wordpress.org/ticket/11644">#11644</a></pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkwpadminmssitesphp">trunk/wp-admin/ms-sites.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkwpadminmssitesphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/ms-sites.php (12896 => 12897)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/ms-sites.php        2010-01-29 16:26:46 UTC (rev 12896)
+++ trunk/wp-admin/ms-sites.php        2010-01-29 17:36:57 UTC (rev 12897)
</span><span class="lines">@@ -76,13 +76,13 @@
</span><span class="cx">         // Edit blog
</span><span class="cx">         case "editblog":
</span><span class="cx">                 $blog_prefix = $wpdb->get_blog_prefix( $id );
</span><del>-                $options = $wpdb->get_results( "SELECT * FROM {$blog_prefix}options WHERE option_name NOT LIKE '_transient_rss%' AND option_name NOT LIKE '%user_roles'", ARRAY_A );
-                $details = $wpdb->get_row( "SELECT * FROM {$wpdb->blogs} WHERE blog_id = '{$id}'", ARRAY_A );
</del><ins>+                $options = $wpdb->get_results( "SELECT * FROM {$blog_prefix}options WHERE option_name NOT LIKE '\_%' AND option_name NOT LIKE '%user_roles'" );
+                $details = get_blog_details($id);
</ins><span class="cx">                 $editblog_roles = get_blog_option( $id, "{$blog_prefix}user_roles" );
</span><span class="cx">                 ?>
</span><span class="cx">                 <div class="wrap">
</span><span class="cx">                 <?php screen_icon(); ?>
</span><del>-                <h2><?php _e('Edit Blog'); ?> - <a href='http://<?php echo $details['domain'].$details['path']; ?>'>http://<?php echo $details['domain'].$details['path']; ?></a></h2>
</del><ins>+                <h2><?php _e('Edit Blog'); ?> - <a href='http://<?php echo $details->domain . $details->path; ?>'>http://<?php echo $details->domain . $details->path; ?></a></h2>
</ins><span class="cx">                 <form method="post" action="ms-edit.php?action=updateblog">
</span><span class="cx">                         <?php wp_nonce_field('editblog'); ?>
</span><span class="cx">                         <input type="hidden" name="id" value="<?php echo esc_attr($id) ?>" />
</span><span class="lines">@@ -93,54 +93,54 @@
</span><span class="cx">                                 <table class="form-table">
</span><span class="cx">                                                         <tr class="form-field form-required">
</span><span class="cx">                                                                 <th scope="row"><?php _e('Domain') ?></th>
</span><del>-                                                                <td>http://<input name="blog[domain]" type="text" id="domain" value="<?php echo $details['domain'] ?>" size="33" /></td>
</del><ins>+                                                                <td>http://<input name="blog[domain]" type="text" id="domain" value="<?php echo $details->domain ?>" size="33" /></td>
</ins><span class="cx">                                                         </tr>
</span><span class="cx">                                                         <tr class="form-field form-required">
</span><span class="cx">                                                                 <th scope="row"><?php _e('Path') ?></th>
</span><del>-                                                                <td><input name="blog[path]" type="text" id="path" value="<?php echo esc_attr($details['path']) ?>" size="40" style='margin-bottom:5px;' />
-                                                                <br /><input type='checkbox' style='width:20px;' name='update_home_url' value='update' <?php if ( get_blog_option( $id, 'siteurl' ) == preg_replace('|/+$|', '', 'http://' . $details['domain'] . $details['path']) || get_blog_option( $id, 'home' ) == preg_replace('|/+$|', '', 'http://' . $details['domain'] . $details['path']) ) echo 'checked="checked"'; ?> /> <?php _e( "Update 'siteurl' and 'home' as well." ); ?></td>
</del><ins>+                                                                <td><input name="blog[path]" type="text" id="path" value="<?php echo esc_attr($details->path) ?>" size="40" style='margin-bottom:5px;' />
+                                                                <br /><input type='checkbox' style='width:20px;' name='update_home_url' value='update' <?php if ( get_blog_option( $id, 'siteurl' ) == preg_replace('|/+$|', '', 'http://' . $details->domain . $details->path) || get_blog_option( $id, 'home' ) == preg_replace('|/+$|', '', 'http://' . $details->domain . $details->path) ) echo 'checked="checked"'; ?> /> <?php _e( "Update 'siteurl' and 'home' as well." ); ?></td>
</ins><span class="cx">                                                         </tr>
</span><span class="cx">                                                         <tr class="form-field">
</span><span class="cx">                                                                 <th scope="row"><?php _e('Registered') ?></th>
</span><del>-                                                                <td><input name="blog[registered]" type="text" id="blog_registered" value="<?php echo esc_attr($details['registered']) ?>" size="40" /></td>
</del><ins>+                                                                <td><input name="blog[registered]" type="text" id="blog_registered" value="<?php echo esc_attr($details->registered) ?>" size="40" /></td>
</ins><span class="cx">                                                         </tr>
</span><span class="cx">                                                         <tr class="form-field">
</span><span class="cx">                                                                 <th scope="row"><?php _e('Last Updated') ?></th>
</span><del>-                                                                <td><input name="blog[last_updated]" type="text" id="blog_last_updated" value="<?php echo esc_attr($details['last_updated']) ?>" size="40" /></td>
</del><ins>+                                                                <td><input name="blog[last_updated]" type="text" id="blog_last_updated" value="<?php echo esc_attr($details->last_updated) ?>" size="40" /></td>
</ins><span class="cx">                                                         </tr>
</span><span class="cx">                                                         <tr class="form-field">
</span><span class="cx">                                                                 <th scope="row"><?php _e('Public') ?></th>
</span><span class="cx">                                                                 <td>
</span><del>-                                                                        <input type='radio' style='width:20px;' name='blog[public]' value='1' <?php if ( $details['public'] == '1' ) echo 'checked="checked"'; ?> /> <?php _e('Yes') ?>
-                                                                        <input type='radio' style='width:20px;' name='blog[public]' value='0' <?php if ( $details['public'] == '0' ) echo 'checked="checked"'; ?> /> <?php _e('No') ?>
</del><ins>+                                                                        <input type='radio' style='width:20px;' name='blog[public]' value='1' <?php if ( $details->public == '1' ) echo 'checked="checked"'; ?> /> <?php _e('Yes') ?>
+                                                                        <input type='radio' style='width:20px;' name='blog[public]' value='0' <?php if ( $details->public == '0' ) echo 'checked="checked"'; ?> /> <?php _e('No') ?>
</ins><span class="cx">                                                                 </td>
</span><span class="cx">                                                         </tr>
</span><span class="cx">                                                         <tr class="form-field">
</span><span class="cx">                                                                 <th scope="row"><?php _e( 'Archived' ); ?></th>
</span><span class="cx">                                                                 <td>
</span><del>-                                                                        <input type='radio' style='width:20px;' name='blog[archived]' value='1' <?php if ( $details['archived'] == '1' ) echo 'checked="checked"'; ?> /> <?php _e('Yes') ?>
-                                                                        <input type='radio' style='width:20px;' name='blog[archived]' value='0' <?php if ( $details['archived'] == '0' ) echo 'checked="checked"'; ?> /> <?php _e('No') ?>
</del><ins>+                                                                        <input type='radio' style='width:20px;' name='blog[archived]' value='1' <?php if ( $details->archived == '1' ) echo 'checked="checked"'; ?> /> <?php _e('Yes') ?>
+                                                                        <input type='radio' style='width:20px;' name='blog[archived]' value='0' <?php if ( $details->archived == '0' ) echo 'checked="checked"'; ?> /> <?php _e('No') ?>
</ins><span class="cx">                                                                 </td>
</span><span class="cx">                                                         </tr>
</span><span class="cx">                                                         <tr class="form-field">
</span><span class="cx">                                                                 <th scope="row"><?php _e( 'Mature' ); ?></th>
</span><span class="cx">                                                                 <td>
</span><del>-                                                                        <input type='radio' style='width:20px;' name='blog[mature]' value='1' <?php if ( $details['mature'] == '1' ) echo 'checked="checked"'; ?> /> <?php _e('Yes') ?>
-                                                                        <input type='radio' style='width:20px;' name='blog[mature]' value='0' <?php if ( $details['mature'] == '0' ) echo 'checked="checked"'; ?> /> <?php _e('No') ?>
</del><ins>+                                                                        <input type='radio' style='width:20px;' name='blog[mature]' value='1' <?php if ( $details->mature == '1' ) echo 'checked="checked"'; ?> /> <?php _e('Yes') ?>
+                                                                        <input type='radio' style='width:20px;' name='blog[mature]' value='0' <?php if ( $details->mature == '0' ) echo 'checked="checked"'; ?> /> <?php _e('No') ?>
</ins><span class="cx">                                                                 </td>
</span><span class="cx">                                                         </tr>
</span><span class="cx">                                                         <tr class="form-field">
</span><span class="cx">                                                                 <th scope="row"><?php _e( 'Spam' ); ?></th>
</span><span class="cx">                                                                 <td>
</span><del>-                                                                        <input type='radio' style='width:20px;' name='blog[spam]' value='1' <?php if ( $details['spam'] == '1' ) echo 'checked="checked"'; ?> /> <?php _e('Yes') ?>
-                                                                        <input type='radio' style='width:20px;' name='blog[spam]' value='0' <?php if ( $details['spam'] == '0' ) echo 'checked="checked"'; ?> /> <?php _e('No') ?>
</del><ins>+                                                                        <input type='radio' style='width:20px;' name='blog[spam]' value='1' <?php if ( $details->spam == '1' ) echo 'checked="checked"'; ?> /> <?php _e('Yes') ?>
+                                                                        <input type='radio' style='width:20px;' name='blog[spam]' value='0' <?php if ( $details->spam == '0' ) echo 'checked="checked"'; ?> /> <?php _e('No') ?>
</ins><span class="cx">                                                                 </td>
</span><span class="cx">                                                         </tr>
</span><span class="cx">                                                         <tr class="form-field">
</span><span class="cx">                                                                 <th scope="row"><?php _e( 'Deleted' ); ?></th>
</span><span class="cx">                                                                 <td>
</span><del>-                                                                        <input type='radio' style='width:20px;' name='blog[deleted]' value='1' <?php if ( $details['deleted'] == '1' ) echo 'checked="checked"'; ?> /> <?php _e('Yes') ?>
-                                                                        <input type='radio' style='width:20px;' name='blog[deleted]' value='0' <?php if ( $details['deleted'] == '0' ) echo 'checked="checked"'; ?> /> <?php _e('No') ?>
</del><ins>+                                                                        <input type='radio' style='width:20px;' name='blog[deleted]' value='1' <?php if ( $details->deleted == '1' ) echo 'checked="checked"'; ?> /> <?php _e('Yes') ?>
+                                                                        <input type='radio' style='width:20px;' name='blog[deleted]' value='0' <?php if ( $details->deleted == '0' ) echo 'checked="checked"'; ?> /> <?php _e('No') ?>
</ins><span class="cx">                                                                 </td>
</span><span class="cx">                                                         </tr>
</span><span class="cx">                                                 </table>
</span><span class="lines">@@ -153,31 +153,30 @@
</span><span class="cx">                                 <table class="form-table">
</span><span class="cx">                                                         <?php
</span><span class="cx">                                                         $editblog_default_role = 'subscriber';
</span><del>-                                                        foreach ( $options as $key => $val ) {
-                                                                if ( $val['option_name'] == 'default_role' ) {
-                                                                        $editblog_default_role = $val['option_value'];
-                                                                }
</del><ins>+                                                        foreach ( $options as $option ) {
+                                                                if ( $option->option_name == 'default_role' )
+                                                                        $editblog_default_role = $option->option_value;
</ins><span class="cx">                                                                 $disabled = '';
</span><del>-                                                                if ( is_serialized($val['option_value']) ) {
-                                                                        if ( is_serialized_string($val['option_value']) ) {
-                                                                                $val['option_value'] = wp_specialchars(maybe_unserialize($val['option_value']), 'single');
</del><ins>+                                                                if ( is_serialized($option->option_value) ) {
+                                                                        if ( is_serialized_string($option->option_value) ) {
+                                                                                $option->option_value = wp_specialchars(maybe_unserialize($option->option_value), 'single');
</ins><span class="cx">                                                                         } else {
</span><del>-                                                                                $val['option_value'] = "SERIALIZED DATA";
</del><ins>+                                                                                $option->option_value = "SERIALIZED DATA";
</ins><span class="cx">                                                                                 $disabled = ' disabled="disabled"';
</span><span class="cx">                                                                         }
</span><span class="cx">                                                                 }
</span><del>-                                                                if ( stristr($val['option_value'], "\r") || stristr($val['option_value'], "\n") || stristr($val['option_value'], "\r\n") ) {
</del><ins>+                                                                if ( stristr($option->option_value, "\r") || stristr($option->option_value, "\n") || stristr($option->option_value, "\r\n") ) {
</ins><span class="cx">                                                                 ?>
</span><span class="cx">                                                                         <tr class="form-field">
</span><del>-                                                                                <th scope="row"><?php echo ucwords( str_replace( "_", " ", $val['option_name'] ) ) ?></th>
-                                                                                <td><textarea rows="5" cols="40" name="option[<?php echo $val['option_name'] ?>]" type="text" id="<?php echo $val['option_name'] ?>"<?php echo $disabled ?>><?php echo wp_specialchars( stripslashes( $val['option_value'] ), 1 ) ?></textarea></td>
</del><ins>+                                                                                <th scope="row"><?php echo ucwords( str_replace( "_", " ", $option->option_name ) ) ?></th>
+                                                                                <td><textarea rows="5" cols="40" name="option[<?php echo esc_attr($option->option_name) ?>]" type="text" id="<?php echo esc_attr($option->option_name) ?>"<?php echo $disabled ?>><?php echo esc_html( $option->option_value ) ?></textarea></td>
</ins><span class="cx">                                                                         </tr>
</span><span class="cx">                                                                 <?php
</span><span class="cx">                                                                 } else {
</span><span class="cx">                                                                 ?>
</span><span class="cx">                                                                         <tr class="form-field">
</span><del>-                                                                                <th scope="row"><?php echo ucwords( str_replace( "_", " ", $val['option_name'] ) ) ?></th>
-                                                                                <td><input name="option[<?php echo $val['option_name'] ?>]" type="text" id="<?php echo $val['option_name'] ?>" value="<?php echo esc_attr( stripslashes( $val['option_value'] ), 1 ) ?>" size="40" <?php echo $disabled ?> /></td>
</del><ins>+                                                                                <th scope="row"><?php echo ucwords( str_replace( "_", " ", $option->option_name ) ) ?></th>
+                                                                                <td><input name="option[<?php echo esc_attr($option->option_name) ?>]" type="text" id="<?php echo esc_attr($option->option_name) ?>" value="<?php echo esc_attr( $option->option_value ) ?>" size="40" <?php echo $disabled ?> /></td>
</ins><span class="cx">                                                                         </tr>
</span><span class="cx">                                                                 <?php
</span><span class="cx">                                                                 }
</span><span class="lines">@@ -194,17 +193,16 @@
</span><span class="cx">                                         $themes = get_themes();
</span><span class="cx">                                         $blog_allowed_themes = wpmu_get_blog_allowedthemes( $id );
</span><span class="cx">                                         $allowed_themes = get_site_option( "allowedthemes" );
</span><del>-                                        if ( $allowed_themes == false ) {
</del><ins>+                                        if ( ! $allowed_themes )
</ins><span class="cx">                                                 $allowed_themes = array_keys( $themes );
</span><del>-                                        }
</del><span class="cx">                                         $out = '';
</span><del>-                                        foreach( $themes as $key => $theme ) {
</del><ins>+                                        foreach ( $themes as $key => $theme ) {
</ins><span class="cx">                                                 $theme_key = wp_specialchars( $theme['Stylesheet'] );
</span><del>-                                                if ( isset($allowed_themes[$theme_key] ) == false ) {
</del><ins>+                                                if ( ! isset($allowed_themes[$theme_key] ) ) {
</ins><span class="cx">                                                         $checked = ( isset($blog_allowed_themes[ $theme_key ]) ) ? 'checked="checked"' : '';
</span><span class="cx">                                                         $out .= '<tr class="form-field form-required">
</span><del>-                                                                        <th title="'.htmlspecialchars( $theme["Description"] ).'" scope="row">'.$key.'</th>
-                                                                        <td><input name="theme['.$theme_key.']" type="checkbox" style="width:20px;" value="on" '.$checked.'/>' . __( 'Active' ) . '</td>
</del><ins>+                                                                        <th title="' . esc_attr( $theme["Description"] ).'" scope="row">' . esc_html($key) . '</th>
+                                                                        <td><input name="theme[' . esc_attr($theme_key) . ']" type="checkbox" style="width:20px;" value="on" '.$checked.'/>' . __( 'Active' ) . '</td>
</ins><span class="cx">                                                                 </tr>';
</span><span class="cx">                                                 }
</span><span class="cx">                                         }
</span><span class="lines">@@ -212,10 +210,10 @@
</span><span class="cx">                                         if ( $out != '' ) {
</span><span class="cx">                         ?>
</span><span class="cx">                         <div id="blogedit_blogthemes" class="postbox">
</span><del>-                        <h3 class='hndle'><span><?php _e('Blog Themes'); ?></span></h3>
</del><ins>+                        <h3 class='hndle'><span><?php esc_html_e('Blog Themes'); ?></span></h3>
</ins><span class="cx">                         <div class="inside">
</span><span class="cx">                                 <table class="form-table">
</span><del>-                                        <tr><th style="font-weight:bold;"><?php _e('Theme'); ?></th></tr>
</del><ins>+                                        <tr><th style="font-weight:bold;"><?php esc_html_e('Theme'); ?></th></tr>
</ins><span class="cx">                                         <?php echo $out; ?>
</span><span class="cx">                                 </table>
</span><span class="cx">                                 <p class="submit" style="margin:-15px 0 -5px 230px;"><input type="submit" name="Submit" value="<?php esc_attr_e('Update Options') ?>" /></p>
</span><span class="lines">@@ -241,7 +239,7 @@
</span><span class="cx">                                                                 ?>
</span><span class="cx">                                                                 <td>
</span><span class="cx">                                                                         <select name="role[<?php echo $val->user_id ?>]" id="new_role"><?php
</span><del>-                                                                                foreach( $editblog_roles as $role => $role_assoc ){
</del><ins>+                                                                                foreach ( $editblog_roles as $role => $role_assoc ){
</ins><span class="cx">                                                                                         $name = translate_with_context($role_assoc['name']);
</span><span class="cx">                                                                                         $selected = ( $role == $existing_role ) ? 'selected="selected"' : '';
</span><span class="cx">                                                                                         echo "<option {$selected} value=\"" . esc_attr($role) . "\">{$name}</option>";
</span><span class="lines">@@ -250,10 +248,10 @@
</span><span class="cx">                                                                         </select>
</span><span class="cx">                                                                 </td>
</span><span class="cx">                                                                 <td>
</span><del>-                                                                                <input type='text' name='user_password[<?php echo $val->user_id ?>]' />
</del><ins>+                                                                                <input type='text' name='user_password[<?php echo esc_attr($val->user_id) ?>]' />
</ins><span class="cx">                                                                 </td>
</span><span class="cx">                                                                 <?php
</span><del>-                                                                echo '<td><input title="' . __('Click to remove user') . '" type="checkbox" name="blogusers[' . $val->user_id . ']" /></td>';
</del><ins>+                                                                echo '<td><input title="' . __('Click to remove user') . '" type="checkbox" name="blogusers[' . esc_attr($val->user_id) . ']" /></td>';
</ins><span class="cx">                                                         } else {
</span><span class="cx">                                                                 echo "<td><strong>" . __ ('N/A') . "</strong></td><td><strong>" . __ ('N/A') . "</strong></td><td><strong>" . __('N/A') . "</strong></td>";
</span><span class="cx">                                                         }
</span><span class="lines">@@ -448,22 +446,35 @@
</span><span class="cx">                         <?php
</span><span class="cx">                         if ( $blog_list ) {
</span><span class="cx">                                 $bgcolor = $class = '';
</span><del>-                                $status_list = array( "archived" => "#fee", "spam" => "#faa", "deleted" => "#f55" );
</del><ins>+                                $status_list = array( 'archived' => array( '#fee', __('Archived') ), 'spam' => array( '#faa', __('Spam') ), 'deleted' => array( '#f55', __('Deleted') ) );
</ins><span class="cx">                                 foreach ( $blog_list as $blog ) {
</span><span class="cx">                                         $class = ('alternate' == $class) ? '' : 'alternate';
</span><span class="cx">                                         reset( $status_list );
</span><span class="cx">
</span><del>-                                        $bgcolour = "";
</del><ins>+                                        $bgcolour = '';
+                                        $blog_states = array();
</ins><span class="cx">                                         foreach ( $status_list as $status => $col ) {
</span><span class="cx">                                                 if ( get_blog_status( $blog['blog_id'], $status ) == 1 ) {
</span><del>-                                                        $bgcolour = "style='background: $col'";
</del><ins>+                                                        $bgcolour = "style='background: {$col[0]}'";
+                                                        $blog_states[] = $col[1];
</ins><span class="cx">                                                 }
</span><span class="cx">                                         }
</span><ins>+                                        $blog_state = '';
+                                        if ( ! empty($blog_states) ) {
+                                                $state_count = count($blog_states);
+                                                $i = 0;
+                                                $blog_state .= ' - ';
+                                                foreach ( $blog_states as $state ) {
+                                                        ++$i;
+                                                        ( $i == $state_count ) ? $sep = '' : $sep = ', ';
+                                                        $blog_state .= "<span class='post-state'>$state$sep</span>";
+                                                }
+                                        }
</ins><span class="cx">                                         echo "<tr $bgcolour class='$class'>";
</span><span class="cx">
</span><span class="cx">                                         $blogname = ( is_subdomain_install() ) ? str_replace('.'.$current_site->domain, '', $blog['domain']) : $blog['path'];
</span><span class="cx">                                         foreach ( $posts_columns as $column_name=>$column_display_name ) {
</span><del>-                                                switch($column_name) {
</del><ins>+                                                switch ( $column_name ) {
</ins><span class="cx">                                                         case 'id': ?>
</span><span class="cx">                                                                 <th scope="row" class="check-column">
</span><span class="cx">                                                                         <input type='checkbox' id='blog_<?php echo $blog['blog_id'] ?>' name='allblogs[]' value='<?php echo esc_attr($blog['blog_id']) ?>' />
</span><span class="lines">@@ -476,36 +487,36 @@
</span><span class="cx">
</span><span class="cx">                                                         case 'blogname': ?>
</span><span class="cx">                                                                 <td valign="top">
</span><del>-                                                                        <a href="ms-sites.php?action=editblog&amp;id=<?php echo $blog['blog_id'] ?>" class="edit"><?php echo $blogname; ?></a>
</del><ins>+                                                                        <a href="ms-sites.php?action=editblog&amp;id=<?php echo $blog['blog_id'] ?>" class="edit"><?php echo $blogname; echo $blog_state?></a>
</ins><span class="cx">                                                                         <br/>
</span><span class="cx">                                                                         <?php
</span><del>-                                                                        $controlActions        = array();
-                                                                        $controlActions[]        = '<a href="ms-sites.php?action=editblog&amp;id=' . $blog['blog_id'] . '" class="edit">' . __('Edit') . '</a>';
-                                                                        $controlActions[]        = "<a href='{$protocol}{$blog['domain']}{$blog['path']}wp-admin/' class='edit'>" . __('Backend') . '</a>';
</del><ins>+                                                                        $actions        = array();
+                                                                        $actions[]        = '<a href="ms-sites.php?action=editblog&amp;id=' . $blog['blog_id'] . '" class="edit">' . __('Edit') . '</a>';
+                                                                        $actions[]        = "<a href='{$protocol}{$blog['domain']}{$blog['path']}wp-admin/' class='edit'>" . __('Backend') . '</a>';
</ins><span class="cx">
</span><span class="cx">                                                                         if ( get_blog_status( $blog['blog_id'], "deleted" ) == '1' )
</span><del>-                                                                                $controlActions[]        = '<a class="delete" href="ms-edit.php?action=confirm&amp;action2=activateblog&amp;ref=' . urlencode( $_SERVER['REQUEST_URI'] ) . '&amp;id=' . $blog['blog_id'] . '&amp;msg=' . urlencode( sprintf( __( "You are about to activate the blog %s" ), $blogname ) ) . '">' . __('Activate') . '</a>';
</del><ins>+                                                                                $actions[]        = '<a class="delete" href="ms-edit.php?action=confirm&amp;action2=activateblog&amp;ref=' . urlencode( $_SERVER['REQUEST_URI'] ) . '&amp;id=' . $blog['blog_id'] . '&amp;msg=' . urlencode( sprintf( __( "You are about to activate the blog %s" ), $blogname ) ) . '">' . __('Activate') . '</a>';
</ins><span class="cx">                                                                         else
</span><del>-                                                                                $controlActions[]        = '<a class="delete" href="ms-edit.php?action=confirm&amp;action2=deactivateblog&amp;ref=' . urlencode( $_SERVER['REQUEST_URI'] ) . '&amp;id=' . $blog['blog_id'] . '&amp;msg=' . urlencode( sprintf( __( "You are about to deactivate the blog %s" ), $blogname ) ) . '">' . __('Deactivate') . '</a>';
</del><ins>+                                                                                $actions[]        = '<a class="delete" href="ms-edit.php?action=confirm&amp;action2=deactivateblog&amp;ref=' . urlencode( $_SERVER['REQUEST_URI'] ) . '&amp;id=' . $blog['blog_id'] . '&amp;msg=' . urlencode( sprintf( __( "You are about to deactivate the blog %s" ), $blogname ) ) . '">' . __('Deactivate') . '</a>';
</ins><span class="cx">
</span><span class="cx">                                                                         if ( get_blog_status( $blog['blog_id'], "archived" ) == '1' )
</span><del>-                                                                                $controlActions[]        = '<a class="delete" href="ms-edit.php?action=confirm&amp;action2=unarchiveblog&amp;id=' . $blog['blog_id'] . '&amp;msg=' . urlencode( sprintf( __( "You are about to unarchive the blog %s" ), $blogname ) ) . '">' . __('Unarchive') . '</a>';
</del><ins>+                                                                                $actions[]        = '<a class="delete" href="ms-edit.php?action=confirm&amp;action2=unarchiveblog&amp;id=' . $blog['blog_id'] . '&amp;msg=' . urlencode( sprintf( __( "You are about to unarchive the blog %s" ), $blogname ) ) . '">' . __('Unarchive') . '</a>';
</ins><span class="cx">                                                                         else
</span><del>-                                                                                $controlActions[]        = '<a class="delete" href="ms-edit.php?action=confirm&amp;action2=archiveblog&amp;id=' . $blog['blog_id'] . '&amp;msg=' . urlencode( sprintf( __( "You are about to archive the blog %s" ), $blogname ) ) . '">' . __('Archive') . '</a>';
</del><ins>+                                                                                $actions[]        = '<a class="delete" href="ms-edit.php?action=confirm&amp;action2=archiveblog&amp;id=' . $blog['blog_id'] . '&amp;msg=' . urlencode( sprintf( __( "You are about to archive the blog %s" ), $blogname ) ) . '">' . __('Archive') . '</a>';
</ins><span class="cx">
</span><span class="cx">                                                                         if ( get_blog_status( $blog['blog_id'], "spam" ) == '1' )
</span><del>-                                                                                $controlActions[]        = '<a class="delete" href="ms-edit.php?action=confirm&amp;action2=unspamblog&amp;id=' . $blog['blog_id'] . '&amp;msg=' . urlencode( sprintf( __( "You are about to unspam the blog %s" ), $blogname ) ) . '">' . __('Not Spam') . '</a>';
</del><ins>+                                                                                $actions[]        = '<a class="delete" href="ms-edit.php?action=confirm&amp;action2=unspamblog&amp;id=' . $blog['blog_id'] . '&amp;msg=' . urlencode( sprintf( __( "You are about to unspam the blog %s" ), $blogname ) ) . '">' . __('Not Spam') . '</a>';
</ins><span class="cx">                                                                         else
</span><del>-                                                                                $controlActions[]        = '<a class="delete" href="ms-edit.php?action=confirm&amp;action2=spamblog&amp;id=' . $blog['blog_id'] . '&amp;msg=' . urlencode( sprintf( __( "You are about to mark the blog %s as spam" ), $blogname ) ) . '">' . __("Spam") . '</a>';
</del><ins>+                                                                                $actions[]        = '<a class="delete" href="ms-edit.php?action=confirm&amp;action2=spamblog&amp;id=' . $blog['blog_id'] . '&amp;msg=' . urlencode( sprintf( __( "You are about to mark the blog %s as spam" ), $blogname ) ) . '">' . __("Spam") . '</a>';
</ins><span class="cx">
</span><del>-                                                                        $controlActions[]        = '<a class="delete" href="ms-edit.php?action=confirm&amp;action2=deleteblog&amp;id=' . $blog['blog_id'] . '&amp;msg=' . urlencode( sprintf( __( "You are about to delete the blog %s" ), $blogname ) ) . '">' . __("Delete") . '</a>';
</del><ins>+                                                                        $actions[]        = '<a class="delete" href="ms-edit.php?action=confirm&amp;action2=deleteblog&amp;id=' . $blog['blog_id'] . '&amp;msg=' . urlencode( sprintf( __( "You are about to delete the blog %s" ), $blogname ) ) . '">' . __("Delete") . '</a>';
</ins><span class="cx">
</span><del>-                                                                        $controlActions[]        = "<a href='http://{$blog['domain']}{$blog['path']}' rel='permalink'>" . __('Visit') . '</a>';
</del><ins>+                                                                        $actions[]        = "<a href='http://{$blog['domain']}{$blog['path']}' rel='permalink'>" . __('Visit') . '</a>';
</ins><span class="cx">                                                                         ?>
</span><span class="cx">
</span><del>-                                                                        <?php if (count($controlActions)) : ?>
</del><ins>+                                                                        <?php if ( count($actions) ) : ?>
</ins><span class="cx">                                                                         <div class="row-actions">
</span><del>-                                                                                <?php echo implode(' | ', $controlActions); ?>
</del><ins>+                                                                                <?php echo implode(' | ', $actions); ?>
</ins><span class="cx">                                                                         </div>
</span><span class="cx">                                                                         <?php endif; ?>
</span><span class="cx">                                                                 </td>
</span><span class="lines">@@ -535,12 +546,10 @@
</span><span class="cx">                                                                                         $blogusers = array_slice( $blogusers, 0, 5 );
</span><span class="cx">                                                                                         $blogusers_warning = __( 'Only showing first 5 users.' ) . ' <a href="' . $protocol . $blog[ 'domain' ] . $blog[ 'path' ] . 'wp-admin/users.php">' . __( 'More' ) . '</a>';
</span><span class="cx">                                                                                 }
</span><del>-                                                                                foreach ( $blogusers as $key => $val ) {
</del><ins>+                                                                                foreach ( $blogusers as $key => $val )
</ins><span class="cx">                                                                                         echo '<a href="user-edit.php?user_id=' . $val->user_id . '">' . $val->user_login . '</a> ('.$val->user_email.')<br />';
</span><del>-                                                                                }
-                                                                                if ( $blogusers_warning != '' ) {
</del><ins>+                                                                                if ( $blogusers_warning != '' )
</ins><span class="cx">                                                                                         echo '<strong>' . $blogusers_warning . '</strong><br />';
</span><del>-                                                                                }
</del><span class="cx">                                                                         }
</span><span class="cx">                                                                         ?>
</span><span class="cx">                                                                 </td>
</span></span></pre>
</div>
</div>
</body>
</html>