Make WordPress Core


Ignore:
Timestamp:
11/12/2008 06:36:48 PM (17 years ago)
Author:
markjaquith
Message:

Visibility section of Publish Module for Posts. Pages later.

File:
1 edited

Legend:

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

    r9620 r9639  
    9393
    9494<div id="save-action">
    95 <?php if ( 'publish' != $post->post_status && 'private' != $post->post_status && 'future' != $post->post_status && 'pending' != $post->post_status )  { ?>
    96 <input type="submit" name="save" id="save-post" value="<?php echo attribute_escape( __('Save Draft') ); ?>" tabindex="4" class="button button-highlighted" />
     95<?php if ( 'publish' != $post->post_status && 'future' != $post->post_status && 'pending' != $post->post_status )  { ?>
     96<input <?php if ( 'private' == $post->post_status ) { ?>style="display:none"<?php } ?> type="submit" name="save" id="save-post" value="<?php echo attribute_escape( __('Save Draft') ); ?>" tabindex="4" class="button button-highlighted" />
    9797<?php } elseif ( 'pending' == $post->post_status && $can_publish ) { ?>
    9898<input type="submit" name="save" id="save-post" value="<?php echo attribute_escape( __('Save as Pending') ); ?>" tabindex="4" class="button button-highlighted" />
     
    114114<?php
    115115switch ( $post->post_status ) {
     116    case 'private':
     117        _e('Privately Published');
     118        break;
    116119    case 'publish':
    117     case 'private':
    118120        _e('Published');
    119121        break;
     
    131133</span></b>
    132134<?php if ( 'publish' == $post->post_status || 'private' == $post->post_status || $can_publish ) { ?>
    133 <a href="#post_status" class="edit-post-status hide-if-no-js" tabindex='4'><?php _e('Edit') ?></a>
     135<a href="#post_status" <?php if ( 'private' == $post->post_status ) { ?>style="display:none;" <?php } ?>class="edit-post-status hide-if-no-js" tabindex='4'><?php _e('Edit') ?></a>
    134136
    135137<div id="post-status-select" class="hide-if-js">
    136138<input type="hidden" name="hidden_post_status" id="hidden_post_status" value="<?php echo $post->post_status; ?>" />
    137139<select name='post_status' id='post_status' tabindex='4'>
    138 <?php if ( $post->post_status == 'publish' ) : ?>
    139 <option<?php selected( $post->post_status, 'publish' ); selected( $post->post_status, 'private' );?> value='publish'><?php _e('Published') ?></option>
     140<?php if ( 'publish' == $post->post_status ) : ?>
     141<option<?php selected( $post->post_status, 'publish' ); ?> value='publish'><?php _e('Published') ?></option>
     142<?php elseif ( 'private' == $post->post_status ) : ?>
     143<option<?php selected( $post->post_status, 'private' ); ?> value='publish'><?php _e('Privately Published') ?></option>
    140144<?php elseif ( 'future' == $post->post_status ) : ?>
    141145<option<?php selected( $post->post_status, 'future' ); ?> value='future'><?php _e('Scheduled') ?></option>
     
    151155</div><?php // /misc-pub-section ?>
    152156
    153 
    154 <?php if ( $can_publish && current_user_can( 'edit_others_posts' ) ) { ?>
    155 <div class="misc-pub-section " id="sticky-checkbox">
    156 <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>
     157<div class="misc-pub-section " id="visibility">
     158<?php _e('Visibility:'); ?> <b><span id="post-visibility-display"><?php
     159
     160if ( !empty( $post->post_password ) ) {
     161    $visibility = 'password';
     162    $visibility_trans = __('Password protected');
     163} elseif ( 'private' == $post->post_status ) {
     164    $visibility = 'private';
     165    $visibility_trans = __('Private');
     166} elseif ( is_sticky( $post->ID ) ) {
     167    $visibility = 'public';
     168    $visibility_trans = __('Public, sticky');
     169    $sticky = 'sticky';
     170} else {
     171    $visibility = 'public';
     172    $visibility_trans = __('Public');
     173}
     174
     175?><?php echo wp_specialchars( $visibility_trans ); ?></span></b> <?php if ( $can_publish ) { ?> <a href="#visibility" class="edit-visibility hide-if-no-js"><?php _e('Edit'); ?></a>
     176
     177<div id="post-visibility-select" class="hide-if-js">
     178<input type="hidden" name="hidden_post_password" id="hidden-post-password" value="<?php echo attribute_escape($post->post_password); ?>" />
     179<input type="checkbox" style="display:none" name="hidden_post_sticky" id="hidden-post-sticky" value="sticky" <?php checked(is_sticky($post->ID), true); ?> />
     180<input type="hidden" name="hidden_post_visibility" id="hidden-post-visibility" value="<?php echo attribute_escape( $visibility ); ?>" />
     181
     182
     183<input type="radio" name="visibility" id="visibility-radio-public" value="public" <?php checked( $visibility, 'public' ); ?> /> <label for="visibility-radio-public" class="selectit"><?php _e('Public'); ?></label><br />
     184<span id="sticky-span"><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><br /></span>
     185<input type="radio" name="visibility" id="visibility-radio-password" value="password" <?php checked( $visibility, 'password' ); ?> /> <label for="visibility-radio-password" class="selectit"><?php _e('Password protected'); ?></label><br />
     186<span id="password-span"><label for="post_password"><?php _e('Password:'); ?></label> <input type="text" name="post_password" id="post_password" value="<?php echo attribute_escape($post->post_password); ?>" /><br /></span>
     187<input type="radio" name="visibility" id="visibility-radio-private" value="private" <?php checked( $visibility, 'private' ); ?> /> <label for="visibility-radio-private" class="selectit"><?php _e('Private'); ?></label><br />
     188
     189<p>
     190 <a href="#visibility" class="save-post-visibility hide-if-no-js button"><?php _e('OK'); ?></a>
     191 <a href="#visibility" class="cancel-post-visibility hide-if-no-js"><?php _e('Cancel'); ?></a>
     192</p>
     193</div>
     194<?php } ?>
     195
    157196</div><?php // /misc-pub-section ?>
    158 <?php } ?>
    159197
    160198
     
    164202    if ( 'future' == $post->post_status ) { // scheduled for publishing at a future date
    165203        $stamp = __('Scheduled for: <b>%1$s</b>');
    166     } else if ( 'publish' == $post->post_status ) { // already published
     204    } else if ( 'publish' == $post->post_status || 'private' == $post->post_status ) { // already published
    167205        $stamp = __('Published on: <b>%1$s</b>');
    168206    } else if ( '0000-00-00 00:00:00' == $post->post_date_gmt ) { // draft, 1 or more saves, no date specified
     
    203241<div id="publishing-action">
    204242<?php
    205 if ( !in_array( $post->post_status, array('publish', 'future') ) || 0 == $post->ID ) { ?>
     243if ( !in_array( $post->post_status, array('publish', 'future', 'private') ) || 0 == $post->ID ) { ?>
    206244<?php if ( current_user_can('publish_posts') ) : ?>
    207245    <?php if ( !empty($post->post_date_gmt) && time() < strtotime( $post->post_date_gmt . ' +0000' ) ) : ?>
     246        <input name="original_publish" type="hidden" id="original_publish" value="<?php _e('Schedule') ?>" />
    208247        <input name="publish" type="submit" class="button-primary" id="publish" tabindex="5" accesskey="p" value="<?php _e('Schedule') ?>" />
    209248    <?php else : ?>
     249        <input name="original_publish" type="hidden" id="original_publish" value="<?php _e('Publish') ?>" />
    210250        <input name="publish" type="submit" class="button-primary" id="publish" tabindex="5" accesskey="p" value="<?php _e('Publish') ?>" />
    211251    <?php endif; ?>
    212252<?php else : ?>
     253    <input name="original_publish" type="hidden" id="original_publish" value="<?php _e('Submit for Review') ?>" />
    213254    <input name="publish" type="submit" class="button-primary" id="publish" tabindex="5" accesskey="p" value="<?php _e('Submit for Review') ?>" />
    214255<?php endif; ?>
    215256<?php } else { ?>
     257    <input name="original_publish" type="hidden" id="original_publish" value="<?php _e('Update Post') ?>" />
    216258    <input name="save" type="submit" class="button-primary" id="publish" tabindex="5" accesskey="p" value="<?php _e('Update Post') ?>" />
    217259<?php } ?>
     
    301343<?php
    302344}
    303 add_meta_box('passworddiv', __('Privacy Options'), 'post_password_meta_box', 'post', 'side', 'core');
     345// add_meta_box('passworddiv', __('Privacy Options'), 'post_password_meta_box', 'post', 'side', 'core');
    304346
    305347/**
Note: See TracChangeset for help on using the changeset viewer.