Ticket #37799: 37799.2.diff
File 37799.2.diff, 2.6 KB (added by , 8 years ago) |
---|
-
wp-admin/network/upgrade.php
41 41 42 42 $action = isset($_GET['action']) ? $_GET['action'] : 'show'; 43 43 44 $total_sites = get_blog_count(); 45 44 46 switch ( $action ) { 45 47 case "upgrade": 46 48 $n = ( isset($_GET['n']) ) ? intval($_GET['n']) : 0; … … 65 67 'orderby' => 'id', 66 68 ) ); 67 69 if ( empty( $site_ids ) ) { 68 echo '<p>' . __( 'All done!' ) . '</p>'; 70 echo '<p>' . esc_html__( 'No more sites found.' ) . '</p>'; 71 // If a site fails to be upgraded, the script will just stop, so the $n has always the total so far 72 echo '<p>' . esc_html( sprintf( _n( '%1$s site have been upgraded.', '%1$s sites have been upgraded.', $n ), $n ) ) . '</p>'; 69 73 break; 70 74 } 75 71 76 echo "<ul>"; 72 77 foreach ( (array) $site_ids as $site_id ) { 73 78 switch_to_blog( $site_id ); … … 90 95 '<em>' . $response->get_error_message() . '</em>' 91 96 ) ); 92 97 } 93 94 98 /** 95 99 * Fires after the Multisite DB upgrade for each site is complete. 96 100 * … … 109 113 do_action( 'wpmu_upgrade_site', $site_id ); 110 114 } 111 115 echo "</ul>"; 112 ?><p><?php _e( 'If your browser doesn’t start loading the next page automatically, click this link:' ); ?> <a class="button" href="upgrade.php?action=upgrade&n=<?php echo ($n + 5) ?>"><?php _e("Next Sites"); ?></a></p> 116 117 $top_boundery = $n + 5; 118 if ( $total_sites < $top_boundery ) { 119 $top_boundery = $total_sites; 120 } 121 $lower_boundery = $n + 1; 122 123 ?> 124 <p><?php echo esc_html( sprintf( __( 'Upgrading sites %1$d-%2$d out of %3$d' ),$lower_boundery , $top_boundery , $total_sites ) ); ?></p> 125 <p><?php esc_html_e( 'If your browser doesn’t start loading the next page automatically, click this link:' ); ?> <a class="button" href="upgrade.php?action=upgrade&n=<?php echo ( $top_boundery ) ?>"><?php esc_html_e( 'Next Sites' ); ?></a></p> 126 127 113 128 <script type="text/javascript"> 114 129 <!-- 115 130 function nextpage() { 116 location.href = "upgrade.php?action=upgrade&n=<?php echo ( $n + 5) ?>";131 location.href = "upgrade.php?action=upgrade&n=<?php echo ( $top_boundery ) ?>"; 117 132 } 118 133 setTimeout( "nextpage()", 250 ); 119 134 //--> … … 128 143 <?php endif; ?> 129 144 130 145 <p><?php _e( 'The database update process may take a little while, so please be patient.' ); ?></p> 146 <p><?php echo esc_html( sprintf( __( 'There are %1$s sites.' ), $total_sites ) ); ?></p> 131 147 <p><a class="button button-primary" href="upgrade.php?action=upgrade"><?php _e( 'Upgrade Network' ); ?></a></p> 132 148 <?php 133 149 /**