diff --git a/wp-admin/edit-form-advanced.php b/wp-admin/edit-form-advanced.php index c2289ceefe..f60cbaa142 100644 --- a/wp-admin/edit-form-advanced.php +++ b/wp-admin/edit-form-advanced.php @@ -82,12 +82,12 @@ function post_submit_meta_box($post) {
ID), true); ?> tabindex="4" />
- + -
post_status ) {
diff --git a/wp-admin/edit-page-form.php b/wp-admin/edit-page-form.php index 63ee133437..f2bb035089 100644 --- a/wp-admin/edit-page-form.php +++ b/wp-admin/edit-page-form.php @@ -63,10 +63,53 @@ function page_submit_meta_box($post) { ?>
-
+
+
-
- + +
+ +
+ +
+ +
+
+ID ) { + if ( 'future' == $post->post_status ) { // scheduled for publishing at a future date + $stamp = __('Scheduled for:
%1$s'); + } else if ( 'publish' == $post->post_status ) { // already published + $stamp = __('Published on:
%1$s'); + } else if ( '0000-00-00 00:00:00' == $post->post_date_gmt ) { // draft, 1 or more saves, no date specified + $stamp = __('Publish immediately'); + } else if ( time() < strtotime( $post->post_date_gmt . ' +0000' ) ) { // draft, 1 or more saves, future date specified + $stamp = __('Schedule for:
%1$s'); + } else { // draft, 1 or more saves, date specified + $stamp = __('Publish on:
%1$s'); + } + $date = date_i18n( $datef, strtotime( $post->post_date ) ); +} else { // draft (no saves, and thus no date specified) + $stamp = __('Publish immediately'); + $date = date_i18n( $datef, strtotime( current_time('mysql') ) ); +} +?> + +
+ + +   +
+
+ + +
+ post_status ) { case 'publish': @@ -80,103 +123,80 @@ switch ( $post->post_status ) { _e('Pending Review'); break; case 'draft': - _e('Unpublished'); + _e('Draft'); break; } ?> - -post_status || 'private' == $post->post_status ) { ?> - + +post_status || 'private' == $post->post_status || $can_publish ) { ?> +
-
+
-
- - -
- -post_status ) { ?> -
- - -ID) ) { ?> - - - -ID ) { - if ( 'future' == $post->post_status ) { // scheduled for publishing at a future date - $stamp = __('Scheduled for: %1$s at %2$s'); - } else if ( 'publish' == $post->post_status ) { // already published - $stamp = __('Published on: %1$s at %2$s'); - } else if ( '0000-00-00 00:00:00' == $post->post_date_gmt ) { // draft, 1 or more saves, no date specified - $stamp = __('Publish immediately'); - } else { // draft, 1 or more saves, date specified - $stamp = __('Publish on: %1$s at %2$s'); - } - $date = mysql2date(get_option('date_format'), $post->post_date); - $time = mysql2date(get_option('time_format'), $post->post_date); -} else { // draft (no saves, and thus no date specified) - $stamp = __('Publish immediately'); - $date = mysql2date(get_option('date_format'), current_time('mysql')); - $time = mysql2date(get_option('time_format'), current_time('mysql')); -} -?> - -

- -
- - +
+
-

- -post_status || 'private' == $post->post_status ) - $savebtn = attribute_escape( __('Save') ); -else - $savebtn = attribute_escape( __('Save Draft') ); -?> - +

+ +post_status && 'private' != $post->post_status && 'future' != $post->post_status && 'pending' != $post->post_status ) { ?> + +post_status && $can_publish ) { ?> + + post_status ) { ?> - + - -post_status, array('publish', 'future') ) || 0 == $post->ID ) { ?> - - - - - - - -

+
+ +
currentDate ) { + $('#publish').val( postL10n.schedule ); + } else if ( $('#original_post_status').val() != 'publish' ) { + $('#publish').val( postL10n.publish ); + } else { + $('#publish').val( postL10n.update ); + } + return false; }); $('.save-timestamp').click(function () { // crazyhorse - multiple ok cancels $('#timestampdiv').slideUp("normal"); $('.edit-timestamp').show(); + var attemptedDate = new Date( $('#aa').val(), $('#mm').val() -1, $('#jj').val(), $('#hh').val(), $('#mn').val() ); + var currentDate = new Date( $('#cur_aa').val(), $('#cur_mm').val() -1, $('#cur_jj').val(), $('#cur_hh').val(), $('#cur_mn').val() ); + if ( attemptedDate > currentDate ) { + var publishOn = postL10n.publishOnFuture; + $('#publish').val( postL10n.schedule ); + } else if ( $('#original_post_status').val() != 'publish' ) { + var publishOn = postL10n.publishOn; + $('#publish').val( postL10n.publish ); + } else { + var publishOn = postL10n.publishOnPast; + $('#publish').val( postL10n.update ); + } $('#timestamp').html( + publishOn + '
' + $( '#mm option[value=' + $('#mm').val() + ']' ).text() + ' ' + $('#jj').val() + ', ' + $('#aa').val() + ' @ ' + @@ -61,16 +84,25 @@ jQuery(document).ready( function($) { $('#post-status-select').slideUp("normal"); $('#post-status-display').html($('#post_status :selected').text()); $('.edit-post-status').show(); - + if ( $('#post_status :selected').val() == 'pending' ) { + $('#save-post').val( postL10n.savePending ); + } else { + $('#save-post').val( postL10n.saveDraft ); + } return false; }); - + $('.cancel-post-status').click(function() { $('#post-status-select').slideUp("normal"); $('#post_status').val($('#hidden_post_status').val()); $('#post-status-display').html($('#post_status :selected').text()); $('.edit-post-status').show(); - + if ( $('#post_status :selected').val() == 'pending' ) { + $('#save-post').val( postL10n.savePending ); + } else { + $('#save-post').val( postL10n.saveDraft ); + } + return false; }); }); diff --git a/wp-admin/js/post.js b/wp-admin/js/post.js index e3e6d354cf..1bd76a4a28 100644 --- a/wp-admin/js/post.js +++ b/wp-admin/js/post.js @@ -215,17 +215,6 @@ jQuery(document).ready( function($) { return false; }); - // Custom Fields - jQuery('#the-list').wpList( { addAfter: function( xml, s ) { - if ( jQuery.isFunction( autosave_update_post_ID ) ) { - autosave_update_post_ID(s.parsed.responses[0].supplemental.postid); - } - }, addBefore: function( s ) { - s.data += '&post_id=' + jQuery('#post_ID').val(); - return s; - } - }); - $('.edit-post-status').click(function() { if ($('#post-status-select').is(":hidden")) { $('#post-status-select').slideDown("normal"); @@ -260,6 +249,17 @@ jQuery(document).ready( function($) { return false; }); + + // Custom Fields + jQuery('#the-list').wpList( { addAfter: function( xml, s ) { + if ( jQuery.isFunction( autosave_update_post_ID ) ) { + autosave_update_post_ID(s.parsed.responses[0].supplemental.postid); + } + }, addBefore: function( s ) { + s.data += '&post_id=' + jQuery('#post_ID').val(); + return s; + } + }); }); (function($){ diff --git a/wp-includes/script-loader.php b/wp-includes/script-loader.php index 5a8f102e3d..747cb77613 100644 --- a/wp-includes/script-loader.php +++ b/wp-includes/script-loader.php @@ -199,6 +199,16 @@ function wp_default_scripts( &$scripts ) { $scripts->localize( 'page', 'postL10n', array( 'cancel' => __('Cancel'), 'edit' => __('Edit'), + 'publishOn' => __('Publish on:'), + 'publishOnFuture' => __('Schedule for:'), + 'publishOnPast' => __('Published on:'), + 'showcomm' => __('Show more comments'), + 'endcomm' => __('No more comments found.'), + 'publish' => __('Publish'), + 'schedule' => __('Schedule'), + 'update' => __('Update Page'), + 'savePending' => __('Save Pending'), + 'saveDraft' => __('Save Draft') ) ); $scripts->add( 'link', '/wp-admin/js/link.js', array('jquery-ui-tabs', 'wp-lists', 'postbox', 'settings-box'), '20080925' ); $scripts->add( 'comment', '/wp-admin/js/comment.js', array('jquery'), '20080219' );