Make WordPress Core


Ignore:
Timestamp:
08/20/2008 04:06:36 AM (16 years ago)
Author:
ryan
Message:

Merge crazyhorse management pages. see #7552

File:
1 edited

Legend:

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

    r8656 r8682  
    1111
    1212$title = __('Edit Comments');
    13 $parent_file = 'edit-comments.php';
    1413wp_enqueue_script( 'admin-comments' );
    1514wp_enqueue_script('admin-forms');
    1615
    17 if ( !empty( $_REQUEST['delete_comments'] ) ) {
     16if ( !empty( $_REQUEST['delete_comments'] ) && isset($_REQUEST['action']) ) {
    1817    check_admin_referer('bulk-comments');
    1918
     
    2423        if ( !current_user_can('edit_post', $post_id) )
    2524            continue;
    26         if ( !empty( $_REQUEST['spamit'] ) ) {
     25        if ( $_REQUEST['action'] == 'markspam' ) {
    2726            wp_set_comment_status($comment, 'spam');
    2827            $comments_spammed++;
    29         } elseif ( !empty( $_REQUEST['deleteit'] ) ) {
     28        } elseif ( $_REQUEST['action'] == 'delete' ) {
    3029            wp_set_comment_status($comment, 'delete');
    3130            $comments_deleted++;
    32         } elseif ( !empty( $_REQUEST['approveit'] ) ) {
     31        } elseif ( $_REQUEST['action'] == 'approve' ) {
    3332            wp_set_comment_status($comment, 'approve');
    3433            $comments_approved++;
    35         } elseif ( !empty( $_REQUEST['unapproveit'] ) ) {
     34        } elseif ( $_REQUEST['action'] == 'unapprove' ) {
    3635            wp_set_comment_status($comment, 'hold');
    3736            $comments_unapproved++;
     
    107106$status_links = array();
    108107$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    );
    110113$class = ( '' === $comment_status ) ? ' class="current"' : '';
    111114$status_links[] = "<li><a href=\"edit-comments.php\"$class>".__('Show All Comments')."</a>";
     
    116119        $class = ' class="current"';
    117120
    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>";
    119123}
    120124
     
    136140</form>
    137141
     142<!-- crazyhorse
    138143<ul class="view-switch">
    139144    <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>
    140145    <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>
    141146</ul>
     147-->
    142148
    143149<?php
     
    176182
    177183<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'); ?>
    180190<?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>
    184193<?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>
    186196<?php do_action('manage_comments_nav', $comment_status); ?>
    187197<?php wp_nonce_field('bulk-comments'); ?>
     198<input type="submit" name="doaction" value="Apply" class="button-secondary apply" />
    188199<?php if ( isset($_GET['apage']) ) { ?>
    189200    <input type="hidden" name="apage" value="<?php echo absint( $_GET['apage'] ); ?>" />
     
    203214  <tr>
    204215    <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>
    208220  </tr>
    209221</thead>
Note: See TracChangeset for help on using the changeset viewer.