Changeset 8691 for trunk/wp-admin/edit-page-form.php
- Timestamp:
- 08/20/2008 09:42:31 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/edit-page-form.php
r8656 r8691 45 45 $temp_ID = (int) $temp_ID; 46 46 $user_ID = (int) $user_ID; 47 48 ?> 47 ?> 48 49 <form name="post" action="page.php" method="post" id="post"> 50 <div id="wpbody-content"> 49 51 50 52 <?php if ( $notice ) : ?> … … 55 57 <?php endif; ?> 56 58 57 <form name="post" action="page.php" method="post" id="post"> 58 <div class="wrap"> 59 <h2><?php _e('Write Page') ?></h2> 60 61 <?php 62 wp_nonce_field($nonce_action); 63 64 if (isset($mode) && 'bookmarklet' == $mode) 65 echo '<input type="hidden" name="mode" value="bookmarklet" />'; 66 ?> 67 <input type="hidden" id="user-id" name="user_ID" value="<?php echo $user_ID ?>" /> 68 <input type="hidden" id="hiddenaction" name="action" value='<?php echo $form_action ?>' /> 69 <input type="hidden" id="originalaction" name="originalaction" value="<?php echo $form_action ?>" /> 70 <input type="hidden" id="post_author" name="post_author" value="<?php echo attribute_escape( $post->post_author ); ?>" /> 71 <?php echo $form_extra ?> 72 <input type="hidden" id="post_type" name="post_type" value="<?php echo $post->post_type ?>" /> 73 <input type="hidden" id="original_post_status" name="original_post_status" value="<?php echo $post->post_status ?>" /> 74 <input name="referredby" type="hidden" id="referredby" value="<?php echo clean_url(stripslashes(wp_get_referer())); ?>" /> 75 <?php if ( 'draft' != $post->post_status ) wp_original_referer_field(true, 'previous'); ?> 76 77 <div id="poststuff"> 78 59 <?php 60 function page_submit_meta_box($post) { 61 global $action; 62 ?> 79 63 <div class="submitbox" id="submitpage"> 80 64 81 <div id="previewview"> 82 <?php if ( 'publish' == $post->post_status ) { ?> 83 <a href="<?php echo clean_url(get_permalink($post->ID)); ?>" target="_blank" tabindex="4"><?php _e('View this Page'); ?></a> 84 <?php } elseif ( 'edit' == $action ) { ?> 85 <a 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> 86 <?php } ?> 87 </div> 88 89 <div class="inside"> 65 <div class="inside-submitbox"> 90 66 <p><strong><label for='post_status'><?php _e('Publish Status') ?></label></strong></p> 91 67 <p> … … 109 85 110 86 <?php 111 if ( 0 != $post _ID ) {87 if ( 0 != $post->ID ) { 112 88 if ( 'future' == $post->post_status ) { // scheduled for publishing at a future date 113 89 $stamp = __('Scheduled for:<br />%1$s at %2$s'); … … 138 114 <input type="submit" name="save" class="button button-highlighted" value="<?php _e('Save'); ?>" tabindex="4" /> 139 115 <?php 140 if ( !in_array( $post->post_status, array('publish', 'future') ) || 0 == $post _ID ) {116 if ( !in_array( $post->post_status, array('publish', 'future') ) || 0 == $post->ID ) { 141 117 ?> 142 118 <?php if ( current_user_can('publish_pages') ) : ?> … … 148 124 } 149 125 150 if ( ('edit' == $action) && current_user_can('delete_page', $post _ID) )151 echo "<a class='submitdelete' href='" . wp_nonce_url("page.php?action=delete&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 page') . "</a>";126 if ( ('edit' == $action) && current_user_can('delete_page', $post->ID) ) 127 echo "<a class='submitdelete' href='" . wp_nonce_url("page.php?action=delete&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 page') . "</a>"; 152 128 ?> 153 129 <br class="clear" /> 154 <?php if ( 0 != $post_ID ) : ?> 155 <?php if ( $last_id = get_post_meta($post_ID, '_edit_last', true) ) { 130 131 <!-- moved under the editor 132 <?php if ( 0 != $post->ID ) : ?> 133 <?php if ( $last_id = get_post_meta($post->ID, '_edit_last', true) ) { 156 134 $last_user = get_userdata($last_id); 157 135 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)); … … 162 140 <br class="clear" /> 163 141 <?php endif; ?> 164 <span id="autosave"></span>165 <span id="wp-word-count"></span> 142 --> 143 166 144 </p> 167 168 <div class="side-info"> 169 <h5><?php _e('Related') ?></h5> 170 171 <ul> 172 <?php if ( 0 != $post_ID ) : ?> 173 <li><a href="edit-pages.php?page_id=<?php echo $post_ID ?>"><?php _e('See Comments on this Page') ?></a></li> 174 <?php endif; ?> 175 <li><a href="edit-comments.php"><?php _e('Manage All Comments') ?></a></li> 176 <li><a href="edit-pages.php"><?php _e('Manage All Pages') ?></a></li> 177 <?php do_action('page_relatedlinks_list'); ?> 178 </ul> 179 </div> 180 <?php do_action('submitpage_box'); ?> 181 </div> 182 183 <div id="post-body"> 184 <div id="titlediv"> 185 <h3><label for="title"><?php _e('Title') ?></label></h3> 186 <div id="titlewrap"> 187 <input type="text" name="post_title" size="30" tabindex="1" value="<?php echo attribute_escape( $post->post_title ); ?>" id="title" autocomplete="off" /> 188 </div> 189 <div class="inside"> 190 <?php $sample_permalink_html = get_sample_permalink_html($post->ID); ?> 191 <div id="edit-slug-box"> 192 <?php if ( ! empty($post->ID) && ! empty($sample_permalink_html) ) : 193 echo $sample_permalink_html; 194 endif; ?> 195 </div> 196 </div> 197 </div> 198 199 <div id="<?php echo user_can_richedit() ? 'postdivrich' : 'postdiv'; ?>" class="postarea"> 200 <h3><label for="content"><?php _e('Page') ?></label></h3> 201 <?php the_editor($post->post_content); ?> 202 <?php wp_nonce_field( 'autosave', 'autosavenonce', false ); ?> 203 <?php wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false ); ?> 204 <?php wp_nonce_field( 'getpermalink', 'getpermalinknonce', false ); ?> 205 <?php wp_nonce_field( 'samplepermalink', 'samplepermalinknonce', false ); ?> 206 </div> 207 208 <?php do_meta_boxes('page', 'normal', $post); ?> 209 210 <?php do_action('edit_page_form'); ?> 211 212 <h2><?php _e('Advanced Options'); ?></h2> 213 214 215 <?php 145 </div> 146 <?php 147 } 148 add_meta_box('pagesubmitdiv', __('Publish'), 'page_submit_meta_box', 'page', 'side', 'core'); 149 216 150 function page_custom_meta_box($post){ 217 151 ?> … … 232 166 <?php 233 167 } 234 add_meta_box('pagecustomdiv', __('Custom Fields'), 'page_custom_meta_box', 'page', ' advanced', 'core');168 add_meta_box('pagecustomdiv', __('Custom Fields'), 'page_custom_meta_box', 'page', 'normal', 'core'); 235 169 236 170 function page_comments_status_meta_box($post){ … … 244 178 <?php 245 179 } 246 add_meta_box('pagecommentstatusdiv', __('Comments & Pings'), 'page_comments_status_meta_box', 'page', ' advanced', 'core');180 add_meta_box('pagecommentstatusdiv', __('Comments & Pings'), 'page_comments_status_meta_box', 'page', 'normal', 'core'); 247 181 248 182 function page_password_meta_box($post){ … … 252 186 <?php 253 187 } 254 add_meta_box('pagepassworddiv', __('Password Protect This Page'), 'page_password_meta_box', 'page', ' advanced', 'core');188 add_meta_box('pagepassworddiv', __('Password Protect This Page'), 'page_password_meta_box', 'page', 'normal', 'core'); 255 189 256 190 function page_slug_meta_box($post){ … … 259 193 <?php 260 194 } 261 add_meta_box('pageslugdiv', __('Page Slug'), 'page_slug_meta_box', 'page', ' advanced', 'core');195 add_meta_box('pageslugdiv', __('Page Slug'), 'page_slug_meta_box', 'page', 'normal', 'core'); 262 196 263 197 function page_parent_meta_box($post){ … … 271 205 <?php 272 206 } 273 add_meta_box('pageparentdiv', __('Page Parent'), 'page_parent_meta_box', 'page', ' advanced', 'core');207 add_meta_box('pageparentdiv', __('Page Parent'), 'page_parent_meta_box', 'page', 'normal', 'core'); 274 208 275 209 if ( 0 != count( get_page_templates() ) ) { … … 283 217 <?php 284 218 } 285 add_meta_box('pagetemplatediv', __('Page Template'), 'page_template_meta_box', 'page', ' advanced', 'core');219 add_meta_box('pagetemplatediv', __('Page Template'), 'page_template_meta_box', 'page', 'normal', 'core'); 286 220 } 287 221 … … 292 226 <?php 293 227 } 294 add_meta_box('pageorderdiv', __('Page Order'), 'page_order_meta_box', 'page', ' advanced', 'core');228 add_meta_box('pageorderdiv', __('Page Order'), 'page_order_meta_box', 'page', 'normal', 'core'); 295 229 296 230 … … 308 242 <?php 309 243 } 310 add_meta_box('pageauthordiv', __('Page Author'), 'page_author_meta_box', 'page', ' advanced', 'core');244 add_meta_box('pageauthordiv', __('Page Author'), 'page_author_meta_box', 'page', 'normal', 'core'); 311 245 } 312 246 … … 316 250 wp_list_post_revisions(); 317 251 } 318 add_meta_box('revisionsdiv', __('Page Revisions'), 'page_revisions_meta_box', 'page', ' advanced', 'core');252 add_meta_box('revisionsdiv', __('Page Revisions'), 'page_revisions_meta_box', 'page', 'normal', 'core'); 319 253 endif; 320 254 ?> 255 256 <div class="wrap"> 257 <h2><?php 258 if ( !isset($post_ID) || 0 == $post_ID ) 259 printf( __( '<a href="%s">Pages</a> / Write New Page' ), 'edit-pages.php' ); 260 else 261 printf( __( '<a href="%s">Pages</a> / Edit Page' ), 'edit-pages.php' ); 262 ?></h2> 263 264 <div id="previewview"> 265 <?php if ( 'publish' == $post->post_status ) { ?> 266 <a class="button" href="<?php echo clean_url(get_permalink($post->ID)); ?>" target="_blank" tabindex="4"><?php _e('View this Page'); ?></a> 267 <?php } elseif ( 'edit' == $action ) { ?> 268 <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> 269 <?php } ?> 270 </div> 271 272 <?php 273 wp_nonce_field($nonce_action); 274 275 if (isset($mode) && 'bookmarklet' == $mode) 276 echo '<input type="hidden" name="mode" value="bookmarklet" />'; 277 ?> 278 <input type="hidden" id="user-id" name="user_ID" value="<?php echo $user_ID ?>" /> 279 <input type="hidden" id="hiddenaction" name="action" value='<?php echo $form_action ?>' /> 280 <input type="hidden" id="originalaction" name="originalaction" value="<?php echo $form_action ?>" /> 281 <input type="hidden" id="post_author" name="post_author" value="<?php echo attribute_escape( $post->post_author ); ?>" /> 282 <?php echo $form_extra ?> 283 <input type="hidden" id="post_type" name="post_type" value="<?php echo $post->post_type ?>" /> 284 <input type="hidden" id="original_post_status" name="original_post_status" value="<?php echo $post->post_status ?>" /> 285 <input name="referredby" type="hidden" id="referredby" value="<?php echo clean_url(stripslashes(wp_get_referer())); ?>" /> 286 <?php if ( 'draft' != $post->post_status ) wp_original_referer_field(true, 'previous'); ?> 287 288 <!-- TODO 289 <div class="inside"> 290 <p><strong><label for='post_status'><?php _e('Publish Status') ?></label></strong></p> 291 <p> 292 <select name='post_status' tabindex='4' id='post_status'> 293 <?php // Show publish in dropdown if user can publish or if they can re-publish this page ('edit_published_pages') 294 // 'publish' option will be selected for published AND private posts (checkbox overrides dropdown) 295 if ( current_user_can('publish_pages') OR ( $post->post_status == 'publish' AND current_user_can('edit_page', $post->ID) ) ) : 296 ?> 297 <option<?php selected( $post->post_status, 'publish' ); selected( $post->post_status, 'private' );?> value='publish'><?php _e('Published') ?></option> 298 <?php endif; ?> 299 <?php if ( 'future' == $post->post_status ) : ?> 300 <option<?php selected( $post->post_status, 'future' ); ?> value='future'><?php _e('Pending') ?></option> 301 <?php endif; ?> 302 <option<?php selected( $post->post_status, 'pending' ); ?> value='pending'><?php _e('Pending Review') ?></option> 303 <option<?php selected( $post->post_status, 'draft' ); ?> value='draft'><?php _e('Unpublished') ?></option> 304 </select> 305 </p> 306 <?php if ( current_user_can( 'publish_posts' ) ) : ?> 307 <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> 308 <?php endif; ?> 309 310 <h5><?php _e('Related') ?></h5> 311 <ul> 312 <?php if ($post_ID): ?> 313 <li><a href="edit-pages.php?page_id=<?php echo $post_ID ?>"><?php _e('See Comments on this Page') ?></a></li> 314 <?php endif; ?> 315 <li><a href="edit-comments.php"><?php _e('Manage All Comments') ?></a></li> 316 <li><a href="edit-pages.php"><?php _e('Manage All Pages') ?></a></li> 317 <?php do_action('page_relatedlinks_list'); ?> 318 </ul> 319 320 --> 321 322 <div id="poststuff"> 323 324 <div id="side-info-column" class="inner-sidebar"> 325 326 <?php 327 328 do_action('submitpage_box'); 329 $side_meta_boxes = do_meta_boxes('page', 'side', $page); 330 331 ?> 332 </div> 333 334 <div id="post-body" class="<?php echo $side_meta_boxes ? 'has-sidebar' : ''; ?>"> 335 <div id="post-body-content" class="has-sidebar-content"> 336 337 <div id="titlediv"> 338 <h3><label for="title"><?php _e('Title') ?></label></h3> 339 <div id="titlewrap"> 340 <input type="text" name="post_title" size="30" tabindex="1" value="<?php echo attribute_escape( $post->post_title ); ?>" id="title" autocomplete="off" /> 341 </div> 342 <div class="inside"> 343 <?php $sample_permalink_html = get_sample_permalink_html($post->ID); ?> 344 <div id="edit-slug-box"> 345 <?php if ( ! empty($post->ID) && ! empty($sample_permalink_html) ) : 346 echo $sample_permalink_html; 347 endif; ?> 348 </div> 349 </div> 350 </div> 351 352 <div id="<?php echo user_can_richedit() ? 'postdivrich' : 'postdiv'; ?>" class="postarea"> 353 354 <div id="add-media-button"><a href="<?php echo clean_url( admin_url( 'media-upload.php?post_id=' . ( $post_ID ? $post_ID : $temp_ID ) . '&type=image&TB_iframe=true' ) ); ?>" class="thickbox button"><?php _e( 'Add Media' ); ?></a></div> 355 356 <h3><?php _e('Page') ?></h3> 357 <?php the_editor($post->post_content); ?> 358 <div id="post-status-info"> 359 <span id="wp-word-count" class="alignleft"></span> 360 <span class="alignright"> 361 <span id="autosave"> </span> 362 363 <?php 364 if ($post_ID) { 365 if ( $last_id = get_post_meta($post_ID, '_edit_last', true) ) { 366 $last_user = get_userdata($last_id); 367 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)); 368 } else { 369 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)); 370 } 371 } 372 ?> 373 </span> 374 <br class="clear" /> 375 </div> 376 377 378 <?php wp_nonce_field( 'autosave', 'autosavenonce', false ); ?> 379 <?php wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false ); ?> 380 <?php wp_nonce_field( 'getpermalink', 'getpermalinknonce', false ); ?> 381 <?php wp_nonce_field( 'samplepermalink', 'samplepermalinknonce', false ); ?> 382 <?php wp_nonce_field( 'meta-box-order', 'meta-box-order-nonce', false ); ?> 383 </div> 384 385 <?php 386 387 do_meta_boxes('page', 'normal', $post); 388 do_action('edit_page_form'); 321 389 do_meta_boxes('page', 'advanced', $post); 322 ?> 323 324 </div> 325 </div> 326 327 </div> 328 390 391 ?> 392 393 </div> 394 </div> 395 </div> 396 397 </div> 398 399 <br class="clear" /> 400 </div> 329 401 </form> 330 402
Note: See TracChangeset
for help on using the changeset viewer.