]> scripts.mit.edu Git - autoinstalls/wordpress.git/blob - wp-admin/edit-post-rows.php
Wordpress 2.3.3
[autoinstalls/wordpress.git] / wp-admin / edit-post-rows.php
1 <?php if ( ! defined('ABSPATH') ) die(); ?>
2 <table class="widefat">
3         <thead>
4         <tr>
5
6 <?php foreach($posts_columns as $column_display_name) { ?>
7         <th scope="col"><?php echo $column_display_name; ?></th>
8 <?php } ?>
9
10         </tr>
11         </thead>
12         <tbody id="the-list">
13 <?php
14 if ( have_posts() ) {
15 $bgcolor = '';
16 add_filter('the_title','wp_specialchars');
17 while (have_posts()) : the_post();
18 $class = ('alternate' == $class) ? '' : 'alternate';
19 global $current_user;
20 $post_owner = ( $current_user->ID == $post->post_author ? 'self' : 'other' );
21 ?>
22         <tr id='post-<?php echo $id; ?>' class='<?php echo trim( $class . ' author-' . $post_owner . ' status-' . $post->post_status ); ?>'>
23
24 <?php
25
26 foreach($posts_columns as $column_name=>$column_display_name) {
27
28         switch($column_name) {
29
30         case 'id':
31                 ?>
32                 <th scope="row" style="text-align: center"><?php echo $id ?></th>
33                 <?php
34                 break;
35         case 'modified':
36                 ?>
37                 <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>
38                 <?php
39                 break;
40         case 'date':
41                 ?>
42                 <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>
43                 <?php
44                 break;
45         case 'title':
46                 ?>
47                 <td><?php the_title() ?>
48                 <?php if ('private' == $post->post_status) _e(' - <strong>Private</strong>'); ?></td>
49                 <?php
50                 break;
51
52         case 'categories':
53                 ?>
54                 <td><?php the_category(','); ?></td>
55                 <?php
56                 break;
57
58         case 'comments':
59                 ?>
60                 <td style="text-align: center">
61                 <?php
62                 $left = get_pending_comments_num( $post->ID );
63                 $pending_phrase = sprintf( __('%s pending'), number_format( $left ) );
64                 if ( $left )
65                         echo '<strong>';
66                 comments_number("<a href='edit.php?p=$id&amp;c=1' title='$pending_phrase'>" . __('0') . '</a>', "<a href='edit.php?p=$id&amp;c=1' title='$pending_phrase'>" . __('1') . '</a>', "<a href='edit.php?p=$id&amp;c=1' title='$pending_phrase'>" . __('%') . '</a>');
67                 if ( $left )
68                         echo '</strong>';
69                 ?>
70                 </td>
71                 <?php
72                 break;
73
74         case 'author':
75                 ?>
76                 <td><?php the_author() ?></td>
77                 <?php
78                 break;
79
80         case 'control_view':
81                 ?>
82                 <td><a href="<?php the_permalink(); ?>" rel="permalink" class="view"><?php _e('View'); ?></a></td>
83                 <?php
84                 break;
85
86         case 'control_edit':
87                 ?>
88                 <td><?php if ( current_user_can('edit_post',$post->ID) ) { echo "<a href='post.php?action=edit&amp;post=$id' class='edit'>" . __('Edit') . "</a>"; } ?></td>
89                 <?php
90                 break;
91
92         case 'control_delete':
93                 ?>
94                 <td><?php if ( current_user_can('delete_post',$post->ID) ) { echo "<a href='" . wp_nonce_url("post.php?action=delete&amp;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>
95                 <?php
96                 break;
97
98         default:
99                 ?>
100                 <td><?php do_action('manage_posts_custom_column', $column_name, $id); ?></td>
101                 <?php
102                 break;
103         }
104 }
105 ?>
106         </tr>
107 <?php
108 endwhile;
109 } else {
110 ?>
111   <tr style='background-color: <?php echo $bgcolor; ?>'>
112     <td colspan="8"><?php _e('No posts found.') ?></td>
113   </tr>
114 <?php
115 } // end if ( have_posts() )
116 ?>
117         </tbody>
118 </table>