WordPress.org

Make WordPress Core


Ignore:
Timestamp:
11/06/2008 09:56:29 PM (13 years ago)
Author:
azaozz
Message:

Implementing new design for Edit Posts, Comments, etc. lists, props mdawaffe, see #8083

File:
1 edited

Legend:

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

    r9545 r9556  
    121121$status_links = array();
    122122$num_comments = wp_count_comments();
     123//, number_format_i18n($num_comments->moderated) ), "<span class='comment-count'>" . number_format_i18n($num_comments->moderated) . "</span>"),
     124//, number_format_i18n($num_comments->spam) ), "<span class='spam-comment-count'>" . number_format_i18n($num_comments->spam) . "</span>")
    123125$stati = array(
    124         '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>"),
    125         'approved' => _c('Approved|plural'),
    126         '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>")
     126        'moderated' => __ngettext_noop('Awaiting Moderation <span class="count">(%s)</span>', 'Awaiting Moderation <span class="count">(%s)</span>'),
     127        'approved' => __ngettext_noop('Approved', 'Approved'), // singular not used
     128        'spam' => __ngettext_noop('Spam <span class="count">(%s)</span>', 'Spam <span class="count">(%s)</span>')
    127129    );
    128130$class = ( '' === $comment_status ) ? ' class="current"' : '';
    129 $status_links[] = "<li><a href=\"edit-comments.php\"$class>".__('Show All Comments')."</a>";
     131$status_links[] = "<li><a href='edit-comments.php'$class>" . __( 'All' ) . '</a>';
    130132$type = ( !$comment_type && 'all' != $comment_type ) ? '' : "&amp;comment_type=$comment_type";
    131133foreach ( $stati as $status => $label ) {
     
    134136    if ( $status == $comment_status )
    135137        $class = ' class="current"';
    136 
    137     $status_links[] = "<li class='$status'><a href=\"edit-comments.php?comment_status=$status$type\"$class>$label</a>";
     138    if ( !isset( $num_comments->$status ) )
     139        $num_comments->$status = 10;
     140
     141    $status_links[] = "<li class='$status'><a href='edit-comments.php?comment_status=$status$type'$class>" . sprintf(
     142        __ngettext( $label[0], $label[1], $num_comments->$status ),
     143        number_format_i18n( $num_comments->$status )
     144    ) . '</a>';
    138145}
    139146
    140147$status_links = apply_filters( 'comment_status_links', $status_links );
    141148
    142 echo implode(' | </li>', $status_links) . '</li>';
     149echo implode( " |</li>\n", $status_links) . '</li>';
    143150unset($status_links);
    144151?>
     
    183190<div class="tablenav">
    184191
    185 <?php
    186 if ( $page_links )
    187     echo "<div class='tablenav-pages'>$page_links</div>";
    188 ?>
     192<?php if ( $page_links ) : ?>
     193<div class="tablenav-pages"><?php $page_links_text = sprintf( '<span class="displaying-num">' . __( 'Displaying %s-%s of %s' ) . '</span>' . __( '%s' ),
     194    number_format_i18n( $start + 1 ),
     195    number_format_i18n( min( $page * $comments_per_page, $total ) ),
     196    number_format_i18n( $total ),
     197    $page_links
     198); echo $page_links_text; ?></div>
     199<?php endif; ?>
    189200
    190201<div class="alignleft actions">
     
    271282<?php
    272283if ( $page_links )
    273     echo "<div class='tablenav-pages'>$page_links</div>";
     284    echo "<div class='tablenav-pages'>$page_links_text</div>";
    274285?>
    275286
Note: See TracChangeset for help on using the changeset viewer.