Make WordPress Core

Ticket #9501: edit.page.form.code.cleanup.patch

File edit.page.form.code.cleanup.patch, 29.8 KB (added by simek, 16 years ago)
  • edit-page-form.php

     
    6767
    6868<?php // Hidden submit button early on so that the browser chooses the right button when form is submitted with Return key ?>
    6969<div style="display:none;">
    70 <input type="submit" name="save" value="<?php echo attribute_escape( __('Save') ); ?>" />
     70        <input type="submit" name="save" value="<?php echo attribute_escape( __('Save') ); ?>" />
    7171</div>
    7272
    7373<div id="minor-publishing-actions">
    7474<div id="save-action">
    75 <?php if ( 'publish' != $post->post_status && 'future' != $post->post_status && 'pending' != $post->post_status )  { ?>
    76 <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" />
    77 <?php } elseif ( 'pending' == $post->post_status && $can_publish ) { ?>
    78 <input type="submit" name="save" id="save-post" value="<?php echo attribute_escape( __('Save as Pending') ); ?>" tabindex="4" class="button button-highlighted" />
    79 <?php } ?>
     75        <?php if ( 'publish' != $post->post_status && 'future' != $post->post_status && 'pending' != $post->post_status )  { ?>
     76        <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" />
     77        <?php } elseif ( 'pending' == $post->post_status && $can_publish ) { ?>
     78        <input type="submit" name="save" id="save-post" value="<?php echo attribute_escape( __('Save as Pending') ); ?>" tabindex="4" class="button button-highlighted" />
     79        <?php } ?>
    8080</div>
    8181
    8282<div id="preview-action">
    83 <?php
    84 if ( 'publish' == $post->post_status ) {
    85         $preview_link = clean_url(get_permalink($post->ID));
    86         $preview_button = __('Preview Changes');
    87 } else {
    88         $preview_link = clean_url(apply_filters('preview_post_link', add_query_arg('preview', 'true', get_permalink($post->ID))));
    89         $preview_button = __('Preview');
    90 }
    91 ?>
    92 <a class="preview button" href="<?php echo $preview_link; ?>" target="wp-preview" id="post-preview" tabindex="4"><?php echo $preview_button; ?></a>
    93 <input type="hidden" name="wp-preview" id="wp-preview" value="" />
     83        <?php if ( 'publish' == $post->post_status ) {
     84                $preview_link = clean_url(get_permalink($post->ID));
     85                $preview_button = __('Preview Changes');
     86        } else {
     87                $preview_link = clean_url(apply_filters('preview_post_link', add_query_arg('preview', 'true', get_permalink($post->ID))));
     88                $preview_button = __('Preview');
     89        } ?>
     90        <a class="preview button" href="<?php echo $preview_link; ?>" target="wp-preview" id="post-preview" tabindex="4"><?php echo $preview_button; ?></a>
     91        <input type="hidden" name="wp-preview" id="wp-preview" value="" />
    9492</div>
    9593
    9694<div class="clear"></div>
     
    9896
    9997<div id="misc-publishing-actions">
    10098
    101 <div class="misc-pub-section<?php if ( !$can_publish ) { echo ' misc-pub-section-last'; } ?>"><label for="post_status"><?php _e('Status:') ?></label>
    102 <b><span id="post-status-display">
    103 <?php
    104 switch ( $post->post_status ) {
    105         case 'private':
    106                 _e('Privately Published');
    107                 break;
    108         case 'publish':
    109                 _e('Published');
    110                 break;
    111         case 'future':
    112                 _e('Scheduled');
    113                 break;
    114         case 'pending':
    115                 _e('Pending Review');
    116                 break;
    117         case 'draft':
    118                 _e('Draft');
    119                 break;
    120 }
    121 ?>
    122 </span></b>
    123 <?php if ( 'publish' == $post->post_status || 'private' == $post->post_status || $can_publish ) { ?>
    124 <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>
     99<div class="misc-pub-section<?php if ( !$can_publish ) { echo ' misc-pub-section-last'; } ?>">
     100        <label for="post_status"><?php _e('Status:') ?></label>
     101        <span id="post-status-display">
     102        <?php switch ( $post->post_status ) {
     103                case 'private':
     104                        _e('Privately Published');
     105                        break;
     106                case 'publish':
     107                        _e('Published');
     108                        break;
     109                case 'future':
     110                        _e('Scheduled');
     111                        break;
     112                case 'pending':
     113                        _e('Pending Review');
     114                        break;
     115                case 'draft':
     116                        _e('Draft');
     117                        break;
     118        } ?>
     119        </span>
     120        <?php if ( 'publish' == $post->post_status || 'private' == $post->post_status || $can_publish ) { ?>
     121        <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>
    125122
    126 <div id="post-status-select" class="hide-if-js">
    127 <input type="hidden" name="hidden_post_status" id="hidden_post_status" value="<?php echo $post->post_status; ?>" />
    128 <select name='post_status' id='post_status' tabindex='4'>
    129 <?php if ( 'publish' == $post->post_status ) : ?>
    130 <option<?php selected( $post->post_status, 'publish' ); ?> value='publish'><?php _e('Published') ?></option>
    131 <?php elseif ( 'private' == $post->post_status ) : ?>
    132 <option<?php selected( $post->post_status, 'private' ); ?> value='publish'><?php _e('Privately Published') ?></option>
    133 <?php elseif ( 'future' == $post->post_status ) : ?>
    134 <option<?php selected( $post->post_status, 'future' ); ?> value='future'><?php _e('Scheduled') ?></option>
    135 <?php endif; ?>
    136 <option<?php selected( $post->post_status, 'pending' ); ?> value='pending'><?php _e('Pending Review') ?></option>
    137 <option<?php selected( $post->post_status, 'draft' ); ?> value='draft'><?php _e('Draft') ?></option>
    138 </select>
     123        <div id="post-status-select" class="hide-if-js">
     124                <input type="hidden" name="hidden_post_status" id="hidden_post_status" value="<?php echo $post->post_status; ?>" />
     125               
     126                <select name='post_status' id='post_status' tabindex='4'>
     127                        <?php if ( 'publish' == $post->post_status ) : ?>
     128                        <option<?php selected( $post->post_status, 'publish' ); ?> value='publish'><?php _e('Published') ?></option>
     129                        <?php elseif ( 'private' == $post->post_status ) : ?>
     130                        <option<?php selected( $post->post_status, 'private' ); ?> value='publish'><?php _e('Privately Published') ?></option>
     131                        <?php elseif ( 'future' == $post->post_status ) : ?>
     132                        <option<?php selected( $post->post_status, 'future' ); ?> value='future'><?php _e('Scheduled') ?></option>
     133                        <?php endif; ?>
     134                        <option<?php selected( $post->post_status, 'pending' ); ?> value='pending'><?php _e('Pending Review') ?></option>
     135                        <option<?php selected( $post->post_status, 'draft' ); ?> value='draft'><?php _e('Draft') ?></option>
     136                </select>
    139137
    140  <a href="#post_status" class="save-post-status hide-if-no-js button"><?php _e('OK'); ?></a>
    141  <a href="#post_status" class="cancel-post-status hide-if-no-js"><?php _e('Cancel'); ?></a>
    142 </div>
     138                <a href="#post_status" class="save-post-status hide-if-no-js button"><?php _e('OK'); ?></a>
     139                <a href="#post_status" class="cancel-post-status hide-if-no-js"><?php _e('Cancel'); ?></a>
     140        </div>
    143141
    144142<?php } ?>
    145143</div><?php // /misc-pub-section ?>
    146144
    147145<div class="misc-pub-section " id="visibility">
    148 <?php _e('Visibility:'); ?> <b><span id="post-visibility-display"><?php
     146        <?php _e('Visibility:'); ?>
     147       
     148        <span id="post-visibility-display"><?php
     149       
     150        if ( 'private' == $post->post_status ) {
     151                $post->post_password = '';
     152                $visibility = 'private';
     153                $visibility_trans = __('Private');
     154        } elseif ( !empty( $post->post_password ) ) {
     155                $visibility = 'password';
     156                $visibility_trans = __('Password protected');
     157        } else {
     158                $visibility = 'public';
     159                $visibility_trans = __('Public');
     160        }
    149161
    150 if ( 'private' == $post->post_status ) {
    151         $post->post_password = '';
    152         $visibility = 'private';
    153         $visibility_trans = __('Private');
    154 } elseif ( !empty( $post->post_password ) ) {
    155         $visibility = 'password';
    156         $visibility_trans = __('Password protected');
    157 } else {
    158         $visibility = 'public';
    159         $visibility_trans = __('Public');
    160 }
     162        echo wp_specialchars( $visibility_trans ); ?>
     163        </span>
     164       
     165        <?php if ( $can_publish ) { ?>
     166        <a href="#visibility" class="edit-visibility hide-if-no-js"><?php _e('Edit'); ?></a>
    161167
    162 ?><?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>
     168        <div id="post-visibility-select" class="hide-if-js">
     169                <input type="hidden" name="hidden_post_password" id="hidden-post-password" value="<?php echo attribute_escape($post->post_password); ?>" />
     170                <input type="hidden" name="hidden_post_visibility" id="hidden-post-visibility" value="<?php echo attribute_escape( $visibility ); ?>" />
    163171
    164 <div id="post-visibility-select" class="hide-if-js">
    165 <input type="hidden" name="hidden_post_password" id="hidden-post-password" value="<?php echo attribute_escape($post->post_password); ?>" />
    166 <input type="hidden" name="hidden_post_visibility" id="hidden-post-visibility" value="<?php echo attribute_escape( $visibility ); ?>" />
     172                <input type="radio" name="visibility" id="visibility-radio-public" value="public" <?php checked( $visibility, 'public' ); ?> />
     173                <label for="visibility-radio-public" class="selectit"><?php _e('Public'); ?></label><br />
     174                <input type="radio" name="visibility" id="visibility-radio-password" value="password" <?php checked( $visibility, 'password' ); ?> />
     175                <label for="visibility-radio-password" class="selectit"><?php _e('Password protected'); ?></label><br />
     176                <span id="password-span"><label for="post_password"><?php _e('Password:'); ?></label>
     177                <input type="text" name="post_password" id="post_password" value="<?php echo attribute_escape($post->post_password); ?>" /></span><br />
     178                <input type="radio" name="visibility" id="visibility-radio-private" value="private" <?php checked( $visibility, 'private' ); ?> />
     179                <label for="visibility-radio-private" class="selectit"><?php _e('Private'); ?></label><br />
    167180
    168 
    169 <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 />
    170 <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 />
    171 <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>
    172 <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 />
    173 
    174 <p>
    175  <a href="#visibility" class="save-post-visibility hide-if-no-js button"><?php _e('OK'); ?></a>
    176  <a href="#visibility" class="cancel-post-visibility hide-if-no-js"><?php _e('Cancel'); ?></a>
    177 </p>
    178 </div>
     181                <p>
     182                <a href="#visibility" class="save-post-visibility hide-if-no-js button"><?php _e('OK'); ?></a>
     183                <a href="#visibility" class="cancel-post-visibility hide-if-no-js"><?php _e('Cancel'); ?></a>
     184                </p>
     185        </div>
    179186<?php } ?>
    180187
    181188</div><?php // /misc-pub-section ?>
     
    200207        $stamp = __('Publish <b>immediately</b>');
    201208        $date = date_i18n( $datef, strtotime( current_time('mysql') ) );
    202209}
    203 ?>
    204 <?php if ( $can_publish ) : // Contributors don't get to choose the date of publish ?>
     210
     211if ( $can_publish ) : // Contributors don't get to choose the date of publish ?>
    205212<div class="misc-pub-section curtime misc-pub-section-last">
    206213        <span id="timestamp">
    207214        <?php printf($stamp, $date); ?></span>
     
    215222</div>
    216223
    217224<div id="major-publishing-actions">
    218 <?php do_action('post_submitbox_start'); ?>
    219 <div id="delete-action">
    220 <?php
    221 if ( ( 'edit' == $action ) && current_user_can('delete_page', $post->ID) ) { ?>
    222 <a class="submitdelete deletion" href="<?php echo wp_nonce_url("page.php?action=delete&amp;post=$post->ID", 'delete-page_' . $post->ID); ?>" onclick="if ( confirm('<?php echo 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;"><?php _e('Delete'); ?></a>
    223 <?php } ?>
     225        <?php do_action('post_submitbox_start'); ?>
     226        <div id="delete-action">
     227                <?php if ( ( 'edit' == $action ) && current_user_can('delete_page', $post->ID) ) { ?>
     228                <a class="submitdelete deletion" href="<?php echo wp_nonce_url("page.php?action=delete&amp;post=$post->ID", 'delete-page_' . $post->ID); ?>" onclick="if ( confirm('<?php echo 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;"><?php _e('Delete'); ?></a>
     229        <?php } ?>
     230        </div>
     231
     232        <div id="publishing-action">
     233                <?php if ( !in_array( $post->post_status, array('publish', 'future', 'private') ) || 0 == $post->ID ) { ?>
     234                        <?php if ( $can_publish ) : ?>
     235                                <?php if ( !empty($post->post_date_gmt) && time() < strtotime( $post->post_date_gmt . ' +0000' ) ) : ?>
     236                                        <input name="original_publish" type="hidden" id="original_publish" value="<?php _e('Schedule') ?>" />
     237                                        <input name="publish" type="submit" class="button-primary" id="publish" tabindex="5" accesskey="p" value="<?php _e('Schedule') ?>" />
     238                                <?php else : ?>
     239                                        <input name="original_publish" type="hidden" id="original_publish" value="<?php _e('Publish') ?>" />
     240                                        <input name="publish" type="submit" class="button-primary" id="publish" tabindex="5" accesskey="p" value="<?php _e('Publish') ?>" />
     241                                <?php endif; ?>
     242                        <?php else : ?>
     243                                <input name="original_publish" type="hidden" id="original_publish" value="<?php _e('Submit for Review') ?>" />
     244                                <input name="publish" type="submit" class="button-primary" id="publish" tabindex="5" accesskey="p" value="<?php _e('Submit for Review') ?>" />
     245                        <?php endif; ?>
     246                <?php } else { ?>
     247                        <input name="original_publish" type="hidden" id="original_publish" value="<?php _e('Update Page') ?>" />
     248                        <input name="save" type="submit" class="button-primary" id="publish" tabindex="5" accesskey="p" value="<?php _e('Update Page') ?>" />
     249        <?php } ?>
    224250</div>
    225251
    226 <div id="publishing-action">
    227 <?php
    228 if ( !in_array( $post->post_status, array('publish', 'future', 'private') ) || 0 == $post->ID ) { ?>
    229 <?php if ( $can_publish ) : ?>
    230         <?php if ( !empty($post->post_date_gmt) && time() < strtotime( $post->post_date_gmt . ' +0000' ) ) : ?>
    231                 <input name="original_publish" type="hidden" id="original_publish" value="<?php _e('Schedule') ?>" />
    232                 <input name="publish" type="submit" class="button-primary" id="publish" tabindex="5" accesskey="p" value="<?php _e('Schedule') ?>" />
    233         <?php else : ?>
    234                 <input name="original_publish" type="hidden" id="original_publish" value="<?php _e('Publish') ?>" />
    235                 <input name="publish" type="submit" class="button-primary" id="publish" tabindex="5" accesskey="p" value="<?php _e('Publish') ?>" />
    236         <?php endif; ?>
    237 <?php else : ?>
    238         <input name="original_publish" type="hidden" id="original_publish" value="<?php _e('Submit for Review') ?>" />
    239         <input name="publish" type="submit" class="button-primary" id="publish" tabindex="5" accesskey="p" value="<?php _e('Submit for Review') ?>" />
    240 <?php endif; ?>
    241 <?php } else { ?>
    242         <input name="original_publish" type="hidden" id="original_publish" value="<?php _e('Update Page') ?>" />
    243         <input name="save" type="submit" class="button-primary" id="publish" tabindex="5" accesskey="p" value="<?php _e('Update Page') ?>" />
    244 <?php } ?>
    245 </div>
    246252<div class="clear"></div>
     253
    247254</div>
    248255</div>
    249256<?php
     
    259266 */
    260267function page_password_meta_box($post){
    261268?>
    262 <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 page private') ?></label></p>
     269<p>
     270        <label for="post_status_private" class="selectit">
     271        <input id="post_status_private" name="post_status" type="checkbox" value="private" <?php checked($post->post_status, 'private'); ?> tabindex='4' /> <?php _e('Keep this page private') ?></label>
     272</p>
    263273<h4><?php _e( 'Page Password' ); ?></h4>
    264 <p><label class="hidden" for="post_password"><?php _e('Password Protect This Page') ?></label><input name="post_password" type="text" size="25" id="post_password" value="<?php the_post_password(); ?>" /></p>
     274<p>
     275        <label class="hidden" for="post_password"><?php _e('Password Protect This Page') ?></label>
     276        <input name="post_password" type="text" size="25" id="post_password" value="<?php the_post_password(); ?>" />
     277</p>
    265278<p><?php _e('Setting a password will require people who visit your blog to enter the above password to view this page and its comments.'); ?></p>
    266279<?php
    267280}
     
    280293<label class="hidden" for="parent_id"><?php _e('Page Parent') ?></label>
    281294<?php wp_dropdown_pages(array('exclude_tree' => $post->ID, 'selected' => $post->post_parent, 'name' => 'parent_id', 'show_option_none' => __('Main Page (no parent)'), 'sort_column'=> 'menu_order, post_title')); ?>
    282295<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>
    283 <?php
    284         if ( 0 != count( get_page_templates() ) ) {
    285 ?>
    286 <h5><?php _e('Template') ?></h5>
    287 <label class="hidden" for="page_template"><?php _e('Page Template') ?></label><select name="page_template" id="page_template">
    288 <option value='default'><?php _e('Default Template'); ?></option>
    289 <?php page_template_dropdown($post->page_template); ?>
    290 </select>
    291 <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>
    292 <?php
    293         }
    294 ?>
     296
     297<?php if ( 0 != count( get_page_templates() ) ) { ?>
     298        <h5><?php _e('Template') ?></h5>
     299        <label class="hidden" for="page_template"><?php _e('Page Template') ?></label>
     300        <select name="page_template" id="page_template">
     301                <option value='default'><?php _e('Default Template'); ?></option>
     302                <?php page_template_dropdown($post->page_template); ?>
     303        </select>
     304        <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>
     305<?php } ?>
     306
    295307<h5><?php _e('Order') ?></h5>
    296 <p><label class="hidden" for="menu_order"><?php _e('Page Order') ?></label><input name="menu_order" type="text" size="4" id="menu_order" value="<?php echo $post->menu_order ?>" /></p>
     308<p>
     309        <label class="hidden" for="menu_order"><?php _e('Page Order') ?></label>
     310        <input name="menu_order" type="text" size="4" id="menu_order" value="<?php echo $post->menu_order ?>" />
     311</p>
    297312<p><?php _e('Pages are usually ordered alphabetically, but you can put a number above to change the order pages appear in. (We know this is a little janky, it&#8217;ll be better in future releases.)'); ?></p>
    298313<?php
    299314}
     
    309324function page_custom_meta_box($post){
    310325?>
    311326<div id="postcustomstuff">
    312 <?php
    313 $metadata = has_meta($post->ID);
    314 list_meta($metadata);
    315 meta_form();
    316 ?>
    317 <div id="ajax-response"></div>
     327        <?php
     328        $metadata = has_meta($post->ID);
     329        list_meta($metadata);
     330        meta_form();
     331        ?>
     332        <div id="ajax-response"></div>
    318333</div>
    319334<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>
    320335<?php
     
    331346function page_comments_status_meta_box($post){
    332347?>
    333348<input name="advanced_view" type="hidden" value="1" />
    334 <p><label for="comment_status" class="selectit">
    335 <input name="comment_status" type="checkbox" id="comment_status" value="open" <?php checked($post->comment_status, 'open'); ?> />
    336 <?php _e('Allow Comments') ?></label></p>
    337 <p><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 Pings') ?></label></p>
     349<p>
     350        <label for="comment_status" class="selectit">
     351                <input name="comment_status" type="checkbox" id="comment_status" value="open" <?php checked($post->comment_status, 'open'); ?> />
     352                <?php _e('Allow Comments') ?>
     353        </label>
     354</p>
     355<p>
     356        <label for="ping_status" class="selectit">
     357        <input name="ping_status" type="checkbox" id="ping_status" value="open" <?php checked($post->ping_status, 'open'); ?> /> <?php _e('Allow Pings') ?></label>
     358</p>
    338359<p><?php _e('These settings apply to this page only. &#8220;Pings&#8221; are <a href="http://codex.wordpress.org/Introduction_to_Blogging#Managing_Comments" target="_blank">trackbacks and pingbacks</a>.'); ?></p>
    339360<?php
    340361}
     
    349370 */
    350371function page_slug_meta_box($post){
    351372?>
    352 <label class="hidden" for="post_name"><?php _e('Page Slug') ?></label><input name="post_name" type="text" size="13" id="post_name" value="<?php echo attribute_escape( $post->post_name ); ?>" />
     373<label class="hidden" for="post_name"><?php _e('Page Slug') ?></label>
     374<input name="post_name" type="text" size="13" id="post_name" value="<?php echo attribute_escape( $post->post_name ); ?>" />
    353375<?php
    354376}
    355377add_meta_box('pageslugdiv', __('Page Slug'), 'page_slug_meta_box', 'page', 'normal', 'core');
     
    370392                $authors = get_editable_user_ids( $current_user->id, true, 'page' ); // TODO: ROLE SYSTEM
    371393                if ( $post->post_author && !in_array($post->post_author, $authors) )
    372394                        $authors[] = $post->post_author;
    373 ?>
    374 <label class="hidden" for="post_author_override"><?php _e('Page Author'); ?></label><?php wp_dropdown_users( array('include' => $authors, 'name' => 'post_author_override', 'selected' => empty($post->ID) ? $user_ID : $post->post_author) ); ?>
    375 <?php
     395                ?>
     396                <label class="hidden" for="post_author_override"><?php _e('Page Author'); ?></label>
     397                <?php wp_dropdown_users( array('include' => $authors, 'name' => 'post_author_override', 'selected' => empty($post->ID) ? $user_ID : $post->post_author) ); ?>
     398                <?php
    376399        }
    377400        add_meta_box('pageauthordiv', __('Page Author'), 'page_author_meta_box', 'page', 'normal', 'core');
    378401}
     
    399422?>
    400423
    401424<div class="wrap">
    402 <?php screen_icon(); ?>
    403 <h2><?php echo wp_specialchars( $title ); ?></h2>
     425        <?php screen_icon(); ?>
     426        <h2><?php echo wp_specialchars( $title ); ?></h2>
    404427
    405 <form name="post" action="page.php" method="post" id="post">
    406 <?php if ( $notice ) : ?>
    407 <div id="notice" class="error"><p><?php echo $notice ?></p></div>
    408 <?php endif; ?>
    409 <?php if (isset($_GET['message'])) : ?>
    410 <div id="message" class="updated fade"><p><?php echo $messages[$_GET['message']]; ?></p></div>
    411 <?php endif; ?>
     428        <form name="post" action="page.php" method="post" id="post">
     429        <?php if ( $notice ) : ?>
     430                <div id="notice" class="error"><p><?php echo $notice ?></p></div>
     431        <?php endif; ?>
    412432
    413 <?php
    414 wp_nonce_field($nonce_action);
     433        <?php if (isset($_GET['message'])) : ?>
     434                <div id="message" class="updated fade"><p><?php echo $messages[$_GET['message']]; ?></p></div>
     435        <?php endif; ?>
    415436
    416 if (isset($mode) && 'bookmarklet' == $mode)
    417         echo '<input type="hidden" name="mode" value="bookmarklet" />';
    418 ?>
    419 <input type="hidden" id="user-id" name="user_ID" value="<?php echo $user_ID ?>" />
    420 <input type="hidden" id="hiddenaction" name="action" value='<?php echo $form_action ?>' />
    421 <input type="hidden" id="originalaction" name="originalaction" value="<?php echo $form_action ?>" />
    422 <input type="hidden" id="post_author" name="post_author" value="<?php echo attribute_escape( $post->post_author ); ?>" />
    423 <?php echo $form_extra ?>
    424 <input type="hidden" id="post_type" name="post_type" value="<?php echo $post->post_type ?>" />
    425 <input type="hidden" id="original_post_status" name="original_post_status" value="<?php echo $post->post_status ?>" />
    426 <input name="referredby" type="hidden" id="referredby" value="<?php echo clean_url(stripslashes(wp_get_referer())); ?>" />
    427 <?php if ( 'draft' != $post->post_status ) wp_original_referer_field(true, 'previous'); ?>
     437        <?php wp_nonce_field($nonce_action);
    428438
    429 <div id="poststuff" class="metabox-holder<?php echo 2 == $screen_layout_columns ? ' has-right-sidebar' : ''; ?>">
     439        if (isset($mode) && 'bookmarklet' == $mode)
     440                echo '<input type="hidden" name="mode" value="bookmarklet" />';
     441        ?>
    430442
    431 <div id="side-info-column" class="inner-sidebar">
     443        <input type="hidden" id="user-id" name="user_ID" value="<?php echo $user_ID ?>" />
     444        <input type="hidden" id="hiddenaction" name="action" value='<?php echo $form_action ?>' />
     445        <input type="hidden" id="originalaction" name="originalaction" value="<?php echo $form_action ?>" />
     446        <input type="hidden" id="post_author" name="post_author" value="<?php echo attribute_escape( $post->post_author ); ?>" />
     447        <?php echo $form_extra ?>
     448        <input type="hidden" id="post_type" name="post_type" value="<?php echo $post->post_type ?>" />
     449        <input type="hidden" id="original_post_status" name="original_post_status" value="<?php echo $post->post_status ?>" />
     450        <input name="referredby" type="hidden" id="referredby" value="<?php echo clean_url(stripslashes(wp_get_referer())); ?>" />
     451        <?php if ( 'draft' != $post->post_status ) wp_original_referer_field(true, 'previous'); ?>
    432452
    433 <?php
     453        <div id="poststuff" class="metabox-holder<?php echo 2 == $screen_layout_columns ? ' has-right-sidebar' : ''; ?>">
    434454
    435 do_action('submitpage_box');
    436 $side_meta_boxes = do_meta_boxes('page', 'side', $post);
     455                <div id="side-info-column" class="inner-sidebar">
     456                        <?php
     457                        do_action('submitpage_box');
     458                        $side_meta_boxes = do_meta_boxes('page', 'side', $post);
     459                        ?>
     460                </div>
    437461
    438 ?>
    439 </div>
    440 
    441 <div id="post-body">
    442 <div id="post-body-content">
    443 <div id="titlediv">
    444 <div id="titlewrap">
    445   <input type="text" name="post_title" size="30" tabindex="1" value="<?php echo attribute_escape( htmlspecialchars( $post->post_title ) ); ?>" id="title" autocomplete="off" />
    446 </div>
    447 <div class="inside">
    448 <?php $sample_permalink_html = get_sample_permalink_html($post->ID); ?>
    449         <div id="edit-slug-box">
    450 <?php if ( ! empty($post->ID) && ! empty($sample_permalink_html) ) :
    451         echo $sample_permalink_html;
    452 endif; ?>
     462        <div id="post-body">
     463        <div id="post-body-content">
     464       
     465        <div id="titlediv">
     466                <div id="titlewrap">
     467                        <input type="text" name="post_title" size="30" tabindex="1" value="<?php echo attribute_escape( htmlspecialchars( $post->post_title ) ); ?>" id="title" autocomplete="off" />
     468                </div>
     469       
     470                <div class="inside">
     471                        <?php $sample_permalink_html = get_sample_permalink_html($post->ID); ?>
     472                        <div id="edit-slug-box">
     473                                <?php if ( ! empty($post->ID) && ! empty($sample_permalink_html) ) :
     474                                        echo $sample_permalink_html;
     475                                endif; ?>
     476                        </div>
     477                </div>
    453478        </div>
    454 </div>
    455 </div>
    456479
    457 <div id="<?php echo user_can_richedit() ? 'postdivrich' : 'postdiv'; ?>" class="postarea">
     480        <div id="<?php echo user_can_richedit() ? 'postdivrich' : 'postdiv'; ?>" class="postarea">
    458481
    459 <?php the_editor($post->post_content); ?>
    460 <table id="post-status-info"><tbody><tr>
    461         <td id="wp-word-count"></td>
    462         <td class="autosave-info">
    463         <span id="autosave">&nbsp;</span>
     482        <?php the_editor($post->post_content); ?>
     483        <table id="post-status-info"><tbody><tr>
     484                <td id="wp-word-count"></td>
     485                <td class="autosave-info">
     486                        <span id="autosave">&nbsp;</span>
    464487
    465 <?php
    466         if ($post_ID) {
    467                 if ( $last_id = get_post_meta($post_ID, '_edit_last', true) ) {
    468                         $last_user = get_userdata($last_id);
    469                         printf(__('Last edited by %1$s on %2$s at %3$s'), wp_specialchars( $last_user->display_name ), mysql2date(get_option('date_format'), $post->post_modified), mysql2date(get_option('time_format'), $post->post_modified));
    470                 } else {
    471                         printf(__('Last edited on %1$s at %2$s'), mysql2date(get_option('date_format'), $post->post_modified), mysql2date(get_option('time_format'), $post->post_modified));
    472                 }
    473         }
    474 ?>
    475         </td>
    476 </tr></tbody></table>
     488                        <?php
     489                                if ($post_ID) {
     490                                        if ( $last_id = get_post_meta($post_ID, '_edit_last', true) ) {
     491                                                $last_user = get_userdata($last_id);
     492                                                printf(__('Last edited by %1$s on %2$s at %3$s'), wp_specialchars( $last_user->display_name ), mysql2date(get_option('date_format'), $post->post_modified), mysql2date(get_option('time_format'), $post->post_modified));
     493                                        } else {
     494                                                printf(__('Last edited on %1$s at %2$s'), mysql2date(get_option('date_format'), $post->post_modified), mysql2date(get_option('time_format'), $post->post_modified));
     495                                        }
     496                                }
     497                        ?>
     498                </td>
     499        </tr></tbody></table>
    477500
    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>
     501        <?php wp_nonce_field( 'autosave', 'autosavenonce', false ); ?>
     502        <?php wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false ); ?>
     503        <?php wp_nonce_field( 'getpermalink', 'getpermalinknonce', false ); ?>
     504        <?php wp_nonce_field( 'samplepermalink', 'samplepermalinknonce', false ); ?>
     505        <?php wp_nonce_field( 'meta-box-order', 'meta-box-order-nonce', false ); ?>
     506        </div>
    484507
    485 <?php
     508        <?php
     509        do_meta_boxes('page', 'normal', $post);
     510        do_action('edit_page_form');
     511        do_meta_boxes('page', 'advanced', $post);
     512        ?>
    486513
    487 do_meta_boxes('page', 'normal', $post);
    488 do_action('edit_page_form');
    489 do_meta_boxes('page', 'advanced', $post);
     514        </div>
     515        </div>
     516        </div>
    490517
    491 ?>
    492 
     518        </form>
    493519</div>
    494 </div>
    495 </div>
    496520
    497 </form>
    498 </div>
    499 
    500521<script type="text/javascript">
    501522try{document.post.title.focus();}catch(e){}
    502523</script>
  • wp-admin.css

     
    281281        margin-left: 18px;
    282282}
    283283
     284#post-status-display ,
     285#post-visibility-display {
     286        font-weight: bold;
     287}
     288
    284289.side-info {
    285290        margin: 0;
    286291        padding: 4px;