WordPress.org

Make WordPress Core

Changeset 15871


Ignore:
Timestamp:
10/20/2010 04:38:00 PM (9 years ago)
Author:
ryan
Message:

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

Location:
trunk/wp-admin
Files:
3 edited

Legend:

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

    r15867 r15871  
    10381038        $update_actions =  array(
    10391039            '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>',
    1040             'plugins_page' => '<a href="' . admin_url('plugins.php') . '" title="' . esc_attr__('Go to plugins page') . '" target="_parent">' . __('Return to Plugins page') . '</a>'
     1040            'plugins_page' => '<a href="' . self_admin_url('plugins.php') . '" title="' . esc_attr__('Go to plugins page') . '" target="_parent">' . __('Return to Plugins page') . '</a>'
    10411041        );
    10421042        if ( $this->plugin_active )
     
    11961196        parent::bulk_footer();
    11971197        $update_actions =  array(
    1198             'plugins_page' => '<a href="' . admin_url('plugins.php') . '" title="' . esc_attr__('Go to plugins page') . '" target="_parent">' . __('Return to Plugins page') . '</a>',
    1199             'updates_page' => '<a href="' . admin_url('update-core.php') . '" title="' . esc_attr__('Go to WordPress Updates page') . '" target="_parent">' . __('Return to WordPress Updates') . '</a>'
     1198            'plugins_page' => '<a href="' . self_admin_url('plugins.php') . '" title="' . esc_attr__('Go to plugins page') . '" target="_parent">' . __('Return to Plugins page') . '</a>',
     1199            '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>'
    12001200        );
    12011201
  • trunk/wp-admin/network/menu.php

    r15869 r15871  
    1111$menu[15] = array(__('Themes'), 'manage_network_themes', 'themes.php', '', 'menu-top menu-icon-appearance', 'menu-appearance', 'div');
    1212
    13 $plugin_update_count = 0;
     13$plugin_update_count = $theme_update_count = $wordpress_update_count = 0;
    1414$update_plugins = get_site_transient( 'update_plugins' );
    1515if ( !empty($update_plugins->response) )
     
    2222
    2323$menu[25] = array(__('Settings'), 'manage_network_options', 'settings.php', '', 'menu-top menu-icon-settings', 'menu-settings', 'div');
    24 $menu[30] = array(__('Update'), 'manage_network', 'upgrade.php', '', 'menu-top menu-icon-tools', 'menu-update', 'div');
     24
     25$update_themes = get_site_transient( 'update_themes' );
     26if ( !empty($update_themes->response) )
     27    $theme_update_count = count( $update_themes->response );
     28$update_wordpress = get_core_updates( array('dismissed' => false) );
     29if ( !empty($update_wordpress) && !in_array( $update_wordpress[0]->response, array('development', 'latest') ) )
     30    $wordpress_update_count = 1;
     31
     32$update_count = $plugin_update_count + $theme_update_count + $wordpress_update_count;
     33$update_title = array();
     34if ( $wordpress_update_count )
     35    $update_title[] = sprintf(__('%d WordPress Update'), $wordpress_update_count);
     36if ( $plugin_update_count )
     37    $update_title[] = sprintf(_n('%d Plugin Update', '%d Plugin Updates', $plugin_update_count), $plugin_update_count);
     38if ( $theme_update_count )
     39    $update_title[] = sprintf(_n('%d Theme Update', '%d Themes Updates', $theme_update_count), $theme_update_count);
     40
     41$update_title = !empty($update_title) ? esc_attr(implode(', ', $update_title)) : '';
     42
     43$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');
     44$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');
     45$submenu[ 'upgrade.php' ][15] = array( __( 'Update Network' ), 'manage_network', 'upgrade.php' );
     46unset($plugin_update_count, $theme_update_count, $wordpress_update_count, $update_count, $update_title, $update_themes, $update_plugins, $update_wordpress);
     47
    2548
    2649$menu[99] = array( '', 'read', 'separator-last', '', 'wp-menu-separator-last' );
  • trunk/wp-admin/update-core.php

    r15473 r15871  
    393393if ( 'upgrade-core' == $action ) {
    394394    wp_version_check();
    395     require_once('./admin-header.php');
     395    require_once(ABSPATH . 'wp-admin/admin-header.php');
    396396    core_upgrade_preamble();
    397397} elseif ( 'do-core-upgrade' == $action || 'do-core-reinstall' == $action ) {
     
    405405        do_undismiss_core_update();
    406406
    407     require_once('./admin-header.php');
     407    require_once(ABSPATH . 'wp-admin/admin-header.php');
    408408    if ( 'do-core-reinstall' == $action )
    409409        $reinstall = true;
     
    431431    $title = __('Update Plugins');
    432432
    433     require_once('./admin-header.php');
     433    require_once(ABSPATH . 'wp-admin/admin-header.php');
    434434    echo '<div class="wrap">';
    435435    screen_icon('plugins');
     
    454454    $title = __('Update Themes');
    455455
    456     require_once('./admin-header.php');
     456    require_once(ABSPATH . 'wp-admin/admin-header.php');
    457457    echo '<div class="wrap">';
    458458    screen_icon('themes');
     
    462462}
    463463
    464 include('./admin-footer.php');
     464include(ABSPATH . 'wp-admin/admin-footer.php');
Note: See TracChangeset for help on using the changeset viewer.