From b5bdfd44d05e7681724129f70c6c329534b5e0db Mon Sep 17 00:00:00 2001 From: ryan Date: Tue, 14 Oct 2008 03:49:57 +0000 Subject: [PATCH] Remove status column, add states into title td. Needs styling. git-svn-id: http://svn.automattic.com/wordpress/trunk@9153 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/template.php | 143 ++++++++++++--------------------- 1 file changed, 53 insertions(+), 90 deletions(-) diff --git a/wp-admin/includes/template.php b/wp-admin/includes/template.php index be2c21139..2ce259489 100644 --- a/wp-admin/includes/template.php +++ b/wp-admin/includes/template.php @@ -687,13 +687,12 @@ function wp_manage_posts_columns() { $posts_columns = array(); $posts_columns['cb'] = ''; $posts_columns['title'] = __('Title'); - $posts_columns['date'] = __('Date'); $posts_columns['author'] = __('Author'); $posts_columns['categories'] = __('Categories'); $posts_columns['tags'] = __('Tags'); if ( !isset($_GET['post_status']) || !in_array($_GET['post_status'], array('pending', 'draft', 'future')) ) $posts_columns['comments'] = '
Comments
'; - $posts_columns['status'] = __('Status'); + $posts_columns['date'] = __('Date'); $posts_columns = apply_filters('manage_posts_columns', $posts_columns); return $posts_columns; @@ -735,11 +734,10 @@ function wp_manage_pages_columns() { $posts_columns = array(); $posts_columns['cb'] = ''; $posts_columns['title'] = __('Title'); - $posts_columns['date'] = __('Date'); $posts_columns['author'] = __('Author'); if ( !in_array($post_status, array('pending', 'draft', 'future')) ) $posts_columns['comments'] = '
'; - $posts_columns['status'] = __('Status'); + $posts_columns['date'] = __('Date'); $posts_columns = apply_filters('manage_pages_columns', $posts_columns); return $posts_columns; @@ -945,6 +943,26 @@ function inline_edit_row( $type ) { +
+
+
+ +
+
+
@@ -1061,38 +1079,6 @@ function inline_edit_row( $type ) { -
title=""> -
-
- -
-
- - -
title=""> -
-
- -
-
- >ID ) ) { ?>"> post_password) ) { _e(' — Protected'); } elseif ('private' == $post->post_status) { _e(' — Private'); } + _post_states($post); if ( 'excerpt' == $mode ) the_excerpt(); @@ -1357,32 +1343,6 @@ function _post_row($a_post, $pending_comments, $mode) { - > - " rel="permalink"> - post_status ) { - case 'publish' : - case 'private' : - _e('Published'); - break; - case 'future' : - _e('Scheduled'); - break; - case 'pending' : - _e('Pending Review'); - break; - case 'draft' : - _e('Unpublished'); - break; - } - ?> - - - @@ -1487,7 +1447,7 @@ foreach ($posts_columns as $column_name=>$column_display_name) { ?> >ID ) ) { ?>"> post_password) ) { _e(' — Protected'); } elseif ('private' == $post->post_status) { _e(' — Private'); } + _post_states($page); $actions = array(); $actions['edit'] = '' . __('Edit') . ''; @@ -1531,32 +1491,6 @@ foreach ($posts_columns as $column_name=>$column_display_name) { - > - " rel="permalink"> - post_status ) { - case 'publish' : - case 'private' : - _e('Published'); - break; - case 'future' : - _e('Scheduled'); - break; - case 'pending' : - _e('Pending Review'); - break; - case 'draft' : - _e('Unpublished'); - break; - } - ?> - - - > @@ -3114,4 +3048,33 @@ function iframe_footer() { '; } +function _post_states($post) { + $post_states = array(); + if ( isset($_GET['post_status']) ) + $post_status = $_GET['post_status']; + else + $post_status = ''; + + if ( !empty($post->post_password) ) + $post_states[] = __('Protected'); + if ( 'private' == $post->post_status && 'private' != $post_status ) + $post_states[] = __('Private'); + if ( 'draft' == $post->post_status && 'draft' != $post_status ) + $post_states[] = __('Draft'); + if ( 'pending' == $post->post_status && 'pending' != $post_status ) + $post_states[] = __('Pending'); + + if ( ! empty($post_states) ) { + $state_count = count($post_states); + $i = 0; + echo '
'; + foreach ( $post_states as $state ) { + ++$i; + ( $i == $state_count ) ? $sep = '' : $sep = ', '; + echo "$state$sep"; + } + echo '
'; + } +} + ?>