Changeset 9153

Show
Ignore:
Timestamp:
10/14/08 03:49:57 (2 months ago)
Author:
ryan
Message:

Remove status column, add states into title td. Needs styling.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/wp-admin/includes/template.php

    r9141 r9153  
    688688    $posts_columns['cb'] = '<input type="checkbox" />'; 
    689689    $posts_columns['title'] = __('Title'); 
    690     $posts_columns['date'] = __('Date'); 
    691690    $posts_columns['author'] = __('Author'); 
    692691    $posts_columns['categories'] = __('Categories'); 
     
    694693    if ( !isset($_GET['post_status']) || !in_array($_GET['post_status'], array('pending', 'draft', 'future')) ) 
    695694        $posts_columns['comments'] = '<div class="vers"><img alt="Comments" src="images/comment-grey-bubble.png" /></div>'; 
    696     $posts_columns['status'] = __('Status'); 
     695    $posts_columns['date'] = __('Date'); 
    697696    $posts_columns = apply_filters('manage_posts_columns', $posts_columns); 
    698697 
     
    736735    $posts_columns['cb'] = '<input type="checkbox" />'; 
    737736    $posts_columns['title'] = __('Title'); 
    738     $posts_columns['date'] = __('Date'); 
    739737    $posts_columns['author'] = __('Author'); 
    740738    if ( !in_array($post_status, array('pending', 'draft', 'future')) ) 
    741739        $posts_columns['comments'] = '<div class="vers"><img alt="" src="images/comment-grey-bubble.png" /></div>'; 
    742     $posts_columns['status'] = __('Status'); 
     740    $posts_columns['date'] = __('Date'); 
    743741    $posts_columns = apply_filters('manage_pages_columns', $posts_columns); 
    744742 
     
    945943                </div> 
    946944                <?php } ?> 
     945 
     946                <div class="status quick-edit-div" title="<?php _e('Status'); ?>"> 
     947                    <div class="title"><?php _e('Status'); ?></div> 
     948                    <div class="in"> 
     949                    <select name="_status"> 
     950                        <?php if ( $bulk ) { ?> 
     951                        <option value="-1"><?php _e('- No Change -'); ?></option> 
     952                            <?php if ( $can_publish ) { ?> 
     953                            <option value="private"><?php _e('Private') ?></option> 
     954                            <?php } ?> 
     955                        <?php } ?> 
     956                        <?php if ( $can_publish ) { // Contributors only get "Unpublished" and "Pending Review" ?> 
     957                        <option value="publish"><?php _e('Published') ?></option> 
     958                        <option value="future"><?php _e('Scheduled') ?></option> 
     959                        <?php } ?> 
     960                        <option value="pending"><?php _e('Pending Review') ?></option> 
     961                        <option value="draft"><?php _e('Unpublished') ?></option> 
     962                    </select> 
     963                    </div> 
     964                </div> 
    947965 
    948966                <?php if ( $is_page ) { ?> 
     
    10621080                break; 
    10631081 
    1064             case 'status': ?> 
    1065                 <div <?php echo $attributes ?> title="<?php _e('Status'); ?>"> 
    1066                     <div class="title"><?php _e('Status'); ?></div> 
    1067                     <div class="in"> 
    1068                     <select name="_status"> 
    1069                         <?php if ( $bulk ) { ?> 
    1070                         <option value="-1"><?php _e('- No Change -'); ?></option> 
    1071                             <?php if ( $can_publish ) { ?> 
    1072                             <option value="private"><?php _e('Private') ?></option> 
    1073                             <?php } ?> 
    1074                         <?php } ?> 
    1075                         <?php if ( $can_publish ) { // Contributors only get "Unpublished" and "Pending Review" ?> 
    1076                         <option value="publish"><?php _e('Published') ?></option> 
    1077                         <option value="future"><?php _e('Scheduled') ?></option> 
    1078                         <?php } ?> 
    1079                         <option value="pending"><?php _e('Pending Review') ?></option> 
    1080                         <option value="draft"><?php _e('Unpublished') ?></option> 
    1081                     </select> 
    1082                     </div> 
    1083                 </div> 
    1084  
    1085                 <?php if ( ! $is_page && ! $bulk && current_user_can( 'edit_others_posts' ) ) { ?> 
    1086                 <div class="sticky quick-edit-div" <?php echo $style; ?> title="<?php _e('Sticky') ?>"> 
    1087                     <div class="title"><?php _e('Sticky'); ?></div> 
    1088                     <div class="in"> 
    1089                     <label title="<?php _e('Sticky') ?>"> 
    1090                     <input type="checkbox" name="sticky" value="sticky" /> <?php _e('Stick this post to the front page') ?></label> 
    1091                     </div> 
    1092                 </div> 
    1093                 <?php } 
    1094                 break; 
    1095  
    10961082            default: 
    10971083                if ( $bulk ) 
     
    12761262        <td <?php echo $attributes ?>><strong><?php if ( current_user_can( 'edit_post', $post->ID ) ) { ?><a class="row-title" href="<?php echo $edit_link; ?>" title="<?php echo attribute_escape(sprintf(__('Edit "%s"'), $title)); ?>"><?php echo $title ?></a><?php } else { echo $title; } ?></strong> 
    12771263        <?php 
    1278             if ( !empty($post->post_password) ) { _e(' &#8212; <strong>Protected</strong>'); } elseif ('private' == $post->post_status) { _e(' &#8212; <strong>Private</strong>'); } 
     1264            _post_states($post); 
    12791265 
    12801266            if ( 'excerpt' == $mode ) 
     
    13551341        ?> 
    13561342        <td <?php echo $attributes ?>><a href="edit.php?author=<?php the_author_ID(); ?>"><?php the_author() ?></a></td> 
    1357         <?php 
    1358         break; 
    1359  
    1360         case 'status': 
    1361         ?> 
    1362         <td <?php echo $attributes ?>> 
    1363         <a href="<?php the_permalink(); ?>" title="<?php echo attribute_escape(sprintf(__('View "%s"'), $title)); ?>" rel="permalink"> 
    1364         <?php 
    1365             switch ( $post->post_status ) { 
    1366                 case 'publish' : 
    1367                 case 'private' : 
    1368                     _e('Published'); 
    1369                     break; 
    1370                 case 'future' : 
    1371                     _e('Scheduled'); 
    1372                     break; 
    1373                 case 'pending' : 
    1374                     _e('Pending Review'); 
    1375                     break; 
    1376                 case 'draft' : 
    1377                     _e('Unpublished'); 
    1378                     break; 
    1379             } 
    1380         ?> 
    1381         </a> 
    1382         </td> 
    13831343        <?php 
    13841344        break; 
     
    14881448        <td <?php echo $attributes ?>><strong><?php if ( current_user_can( 'edit_post', $page->ID ) ) { ?><a class="row-title" href="<?php echo $edit_link; ?>" title="<?php echo attribute_escape(sprintf(__('Edit "%s"'), $title)); ?>"><?php echo $pad; echo $title ?></a><?php } else { echo $pad; echo $title; } ?></strong> 
    14891449        <?php 
    1490         if ( !empty($post->post_password) ) { _e(' &#8212; <strong>Protected</strong>'); } elseif ('private' == $post->post_status) { _e(' &#8212; <strong>Private</strong>'); } 
     1450        _post_states($page); 
    14911451 
    14921452        $actions = array(); 
     
    15291489        ?> 
    15301490        <td <?php echo $attributes ?>><a href="edit-pages.php?author=<?php the_author_ID(); ?>"><?php the_author() ?></a></td> 
    1531         <?php 
    1532         break; 
    1533  
    1534     case 'status': 
    1535         ?> 
    1536         <td <?php echo $attributes ?>> 
    1537         <a href="<?php the_permalink(); ?>" title="<?php echo attribute_escape(sprintf(__('View "%s"'), $title)); ?>" rel="permalink"> 
    1538         <?php 
    1539         switch ( $page->post_status ) { 
    1540             case 'publish' : 
    1541             case 'private' : 
    1542                 _e('Published'); 
    1543                 break; 
    1544             case 'future' : 
    1545                 _e('Scheduled'); 
    1546                 break; 
    1547             case 'pending' : 
    1548                 _e('Pending Review'); 
    1549                 break; 
    1550             case 'draft' : 
    1551                 _e('Unpublished'); 
    1552                 break; 
    1553         } 
    1554         ?> 
    1555         </a> 
    1556         </td> 
    15571491        <?php 
    15581492        break; 
     
    31153049} 
    31163050 
     3051function _post_states($post) { 
     3052    $post_states = array(); 
     3053    if ( isset($_GET['post_status']) ) 
     3054        $post_status = $_GET['post_status']; 
     3055    else 
     3056        $post_status = ''; 
     3057 
     3058    if ( !empty($post->post_password) ) 
     3059        $post_states[] = __('Protected'); 
     3060    if ( 'private' == $post->post_status && 'private' != $post_status ) 
     3061        $post_states[] = __('Private'); 
     3062    if ( 'draft' == $post->post_status && 'draft' != $post_status ) 
     3063        $post_states[] = __('Draft'); 
     3064    if ( 'pending' == $post->post_status && 'pending' != $post_status ) 
     3065        $post_states[] = __('Pending'); 
     3066 
     3067    if ( ! empty($post_states) ) { 
     3068        $state_count = count($post_states); 
     3069        $i = 0; 
     3070        echo '<div id="post-states">'; 
     3071        foreach ( $post_states as $state ) { 
     3072            ++$i; 
     3073            ( $i == $state_count ) ? $sep = '' : $sep = ', '; 
     3074            echo "<span class='post-state'>$state$sep</span>"; 
     3075        } 
     3076        echo '</div>'; 
     3077    } 
     3078} 
     3079 
    31173080?>