WordPress.org

Make WordPress Core


Ignore:
Timestamp:
05/23/2010 12:29:00 PM (11 years ago)
Author:
dd32
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/class-wp-upgrader.php

    r14812 r14819  
    467467        }
    468468
     469        $this->skin->feedback('bulk_upgrade_start');
    469470        $this->maintenance_mode(true);
    470471
     
    508509                break;
    509510        } //end foreach $plugins
     511
    510512        $this->maintenance_mode(false);
     513        $this->skin->feedback('bulk_upgrade_end');
     514
    511515        $this->skin->footer();
    512516
     
    705709        }
    706710
     711        $this->skin->feedback('bulk_upgrade_start');
    707712        $this->maintenance_mode(true);
    708713
     
    746751                break;
    747752        } //end foreach $plugins
     753
    748754        $this->maintenance_mode(false);
     755        $this->skin->feedback('bulk_upgrade_end');
    749756        $this->skin->footer();
    750757
     
    10581065
    10591066    function add_strings() {
     1067        $this->upgrader->strings['bulk_upgrade_start'] = __('The update process is starting. This process may take awhile on some hosts, so please be patient.');
    10601068        $this->upgrader->strings['skin_update_failed_error'] = __('An error occured while updating %1$s: <strong>%2$s</strong>.');
    10611069        $this->upgrader->strings['skin_update_failed'] = __('The update of %1$s failed.');
    10621070        $this->upgrader->strings['skin_update_successful'] = __('%1$s updated successfully.').' <a onclick="%2$s" href="#" class="hide-if-no-js"><span>'.__('Show Details').'</span><span class="hidden">'.__('Hide Details').'</span>.</a>';
     1071        $this->upgrader->strings['bulk_upgrade_end'] = __('All upgrades have been completed.');
    10631072    }
    10641073
     
    11011110            $this->error = implode(', ', $messages);
    11021111        }
     1112        echo '<script type="text/javascript">jQuery(\'.waiting-' . esc_js($this->upgrader->update_current) . '\').hide();</script>';
    11031113    }
    11041114
    11051115    function before($title = '') {
    11061116        $this->in_loop = true;
    1107         printf( '<h4>' . $this->upgrader->strings['skin_before_update_header'] . '</h4>',  $title, $this->upgrader->update_current, $this->upgrader->update_count);
     1117        printf( '<h4>' . $this->upgrader->strings['skin_before_update_header'] . ' <img alt="" src="' . admin_url( 'images/wpspin_light.gif' ) . '" class="hidden waiting-' . $this->upgrader->update_current . '" style="vertical-align:middle;"></h4>',  $title, $this->upgrader->update_current, $this->upgrader->update_count);
     1118        echo '<script type="text/javascript">jQuery(\'.waiting-' . esc_js($this->upgrader->update_current) . '\').show();</script>';
    11081119        echo '<div class="update-messages hide-if-js" id="progress-' . esc_attr($this->upgrader->update_current) . '"><p>';
    11091120        $this->flush_output();
     
    11221133        if ( !empty($this->result) && !is_wp_error($this->result) ) {
    11231134            echo '<div class="updated"><p>' . sprintf($this->upgrader->strings['skin_update_successful'], $title, 'jQuery(\'#progress-' . esc_js($this->upgrader->update_current) . '\').toggle();jQuery(\'span\', this).toggle(); return false;') . '</p></div>';
     1135            echo '<script type="text/javascript">jQuery(\'.waiting-' . esc_js($this->upgrader->update_current) . '\').hide();</script>';
    11241136        }
    11251137        $this->reset();
Note: See TracChangeset for help on using the changeset viewer.