Make WordPress Core


Ignore:
Timestamp:
05/28/2007 06:34:06 PM (17 years ago)
Author:
ryan
Message:

Better draft, private, and future post/page management from mdawaffe. fixes #3945

File:
1 edited

Legend:

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

    r5361 r5575  
    55wp_enqueue_script( 'listman' );
    66require_once('admin-header.php');
     7
     8$post_stati  = array(   //  array( adj, noun )
     9            'draft'   => array(__('Draft'), __('Draft pages')),
     10            'future'  => array(__('Future dated'), __('Future dated pages')),
     11            'private' => array(__('Private'), __('Private pages')),
     12            'publish' => array(__('Published'), __('Published pages'))
     13        );
     14
     15
     16$post_status_label = _c('Pages|manage pages header');
     17$post_listing_pageable = true;
     18if ( isset($_GET['post_status']) && in_array( $_GET['post_status'], array_keys($post_stati) ) ) {
     19    $post_status_label = $post_stati[$_GET['post_status']][1];
     20    $post_listing_pageable = false;
     21    $post_status_q = '&post_status=' . $_GET['post_status'];
     22    if ( 'publish' == $_GET['post_status'] );
     23        $post_listing_pageable = true;
     24}
     25
    726?>
    827
    928<div class="wrap">
    10 <h2><?php _e('Page Management'); ?></h2>
     29
     30<h2><?php
     31// Use $_GET instead of is_ since they can override each other
     32$h2_search = isset($_GET['s']) && $_GET['s'] ? ' ' . sprintf(__('matching &#8220;%s&#8221;'), wp_specialchars( stripslashes( $_GET['s'] ) ) ) : '';
     33printf( _c( '%1$s%2$s|manage pages header' ), $post_status_label, $h2_search );
     34?></h2>
     35
    1136<p><?php _e('Pages are like posts except they live outside of the normal blog chronology and can be hierarchical. You can use pages to organize and manage any amount of content.'); ?> <a href="page-new.php"><?php _e('Create a new page &raquo;'); ?></a></p>
    1237
    1338<form name="searchform" id="searchform" action="" method="get">
    14     <fieldset>
    15     <legend><?php _e('Search Pages&hellip;') ?></legend>
    16     <input type="text" name="s" id="s" value="<?php if (isset($_GET['s'])) echo attribute_escape($_GET['s']); ?>" size="17" />
    17     <input type="submit" name="submit" value="<?php _e('Search') ?>"  />
     39    <fieldset><legend><?php _e('Search Terms&hellip;') ?></legend>
     40        <input type="text" name="s" id="s" value="<?php echo attribute_escape( stripslashes( $_GET['s'] ) ); ?>" size="17" />
    1841    </fieldset>
     42
     43       
     44    <fieldset><legend><?php _e('Page Type&hellip;'); ?></legend>
     45        <select name='post_status'>
     46            <option<?php selected( @$_GET['post_status'], 0 ); ?> value='0'><?php _e('Any'); ?></option>
     47<?php   foreach ( $post_stati as $status => $label ) : ?>
     48            <option<?php selected( @$_GET['post_status'], $status ); ?> value='<?php echo $status; ?>'><?php echo $label[0]; ?></option>
     49<?php   endforeach; ?>
     50        </select>
     51    </fieldset>
     52
     53    <input type="submit" id="post-query-submit" value="<?php _e('Go &#187;'); ?>" class="button" />
    1954</form>
    2055
     
    2257
    2358<?php
    24 wp('post_type=page&orderby=menu_order&what_to_show=posts&posts_per_page=-1&posts_per_archive_page=-1&order=asc');
     59wp("post_type=page&orderby=menu_order&what_to_show=posts$post_status_q&posts_per_page=-1&posts_per_archive_page=-1&order=asc");
    2560
    2661if ( $_GET['s'] )
     
    4277  </thead>
    4378  <tbody id="the-list">
    44 <?php
    45 page_rows(0, 0, $posts, $all);
    46 ?>
     79<?php page_rows(0, 0, $posts, $all); ?>
    4780  </tbody>
    4881</table>
     
    5386} else {
    5487?>
    55 <p><?php _e('No pages yet.') ?></p>
     88<p><?php _e('No pages found.') ?></p>
    5689<?php
    5790} // end if ($posts)
Note: See TracChangeset for help on using the changeset viewer.