X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/d3b1ea255664edd2deef17f900a655613d20820d..refs/tags/wordpress-2.9:/wp-admin/update-core.php
diff --git a/wp-admin/update-core.php b/wp-admin/update-core.php
index 1f458242..ed24f180 100644
--- a/wp-admin/update-core.php
+++ b/wp-admin/update-core.php
@@ -14,7 +14,7 @@ if ( ! current_user_can('update_plugins') )
function list_core_update( $update ) {
global $wp_local_package;
- $version_string = 'en_US' == $update->locale ?
+ $version_string = ('en_US' == $update->locale && 'en_US' == get_locale() ) ?
$update->current : sprintf("%s–%s", $update->current, $update->locale);
$current = false;
if ( !isset($update->response) || 'latest' == $update->response )
@@ -53,6 +53,9 @@ function list_core_update( $update ) {
echo '
';
if ( 'en_US' != $update->locale && ( !isset($wp_local_package) || $wp_local_package != $update->locale ) )
echo ''.__('This localized version contains both the translation and various other localization fixes. You can skip upgrading if you want to keep your current translation.').'
';
+ else if ( 'en_US' == $update->locale && get_locale() != 'en_US' ) {
+ echo ''.sprintf( __('You are about to install WordPress %s in English. There is a chance this upgrade will break your translation. You may prefer to wait for the localized version to be released.'), $update->current ).'
';
+ }
echo '';
}
@@ -92,12 +95,20 @@ function dismissed_updates() {
* @return null
*/
function core_upgrade_preamble() {
+ global $upgrade_error;
+
$updates = get_core_updates();
?>
';
+ _e('Please select one or more plugins to upgrade.');
+ echo '
';
+ }
+
if ( !isset($updates[0]->response) || 'latest' == $updates[0]->response ) {
echo '';
_e('You have the latest version of WordPress. You do not need to upgrade');
@@ -123,9 +134,125 @@ function core_upgrade_preamble() {
}
echo '';
dismissed_updates();
+
+ list_plugin_updates();
+ //list_theme_updates();
+ do_action('core_upgrade_preamble');
echo '';
}
+function list_plugin_updates() {
+ global $wp_version;
+
+ $cur_wp_version = preg_replace('/-.*$/', '', $wp_version);
+
+ require_once(ABSPATH . 'wp-admin/includes/plugin-install.php');
+ $plugins = get_plugin_updates();
+ if ( empty($plugins) )
+ return;
+ $form_action = 'update-core.php?action=do-plugin-upgrade';
+
+ $core_updates = get_core_updates();
+ if ( !isset($core_updates[0]->response) || 'latest' == $core_updates[0]->response || 'development' == $core_updates[0]->response )
+ $core_update_version = false;
+ else
+ $core_update_version = $core_updates[0]->current;
+ ?>
+
+
+
+
+
+
+bulk_upgrade($plugins);
+}
+
$action = isset($_GET['action']) ? $_GET['action'] : 'upgrade-core';
+$upgrade_error = false;
+if ( 'do-plugin-upgrade' == $action && !isset($_GET['plugins']) && !isset($_POST['checked']) ) {
+ $upgrade_error = true;
+ $action = 'upgrade-core';
+}
+
+$title = __('Upgrade WordPress');
+$parent_file = 'tools.php';
+
if ( 'upgrade-core' == $action ) {
wp_version_check();
- $title = __('Upgrade WordPress');
- $parent_file = 'tools.php';
require_once('admin-header.php');
core_upgrade_preamble();
- include('admin-footer.php');
} elseif ( 'do-core-upgrade' == $action || 'do-core-reinstall' == $action ) {
check_admin_referer('upgrade-core');
- $title = __('Upgrade WordPress');
- $parent_file = 'tools.php';
// do the (un)dismiss actions before headers,
// so that they can redirect
if ( isset( $_POST['dismiss'] ) )
@@ -229,6 +382,10 @@ if ( 'upgrade-core' == $action ) {
$reinstall = false;
if ( isset( $_POST['upgrade'] ) )
do_core_upgrade($reinstall);
- include('admin-footer.php');
+} elseif ( 'do-plugin-upgrade' == $action ) {
+ check_admin_referer('upgrade-core');
+ require_once('admin-header.php');
+ do_plugin_upgrade();
+}
-}?>
+include('admin-footer.php');