Changes from trunk/wp-admin/update-core.php at r17048 to branches/3.0/wp-admin/update-core.php at r15282
- File:
-
- 1 edited
-
branches/3.0/wp-admin/update-core.php (modified) (23 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/3.0/wp-admin/update-core.php
r17048 r15282 10 10 require_once('./admin.php'); 11 11 12 if ( is_multisite() && ! is_network_admin() ) { 13 wp_redirect( network_admin_url( 'update-core.php' ) ); 14 exit(); 15 } 16 17 if ( ! current_user_can( 'update_core' ) ) 18 wp_die( __( 'You do not have sufficient permissions to update this site.' ) ); 12 if ( ! current_user_can('update_plugins') ) 13 wp_die(__('You do not have sufficient permissions to update plugins for this site.')); 19 14 20 15 function list_core_update( $update ) { … … 64 59 echo '<input name="locale" value="'. esc_attr($update->locale) .'" type="hidden"/>'; 65 60 if ( $show_buttons ) { 66 submit_button( $submit, 'button', 'upgrade', false );67 echo ' <a href="' . esc_url($update->package) . '" class="button">' . $download . '</a> ';61 echo '<input id="upgrade" class="button" type="submit" value="' . esc_attr($submit) . '" name="upgrade" /> '; 62 echo '<a href="' . esc_url($update->package) . '" class="button">' . $download . '</a> '; 68 63 } 69 64 if ( 'en_US' != $update->locale ) 70 65 if ( !isset( $update->dismissed ) || !$update->dismissed ) 71 submit_button( __('Hide this update'), 'button', 'dismiss', false );66 echo '<input id="dismiss" class="button" type="submit" value="' . esc_attr__('Hide this update') . '" name="dismiss" />'; 72 67 else 73 submit_button( __('Bring back this update'), 'button', 'undismiss', false );68 echo '<input id="undismiss" class="button" type="submit" value="' . esc_attr__('Bring back this update') . '" name="undismiss" />'; 74 69 echo '</p>'; 75 70 if ( 'en_US' != $update->locale && ( !isset($wp_local_package) || $wp_local_package != $update->locale ) ) 76 71 echo '<p class="hint">'.__('This localized version contains both the translation and various other localization fixes. You can skip upgrading if you want to keep your current translation.').'</p>'; 77 72 else if ( 'en_US' == $update->locale && get_locale() != 'en_US' ) { 78 echo '<p class="hint">'.sprintf( __('You are about to install WordPress %s <strong>in English (US).</strong> There is a chance this update will break your translation. You may prefer to wait for the localized version to be released.'), $update->current ).'</p>';73 echo '<p class="hint">'.sprintf( __('You are about to install WordPress %s <strong>in English.</strong> There is a chance this upgrade will break your translation. You may prefer to wait for the localized version to be released.'), $update->current ).'</p>'; 79 74 } 80 75 echo '</form>'; … … 127 122 if ( $upgrade_error ) { 128 123 echo '<div class="error"><p>'; 129 if ( $upgrade_error == 'themes' ) 130 _e('Please select one or more themes to update.'); 131 else 132 _e('Please select one or more plugins to update.'); 124 _e('Please select one or more plugins to upgrade.'); 133 125 echo '</p></div>'; 134 126 } 135 136 echo '<p>';137 /* translators: %1 date, %2 time. */138 printf( __('Last checked on %1$s at %2$s.'), date_i18n( get_option( 'date_format' ) ), date_i18n( get_option( 'time_format' ) ) );139 echo ' <a class="button" href="' . esc_url( self_admin_url('update-core.php') ) . '">' . __( 'Check Again' ) . '</a>';140 echo '</p>';141 127 142 128 if ( !isset($updates[0]->response) || 'latest' == $updates[0]->response ) { … … 145 131 echo '</h3>'; 146 132 } else { 147 echo '<div class="updated inline"><p>';148 _e('<strong>Important:</strong> before updating, please <a href="http://codex.wordpress.org/WordPress_Backups">back up your database and files</a>. For help with updates, visit the <a href="http://codex.wordpress.org/Updating_WordPress">Updating WordPress</a> Codex page.');133 echo '<div class="updated"><p>'; 134 _e('<strong>Important:</strong> before updating, please <a href="http://codex.wordpress.org/WordPress_Backups">backup your database and files</a>. For help with updates, visit the <a href="http://codex.wordpress.org/Updating_WordPress">Updating WordPress</a> Codex page.'); 149 135 echo '</p></div>'; 150 136 … … 157 143 $alternate = true; 158 144 foreach( (array) $updates as $update ) { 159 echo '<li>'; 145 $class = $alternate? ' class="alternate"' : ''; 146 $alternate = !$alternate; 147 echo "<li $class>"; 160 148 list_core_update( $update ); 161 149 echo '</li>'; … … 165 153 dismissed_updates(); 166 154 167 if ( current_user_can( 'update_plugins' ) ) 168 list_plugin_updates(); 169 if ( current_user_can( 'update_themes' ) ) 170 list_theme_updates(); 155 list_plugin_updates(); 156 list_theme_updates(); 171 157 do_action('core_upgrade_preamble'); 172 158 echo '</div>'; … … 243 229 <tr class='active'> 244 230 <th scope='row' class='check-column'><input type='checkbox' name='checked[]' value='" . esc_attr($plugin_file) . "' /></th> 245 <td ><strong>{$plugin_data->Name}</strong><br />" . sprintf(__('You have version %1$s installed. Update to %2$s.'), $plugin_data->Version, $plugin_data->update->new_version) . $compat . $upgrade_notice . "</td>231 <td class='plugin-title'><strong>{$plugin_data->Name}</strong>" . sprintf(__('You have version %1$s installed. Update to %2$s.'), $plugin_data->Version, $plugin_data->update->new_version) . $compat . $upgrade_notice . "</td> 246 232 </tr>"; 247 233 } … … 267 253 <h3><?php _e( 'Themes' ); ?></h3> 268 254 <p><?php _e( 'The following themes have new versions available. Check the ones you want to update and then click “Update Themes”.' ); ?></p> 269 <p><?php printf( __('<strong>Please Note:</strong> Any customizations you have made to the mefiles will be lost. Please consider using <a href="%s">child themes</a> for modifications.'), _x('http://codex.wordpress.org/Child_Themes', 'Link used in suggestion to use child themes in GUU') ); ?></p>255 <p><?php printf( __('<strong>Please Note:</strong> Any customizations you have made to the Themes files will be lost. Please consider using <a href="%s">child themes</a> for modifications.'), _x('http://codex.wordpress.org/Child_Themes', 'Link used in suggestion to use child themes in GUU') ); ?></p> 270 256 <form method="post" action="<?php echo $form_action; ?>" name="upgrade-themes" class="upgrade"> 271 257 <?php wp_nonce_field('upgrade-core'); ?> … … 335 321 ?> 336 322 <div class="wrap"> 337 <?php screen_icon( 'tools'); ?>323 <?php screen_icon(); ?> 338 324 <h2><?php _e('Update WordPress'); ?></h2> 339 325 <?php … … 356 342 } else { 357 343 show_message( __('WordPress updated successfully') ); 358 show_message( '< a href="' . esc_url( self_admin_url() ) . '">' . __('Go to Dashboard') . '</a>' );344 show_message( '<strong>' . __('Actions:') . '</strong> <a href="' . esc_url( admin_url() ) . '">' . __('Go to Dashboard') . '</a>' ); 359 345 } 360 346 echo '</div>'; … … 369 355 dismiss_core_update( $update ); 370 356 wp_redirect( wp_nonce_url('update-core.php?action=upgrade-core', 'upgrade-core') ); 371 exit;372 357 } 373 358 … … 380 365 undismiss_core_update( $version, $locale ); 381 366 wp_redirect( wp_nonce_url('update-core.php?action=upgrade-core', 'upgrade-core') ); 382 exit;383 367 } 384 368 … … 390 374 391 375 $upgrade_error = false; 392 if ( ( 'do-theme-upgrade' == $action || ( 'do-plugin-upgrade' == $action && ! isset( $_GET['plugins'] ) ) ) 393 && ! isset( $_POST['checked'] ) ) { 394 $upgrade_error = $action == 'do-theme-upgrade' ? 'themes' : 'plugins'; 376 if ( 'do-plugin-upgrade' == $action && !isset($_GET['plugins']) && !isset($_POST['checked']) ) { 377 $upgrade_error = true; 395 378 $action = 'upgrade-core'; 396 379 } … … 402 385 '<p>' . __('This screen lets you update to the latest version of WordPress as well as update your themes and plugins from the WordPress.org repository. When updates are available, the number of available updates will appear in a bubble on the left hand menu as a notification. It is very important to keep your WordPress installation up to date for security reasons, so when you see a number appear, make sure you take the time to update, which is an easy process.') . '</p>' . 403 386 '<p>' . __('Updating your WordPress installation is a simple one-click procedure; just click on the Update button when it says a new version is available.') . '</p>' . 404 '<p>' . __('To up date themes or plugins from this screen, use the checkboxes to make your selection and click on the appropriate Update button. Check the box at the top of the Themes or Plugins section to select all and update them all at once.') . '</p>' .387 '<p>' . __('To upgrade themes or plugins from this screen, use the checkboxes to make your selection and click on the appropriate Update button. Check the box at the top of the Themes or Plugins section to select all and update them all at once.') . '</p>' . 405 388 '<p><strong>' . __('For more information:') . '</strong></p>' . 406 389 '<p>' . __('<a href="http://codex.wordpress.org/Dashboard_Updates_SubPanel" target="_blank">Documentation on Updating WordPress</a>') . '</p>' . … … 409 392 410 393 if ( 'upgrade-core' == $action ) { 411 412 394 wp_version_check(); 413 require_once( ABSPATH . 'wp-admin/admin-header.php');395 require_once('./admin-header.php'); 414 396 core_upgrade_preamble(); 415 416 397 } elseif ( 'do-core-upgrade' == $action || 'do-core-reinstall' == $action ) { 417 398 check_admin_referer('upgrade-core'); … … 424 405 do_undismiss_core_update(); 425 406 426 require_once( ABSPATH . 'wp-admin/admin-header.php');407 require_once('./admin-header.php'); 427 408 if ( 'do-core-reinstall' == $action ) 428 409 $reinstall = true; … … 434 415 435 416 } elseif ( 'do-plugin-upgrade' == $action ) { 436 437 if ( ! current_user_can( 'update_plugins' ) )438 wp_die( __( 'You do not have sufficient permissions to update this site.' ) );439 440 417 check_admin_referer('upgrade-core'); 441 418 … … 445 422 $plugins = (array) $_POST['checked']; 446 423 } else { 447 wp_redirect( admin_url('update-core.php'));424 wp_redirect('update-core.php'); 448 425 exit; 449 426 } … … 454 431 $title = __('Update Plugins'); 455 432 456 require_once( ABSPATH . 'wp-admin/admin-header.php');433 require_once('./admin-header.php'); 457 434 echo '<div class="wrap">'; 458 435 screen_icon('plugins'); … … 460 437 echo "<iframe src='$url' style='width: 100%; height: 100%; min-height: 750px;' frameborder='0'></iframe>"; 461 438 echo '</div>'; 462 463 439 } elseif ( 'do-theme-upgrade' == $action ) { 464 465 if ( ! current_user_can( 'update_themes' ) )466 wp_die( __( 'You do not have sufficient permissions to update this site.' ) );467 468 440 check_admin_referer('upgrade-core'); 469 441 … … 473 445 $themes = (array) $_POST['checked']; 474 446 } else { 475 wp_redirect( admin_url('update-core.php'));447 wp_redirect('update-core.php'); 476 448 exit; 477 449 } … … 482 454 $title = __('Update Themes'); 483 455 484 require_once( ABSPATH . 'wp-admin/admin-header.php');456 require_once('./admin-header.php'); 485 457 echo '<div class="wrap">'; 486 458 screen_icon('themes'); … … 490 462 } 491 463 492 include( ABSPATH . 'wp-admin/admin-footer.php');464 include('./admin-footer.php');
Note: See TracChangeset
for help on using the changeset viewer.