Changeset 8682 for trunk/wp-admin/edit-comments.php
- Timestamp:
- 08/20/2008 04:06:36 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/edit-comments.php
r8656 r8682 11 11 12 12 $title = __('Edit Comments'); 13 $parent_file = 'edit-comments.php';14 13 wp_enqueue_script( 'admin-comments' ); 15 14 wp_enqueue_script('admin-forms'); 16 15 17 if ( !empty( $_REQUEST['delete_comments'] ) ) {16 if ( !empty( $_REQUEST['delete_comments'] ) && isset($_REQUEST['action']) ) { 18 17 check_admin_referer('bulk-comments'); 19 18 … … 24 23 if ( !current_user_can('edit_post', $post_id) ) 25 24 continue; 26 if ( !empty( $_REQUEST['spamit'] )) {25 if ( $_REQUEST['action'] == 'markspam' ) { 27 26 wp_set_comment_status($comment, 'spam'); 28 27 $comments_spammed++; 29 } elseif ( !empty( $_REQUEST['deleteit'] )) {28 } elseif ( $_REQUEST['action'] == 'delete' ) { 30 29 wp_set_comment_status($comment, 'delete'); 31 30 $comments_deleted++; 32 } elseif ( !empty( $_REQUEST['approveit'] )) {31 } elseif ( $_REQUEST['action'] == 'approve' ) { 33 32 wp_set_comment_status($comment, 'approve'); 34 33 $comments_approved++; 35 } elseif ( !empty( $_REQUEST['unapproveit'] )) {34 } elseif ( $_REQUEST['action'] == 'unapprove' ) { 36 35 wp_set_comment_status($comment, 'hold'); 37 36 $comments_unapproved++; … … 107 106 $status_links = array(); 108 107 $num_comments = wp_count_comments(); 109 $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')); 108 $stati = array( 109 '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>"), 110 'approved' => _c('Approved|plural'), 111 '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>") 112 ); 110 113 $class = ( '' === $comment_status ) ? ' class="current"' : ''; 111 114 $status_links[] = "<li><a href=\"edit-comments.php\"$class>".__('Show All Comments')."</a>"; … … 116 119 $class = ' class="current"'; 117 120 118 $status_links[] = "<li><a href=\"edit-comments.php?comment_status=$status\"$class>" . $label . '</a>'; 121 122 $status_links[] = "<li class='$status'><a href=\"edit-comments.php?comment_status=$status\"$class>$label</a>"; 119 123 } 120 124 … … 136 140 </form> 137 141 142 <!-- crazyhorse 138 143 <ul class="view-switch"> 139 144 <li <?php if ( 'detail' == $mode ) echo "class='current'" ?>><a href="<?php echo clean_url(add_query_arg('mode', 'detail', $_SERVER['REQUEST_URI'])) ?>"><?php _e('Detail View') ?></a></li> 140 145 <li <?php if ( 'list' == $mode ) echo "class='current'" ?>><a href="<?php echo clean_url(add_query_arg('mode', 'list', $_SERVER['REQUEST_URI'])) ?>"><?php _e('List View') ?></a></li> 141 146 </ul> 147 --> 142 148 143 149 <?php … … 176 182 177 183 <div class="alignleft"> 178 <?php if ( 'approved' != $comment_status ): ?> 179 <input type="submit" value="<?php _e('Approve'); ?>" name="approveit" class="button-secondary" /> 184 <select name="action"> 185 <option value="" selected>Actions</option> 186 <?php if ( 'approved' == $comment_status ): ?> 187 <option value="unapprove"><?php _e('Unapprove'); ?></option> 188 <?php else : ?> 189 <option value="approve"><?php _e('Approve'); ?> 180 190 <?php endif; ?> 181 <input type="submit" value="<?php _e('Mark as Spam'); ?>" name="spamit" class="button-secondary" /> 182 <?php if ( 'moderated' != $comment_status ): ?> 183 <input type="submit" value="<?php _e('Unapprove'); ?>" name="unapproveit" class="button-secondary" /> 191 <?php if ( 'spam' != $comment_status ): ?> 192 <option value="markspam"><?php _e('Mark as Spam'); ?></option> 184 193 <?php endif; ?> 185 <input type="submit" value="<?php _e('Delete'); ?>" name="deleteit" class="button-secondary delete" /> 194 <option value="delete"><?php _e('Delete'); ?></option> 195 </select> 186 196 <?php do_action('manage_comments_nav', $comment_status); ?> 187 197 <?php wp_nonce_field('bulk-comments'); ?> 198 <input type="submit" name="doaction" value="Apply" class="button-secondary apply" /> 188 199 <?php if ( isset($_GET['apage']) ) { ?> 189 200 <input type="hidden" name="apage" value="<?php echo absint( $_GET['apage'] ); ?>" /> … … 203 214 <tr> 204 215 <th scope="col" class="check-column"><input type="checkbox" /></th> 205 <th scope="col"><?php _e('Comment') ?></th> 206 <th scope="col"><?php _e('Date') ?></th> 207 <th scope="col" class="action-links"><?php _e('Actions') ?></th> 216 <th scope="col" class="comment-column"><?php _e('Comment') ?></th> 217 <th scope="col" class="author-column"><?php _e('Author') ?></th> 218 <th scope="col" class="date-column"><?php _e('Comment Submitted') ?></th> 219 <th scope="col" class="response-column"><?php _e('In Response To This Post') ?></th> 208 220 </tr> 209 221 </thead>
Note: See TracChangeset
for help on using the changeset viewer.