Ticket #18289: 18289.3.diff
File 18289.3.diff, 8.1 KB (added by , 13 years ago) |
---|
-
wp-admin/includes/plugin-install.php
233 233 } 234 234 235 235 /** 236 * Display plugin information in dialog box form.236 * Display plugin information in plugin list table. 237 237 * 238 238 * @since 2.7.0 239 239 */ … … 261 261 if ( empty($section) || ! isset($api->sections[ $section ]) ) 262 262 $section = array_shift( $section_titles = array_keys((array)$api->sections) ); 263 263 264 iframe_header( __('Plugin Install') ); 264 echo '<div id="plugin-information">'; 265 echo "<h2>$api->name</h2>\n"; 265 266 echo "<div id='$tab-header'>\n"; 266 267 echo "<ul id='sidemenu'>\n"; 267 268 foreach ( (array)$api->sections as $section_name => $content ) { … … 302 303 ?> 303 304 </p> 304 305 <?php endif; ?> 305 <h 2 class="mainheader"><?php /* translators: For Your Information */ _e('FYI') ?></h2>306 <h3 class="mainheader"><?php /* translators: For Your Information */ _e('FYI') ?></h3> 306 307 <ul> 307 308 <?php if ( ! empty($api->version) ) : ?> 308 309 <li><strong><?php _e('Version:') ?></strong> <?php echo $api->version ?></li> … … 324 325 <?php endif; ?> 325 326 </ul> 326 327 <?php if ( ! empty($api->rating) ) : ?> 327 <h 2><?php _e('Average Rating') ?></h2>328 <h3><?php _e('Average Rating') ?></h3> 328 329 <div class="star-holder" title="<?php printf(_n('(based on %s rating)', '(based on %s ratings)', $api->num_ratings), number_format_i18n($api->num_ratings)); ?>"> 329 330 <div class="star star-rating" style="width: <?php echo esc_attr($api->rating) ?>px"></div> 330 331 <div class="star star5"><img src="<?php echo admin_url('images/star.png?v=20110615'); ?>" alt="<?php _e('5 stars') ?>" /></div> … … 357 358 $display = ( $section_name == $section ) ? 'block' : 'none'; 358 359 359 360 echo "\t<div id='section-{$san_title}' class='section' style='display: {$display};'>\n"; 360 echo "\t\t<h 2 class='long-header'>$title</h2>";361 echo "\t\t<h3 class='long-header'>$title</h3>"; 361 362 echo $content; 362 363 echo "\t</div>\n"; 363 364 } 364 365 echo "</div>\n"; 365 366 iframe_footer(); 367 exit; 366 echo "</div>\n"; 367 368 if ( isset( $_REQUEST['no-chrome'] ) ) 369 exit; 368 370 } 369 add_action('install_plugins_pre_plugin-information', 'install_plugin_information'); 371 if ( isset( $_REQUEST['no-chrome'] ) ) { 372 add_action('install_plugins_pre_plugin-information', 'install_plugin_information'); 373 } else { 374 add_action('install_plugins_plugin-information', 'install_plugin_information'); 375 } 376 No newline at end of file -
wp-admin/includes/class-wp-plugin-install-list-table.php
187 187 $author = wp_kses( $author, $plugins_allowedtags ); 188 188 189 189 $action_links = array(); 190 $action_links[] = '<a href="' . self_admin_url( 'plugin-install.php?tab=plugin-information&plugin=' . $plugin['slug'] . 191 '&TB_iframe=true&width=600&height=550' ) . '" class="thickbox" title="' . 192 esc_attr( sprintf( __( 'More information about %s' ), $name ) ) . '">' . __( 'Details' ) . '</a>'; 190 $action_links[] = '<a href="' . self_admin_url( 'plugin-install.php?tab=plugin-information&plugin=' . $plugin['slug'] ) . '" 191 class="infoinline" title="' . esc_attr( sprintf( __( 'More information about %s' ), $name ) ) . '">' . __( 'Details' ) . '</a>'; 193 192 194 193 if ( current_user_can( 'install_plugins' ) || current_user_can( 'update_plugins' ) ) { 195 194 $status = install_plugin_install_status( $plugin ); -
wp-admin/js/plugin-install.dev.js
1 /* Plugin Browser Thickbox related JS*/2 var tb_position;3 1 jQuery(document).ready(function($) { 4 tb_position = function() { 5 var tbWindow = $('#TB_window'), width = $(window).width(), H = $(window).height(), W = ( 720 < width ) ? 720 : width, adminbar_height = 0; 6 7 if ( $('body.admin-bar').length ) 8 adminbar_height = 28; 9 10 if ( tbWindow.size() ) { 11 tbWindow.width( W - 50 ).height( H - 45 - adminbar_height ); 12 $('#TB_iframeContent').width( W - 50 ).height( H - 75 - adminbar_height ); 13 tbWindow.css({'margin-left': '-' + parseInt((( W - 50 ) / 2),10) + 'px'}); 14 if ( typeof document.body.style.maxWidth != 'undefined' ) 15 tbWindow.css({'top': 20 + adminbar_height + 'px','margin-top':'0'}); 16 }; 17 18 return $('a.thickbox').each( function() { 19 var href = $(this).attr('href'); 20 if ( ! href ) 21 return; 22 href = href.replace(/&width=[0-9]+/g, ''); 23 href = href.replace(/&height=[0-9]+/g, ''); 24 $(this).attr( 'href', href + '&width=' + ( W - 80 ) + '&height=' + ( H - 85 - adminbar_height ) ); 25 }); 26 }; 27 28 $(window).resize(function(){ tb_position(); }); 29 30 $('#dashboard_plugins a.thickbox, .plugins a.thickbox').click( function() { 31 tb_click.call(this); 32 33 $('#TB_title').css({'background-color':'#222','color':'#cfcfcf'}); 34 $('#TB_ajaxWindowTitle').html('<strong>' + plugininstallL10n.plugin_information + '</strong> ' + $(this).attr('title') ); 35 return false; 2 $('a.infoinline').click(function(e) { 3 if ($('#plugin-information').length < 1 ) { 4 $('<tr id="plugin-information"><td colspan="4"><div id="plugin-loading"><img src="' + ajaxurl.replace( '/admin-ajax.php', '' ) + '/images/loading.gif" alt="Loading..."></div></td></tr>').insertAfter($(this).parents('tr')); 5 6 $('#plugin-information td').load($(this).attr('href') + '&no-chrome=1', function() { 7 $('#plugin-loading').remove(); 8 $(this).wrapInner('<div style="display: none;"></div>').parent().find('td > div').slideDown('slow'); 9 }); 10 11 $(this).text('Close Details'); 12 } else { 13 $('#plugin-information td > div').slideUp('slow', function() { 14 $('#plugin-information').remove(); 15 }); 16 17 $(this).text('Details'); 18 } 19 20 e.preventDefault(); 36 21 }); 37 38 /* Plugin install related JS*/ 39 $('#plugin-information #sidemenu a').click( function() { 22 23 $('#plugin-information #sidemenu a').live('click', function(e) { 40 24 var tab = $(this).attr('name'); 41 25 //Flip the tab 42 26 $('#plugin-information-header a.current').removeClass('current'); … … 44 28 //Flip the content. 45 29 $('#section-holder div.section').hide(); //Hide 'em all 46 30 $('#section-' + tab).show(); 47 return false; 31 32 e.preventDefault(); 48 33 }); 49 34 50 35 $('a.install-now').click( function() { 51 36 return confirm( plugininstallL10n.ays ); 52 37 }); 53 }); 38 }); 39 No newline at end of file -
wp-admin/plugin-install.php
29 29 30 30 wp_enqueue_style( 'plugin-install' ); 31 31 wp_enqueue_script( 'plugin-install' ); 32 if ( 'plugin-information' != $tab )33 add_thickbox();34 32 35 33 $body_id = $tab; 36 34 … … 49 47 include(ABSPATH . 'wp-admin/admin-header.php'); 50 48 ?> 51 49 <div class="wrap"> 50 <?php if ( 'plugin-information' !== $tab ) { ?> 52 51 <?php screen_icon(); ?> 53 52 <h2><?php echo esc_html( $title ); ?></h2> 54 53 55 54 <?php $wp_list_table->views(); ?> 56 55 57 56 <br class="clear" /> 57 <?php } ?> 58 58 <?php do_action('install_plugins_' . $tab, $paged); ?> 59 59 </div> 60 60 <?php -
wp-admin/css/plugin-install.dev.css
1 #plugin-loading { 2 padding: 5px 0; 3 text-align: center; 4 } 5 1 6 /* NOTE: the following CSS rules(.star*) are taken more or less straight from the bbPress rating plugin. */ 2 7 div.star-holder { 3 8 position: relative; … … 40 45 height: 19px; 41 46 } 42 47 43 /* Header on thickbox */ 48 #plugin-information td { 49 background: #fff; 50 padding: 0; 51 } 52 44 53 #plugin-information-header { 45 54 margin: 0; 46 55 padding: 0 5px; … … 58 67 bottom: -1px; 59 68 } 60 69 70 #plugin-information .updated p { 71 margin: 0.5em 0; 72 } 73 61 74 /* Install sidemenu */ 62 75 #plugin-information p.action-button { 63 76 width: 100%;