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-pages.php

    r9545 r9556  
    7474
    7575$post_stati  = array(   //  array( adj, noun )
    76         'publish' => array(__('Published'), __('Published pages'), __ngettext_noop('Published (%s)', 'Published (%s)')),
    77         'future' => array(__('Scheduled'), __('Scheduled pages'), __ngettext_noop('Scheduled (%s)', 'Scheduled (%s)')),
    78         'pending' => array(__('Pending Review'), __('Pending pages'), __ngettext_noop('Pending Review (%s)', 'Pending Review (%s)')),
    79         'draft' => array(__('Draft'), _c('Drafts|manage posts header'), __ngettext_noop('Draft (%s)', 'Drafts (%s)')),
    80         'private' => array(__('Private'), __('Private pages'), __ngettext_noop('Private (%s)', 'Private (%s)'))
     76        'publish' => array(__('Published'), __('Published pages'), __ngettext_noop('Published <span class="count">(%s)</span>', 'Published <span class="count">(%s)</span>')),
     77        'future' => array(__('Scheduled'), __('Scheduled pages'), __ngettext_noop('Scheduled <span class="count">(%s)</span>', 'Scheduled <span class="count">(%s)</span>')),
     78        'pending' => array(__('Pending Review'), __('Pending pages'), __ngettext_noop('Pending Review <span class="count">(%s)</span>', 'Pending Review <span class="count">(%s)</span>')),
     79        'draft' => array(__('Draft'), _c('Drafts|manage posts header'), __ngettext_noop('Draft <span class="count">(%s)</span>', 'Drafts</a> <span class="count">(%s)</span>')),
     80        'private' => array(__('Private'), __('Private pages'), __ngettext_noop('<a %s>Private</a> <span class="count">(%s)</span>', '<a %s>Private</a> <span class="count">(%s)</span>'))
    8181    );
    8282
     
    138138$status_links = array();
    139139$num_posts = wp_count_posts('page', 'readable');
     140$total_posts = array_sum( (array) $num_posts );
    140141$class = empty($_GET['post_status']) ? ' class="current"' : '';
    141 $status_links[] = "<li><a href=\"edit-pages.php\"$class>".__('All Pages')."</a>";
     142$status_links[] = "<li><a href='edit-pages.php'$class>" . sprintf( __ngettext( 'All <span class="count">(%s)</span>', 'All <span class="count">(%s)</span>', $total_posts ), number_format_i18n( $total_posts ) ) . '</a>';
    142143foreach ( $post_stati as $status => $label ) {
    143144    $class = '';
     
    149150        $class = ' class="current"';
    150151
    151     $status_links[] = "<li><a href=\"edit-pages.php?post_status=$status\"$class>" .
    152     sprintf(__ngettext($label[2][0], $label[2][1], $num_posts->$status), number_format_i18n( $num_posts->$status ) ) . '</a>';
    153 }
    154 echo implode(' |</li>', $status_links) . '</li>';
     152    $status_links[] = "<li><a href='edit-pages.php?post_status=$status'$class>" . sprintf( __ngettext( $label[2][0], $label[2][1], $num_posts->$status ), number_format_i18n( $num_posts->$status ) ) . '</a>';
     153}
     154echo implode( " |</li>\n", $status_links ) . '</li>';
    155155unset($status_links);
    156156endif;
     
    187187));
    188188
    189 if ( $page_links )
    190     echo "<div class='tablenav-pages'>$page_links</div>";
    191 ?>
     189if ( $page_links ) : ?>
     190<div class="tablenav-pages"><?php $page_links_text = sprintf( '<span class="displaying-num">' . __( 'Displaying %s-%s of %s' ) . '</span>' . __( '%s' ),
     191    number_format_i18n( ( $_GET['paged'] - 1 ) * $wp_query->query_vars['posts_per_page'] + 1 ),
     192    number_format_i18n( min( $_GET['paged'] * $wp_query->query_vars['posts_per_page'], $wp_query->found_posts ) ),
     193    number_format_i18n( $wp_query->found_posts ),
     194    $page_links
     195); echo $page_links_text; ?></div>
     196<?php endif; ?>
    192197
    193198<div class="alignleft actions">
     
    231236<?php
    232237if ( $page_links )
    233     echo "<div class='tablenav-pages'>$page_links</div>";
     238    echo "<div class='tablenav-pages'>$page_links_text</div>";
    234239?>
    235240
Note: See TracChangeset for help on using the changeset viewer.