Make WordPress Core


Ignore:
Timestamp:
05/05/2009 02:14:25 AM (15 years ago)
Author:
azaozz
Message:

Some cleanup for edit-page-form.php and edit-form-advanced.php, props simek, fixes #9501

File:
1 edited

Legend:

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

    r11180 r11183  
    105105
    106106<div class="misc-pub-section<?php if ( !$can_publish ) { echo '  misc-pub-section-last'; } ?>"><label for="post_status"><?php _e('Status:') ?></label>
    107 <b><span id="post-status-display">
     107<span id="post-status-display">
    108108<?php
    109109switch ( $post->post_status ) {
     
    125125}
    126126?>
    127 </span></b>
     127</span>
    128128<?php if ( 'publish' == $post->post_status || 'private' == $post->post_status || $can_publish ) { ?>
    129129<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>
     
    150150
    151151<div class="misc-pub-section " id="visibility">
    152 <?php _e('Visibility:'); ?> <b><span id="post-visibility-display"><?php
     152<?php _e('Visibility:'); ?> <span id="post-visibility-display"><?php
    153153
    154154if ( 'private' == $post->post_status ) {
     
    167167}
    168168
    169 ?><?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>
     169?><?php echo wp_specialchars( $visibility_trans ); ?></span> <?php if ( $can_publish ) { ?> <a href="#visibility" class="edit-visibility hide-if-no-js"><?php _e('Edit'); ?></a>
    170170
    171171<div id="post-visibility-select" class="hide-if-js">
     
    211211    $date = date_i18n( $datef, strtotime( current_time('mysql') ) );
    212212}
    213 ?>
    214 <?php if ( $can_publish ) : // Contributors don't get to choose the date of publish ?>
     213
     214if ( $can_publish ) : // Contributors don't get to choose the date of publish ?>
    215215<div class="misc-pub-section curtime misc-pub-section-last">
    216216    <span id="timestamp">
     
    236236<div id="publishing-action">
    237237<?php
    238 if ( !in_array( $post->post_status, array('publish', 'future', 'private') ) || 0 == $post->ID ) { ?>
    239 <?php if ( current_user_can('publish_posts') ) : ?>
    240     <?php if ( !empty($post->post_date_gmt) && time() < strtotime( $post->post_date_gmt . ' +0000' ) ) : ?>
     238if ( !in_array( $post->post_status, array('publish', 'future', 'private') ) || 0 == $post->ID ) {
     239    if ( current_user_can('publish_posts') ) :
     240        if ( !empty($post->post_date_gmt) && time() < strtotime( $post->post_date_gmt . ' +0000' ) ) : ?>
    241241        <input name="original_publish" type="hidden" id="original_publish" value="<?php _ea('Schedule') ?>" />
    242242        <input name="publish" type="submit" class="button-primary" id="publish" tabindex="5" accesskey="p" value="<?php _ea('Schedule') ?>" />
    243     <?php else : ?>
     243<?php   else : ?>
    244244        <input name="original_publish" type="hidden" id="original_publish" value="<?php _ea('Publish') ?>" />
    245245        <input name="publish" type="submit" class="button-primary" id="publish" tabindex="5" accesskey="p" value="<?php _ea('Publish') ?>" />
    246     <?php endif; ?>
    247 <?php else : ?>
    248     <input name="original_publish" type="hidden" id="original_publish" value="<?php _ea('Submit for Review') ?>" />
    249     <input name="publish" type="submit" class="button-primary" id="publish" tabindex="5" accesskey="p" value="<?php _ea('Submit for Review') ?>" />
    250 <?php endif; ?>
    251 <?php } else { ?>
    252     <input name="original_publish" type="hidden" id="original_publish" value="<?php _ea('Update Post') ?>" />
    253     <input name="save" type="submit" class="button-primary" id="publish" tabindex="5" accesskey="p" value="<?php _ea('Update Post') ?>" />
    254 <?php } ?>
     246<?php   endif;
     247    else : ?>
     248        <input name="original_publish" type="hidden" id="original_publish" value="<?php _ea('Submit for Review') ?>" />
     249        <input name="publish" type="submit" class="button-primary" id="publish" tabindex="5" accesskey="p" value="<?php _ea('Submit for Review') ?>" />
     250<?php
     251    endif;
     252} else { ?>
     253        <input name="original_publish" type="hidden" id="original_publish" value="<?php _ea('Update Post') ?>" />
     254        <input name="save" type="submit" class="button-primary" id="publish" tabindex="5" accesskey="p" value="<?php _ea('Update Post') ?>" />
     255<?php
     256} ?>
    255257</div>
    256258<div class="clear"></div>
     
    318320<div id="categories-pop" class="ui-tabs-panel" style="display: none;">
    319321    <ul id="categorychecklist-pop" class="categorychecklist form-no-clear" >
    320         <?php $popular_ids = wp_popular_terms_checklist('category'); ?>
     322<?php $popular_ids = wp_popular_terms_checklist('category'); ?>
    321323    </ul>
    322324</div>
     
    324326<div id="categories-all" class="ui-tabs-panel">
    325327    <ul id="categorychecklist" class="list:category categorychecklist form-no-clear">
    326         <?php wp_category_checklist($post->ID, false, false, $popular_ids) ?>
     328<?php wp_category_checklist($post->ID, false, false, $popular_ids) ?>
    327329    </ul>
    328330</div>
     
    332334    <h4><a id="category-add-toggle" href="#category-add" class="hide-if-no-js" tabindex="3"><?php _e( '+ Add New Category' ); ?></a></h4>
    333335    <p id="category-add" class="wp-hidden-child">
    334         <label class="invisible" for="newcat"><?php _e( 'Add New Category' ); ?></label><input type="text" name="newcat" id="newcat" class="form-required form-input-tip" value="<?php _ea( 'New category name' ); ?>" tabindex="3" aria-required="true"/>
    335         <label class="invisible" for="newcat_parent"><?php _e('Parent category'); ?>:</label><?php wp_dropdown_categories( array( 'hide_empty' => 0, 'name' => 'newcat_parent', 'orderby' => 'name', 'hierarchical' => 1, 'show_option_none' => __('Parent category'), 'tab_index' => 3 ) ); ?>
    336         <input type="button" id="category-add-sumbit" class="add:categorychecklist:category-add button" value="<?php _ea( 'Add' ); ?>" tabindex="3" />
    337         <?php wp_nonce_field( 'add-category', '_ajax_nonce', false ); ?>
    338         <span id="category-ajax-response"></span>
    339     </p>
     336    <label class="invisible" for="newcat"><?php _e( 'Add New Category' ); ?></label><input type="text" name="newcat" id="newcat" class="form-required form-input-tip" value="<?php _ea( 'New category name' ); ?>" tabindex="3" aria-required="true"/>
     337    <label class="invisible" for="newcat_parent"><?php _e('Parent category'); ?>:</label><?php wp_dropdown_categories( array( 'hide_empty' => 0, 'name' => 'newcat_parent', 'orderby' => 'name', 'hierarchical' => 1, 'show_option_none' => __('Parent category'), 'tab_index' => 3 ) ); ?>
     338    <input type="button" id="category-add-sumbit" class="add:categorychecklist:category-add button" value="<?php _ea( 'Add' ); ?>" tabindex="3" />
     339<?php   wp_nonce_field( 'add-category', '_ajax_nonce', false ); ?>
     340    <span id="category-ajax-response"></span></p>
    340341</div>
    341342<?php
     
    354355function post_password_meta_box($post) {
    355356?>
    356 <p>
    357     <label for="post_status_private" class="selectit"><input id="post_status_private" name="post_status" type="checkbox" value="private" <?php checked($post->post_status, 'private'); ?> tabindex="4" /> <?php _e('Keep this post private') ?></label>
    358 </p>
     357<p><label for="post_status_private" class="selectit"><input id="post_status_private" name="post_status" type="checkbox" value="private" <?php checked($post->post_status, 'private'); ?> tabindex="4" /> <?php _e('Keep this post private') ?></label></p>
    359358<h4><?php _e( 'Post Password' ); ?></h4>
    360359<p><label class="invisible" for="post_password"><?php _e('Password Protect This Post') ?></label><input name="post_password" type="text" size="25" id="post_password" value="<?php the_post_password(); ?>" /></p>
     
    420419$metadata = has_meta($post->ID);
    421420list_meta($metadata);
    422 meta_form();
    423 ?>
     421meta_form(); ?>
    424422</div>
    425423<p><?php _e('Custom fields can be used to add extra metadata to a post that you can <a href="http://codex.wordpress.org/Using_Custom_Fields" target="_blank">use in your theme</a>.'); ?></p>
     
    442440<p class="meta-options">
    443441    <label for="comment_status" class="selectit"> <input name="comment_status" type="checkbox" id="comment_status" value="open" <?php checked($post->comment_status, 'open'); ?> /> <?php _e('Allow comments on this post') ?></label><br />
    444     <label for="ping_status" class="selectit"><input name="ping_status" type="checkbox" id="ping_status" value="open" <?php checked($post->ping_status, 'open'); ?> /> <?php _e('Allow <a href="http://codex.wordpress.org/Introduction_to_Blogging#Managing_Comments" target="_blank">trackbacks and pingbacks</a> on this post') ?></label>
    445 </p>
     442    <label for="ping_status" class="selectit"><input name="ping_status" type="checkbox" id="ping_status" value="open" <?php checked($post->ping_status, 'open'); ?> /> <?php _e('Allow <a href="http://codex.wordpress.org/Introduction_to_Blogging#Managing_Comments" target="_blank">trackbacks and pingbacks</a> on this post') ?></label></p>
    446443<?php
    447444}
     
    469466
    470467<table class="widefat comments-box fixed" cellspacing="0" style="display:none;">
    471 <thead>
    472     <tr>
     468<thead><tr>
    473469    <th scope="col" class="column-author"><?php _e('Author') ?></th>
    474470    <th scope="col" class="column-comment">
    475         <?php /* translators: field name in comment form */ echo _x('Comment', 'noun'); ?>
    476     </th>
    477   </tr>
    478 </thead>
    479 <tbody id="the-comment-list" class="list:comment">
    480 </tbody>
     471<?php /* translators: field name in comment form */ echo _x('Comment', 'noun'); ?></th>
     472</tr></thead>
     473<tbody id="the-comment-list" class="list:comment"></tbody>
    481474</table>
    482475<p class="hide-if-no-js"><a href="#commentstatusdiv" id="show-comments" onclick="commentsBox.get(<?php echo $total; ?>);return false;"><?php _e('Show comments'); ?></a> <img class="waiting" style="display:none;" src="images/wpspin.gif" alt="" /></p>
     
    581574<input type="hidden" id="original_post_status" name="original_post_status" value="<?php echo attr($post->post_status) ?>" />
    582575<input name="referredby" type="hidden" id="referredby" value="<?php echo clean_url(stripslashes(wp_get_referer())); ?>" />
    583 <?php if ( 'draft' != $post->post_status ) wp_original_referer_field(true, 'previous'); ?>
    584 
    585 <?php echo $form_extra ?>
     576<?php
     577if ( 'draft' != $post->post_status )
     578    wp_original_referer_field(true, 'previous');
     579
     580echo $form_extra ?>
    586581
    587582<div id="poststuff" class="metabox-holder<?php echo 2 == $screen_layout_columns ? ' has-right-sidebar' : ''; ?>">
    588 
    589583<div id="side-info-column" class="inner-sidebar">
    590584
     
    602596</div>
    603597<div class="inside">
    604 <?php $sample_permalink_html = get_sample_permalink_html($post->ID); ?>
    605 <?php if ( !( 'pending' == $post->post_status && !current_user_can( 'publish_posts' ) ) ) { ?>
     598<?php
     599$sample_permalink_html = get_sample_permalink_html($post->ID);
     600if ( !( 'pending' == $post->post_status && !current_user_can( 'publish_posts' ) ) ) { ?>
    606601    <div id="edit-slug-box">
    607 <?php if ( ! empty($post->ID) && ! empty($sample_permalink_html) ) :
    608     echo $sample_permalink_html;
     602<?php
     603    if ( ! empty($post->ID) && ! empty($sample_permalink_html) ) :
     604        echo $sample_permalink_html;
    609605endif; ?>
    610606    </div>
    611 <?php } ?>
     607<?php
     608} ?>
    612609</div>
    613610</div>
     
    631628        }
    632629        echo '</span>';
    633     }
    634 ?>
     630    } ?>
    635631    </td>
    636632</tr></tbody></table>
    637633
    638 
    639 <?php wp_nonce_field( 'autosave', 'autosavenonce', false ); ?>
    640 <?php wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false ); ?>
    641 <?php wp_nonce_field( 'getpermalink', 'getpermalinknonce', false ); ?>
    642 <?php wp_nonce_field( 'samplepermalink', 'samplepermalinknonce', false ); ?>
    643 <?php wp_nonce_field( 'meta-box-order', 'meta-box-order-nonce', false ); ?>
     634<?php
     635wp_nonce_field( 'autosave', 'autosavenonce', false );
     636wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false );
     637wp_nonce_field( 'getpermalink', 'getpermalinknonce', false );
     638wp_nonce_field( 'samplepermalink', 'samplepermalinknonce', false );
     639wp_nonce_field( 'meta-box-order', 'meta-box-order-nonce', false ); ?>
    644640</div>
    645641
     
    652648do_meta_boxes('post', 'advanced', $post);
    653649
    654 do_action('dbx_post_sidebar');
    655 
    656 ?>
     650do_action('dbx_post_sidebar'); ?>
    657651
    658652</div>
Note: See TracChangeset for help on using the changeset viewer.