Make WordPress Core


Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3.0/wp-admin/update-core.php

    r17048 r15282  
    1010require_once('./admin.php');
    1111
    12 if ( is_multisite() && ! is_network_admin() ) {
    13         wp_redirect( network_admin_url( 'update-core.php' ) );
    14         exit();
    15 }
    16 
    17 if ( ! current_user_can( 'update_core' ) )
    18         wp_die( __( 'You do not have sufficient permissions to update this site.' ) );
     12if ( ! current_user_can('update_plugins') )
     13        wp_die(__('You do not have sufficient permissions to update plugins for this site.'));
    1914
    2015function list_core_update( $update ) {
    … …  
    6459        echo '<input name="locale" value="'. esc_attr($update->locale) .'" type="hidden"/>';
    6560        if ( $show_buttons ) {
    66                 submit_button( $submit, 'button', 'upgrade', false );
    67                 echo '&nbsp;<a href="' . esc_url($update->package) . '" class="button">' . $download . '</a>&nbsp;';
     61                echo '<input id="upgrade" class="button" type="submit" value="' . esc_attr($submit) . '" name="upgrade" />&nbsp;';
     62                echo '<a href="' . esc_url($update->package) . '" class="button">' . $download . '</a>&nbsp;';
    6863        }
    6964        if ( 'en_US' != $update->locale )
    7065                if ( !isset( $update->dismissed ) || !$update->dismissed )
    71                         submit_button( __('Hide this update'), 'button', 'dismiss', false );
     66                        echo '<input id="dismiss" class="button" type="submit" value="' . esc_attr__('Hide this update') . '" name="dismiss" />';
    7267                else
    73                         submit_button( __('Bring back this update'), 'button', 'undismiss', false );
     68                        echo '<input id="undismiss" class="button" type="submit" value="' . esc_attr__('Bring back this update') . '" name="undismiss" />';
    7469        echo '</p>';
    7570        if ( 'en_US' != $update->locale && ( !isset($wp_local_package) || $wp_local_package != $update->locale ) )
    7671            echo '<p class="hint">'.__('This localized version contains both the translation and various other localization fixes. You can skip upgrading if you want to keep your current translation.').'</p>';
    7772        else if ( 'en_US' == $update->locale && get_locale() != 'en_US' ) {
    78             echo '<p class="hint">'.sprintf( __('You are about to install WordPress %s <strong>in English (US).</strong> There is a chance this update will break your translation. You may prefer to wait for the localized version to be released.'), $update->current ).'</p>';
     73            echo '<p class="hint">'.sprintf( __('You are about to install WordPress %s <strong>in English.</strong> There is a chance this upgrade will break your translation. You may prefer to wait for the localized version to be released.'), $update->current ).'</p>';
    7974        }
    8075        echo '</form>';
    … …  
    127122        if ( $upgrade_error ) {
    128123                echo '<div class="error"><p>';
    129                 if ( $upgrade_error == 'themes' )
    130                         _e('Please select one or more themes to update.');
    131                 else
    132                         _e('Please select one or more plugins to update.');
     124                _e('Please select one or more plugins to upgrade.');
    133125                echo '</p></div>';
    134126        }
    135 
    136         echo '<p>';
    137         /* translators: %1 date, %2 time. */
    138         printf( __('Last checked on %1$s at %2$s.'), date_i18n( get_option( 'date_format' ) ), date_i18n( get_option( 'time_format' ) ) );
    139         echo ' &nbsp; <a class="button" href="' . esc_url( self_admin_url('update-core.php') ) . '">' . __( 'Check Again' ) . '</a>';
    140         echo '</p>';
    141127
    142128        if ( !isset($updates[0]->response) || 'latest' == $updates[0]->response ) {
    … …  
    145131                echo '</h3>';
    146132        } else {
    147                 echo '<div class="updated inline"><p>';
    148                 _e('<strong>Important:</strong> before updating, please <a href="http://codex.wordpress.org/WordPress_Backups">back up your database and files</a>. For help with updates, visit the <a href="http://codex.wordpress.org/Updating_WordPress">Updating WordPress</a> Codex page.');
     133                echo '<div class="updated"><p>';
     134                _e('<strong>Important:</strong> before updating, please <a href="http://codex.wordpress.org/WordPress_Backups">backup your database and files</a>. For help with updates, visit the <a href="http://codex.wordpress.org/Updating_WordPress">Updating WordPress</a> Codex page.');
    149135                echo '</p></div>';
    150136
    … …  
    157143        $alternate = true;
    158144        foreach( (array) $updates as $update ) {
    159                 echo '<li>';
     145                $class = $alternate? ' class="alternate"' : '';
     146                $alternate = !$alternate;
     147                echo "<li $class>";
    160148                list_core_update( $update );
    161149                echo '</li>';
    … …  
    165153        dismissed_updates();
    166154
    167         if ( current_user_can( 'update_plugins' ) )
    168                 list_plugin_updates();
    169         if ( current_user_can( 'update_themes' ) )
    170                 list_theme_updates();
     155        list_plugin_updates();
     156        list_theme_updates();
    171157        do_action('core_upgrade_preamble');
    172158        echo '</div>';
    … …  
    243229        <tr class='active'>
    244230                <th scope='row' class='check-column'><input type='checkbox' name='checked[]' value='" . esc_attr($plugin_file) . "' /></th>
    245                 <td><strong>{$plugin_data->Name}</strong><br />" . sprintf(__('You have version %1$s installed. Update to %2$s.'), $plugin_data->Version, $plugin_data->update->new_version) . $compat . $upgrade_notice . "</td>
     231                <td class='plugin-title'><strong>{$plugin_data->Name}</strong>" . sprintf(__('You have version %1$s installed. Update to %2$s.'), $plugin_data->Version, $plugin_data->update->new_version) . $compat . $upgrade_notice . "</td>
    246232        </tr>";
    247233        }
    … …  
    267253<h3><?php _e( 'Themes' ); ?></h3>
    268254<p><?php _e( 'The following themes have new versions available. Check the ones you want to update and then click &#8220;Update Themes&#8221;.' ); ?></p>
    269 <p><?php printf( __('<strong>Please Note:</strong> Any customizations you have made to theme files will be lost. Please consider using <a href="%s">child themes</a> for modifications.'), _x('http://codex.wordpress.org/Child_Themes', 'Link used in suggestion to use child themes in GUU') ); ?></p>
     255<p><?php printf( __('<strong>Please Note:</strong> Any customizations you have made to the Themes files will be lost. Please consider using <a href="%s">child themes</a> for modifications.'), _x('http://codex.wordpress.org/Child_Themes', 'Link used in suggestion to use child themes in GUU') ); ?></p>
    270256<form method="post" action="<?php echo $form_action; ?>" name="upgrade-themes" class="upgrade">
    271257<?php wp_nonce_field('upgrade-core'); ?>
    … …  
    335321?>
    336322        <div class="wrap">
    337         <?php screen_icon('tools'); ?>
     323        <?php screen_icon(); ?>
    338324        <h2><?php _e('Update WordPress'); ?></h2>
    339325<?php
    … …  
    356342        } else {
    357343                show_message( __('WordPress updated successfully') );
    358                 show_message( '<a href="' . esc_url( self_admin_url() ) . '">' . __('Go to Dashboard') . '</a>' );
     344                show_message( '<strong>' . __('Actions:') . '</strong> <a href="' . esc_url( admin_url() ) . '">' . __('Go to Dashboard') . '</a>' );
    359345        }
    360346        echo '</div>';
    … …  
    369355        dismiss_core_update( $update );
    370356        wp_redirect( wp_nonce_url('update-core.php?action=upgrade-core', 'upgrade-core') );
    371         exit;
    372357}
    373358
    … …  
    380365        undismiss_core_update( $version, $locale );
    381366        wp_redirect( wp_nonce_url('update-core.php?action=upgrade-core', 'upgrade-core') );
    382         exit;
    383367}
    384368
    … …  
    390374
    391375$upgrade_error = false;
    392 if ( ( 'do-theme-upgrade' == $action || ( 'do-plugin-upgrade' == $action && ! isset( $_GET['plugins'] ) ) )
    393         && ! isset( $_POST['checked'] ) ) {
    394         $upgrade_error = $action == 'do-theme-upgrade' ? 'themes' : 'plugins';
     376if ( 'do-plugin-upgrade' == $action && !isset($_GET['plugins']) && !isset($_POST['checked']) ) {
     377        $upgrade_error = true;
    395378        $action = 'upgrade-core';
    396379}
    … …  
    402385        '<p>' . __('This screen lets you update to the latest version of WordPress as well as update your themes and plugins from the WordPress.org repository. When updates are available, the number of available updates will appear in a bubble on the left hand menu as a notification. It is very important to keep your WordPress installation up to date for security reasons, so when you see a number appear, make sure you take the time to update, which is an easy process.') . '</p>' .
    403386        '<p>' . __('Updating your WordPress installation is a simple one-click procedure; just click on the Update button when it says a new version is available.') . '</p>' .
    404         '<p>' . __('To update themes or plugins from this screen, use the checkboxes to make your selection and click on the appropriate Update button. Check the box at the top of the Themes or Plugins section to select all and update them all at once.') . '</p>' .
     387        '<p>' . __('To upgrade themes or plugins from this screen, use the checkboxes to make your selection and click on the appropriate Update button. Check the box at the top of the Themes or Plugins section to select all and update them all at once.') . '</p>' .
    405388        '<p><strong>' . __('For more information:') . '</strong></p>' .
    406389        '<p>' . __('<a href="http://codex.wordpress.org/Dashboard_Updates_SubPanel" target="_blank">Documentation on Updating WordPress</a>') . '</p>' .
    … …  
    409392
    410393if ( 'upgrade-core' == $action ) {
    411 
    412394        wp_version_check();
    413         require_once(ABSPATH . 'wp-admin/admin-header.php');
     395        require_once('./admin-header.php');
    414396        core_upgrade_preamble();
    415 
    416397} elseif ( 'do-core-upgrade' == $action || 'do-core-reinstall' == $action ) {
    417398        check_admin_referer('upgrade-core');
    … …  
    424405                do_undismiss_core_update();
    425406
    426         require_once(ABSPATH . 'wp-admin/admin-header.php');
     407        require_once('./admin-header.php');
    427408        if ( 'do-core-reinstall' == $action )
    428409                $reinstall = true;
    … …  
    434415
    435416} elseif ( 'do-plugin-upgrade' == $action ) {
    436 
    437         if ( ! current_user_can( 'update_plugins' ) )
    438                 wp_die( __( 'You do not have sufficient permissions to update this site.' ) );
    439 
    440417        check_admin_referer('upgrade-core');
    441418
    … …  
    445422                $plugins = (array) $_POST['checked'];
    446423        } else {
    447                 wp_redirect( admin_url('update-core.php') );
     424                wp_redirect('update-core.php');
    448425                exit;
    449426        }
    … …  
    454431        $title = __('Update Plugins');
    455432
    456         require_once(ABSPATH . 'wp-admin/admin-header.php');
     433        require_once('./admin-header.php');
    457434        echo '<div class="wrap">';
    458435        screen_icon('plugins');
    … …  
    460437        echo "<iframe src='$url' style='width: 100%; height: 100%; min-height: 750px;' frameborder='0'></iframe>";
    461438        echo '</div>';
    462 
    463439} elseif ( 'do-theme-upgrade' == $action ) {
    464 
    465         if ( ! current_user_can( 'update_themes' ) )
    466                 wp_die( __( 'You do not have sufficient permissions to update this site.' ) );
    467 
    468440        check_admin_referer('upgrade-core');
    469441
    … …  
    473445                $themes = (array) $_POST['checked'];
    474446        } else {
    475                 wp_redirect( admin_url('update-core.php') );
     447                wp_redirect('update-core.php');
    476448                exit;
    477449        }
    … …  
    482454        $title = __('Update Themes');
    483455
    484         require_once(ABSPATH . 'wp-admin/admin-header.php');
     456        require_once('./admin-header.php');
    485457        echo '<div class="wrap">';
    486458        screen_icon('themes');
    … …  
    490462}
    491463
    492 include(ABSPATH . 'wp-admin/admin-footer.php');
     464include('./admin-footer.php');
Note: See TracChangeset for help on using the changeset viewer.