From ce9cca9dd0adebc1ee0fcb7f6f2830ebd112fb3f Mon Sep 17 00:00:00 2001 From: Dion Hulse Date: Sun, 23 May 2010 12:29:00 +0000 Subject: [PATCH] Provide some Before/After strings for Bulk Upgrades, Add a spinner whilst a upgrade is in process, Remove scrollbars on update iframe. Props ocean90. See #11232 git-svn-id: https://develop.svn.wordpress.org/trunk@14819 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-admin/css/wp-admin.dev.css | 5 +++++ wp-admin/includes/class-wp-upgrader.php | 14 +++++++++++++- wp-admin/update-core.php | 4 ++-- wp-includes/script-loader.php | 2 +- 4 files changed, 21 insertions(+), 4 deletions(-) diff --git a/wp-admin/css/wp-admin.dev.css b/wp-admin/css/wp-admin.dev.css index b5bc4179bc..8984fb37d4 100644 --- a/wp-admin/css/wp-admin.dev.css +++ b/wp-admin/css/wp-admin.dev.css @@ -3752,3 +3752,8 @@ h2 .nav-tab { padding: 4px 20px 6px; font: italic normal normal 24px/35px Georgia, "Times New Roman", "Bitstream Charter", Times, serif; } + +/* Scrollbar fix for bulk upgrade iframe */ +body.update-php { + height: 98%; +} diff --git a/wp-admin/includes/class-wp-upgrader.php b/wp-admin/includes/class-wp-upgrader.php index cd295420f7..911cc740b7 100644 --- a/wp-admin/includes/class-wp-upgrader.php +++ b/wp-admin/includes/class-wp-upgrader.php @@ -466,6 +466,7 @@ class Plugin_Upgrader extends WP_Upgrader { return false; } + $this->skin->feedback('bulk_upgrade_start'); $this->maintenance_mode(true); $results = array(); @@ -507,7 +508,10 @@ class Plugin_Upgrader extends WP_Upgrader { if ( false === $result ) break; } //end foreach $plugins + $this->maintenance_mode(false); + $this->skin->feedback('bulk_upgrade_end'); + $this->skin->footer(); // Cleanup our hooks, incase something else does a upgrade on this connection. @@ -704,6 +708,7 @@ class Theme_Upgrader extends WP_Upgrader { return false; } + $this->skin->feedback('bulk_upgrade_start'); $this->maintenance_mode(true); $results = array(); @@ -745,7 +750,9 @@ class Theme_Upgrader extends WP_Upgrader { if ( false === $result ) break; } //end foreach $plugins + $this->maintenance_mode(false); + $this->skin->feedback('bulk_upgrade_end'); $this->skin->footer(); // Cleanup our hooks, incase something else does a upgrade on this connection. @@ -1057,9 +1064,11 @@ class Bulk_Upgrader_Skin extends WP_Upgrader_Skin { } function add_strings() { + $this->upgrader->strings['bulk_upgrade_start'] = __('The update process is starting. This process may take awhile on some hosts, so please be patient.'); $this->upgrader->strings['skin_update_failed_error'] = __('An error occured while updating %1$s: %2$s.'); $this->upgrader->strings['skin_update_failed'] = __('The update of %1$s failed.'); $this->upgrader->strings['skin_update_successful'] = __('%1$s updated successfully.').' '.__('Show Details').'.'; + $this->upgrader->strings['bulk_upgrade_end'] = __('All upgrades have been completed.'); } function feedback($string) { @@ -1100,11 +1109,13 @@ class Bulk_Upgrader_Skin extends WP_Upgrader_Skin { } $this->error = implode(', ', $messages); } + echo ''; } function before($title = '') { $this->in_loop = true; - printf( '

' . $this->upgrader->strings['skin_before_update_header'] . '

', $title, $this->upgrader->update_current, $this->upgrader->update_count); + printf( '

' . $this->upgrader->strings['skin_before_update_header'] . '

', $title, $this->upgrader->update_current, $this->upgrader->update_count); + echo ''; echo '

'; $this->flush_output(); } @@ -1121,6 +1132,7 @@ class Bulk_Upgrader_Skin extends WP_Upgrader_Skin { } if ( !empty($this->result) && !is_wp_error($this->result) ) { echo '

' . sprintf($this->upgrader->strings['skin_update_successful'], $title, 'jQuery(\'#progress-' . esc_js($this->upgrader->update_current) . '\').toggle();jQuery(\'span\', this).toggle(); return false;') . '

'; + echo ''; } $this->reset(); $this->flush_output(); diff --git a/wp-admin/update-core.php b/wp-admin/update-core.php index 0b18803052..da80e9b694 100644 --- a/wp-admin/update-core.php +++ b/wp-admin/update-core.php @@ -418,7 +418,7 @@ if ( 'upgrade-core' == $action ) { echo '
'; screen_icon('plugins'); echo '

' . esc_html__('Update Plugins') . '

'; - echo ""; + echo ""; echo '
'; } elseif ( 'do-theme-upgrade' == $action ) { check_admin_referer('upgrade-core'); @@ -441,7 +441,7 @@ if ( 'upgrade-core' == $action ) { echo '
'; screen_icon('themes'); echo '

' . esc_html__('Update Themes') . '

'; - echo ""; + echo ""; echo '
'; } diff --git a/wp-includes/script-loader.php b/wp-includes/script-loader.php index d8f0a04648..dfb793caf8 100644 --- a/wp-includes/script-loader.php +++ b/wp-includes/script-loader.php @@ -435,7 +435,7 @@ function wp_default_styles( &$styles ) { // Any rtl stylesheets that don't have a .dev version for ltr $no_suffix = array( 'farbtastic' ); - $styles->add( 'wp-admin', "/wp-admin/css/wp-admin$suffix.css", array(), '20100523' ); + $styles->add( 'wp-admin', "/wp-admin/css/wp-admin$suffix.css", array(), '20100523b' ); $styles->add( 'ie', "/wp-admin/css/ie$suffix.css", array(), '20100219' ); $styles->add_data( 'ie', 'conditional', 'lte IE 7' );