Make WordPress Core

Changeset 11183


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

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

Location:
trunk/wp-admin
Files:
3 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>
  • trunk/wp-admin/edit-page-form.php

    r11180 r11183  
    9999
    100100<div class="misc-pub-section<?php if ( !$can_publish ) { echo ' misc-pub-section-last'; } ?>"><label for="post_status"><?php _e('Status:') ?></label>
    101 <b><span id="post-status-display">
     101<span id="post-status-display">
    102102<?php
    103103switch ( $post->post_status ) {
     
    119119}
    120120?>
    121 </span></b>
     121</span>
    122122<?php if ( 'publish' == $post->post_status || 'private' == $post->post_status || $can_publish ) { ?>
    123123<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>
     
    145145
    146146<div class="misc-pub-section " id="visibility">
    147 <?php _e('Visibility:'); ?> <b><span id="post-visibility-display"><?php
     147<?php _e('Visibility:'); ?> <span id="post-visibility-display"><?php
    148148
    149149if ( 'private' == $post->post_status ) {
     
    159159}
    160160
    161 ?><?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>
     161echo wp_specialchars( $visibility_trans ); ?></span>
     162<?php if ( $can_publish ) { ?>
     163<a href="#visibility" class="edit-visibility hide-if-no-js"><?php _e('Edit'); ?></a>
    162164
    163165<div id="post-visibility-select" class="hide-if-js">
    164166<input type="hidden" name="hidden_post_password" id="hidden-post-password" value="<?php echo attr($post->post_password); ?>" />
    165167<input type="hidden" name="hidden_post_visibility" id="hidden-post-visibility" value="<?php echo attr( $visibility ); ?>" />
    166 
    167168
    168169<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 />
     
    171172<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 />
    172173
    173 <p>
    174  <a href="#visibility" class="save-post-visibility hide-if-no-js button"><?php _e('OK'); ?></a>
    175  <a href="#visibility" class="cancel-post-visibility hide-if-no-js"><?php _e('Cancel'); ?></a>
    176 </p>
     174<p><a href="#visibility" class="save-post-visibility hide-if-no-js button"><?php _e('OK'); ?></a>
     175<a href="#visibility" class="cancel-post-visibility hide-if-no-js"><?php _e('Cancel'); ?></a></p>
    177176</div>
    178177<?php } ?>
     
    200199    $date = date_i18n( $datef, strtotime( current_time('mysql') ) );
    201200}
    202 ?>
    203 <?php if ( $can_publish ) : // Contributors don't get to choose the date of publish ?>
     201
     202if ( $can_publish ) : // Contributors don't get to choose the date of publish ?>
    204203<div class="misc-pub-section curtime misc-pub-section-last">
    205     <span id="timestamp">
    206     <?php printf($stamp, $date); ?></span>
     204    <span id="timestamp"><?php printf($stamp, $date); ?></span>
    207205    <a href="#edit_timestamp" class="edit-timestamp hide-if-no-js" tabindex='4'><?php _e('Edit') ?></a>
    208206    <div id="timestampdiv" class="hide-if-js"><?php touch_time(($action == 'edit'),1,4); ?></div>
    209 </div><?php // /misc-pub-section ?>
    210 <?php endif; ?>
     207</div><?php // /misc-pub-section
     208endif; ?>
    211209
    212210</div>
     
    226224<?php
    227225if ( !in_array( $post->post_status, array('publish', 'future', 'private') ) || 0 == $post->ID ) { ?>
    228 <?php if ( $can_publish ) : ?>
    229     <?php if ( !empty($post->post_date_gmt) && time() < strtotime( $post->post_date_gmt . ' +0000' ) ) : ?>
     226<?php
     227    if ( $can_publish ) :
     228        if ( !empty($post->post_date_gmt) && time() < strtotime( $post->post_date_gmt . ' +0000' ) ) : ?>
    230229        <input name="original_publish" type="hidden" id="original_publish" value="<?php _ea('Schedule') ?>" />
    231230        <input name="publish" type="submit" class="button-primary" id="publish" tabindex="5" accesskey="p" value="<?php _ea('Schedule') ?>" />
    232     <?php else : ?>
     231<?php   else : ?>
    233232        <input name="original_publish" type="hidden" id="original_publish" value="<?php _ea('Publish') ?>" />
    234233        <input name="publish" type="submit" class="button-primary" id="publish" tabindex="5" accesskey="p" value="<?php _ea('Publish') ?>" />
    235     <?php endif; ?>
    236 <?php else : ?>
     234<?php   endif;
     235    else : ?>
    237236    <input name="original_publish" type="hidden" id="original_publish" value="<?php _ea('Submit for Review') ?>" />
    238237    <input name="publish" type="submit" class="button-primary" id="publish" tabindex="5" accesskey="p" value="<?php _ea('Submit for Review') ?>" />
    239 <?php endif; ?>
    240 <?php } else { ?>
     238<?php
     239    endif;
     240} else { ?>
    241241    <input name="original_publish" type="hidden" id="original_publish" value="<?php _ea('Update Page') ?>" />
    242242    <input name="save" type="submit" class="button-primary" id="publish" tabindex="5" accesskey="p" value="<?php _ea('Update Page') ?>" />
    243 <?php } ?>
     243<?php
     244} ?>
    244245</div>
    245246<div class="clear"></div>
     
    281282<p><?php _e('You can arrange your pages in hierarchies, for example you could have an &#8220;About&#8221; page that has &#8220;Life Story&#8221; and &#8220;My Dog&#8221; pages under it. There are no limits to how deeply nested you can make pages.'); ?></p>
    282283<?php
    283     if ( 0 != count( get_page_templates() ) ) {
    284 ?>
     284    if ( 0 != count( get_page_templates() ) ) { ?>
    285285<h5><?php _e('Template') ?></h5>
    286286<label class="invisible" for="page_template"><?php _e('Page Template') ?></label><select name="page_template" id="page_template">
     
    290290<p><?php _e('Some themes have custom templates you can use for certain pages that might have additional features or custom layouts. If so, you&#8217;ll see them above.'); ?></p>
    291291<?php
    292     }
    293 ?>
     292    } ?>
    294293<h5><?php _e('Order') ?></h5>
    295294<p><label class="invisible" for="menu_order"><?php _e('Page Order') ?></label><input name="menu_order" type="text" size="4" id="menu_order" value="<?php echo attr($post->menu_order) ?>" /></p>
     
    310309<div id="postcustomstuff">
    311310<?php
    312 $metadata = has_meta($post->ID);
    313 list_meta($metadata);
    314 meta_form();
    315 ?>
    316 <div id="ajax-response"></div>
     311    $metadata = has_meta($post->ID);
     312    list_meta($metadata);
     313    meta_form(); ?>
     314    <div id="ajax-response"></div>
    317315</div>
    318316<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>
     
    429427
    430428<div id="side-info-column" class="inner-sidebar">
    431 
    432 <?php
    433 
     429<?php
    434430do_action('submitpage_box');
    435 $side_meta_boxes = do_meta_boxes('page', 'side', $post);
    436 
    437 ?>
     431$side_meta_boxes = do_meta_boxes('page', 'side', $post); ?>
    438432</div>
    439433
     
    476470</tr></tbody></table>
    477471
    478 <?php wp_nonce_field( 'autosave', 'autosavenonce', false ); ?>
    479 <?php wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false ); ?>
    480 <?php wp_nonce_field( 'getpermalink', 'getpermalinknonce', false ); ?>
    481 <?php wp_nonce_field( 'samplepermalink', 'samplepermalinknonce', false ); ?>
    482 <?php wp_nonce_field( 'meta-box-order', 'meta-box-order-nonce', false ); ?>
    483 </div>
    484 
    485 <?php
    486 
     472<?php
     473wp_nonce_field( 'autosave', 'autosavenonce', false );
     474wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false );
     475wp_nonce_field( 'getpermalink', 'getpermalinknonce', false );
     476wp_nonce_field( 'samplepermalink', 'samplepermalinknonce', false );
     477wp_nonce_field( 'meta-box-order', 'meta-box-order-nonce', false ); ?>
     478</div>
     479
     480<?php
    487481do_meta_boxes('page', 'normal', $post);
    488482do_action('edit_page_form');
    489483do_meta_boxes('page', 'advanced', $post);
    490 
    491484?>
    492485
  • trunk/wp-admin/wp-admin.css

    r11172 r11183  
    308308#sticky-span {
    309309    margin-left: 18px;
     310}
     311
     312#post-status-display,
     313#post-visibility-display {
     314    font-weight: bold;
    310315}
    311316
Note: See TracChangeset for help on using the changeset viewer.