First scrape at new UI for Bulk plugin upgrades. See #11232

git-svn-id: https://develop.svn.wordpress.org/trunk@13602 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Dion Hulse
2010-03-06 08:39:50 +00:00
parent 2265baca72
commit 0dbad6d7b5
5 changed files with 178 additions and 58 deletions
+25 -20
View File
@@ -351,24 +351,6 @@ function no_update_actions($actions) {
return '';
}
function do_plugin_upgrade() {
if ( isset( $_GET['plugins'] ) ) {
$plugins = explode( ',', $_GET['plugins'] );
} elseif ( isset( $_POST['checked'] ) ) {
$plugins = (array) $_POST['checked'];
} else {
// Nothing to do.
return;
}
include_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
$url = 'update-core.php?action=do-plugin-upgrade&plugins=' . urlencode( implode( ',', $plugins ) );
$title = __( 'Upgrade Plugins' );
$nonce = 'upgrade-core';
$upgrader = new Plugin_Upgrader( new Plugin_Upgrader_Skin( compact( 'title', 'nonce', 'url' ) ) );
$upgrader->bulk_upgrade( $plugins );
}
$action = isset($_GET['action']) ? $_GET['action'] : 'upgrade-core';
$upgrade_error = false;
@@ -386,23 +368,46 @@ if ( 'upgrade-core' == $action ) {
core_upgrade_preamble();
} elseif ( 'do-core-upgrade' == $action || 'do-core-reinstall' == $action ) {
check_admin_referer('upgrade-core');
// do the (un)dismiss actions before headers,
// so that they can redirect
if ( isset( $_POST['dismiss'] ) )
do_dismiss_core_update();
elseif ( isset( $_POST['undismiss'] ) )
do_undismiss_core_update();
do_undismiss_core_update();
require_once('admin-header.php');
if ( 'do-core-reinstall' == $action )
$reinstall = true;
else
$reinstall = false;
if ( isset( $_POST['upgrade'] ) )
do_core_upgrade($reinstall);
} elseif ( 'do-plugin-upgrade' == $action ) {
check_admin_referer('upgrade-core');
if ( isset( $_GET['plugins'] ) ) {
$plugins = explode( ',', $_GET['plugins'] );
} elseif ( isset( $_POST['checked'] ) ) {
$plugins = (array) $_POST['checked'];
} else {
wp_redirect('plugins.php');
exit;
}
$url = 'update.php?action=update-selected&plugins=' . urlencode(implode(',', $plugins));
$url = wp_nonce_url($url, 'bulk-update-plugins');
$title = __('Update Plugins');
require_once('admin-header.php');
do_plugin_upgrade();
echo '<div class="wrap">';
screen_icon('plugins');
echo '<h2>' . esc_html__('Update Plugins') . '</h2>';
echo "<iframe src='$url' style='width: 100%; height:100%; min-height:850px;'></iframe>";
echo '</div>';
}
include('admin-footer.php');