| 1 |
<?php |
|---|
| 2 |
require_once('admin.php'); |
|---|
| 3 |
$title = __('Pages'); |
|---|
| 4 |
$parent_file = 'edit.php'; |
|---|
| 5 |
wp_enqueue_script( 'listman' ); |
|---|
| 6 |
require_once('admin-header.php'); |
|---|
| 7 |
|
|---|
| 8 |
$post_stati = array( |
|---|
| 9 |
'publish' => array(__('Published'), __('Published pages')), |
|---|
| 10 |
'draft' => array(__('Draft'), __('Draft pages')), |
|---|
| 11 |
'private' => array(__('Private'), __('Private pages')) |
|---|
| 12 |
); |
|---|
| 13 |
|
|---|
| 14 |
|
|---|
| 15 |
$post_status_label = __('Pages'); |
|---|
| 16 |
$post_status_q = ''; |
|---|
| 17 |
if ( isset($_GET['post_status']) && in_array( $_GET['post_status'], array_keys($post_stati) ) ) { |
|---|
| 18 |
$post_status_label = $post_stati[$_GET['post_status']][1]; |
|---|
| 19 |
$post_status_q = '&post_status=' . $_GET['post_status']; |
|---|
| 20 |
} |
|---|
| 21 |
|
|---|
| 22 |
?> |
|---|
| 23 |
|
|---|
| 24 |
<div class="wrap"> |
|---|
| 25 |
|
|---|
| 26 |
<h2><?php |
|---|
| 27 |
|
|---|
| 28 |
$h2_search = isset($_GET['s']) && $_GET['s'] ? ' ' . sprintf(__('matching “%s”'), wp_specialchars( stripslashes( $_GET['s'] ) ) ) : ''; |
|---|
| 29 |
$h2_author = ''; |
|---|
| 30 |
if ( isset($_GET['author']) && $_GET['author'] ) { |
|---|
| 31 |
$author_user = get_userdata( (int) $_GET['author'] ); |
|---|
| 32 |
$h2_author = ' ' . sprintf(__('by %s'), wp_specialchars( $author_user->display_name )); |
|---|
| 33 |
} |
|---|
| 34 |
printf( _c( '%1$s%2$s%3$s|You can reorder these: 1: Pages, 2: by {s}, 3: matching {s}' ), $post_status_label, $h2_author, $h2_search ); |
|---|
| 35 |
?></h2> |
|---|
| 36 |
|
|---|
| 37 |
<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 »'); ?></a></p> |
|---|
| 38 |
|
|---|
| 39 |
<form name="searchform" id="searchform" action="" method="get"> |
|---|
| 40 |
<fieldset><legend><?php _e('Search Terms…') ?></legend> |
|---|
| 41 |
<input type="text" name="s" id="s" value="<?php echo attribute_escape( stripslashes( $_GET['s'] ) ); ?>" size="17" /> |
|---|
| 42 |
</fieldset> |
|---|
| 43 |
|
|---|
| 44 |
|
|---|
| 45 |
<fieldset><legend><?php _e('Page Type…'); ?></legend> |
|---|
| 46 |
<select name='post_status'> |
|---|
| 47 |
<option<?php selected( @$_GET['post_status'], 0 ); ?> value='0'><?php _e('Any'); ?></option> |
|---|
| 48 |
<?php foreach ( $post_stati as $status => $label ) : ?> |
|---|
| 49 |
<option<?php selected( @$_GET['post_status'], $status ); ?> value='<?php echo $status; ?>'><?php echo $label[0]; ?></option> |
|---|
| 50 |
<?php endforeach; ?> |
|---|
| 51 |
</select> |
|---|
| 52 |
</fieldset> |
|---|
| 53 |
|
|---|
| 54 |
<?php $editable_ids = get_editable_user_ids( $user_ID ); if ( $editable_ids && count( $editable_ids ) > 1 ) : ?> |
|---|
| 55 |
|
|---|
| 56 |
<fieldset><legend><?php _e('Author…'); ?></legend> |
|---|
| 57 |
<?php wp_dropdown_users( array('include' => $editable_ids, 'show_option_all' => __('Any'), 'name' => 'author', 'selected' => isset($_GET['author']) ? $_GET['author'] : 0) ); ?> |
|---|
| 58 |
</fieldset> |
|---|
| 59 |
|
|---|
| 60 |
<?php endif; ?> |
|---|
| 61 |
|
|---|
| 62 |
<input type="submit" id="post-query-submit" value="<?php _e('Filter »'); ?>" class="button" /> |
|---|
| 63 |
</form> |
|---|
| 64 |
|
|---|
| 65 |
<br style="clear:both;" /> |
|---|
| 66 |
|
|---|
| 67 |
<?php |
|---|
| 68 |
wp("post_type=page&orderby=menu_order&what_to_show=posts$post_status_q&posts_per_page=-1&posts_per_archive_page=-1&order=asc"); |
|---|
| 69 |
|
|---|
| 70 |
$all = !( $h2_search || $post_status_q ); |
|---|
| 71 |
|
|---|
| 72 |
if ($posts) { |
|---|
| 73 |
?> |
|---|
| 74 |
<table class="widefat"> |
|---|
| 75 |
<thead> |
|---|
| 76 |
<tr> |
|---|
| 77 |
<th scope="col" style="text-align: center"><?php _e('ID') ?></th> |
|---|
| 78 |
<th scope="col"><?php _e('Title') ?></th> |
|---|
| 79 |
<th scope="col"><?php _e('Owner') ?></th> |
|---|
| 80 |
<th scope="col"><?php _e('Updated') ?></th> |
|---|
| 81 |
<th scope="col" colspan="3" style="text-align: center"><?php _e('Action'); ?></th> |
|---|
| 82 |
</tr> |
|---|
| 83 |
</thead> |
|---|
| 84 |
<tbody id="the-list"> |
|---|
| 85 |
<?php page_rows(0, 0, $posts, $all); ?> |
|---|
| 86 |
</tbody> |
|---|
| 87 |
</table> |
|---|
| 88 |
|
|---|
| 89 |
<div id="ajax-response"></div> |
|---|
| 90 |
|
|---|
| 91 |
<?php |
|---|
| 92 |
} else { |
|---|
| 93 |
?> |
|---|
| 94 |
<p><?php _e('No pages found.') ?></p> |
|---|
| 95 |
<?php |
|---|
| 96 |
} |
|---|
| 97 |
?> |
|---|
| 98 |
|
|---|
| 99 |
<h3><a href="page-new.php"><?php _e('Create New Page »'); ?></a></h3> |
|---|
| 100 |
|
|---|
| 101 |
</div> |
|---|
| 102 |
|
|---|
| 103 |
<?php include('admin-footer.php'); ?> |
|---|
| 104 |
|
|---|