PHP Cross Reference of WordPress Subversion HEAD

[ Index ]     [ Classes ]     [ Functions ]     [ Variables ]     [ Constants ]

title

Body

[close]

/wp-admin/ -> edit-post-rows.php (source)

   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" class="list:post">
  13  <?php
  14  $i_post = 0;
  15  if ( have_posts() ) {
  16  $bgcolor = '';
  17  add_filter('the_title','wp_specialchars');
  18  while (have_posts()) : the_post(); $i_post++;
  19  if ( 16 == $i_post )
  20      echo "\t</tbody>\n\t<tbody id='the-extra-list' class='list:post' style='display: none'>\n"; // Hack!
  21  $class = ( $i_post > 15 || 'alternate' == $class) ? '' : 'alternate';
  22  global $current_user;
  23  $post_owner = ( $current_user->ID == $post->post_author ? 'self' : 'other' );
  24  ?>
  25      <tr id='post-<?php echo $id; ?>' class='<?php echo trim( $class . ' author-' . $post_owner . ' status-' . $post->post_status ); ?>'>
  26  
  27  <?php
  28  
  29  foreach($posts_columns as $column_name=>$column_display_name) {
  30  
  31      switch($column_name) {
  32  
  33      case 'id':
  34          ?>
  35          <th scope="row" style="text-align: center"><?php echo $id ?></th>
  36          <?php
  37          break;
  38      case 'modified':
  39          ?>
  40          <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>
  41          <?php
  42          break;
  43      case 'date':
  44          ?>
  45          <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>
  46          <?php
  47          break;
  48      case 'title':
  49          ?>
  50          <td><?php the_title() ?>
  51          <?php if ('private' == $post->post_status) _e(' - <strong>Private</strong>'); ?></td>
  52          <?php
  53          break;
  54  
  55      case 'categories':
  56          ?>
  57          <td><?php the_category(','); ?></td>
  58          <?php
  59          break;
  60  
  61      case 'comments':
  62          ?>
  63          <td style="text-align: center">
  64          <?php
  65          $left = get_pending_comments_num( $post->ID );
  66          $pending_phrase = sprintf( __('%s pending'), number_format( $left ) );
  67          if ( $left )
  68              echo '<strong>';
  69          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>');
  70          if ( $left )
  71              echo '</strong>';
  72          ?>
  73          </td>
  74          <?php
  75          break;
  76  
  77      case 'author':
  78          ?>
  79          <td><?php the_author() ?></td>
  80          <?php
  81          break;
  82  
  83      case 'control_view':
  84          ?>
  85          <td><a href="<?php the_permalink(); ?>" rel="permalink" class="view"><?php _e('View'); ?></a></td>
  86          <?php
  87          break;
  88  
  89      case 'control_edit':
  90          ?>
  91          <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>
  92          <?php
  93          break;
  94  
  95      case 'control_delete':
  96          ?>
  97          <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:the-list:post-$post->ID delete'>" . __('Delete') . "</a>"; } ?></td>
  98          <?php
  99          break;
 100  
 101      default:
 102          ?>
 103          <td><?php do_action('manage_posts_custom_column', $column_name, $id); ?></td>
 104          <?php
 105          break;
 106      }
 107  }
 108  ?>
 109      </tr>
 110  <?php
 111  endwhile;
 112  } else {
 113  ?>
 114    <tr style='background-color: <?php echo $bgcolor; ?>'>
 115      <td colspan="8"><?php _e('No posts found.') ?></td>
 116    </tr>
 117  <?php
 118  } // end if ( have_posts() )
 119  ?>
 120      </tbody>
 121  </table>


Generated Thu Dec 6 06:47:08 2007 for RedAlt XRefs Cross-referenced by PHPXref 0.6 and RedAlt