Make WordPress Core


Ignore:
Timestamp:
11/12/2008 07:31:39 PM (18 years ago)
Author:
markjaquith
Message:

Visibility section for the Publish Module for Pages

File:
1 edited

Legend:

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

    r9620 r9641  
    8686
    8787<div id="save-action">
    88 <?php if ( 'publish' != $post->post_status && 'private' != $post->post_status && 'future' != $post->post_status && 'pending' != $post->post_status )  { ?>
    89 <input type="submit" name="save" id="save-post" value="<?php echo attribute_escape( __('Save Draft') ); ?>" tabindex="4" class="button button-highlighted" />
     88<?php if ( 'publish' != $post->post_status && 'future' != $post->post_status && 'pending' != $post->post_status )  { ?>
     89<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" />
    9090<?php } elseif ( 'pending' == $post->post_status && $can_publish ) { ?>
    9191<input type="submit" name="save" id="save-post" value="<?php echo attribute_escape( __('Save as Pending') ); ?>" tabindex="4" class="button button-highlighted" />
    … …  
    107107<?php
    108108switch ( $post->post_status ) {
     109        case 'private':
     110                _e('Privately Published');
     111                break;
    109112        case 'publish':
    110         case 'private':
    111113                _e('Published');
    112114                break;
    … …  
    124126</span></b>
    125127<?php if ( 'publish' == $post->post_status || 'private' == $post->post_status || $can_publish ) { ?>
    126 <a href="#post_status" class="edit-post-status hide-if-no-js" tabindex='4'><?php _e('Edit') ?></a>
     128<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>
    127129
    128130<div id="post-status-select" class="hide-if-js">
    129131<input type="hidden" name="hidden_post_status" id="hidden_post_status" value="<?php echo $post->post_status; ?>" />
    130132<select name='post_status' id='post_status' tabindex='4'>
    131 <?php if ( $post->post_status == 'publish' ) : ?>
    132 <option<?php selected( $post->post_status, 'publish' ); selected( $post->post_status, 'private' );?> value='publish'><?php _e('Published') ?></option>
     133<?php if ( 'publish' == $post->post_status ) : ?>
     134<option<?php selected( $post->post_status, 'publish' ); ?> value='publish'><?php _e('Published') ?></option>
     135<?php elseif ( 'private' == $post->post_status ) : ?>
     136<option<?php selected( $post->post_status, 'private' ); ?> value='publish'><?php _e('Privately Published') ?></option>
    133137<?php elseif ( 'future' == $post->post_status ) : ?>
    134138<option<?php selected( $post->post_status, 'future' ); ?> value='future'><?php _e('Scheduled') ?></option>
    … …  
    145149</div><?php // /misc-pub-section ?>
    146150
     151<div class="misc-pub-section " id="visibility">
     152<?php _e('Visibility:'); ?> <b><span id="post-visibility-display"><?php
     153
     154if ( !empty( $post->post_password ) ) {
     155        $visibility = 'password';
     156        $visibility_trans = __('Password protected');
     157} elseif ( 'private' == $post->post_status ) {
     158        $visibility = 'private';
     159        $visibility_trans = __('Private');
     160} else {
     161        $visibility = 'public';
     162        $visibility_trans = __('Public');
     163}
     164
     165?><?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>
     166
     167<div id="post-visibility-select" class="hide-if-js">
     168<input type="hidden" name="hidden_post_password" id="hidden-post-password" value="<?php echo attribute_escape($post->post_password); ?>" />
     169<input type="hidden" name="hidden_post_visibility" id="hidden-post-visibility" value="<?php echo attribute_escape( $visibility ); ?>" />
     170
     171
     172<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 />
     173<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 />
     174<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>
     175<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 />
     176
     177<p>
     178 <a href="#visibility" class="save-post-visibility hide-if-no-js button"><?php _e('OK'); ?></a>
     179 <a href="#visibility" class="cancel-post-visibility hide-if-no-js"><?php _e('Cancel'); ?></a>
     180</p>
     181</div>
     182<?php } ?>
     183
     184</div><?php // /misc-pub-section ?>
     185
    147186<?php
    148187$datef = _c( 'M j, Y @ G:i|Publish box date format');
    … …  
    150189        if ( 'future' == $post->post_status ) { // scheduled for publishing at a future date
    151190                $stamp = __('Scheduled for: <b>%1$s</b>');
    152         } else if ( 'publish' == $post->post_status ) { // already published
     191        } else if ( 'publish' == $post->post_status || 'private' == $post->post_status ) { // already published
    153192                $stamp = __('Published on: <b>%1$s</b>');
    154193        } else if ( '0000-00-00 00:00:00' == $post->post_date_gmt ) { // draft, 1 or more saves, no date specified
    … …  
    189228<div id="publishing-action">
    190229<?php
    191 if ( !in_array( $post->post_status, array('publish', 'future') ) || 0 == $post->ID ) { ?>
     230if ( !in_array( $post->post_status, array('publish', 'future', 'private') ) || 0 == $post->ID ) { ?>
    192231<?php if ( current_user_can('publish_posts') ) : ?>
    193232        <?php if ( !empty($post->post_date_gmt) && time() < strtotime( $post->post_date_gmt . ' +0000' ) ) : ?>
     233                <input name="original_publish" type="hidden" id="original_publish" value="<?php _e('Schedule') ?>" />
    194234                <input name="publish" type="submit" class="button-primary" id="publish" tabindex="5" accesskey="p" value="<?php _e('Schedule') ?>" />
    195235        <?php else : ?>
     236                <input name="original_publish" type="hidden" id="original_publish" value="<?php _e('Publish') ?>" />
    196237                <input name="publish" type="submit" class="button-primary" id="publish" tabindex="5" accesskey="p" value="<?php _e('Publish') ?>" />
    197238        <?php endif; ?>
    198239<?php else : ?>
     240        <input name="original_publish" type="hidden" id="original_publish" value="<?php _e('Submit for Review') ?>" />
    199241        <input name="publish" type="submit" class="button-primary" id="publish" tabindex="5" accesskey="p" value="<?php _e('Submit for Review') ?>" />
    200242<?php endif; ?>
    201243<?php } else { ?>
     244        <input name="original_publish" type="hidden" id="original_publish" value="<?php _e('Update Page') ?>" />
    202245        <input name="save" type="submit" class="button-primary" id="publish" tabindex="5" accesskey="p" value="<?php _e('Update Page') ?>" />
    203246<?php } ?>
    … …  
    225268<?php
    226269}
    227 add_meta_box('pagepassworddiv', __('Privacy Options'), 'page_password_meta_box', 'page', 'side', 'core');
     270// add_meta_box('pagepassworddiv', __('Privacy Options'), 'page_password_meta_box', 'page', 'side', 'core');
    228271
    229272/**
    … …  
    379422
    380423<div class="wrap">
    381 <h2><?php echo wp_specialchars( $title ); ?></h2> 
     424<h2><?php echo wp_specialchars( $title ); ?></h2>
    382425
    383426<form name="post" action="page.php" method="post" id="post">
Note: See TracChangeset for help on using the changeset viewer.