Make WordPress Core

Ticket #6530: 6530.diff

File 6530.diff, 2.6 KB (added by greuben, 14 years ago)

I tried to do it less complicated way but I don't think its the best solution. Anyways...

  • wp-admin/edit-comments.php

     
    1414$wp_list_table = get_list_table('WP_Comments_List_Table');
    1515$pagenum = $wp_list_table->get_pagenum();
    1616
     17$parent_file = 'edit-comments.php';
     18
    1719$doaction = $wp_list_table->current_action();
    1820
    1921if ( $doaction ) {
  • wp-admin/includes/class-wp-list-table.php

     
    476476
    477477                $current = $this->get_pagenum();
    478478
    479                 $current_url = ( is_ssl() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
     479                if( defined('DOING_AJAX') && DOING_AJAX ) {
     480                        $current_url = admin_url( $_GET['list_args']['screen']['parent_file'] );
     481                        $current--;
     482                } else {
     483                        $current_url = ( is_ssl() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
     484                }
    480485
    481486                $page_links = array();
    482487
     
    851856                        $this->display_rows();
    852857                else
    853858                        $this->display_rows_or_placeholder();
     859               
     860                $rows = ob_get_contents();
     861                ob_clean();
     862               
     863                $this->display_tablenav( 'top' );
     864                $top_pagination = ob_get_contents();
     865                ob_clean();
     866               
     867                $this->display_tablenav( 'bottom' );
     868                $bottom_pagination = ob_get_contents();
     869               
     870                ob_end_clean();
    854871
    855                 $rows = ob_get_clean();
     872                $response = array( 'rows' => $rows, 'top_pagination' => $top_pagination, 'bottom_pagination' => $bottom_pagination );
    856873
    857                 $response = array( 'rows' => $rows );
    858 
    859874                if ( isset( $total_items ) )
    860875                        $response['total_items_i18n'] = sprintf( _n( '1 item', '%s items', $total_items ), number_format_i18n( $total_items ) );
    861876
  • wp-admin/js/edit-comments.dev.js

     
    235235
    236236                listTable.fetch_list(args, function(response) {
    237237                        theExtraList.get(0).wpList.add( response.rows );
     238                        updatePagination( response.top_pagination, response.bottom_pagination );
    238239                });
    239240        };
     241       
     242        var updatePagination = function( top, bottom ){
     243                $('.tablenav.top').before( top ).remove();
     244                $('.tablenav.bottom').before( bottom ).remove();
     245        }
    240246
    241247        theExtraList = $('#the-extra-comment-list').wpList( { alt: '', delColor: 'none', addColor: 'none' } );
    242248        theList = $('#the-comment-list').wpList( { alt: '', delBefore: delBefore, dimAfter: dimAfter, delAfter: delAfter, addColor: 'none' } )