2007-10-17 12:51:31 -04:00
|
|
|
<?php if ( ! defined('ABSPATH') ) die(); ?>
|
2007-08-23 18:19:53 -04:00
|
|
|
<table class="widefat">
|
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
|
2008-02-12 00:51:53 -05:00
|
|
|
<?php $posts_columns = wp_manage_posts_columns(); ?>
|
2007-08-23 18:19:53 -04:00
|
|
|
<?php foreach($posts_columns as $column_display_name) { ?>
|
|
|
|
<th scope="col"><?php echo $column_display_name; ?></th>
|
|
|
|
<?php } ?>
|
|
|
|
|
|
|
|
</tr>
|
|
|
|
</thead>
|
2007-10-09 18:49:42 -04:00
|
|
|
<tbody id="the-list" class="list:post">
|
2007-08-23 18:19:53 -04:00
|
|
|
<?php
|
2007-10-09 18:49:42 -04:00
|
|
|
$i_post = 0;
|
2007-08-23 18:19:53 -04:00
|
|
|
if ( have_posts() ) {
|
|
|
|
$bgcolor = '';
|
|
|
|
add_filter('the_title','wp_specialchars');
|
2007-10-09 18:49:42 -04:00
|
|
|
while (have_posts()) : the_post(); $i_post++;
|
|
|
|
if ( 16 == $i_post )
|
2007-10-18 18:09:56 -04:00
|
|
|
echo "\t</tbody>\n\t<tbody id='the-extra-list' class='list:post' style='display: none'>\n"; // Hack!
|
2007-10-09 18:49:42 -04:00
|
|
|
$class = ( $i_post > 15 || 'alternate' == $class) ? '' : 'alternate';
|
2007-08-23 18:19:53 -04:00
|
|
|
global $current_user;
|
|
|
|
$post_owner = ( $current_user->ID == $post->post_author ? 'self' : 'other' );
|
|
|
|
?>
|
2008-02-10 03:10:11 -05:00
|
|
|
<tr id='post-<?php echo $id; ?>' class='<?php echo trim( $class . ' author-' . $post_owner . ' status-' . $post->post_status ); ?>' valign="top">
|
2007-08-23 18:19:53 -04:00
|
|
|
|
|
|
|
<?php
|
|
|
|
|
|
|
|
foreach($posts_columns as $column_name=>$column_display_name) {
|
|
|
|
|
|
|
|
switch($column_name) {
|
|
|
|
|
2008-02-10 03:10:11 -05:00
|
|
|
case 'cb':
|
2007-08-23 18:19:53 -04:00
|
|
|
?>
|
2008-02-10 03:10:11 -05:00
|
|
|
<th scope="row" style="text-align: center"><input type="checkbox" name="delete[]" value="<?php the_ID(); ?>" /></th>
|
2007-08-23 18:19:53 -04:00
|
|
|
<?php
|
|
|
|
break;
|
|
|
|
case 'modified':
|
|
|
|
?>
|
2008-02-10 03:10:11 -05:00
|
|
|
<td><?php if ( '0000-00-00 00:00:00' ==$post->post_modified ) _e('Never'); else the_modified_time(__('Y/m/d \<\b\r \/\> g:i:s a')); ?></td>
|
2007-08-23 18:19:53 -04:00
|
|
|
<?php
|
|
|
|
break;
|
|
|
|
case 'date':
|
|
|
|
?>
|
2008-02-10 03:10:11 -05:00
|
|
|
<td><a href="<?php the_permalink(); ?>" rel="permalink">
|
|
|
|
<?php
|
|
|
|
if ( '0000-00-00 00:00:00' ==$post->post_date ) {
|
|
|
|
_e('Unpublished');
|
|
|
|
} else {
|
2008-02-11 16:52:50 -05:00
|
|
|
if ( ( abs(time() - get_post_time()) ) < 86400 ) {
|
|
|
|
if ( ( 'future' == $post->post_status) )
|
|
|
|
echo sprintf( __('%s from now'), human_time_diff( get_post_time() ) );
|
|
|
|
else
|
|
|
|
echo sprintf( __('%s ago'), human_time_diff( get_post_time() ) );
|
|
|
|
} else {
|
2008-02-10 03:10:11 -05:00
|
|
|
the_time(__('Y/m/d'));
|
2008-02-11 16:52:50 -05:00
|
|
|
}
|
2008-02-10 03:10:11 -05:00
|
|
|
}
|
|
|
|
?></a></td>
|
2007-08-23 18:19:53 -04:00
|
|
|
<?php
|
|
|
|
break;
|
|
|
|
case 'title':
|
|
|
|
?>
|
2008-02-10 03:10:11 -05:00
|
|
|
<td><strong><a href="post.php?action=edit&post=<?php the_ID(); ?>"><?php the_title() ?></a></strong>
|
|
|
|
<?php if ('private' == $post->post_status) _e(' — <strong>Private</strong>'); ?></td>
|
2007-08-23 18:19:53 -04:00
|
|
|
<?php
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 'categories':
|
|
|
|
?>
|
2008-02-10 03:10:11 -05:00
|
|
|
<td><?php
|
|
|
|
$categories = get_the_category();
|
|
|
|
if ( !empty( $categories ) ) {
|
|
|
|
$out = array();
|
|
|
|
foreach ( $categories as $c )
|
|
|
|
$out[] = "<a href='edit.php?category_name=$c->slug'> " . wp_specialchars( $c->name) . "</a>";
|
|
|
|
echo join( ', ', $out );
|
|
|
|
} else {
|
|
|
|
_e('Uncategorized');
|
|
|
|
}
|
|
|
|
?></td>
|
|
|
|
<?php
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 'tags':
|
|
|
|
?>
|
|
|
|
<td><?php
|
|
|
|
$tags = get_the_tags();
|
|
|
|
if ( !empty( $tags ) ) {
|
|
|
|
$out = array();
|
|
|
|
foreach ( $tags as $c )
|
|
|
|
$out[] = "<a href='edit.php?tag=$c->slug'> " . wp_specialchars( $c->name) . "</a>";
|
|
|
|
echo join( ', ', $out );
|
|
|
|
} else {
|
|
|
|
_e('No Tags');
|
|
|
|
}
|
|
|
|
?></td>
|
2007-08-23 18:19:53 -04:00
|
|
|
<?php
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 'comments':
|
|
|
|
?>
|
|
|
|
<td style="text-align: center">
|
|
|
|
<?php
|
|
|
|
$left = get_pending_comments_num( $post->ID );
|
|
|
|
$pending_phrase = sprintf( __('%s pending'), number_format( $left ) );
|
|
|
|
if ( $left )
|
|
|
|
echo '<strong>';
|
2008-02-10 03:10:11 -05:00
|
|
|
comments_number("<a href='edit.php?p=$id&c=1' title='$pending_phrase' class='post-com-count comment-count'><span>" . __('0') . '</span></a>', "<a href='edit.php?p=$id&c=1' title='$pending_phrase' class='post-com-count comment-count'><span>" . __('1') . '</span></a>', "<a href='edit.php?p=$id&c=1' title='$pending_phrase' class='post-com-count comment-count'><span>" . __('%') . '</span></a>');
|
2007-08-23 18:19:53 -04:00
|
|
|
if ( $left )
|
|
|
|
echo '</strong>';
|
|
|
|
?>
|
|
|
|
</td>
|
|
|
|
<?php
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 'author':
|
|
|
|
?>
|
2008-02-10 03:10:11 -05:00
|
|
|
<td><a href="edit.php?author=<?php the_author_ID(); ?>"><?php the_author() ?></a></td>
|
|
|
|
<?php
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 'status':
|
|
|
|
?>
|
|
|
|
<td>
|
|
|
|
<?php
|
|
|
|
switch ( $post->post_status ) {
|
|
|
|
case 'publish' :
|
|
|
|
case 'private' :
|
|
|
|
_e('Published');
|
|
|
|
break;
|
|
|
|
case 'future' :
|
|
|
|
_e('Scheduled');
|
|
|
|
break;
|
|
|
|
case 'pending' :
|
|
|
|
_e('Pending Review');
|
|
|
|
break;
|
|
|
|
case 'draft' :
|
|
|
|
_e('Unpublished');
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
?>
|
|
|
|
</td>
|
2007-08-23 18:19:53 -04:00
|
|
|
<?php
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 'control_view':
|
|
|
|
?>
|
|
|
|
<td><a href="<?php the_permalink(); ?>" rel="permalink" class="view"><?php _e('View'); ?></a></td>
|
|
|
|
<?php
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 'control_edit':
|
|
|
|
?>
|
|
|
|
<td><?php if ( current_user_can('edit_post',$post->ID) ) { echo "<a href='post.php?action=edit&post=$id' class='edit'>" . __('Edit') . "</a>"; } ?></td>
|
|
|
|
<?php
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 'control_delete':
|
|
|
|
?>
|
2007-10-09 18:49:42 -04:00
|
|
|
<td><?php if ( current_user_can('delete_post',$post->ID) ) { echo "<a href='" . wp_nonce_url("post.php?action=delete&post=$id", 'delete-post_' . $post->ID) . "' class='delete:the-list:post-$post->ID delete'>" . __('Delete') . "</a>"; } ?></td>
|
2007-08-23 18:19:53 -04:00
|
|
|
<?php
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
?>
|
|
|
|
<td><?php do_action('manage_posts_custom_column', $column_name, $id); ?></td>
|
|
|
|
<?php
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
?>
|
2007-09-03 19:32:58 -04:00
|
|
|
</tr>
|
2007-08-23 18:19:53 -04:00
|
|
|
<?php
|
|
|
|
endwhile;
|
|
|
|
} else {
|
|
|
|
?>
|
2007-09-03 19:32:58 -04:00
|
|
|
<tr style='background-color: <?php echo $bgcolor; ?>'>
|
|
|
|
<td colspan="8"><?php _e('No posts found.') ?></td>
|
|
|
|
</tr>
|
2007-08-23 18:19:53 -04:00
|
|
|
<?php
|
|
|
|
} // end if ( have_posts() )
|
|
|
|
?>
|
|
|
|
</tbody>
|
|
|
|
</table>
|