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

git-svn-id: http://svn.automattic.com/wordpress/trunk@12107 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
azaozz 2009-10-26 07:04:30 +00:00
parent ea955a4191
commit 63732badd5
2 changed files with 25 additions and 9 deletions

View File

@ -271,6 +271,7 @@ class WP_Upgrader {
'destination' => '', //And this 'destination' => '', //And this
'clear_destination' => false, 'clear_destination' => false,
'clear_working' => true, 'clear_working' => true,
'is_multi' => false,
'hook_extra' => array() //Pass any extra $hook_extra args here, this will be passed to any hooked filters. 'hook_extra' => array() //Pass any extra $hook_extra args here, this will be passed to any hooked filters.
); );
@ -287,7 +288,9 @@ class WP_Upgrader {
return $res; return $res;
} }
$this->skin->header(); if ( !$is_multi ) // call $this->header separately if running multiple times
$this->skin->header();
$this->skin->before(); $this->skin->before();
//Download the package (Note, This just returns the filename of the file if the package is a local file) //Download the package (Note, This just returns the filename of the file if the package is a local file)
@ -321,7 +324,10 @@ class WP_Upgrader {
$this->skin->feedback('process_success'); $this->skin->feedback('process_success');
} }
$this->skin->after(); $this->skin->after();
$this->skin->footer();
if ( !$is_multi )
$this->skin->footer();
return $result; return $result;
} }
@ -355,6 +361,7 @@ class Plugin_Upgrader extends WP_Upgrader {
var $result; var $result;
var $bulk = true; var $bulk = true;
var $show_before = '';
function upgrade_strings() { function upgrade_strings() {
$this->strings['up_to_date'] = __('The plugin is at the latest version.'); $this->strings['up_to_date'] = __('The plugin is at the latest version.');
@ -447,7 +454,14 @@ class Plugin_Upgrader extends WP_Upgrader {
add_filter('upgrader_pre_install', array(&$this, 'deactivate_plugin_before_upgrade'), 10, 2); add_filter('upgrader_pre_install', array(&$this, 'deactivate_plugin_before_upgrade'), 10, 2);
add_filter('upgrader_clear_destination', array(&$this, 'delete_old_plugin'), 10, 4); add_filter('upgrader_clear_destination', array(&$this, 'delete_old_plugin'), 10, 4);
$this->skin->header();
$all = count($plugins);
$i = 1;
foreach ( $plugins as $plugin ) { foreach ( $plugins as $plugin ) {
$this->show_before = sprintf( '<h4>' . __('Updating plugin %d of %d...') . '</h4>', $i, $all );
$i++;
if ( !isset( $current->response[ $plugin ] ) ) { if ( !isset( $current->response[ $plugin ] ) ) {
$this->skin->set_result(false); $this->skin->set_result(false);
$this->skin->error('up_to_date'); $this->skin->error('up_to_date');
@ -466,17 +480,19 @@ class Plugin_Upgrader extends WP_Upgrader {
'destination' => WP_PLUGIN_DIR, 'destination' => WP_PLUGIN_DIR,
'clear_destination' => true, 'clear_destination' => true,
'clear_working' => true, 'clear_working' => true,
'is_multi' => true,
'hook_extra' => array( 'hook_extra' => array(
'plugin' => $plugin 'plugin' => $plugin
) )
)); ));
$results[$plugin] = $this->result; $results[$plugin] = $this->result;
// Prevent credentials auth screen from displaying multiple times // Prevent credentials auth screen from displaying multiple times
if ( false === $result ) if ( false === $result )
break; break;
} }
$this->skin->footer();
//Cleanup our hooks, incase something else does a upgrade on this connection. //Cleanup our hooks, incase something else does a upgrade on this connection.
remove_filter('upgrader_pre_install', array(&$this, 'deactivate_plugin_before_upgrade')); remove_filter('upgrader_pre_install', array(&$this, 'deactivate_plugin_before_upgrade'));
@ -902,11 +918,11 @@ class Plugin_Upgrader_Skin extends WP_Upgrader_Skin {
$this->feedback('<strong>' . __('Actions:') . '</strong> ' . implode(' | ', (array)$update_actions)); $this->feedback('<strong>' . __('Actions:') . '</strong> ' . implode(' | ', (array)$update_actions));
} }
function footer() { function before() {
if ( $this->upgrader->bulk ) if ( $this->upgrader->show_before ) {
return; echo $this->upgrader->show_before;
$this->upgrader->show_before = '';
echo '</div>'; }
} }
} }

View File

@ -126,10 +126,10 @@ function core_upgrade_preamble() {
} }
echo '</ul>'; echo '</ul>';
dismissed_updates(); dismissed_updates();
echo '</div>';
list_plugin_updates(); list_plugin_updates();
//list_theme_updates(); //list_theme_updates();
echo '</div>';
} }
function list_plugin_updates() { function list_plugin_updates() {