]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-admin/includes/class-wp-ms-sites-list-table.php
Wordpress 3.7
[autoinstalls/wordpress.git] / wp-admin / includes / class-wp-ms-sites-list-table.php
index 73ce88989a37a6d93935e677313eb9632a4fd0c2..edc1146a975a6afafe7b289aebd78cf9dadd3037 100644 (file)
@@ -9,9 +9,10 @@
  */
 class WP_MS_Sites_List_Table extends WP_List_Table {
 
-       function __construct() {
+       function __construct( $args = array() ) {
                parent::__construct( array(
                        'plural' => 'sites',
+                       'screen' => isset( $args['screen'] ) ? $args['screen'] : null,
                ) );
        }
 
@@ -28,7 +29,7 @@ class WP_MS_Sites_List_Table extends WP_List_Table {
 
                $pagenum = $this->get_pagenum();
 
-               $s = isset( $_REQUEST['s'] ) ? stripslashes( trim( $_REQUEST[ 's' ] ) ) : '';
+               $s = isset( $_REQUEST['s'] ) ? wp_unslash( trim( $_REQUEST[ 's' ] ) ) : '';
                $wild = '';
                if ( false !== strpos($s, '*') ) {
                        $wild = '%';
@@ -213,7 +214,10 @@ class WP_MS_Sites_List_Table extends WP_List_Table {
                                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;
@@ -229,8 +233,11 @@ class WP_MS_Sites_List_Table extends WP_List_Table {
                                                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 )
-                                                               echo '<p>' . sprintf( _x( '%1$s &#8211; <em>%2$s</em>', '%1$s: site name. %2$s: site tagline.' ), get_blog_option( $blog['blog_id'], 'blogname' ), get_blog_option( $blog['blog_id'], 'blogdescription ' ) ) . '</p>';
+                                                       if ( 'list' != $mode ) {
+                                                               switch_to_blog( $blog['blog_id'] );
+                                                               echo '<p>' . sprintf( _x( '%1$s &#8211; <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(
@@ -251,7 +258,7 @@ class WP_MS_Sites_List_Table extends WP_List_Table {
                                                                        $actions['deactivate']  = '<span class="activate"><a href="' . esc_url( wp_nonce_url( network_admin_url( 'sites.php?action=confirm&amp;action2=deactivateblog&amp;id=' . $blog['blog_id'] . '&amp;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&amp;action2=unarchiveblog&amp;id=' .  $blog['blog_id'] . '&amp;msg=' . urlencode( sprintf( __( 'You are about to unarchive the site %s.' ), $blogname ) ) ), 'confirm') ) . '">' . __( 'Unarchive' ) . '</a></span>';
+                                                                       $actions['unarchive']   = '<span class="archive"><a href="' . esc_url( wp_nonce_url( network_admin_url( 'sites.php?action=confirm&amp;action2=unarchiveblog&amp;id=' . $blog['blog_id'] . '&amp;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&amp;action2=archiveblog&amp;id=' . $blog['blog_id'] . '&amp;msg=' . urlencode( sprintf( __( 'You are about to archive the site %s.' ), $blogname ) ) ), 'confirm') ) . '">' . _x( 'Archive', 'verb; site' ) . '</a></span>';
 
@@ -264,7 +271,7 @@ class WP_MS_Sites_List_Table extends WP_List_Table {
                                                                        $actions['delete']      = '<span class="delete"><a href="' . esc_url( wp_nonce_url( network_admin_url( 'sites.php?action=confirm&amp;action2=deleteblog&amp;id=' . $blog['blog_id'] . '&amp;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>';
+                                                       $actions['visit']       = "<span class='view'><a href='" . esc_url( get_home_url( $blog['blog_id'], '/' ) ) . "' rel='permalink'>" . __( 'Visit' ) . '</a></span>';
 
                                                        $actions = apply_filters( 'manage_sites_action_links', array_filter( $actions ), $blog['blog_id'], $blogname );
                                                        echo $this->row_actions( $actions );
@@ -337,5 +344,3 @@ class WP_MS_Sites_List_Table extends WP_List_Table {
                }
        }
 }
-
-?>