Make WordPress Core


Ignore:
Timestamp:
10/26/2009 07:04:30 AM (17 years ago)
Author:
azaozz
Message:

Add subtitles and opening/closing DIVs on GUU results screen, see #10973

File:
1 edited

Legend:

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

    r12097 r12107  
    272272                                                        'clear_destination' => false,
    273273                                                        'clear_working' => true,
     274                                                        'is_multi' => false,
    274275                                                        'hook_extra' => array() //Pass any extra $hook_extra args here, this will be passed to any hooked filters.
    275276                                                );
     
    288289                }
    289290
    290                 $this->skin->header();
     291                if ( !$is_multi ) // call $this->header separately if running multiple times
     292                        $this->skin->header();
     293
    291294                $this->skin->before();
    292295
     
    322325                }
    323326                $this->skin->after();
    324                 $this->skin->footer();
     327
     328                if ( !$is_multi )
     329                        $this->skin->footer();
     330
    325331                return $result;
    326332        }
     
    356362        var $result;
    357363        var $bulk = true;
     364        var $show_before = '';
    358365
    359366        function upgrade_strings() {
     
    448455                add_filter('upgrader_clear_destination', array(&$this, 'delete_old_plugin'), 10, 4);
    449456
     457                $this->skin->header();
     458                $all = count($plugins);
     459                $i = 1;
    450460                foreach ( $plugins as $plugin ) {
     461
     462                        $this->show_before = sprintf( '<h4>' . __('Updating plugin %d of %d...') . '</h4>', $i, $all );
     463                        $i++;
     464
    451465                        if ( !isset( $current->response[ $plugin ] ) ) {
    452466                                $this->skin->set_result(false);
     
    467481                                                'clear_destination' => true,
    468482                                                'clear_working' => true,
     483                                                'is_multi' => true,
    469484                                                'hook_extra' => array(
    470485                                                                        'plugin' => $plugin
    471486                                                )
    472487                                        ));
    473                                
     488
    474489                        $results[$plugin] = $this->result;
    475490
     
    478493                                break;
    479494                }
     495                $this->skin->footer();
    480496
    481497                //Cleanup our hooks, incase something else does a upgrade on this connection.
     
    903919        }
    904920
    905         function footer() {
    906                 if ( $this->upgrader->bulk )
    907                         return;
    908 
    909                 echo '</div>';
     921        function before() {
     922                if ( $this->upgrader->show_before ) {
     923                        echo $this->upgrader->show_before;
     924                        $this->upgrader->show_before = '';
     925                }
    910926        }
    911927}
Note: See TracChangeset for help on using the changeset viewer.