Make WordPress Core


Ignore:
Timestamp:
02/10/2008 08:10:11 AM (19 years ago)
Author:
matt
Message:

New manage posts almost fully functional, and some admin CSS reorganization. TODO: Delete buttons and checkboxes are currently impotent.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/edit-post-rows.php

    r6550 r6778  
    2323$post_owner = ( $current_user->ID == $post->post_author ? 'self' : 'other' );
    2424?>
    25         <tr id='post-<?php echo $id; ?>' class='<?php echo trim( $class . ' author-' . $post_owner . ' status-' . $post->post_status ); ?>'>
     25        <tr id='post-<?php echo $id; ?>' class='<?php echo trim( $class . ' author-' . $post_owner . ' status-' . $post->post_status ); ?>' valign="top">
    2626
    2727<?php
    … …  
    3131        switch($column_name) {
    3232
    33         case 'id':
     33        case 'cb':
    3434                ?>
    35                 <th scope="row" style="text-align: center"><?php echo $id ?></th>
     35                <th scope="row" style="text-align: center"><input type="checkbox" name="delete[]" value="<?php the_ID(); ?>" /></th>
    3636                <?php
    3737                break;
    3838        case 'modified':
    3939                ?>
    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>
     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>
    4141                <?php
    4242                break;
    4343        case 'date':
    4444                ?>
    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>
     45                <td><a href="<?php the_permalink(); ?>" rel="permalink">
     46                <?php
     47                if ( '0000-00-00 00:00:00' ==$post->post_date ) {
     48                        _e('Unpublished');
     49                } else {
     50                        if ( ( time() - get_post_time() ) < 86400 )
     51                                echo sprintf( __('%s ago'), human_time_diff( get_post_time() ) );
     52                        else
     53                                the_time(__('Y/m/d'));
     54                }
     55                ?></a></td>
    4656                <?php
    4757                break;
    4858        case 'title':
    4959                ?>
    50                 <td><?php the_title() ?>
    51                 <?php if ('private' == $post->post_status) _e(' - <strong>Private</strong>'); ?></td>
     60                <td><strong><a href="post.php?action=edit&post=<?php the_ID(); ?>"><?php the_title() ?></a></strong>
     61                <?php if ('private' == $post->post_status) _e(' &#8212; <strong>Private</strong>'); ?></td>
    5262                <?php
    5363                break;
    … …  
    5565        case 'categories':
    5666                ?>
    57                 <td><?php the_category(','); ?></td>
     67                <td><?php
     68                $categories = get_the_category();
     69                if ( !empty( $categories ) ) {
     70                        $out = array();
     71                        foreach ( $categories as $c )
     72                                $out[] = "<a href='edit.php?category_name=$c->slug'> " . wp_specialchars( $c->name) . "</a>";
     73                        echo join( ', ', $out );
     74                } else {
     75                        _e('Uncategorized');
     76                }
     77                ?></td>
     78                <?php
     79                break;
     80
     81        case 'tags':
     82                ?>
     83                <td><?php
     84                $tags = get_the_tags();
     85                if ( !empty( $tags ) ) {
     86                        $out = array();
     87                        foreach ( $tags as $c )
     88                                $out[] = "<a href='edit.php?tag=$c->slug'> " . wp_specialchars( $c->name) . "</a>";
     89                        echo join( ', ', $out );
     90                } else {
     91                        _e('No Tags');
     92                }
     93                ?></td>
    5894                <?php
    5995                break;
    … …  
    67103                if ( $left )
    68104                        echo '<strong>';
    69                 comments_number("<a href='edit.php?p=$id&amp;c=1' title='$pending_phrase' class='post-com-count'>" . __('0') . '</a>', "<a href='edit.php?p=$id&amp;c=1' title='$pending_phrase' class='post-com-count'>" . __('1') . '</a>', "<a href='edit.php?p=$id&amp;c=1' title='$pending_phrase' class='post-com-count'>" . __('%') . '</a>');
     105                comments_number("<a href='edit.php?p=$id&amp;c=1' title='$pending_phrase' class='post-com-count comment-count'><span>" . __('0') . '</span></a>', "<a href='edit.php?p=$id&amp;c=1' title='$pending_phrase' class='post-com-count comment-count'><span>" . __('1') . '</span></a>', "<a href='edit.php?p=$id&amp;c=1' title='$pending_phrase' class='post-com-count comment-count'><span>" . __('%') . '</span></a>');
    70106                if ( $left )
    71107                        echo '</strong>';
    … …  
    77113        case 'author':
    78114                ?>
    79                 <td><?php the_author() ?></td>
     115                <td><a href="edit.php?author=<?php the_author_ID(); ?>"><?php the_author() ?></a></td>
     116                <?php
     117                break;
     118
     119        case 'status':
     120                ?>
     121                <td>
     122                <?php
     123                switch ( $post->post_status ) {
     124                        case 'publish' :
     125                        case 'private' :
     126                                _e('Published');
     127                                break;
     128                        case 'future' :
     129                                _e('Scheduled');
     130                                break;
     131                        case 'pending' :
     132                                _e('Pending Review');
     133                                break;
     134                        case 'draft' :
     135                                _e('Unpublished');
     136                                break;
     137                }
     138                ?>
     139                </td>
    80140                <?php
    81141                break;
Note: See TracChangeset for help on using the changeset viewer.