Make WordPress Core

Changeset 9261


Ignore:
Timestamp:
10/21/2008 04:36:35 AM (17 years ago)
Author:
markjaquith
Message:

Initial work on Publish box. Very rough.

Location:
trunk/wp-admin
Files:
2 edited

Legend:

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

    r9241 r9261  
    7373<div class="inside-submitbox">
    7474
    75 <div class="insidebox"><label for="post_status"><?php _e('This post is') ?></label>
    76 <strong><span id="post-status-display">
    77 <?php
    78 switch ( $post->post_status ) {
    79     case 'publish':
    80     case 'private':
    81         _e('Published');
    82         break;
    83     case 'future':
    84         _e('Scheduled');
    85         break;
    86     case 'pending':
    87         _e('Pending Review');
    88         break;
    89     case 'draft':
    90         _e('Unpublished');
    91         break;
    92 }
    93 ?>
    94 </span></strong>
    95 <?php if ( 'publish' == $post->post_status || 'private' == $post->post_status ) { ?>
    96 <a href="#post_status" class="edit-post-status hide-if-no-js" tabindex='4'><?php _e('Edit') ?></a>
    97 
    98 <div id="post-status-select" class="hide-if-js">
    99 <input type="hidden" name="hidden_post_status" id="hidden_post_status" value="<?php echo $post->post_status; ?>" />
    100 <?php _e('Change post status'); ?><br />
    101 <select name='post_status' id='post_status' tabindex='4'>
    102 <?php
    103 // only show the publish menu item if they are allowed to publish posts or they are allowed to edit this post (accounts for 'edit_published_posts' capability)
    104 if ( $can_publish OR ( $post->post_status == 'publish' AND current_user_can('edit_post', $post->ID) ) ) : ?>
    105 <option<?php selected( $post->post_status, 'publish' ); selected( $post->post_status, 'private' );?> value='publish'><?php _e('Published') ?></option>
    106 <?php if ( 'future' == $post->post_status ) : ?>
    107 <option<?php selected( $post->post_status, 'future' ); ?> value='future'><?php _e('Scheduled') ?></option>
    108 <?php endif; ?>
    109 <?php endif; ?>
    110 <option<?php selected( $post->post_status, 'pending' ); ?> value='pending'><?php _e('Pending Review') ?></option>
    111 <option<?php selected( $post->post_status, 'draft' ); ?> value='draft'><?php _e('Unpublished') ?></option>
    112 </select>
    113 
    114 <a href="#post_status" class="save-post-status hide-if-no-js button"><?php _e('OK'); ?></a>
    115 <a href="#post_status" class="cancel-post-status hide-if-no-js"><?php _e('Cancel'); ?></a>
    116 </div>
    117 </div>
    118 
    119 <?php } else { ?>
    120 </div>
    121 
    122 <?php if ( $can_publish && 'pending' != $post->post_status ) { ?>
    123 <div  class="insidebox"><input name="pending" type="submit" class="button" id="pending" tabindex="6" accesskey="r" value="<?php _e('Submit for Review') ?>" /></div>
    124 <?php } ?>
    125 
    126 <?php } ?>
    127 
     75<div id="minor-publishing">
     76<div id="misc-publishing-actions">
    12877<?php if ( $can_publish && current_user_can( 'edit_others_posts' ) ) { ?>
    129     <div class="insidebox" 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 this post to the front page') ?></label></div>
    130 <?php } ?>
    131 
    132 <?php
    133 if ( ( 'edit' == $action ) && current_user_can('delete_post', $post->ID) ) { ?>
    134     <div class="insidebox" id="deletebutton"><a class="submitdelete" href="<?php echo wp_nonce_url("post.php?action=delete&amp;post=$post->ID", 'delete-post_' . $post->ID); ?>" onclick="if ( confirm('<?php echo js_escape(sprintf( ('draft' == $post->post_status) ? __("You are about to delete this draft '%s'\n  'Cancel' to stop, 'OK' to delete.") : __("You are about to delete this post '%s'\n  'Cancel' to stop, 'OK' to delete."), $post->post_title )); ?>') ) {return true;}return false;"><?php _e('Delete&nbsp;post'); ?></a></div>
    135 <?php } ?>
     78    <div class="insidebox" 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>
     79<?php } ?>
     80
     81<div class="insidebox" id="visibility">
     82<?php _e('Visibility:'); ?> <?php _e('Public'); // TODO: dropdown ?>
     83</div>
    13684
    13785<?php
     
    155103?>
    156104<?php if ( $can_publish ) : // Contributors don't get to choose the date of publish ?>
    157 <div class="insidebox curtime"><span id="timestamp"><?php printf($stamp, $date, $time); ?></span>
    158 &nbsp;<a href="#edit_timestamp" class="edit-timestamp hide-if-no-js" tabindex='4'><?php _e('Edit') ?></a>
    159 
    160 <div id="timestampdiv" class="hide-if-js"><?php touch_time(($action == 'edit'),1,4); ?></div></div>
    161 <?php endif; ?>
    162 
    163 </div>
    164 
    165 <p class="submit">
    166 <?php do_action('post_submitbox_start'); ?>
     105<div class="insidebox curtime">
     106    <span id="timestamp"><?php printf($stamp, $date, $time); ?></span>
     107    &nbsp;<a href="#edit_timestamp" class="edit-timestamp hide-if-no-js" tabindex='4'><?php _e('Edit') ?></a>
     108    <div id="timestampdiv" class="hide-if-js"><?php touch_time(($action == 'edit'),1,4); ?></div>
     109</div>
     110<?php endif; ?>
     111
     112<div class="insidebox"><label for="post_status"><?php _e('Status:') ?></label>
     113<strong><span id="post-status-display">
     114<?php
     115switch ( $post->post_status ) {
     116    case 'publish':
     117    case 'private':
     118        _e('Published');
     119        break;
     120    case 'future':
     121        _e('Scheduled');
     122        break;
     123    case 'pending':
     124        _e('Pending Review');
     125        break;
     126    case 'draft':
     127        _e('Draft');
     128        break;
     129}
     130?>
     131</span></strong>
     132<?php if ( 'publish' == $post->post_status || 'private' == $post->post_status ) { ?>
     133<a href="#post_status" class="edit-post-status hide-if-no-js" tabindex='4'><?php _e('Edit') ?></a>
     134
     135<div id="post-status-select" class="hide-if-js">
     136<input type="hidden" name="hidden_post_status" id="hidden_post_status" value="<?php echo $post->post_status; ?>" />
     137<?php _e('Change post status'); ?><br />
     138<select name='post_status' id='post_status' tabindex='4'>
     139<?php
     140// only show the publish menu item if they are allowed to publish posts or they are allowed to edit this post (accounts for 'edit_published_posts' capability)
     141if ( $can_publish OR ( $post->post_status == 'publish' AND current_user_can('edit_post', $post->ID) ) ) : ?>
     142<option<?php selected( $post->post_status, 'publish' ); selected( $post->post_status, 'private' );?> value='publish'><?php _e('Published') ?></option>
     143<?php if ( 'future' == $post->post_status ) : ?>
     144<option<?php selected( $post->post_status, 'future' ); ?> value='future'><?php _e('Scheduled') ?></option>
     145<?php endif; ?>
     146<?php endif; ?>
     147<option<?php selected( $post->post_status, 'pending' ); ?> value='pending'><?php _e('Pending Review') ?></option>
     148<option<?php selected( $post->post_status, 'draft' ); ?> value='draft'><?php _e('Draft') ?></option>
     149</select>
     150
     151<a href="#post_status" class="save-post-status hide-if-no-js button"><?php _e('OK'); ?></a>
     152<a href="#post_status" class="cancel-post-status hide-if-no-js"><?php _e('Cancel'); ?></a>
     153</div>
     154</div>
     155
     156<?php } else { ?>
     157</div>
     158
     159<?php if ( $can_publish && 'pending' != $post->post_status ) { ?>
     160<!--
     161<div  class="insidebox"><input name="pending" type="submit" class="button" id="pending" tabindex="6" accesskey="r" value="<?php _e('Submit for Review') ?>" /></div>
     162-->
     163<?php } ?>
     164
     165<?php } ?>
     166
     167</div>
     168
     169<div id="minor-publishing-actions">
    167170<?php if ( 'publish' == $post->post_status || 'private' == $post->post_status )
    168171    $savebtn = attribute_escape( __('Save') );
     
    173176
    174177<?php if ( 'publish' == $post->post_status ) { ?>
    175 <a class="preview button" href="<?php echo clean_url(get_permalink($post->ID)); ?>" target="_blank" tabindex="4"><?php _e('View this Post'); ?></a>
     178<a class="preview button" href="<?php echo clean_url(get_permalink($post->ID)); ?>" target="_blank" tabindex="4"><?php _e('View Post'); ?></a>
    176179<?php } else { ?>
    177180<a class="preview button" href="<?php echo clean_url(apply_filters('preview_post_link', add_query_arg('preview', 'true', get_permalink($post->ID)))); ?>" target="_blank" tabindex="4"><?php _e('Preview'); ?></a>
    178181<?php } ?>
    179 
     182</div>
     183<div class="clear"></div>
     184</div>
     185</div>
     186
     187<div id="major-publishing-actions">
     188<?php do_action('post_submitbox_start'); ?>
     189<div id="delete-action">
     190<?php
     191if ( ( 'edit' == $action ) && current_user_can('delete_post', $post->ID) ) { ?>
     192<a class="submitdelete deletion" href="<?php echo wp_nonce_url("post.php?action=delete&amp;post=$post->ID", 'delete-post_' . $post->ID); ?>" onclick="if ( confirm('<?php echo js_escape(sprintf( ('draft' == $post->post_status) ? __("You are about to delete this draft '%s'\n  'Cancel' to stop, 'OK' to delete.") : __("You are about to delete this post '%s'\n  'Cancel' to stop, 'OK' to delete."), $post->post_title )); ?>') ) {return true;}return false;"><?php _e('Delete'); ?></a>
     193<?php } ?>
     194</div>
     195
     196<div id="publishing-action">
    180197<?php
    181198if ( !in_array( $post->post_status, array('publish', 'future') ) || 0 == $post->ID ) { ?>
     
    186203<?php endif; ?>
    187204<?php } ?>
    188 
    189 </p>
     205</div>
     206</div>
    190207<div class="clear"></div>
    191208</div>
  • trunk/wp-admin/wp-admin.css

    r9240 r9261  
    199199    border-bottom-left-radius: 3px;
    200200    border-bottom-right-radius: 3px;
     201}
     202
     203#misc-publishing-actions {
     204    width: 70%;
     205    float: left;
     206}
     207
     208#minor-publishing-actions {
     209    width: 30%;
     210    float: right;
     211    text-align: right;
     212}
     213
     214#minor-publishing {
     215}
     216
     217#major-publishing-actions {
     218    padding: 0 3px;
     219    clear: both;
     220    height: 30px;
     221    line-height: 30px;
     222}
     223
     224#delete-action {
     225    text-align: left;
     226    float: left;
     227    width: 30%;
     228}
     229
     230#publishing-action {
     231    text-align: right;
     232    float: right;
     233    width: 70%;
    201234}
    202235
     
    237270
    238271.preview {
    239     padding: 7px;
     272    /* padding: 7px; */
    240273}
    241274
    242275#publish {
    243     margin: 8px auto auto;
    244     min-width: 150px;
     276    min-width: 100px;
    245277}
    246278
     
    10581090
    10591091#normal-sortables .inside-submitbox {
    1060     float: left;
     1092    /* float: left; */
    10611093}
    10621094
     
    12311263#poststuff .inside {
    12321264    font-size: 11px;
    1233     margin: 0 12px 12px;
     1265    margin: 0 6px 6px;
    12341266}
    12351267
     
    12631295#poststuff .inside-submitbox,
    12641296#side-info-column .inside-submitbox {
    1265     margin: 0 12px 12px;
     1297    margin: 0 3px;
    12661298    font-size: 11px;
    12671299}
Note: See TracChangeset for help on using the changeset viewer.