Make WordPress Core


Ignore:
Timestamp:
01/16/2011 09:47:24 PM (11 years ago)
Author:
nacin
Message:

Remove AJAX from list tables. first pass. see #16262.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/class-wp-list-table.php

    r17321 r17322  
    1414 * @subpackage List_Table
    1515 * @since 3.1.0
     16 * @access private
    1617 */
    1718class WP_List_Table {
     
    9394        $this->_args = $args;
    9495
    95         if ( $args['ajax'] ) {
    96             wp_enqueue_script( 'list-table' );
    97             add_action( 'admin_footer', array( &$this, '_js_vars' ) );
    98         }
     96        // if ( $args['ajax'] ) {
     97        //  wp_enqueue_script( 'list-table' );
     98        //  add_action( 'admin_footer', array( &$this, '_js_vars' ) );
     99        // }
    99100    }
    100101
     
    200201    <label class="screen-reader-text" for="<?php echo $input_id ?>"><?php echo $text; ?>:</label>
    201202    <input type="text" id="<?php echo $input_id ?>" name="s" value="<?php _admin_search_query(); ?>" />
    202     <?php submit_button( $text, 'button', 'submit', false, array('id' => 'search-submit') ); ?>
     203    <?php submit_button( $text, 'button', false, false, array('id' => 'search-submit') ); ?>
    203204</p>
    204 <img src="<?php echo esc_url( admin_url( 'images/wpspin_light.gif' ) ); ?>" class="ajax-loading list-ajax-loading" alt="" />
    205205<?php
    206206    }
     
    468468     * @access protected
    469469     */
    470     function pagination() {
    471         if ( $this->_pagination ) {
    472             echo $this->_pagination;
    473             return;
    474         }
    475 
     470    function pagination( $which ) {
    476471        if ( empty( $this->_pagination_args ) )
    477472            return;
     
    507502        );
    508503
    509         $html_current_page = sprintf( "<input class='current-page' title='%s' type='text' name='%s' value='%s' size='%d' />",
    510             esc_attr__( 'Current page' ),
    511             esc_attr( 'paged' ),
    512             number_format_i18n( $current ),
    513             strlen( $total_pages )
    514         );
     504        if ( 'bottom' == $which )
     505            $html_current_page = $current;
     506        else
     507            $html_current_page = sprintf( "<input class='current-page' title='%s' type='text' name='%s' value='%s' size='%d' />",
     508                esc_attr__( 'Current page' ),
     509                esc_attr( 'paged' ),
     510                $current,
     511                strlen( $total_pages )
     512            );
     513
    515514        $html_total_pages = sprintf( "<span class='total-pages'>%s</span>", number_format_i18n( $total_pages ) );
    516515        $page_links[] = '<span class="paging-input">' . sprintf( _x( '%1$s of %2$s', 'paging' ), $html_current_page, $html_total_pages ) . '</span>';
     
    634633
    635634        $current_url = ( is_ssl() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
     635        $current_url = remove_query_arg( 'paged', $current_url );
    636636
    637637        if ( isset( $_GET['orderby'] ) )
     
    693693        extract( $this->_args );
    694694
    695         wp_nonce_field( "fetch-list-" . get_class( $this ), '_ajax_fetch_list_nonce' );
    696 
    697695        $this->display_tablenav( 'top' );
    698696
     
    749747        $this->extra_tablenav( $which );
    750748        $this->pagination( $which );
    751 
    752 if ( 'bottom' == $which ) {
    753749?>
    754 <img src="<?php echo esc_url( admin_url( 'images/wpspin_light.gif' ) ); ?>" class="ajax-loading list-ajax-loading" alt="" />
    755 <?php } ?>
    756750
    757751        <br class="clear" />
Note: See TracChangeset for help on using the changeset viewer.