Make WordPress Core

Ticket #18289: 18289.5.diff

File 18289.5.diff, 11.8 KB (added by dd32, 13 years ago)
  • wp-admin/css/colors-classic.dev.css

     
    156156        background-color: #ccc;
    157157}
    158158/* #upload-menu li a.upload-tab-link, */
    159 #plugin-information .action-button a,
    160 #plugin-information .action-button a:hover,
    161 #plugin-information .action-button a:visited {
     159body.plugin-install-plugin-information .action-button a,
     160body.plugin-install-plugin-information .action-button a:hover,
     161body.plugin-install-plugin-information .action-button a:visited {
    162162        color: #fff;
    163163}
    164164
     
    575575        -webkit-box-shadow: rgba(255,255,255,0.5) 0 1px 0;
    576576        box-shadow: rgba(255,255,255,0.5) 0 1px 0;
    577577}
    578 #plugin-information .action-button {
     578body.plugin-install-plugin-information .action-button {
    579579        background-color: #d54e21;
    580580        color: #fff;
    581581}
     
    16381638        border-right: 1px solid #fff;
    16391639}
    16401640
    1641 #plugin-information .fyi ul {
     1641body.plugin-install-plugin-information .fyi ul {
    16421642        background-color: #eaf3fa;
    16431643}
    16441644
    1645 #plugin-information .fyi h2.mainheader {
     1645body.plugin-install-plugin-information .fyi h2.mainheader {
    16461646        background-color: #cee1ef;
    16471647}
    16481648
    1649 #plugin-information pre,
    1650 #plugin-information code {
     1649body.plugin-install-plugin-information pre,
     1650body.plugin-install-plugin-information code {
    16511651        background-color: #ededff;
    16521652}
    16531653
    1654 #plugin-information pre {
     1654body.plugin-install-plugin-information pre {
    16551655        border: 1px solid #ccc;
    16561656}
    16571657
  • wp-admin/css/colors-fresh.dev.css

     
    164164        background-color: #ccc;
    165165}
    166166/* #upload-menu li a.upload-tab-link, */
    167 #plugin-information .action-button a,
    168 #plugin-information .action-button a:hover,
    169 #plugin-information .action-button a:visited {
     167body.plugin-install-plugin-information .action-button a,
     168body.plugin-install-plugin-information .action-button a:hover,
     169body.plugin-install-plugin-information .action-button a:visited {
    170170        color: #fff;
    171171}
    172172
     
    581581        -webkit-box-shadow: rgba(255,255,255,0.5) 0 1px 0;
    582582        box-shadow: rgba(255,255,255,0.5) 0 1px 0;
    583583}
    584 #plugin-information .action-button {
     584body.plugin-install-plugin-information .action-button {
    585585        background-color: #d54e21;
    586586        color: #fff;
    587587}
     
    13081308        border-right: 1px solid #f9f9f9;
    13091309}
    13101310
    1311 #plugin-information .fyi ul {
     1311body.plugin-install-plugin-information .fyi ul {
    13121312        background-color: #eaf3fa;
    13131313}
    13141314
    1315 #plugin-information .fyi h2.mainheader {
     1315body.plugin-install-plugin-information .fyi h2.mainheader {
    13161316        background-color: #cee1ef;
    13171317}
    13181318
    1319 #plugin-information pre,
    1320 #plugin-information code {
     1319body.plugin-install-plugin-information pre,
     1320body.plugin-install-plugin-information code {
    13211321        background-color: #ededff;
    13221322}
    13231323
    1324 #plugin-information pre {
     1324body.plugin-install-plugin-information pre {
    13251325        border: 1px solid #ccc;
    13261326}
    13271327
  • wp-admin/css/wp-admin.dev.css

     
    63426342}
    63436343
    63446344/* Header on thickbox */
    6345 #plugin-information-header {
     6345body.plugin-install-plugin-information #plugin-information-header {
    63466346        margin: 0;
    63476347        padding: 0 5px;
    63486348        font-weight: bold;
     
    63516351        border-bottom-style: solid;
    63526352        height: 2.5em;
    63536353}
    6354 #plugin-information ul#sidemenu {
     6354body.plugin-install-plugin-information ul#sidemenu {
    63556355        font-weight: normal;
    63566356        margin: 0 5px;
    63576357        position: absolute;
     
    63606360}
    63616361
    63626362/* Install sidemenu */
    6363 #plugin-information p.action-button {
     6363body.plugin-install-plugin-information p.action-button {
    63646364        width: 100%;
    63656365        padding-bottom: 0;
    6366         margin-bottom: 0;
    63676366        margin-top: 10px;
    63686367        -webkit-border-top-left-radius: 3px;
    63696368        -webkit-border-bottom-left-radius: 3px;
     
    63716370        border-bottom-left-radius: 3px;
    63726371}
    63736372
    6374 #plugin-information .action-button a {
     6373body.plugin-install-plugin-information .action-button a {
    63756374        text-align: center;
    63766375        font-weight: bold;
    63776376        text-decoration: none;
     
    63796378        line-height: 2em;
    63806379}
    63816380
    6382 #plugin-information h2 {
     6381body.plugin-install-plugin-information h2 {
    63836382        clear: none !important;
    63846383        margin-right: 200px;
    63856384}
    63866385
    6387 #plugin-information .fyi {
     6386body.plugin-install-plugin-information .fyi {
    63886387        margin: 0 10px 50px;
    63896388        width: 210px;
    63906389}
    63916390
    6392 #plugin-information .fyi h2 {
     6391body.plugin-install-plugin-information .fyi h2 {
    63936392        font-size: 0.9em;
    63946393        margin-bottom: 0;
    63956394        margin-right: 0;
    63966395}
    63976396
    6398 #plugin-information .fyi h2.mainheader {
     6397body.plugin-install-plugin-information .fyi h2.mainheader {
    63996398        padding: 5px;
    64006399        -webkit-border-top-left-radius: 3px;
    64016400        border-top-left-radius: 3px;
    64026401}
    64036402
    6404 #plugin-information .fyi ul {
     6403body.plugin-install-plugin-information .fyi ul {
    64056404        padding: 10px 5px 10px 7px;
    64066405        margin: 0;
    64076406        list-style: none;
     
    64096408        border-bottom-left-radius: 3px;
    64106409}
    64116410
    6412 #plugin-information .fyi li {
     6411body.plugin-install-plugin-information .fyi li {
    64136412        margin-right: 0;
    64146413}
    64156414
    6416 #plugin-information #section-holder {
     6415body.plugin-install-plugin-information #section-holder {
    64176416        padding: 10px;
    64186417}
    64196418
    6420 #plugin-information .section ul,
    6421 #plugin-information .section ol {
     6419body.plugin-install-plugin-information .section ul,
     6420body.plugin-install-plugin-information .section ol {
    64226421        margin-left: 16px;
    64236422        list-style-type: square;
    64246423        list-style-image: none;
    64256424}
    64266425
    6427 #plugin-information #section-screenshots li img {
     6426body.plugin-install-plugin-information #section-screenshots li img {
    64286427        vertical-align: text-top;
    64296428}
    64306429
    6431 #plugin-information #section-screenshots li p {
     6430body.plugin-install-plugin-information #section-screenshots li p {
    64326431        font-style: italic;
    64336432        padding-left: 20px;
    64346433        padding-bottom: 2em;
    64356434}
    64366435
    6437 #plugin-information .updated,
    6438 #plugin-information pre {
     6436body.plugin-install-plugin-information .updated,
     6437body.plugin-install-plugin-information pre {
    64396438        margin-right: 215px;
    64406439}
    64416440
    6442 #plugin-information pre {
     6441body.plugin-install-plugin-information pre {
    64436442        padding: 7px;
    64446443        overflow: auto;
    64456444}
  • wp-admin/includes/class-wp-plugin-install-list-table.php

     
    2626
    2727                // These are the tabs which are shown on the page
    2828                $tabs = array();
     29
     30                if ( 'plugin-information' == $tab && ( ! defined('IFRAME_REQUEST') || ! IFRAME_REQUEST ) )
     31                        $tabs['plugin-information'] = __('Plugin Information');
     32
    2933                $tabs['dashboard'] = __( 'Search' );
    3034                if ( 'search' == $tab )
    3135                        $tabs['search'] = __( 'Search Results' );
     
    104108                foreach ( (array) $tabs as $action => $text ) {
    105109                        $class = ( $action == $tab ) ? ' class="current"' : '';
    106110                        $href = self_admin_url('plugin-install.php?tab=' . $action);
     111                        if ( 'plugin-information' == $action )
     112                                $href = add_query_arg('plugin', $_REQUEST['plugin'], $href);
    107113                        $display_tabs['plugin-install-'.$action] = "<a href='$href'$class>$text</a>";
    108114                }
    109115
  • wp-admin/includes/plugin-install.php

     
    237237 *
    238238 * @since 2.7.0
    239239 */
    240 function install_plugin_information() {
     240function install_plugin_information($api) {
    241241        global $tab;
    242242
    243         $api = plugins_api('plugin_information', array('slug' => stripslashes( $_REQUEST['plugin'] ) ));
    244 
    245243        if ( is_wp_error($api) )
    246244                wp_die($api);
    247245
     
    263261        if ( empty($section) || ! isset($api->sections[ $section ]) )
    264262                $section = array_shift( $section_titles = array_keys((array)$api->sections) );
    265263
    266         iframe_header( __('Plugin Install') );
    267264        echo "<div id='$tab-header'>\n";
    268265        echo "<ul id='sidemenu'>\n";
    269266        foreach ( (array)$api->sections as $section_name => $content ) {
     
    365362                }
    366363        echo "</div>\n";
    367364
     365}
     366
     367function install_plugin_information_iframe() {
     368        $api = plugins_api('plugin_information', array('slug' => stripslashes( $_REQUEST['plugin'] ) ));
     369
     370        iframe_header( __('Plugin Install') );
     371        install_plugin_information($api);
    368372        iframe_footer();
    369373        exit;
    370374}
    371 add_action('install_plugins_pre_plugin-information', 'install_plugin_information');
     375
     376function install_plugin_information_direct() {
     377        static $api = null; // First call on install_plugins_pre_plugin-information sets up the $api and setes the page title.
     378        if ( $api ) // Second call on install_plugins_plugin-information is the content to display
     379                return install_plugin_information($api);
     380
     381        $api = plugins_api('plugin_information', array('slug' => stripslashes( $_REQUEST['plugin'] ) ));
     382
     383        if ( $api && ! is_wp_error($api) ) {
     384                /* translators: 1: Plugin Name 2: Plugin Version */
     385                $GLOBALS['title'] = sprintf( __('Plugin Information: %1$s %2$s'), strip_tags($api->name), strip_tags($api->version) );
     386        }
     387}
     388
     389if ( isset($_GET['iframe']) ) {
     390        add_action('install_plugins_pre_plugin-information', 'install_plugin_information_iframe');
     391} else {
     392        add_action('install_plugins_pre_plugin-information', 'install_plugin_information_direct');
     393        add_action('install_plugins_plugin-information', 'install_plugin_information_direct');
     394}
  • wp-admin/includes/template.php

     
    13481348 *
    13491349 */
    13501350function iframe_header( $title = '', $limit_styles = false ) {
    1351         show_admin_bar( false );
     1351
    13521352        global $hook_suffix, $current_screen, $current_user, $admin_body_class, $wp_locale;
    13531353        $admin_body_class = preg_replace('/[^a-z0-9_-]+/i', '-', $hook_suffix);
    13541354
  • wp-admin/js/plugin-install.dev.js

     
    2727
    2828        $(window).resize(function(){ tb_position(); });
    2929
    30          $('#dashboard_plugins a.thickbox, .plugins a.thickbox').click( function() {
     30         $('#dashboard_plugins a.thickbox, body.plugin-install-php a.thickbox').click( function() {
     31                this.href = this.href.replace('?', '?iframe=1&');
    3132                tb_click.call(this);
     33                this.href = this.href.replace('?iframe=1&', '?');
    3234
    3335                $('#TB_title').css({'background-color':'#222','color':'#cfcfcf'});
    3436                $('#TB_ajaxWindowTitle').html('<strong>' + plugininstallL10n.plugin_information + '</strong>&nbsp;' + $(this).attr('title') );
     
    3638        });
    3739
    3840        /* Plugin install related JS*/
    39         $('#plugin-information #sidemenu a').click( function() {
     41        $('#plugin-information-header #sidemenu a').click( function() {
    4042                var tab = $(this).attr('name');
    4143                //Flip the tab
    4244                $('#plugin-information-header a.current').removeClass('current');
  • wp-admin/plugin-install.php

     
    66 * @subpackage Administration
    77 */
    88// TODO route this pages via a specific iframe handler instead of the do_action below
    9 if ( !defined( 'IFRAME_REQUEST' ) && isset( $_GET['tab'] ) && ( 'plugin-information' == $_GET['tab'] ) )
     9if ( !defined( 'IFRAME_REQUEST' ) && isset( $_GET['tab'] ) && isset( $_GET['iframe'] ) && ( 'plugin-information' == $_GET['tab'] ) )
    1010        define( 'IFRAME_REQUEST', true );
    1111
    1212/** WordPress Administration Bootstrap */
     
    3131if ( 'plugin-information' != $tab )
    3232        add_thickbox();
    3333
    34 $body_id = $tab;
     34function plugin_install_body_class($classes) {
     35        global $tab;
     36        return "$classes plugin-install-$tab";
     37}
     38add_filter('admin_body_class', 'plugin_install_body_class');
    3539
    3640do_action('install_plugins_pre_' . $tab); //Used to override the general interface, Eg, install or plugin information.
    3741