-<div id="message" class="updated"><p><?php echo $message; ?></p></div>
-<?php } ?>
-
-<ul class="subsubsub">
-<?php
-$type_links = array();
-$_num_posts = (array) wp_count_attachments();
-$_total_posts = array_sum($_num_posts) - $_num_posts['trash'];
-if ( !isset( $total_orphans ) )
- $total_orphans = $wpdb->get_var( "SELECT COUNT( * ) FROM $wpdb->posts WHERE post_type = 'attachment' AND post_status != 'trash' AND post_parent < 1" );
-$matches = wp_match_mime_types(array_keys($post_mime_types), array_keys($_num_posts));
-foreach ( $matches as $type => $reals )
- foreach ( $reals as $real )
- $num_posts[$type] = ( isset( $num_posts[$type] ) ) ? $num_posts[$type] + $_num_posts[$real] : $_num_posts[$real];
-
-$class = ( empty($_GET['post_mime_type']) && !isset($_GET['detached']) && !isset($_GET['status']) ) ? ' class="current"' : '';
-$type_links[] = "<li><a href='upload.php'$class>" . sprintf( _nx( 'All <span class="count">(%s)</span>', 'All <span class="count">(%s)</span>', $_total_posts, 'uploaded files' ), number_format_i18n( $_total_posts ) ) . '</a>';
-foreach ( $post_mime_types as $mime_type => $label ) {
- $class = '';
-
- if ( !wp_match_mime_types($mime_type, $avail_post_mime_types) )
- continue;
-
- if ( !empty($_GET['post_mime_type']) && wp_match_mime_types($mime_type, $_GET['post_mime_type']) )
- $class = ' class="current"';
- if ( !empty( $num_posts[$mime_type] ) )
- $type_links[] = "<li><a href='upload.php?post_mime_type=$mime_type'$class>" . sprintf( _n( $label[2][0], $label[2][1], $num_posts[$mime_type] ), number_format_i18n( $num_posts[$mime_type] )) . '</a>';
-}
-$type_links[] = '<li><a href="upload.php?detached=1"' . ( isset($_GET['detached']) ? ' class="current"' : '' ) . '>' . sprintf( _nx( 'Unattached <span class="count">(%s)</span>', 'Unattached <span class="count">(%s)</span>', $total_orphans, 'detached files' ), number_format_i18n( $total_orphans ) ) . '</a>';
-
-if ( !empty($_num_posts['trash']) )
- $type_links[] = '<li><a href="upload.php?status=trash"' . ( (isset($_GET['status']) && $_GET['status'] == 'trash' ) ? ' class="current"' : '') . '>' . sprintf( _nx( 'Trash <span class="count">(%s)</span>', 'Trash <span class="count">(%s)</span>', $_num_posts['trash'], 'uploaded files' ), number_format_i18n( $_num_posts['trash'] ) ) . '</a>';
-
-echo implode( " |</li>\n", $type_links) . '</li>';
-unset($type_links);
-?>
-</ul>
-
-<form class="search-form" action="" method="get">
-<p class="search-box">
- <label class="screen-reader-text" for="media-search-input"><?php _e( 'Search Media' ); ?>:</label>
- <input type="text" id="media-search-input" name="s" value="<?php the_search_query(); ?>" />
- <input type="submit" value="<?php esc_attr_e( 'Search Media' ); ?>" class="button" />
-</p>
-</form>
-
-<form id="posts-filter" action="" method="get">
-<?php wp_nonce_field('bulk-media'); ?>
-<?php if ( have_posts() || isset( $orphans ) ) { ?>
-<div class="tablenav">
-<?php
-if ( ! isset($page_links_total) )
- $page_links_total = $wp_query->max_num_pages;
-
-$page_links = paginate_links( array(
- 'base' => add_query_arg( 'paged', '%#%' ),
- 'format' => '',
- 'prev_text' => __('«'),
- 'next_text' => __('»'),
- 'total' => $page_links_total,
- 'current' => $_GET['paged']
-));
-
-if ( $page_links ) : ?>
-<div class="tablenav-pages"><?php $page_links_text = sprintf( '<span class="displaying-num">' . __( 'Displaying %s–%s of %s' ) . '</span>%s',
- number_format_i18n( ( $_GET['paged'] - 1 ) * $wp_query->query_vars['posts_per_page'] + 1 ),
- number_format_i18n( min( $_GET['paged'] * $wp_query->query_vars['posts_per_page'], $wp_query->found_posts ) ),
- number_format_i18n( $wp_query->found_posts ),
- $page_links
-); echo $page_links_text; ?></div>
-<?php endif; ?>
-
-<div class="alignleft actions">
-<?php if ( ! isset( $orphans ) || ! empty( $orphans ) ) { ?>
-<select name="action" class="select-action">
-<option value="-1" selected="selected"><?php _e('Bulk Actions'); ?></option>
-<?php if ( $is_trash ) { ?>
-<option value="untrash"><?php _e('Restore'); ?></option>
-<?php } if ( $is_trash || !EMPTY_TRASH_DAYS || !MEDIA_TRASH ) { ?>
-<option value="delete"><?php _e('Delete Permanently'); ?></option>
-<?php } else { ?>
-<option value="trash"><?php _e('Move to Trash'); ?></option>
-<?php } if ( isset($orphans) ) { ?>
-<option value="attach"><?php _e('Attach to a post'); ?></option>
-<?php } ?>
-</select>
-<input type="submit" value="<?php esc_attr_e('Apply'); ?>" name="doaction" id="doaction" class="button-secondary action" />
-
-<?php
-if ( !is_singular() && !isset($_GET['detached']) && !$is_trash ) {
- $arc_query = "SELECT DISTINCT YEAR(post_date) AS yyear, MONTH(post_date) AS mmonth FROM $wpdb->posts WHERE post_type = 'attachment' ORDER BY post_date DESC";
-
- $arc_result = $wpdb->get_results( $arc_query );
-
- $month_count = count($arc_result);
-
- if ( $month_count && !( 1 == $month_count && 0 == $arc_result[0]->mmonth ) ) : ?>
-<select name='m'>
-<option value='0'><?php _e('Show all dates'); ?></option>
-<?php
-foreach ($arc_result as $arc_row) {
- if ( $arc_row->yyear == 0 )
- continue;
- $arc_row->mmonth = zeroise( $arc_row->mmonth, 2 );
-
- if ( isset($_GET['m']) && ( $arc_row->yyear . $arc_row->mmonth == $_GET['m'] ) )
- $default = ' selected="selected"';
- else
- $default = '';
-
- echo "<option$default value='" . esc_attr("$arc_row->yyear$arc_row->mmonth") . "'>";
- echo $wp_locale->get_month($arc_row->mmonth) . " $arc_row->yyear";
- echo "</option>\n";
-}
-?>
-</select>
-<?php endif; // month_count ?>
-
-<?php do_action('restrict_manage_posts'); ?>
-
-<input type="submit" id="post-query-submit" value="<?php esc_attr_e('Filter'); ?>" class="button-secondary" />
-
-<?php } // ! is_singular ?>
-
-<?php
-
-} // ! empty( $orphans )
-
-if ( isset($_GET['detached']) ) { ?>
- <input type="submit" id="find_detached" name="find_detached" value="<?php esc_attr_e('Scan for lost attachments'); ?>" class="button-secondary" />
-<?php } elseif ( isset($_GET['status']) && $_GET['status'] == 'trash' && current_user_can('edit_others_posts') ) { ?>
- <input type="submit" id="delete_all" name="delete_all" value="<?php esc_attr_e('Empty Trash'); ?>" class="button-secondary apply" />