-<?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" />
-<?php } ?>
-
-</div>
-
-<br class="clear" />
-</div>
-
-<?php } // have_posts() || !empty( $orphans ) ?>
-
-<div class="clear"></div>
-
-<?php if ( ! empty( $orphans ) ) { ?>
-<table class="widefat" cellspacing="0">
-<thead>
-<tr>
- <th scope="col" class="check-column"><input type="checkbox" /></th>
- <th scope="col"></th>
- <th scope="col"><?php /* translators: column name in media */ _ex('Media', 'media column name'); ?></th>
- <th scope="col"><?php /* translators: column name in media */ _ex('Author', 'media column name'); ?></th>
- <th scope="col"><?php /* translators: column name in media */ _ex('Date Added', 'media column name'); ?></th>
-</tr>
-</thead>
-
-<tfoot>
-<tr>
- <th scope="col" class="check-column"><input type="checkbox" /></th>
- <th scope="col"></th>
- <th scope="col"><?php /* translators: column name in media */ _ex('Media', 'media column name'); ?></th>
- <th scope="col"><?php /* translators: column name in media */ _ex('Author', 'media column name'); ?></th>
- <th scope="col"><?php /* translators: column name in media */ _ex('Date Added', 'media column name'); ?></th>
-</tr>
-</tfoot>
-
-<tbody id="the-list" class="list:post">
-<?php
- foreach ( $orphans as $post ) {
- $class = 'alternate' == $class ? '' : 'alternate';
- $att_title = esc_html( _draft_or_post_title($post->ID) );
-?>
- <tr id='post-<?php echo $post->ID; ?>' class='<?php echo $class; ?>' valign="top">
- <th scope="row" class="check-column"><?php if ( current_user_can('edit_post', $post->ID) ) { ?><input type="checkbox" name="media[]" value="<?php echo esc_attr($post->ID); ?>" /><?php } ?></th>
-
- <td class="media-icon"><?php
- if ( $thumb = wp_get_attachment_image( $post->ID, array(80, 60), true ) ) { ?>
- <a href="media.php?action=edit&attachment_id=<?php echo $post->ID; ?>" title="<?php echo esc_attr(sprintf(__('Edit “%s”'), $att_title)); ?>"><?php echo $thumb; ?></a>
-<?php } ?></td>
-
- <td class="media column-media"><strong><a href="<?php echo get_edit_post_link( $post->ID ); ?>" title="<?php echo esc_attr(sprintf(__('Edit “%s”'), $att_title)); ?>"><?php echo $att_title; ?></a></strong><br />
- <?php
- if ( preg_match( '/^.*?\.(\w+)$/', get_attached_file( $post->ID ), $matches ) )
- echo esc_html( strtoupper( $matches[1] ) );
- else
- echo strtoupper( str_replace( 'image/', '', get_post_mime_type() ) );
- ?>
-
- <div class="row-actions">
- <?php
- $actions = array();
- if ( current_user_can('edit_post', $post->ID) )
- $actions['edit'] = '<a href="' . get_edit_post_link($post->ID, true) . '">' . __('Edit') . '</a>';
- if ( current_user_can('delete_post', $post->ID) )
- if ( EMPTY_TRASH_DAYS && MEDIA_TRASH ) {
- $actions['trash'] = "<a class='submitdelete' href='" . wp_nonce_url("post.php?action=trash&post=$post->ID", 'trash-attachment_' . $post->ID) . "'>" . __('Trash') . "</a>";
- } else {
- $delete_ays = !MEDIA_TRASH ? " onclick='return showNotice.warn();'" : '';
- $actions['delete'] = "<a class='submitdelete'$delete_ays href='" . wp_nonce_url("post.php?action=delete&post=$post->ID", 'delete-attachment_' . $post->ID) . "'>" . __('Delete Permanently') . "</a>";
- }
- $actions['view'] = '<a href="' . get_permalink($post->ID) . '" title="' . esc_attr(sprintf(__('View “%s”'), $title)) . '" rel="permalink">' . __('View') . '</a>';
- if ( current_user_can('edit_post', $post->ID) )
- $actions['attach'] = '<a href="#the-list" onclick="findPosts.open(\'media[]\',\''.$post->ID.'\');return false;" class="hide-if-no-js">'.__('Attach').'</a>';
- $actions = apply_filters( 'media_row_actions', $actions, $post );
- $action_count = count($actions);
- $i = 0;
- foreach ( $actions as $action => $link ) {
- ++$i;
- ( $i == $action_count ) ? $sep = '' : $sep = ' | ';
- echo "<span class='$action'>$link$sep</span>";
- } ?>
- </div></td>
- <td class="author column-author"><?php $author = get_userdata($post->post_author); echo $author->display_name; ?></td>
-<?php if ( '0000-00-00 00:00:00' == $post->post_date && 'date' == $column_name ) {
- $t_time = $h_time = __('Unpublished');
- } else {
- $t_time = get_the_time(__('Y/m/d g:i:s A'));
- $m_time = $post->post_date;
- $time = get_post_time( 'G', true );
- if ( ( abs($t_diff = time() - $time) ) < 86400 ) {
- if ( $t_diff < 0 )
- $h_time = sprintf( __('%s from now'), human_time_diff( $time ) );
- else
- $h_time = sprintf( __('%s ago'), human_time_diff( $time ) );
- } else {
- $h_time = mysql2date(__('Y/m/d'), $m_time);
- }
- } ?>
- <td class="date column-date"><?php echo $h_time ?></td>
- </tr>
-<?php } ?>
-</tbody>
-</table>
-
-<?php
-
-} else {
- include( './edit-attachment-rows.php' );
-} ?>