WordPress.org

Make WordPress Core

Changeset 17322


Ignore:
Timestamp:
01/16/11 21:47:24 (3 years ago)
Author:
nacin
Message:

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

Location:
trunk
Files:
34 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/edit-comments.php

    r17321 r17322  
    1212    wp_die(__('Cheatin’ uh?')); 
    1313 
    14 $wp_list_table = get_list_table('WP_Comments_List_Table'); 
     14$wp_list_table = _get_list_table('WP_Comments_List_Table'); 
    1515$pagenum = $wp_list_table->get_pagenum(); 
    1616 
  • trunk/wp-admin/edit-tags.php

    r17321 r17322  
    1313    wp_die( __( 'Cheatin’ uh?' ) ); 
    1414 
    15 $wp_list_table = get_list_table('WP_Terms_List_Table'); 
     15$wp_list_table = _get_list_table('WP_Terms_List_Table'); 
    1616 
    1717$title = $tax->labels->name; 
  • trunk/wp-admin/edit.php

    r17321 r17322  
    2424    wp_die(__('Cheatin’ uh?')); 
    2525 
    26 $wp_list_table = get_list_table('WP_Posts_List_Table'); 
     26$wp_list_table = _get_list_table('WP_Posts_List_Table'); 
    2727$pagenum = $wp_list_table->get_pagenum(); 
    2828 
  • trunk/wp-admin/includes/class-wp-comments-list-table.php

    r17262 r17322  
    1414 * @subpackage List_Table 
    1515 * @since 3.1.0 
     16 * @access private 
    1617 */ 
    1718class WP_Comments_List_Table extends WP_List_Table { 
     
    267268        extract( $this->_args ); 
    268269 
    269         wp_nonce_field( "fetch-list-" . get_class( $this ), '_ajax_fetch_list_nonce' ); 
     270        // wp_nonce_field( "fetch-list-" . get_class( $this ), '_ajax_fetch_list_nonce' ); 
    270271 
    271272        $this->display_tablenav( 'top' ); 
     
    510511 * @subpackage List_Table 
    511512 * @since 3.1.0 
     513 * @access private 
    512514 * 
    513515 * @see WP_Comments_Table 
     
    537539        extract( $this->_args ); 
    538540 
    539         wp_nonce_field( "fetch-list-" . get_class( $this ), '_ajax_fetch_list_nonce' ); 
     541        // wp_nonce_field( "fetch-list-" . get_class( $this ), '_ajax_fetch_list_nonce' ); 
    540542?> 
    541543<table class="<?php echo implode( ' ', $this->get_table_classes() ); ?>" cellspacing="0" style="display:none;"> 
  • trunk/wp-admin/includes/class-wp-links-list-table.php

    r17102 r17322  
    66 * @subpackage List_Table 
    77 * @since 3.1.0 
     8 * @access private 
    89 */ 
    910class WP_Links_List_Table extends WP_List_Table { 
  • 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" /> 
  • trunk/wp-admin/includes/class-wp-media-list-table.php

    r17222 r17322  
    66 * @subpackage List_Table 
    77 * @since 3.1.0 
     8 * @access private 
    89 */ 
    910class WP_Media_List_Table extends WP_List_Table { 
  • trunk/wp-admin/includes/class-wp-ms-sites-list-table.php

    r17180 r17322  
    66 * @subpackage List_Table 
    77 * @since 3.1.0 
     8 * @access private 
    89 */ 
    910class WP_MS_Sites_List_Table extends WP_List_Table { 
  • trunk/wp-admin/includes/class-wp-ms-themes-list-table.php

    r17228 r17322  
    66 * @subpackage List_Table 
    77 * @since 3.1.0 
     8 * @access private 
    89 */ 
    910class WP_MS_Themes_List_Table extends WP_List_Table { 
  • trunk/wp-admin/includes/class-wp-ms-users-list-table.php

    r17201 r17322  
    66 * @subpackage List_Table 
    77 * @since 3.1.0 
     8 * @access private 
    89 */ 
    910class WP_MS_Users_List_Table extends WP_List_Table { 
  • trunk/wp-admin/includes/class-wp-plugin-install-list-table.php

    r17281 r17322  
    66 * @subpackage List_Table 
    77 * @since 3.1.0 
     8 * @access private 
    89 */ 
    910class WP_Plugin_Install_List_Table extends WP_List_Table { 
  • trunk/wp-admin/includes/class-wp-plugins-list-table.php

    r17228 r17322  
    66 * @subpackage List_Table 
    77 * @since 3.1.0 
     8 * @access private 
    89 */ 
    910class WP_Plugins_List_Table extends WP_List_Table { 
  • trunk/wp-admin/includes/class-wp-posts-list-table.php

    r17284 r17322  
    66 * @subpackage List_Table 
    77 * @since 3.1.0 
     8 * @access private 
    89 */ 
    910class WP_Posts_List_Table extends WP_List_Table { 
  • trunk/wp-admin/includes/class-wp-terms-list-table.php

    r17228 r17322  
    66 * @subpackage List_Table 
    77 * @since 3.1.0 
     8 * @access private 
    89 */ 
    910class WP_Terms_List_Table extends WP_List_Table { 
  • trunk/wp-admin/includes/class-wp-theme-install-list-table.php

    r17303 r17322  
    66 * @subpackage List_Table 
    77 * @since 3.1.0 
     8 * @access private 
    89 */ 
    910class WP_Theme_Install_List_Table extends WP_List_Table { 
     
    128129    function display() { 
    129130 
    130         wp_nonce_field( "fetch-list-" . get_class( $this ), '_ajax_fetch_list_nonce' ); 
     131        // wp_nonce_field( "fetch-list-" . get_class( $this ), '_ajax_fetch_list_nonce' ); 
    131132?> 
    132133        <div class="tablenav top"> 
  • trunk/wp-admin/includes/class-wp-themes-list-table.php

    r17303 r17322  
    66 * @subpackage List_Table 
    77 * @since 3.1.0 
     8 * @access private 
    89 */ 
    910class WP_Themes_List_Table extends WP_List_Table { 
     
    102103 
    103104    function display() { 
    104         wp_nonce_field( "fetch-list-" . get_class( $this ), '_ajax_fetch_list_nonce' ); 
     105        // wp_nonce_field( "fetch-list-" . get_class( $this ), '_ajax_fetch_list_nonce' ); 
    105106?> 
    106107        <?php $this->tablenav( 'top' ); ?>  
  • trunk/wp-admin/includes/class-wp-users-list-table.php

    r17319 r17322  
    66 * @subpackage List_Table 
    77 * @since 3.1.0 
     8 * @access private 
    89 */ 
    910class WP_Users_List_Table extends WP_List_Table { 
  • trunk/wp-admin/includes/list-table.php

    r17293 r17322  
    1111 * Fetch an instance of a WP_List_Table class. 
    1212 * 
     13 * @access private 
    1314 * @since 3.1.0 
    1415 * 
    15  * @param string $class The type of the list table, which is the class name except for core list tables. 
     16 * @param string $class The type of the list table, which is the class name. 
    1617 * @return object|bool Object on success, false if the class does not exist. 
    1718 */ 
    18 function get_list_table( $class ) { 
    19     $class = apply_filters( "get_list_table_$class", $class ); 
    20  
    21     require_list_table( $class ); 
    22  
    23     if ( class_exists( $class ) ) 
    24         return new $class; 
    25     return false; 
    26 } 
    27  
    28 /** 
    29  * Include the proper file for a core list table. 
    30  * 
    31  * Useful for extending a core class that would not otherwise be required. 
    32  * 
    33  * @since 3.1.0 
    34  * 
    35  * @param string $table The core table to include. 
    36  * @return bool True on success, false on failure. 
    37  */ 
    38 function require_list_table( $class ) { 
     19function _get_list_table( $class ) { 
    3920    $core_classes = array( 
    4021        //Site Admin 
     
    5839    if ( isset( $core_classes[ $class ] ) ) { 
    5940        require_once( ABSPATH . 'wp-admin/includes/class-wp-' . $core_classes[ $class ] . '-list-table.php' ); 
    60         return true; 
     41        return new $class; 
    6142    } 
    6243 
  • trunk/wp-admin/includes/meta-boxes.php

    r17250 r17322  
    485485    wp_nonce_field( 'get-comments', 'add_comment_nonce', false ); 
    486486 
    487     $wp_list_table = get_list_table('WP_Post_Comments_List_Table'); 
     487    $wp_list_table = _get_list_table('WP_Post_Comments_List_Table'); 
    488488    $wp_list_table->display( true ); 
    489489?> 
  • trunk/wp-admin/includes/template.php

    r17318 r17322  
    333333 
    334334    if ( $mode == 'single' ) { 
    335         $wp_list_table = get_list_table('WP_Post_Comments_List_Table'); 
     335        $wp_list_table = _get_list_table('WP_Post_Comments_List_Table'); 
    336336    } else { 
    337         $wp_list_table = get_list_table('WP_Comments_List_Table'); 
     337        $wp_list_table = _get_list_table('WP_Comments_List_Table'); 
    338338    } 
    339339 
  • trunk/wp-admin/includes/update.php

    r16994 r17322  
    195195    $details_url = self_admin_url('plugin-install.php?tab=plugin-information&plugin=' . $r->slug . '&TB_iframe=true&width=600&height=800'); 
    196196 
    197     $wp_list_table = get_list_table('WP_Plugins_List_Table'); 
     197    $wp_list_table = _get_list_table('WP_Plugins_List_Table'); 
    198198 
    199199    if ( is_network_admin() || !is_multisite() ) { 
     
    271271    $details_url = self_admin_url("theme-install.php?tab=theme-information&theme=$theme_key&TB_iframe=true&width=600&height=400"); 
    272272 
    273     $wp_list_table = get_list_table('WP_MS_Themes_List_Table'); 
     273    $wp_list_table = _get_list_table('WP_MS_Themes_List_Table'); 
    274274 
    275275    echo '<tr class="plugin-update-tr"><td colspan="' . $wp_list_table->get_column_count() . '" class="plugin-update colspanchange"><div class="update-message">'; 
  • trunk/wp-admin/link-manager.php

    r17307 r17322  
    1212    wp_die( __( 'You do not have sufficient permissions to edit the links for this site.' ) ); 
    1313 
    14 $wp_list_table = get_list_table('WP_Links_List_Table'); 
     14$wp_list_table = _get_list_table('WP_Links_List_Table'); 
    1515 
    1616// Handle bulk deletes 
  • trunk/wp-admin/network/site-themes.php

    r17314 r17322  
    3333); 
    3434 
    35 $wp_list_table = get_list_table('WP_MS_Themes_List_Table'); 
     35$wp_list_table = _get_list_table('WP_MS_Themes_List_Table'); 
    3636 
    3737$action = $wp_list_table->current_action(); 
  • trunk/wp-admin/network/site-users.php

    r17314 r17322  
    1717    wp_die(__('You do not have sufficient permissions to edit this site.')); 
    1818 
    19 $wp_list_table = get_list_table('WP_Users_List_Table'); 
     19$wp_list_table = _get_list_table('WP_Users_List_Table'); 
    2020$wp_list_table->prepare_items(); 
    2121 
  • trunk/wp-admin/network/sites.php

    r17274 r17322  
    1717    wp_die( __( 'You do not have permission to access this page.' ) ); 
    1818 
    19 $wp_list_table = get_list_table('WP_MS_Sites_List_Table'); 
     19$wp_list_table = _get_list_table('WP_MS_Sites_List_Table'); 
    2020$pagenum = $wp_list_table->get_pagenum(); 
    2121 
  • trunk/wp-admin/network/themes.php

    r17274 r17322  
    2222    wp_die( __( 'You do not have sufficient permissions to manage network themes.' ) ); 
    2323 
    24 $wp_list_table = get_list_table('WP_MS_Themes_List_Table'); 
     24$wp_list_table = _get_list_table('WP_MS_Themes_List_Table'); 
    2525$pagenum = $wp_list_table->get_pagenum(); 
    2626 
  • trunk/wp-admin/network/users.php

    r17144 r17322  
    1717    wp_die( __( 'You do not have permission to access this page.' ) ); 
    1818 
    19 $wp_list_table = get_list_table('WP_MS_Users_List_Table'); 
     19$wp_list_table = _get_list_table('WP_MS_Users_List_Table'); 
    2020$wp_list_table->prepare_items(); 
    2121 
  • trunk/wp-admin/plugin-install.php

    r17274 r17322  
    2121} 
    2222 
    23 $wp_list_table = get_list_table('WP_Plugin_Install_List_Table'); 
     23$wp_list_table = _get_list_table('WP_Plugin_Install_List_Table'); 
    2424$pagenum = $wp_list_table->get_pagenum(); 
    2525$wp_list_table->prepare_items(); 
  • trunk/wp-admin/plugins.php

    r17274 r17322  
    2020    wp_die( __( 'You do not have sufficient permissions to manage plugins for this site.' ) ); 
    2121 
    22 $wp_list_table = get_list_table('WP_Plugins_List_Table'); 
     22$wp_list_table = _get_list_table('WP_Plugins_List_Table'); 
    2323$pagenum = $wp_list_table->get_pagenum(); 
    2424 
  • trunk/wp-admin/theme-install.php

    r17274 r17322  
    2121} 
    2222 
    23 $wp_list_table = get_list_table('WP_Theme_Install_List_Table'); 
     23$wp_list_table = _get_list_table('WP_Theme_Install_List_Table'); 
    2424$pagenum = $wp_list_table->get_pagenum(); 
    2525$wp_list_table->prepare_items(); 
  • trunk/wp-admin/themes.php

    r17308 r17322  
    1313    wp_die( __( 'Cheatin&#8217; uh?' ) ); 
    1414 
    15 $wp_list_table = get_list_table('WP_Themes_List_Table'); 
     15$wp_list_table = _get_list_table('WP_Themes_List_Table'); 
    1616 
    1717if ( current_user_can( 'switch_themes' ) && isset($_GET['action'] ) ) { 
  • trunk/wp-admin/upload.php

    r17321 r17322  
    1313    wp_die( __( 'You do not have permission to upload files.' ) ); 
    1414 
    15 $wp_list_table = get_list_table('WP_Media_List_Table'); 
     15$wp_list_table = _get_list_table('WP_Media_List_Table'); 
    1616$pagenum = $wp_list_table->get_pagenum(); 
    1717 
  • trunk/wp-admin/users.php

    r17277 r17322  
    1313    wp_die( __( 'Cheatin&#8217; uh?' ) ); 
    1414 
    15 $wp_list_table = get_list_table('WP_Users_List_Table'); 
     15$wp_list_table = _get_list_table('WP_Users_List_Table'); 
    1616 
    1717$title = __('Users'); 
  • trunk/wp-includes/script-loader.php

    r17321 r17322  
    299299        $scripts->add( 'admin-custom-fields', "/wp-admin/js/custom-fields$suffix.js", array('wp-lists'), '20090106' ); 
    300300        $scripts->add_data( 'admin-custom-fields', 'group', 1 ); 
    301  
    302         $scripts->add( 'list-table', "/wp-admin/js/list-table$suffix.js", array( 'jquery-query', 'jquery-serialize-object' ), '20110111a' ); 
    303         $scripts->add_data( 'list-table', 'group', 1 ); 
    304         $scripts->localize( 'list-table', 'listTableL10n', array( 
    305             'error' => __('An error has occurred while loading the items.'), 
    306             'search' => __('Search results for &#8220;%s&#8221;'), 
    307             'l10n_print_after' => 'try{convertEntities(listTableL10n);}catch(e){};' 
    308         ) ); 
    309301 
    310302        $scripts->add( 'admin-comments', "/wp-admin/js/edit-comments$suffix.js", array('wp-lists', 'list-table', 'jquery-ui-resizable', 'quicktags'), '20101223' ); 
Note: See TracChangeset for help on using the changeset viewer.