Ticket #15318: colspan_magic.patch
| File colspan_magic.patch, 5.1 KB (added by ocean90, 3 years ago) |
|---|
-
wp-admin/includes/class-wp-posts-list-table.php
720 720 721 721 <tr id="<?php echo $bulk ? 'bulk-edit' : 'inline-edit'; ?>" class="inline-edit-row inline-edit-row-<?php echo "$hclass inline-edit-$screen->post_type "; 722 722 echo $bulk ? "bulk-edit-row bulk-edit-row-$hclass bulk-edit-$screen->post_type" : "quick-edit-row quick-edit-row-$hclass inline-edit-$screen->post_type"; 723 ?>" style="display: none"><td colspan="<?php echo $col_count; ?>" >723 ?>" style="display: none"><td colspan="<?php echo $col_count; ?>" class="colspanchange"> 724 724 725 725 <fieldset class="inline-edit-col-left"><div class="inline-edit-col"> 726 726 <h4><?php echo $bulk ? __( 'Bulk Edit' ) : __( 'Quick Edit' ); ?></h4> -
wp-admin/includes/class-wp-terms-list-table.php
315 315 ?> 316 316 317 317 <form method="get" action=""><table style="display: none"><tbody id="inlineedit"> 318 <tr id="inline-edit" class="inline-edit-row" style="display: none"><td colspan="<?php echo $col_count; ?>" >318 <tr id="inline-edit" class="inline-edit-row" style="display: none"><td colspan="<?php echo $col_count; ?>" class="colspanchange"> 319 319 320 320 <fieldset><div class="inline-edit-col"> 321 321 <h4><?php _e( 'Quick Edit' ); ?></h4> -
wp-admin/includes/update.php
192 192 193 193 $details_url = self_admin_url('plugin-install.php?tab=plugin-information&plugin=' . $r->slug . '&TB_iframe=true&width=600&height=800'); 194 194 195 $wp_list_table = get_list_table('WP_Plugins_List_Table'); 196 list ( $columns, $hidden ) = $wp_list_table->get_column_info(); 197 $hidden = array_intersect( array_keys( $columns ), array_filter( $hidden ) ); 198 $col_count = count($columns) - count($hidden); 199 195 200 if ( is_network_admin() || !is_multisite() ) { 196 echo '<tr class="plugin-update-tr"><td colspan=" 3" class="plugin-update"><div class="update-message">';201 echo '<tr class="plugin-update-tr"><td colspan="' . $col_count . '" class="plugin-update colspanchange"><div class="update-message">'; 197 202 if ( ! current_user_can('update_plugins') ) 198 203 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>.'), $plugin_name, esc_url($details_url), esc_attr($plugin_name), $r->new_version ); 199 204 else if ( empty($r->package) ) … … 266 271 267 272 $details_url = self_admin_url("theme-install.php?tab=theme-information&theme=$theme_key&TB_iframe=true&width=600&height=400"); 268 273 269 echo '<tr class="plugin-update-tr"><td colspan="3" class="plugin-update"><div class="update-message">'; 274 $wp_list_table = get_list_table('WP_MS_Themes_List_Table'); 275 list ( $columns, $hidden ) = $wp_list_table->get_column_info(); 276 $hidden = array_intersect( array_keys( $columns ), array_filter( $hidden ) ); 277 $col_count = count($columns) - count($hidden); 278 279 echo '<tr class="plugin-update-tr"><td colspan="' . $col_count . '" class="plugin-update colspanchange"><div class="update-message">'; 270 280 if ( ! current_user_can('update_themes') ) 271 281 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>.'), $theme['Name'], esc_url($details_url), esc_attr($theme['Name']), $r->new_version ); 272 282 else if ( empty( $r['package'] ) ) -
wp-admin/includes/template.php
338 338 ?> 339 339 <form method="get" action=""> 340 340 <?php if ( $table_row ) : ?> 341 <table style="display:none;"><tbody id="com-reply"><tr id="replyrow" style="display:none;"><td colspan="<?php echo $col_count; ?>" >341 <table style="display:none;"><tbody id="com-reply"><tr id="replyrow" style="display:none;"><td colspan="<?php echo $col_count; ?>" class="colspanchange"> 342 342 <?php else : ?> 343 343 <div id="com-reply" style="display:none;"><div id="replyrow" style="display:none;"> 344 344 <?php endif; ?> -
wp-admin/js/common.dev.js
147 147 148 148 checked : function(column) { 149 149 $('.column-' + column).show(); 150 this.colSpanChange(+1); 150 151 }, 151 152 152 153 unchecked : function(column) { 153 154 $('.column-' + column).hide(); 155 this.colSpanChange(-1); 154 156 }, 155 157 156 158 hidden : function() { … … 164 166 return id.substring( id, id.length - 5 ); 165 167 }).get().join(','); 166 168 }; 169 }, 170 171 colSpanChange : function(diff) { 172 var $t = $('table').find('.colspanchange'); 173 if ( !$t.length ) 174 return; 175 var n = parseInt( $t.attr('colspan'), 10 ) + diff; 176 $t.attr('colspan', n.toString()); 167 177 } 168 178 } 169 179
