Changeset 6731

Show
Ignore:
Timestamp:
02/05/08 20:30:24 (10 months ago)
Author:
ryan
Message:

First cut at post status menu. Needs style fixes.

Files:

Legend:

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

    r6660 r6731  
    5454} 
    5555?></h2> 
     56 
     57<ul id="statusmenu"> 
     58<?php 
     59$status_links = array(); 
     60foreach ( $post_stati as $status => $label ) { 
     61    $class = ''; 
     62 
     63    if ( !in_array($status, $avail_post_stati) ) 
     64        continue; 
     65 
     66    $num_posts = wp_count_posts('post', $status); 
     67    if ( $status == $_GET['post_status'] ) 
     68        $class = ' class="current"'; 
     69 
     70    $status_links[] = "<li><a href=\"edit.php?post_status=$status\"$class>" . 
     71    sprintf($label[1], $num_posts) . '</a>'; 
     72} 
     73$class = empty($_GET['post_status']) ? ' class="current"' : ''; 
     74$status_links[] = "<li><a href=\"edit.php\"$class>All Posts</a>"; 
     75echo implode(' |</li>', $status_links) . '</li>'; 
     76unset($status_links); 
     77?> 
     78</ul> 
    5679 
    5780<form name="searchform" id="searchform" action="" method="get"> 
  • trunk/wp-admin/includes/post.php

    r6726 r6731  
    489489    $q['cat'] = (int) $q['cat']; 
    490490    $post_stati  = array(   //  array( adj, noun ) 
    491                 'draft' => array(__('Draft'), _c('Drafts|manage posts header')), 
    492                 'future' => array(__('Scheduled'), __('Scheduled posts')), 
    493                 'pending' => array(__('Pending Review'), __('Pending posts')), 
    494                 'private' => array(__('Private'), __('Private posts')), 
    495                 'publish' => array(__('Published'), __('Published posts')) 
     491                'publish' => array(__('Published'), __('Published (%s)')), 
     492                'future' => array(__('Scheduled'), __('Scheduled (5s)')), 
     493                'pending' => array(__('Pending Review'), __('Pending Review (%s)')), 
     494                'draft' => array(__('Draft'), _c('Draft (%s)|manage posts header')), 
     495                'private' => array(__('Private'), __('Private (%s)')) 
    496496            ); 
    497497 
  • trunk/wp-admin/wp-admin.css

    r6727 r6731  
    996996} 
    997997 
     998#statusmenu { 
     999    margin: 0; 
     1000    color: #999; 
     1001    list-style: none; 
     1002    white-space: nowrap; 
     1003    left: 0; 
     1004} 
     1005 
     1006#statusmenu a { 
     1007    color: #2583ad; 
     1008    padding: 3px; 
     1009    line-height: 200%; 
     1010} 
     1011 
     1012#statusmenu a:hover, #statusmenu a.current, #statusmenu a.current:hover { 
     1013    color: #d54e21; 
     1014} 
    9981015/* end menu stuff */ 
    9991016