diff options
| author | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2007-10-12 16:21:15 +0000 |
|---|---|---|
| committer | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2007-10-12 16:21:15 +0000 |
| commit | 3a4570b0fc8b3d6339bef71d17d7701554e0bbf7 (patch) | |
| tree | 2a06e5261263c68d8afd95a6328879dc289cb909 /wp-admin/edit-post-rows.php | |
| parent | b83c34a7010faee0223f6037025c350da12e05e6 (diff) | |
| download | wordpress-mu-3a4570b0fc8b3d6339bef71d17d7701554e0bbf7.tar.gz wordpress-mu-3a4570b0fc8b3d6339bef71d17d7701554e0bbf7.tar.xz wordpress-mu-3a4570b0fc8b3d6339bef71d17d7701554e0bbf7.zip | |
Merge with WP 2.3 - testing use only!
Move pluggable functions out of wpmu-functions and into pluggable.php, fixes #439
git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@1069 7be80a69-a1ef-0310-a953-fb0f7c49ff36
Diffstat (limited to 'wp-admin/edit-post-rows.php')
| -rw-r--r-- | wp-admin/edit-post-rows.php | 117 |
1 files changed, 117 insertions, 0 deletions
diff --git a/wp-admin/edit-post-rows.php b/wp-admin/edit-post-rows.php new file mode 100644 index 0000000..b3dc1e9 --- /dev/null +++ b/wp-admin/edit-post-rows.php @@ -0,0 +1,117 @@ +<table class="widefat"> + <thead> + <tr> + +<?php foreach($posts_columns as $column_display_name) { ?> + <th scope="col"><?php echo $column_display_name; ?></th> +<?php } ?> + + </tr> + </thead> + <tbody id="the-list"> +<?php +if ( have_posts() ) { +$bgcolor = ''; +add_filter('the_title','wp_specialchars'); +while (have_posts()) : the_post(); +$class = ('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 ); ?>'> + +<?php + +foreach($posts_columns as $column_name=>$column_display_name) { + + switch($column_name) { + + case 'id': + ?> + <th scope="row" style="text-align: center"><?php echo $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> + <?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> + <?php + break; + case 'title': + ?> + <td><?php the_title() ?> + <?php if ('private' == $post->post_status) _e(' - <strong>Private</strong>'); ?></td> + <?php + break; + + case 'categories': + ?> + <td><?php the_category(','); ?></td> + <?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>'; + comments_number("<a href='edit.php?p=$id&c=1' title='$pending_phrase'>" . __('0') . '</a>', "<a href='edit.php?p=$id&c=1' title='$pending_phrase'>" . __('1') . '</a>', "<a href='edit.php?p=$id&c=1' title='$pending_phrase'>" . __('%') . '</a>'); + if ( $left ) + echo '</strong>'; + ?> + </td> + <?php + break; + + case 'author': + ?> + <td><?php the_author() ?></td> + <?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': + ?> + <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' onclick=\"return deleteSomething( 'post', " . $id . ", '" . js_escape(sprintf(__("You are about to delete this post '%s'.\n'OK' to delete, 'Cancel' to stop."), get_the_title())) . "' );\">" . __('Delete') . "</a>"; } ?></td> + <?php + break; + + default: + ?> + <td><?php do_action('manage_posts_custom_column', $column_name, $id); ?></td> + <?php + break; + } +} +?> + </tr> +<?php +endwhile; +} else { +?> + <tr style='background-color: <?php echo $bgcolor; ?>'> + <td colspan="8"><?php _e('No posts found.') ?></td> + </tr> +<?php +} // end if ( have_posts() ) +?> + </tbody> +</table> |
