Make WordPress Core

Changeset 20236


Ignore:
Timestamp:
03/21/2012 04:19:27 PM (13 years ago)
Author:
nacin
Message:

Visually merge a plugin with its update notice. Same applies to themes in the network admin. Move from 'update automatically' to 'update now'. fixes #20273.

Location:
trunk/wp-admin
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/css/wp-admin.dev.css

    r20201 r20236  
    44264426}
    44274427
    4428 #wpbody-content .plugins .plugin-title, #wpbody-content .plugins .theme-title {
     4428.plugins .update th,
     4429.plugins .update td {
     4430    border-bottom: 0;
     4431}
     4432.plugin-update-tr td {
     4433    border-top: 0;
     4434}
     4435
     4436#wpbody-content .plugins .plugin-title,
     4437#wpbody-content .plugins .theme-title {
    44294438    padding-right: 12px;
    44304439    white-space:nowrap;
    44314440}
    44324441
    4433 .plugins .second, .plugins .row-actions-visible {
     4442.plugins .second,
     4443.plugins .row-actions-visible {
    44344444    padding: 0 0 5px;
     4445}
     4446
     4447.plugins .update .second,
     4448.plugins .update .row-actions-visible {
     4449    padding-bottom: 0;
    44354450}
    44364451
  • trunk/wp-admin/includes/class-wp-ms-themes-list-table.php

    r20160 r20236  
    7272        }
    7373
    74         $maybe_update = current_user_can( 'update_themes' ) && ! $this->is_site_themes && get_site_transient( 'update_themes' );
     74        $maybe_update = current_user_can( 'update_themes' ) && ! $this->is_site_themes && $current = get_site_transient( 'update_themes' );
    7575
    7676        foreach ( (array) $themes['all'] as $key => $theme ) {
     
    8080            }
    8181
     82            if ( $maybe_update && isset( $current->response[ $key ] ) ) {
     83                $themes['all'][ $key ]->update = true;
     84                $themes['upgrade'][ $key ] = $themes['all'][ $key ];
     85            }
     86
    8287            $filter = $theme->is_allowed( $allowed_where, $this->site_id ) ? 'enabled' : 'disabled';
    8388            $themes[ $filter ][ $key ] = $themes['all'][ $key ];
    84 
    85             if ( $maybe_update && isset( $current->response[ $key ] ) )
    86                 $themes['upgrade'][ $key ] = $themes['all'][ $key ];
    8789        }
    8890
     
    262264
    263265    function single_row( $key, $theme ) {
    264         global $status, $page, $s;
     266        global $status, $page, $s, $totals;
    265267
    266268        $context = $status;
     
    305307
    306308        $id = sanitize_html_class( $theme->get_stylesheet() );
     309
     310        if ( ! empty( $totals['upgrade'] ) && ! empty( $theme->update ) )
     311            $class .= ' update';
    307312
    308313        echo "<tr id='$id' class='$class'>";
  • trunk/wp-admin/includes/class-wp-plugins-list-table.php

    r20046 r20236  
    6666                $plugins['dropins'] = get_dropins();
    6767
    68             $current = get_site_transient( 'update_plugins' );
    69             foreach ( (array) $plugins['all'] as $plugin_file => $plugin_data ) {
    70                 if ( isset( $current->response[ $plugin_file ] ) )
    71                     $plugins['upgrade'][ $plugin_file ] = $plugin_data;
     68            if ( current_user_can( 'update_plugins' ) ) {
     69                $current = get_site_transient( 'update_plugins' );
     70                foreach ( (array) $plugins['all'] as $plugin_file => $plugin_data ) {
     71                    if ( isset( $current->response[ $plugin_file ] ) ) {
     72                        $plugins['all'][ $plugin_file ]['update'] = true;
     73                        $plugins['upgrade'][ $plugin_file ] = $plugins['all'][ $plugin_file ];
     74                    }
     75                }
    7276            }
    7377        }
     
    101105        }
    102106
    103         if ( !current_user_can( 'update_plugins' ) )
    104             $plugins['upgrade'] = array();
    105 
    106107        if ( $s ) {
    107108            $status = 'search';
     
    313314
    314315    function single_row( $plugin_file, $plugin_data ) {
    315         global $status, $page, $s;
     316        global $status, $page, $s, $totals;
    316317
    317318        $context = $status;
     
    395396
    396397        $id = sanitize_title( $plugin_name );
     398        if ( ! empty( $totals['upgrade'] ) && ! empty( $plugin_data['update'] ) )
     399            $class .= ' update';
    397400
    398401        echo "<tr id='$id' class='$class'>";
  • trunk/wp-admin/includes/theme.php

    r20041 r20236  
    136136                printf( '<p><strong>' . __('There is a new version of %1$s available. <a href="%2$s" class="thickbox" title="%1$s">View version %3$s details</a>. <em>Automatic update is unavailable for this theme.</em>') . '</strong></p>', $theme_name, $details_url, $update['new_version']);
    137137            else
    138                 printf( '<p><strong>' . __('There is a new version of %1$s available. <a href="%2$s" class="thickbox" title="%1$s">View version %3$s details</a> or <a href="%4$s" %5$s>update automatically</a>.') . '</strong></p>', $theme_name, $details_url, $update['new_version'], $update_url, $update_onclick );
     138                printf( '<p><strong>' . __('There is a new version of %1$s available. <a href="%2$s" class="thickbox" title="%1$s">View version %3$s details</a> or <a href="%4$s" %5$s>update now</a>.') . '</strong></p>', $theme_name, $details_url, $update['new_version'], $update_url, $update_onclick );
    139139        }
    140140    }
  • trunk/wp-admin/includes/update.php

    r20029 r20236  
    200200            printf( __('There is a new version of %1$s available. <a href="%2$s" class="thickbox" title="%3$s">View version %4$s details</a>. <em>Automatic update is unavailable for this plugin.</em>'), $plugin_name, esc_url($details_url), esc_attr($plugin_name), $r->new_version );
    201201        else
    202             printf( __('There is a new version of %1$s available. <a href="%2$s" class="thickbox" title="%3$s">View version %4$s details</a> or <a href="%5$s">update automatically</a>.'), $plugin_name, esc_url($details_url), esc_attr($plugin_name), $r->new_version, wp_nonce_url( self_admin_url('update.php?action=upgrade-plugin&plugin=') . $file, 'upgrade-plugin_' . $file) );
     202            printf( __('There is a new version of %1$s available. <a href="%2$s" class="thickbox" title="%3$s">View version %4$s details</a> or <a href="%5$s">update now</a>.'), $plugin_name, esc_url($details_url), esc_attr($plugin_name), $r->new_version, wp_nonce_url( self_admin_url('update.php?action=upgrade-plugin&plugin=') . $file, 'upgrade-plugin_' . $file) );
    203203
    204204        do_action( "in_plugin_update_message-$file", $plugin_data, $r );
     
    272272        printf( __('There is a new version of %1$s available. <a href="%2$s" class="thickbox" title="%3$s">View version %4$s details</a>. <em>Automatic update is unavailable for this theme.</em>'), $theme['Name'], esc_url($details_url), esc_attr($theme['Name']), $r['new_version'] );
    273273    else
    274         printf( __('There is a new version of %1$s available. <a href="%2$s" class="thickbox" title="%3$s">View version %4$s details</a> or <a href="%5$s">update automatically</a>.'), $theme['Name'], esc_url($details_url), esc_attr($theme['Name']), $r['new_version'], wp_nonce_url( self_admin_url('update.php?action=upgrade-theme&theme=') . $theme_key, 'upgrade-theme_' . $theme_key) );
     274        printf( __('There is a new version of %1$s available. <a href="%2$s" class="thickbox" title="%3$s">View version %4$s details</a> or <a href="%5$s">update now</a>.'), $theme['Name'], esc_url($details_url), esc_attr($theme['Name']), $r['new_version'], wp_nonce_url( self_admin_url('update.php?action=upgrade-theme&theme=') . $theme_key, 'upgrade-theme_' . $theme_key) );
    275275
    276276    do_action( "in_theme_update_message-$theme_key", $theme, $r );
Note: See TracChangeset for help on using the changeset viewer.