Changes from branches/3.0/wp-admin/update-core.php at r15282 to trunk/wp-admin/update-core.php at r17048
- File:
-
- 1 edited
-
trunk/wp-admin/update-core.php (modified) (23 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/update-core.php
r15282 r17048 10 10 require_once('./admin.php'); 11 11 12 if ( ! current_user_can('update_plugins') ) 13 wp_die(__('You do not have sufficient permissions to update plugins for this site.')); 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.' ) ); 14 19 15 20 function list_core_update( $update ) { … … 59 64 echo '<input name="locale" value="'. esc_attr($update->locale) .'" type="hidden"/>'; 60 65 if ( $show_buttons ) { 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> ';66 submit_button( $submit, 'button', 'upgrade', false ); 67 echo ' <a href="' . esc_url($update->package) . '" class="button">' . $download . '</a> '; 63 68 } 64 69 if ( 'en_US' != $update->locale ) 65 70 if ( !isset( $update->dismissed ) || !$update->dismissed ) 66 echo '<input id="dismiss" class="button" type="submit" value="' . esc_attr__('Hide this update') . '" name="dismiss" />';71 submit_button( __('Hide this update'), 'button', 'dismiss', false ); 67 72 else 68 echo '<input id="undismiss" class="button" type="submit" value="' . esc_attr__('Bring back this update') . '" name="undismiss" />';73 submit_button( __('Bring back this update'), 'button', 'undismiss', false ); 69 74 echo '</p>'; 70 75 if ( 'en_US' != $update->locale && ( !isset($wp_local_package) || $wp_local_package != $update->locale ) ) 71 76 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>'; 72 77 else if ( 'en_US' == $update->locale && get_locale() != 'en_US' ) { 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>';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>'; 74 79 } 75 80 echo '</form>'; … … 122 127 if ( $upgrade_error ) { 123 128 echo '<div class="error"><p>'; 124 _e('Please select one or more plugins to upgrade.'); 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.'); 125 133 echo '</p></div>'; 126 134 } 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>'; 127 141 128 142 if ( !isset($updates[0]->response) || 'latest' == $updates[0]->response ) { … … 131 145 echo '</h3>'; 132 146 } else { 133 echo '<div class="updated "><p>';134 _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.');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.'); 135 149 echo '</p></div>'; 136 150 … … 143 157 $alternate = true; 144 158 foreach( (array) $updates as $update ) { 145 $class = $alternate? ' class="alternate"' : ''; 146 $alternate = !$alternate; 147 echo "<li $class>"; 159 echo '<li>'; 148 160 list_core_update( $update ); 149 161 echo '</li>'; … … 153 165 dismissed_updates(); 154 166 155 list_plugin_updates(); 156 list_theme_updates(); 167 if ( current_user_can( 'update_plugins' ) ) 168 list_plugin_updates(); 169 if ( current_user_can( 'update_themes' ) ) 170 list_theme_updates(); 157 171 do_action('core_upgrade_preamble'); 158 172 echo '</div>'; … … 229 243 <tr class='active'> 230 244 <th scope='row' class='check-column'><input type='checkbox' name='checked[]' value='" . esc_attr($plugin_file) . "' /></th> 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>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> 232 246 </tr>"; 233 247 } … … 253 267 <h3><?php _e( 'Themes' ); ?></h3> 254 268 <p><?php _e( 'The following themes have new versions available. Check the ones you want to update and then click “Update Themes”.' ); ?></p> 255 <p><?php printf( __('<strong>Please Note:</strong> Any customizations you have made to the Themesfiles 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>269 <p><?php printf( __('<strong>Please Note:</strong> Any customizations you have made to theme 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> 256 270 <form method="post" action="<?php echo $form_action; ?>" name="upgrade-themes" class="upgrade"> 257 271 <?php wp_nonce_field('upgrade-core'); ?> … … 321 335 ?> 322 336 <div class="wrap"> 323 <?php screen_icon( ); ?>337 <?php screen_icon('tools'); ?> 324 338 <h2><?php _e('Update WordPress'); ?></h2> 325 339 <?php … … 342 356 } else { 343 357 show_message( __('WordPress updated successfully') ); 344 show_message( '< strong>' . __('Actions:') . '</strong> <a href="' . esc_url(admin_url() ) . '">' . __('Go to Dashboard') . '</a>' );358 show_message( '<a href="' . esc_url( self_admin_url() ) . '">' . __('Go to Dashboard') . '</a>' ); 345 359 } 346 360 echo '</div>'; … … 355 369 dismiss_core_update( $update ); 356 370 wp_redirect( wp_nonce_url('update-core.php?action=upgrade-core', 'upgrade-core') ); 371 exit; 357 372 } 358 373 … … 365 380 undismiss_core_update( $version, $locale ); 366 381 wp_redirect( wp_nonce_url('update-core.php?action=upgrade-core', 'upgrade-core') ); 382 exit; 367 383 } 368 384 … … 374 390 375 391 $upgrade_error = false; 376 if ( 'do-plugin-upgrade' == $action && !isset($_GET['plugins']) && !isset($_POST['checked']) ) { 377 $upgrade_error = true; 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'; 378 395 $action = 'upgrade-core'; 379 396 } … … 385 402 '<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>' . 386 403 '<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>' . 387 '<p>' . __('To up grade 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>' .404 '<p>' . __('To update 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>' . 388 405 '<p><strong>' . __('For more information:') . '</strong></p>' . 389 406 '<p>' . __('<a href="http://codex.wordpress.org/Dashboard_Updates_SubPanel" target="_blank">Documentation on Updating WordPress</a>') . '</p>' . … … 392 409 393 410 if ( 'upgrade-core' == $action ) { 411 394 412 wp_version_check(); 395 require_once( './admin-header.php');413 require_once(ABSPATH . 'wp-admin/admin-header.php'); 396 414 core_upgrade_preamble(); 415 397 416 } elseif ( 'do-core-upgrade' == $action || 'do-core-reinstall' == $action ) { 398 417 check_admin_referer('upgrade-core'); … … 405 424 do_undismiss_core_update(); 406 425 407 require_once( './admin-header.php');426 require_once(ABSPATH . 'wp-admin/admin-header.php'); 408 427 if ( 'do-core-reinstall' == $action ) 409 428 $reinstall = true; … … 415 434 416 435 } 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 417 440 check_admin_referer('upgrade-core'); 418 441 … … 422 445 $plugins = (array) $_POST['checked']; 423 446 } else { 424 wp_redirect( 'update-core.php');447 wp_redirect( admin_url('update-core.php') ); 425 448 exit; 426 449 } … … 431 454 $title = __('Update Plugins'); 432 455 433 require_once( './admin-header.php');456 require_once(ABSPATH . 'wp-admin/admin-header.php'); 434 457 echo '<div class="wrap">'; 435 458 screen_icon('plugins'); … … 437 460 echo "<iframe src='$url' style='width: 100%; height: 100%; min-height: 750px;' frameborder='0'></iframe>"; 438 461 echo '</div>'; 462 439 463 } 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 440 468 check_admin_referer('upgrade-core'); 441 469 … … 445 473 $themes = (array) $_POST['checked']; 446 474 } else { 447 wp_redirect( 'update-core.php');475 wp_redirect( admin_url('update-core.php') ); 448 476 exit; 449 477 } … … 454 482 $title = __('Update Themes'); 455 483 456 require_once( './admin-header.php');484 require_once(ABSPATH . 'wp-admin/admin-header.php'); 457 485 echo '<div class="wrap">'; 458 486 screen_icon('themes'); … … 462 490 } 463 491 464 include( './admin-footer.php');492 include(ABSPATH . 'wp-admin/admin-footer.php');
Note: See TracChangeset
for help on using the changeset viewer.