WordPress.org

Make WordPress Core


Ignore:
Timestamp:
10/29/2008 06:00:22 AM (12 years ago)
Author:
markjaquith
Message:

Numerous Publish postbox tweaks, fixes, and flourishes. Still WIP

File:
1 edited

Legend:

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

    r9384 r9394  
    7171<div class="submitbox" id="submitpost">
    7272
    73 <!--<div class="inside-submitbox">-->
    74 
    7573<div id="minor-publishing">
    7674<div id="misc-publishing-actions">
     75
     76<?php // Hidden submit button early on so that the browser chooses the right button when form is submitted with Return key ?>
     77<div style="display:none;">
     78<input type="submit" name="save" value="<?php echo attribute_escape( __('Save') ); ?>" />
     79</div>
     80
    7781<?php if ( $can_publish && current_user_can( 'edit_others_posts' ) ) { ?>
    7882    <div class="misc-pub-section" id="sticky-checkbox"><input id="sticky" name="sticky" type="checkbox" value="sticky" <?php checked(is_sticky($post->ID), true); ?> tabindex="4" /> <label for="sticky" class="selectit"><?php _e('Stick to front page') ?></label></div>
     
    8084
    8185<div class="misc-pub-section" id="visibility">
    82 <?php _e('Visibility:'); ?> <?php _e('Public'); // TODO: dropdown ?>
    83 </div>
    84 
    85 <?php
     86<?php _e('Visibility:'); ?> <b><?php _e('Public'); // TODO: dropdown ?></b>
     87</div>
     88
     89<?php
     90$datef = _c( 'M j, Y \a\t G:i|Publish box date format');
    8691if ( 0 != $post->ID ) {
    8792    if ( 'future' == $post->post_status ) { // scheduled for publishing at a future date
    88         $stamp = __('Scheduled for: %1$s at %2$s');
     93        $stamp = __('Scheduled for:<br />%1$s');
    8994    } else if ( 'publish' == $post->post_status ) { // already published
    90         $stamp = __('Published on: %1$s at %2$s');
     95        $stamp = __('Published on:<br />%1$s');
    9196    } else if ( '0000-00-00 00:00:00' == $post->post_date_gmt ) { // draft, 1 or more saves, no date specified
    9297        $stamp = __('Publish immediately');
    9398    } else { // draft, 1 or more saves, date specified
    94         $stamp = __('Publish on: %1$s at %2$s');
     99        $stamp = __('Publish on:<br />%1$s');
    95100    }
    96     $date = mysql2date(get_option('date_format'), $post->post_date);
    97     $time = mysql2date(get_option('time_format'), $post->post_date);
     101    $date = date_i18n( $datef, strtotime( $post->post_date ) );
    98102} else { // draft (no saves, and thus no date specified)
    99103    $stamp = __('Publish immediately');
    100     $date = mysql2date(get_option('date_format'), current_time('mysql'));
    101     $time = mysql2date(get_option('time_format'), current_time('mysql'));
     104    $date = date_i18n( $datef, strtotime( current_time('mysql') ) );
    102105}
    103106?>
    104107<?php if ( $can_publish ) : // Contributors don't get to choose the date of publish ?>
    105108<div class="misc-pub-section curtime">
    106     <span id="timestamp"><?php printf($stamp, $date, $time); ?></span>
     109    <span id="timestamp"><?php printf($stamp, $date); ?></span>
    107110    &nbsp;<a href="#edit_timestamp" class="edit-timestamp hide-if-no-js" tabindex='4'><?php _e('Edit') ?></a>
    108111    <div id="timestampdiv" class="hide-if-js"><?php touch_time(($action == 'edit'),1,4); ?></div>
     
    111114
    112115<div class="misc-pub-section misc-pub-section-last"><label for="post_status"><?php _e('Status:') ?></label>
    113 <strong><span id="post-status-display">
     116<b><span id="post-status-display">
    114117<?php
    115118switch ( $post->post_status ) {
     
    129132}
    130133?>
    131 </span></strong>
     134</span></b>
    132135<?php if ( 'publish' == $post->post_status || 'private' == $post->post_status ) { ?>
    133136<a href="#post_status" class="edit-post-status hide-if-no-js" tabindex='4'><?php _e('Edit') ?></a>
     
    168171
    169172<div id="minor-publishing-actions">
    170 <?php if ( 'publish' == $post->post_status || 'private' == $post->post_status )
    171     $savebtn = attribute_escape( __('Update Post') );
    172 else
    173     $savebtn = attribute_escape( __('Save Draft') );
    174 ?>
    175 <input type="submit" name="save" id="save-post" value="<?php echo $savebtn; ?>" tabindex="4" class="button button-highlighted" />
     173
     174<?php if ( 'publish' != $post->post_status && 'private' != $post->post_status )  { ?>
     175<input type="submit" name="save" id="save-post" value="<?php echo attribute_escape( __('Save Draft') ); ?>" tabindex="4" class="button button-highlighted" />
     176<?php } ?>
    176177
    177178<?php if ( 'publish' == $post->post_status ) { ?>
     
    183184<div class="clear"></div>
    184185</div>
    185 <!--</div>-->
    186186
    187187<div id="major-publishing-actions">
     
    202202    <input name="publish" type="submit" class="button-primary" id="publish" tabindex="5" accesskey="p" value="<?php _e('Submit for Review') ?>" />
    203203<?php endif; ?>
    204 <?php } ?>
    205 </div>
    206 </div>
    207 
     204<?php } else { ?>
     205    <input name="save" type="submit" class="button-primary" id="publish" tabindex="5" accesskey="p" value="<?php _e('Update Post') ?>" />
     206<?php } ?>
     207</div>
    208208<div class="clear"></div>
     209</div>
    209210</div>
    210211
Note: See TracChangeset for help on using the changeset viewer.