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/upload.php

    r9545 r9556  
    186186$type_links = array();
    187187$_num_posts = (array) wp_count_attachments();
     188$_total_posts = array_sum( $_num_posts );
    188189$matches = wp_match_mime_types(array_keys($post_mime_types), array_keys($_num_posts));
    189190foreach ( $matches as $type => $reals )
     
    192193
    193194$class = empty($_GET['post_mime_type']) && ! isset($_GET['detached']) ? ' class="current"' : '';
    194 $type_links[] = "<li><a href=\"upload.php\"$class>".__('All Types')."</a>";
     195$type_links[] = "<li><a href='upload.php'$class>" . sprintf( __ngettext( 'All <span class="count">(%s)</span>', 'All <span class="count">(%s)</span>', $_total_posts ), number_format_i18n( $_total_posts ) ) . '</a>';
    195196foreach ( $post_mime_types as $mime_type => $label ) {
    196197    $class = '';
     
    202203        $class = ' class="current"';
    203204
    204     $type_links[] = "<li><a href=\"upload.php?post_mime_type=$mime_type\"$class>" .
    205     sprintf(__ngettext($label[2][0], $label[2][1], $num_posts[$mime_type]), number_format_i18n( $num_posts[$mime_type] )) . '</a>';
     205    $type_links[] = "<li><a href='upload.php?post_mime_type=$mime_type'$class>" . sprintf( __ngettext( $label[2][0], $label[2][1], $num_posts[$mime_type] ), number_format_i18n( $num_posts[$mime_type] )) . '</a>';
    206206}
    207207$class = isset($_GET['detached']) ? ' class="current"' : '';
    208208$type_links[] = '<li><a href="upload.php?detached=1"' . $class . '>' . __('Unattached') . '</a>';
    209209
    210 echo implode(' | </li>', $type_links) . '</li>';
     210echo implode( " |</li>\n", $type_links) . '</li>';
    211211unset($type_links);
    212212?>
     
    236236));
    237237
    238 if ( $page_links )
    239     echo "<div class='tablenav-pages'>$page_links</div>";
    240 ?>
     238if ( $page_links ) : ?>
     239<div class="tablenav-pages"><?php $page_links_text = sprintf( '<span class="displaying-num">' . __( 'Displaying %s-%s of %s' ) . '</span>' . __( '%s' ),
     240    number_format_i18n( ( $_GET['paged'] - 1 ) * $wp_query->query_vars['posts_per_page'] + 1 ),
     241    number_format_i18n( min( $_GET['paged'] * $wp_query->query_vars['posts_per_page'], $wp_query->found_posts ) ),
     242    number_format_i18n( $wp_query->found_posts ),
     243    $page_links
     244); echo $page_links_text; ?></div>
     245<?php endif; ?>
    241246
    242247<div class="alignleft actions">
     
    387392<?php
    388393if ( $page_links )
    389     echo "<div class='tablenav-pages'>$page_links</div>";
     394    echo "<div class='tablenav-pages'>$page_links_text</div>";
    390395?>
    391396
Note: See TracChangeset for help on using the changeset viewer.