Changeset 8277
- Timestamp:
- 07/07/08 22:49:52 (5 months ago)
- Files:
-
- branches/crazyhorse/wp-admin/admin-ajax.php (modified) (1 diff)
- branches/crazyhorse/wp-admin/css/global.css (modified) (1 diff)
- branches/crazyhorse/wp-admin/edit-comments.php (modified) (3 diffs)
- branches/crazyhorse/wp-admin/includes/template.php (modified) (3 diffs)
- branches/crazyhorse/wp-admin/js/edit-comments.js (modified) (1 diff)
- branches/crazyhorse/wp-admin/wp-admin.css (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/crazyhorse/wp-admin/admin-ajax.php
r8242 r8277 136 136 die('-1'); 137 137 138 if ( 'unapproved' == wp_get_comment_status($comment->comment_ID) ) {138 if ( in_array( wp_get_comment_status($comment->comment_ID), array( 'unapproved', 'spam' ) ) ) { 139 139 check_ajax_referer( "approve-comment_$id" ); 140 140 if ( wp_set_comment_status( $comment->comment_ID, 'approve' ) ) branches/crazyhorse/wp-admin/css/global.css
r8222 r8277 111 111 112 112 .subsubsub li { display: inline; margin: 0; padding: 0; } 113 114 /* make it small? */ 115 .subsubsub li.spam { 116 font-size: .9em; 117 } 113 118 114 119 .widefat { branches/crazyhorse/wp-admin/edit-comments.php
r8146 r8277 96 96 $status_links = array(); 97 97 $num_comments = wp_count_comments(); 98 $stati = array('moderated' => sprintf(__ngettext('Awaiting Moderation (%s)', 'Awaiting Moderation (%s)', number_format_i18n($num_comments->moderated) ), "<span class='comment-count'>" . number_format_i18n($num_comments->moderated) . "</span>"), 'approved' => _c('Approved|plural')); 98 $stati = array( 99 'moderated' => sprintf(__ngettext('Awaiting Moderation (%s)', 'Awaiting Moderation (%s)', number_format_i18n($num_comments->moderated) ), "<span class='comment-count'>" . number_format_i18n($num_comments->moderated) . "</span>"), 100 'approved' => _c('Approved|plural'), 101 'spam' => sprintf(__ngettext('Spam (%s)', 'Spam (%s)', number_format_i18n($num_comments->spam) ), "<span class='spam-comment-count'>" . number_format_i18n($num_comments->spam) . "</span>") 102 ); 99 103 $class = ( '' === $comment_status ) ? ' class="current"' : ''; 100 104 $status_links[] = "<li><a href=\"edit-comments.php\"$class>".__('Show All Comments')."</a>"; … … 105 109 $class = ' class="current"'; 106 110 107 $status_links[] = "<li><a href=\"edit-comments.php?comment_status=$status\"$class>" . $label . '</a>'; 111 112 $status_links[] = "<li class='$status'><a href=\"edit-comments.php?comment_status=$status\"$class>$label</a>"; 108 113 } 109 114 … … 167 172 <select name="action"> 168 173 <option value="" selected>Actions</option> 169 <?php if ( 'approved' != $comment_status ): ?> 174 <?php if ( 'approved' == $comment_status ): ?> 175 <option value="unapprove"><?php _e('Unapprove'); ?></option> 176 <?php else : ?> 170 177 <option value="approve"><?php _e('Approve'); ?> 171 178 <?php endif; ?> 179 <?php if ( 'spam' != $comment_status ): ?> 172 180 <option value="markspam"><?php _e('Mark as Spam'); ?></option> 173 <?php if ( 'moderated' != $comment_status ): ?>174 <option value="unapprove"><?php _e('Unapprove'); ?></option>175 181 <?php endif; ?> 176 182 <option value="delete"><?php _e('Delete'); ?></option> branches/crazyhorse/wp-admin/includes/template.php
r8242 r8277 710 710 $authordata = get_userdata($post->post_author); 711 711 $the_comment_status = wp_get_comment_status($comment->comment_ID); 712 $class = ('unapproved' == $the_comment_status) ? 'unapproved' : '';713 712 714 713 if ( current_user_can( 'edit_post', $post->ID ) ) { … … 738 737 739 738 ?> 740 <tr id="comment-<?php echo $comment->comment_ID; ?>" class='<?php echo $ class; ?>'>739 <tr id="comment-<?php echo $comment->comment_ID; ?>" class='<?php echo $the_comment_status; ?>'> 741 740 <?php if ( $checkbox ) : ?> 742 741 <td class="check-column"><?php if ( current_user_can('edit_post', $comment->comment_post_ID) ) { ?><input type="checkbox" name="delete_comments[]" value="<?php echo $comment->comment_ID; ?>" /><?php } ?></td> … … 761 760 $actions['approve'] = "<a href='$approve_url' class='dim:the-comment-list:comment-$comment->comment_ID:unapproved:e7e7d3:e7e7d3' title='" . __( 'Approve this comment' ) . "'>" . __( 'Approve' ) . '</a> | '; 762 761 $actions['unapprove'] = "<a href='$unapprove_url' class='dim:the-comment-list:comment-$comment->comment_ID:unapproved:e7e7d3:e7e7d3' title='" . __( 'Unapprove this comment' ) . "'>" . __( 'Unapprove' ) . '</a> | '; 763 764 // we're looking at list of only approved or only unapproved comments765 if ( 'moderated' == $comment_status ) {766 $actions['approve'] = "<a href='$approve_url' class='delete:the-comment-list:comment-$comment->comment_ID:e7e7d3:action=dim-comment' title='" . __( 'Approve this comment' ) . "'>" . __( 'Approve' ) . '</a> | ';767 unset($actions['unapprove']);768 } elseif ( 'approved' == $comment_status ) {769 $actions['unapprove'] = "<a href='$unapprove_url' class='delete:the-comment-list:comment-$comment->comment_ID:e7e7d3:action=dim-comment' title='" . __( 'Unapprove this comment' ) . "'>" . __( 'Unapprove' ) . '</a> | ';770 unset($actions['approve']);771 }772 773 762 $actions['edit'] = "<a href='comment.php?action=editcomment&c={$comment->comment_ID}' title='" . __('Edit comment') . "'>". __('Edit') . '</a> | '; 774 763 $actions['spam'] = "<a href='$spam_url' class='delete:the-comment-list:comment-$comment->comment_ID::spam=1' title='" . __( 'Mark this comment as spam' ) . "'>" . __( 'Spam' ) . '</a> | '; 775 764 $actions['delete'] = "<a href='$delete_url' class='delete:the-comment-list:comment-$comment->comment_ID delete'>" . __('Delete') . '</a>'; 765 766 if ( $comment_status ) { // not looking at all comments 767 if ( 'approved' == $the_comment_status ) { 768 $actions['unapprove'] = "<a href='$unapprove_url' class='delete:the-comment-list:comment-$comment->comment_ID:e7e7d3:action=dim-comment' title='" . __( 'Unapprove this comment' ) . "'>" . __( 'Unapprove' ) . '</a> | '; 769 unset($actions['approve']); 770 } else { 771 $actions['approve'] = "<a href='$approve_url' class='delete:the-comment-list:comment-$comment->comment_ID:e7e7d3:action=dim-comment' title='" . __( 'Approve this comment' ) . "'>" . __( 'Approve' ) . '</a> | '; 772 unset($actions['unapprove']); 773 } 774 } 775 776 if ( 'spam' == $the_comment_status ) 777 unset($actions['spam']); 778 776 779 $actions = apply_filters( 'comment_row_actions', $actions, $comment ); 780 777 781 foreach ( $actions as $action => $link ) 778 782 echo "<span class='$action'>$link</span>"; branches/crazyhorse/wp-admin/js/edit-comments.js
r7462 r8277 56 56 a.html( n.toString() ); 57 57 }); 58 $('li span.spam-comment-count' ).each( function() { 59 var a = $(this); 60 var n = parseInt(a.html(),10); 61 if ( $(settings.target).parents( 'span.spam' ).size() ) { // we marked a comment as spam 62 n = n + 1; 63 } else if ( $('#' + settings.element).is('.spam') ) { // we approved or deleted a comment marked as spam 64 n = n - 1; 65 } 66 if ( n < 0 ) { n = 0; } 67 a.html( n.toString() ); 68 }); 58 69 59 70 if ( theExtraList.size() == 0 || theExtraList.children().size() == 0 ) { branches/crazyhorse/wp-admin/wp-admin.css
r8271 r8277 247 247 } 248 248 249 .unapproved .approve {249 .unapproved .approve, .spam .approve { 250 250 display: inline; 251 251 }
