New manage posts almost fully functional, and some admin CSS reorganization. TODO: Delete buttons and checkboxes are currently impotent.
git-svn-id: http://svn.automattic.com/wordpress/trunk@6778 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
@@ -22,7 +22,7 @@ $class = ( $i_post > 15 || 'alternate' == $class) ? '' : 'alternate';
|
||||
global $current_user;
|
||||
$post_owner = ( $current_user->ID == $post->post_author ? 'self' : 'other' );
|
||||
?>
|
||||
<tr id='post-<?php echo $id; ?>' class='<?php echo trim( $class . ' author-' . $post_owner . ' status-' . $post->post_status ); ?>'>
|
||||
<tr id='post-<?php echo $id; ?>' class='<?php echo trim( $class . ' author-' . $post_owner . ' status-' . $post->post_status ); ?>' valign="top">
|
||||
|
||||
<?php
|
||||
|
||||
@@ -30,31 +30,67 @@ foreach($posts_columns as $column_name=>$column_display_name) {
|
||||
|
||||
switch($column_name) {
|
||||
|
||||
case 'id':
|
||||
case 'cb':
|
||||
?>
|
||||
<th scope="row" style="text-align: center"><?php echo $id ?></th>
|
||||
<th scope="row" style="text-align: center"><input type="checkbox" name="delete[]" value="<?php the_ID(); ?>" /></th>
|
||||
<?php
|
||||
break;
|
||||
case 'modified':
|
||||
?>
|
||||
<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>
|
||||
<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>
|
||||
<?php
|
||||
break;
|
||||
case 'date':
|
||||
?>
|
||||
<td><?php if ( '0000-00-00 00:00:00' ==$post->post_date) _e('Unpublished'); else the_time(__('Y-m-d \<\b\r \/\> g:i:s a')); ?></td>
|
||||
<td><a href="<?php the_permalink(); ?>" rel="permalink">
|
||||
<?php
|
||||
if ( '0000-00-00 00:00:00' ==$post->post_date ) {
|
||||
_e('Unpublished');
|
||||
} else {
|
||||
if ( ( time() - get_post_time() ) < 86400 )
|
||||
echo sprintf( __('%s ago'), human_time_diff( get_post_time() ) );
|
||||
else
|
||||
the_time(__('Y/m/d'));
|
||||
}
|
||||
?></a></td>
|
||||
<?php
|
||||
break;
|
||||
case 'title':
|
||||
?>
|
||||
<td><?php the_title() ?>
|
||||
<?php if ('private' == $post->post_status) _e(' - <strong>Private</strong>'); ?></td>
|
||||
<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>
|
||||
<?php
|
||||
break;
|
||||
|
||||
case 'categories':
|
||||
?>
|
||||
<td><?php the_category(','); ?></td>
|
||||
<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>
|
||||
<?php
|
||||
break;
|
||||
|
||||
@@ -66,7 +102,7 @@ foreach($posts_columns as $column_name=>$column_display_name) {
|
||||
$pending_phrase = sprintf( __('%s pending'), number_format( $left ) );
|
||||
if ( $left )
|
||||
echo '<strong>';
|
||||
comments_number("<a href='edit.php?p=$id&c=1' title='$pending_phrase' class='post-com-count'>" . __('0') . '</a>', "<a href='edit.php?p=$id&c=1' title='$pending_phrase' class='post-com-count'>" . __('1') . '</a>', "<a href='edit.php?p=$id&c=1' title='$pending_phrase' class='post-com-count'>" . __('%') . '</a>');
|
||||
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>');
|
||||
if ( $left )
|
||||
echo '</strong>';
|
||||
?>
|
||||
@@ -76,7 +112,31 @@ foreach($posts_columns as $column_name=>$column_display_name) {
|
||||
|
||||
case 'author':
|
||||
?>
|
||||
<td><?php the_author() ?></td>
|
||||
<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>
|
||||
<?php
|
||||
break;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user