WordPress.org

Make WordPress Core

Changeset 8597


Ignore:
Timestamp:
08/09/2008 03:20:16 AM (12 years ago)
Author:
ryan
Message:

Landing page for auto upgrade. see #5560

Location:
trunk/wp-admin
Files:
2 edited

Legend:

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

    r8595 r8597  
    1616    switch ( $cur->response ) {
    1717    case 'development' :
    18         return sprintf( '| '.__( 'You are using a development version (%1$s). Cool! Please <a href="%2$s">stay updated</a>.' ), $GLOBALS['wp_version'], wp_nonce_url('update.php?action=upgrade-core', 'upgrade-core'));
     18        return sprintf( '| '.__( 'You are using a development version (%1$s). Cool! Please <a href="%2$s">stay updated</a>.' ), $GLOBALS['wp_version'], 'update.php?action=upgrade-core');
    1919    break;
    2020
     
    4040
    4141    if ( current_user_can('manage_options') )
    42         $msg = sprintf( __('WordPress %1$s is available! <a href="%2$s">Please update now</a>.'), $cur->current, wp_nonce_url('update.php?action=upgrade-core', 'upgrade-core') );
     42        $msg = sprintf( __('WordPress %1$s is available! <a href="%2$s">Please update now</a>.'), $cur->current, 'update.php?action=upgrade-core' );
    4343    else
    4444        $msg = sprintf( __('WordPress %1$s is available! Please notify the site administrator.'), $cur->current );
     
    5454    $msg = sprintf( __('This is WordPress version %s.'), $GLOBALS['wp_version'] );
    5555    if ( isset( $cur->response ) && $cur->response == 'upgrade' && current_user_can('manage_options') )
    56         $msg .= " <a href='" . wp_nonce_url('update.php?action=upgrade-core', 'upgrade-core') . "' class='rbutton'>" . sprintf( __('Update to %s'), $cur->current ? $cur->current : __( 'Latest' ) ) . '</a>';
     56        $msg .= " <a href='update.php?action=upgrade-core' class='rbutton'>" . sprintf( __('Update to %s'), $cur->current ? $cur->current : __( 'Latest' ) ) . '</a>';
    5757
    5858    echo "<span id='wp-version-message'>$msg</span>";
  • trunk/wp-admin/update.php

    r8595 r8597  
    4242        }
    4343    }
     44    echo '</div>';
     45}
     46
     47function core_upgrade_preamble() {
     48    $update = get_option('update_core');
     49
     50    echo '<div class="wrap">';
     51    echo '<h2>' . __('Upgrade WordPress') . '</h2>';
     52
     53    if ( !isset($update->response) || 'latest' == $update->response ) {
     54        _e('You have the latest version of WordPress. You do not need to upgrade.');
     55        echo '</div>';
     56        return;
     57    }
     58
     59    if ( 'development' == $update->response ) {
     60        $message = __('You are using a developmemt version of WordPress.  You can upgrade to the latest nightly build automatically or download the nightly build and install it manually. Which would you like to do?');
     61        $submit = __('Download nightly build');
     62    } else {
     63        $message =  sprintf(__('You can upgrade to version %s automatically or download the nightly build and install it manually. Which would you like to do?'), $update->current);
     64        $submit = sprintf(__('Download %s'), $update->current);
     65    }
     66
     67    echo '<p>';
     68    echo $message;
     69    echo '</p>';
     70    echo '<form id="post" method="post" action="update.php?action=do-core-upgrade" name="upgrade">';
     71    wp_nonce_field('upgrade-core');
     72    echo '<p>';
     73    echo '<input id="upgrade" class="button" type="submit" value="' . __('Upgrade Automatically') . '" name="upgrade" />';
     74    echo '<a href="' . $update->package . '" class="button">' . $submit . '</a>';
     75    echo '</p>';
     76    echo '</form>';
     77
    4478    echo '</div>';
    4579}
     
    119153        echo "</body></html>";
    120154    } elseif ( 'upgrade-core' == $_GET['action'] ) {
    121         //check_admin_referer('upgrade-core');
     155        $title = __('Upgrade WordPress');
     156        $parent_file = 'index.php';
     157        require_once('admin-header.php');
     158        core_upgrade_preamble();
     159        include('admin-footer.php');
     160    } elseif ( 'do-core-upgrade' ) {
     161        check_admin_referer('upgrade-core');
    122162        $title = __('Upgrade WordPress');
    123163        $parent_file = 'index.php';
Note: See TracChangeset for help on using the changeset viewer.