Make WordPress Core


Ignore:
Timestamp:
09/13/2008 07:12:55 PM (17 years ago)
Author:
ryan
Message:

Move Show Settings into header and rename Advanced Options. Move preview links into submit box. see #7552

File:
1 edited

Legend:

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

    r8862 r8883  
    6262
    6363<div class="inside-submitbox">
    64 <p><strong><label for='post_status'><?php _e('Publish Status') ?></label></strong></p>
    65 <p>
    66 <select name='post_status' tabindex='4' id='post_status'>
    67 <?php // Show publish in dropdown if user can publish or if they can re-publish this page ('edit_published_pages')
    68 // 'publish' option will be selected for published AND private posts (checkbox overrides dropdown)
    69 if ( current_user_can('publish_pages') OR ( $post->post_status == 'publish' AND current_user_can('edit_page', $post->ID) ) ) :
    70 ?>
     64
     65<p><label for='post_status'><?php _e('This post is') ?></label>
     66<strong><span id="post-status-display">
     67<?php
     68switch ( $post->post_status ) {
     69    case 'publish':
     70    case 'private':
     71        _e('Published');
     72        break;
     73    case 'future':
     74        _e('Scheduled');
     75        break;
     76    case 'pending':
     77        _e('Pending Review');
     78        break;
     79    case 'draft':
     80        _e('Unpublished');
     81        break;
     82}
     83?>
     84</span></strong>
     85<a href="#edit_post_status" class="edit-post-status hide-if-no-js" tabindex='4'><?php _e('Edit') ?></a>
     86</p>
     87
     88<p id='post-status-select' class="hide-if-js">
     89<select name='post_status' id='post_status' tabindex='4'>
     90<?php
     91// 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)
     92if ( current_user_can('publish_pages') OR ( $post->post_status == 'publish' AND current_user_can('edit_page', $post->ID) ) ) : ?>
     93<?php if ( 'publish' == $post->post_status || 'private' == $post->post_status ) { ?>
    7194<option<?php selected( $post->post_status, 'publish' ); selected( $post->post_status, 'private' );?> value='publish'><?php _e('Published') ?></option>
    72 <?php endif; ?>
     95<?php } ?>
    7396<?php if ( 'future' == $post->post_status ) : ?>
    74 <option<?php selected( $post->post_status, 'future' ); ?> value='future'><?php _e('Pending') ?></option>
     97<option<?php selected( $post->post_status, 'future' ); ?> value='future'><?php _e('Scheduled') ?></option>
     98<?php endif; ?>
    7599<?php endif; ?>
    76100<option<?php selected( $post->post_status, 'pending' ); ?> value='pending'><?php _e('Pending Review') ?></option>
     
    98122}
    99123?>
     124<?php if ( current_user_can( 'publish_pages' ) ) : // Contributors don't get to choose the date of publish ?>
    100125<p class="curtime"><?php printf($stamp, $date, $time); ?>
    101126&nbsp;<a href="#edit_timestamp" class="edit-timestamp hide-if-no-js" tabindex='4'><?php _e('Edit') ?></a></p>
    102127
    103128<div id='timestampdiv' class='hide-if-js'><?php touch_time(($action == 'edit'),1,4); ?></div>
     129<?php endif; ?>
    104130
    105131</div>
     
    108134<?php do_action('page_submitbox_start'); ?>
    109135<input type="submit" name="save" class="button button-highlighted" value="<?php _e('Save'); ?>" tabindex="4" />
     136
     137<?php if ( 'publish' == $post->post_status ) { ?>
     138<a class="preview button" href="<?php echo clean_url(get_permalink($post->ID)); ?>" target="_blank" tabindex="4"><?php _e('View this Page'); ?></a>
     139<?php } else { ?>
     140<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>
     141<?php } ?>
     142
     143<?php if ( ('edit' == $action) && current_user_can('delete_page', $post->ID) )
     144    echo "<a class='submitdelete' href='" . wp_nonce_url("page.php?action=delete&amp;post=$post->ID", 'delete-page_' . $post->ID) . "' onclick=\"if ( confirm('" . 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 page '%s'\n  'Cancel' to stop, 'OK' to delete."), $post->post_title )) . "') ) { return true;}return false;\">" . __('Delete&nbsp;page') . "</a>";
     145?>
     146<br class="clear" />
    110147<?php
    111148if ( !in_array( $post->post_status, array('publish', 'future') ) || 0 == $post->ID ) {
     
    118155<?php
    119156}
    120 
    121 if ( ('edit' == $action) && current_user_can('delete_page', $post->ID) )
    122     echo "<a class='submitdelete' href='" . wp_nonce_url("page.php?action=delete&amp;post=$post->ID", 'delete-page_' . $post->ID) . "' onclick=\"if ( confirm('" . 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 page '%s'\n  'Cancel' to stop, 'OK' to delete."), $post->post_title )) . "') ) { return true;}return false;\">" . __('Delete&nbsp;page') . "</a>";
    123 ?>
    124 <br class="clear" />
     157?>
    125158
    126159<!-- moved under the editor
     
    249282
    250283<div class="wrap">
     284
     285<div id="show-settings"><a href="#edit_settings" id="show-settings-link" class="hide-if-no-js"><?php _e('Advanced Options') ?></a>
     286<a href="#edit_settings" id="hide-settings-link" class="hide-if-js hide-if-no-js"><?php _e('Hide Options') ?></a></div>
     287
     288<div id="edit-settings" class="hide-if-js hide-if-no-js">
     289<div id="edit-settings-wrap">
     290<h5><?php _e('Show on screen') ?></h5>
     291<div class="metabox-prefs">
     292<?php meta_box_prefs('page') ?>
     293<br class="clear" />
     294</div></div>
     295</div>
     296
    251297<h2><?php
    252298    if ( !isset($post_ID) || 0 == $post_ID )
     
    255301        printf( __( '<a href="%s">Pages</a> / Edit Page' ), 'edit-pages.php' );
    256302?></h2>
    257 
    258 <div id="previewview">
    259 <?php if ( 'publish' == $post->post_status ) { ?>
    260 <a class="button" href="<?php echo clean_url(get_permalink($post->ID)); ?>" target="_blank"  tabindex="4"><?php _e('View this Page'); ?></a>
    261 <?php } elseif ( 'edit' == $action ) { ?>
    262 <a class="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 this Page'); ?></a>
    263 <?php } ?>
    264 </div>
    265303
    266304<?php
     
    316354<div id="poststuff">
    317355
    318 <div id="show-settings"><a href="#edit_settings" id="show-settings-link" class="hide-if-no-js"><?php _e('Show Settings') ?></a>
    319 <a href="#edit_settings" id="hide-settings-link" class="hide-if-js hide-if-no-js"><?php _e('Hide Settings') ?></a></div>
    320 
    321 <div id="edit-settings" class="hide-if-js hide-if-no-js">
    322 <div id="edit-settings-wrap">
    323 <h5><?php _e('Show on screen') ?></h5>
    324 <div class="metabox-prefs">
    325 <?php meta_box_prefs('page') ?>
    326 <br class="clear" />
    327 </div></div>
    328 </div>
    329 
    330356<div id="side-info-column" class="inner-sidebar">
    331357
Note: See TracChangeset for help on using the changeset viewer.