Fix pending comments count, paging and comments requests while moderating for trunk

git-svn-id: http://svn.automattic.com/wordpress/trunk@11660 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
azaozz 2009-06-27 22:40:06 +00:00
parent 2ac19ec179
commit daa5da7259
5 changed files with 13 additions and 8 deletions

View File

@ -602,8 +602,12 @@ case 'add-comment' :
if ( !current_user_can( 'edit_post', $id ) )
die('-1');
$search = isset($_POST['s']) ? $_POST['s'] : false;
$start = isset($_POST['page']) ? intval($_POST['page']) * 25 - 1: 24;
$status = isset($_POST['comment_status']) ? $_POST['comment_status'] : false;
$status = isset($_POST['comment_status']) ? $_POST['comment_status'] : 'all';
$per_page = isset($_POST['per_page']) ? (int) $_POST['per_page'] + 8 : 28;
$start = isset($_POST['page']) ? ( intval($_POST['page']) * $per_page ) -1 : $per_page - 1;
if ( 1 > $start )
$start = 27;
$mode = isset($_POST['mode']) ? $_POST['mode'] : 'detail';
$p = isset($_POST['p']) ? $_POST['p'] : 0;
$comment_type = isset($_POST['comment_type']) ? $_POST['comment_type'] : '';

View File

@ -193,7 +193,7 @@ else
$start = $offset = ( $page - 1 ) * $comments_per_page;
list($_comments, $total) = _wp_get_comment_list( $comment_status, $search_dirty, $start, $comments_per_page + 5, $post_id, $comment_type ); // Grab a few extra
list($_comments, $total) = _wp_get_comment_list( $comment_status, $search_dirty, $start, $comments_per_page + 8, $post_id, $comment_type ); // Grab a few extra
$_comment_post_ids = array();
foreach ( $_comments as $_c ) {
@ -358,7 +358,8 @@ if ( $page_links )
<input type="hidden" name="s" value="<?php echo esc_attr($search); ?>" />
<input type="hidden" name="mode" value="<?php echo esc_attr($mode); ?>" />
<input type="hidden" name="comment_status" value="<?php echo esc_attr($comment_status); ?>" />
<input type="hidden" name="page" value="<?php echo isset($_REQUEST['page']) ? absint( $_REQUEST['page'] ) : 1; ?>" />
<input type="hidden" name="page" value="<?php echo esc_attr($page); ?>" />
<input type="hidden" name="per_page" value="<?php echo esc_attr($comments_per_page); ?>" />
<input type="hidden" name="p" value="<?php echo esc_attr( $post_id ); ?>" />
<input type="hidden" name="comment_type" value="<?php echo esc_attr( $comment_type ); ?>" />
<?php wp_nonce_field( 'add-comment', '_ajax_nonce', false ); ?>

View File

@ -23,7 +23,7 @@ setCommentsList = function() {
if ( isNaN(n) ) return;
n = n + ( $('#' + settings.element).is('.' + settings.dimClass) ? 1 : -1 );
if ( n < 0 ) { n = 0; }
$('#awaiting-mod')[ 0 == n ? 'addClass' : 'removeClass' ]('count-0');
a.parents('#awaiting-mod')[ 0 == n ? 'addClass' : 'removeClass' ]('count-0');
n = n.toString();
if ( n.length > 3 )
n = n.substr(0, n.length-3)+' '+n.substr(-3);
@ -77,7 +77,7 @@ setCommentsList = function() {
n = n + 1;
}
if ( n < 0 ) { n = 0; }
$('#awaiting-mod')[ 0 == n ? 'addClass' : 'removeClass' ]('count-0');
a.parents('#awaiting-mod')[ 0 == n ? 'addClass' : 'removeClass' ]('count-0');
n = n.toString();
if ( n.length > 3 )
n = n.substr(0, n.length-3)+' '+n.substr(-3);

File diff suppressed because one or more lines are too long

View File

@ -240,7 +240,7 @@ function wp_default_scripts( &$scripts ) {
$scripts->add( 'user-profile', "/wp-admin/js/user-profile$suffix.js", array('jquery'), '20090514' );
$scripts->add_data( 'user-profile', 'group', 1 );
$scripts->add( 'admin-comments', "/wp-admin/js/edit-comments$suffix.js", array('wp-lists', 'jquery-ui-resizable', 'quicktags'), '20090209' );
$scripts->add( 'admin-comments', "/wp-admin/js/edit-comments$suffix.js", array('wp-lists', 'jquery-ui-resizable', 'quicktags'), '20090627' );
$scripts->add_data( 'admin-comments', 'group', 1 );
$scripts->localize( 'admin-comments', 'adminCommentsL10n', array(
'hotkeys_highlight_first' => isset($_GET['hotkeys_highlight_first']),