WordPress.org

Make WordPress Core

Changeset 17321


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

Revert [17270], [17273], see #16166, see #16262.

Location:
trunk
Files:
8 edited

Legend:

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

    r17307 r17321  
    3838 
    3939    $redirect_to = remove_query_arg( array( 'trashed', 'untrashed', 'deleted', 'spammed', 'unspammed', 'approved', 'unapproved', 'ids' ), wp_get_referer() ); 
    40     $redirect_to = $wp_list_table->add_query_args( $redirect_to ); 
     40    $redirect_to = add_query_arg( 'paged', $pagenum, $redirect_to ); 
    4141 
    4242    foreach ( $comment_ids as $comment_id ) { // Check the permissions on each 
  • trunk/wp-admin/edit-tags.php

    r17270 r17321  
    7979    wp_delete_term( $tag_ID, $taxonomy ); 
    8080 
    81     $location = $wp_list_table->add_query_args( $location ); 
    8281    $location = add_query_arg( 'message', 2, $location ); 
    8382    wp_redirect( $location ); 
     
    106105 
    107106    $location = add_query_arg( 'message', 6, $location ); 
    108     $location = $wp_list_table->add_query_args( $location ); 
    109107    wp_redirect( $location ); 
    110108    exit; 
  • trunk/wp-admin/edit.php

    r17277 r17321  
    4242 
    4343    $sendback = remove_query_arg( array('trashed', 'untrashed', 'deleted', 'ids'), wp_get_referer() ); 
    44     $sendback = $wp_list_table->add_query_args( $sendback ); 
     44    $sendback = add_query_arg( 'paged', $pagenum, $sendback ); 
    4545    if ( strpos($sendback, 'post.php') !== false ) 
    4646        $sendback = admin_url($post_new_file); 
  • trunk/wp-admin/includes/class-wp-list-table.php

    r17297 r17321  
    619619        return count( $columns ) - count( $hidden ); 
    620620    } 
    621      
    622     function get_order_info() { 
    623         $current_orderby = isset( $_GET['orderby'] ) ? $_GET['orderby'] : ''; 
    624  
    625         if ( ! $current_orderby ) 
    626             $current_order = ''; 
    627         elseif ( isset( $_GET['order'] ) && 'desc' == $_GET['order'] ) 
     621 
     622    /** 
     623     * Print column headers, accounting for hidden and sortable columns. 
     624     * 
     625     * @since 3.1.0 
     626     * @access protected 
     627     * 
     628     * @param bool $with_id Whether to set the id attribute or not 
     629     */ 
     630    function print_column_headers( $with_id = true ) { 
     631        $screen = get_current_screen(); 
     632 
     633        list( $columns, $hidden, $sortable ) = $this->get_column_info(); 
     634 
     635        $current_url = ( is_ssl() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; 
     636 
     637        if ( isset( $_GET['orderby'] ) ) 
     638            $current_orderby = $_GET['orderby']; 
     639        else 
     640            $current_orderby = ''; 
     641 
     642        if ( isset( $_GET['order'] ) && 'desc' == $_GET['order'] ) 
    628643            $current_order = 'desc'; 
    629644        else 
    630645            $current_order = 'asc'; 
    631  
    632         return array( $current_orderby, $current_order ); 
    633     } 
    634      
    635     function add_query_args( $location ) { 
    636         $pagenum = $this->get_pagenum(); 
    637         list( $current_orderby, $current_order ) = $this->get_order_info(); 
    638         $location = add_query_arg( 'paged', $pagenum, $location ); 
    639         if ( $current_orderby ) 
    640             $location = add_query_arg( array( 'orderby' => $current_orderby, 'order' => $current_order ), $location ); 
    641  
    642         return $location; 
    643     } 
    644  
    645     /** 
    646      * Print column headers, accounting for hidden and sortable columns. 
    647      * 
    648      * @since 3.1.0 
    649      * @access protected 
    650      * 
    651      * @param bool $with_id Whether to set the id attribute or not 
    652      */ 
    653     function print_column_headers( $with_id = true ) { 
    654         $screen = get_current_screen(); 
    655  
    656         list( $columns, $hidden, $sortable ) = $this->get_column_info(); 
    657  
    658         $current_url = ( is_ssl() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; 
    659  
    660         list( $current_orderby, $current_order ) = $this->get_order_info(); 
    661646 
    662647        foreach ( $columns as $column_key => $column_display_name ) { 
     
    753738     */ 
    754739    function display_tablenav( $which ) { 
    755         if ( 'top' == $which ) { 
     740        if ( 'top' == $which ) 
    756741            wp_nonce_field( 'bulk-' . $this->_args['plural'] ); 
    757             list( $current_orderby, $current_order ) = $this->get_order_info(); 
    758             echo '<input type="hidden" name="orderby" value="' . esc_attr( $current_orderby ) . '" /><input type="hidden" name="order" value="' . esc_attr( $current_order ) . '" />'; 
    759         } 
    760742?> 
    761743    <div class="tablenav <?php echo esc_attr( $which ); ?>"> 
  • trunk/wp-admin/js/list-table.dev.js

    r17270 r17321  
    123123            this.handle_error(); 
    124124        } else { 
    125             var tablenav = $('.tablenav-pages'), 
    126                 order = $.query.GET('order'), 
    127                 orderby = order ? $.query.GET('orderby') : ''; 
     125            var tablenav = $('.tablenav-pages'); 
    128126 
    129127            this.stop_loading(); 
     
    146144            tablenav.find('.first-page, .prev-page').toggleClass('disabled', 1 == $.query.GET('paged')); 
    147145            tablenav.find('.next-page, .last-page').toggleClass('disabled', response.total_pages == $.query.GET('paged')); 
    148  
    149             $('input[name=order]').val(order); 
    150             $('input[name=orderby]').val(orderby); 
    151146 
    152147            $('th.column-cb :input').attr('checked', false); 
  • trunk/wp-admin/js/list-table.js

    r17270 r17321  
    1 jQuery(document).ready(function(a){window.listTable={init:function(){this.loading=false;this.reset(".tablenav, .search-box, .wp-list-table");if(""==a.query.GET("paged")){a.query.SET("paged",1)}this.set_total_pages();this.$tbody=a("#the-list, #the-comment-list")},reset:function(d){d=a(d);a("input",d).each(function(){this.value=this.defaultValue;this.checked=this.defaultChecked});a("select",d).each(function(){var e=a("option",this),f=false;e.each(function(){this.selected=this.defaultSelected;f=f||this.defaultSelected});if(!this.multiple&&!f){e[0].selected=true}});a("textarea",d).each(function(){this.value=this.defaultValue})},set_total_pages:function(e){var d=a(".last-page").attr("href");if(d){this.total_pages=e||a.query.load(d).get("paged")}},get_total_pages:function(){return this.total_pages},htmlencode:function(d){return a("<div/>").text(d).html()},update_rows:function(e,d,h){if(this.loading){return false}var g=false,f={};a.each(e,function(i,j){if(j!=a.query.GET(i)){a.query.SET(i,j);g=true}});if(!g){return false}this.start_loading();if(d){a.query.SET("paged",1)}a.each(a.query.get(),function(i,j){if(true===j){f[i]=""}else{f[i]=j}});this._callback=h;this.fetch_list(f,a.proxy(this,"handle_success"),a.proxy(this,"handle_error"));return true},fetch_list:function(e,f,d){e=a.extend(e,{action:"fetch-list",list_args:list_args,_ajax_fetch_list_nonce:a("#_ajax_fetch_list_nonce").val()});a.ajax({url:ajaxurl,global:false,dataType:"json",data:e,success:f,error:d})},handle_success:function(e){if("object"!=typeof e){this.handle_error()}else{var f=a(".tablenav-pages"),d=a.query.GET("order"),g=d?a.query.GET("orderby"):"";this.stop_loading();a("div.updated, div.error").not(".persistent, .inline").remove();this.$tbody.html(e.rows);a(".displaying-num").html(e.total_items_i18n);a(".total-pages").html(e.total_pages_i18n);this.set_total_pages(e.total_pages);if(e.total_pages>1){f.removeClass("one-page")}a(".current-page").val(a.query.GET("paged"));f.find(".first-page, .prev-page").toggleClass("disabled",1==a.query.GET("paged"));f.find(".next-page, .last-page").toggleClass("disabled",e.total_pages==a.query.GET("paged"));a("input[name=order]").val(d);a("input[name=orderby]").val(g);a("th.column-cb :input").attr("checked",false);if(history.replaceState){history.replaceState({},"",location.pathname+a.query)}if(this._callback){this._callback()}}},handle_error:function(){this.stop_loading();a("h2").after('<div class="error ajax below-h2"><p>'+listTableL10n.error+"</p></div>")},start_loading:function(){this.loading=true;a(".error.ajax").remove();a(".list-ajax-loading").css("visibility","visible")},stop_loading:function(){this.loading=false;a(".list-ajax-loading").css("visibility","hidden")}};listTable.init();function b(e,d){if(e<1){e=1}if(e>listTable.get_total_pages()){e=listTable.get_total_pages()}a(listTable).trigger("beforeChangePage");listTable.update_rows({paged:e},false,function(){if(d.parents(".tablenav.bottom").length){scrollTo(0,0)}a(listTable).trigger("changePage")})}a(".tablenav-pages a").click(function(){var e=a(this),d=a.query.GET("paged");switch(e.attr("class")){case"first-page":d=1;break;case"prev-page":d-=1;break;case"next-page":d+=1;break;case"last-page":d=listTable.get_total_pages();break}b(d,e);return false});a(".current-page").keypress(function(f){if(13!=f.keyCode){return}var d=a(this);b(parseInt(d.val())||1,d);return false});a("th.sortable a, th.sorted a").click(function(){function i(k){return a.query.load(k.find("a").attr("href")).get("order")}var f=a(this),h=f.parent("th"),g=h.index(),j=a.query.load(f.attr("href")).get("orderby"),e;h=h.closest("table").find("thead th:eq("+g+"), tfoot th:eq("+g+")");if(j==a.query.get("orderby")){e=("asc"==a.query.get("order"))?"desc":"asc"}else{e=i(h);var d=a("th.sorted");if(d.length){d.removeClass("sorted").addClass("sortable");d.removeClass("desc").removeClass("asc").addClass("asc"==i(d)?"desc":"asc")}h.removeClass("sortable").addClass("sorted")}h.removeClass("desc").removeClass("asc").addClass(e);listTable.update_rows({orderby:j,order:e},true);return false});function c(d){if("keypress"==d.type&&13!=d.keyCode){return}d.preventDefault();d.stopImmediatePropagation();var e=a(this).parent(".search-box").find(":input").serializeObject();listTable.update_rows(e,true,function(){if(a("h2.nav-tab-wrapper").length){return}if("site-users-network"==pagenow||"site-themes-network"==pagenow){a("h4.search-text").remove();if(e.s){a("ul.subsubsub").after(a('<h4 class="clear search-text">').html(listTableL10n.search.replace("%s",this.htmlencode(e.s))))}}else{a("h2 .subtitle").remove();if(e.s){a("h2").append(a('<span class="subtitle">').html(listTableL10n.search.replace("%s",this.htmlencode(e.s))))}}})}a(".search-box :submit").click(c);a(".search-box :text").keypress(c);a("#post-query-submit").click(function(){var d={};a(this).parents(".actions").find('select[name!="action"]').each(function(){var e=a(this);d[e.attr("name")]=e.val()});listTable.update_rows(d,true);return false});a(".view-switch a").click(function(){var d=a(this);listTable.update_rows({mode:a.query.load(d.attr("href")).get("mode")},false,function(){a(".view-switch .current").removeClass("current");d.addClass("current")});return false})}); 
     1jQuery(document).ready(function(a){window.listTable={init:function(){this.loading=false;this.reset(".tablenav, .search-box, .wp-list-table");if(""==a.query.GET("paged")){a.query.SET("paged",1)}this.set_total_pages();this.$tbody=a("#the-list, #the-comment-list")},reset:function(d){d=a(d);a("input",d).each(function(){this.value=this.defaultValue;this.checked=this.defaultChecked});a("select",d).each(function(){var e=a("option",this),f=false;e.each(function(){this.selected=this.defaultSelected;f=f||this.defaultSelected});if(!this.multiple&&!f){e[0].selected=true}});a("textarea",d).each(function(){this.value=this.defaultValue})},set_total_pages:function(e){var d=a(".last-page").attr("href");if(d){this.total_pages=e||a.query.load(d).get("paged")}},get_total_pages:function(){return this.total_pages},htmlencode:function(d){return a("<div/>").text(d).html()},update_rows:function(e,d,h){if(this.loading){return false}var g=false,f={};a.each(e,function(i,j){if(j!=a.query.GET(i)){a.query.SET(i,j);g=true}});if(!g){return false}this.start_loading();if(d){a.query.SET("paged",1)}a.each(a.query.get(),function(i,j){if(true===j){f[i]=""}else{f[i]=j}});this._callback=h;this.fetch_list(f,a.proxy(this,"handle_success"),a.proxy(this,"handle_error"));return true},fetch_list:function(e,f,d){e=a.extend(e,{action:"fetch-list",list_args:list_args,_ajax_fetch_list_nonce:a("#_ajax_fetch_list_nonce").val()});a.ajax({url:ajaxurl,global:false,dataType:"json",data:e,success:f,error:d})},handle_success:function(d){if("object"!=typeof d){this.handle_error()}else{var e=a(".tablenav-pages");this.stop_loading();a("div.updated, div.error").not(".persistent, .inline").remove();this.$tbody.html(d.rows);a(".displaying-num").html(d.total_items_i18n);a(".total-pages").html(d.total_pages_i18n);this.set_total_pages(d.total_pages);if(d.total_pages>1){e.removeClass("one-page")}a(".current-page").val(a.query.GET("paged"));e.find(".first-page, .prev-page").toggleClass("disabled",1==a.query.GET("paged"));e.find(".next-page, .last-page").toggleClass("disabled",d.total_pages==a.query.GET("paged"));a("th.column-cb :input").attr("checked",false);if(history.replaceState){history.replaceState({},"",location.pathname+a.query)}if(this._callback){this._callback()}}},handle_error:function(){this.stop_loading();a("h2").after('<div class="error ajax below-h2"><p>'+listTableL10n.error+"</p></div>")},start_loading:function(){this.loading=true;a(".error.ajax").remove();a(".list-ajax-loading").css("visibility","visible")},stop_loading:function(){this.loading=false;a(".list-ajax-loading").css("visibility","hidden")}};listTable.init();function b(e,d){if(e<1){e=1}if(e>listTable.get_total_pages()){e=listTable.get_total_pages()}a(listTable).trigger("beforeChangePage");listTable.update_rows({paged:e},false,function(){if(d.parents(".tablenav.bottom").length){scrollTo(0,0)}a(listTable).trigger("changePage")})}a(".tablenav-pages a").click(function(){var e=a(this),d=a.query.GET("paged");switch(e.attr("class")){case"first-page":d=1;break;case"prev-page":d-=1;break;case"next-page":d+=1;break;case"last-page":d=listTable.get_total_pages();break}b(d,e);return false});a(".current-page").keypress(function(f){if(13!=f.keyCode){return}var d=a(this);b(parseInt(d.val())||1,d);return false});a("th.sortable a, th.sorted a").click(function(){function i(k){return a.query.load(k.find("a").attr("href")).get("order")}var f=a(this),h=f.parent("th"),g=h.index(),j=a.query.load(f.attr("href")).get("orderby"),e;h=h.closest("table").find("thead th:eq("+g+"), tfoot th:eq("+g+")");if(j==a.query.get("orderby")){e=("asc"==a.query.get("order"))?"desc":"asc"}else{e=i(h);var d=a("th.sorted");if(d.length){d.removeClass("sorted").addClass("sortable");d.removeClass("desc").removeClass("asc").addClass("asc"==i(d)?"desc":"asc")}h.removeClass("sortable").addClass("sorted")}h.removeClass("desc").removeClass("asc").addClass(e);listTable.update_rows({orderby:j,order:e},true);return false});function c(d){if("keypress"==d.type&&13!=d.keyCode){return}d.preventDefault();d.stopImmediatePropagation();var e=a(this).parent(".search-box").find(":input").serializeObject();listTable.update_rows(e,true,function(){if(a("h2.nav-tab-wrapper").length){return}if("site-users-network"==pagenow||"site-themes-network"==pagenow){a("h4.search-text").remove();if(e.s){a("ul.subsubsub").after(a('<h4 class="clear search-text">').html(listTableL10n.search.replace("%s",this.htmlencode(e.s))))}}else{a("h2 .subtitle").remove();if(e.s){a("h2").append(a('<span class="subtitle">').html(listTableL10n.search.replace("%s",this.htmlencode(e.s))))}}})}a(".search-box :submit").click(c);a(".search-box :text").keypress(c);a("#post-query-submit").click(function(){var d={};a(this).parents(".actions").find('select[name!="action"]').each(function(){var e=a(this);d[e.attr("name")]=e.val()});listTable.update_rows(d,true);return false});a(".view-switch a").click(function(){var d=a(this);listTable.update_rows({mode:a.query.load(d.attr("href")).get("mode")},false,function(){a(".view-switch .current").removeClass("current");d.addClass("current")});return false})}); 
  • trunk/wp-admin/upload.php

    r17311 r17321  
    8585                } 
    8686 
    87                 $location = $wp_list_table->add_query_args( $location ); 
    8887                $location = add_query_arg( array( 'attached' => $attached ) , $location ); 
    8988                wp_redirect( $location ); 
     
    123122    } 
    124123 
    125     $location = $wp_list_table->add_query_args( $location ); 
    126124    wp_redirect( $location ); 
    127125    exit; 
  • trunk/wp-includes/script-loader.php

    r17317 r17321  
    300300        $scripts->add_data( 'admin-custom-fields', 'group', 1 ); 
    301301 
    302         $scripts->add( 'list-table', "/wp-admin/js/list-table$suffix.js", array( 'jquery-query', 'jquery-serialize-object' ), '20110112' ); 
     302        $scripts->add( 'list-table', "/wp-admin/js/list-table$suffix.js", array( 'jquery-query', 'jquery-serialize-object' ), '20110111a' ); 
    303303        $scripts->add_data( 'list-table', 'group', 1 ); 
    304304        $scripts->localize( 'list-table', 'listTableL10n', array( 
Note: See TracChangeset for help on using the changeset viewer.