WordPress.org

Make WordPress Core

Changeset 8883


Ignore:
Timestamp:
09/13/08 19:12:55 (6 years ago)
Author:
ryan
Message:

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

Location:
trunk/wp-admin
Files:
6 edited

Legend:

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

    r8875 r8883  
    413413 
    414414<div class="wrap"> 
     415 
     416<div id="show-settings"><a href="#edit_settings" id="show-settings-link" class="hide-if-no-js"><?php _e('Advanced Options') ?></a> 
     417<a href="#edit_settings" id="hide-settings-link" class="hide-if-js hide-if-no-js"><?php _e('Hide Options') ?></a></div> 
     418 
     419<div id="edit-settings" class="hide-if-js hide-if-no-js"> 
     420<div id="edit-settings-wrap"> 
     421<h5><?php _e('Show on screen') ?></h5> 
     422<div class="metabox-prefs"> 
     423<?php meta_box_prefs('post') ?> 
     424<br class="clear" /> 
     425</div></div> 
     426</div> 
     427 
    415428<h2><?php 
    416429    if ( !isset($post_ID) || 0 == $post_ID) 
     
    447460 
    448461<div id="poststuff"> 
    449  
    450 <div id="show-settings"><a href="#edit_settings" id="show-settings-link" class="hide-if-no-js"><?php _e('Show Settings') ?></a> 
    451 <a href="#edit_settings" id="hide-settings-link" class="hide-if-js hide-if-no-js"><?php _e('Hide Settings') ?></a></div> 
    452  
    453 <div id="edit-settings" class="hide-if-js hide-if-no-js"> 
    454 <div id="edit-settings-wrap"> 
    455 <h5><?php _e('Show on screen') ?></h5> 
    456 <div class="metabox-prefs"> 
    457 <?php meta_box_prefs('post') ?> 
    458 <br class="clear" /> 
    459 </div></div> 
    460 </div> 
    461462 
    462463<div id="side-info" style="display: none;"><?php // TODO ?> 
  • trunk/wp-admin/edit-link-form.php

    r8753 r8883  
    4747<p class="submit"> 
    4848<input type="submit" class="button button-highlighted" name="save" value="<?php _e('Save'); ?>" tabindex="4" /> 
     49 
     50<?php if ( !empty($link->link_id) ) { ?> 
     51<a class="preview button" href="<?php echo $link->link_url; ?>" target="_blank"><?php _e('Visit Link'); ?></a> 
     52<?php } ?> 
     53 
    4954<?php 
    5055if ( ( 'edit' == $action) && current_user_can('manage_links') ) 
     
    266271 
    267272<div class="wrap"> 
     273 
     274<div id="show-settings"><a href="#edit_settings" id="show-settings-link" class="hide-if-no-js"><?php _e('Advanced Options') ?></a> 
     275<a href="#edit_settings" id="hide-settings-link" class="hide-if-js hide-if-no-js"><?php _e('Hide Options') ?></a></div> 
     276 
     277<div id="edit-settings" class="hide-if-js hide-if-no-js"> 
     278<div id="edit-settings-wrap"> 
     279<h5><?php _e('Show on screen') ?></h5> 
     280<div class="metabox-prefs"> 
     281<?php meta_box_prefs('link') ?> 
     282<br class="clear" /> 
     283</div></div> 
     284</div> 
     285 
    268286<h2><?php echo $heading; ?></h2> 
    269  
    270 <?php if ( !empty($link->link_id) ) { ?> 
    271 <div id="previewview"> 
    272 <a class="button" href="<?php echo $link->link_url; ?>" target="_blank"><?php _e('Visit Link'); ?></a> 
    273 </div> 
    274 <?php } ?> 
    275287 
    276288<!-- 
     
    303315<div id="poststuff"> 
    304316 
    305 <div id="show-settings"><a href="#edit_settings" id="show-settings-link" class="hide-if-no-js"><?php _e('Show Settings') ?></a> 
    306 <a href="#edit_settings" id="hide-settings-link" class="hide-if-js hide-if-no-js"><?php _e('Hide Settings') ?></a></div> 
    307  
    308 <div id="edit-settings" class="hide-if-js hide-if-no-js"> 
    309 <div id="edit-settings-wrap"> 
    310 <h5><?php _e('Show on screen') ?></h5> 
    311 <div class="metabox-prefs"> 
    312 <?php meta_box_prefs('link') ?> 
    313 <br class="clear" /> 
    314 </div></div> 
    315 </div> 
    316  
    317317<div id="side-info-column" class="inner-sidebar"> 
    318318<?php  
  • 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 
  • trunk/wp-admin/edit-pages.php

    r8867 r8883  
    8989<form id="posts-filter" action="" method="get"> 
    9090 
    91 <div id="show-settings"><a href="#edit_settings" id="show-settings-link" class="hide-if-no-js"><?php _e('Show Settings') ?></a> 
    92 <a href="#edit_settings" id="hide-settings-link" class="hide-if-js hide-if-no-js"><?php _e('Hide Settings') ?></a></div> 
     91<div id="show-settings"><a href="#edit_settings" id="show-settings-link" class="hide-if-no-js"><?php _e('Advanced Options') ?></a> 
     92<a href="#edit_settings" id="hide-settings-link" class="hide-if-js hide-if-no-js"><?php _e('Hide Options') ?></a></div> 
    9393 
    9494<div id="edit-settings" class="hide-if-js hide-if-no-js"> 
  • trunk/wp-admin/edit.php

    r8867 r8883  
    8484<form id="posts-filter" action="" method="get"> 
    8585 
    86 <div id="show-settings"><a href="#edit_settings" id="show-settings-link" class="hide-if-no-js"><?php _e('Show Settings') ?></a> 
    87 <a href="#edit_settings" id="hide-settings-link" class="hide-if-js hide-if-no-js"><?php _e('Hide Settings') ?></a></div> 
     86<div id="show-settings"><a href="#edit_settings" id="show-settings-link" class="hide-if-no-js"><?php _e('Advanced Options') ?></a> 
     87<a href="#edit_settings" id="hide-settings-link" class="hide-if-js hide-if-no-js"><?php _e('Hide Options') ?></a></div> 
    8888 
    8989<div id="edit-settings" class="hide-if-js hide-if-no-js"> 
  • trunk/wp-admin/js/page.js

    r8752 r8883  
    6161        return false; 
    6262    }); 
     63 
     64    jQuery('.edit-post-status').click(function () { 
     65        if (jQuery('#post-status-select').is(":hidden")) { 
     66            jQuery('#post-status-select').slideDown("normal"); 
     67        } else { 
     68            jQuery('#post-status-select').slideUp("normal"); 
     69            jQuery('#post-status-display').html(jQuery('#post_status :selected').text()); 
     70        } 
     71        return false; 
     72    }); 
    6373}); 
Note: See TracChangeset for help on using the changeset viewer.