Add update-core to network admin. Props PeteMall. see #15162

git-svn-id: http://svn.automattic.com/wordpress/trunk@15871 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2010-10-20 16:38:00 +00:00
parent f3dee51a99
commit 14ae165bb5
3 changed files with 33 additions and 10 deletions

View File

@ -1037,7 +1037,7 @@ class Plugin_Upgrader_Skin extends WP_Upgrader_Skin {
$update_actions = array(
'activate_plugin' => '<a href="' . wp_nonce_url('plugins.php?action=activate&amp;plugin=' . $this->plugin, 'activate-plugin_' . $this->plugin) . '" title="' . esc_attr__('Activate this plugin') . '" target="_parent">' . __('Activate Plugin') . '</a>',
'plugins_page' => '<a href="' . admin_url('plugins.php') . '" title="' . esc_attr__('Go to plugins page') . '" target="_parent">' . __('Return to Plugins page') . '</a>'
'plugins_page' => '<a href="' . self_admin_url('plugins.php') . '" title="' . esc_attr__('Go to plugins page') . '" target="_parent">' . __('Return to Plugins page') . '</a>'
);
if ( $this->plugin_active )
unset( $update_actions['activate_plugin'] );
@ -1195,8 +1195,8 @@ class Bulk_Plugin_Upgrader_Skin extends Bulk_Upgrader_Skin {
function bulk_footer() {
parent::bulk_footer();
$update_actions = array(
'plugins_page' => '<a href="' . admin_url('plugins.php') . '" title="' . esc_attr__('Go to plugins page') . '" target="_parent">' . __('Return to Plugins page') . '</a>',
'updates_page' => '<a href="' . admin_url('update-core.php') . '" title="' . esc_attr__('Go to WordPress Updates page') . '" target="_parent">' . __('Return to WordPress Updates') . '</a>'
'plugins_page' => '<a href="' . self_admin_url('plugins.php') . '" title="' . esc_attr__('Go to plugins page') . '" target="_parent">' . __('Return to Plugins page') . '</a>',
'updates_page' => '<a href="' . self_admin_url('update-core.php') . '" title="' . esc_attr__('Go to WordPress Updates page') . '" target="_parent">' . __('Return to WordPress Updates') . '</a>'
);
$update_actions = apply_filters('update_bulk_plugins_complete_actions', $update_actions, $this->plugin_info);

View File

@ -10,7 +10,7 @@ $menu[5] = array(__('Sites'), 'manage_sites', 'sites.php', '', 'menu-top menu-ic
$menu[10] = array(__('Users'), 'manage_network_users', 'users.php', '', 'menu-top menu-icon-users', 'menu-users', 'div');
$menu[15] = array(__('Themes'), 'manage_network_themes', 'themes.php', '', 'menu-top menu-icon-appearance', 'menu-appearance', 'div');
$plugin_update_count = 0;
$plugin_update_count = $theme_update_count = $wordpress_update_count = 0;
$update_plugins = get_site_transient( 'update_plugins' );
if ( !empty($update_plugins->response) )
$plugin_update_count = count( $update_plugins->response );
@ -21,7 +21,30 @@ $submenu['plugins.php'][15] = array( _x('Editor', 'plugin editor'), 'edit_plugin
$menu[25] = array(__('Settings'), 'manage_network_options', 'settings.php', '', 'menu-top menu-icon-settings', 'menu-settings', 'div');
$menu[30] = array(__('Update'), 'manage_network', 'upgrade.php', '', 'menu-top menu-icon-tools', 'menu-update', 'div');
$update_themes = get_site_transient( 'update_themes' );
if ( !empty($update_themes->response) )
$theme_update_count = count( $update_themes->response );
$update_wordpress = get_core_updates( array('dismissed' => false) );
if ( !empty($update_wordpress) && !in_array( $update_wordpress[0]->response, array('development', 'latest') ) )
$wordpress_update_count = 1;
$update_count = $plugin_update_count + $theme_update_count + $wordpress_update_count;
$update_title = array();
if ( $wordpress_update_count )
$update_title[] = sprintf(__('%d WordPress Update'), $wordpress_update_count);
if ( $plugin_update_count )
$update_title[] = sprintf(_n('%d Plugin Update', '%d Plugin Updates', $plugin_update_count), $plugin_update_count);
if ( $theme_update_count )
$update_title[] = sprintf(_n('%d Theme Update', '%d Themes Updates', $theme_update_count), $theme_update_count);
$update_title = !empty($update_title) ? esc_attr(implode(', ', $update_title)) : '';
$menu[30] = array(sprintf( __('Update %s'), "<span class='update-plugins count-$update_count' title='$update_title'><span class='update-count'>" . number_format_i18n($update_count) . "</span></span>" ), 'manage_network', 'upgrade.php', '', 'menu-top menu-icon-tools', 'menu-update', 'div');
$submenu[ 'upgrade.php' ][10] = array( sprintf( __('Updates %s'), "<span class='update-plugins count-$update_count' title='$update_title'><span class='update-count'>" . number_format_i18n($update_count) . "</span></span>" ), 'install_plugins', 'update-core.php');
$submenu[ 'upgrade.php' ][15] = array( __( 'Update Network' ), 'manage_network', 'upgrade.php' );
unset($plugin_update_count, $theme_update_count, $wordpress_update_count, $update_count, $update_title, $update_themes, $update_plugins, $update_wordpress);
$menu[99] = array( '', 'read', 'separator-last', '', 'wp-menu-separator-last' );

View File

@ -392,7 +392,7 @@ add_contextual_help($current_screen,
if ( 'upgrade-core' == $action ) {
wp_version_check();
require_once('./admin-header.php');
require_once(ABSPATH . 'wp-admin/admin-header.php');
core_upgrade_preamble();
} elseif ( 'do-core-upgrade' == $action || 'do-core-reinstall' == $action ) {
check_admin_referer('upgrade-core');
@ -404,7 +404,7 @@ if ( 'upgrade-core' == $action ) {
elseif ( isset( $_POST['undismiss'] ) )
do_undismiss_core_update();
require_once('./admin-header.php');
require_once(ABSPATH . 'wp-admin/admin-header.php');
if ( 'do-core-reinstall' == $action )
$reinstall = true;
else
@ -430,7 +430,7 @@ if ( 'upgrade-core' == $action ) {
$title = __('Update Plugins');
require_once('./admin-header.php');
require_once(ABSPATH . 'wp-admin/admin-header.php');
echo '<div class="wrap">';
screen_icon('plugins');
echo '<h2>' . esc_html__('Update Plugins') . '</h2>';
@ -453,7 +453,7 @@ if ( 'upgrade-core' == $action ) {
$title = __('Update Themes');
require_once('./admin-header.php');
require_once(ABSPATH . 'wp-admin/admin-header.php');
echo '<div class="wrap">';
screen_icon('themes');
echo '<h2>' . esc_html__('Update Themes') . '</h2>';
@ -461,4 +461,4 @@ if ( 'upgrade-core' == $action ) {
echo '</div>';
}
include('./admin-footer.php');
include(ABSPATH . 'wp-admin/admin-footer.php');