Changeset 8620 for branches/crazyhorse/wp-admin/edit-form-advanced.php
- Timestamp:
- 08/11/2008 10:52:43 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/crazyhorse/wp-admin/edit-form-advanced.php
r8483 r8620 1 1 <?php 2 3 if ( ! isset( $post_ID ) ) 4 $post_ID = 0; 2 5 3 6 $action = isset($action) ? $action : ''; 4 7 if ( isset($_GET['message']) ) 5 8 $_GET['message'] = absint( $_GET['message'] ); 6 $messages[1] = sprintf( __( 'Post updated. Continue editing below or <a href="%s">go back</a>.' ), attribute_escape( stripslashes( $_GET['_wp_original_http_referer']) ) );9 $messages[1] = sprintf( __( 'Post updated. Continue editing below or <a href="%s">go back</a>.' ), attribute_escape( stripslashes( ( isset( $_GET['_wp_original_http_referer'] ) ? $_GET['_wp_original_http_referer'] : '') ) ) ); 7 10 $messages[2] = __('Custom field updated.'); 8 11 $messages[3] = __('Custom field deleted.'); 9 12 $messages[4] = __('Post updated.'); 10 $messages[5] = sprintf( __('Post restored to revision from %s'), wp_post_revision_title( $_GET['revision'], false ) );11 13 $messages[6] = __('Post published.'); 12 14 $messages[7] = __('Post saved.'); 13 15 16 if ( isset($_GET['revision']) ) 17 $messages[5] = sprintf( __('Post restored to revision from %s'), wp_post_revision_title( (int) $_GET['revision'], false ) ); 18 14 19 $notice = false; 15 20 $notices[1] = __( 'There is an autosave of this post that is more recent than the version below. <a href="%s">View the autosave</a>.' ); 16 21 17 if ( !isset($post_ID) ||0 == $post_ID ) {22 if ( 0 == $post_ID ) { 18 23 $form_action = 'post'; 19 24 $temp_ID = -1 * time(); // don't change this formula without looking at wp_write_post() … … 46 51 <?php 47 52 53 <<<<<<< .working 48 54 // All meta boxes should be defined and added before the first do_meta_boxes() call (or potentially during the do_meta_boxes action). 55 ======= 56 if ( 0 == $post_ID) 57 wp_nonce_field('add-post'); 58 else 59 wp_nonce_field('update-post_' . $post_ID); 60 >>>>>>> .merge-right.r8619 49 61 50 62 function post_tags_meta_box($post) { … … 57 69 add_meta_box('tagsdiv', __('Tags'), 'post_tags_meta_box', 'post', 'side', 'core'); 58 70 71 <<<<<<< .working 59 72 //crazyhorse 60 73 function post_media_meta_box($post) { 61 74 echo "<p><small><em>This feature isn't fully functional in this prototype.</em></small></p>"; 75 ======= 76 <input type="hidden" id="user-id" name="user_ID" value="<?php echo (int) $user_ID ?>" /> 77 <input type="hidden" id="hiddenaction" name="action" value="<?php echo $form_action ?>" /> 78 <input type="hidden" id="originalaction" name="originalaction" value="<?php echo $form_action ?>" /> 79 <input type="hidden" id="post_author" name="post_author" value="<?php echo attribute_escape( $post->post_author ); ?>" /> 80 <input type="hidden" id="post_type" name="post_type" value="<?php echo $post->post_type ?>" /> 81 <input type="hidden" id="original_post_status" name="original_post_status" value="<?php echo $post->post_status ?>" /> 82 <input name="referredby" type="hidden" id="referredby" value="<?php 83 if ( !empty($_REQUEST['popupurl']) ) 84 echo clean_url(stripslashes($_REQUEST['popupurl'])); 85 else if ( strpos( wp_get_referer(), '/wp-admin/' ) === false && $post_ID && url_to_postid(wp_get_referer()) == $post_ID ) 86 echo 'redo'; 87 else 88 echo clean_url(stripslashes(wp_get_referer())); 89 ?>" /> 90 <?php if ( 'draft' != $post->post_status ) wp_original_referer_field(true, 'previous'); ?> 91 >>>>>>> .merge-right.r8619 62 92 63 93 if ( empty( $post->ID ) ) … … 85 115 echo "<h4>$att->post_title</h4>"; 86 116 117 <<<<<<< .working 87 118 echo "<a href='#' class='no-crazy'>Remove</a> | "; 88 119 echo "<a href='media.php?action=edit&attachment_id=$att->ID'>Edit</a>"; 89 120 ======= 121 <p><strong><label for='post_status'><?php _e('Publish Status') ?></label></strong></p> 122 <p> 123 <select name='post_status' id='post_status' tabindex='4'> 124 <?php 125 // 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) 126 if ( current_user_can('publish_posts') OR ( $post->post_status == 'publish' AND current_user_can('edit_post', $post->ID) ) ) : 127 ?> 128 <option<?php selected( $post->post_status, 'publish' ); selected( $post->post_status, 'private' );?> value='publish'><?php _e('Published') ?></option> 129 <?php if ( 'future' == $post->post_status ) : ?> 130 <option<?php selected( $post->post_status, 'future' ); ?> value='future'><?php _e('Scheduled') ?></option> 131 <?php endif; ?> 132 <?php endif; ?> 133 <option<?php selected( $post->post_status, 'pending' ); ?> value='pending'><?php _e('Pending Review') ?></option> 134 <option<?php selected( $post->post_status, 'draft' ); ?> value='draft'><?php _e('Unpublished') ?></option> 135 </select> 136 </p> 137 >>>>>>> .merge-right.r8619 138 139 <<<<<<< .working 90 140 echo "<br class='clear' />"; 141 ======= 142 <?php if ( current_user_can( 'publish_posts' ) ) : ?> 143 <p id="private-checkbox"><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> 144 <?php if ( current_user_can( 'edit_others_posts' ) ) : ?> 145 <p id="sticky-checkbox"><label for="sticky" class="selectit"><input id="sticky" name="sticky" type="checkbox" value="sticky" <?php checked(is_sticky($post->ID), true); ?> tabindex="4" /> <?php _e('Stick this post to the front page') ?></label></p> 146 <?php endif; ?> 147 <?php endif; ?> 148 <?php 149 if ( 0 != $post_ID ) { 150 if ( 'future' == $post->post_status ) { // scheduled for publishing at a future date 151 $stamp = __('Scheduled for:<br />%1$s at %2$s'); 152 } else if ( 'publish' == $post->post_status ) { // already published 153 $stamp = __('Published on:<br />%1$s at %2$s'); 154 } else if ( '0000-00-00 00:00:00' == $post->post_date ) { // draft, 1 or more saves, no date specified 155 $stamp = __('Publish immediately'); 156 } else { // draft, 1 or more saves, date specified 157 $stamp = __('Publish on:<br />%1$s at %2$s'); 158 >>>>>>> .merge-right.r8619 91 159 } 92 160 … … 96 164 add_meta_box( 'mediadiv', __('Media added to this Post' ), 'post_media_meta_box', 'post', 'side', 'core' ); 97 165 98 99 166 <<<<<<< .working 167 ======= 168 if ( ( 'edit' == $action) && current_user_can('delete_post', $post_ID) ) 169 echo "<a class='submitdelete' href='" . wp_nonce_url("post.php?action=delete&post=$post_ID", 'delete-post_' . $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 post '%s'\n 'Cancel' to stop, 'OK' to delete."), $post->post_title )) . "') ) { return true;}return false;\">" . __('Delete post') . "</a>"; 170 ?> 171 <br class="clear" /> 172 <?php if ( 0 != $post_ID ): ?> 173 <?php if ( $last_id = get_post_meta($post_ID, '_edit_last', true) ) { 174 $last_user = get_userdata($last_id); 175 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)); 176 } else { 177 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)); 178 } 179 ?> 180 <br class="clear" /> 181 <?php endif; ?> 182 <span id="autosave"></span> 183 <span id="wp-word-count"></span> 184 </p> 185 >>>>>>> .merge-right.r8619 186 187 188 <<<<<<< .working 189 ======= 190 <ul> 191 <?php if ( 0 != $post_ID ): ?> 192 <li><a href="edit.php?p=<?php echo $post_ID ?>"><?php _e('See Comments on this Post') ?></a></li> 193 <?php endif; ?> 194 <li><a href="edit-comments.php"><?php _e('Manage All Comments') ?></a></li> 195 <li><a href="edit.php"><?php _e('Manage All Posts') ?></a></li> 196 <li><a href="categories.php"><?php _e('Manage All Categories') ?></a></li> 197 <li><a href="edit-tags.php"><?php _e('Manage All Tags') ?></a></li> 198 <li><a href="edit.php?post_status=draft"><?php _e('View Drafts'); ?></a></li> 199 <?php do_action('post_relatedlinks_list'); ?> 200 </ul> 201 >>>>>>> .merge-right.r8619 100 202 101 203 function post_categories_meta_box($post) { … … 231 333 function post_password_meta_box($post) { 232 334 ?> 335 <<<<<<< .working 233 336 <p> 234 337 <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> … … 236 339 <h4><?php _e( 'Post Password' ); ?></h4> 237 340 <p><label class="hidden" for="post_password"><?php _e('Password Protect This Post') ?></label><input name="post_password" type="text" size="25" id="post_password" value="<?php echo attribute_escape( $post->post_password ); ?>" /></p> 341 ======= 342 <p><label class="hidden" for="post_password"><?php _e('Password Protect This Post') ?></label><input name="post_password" type="text" size="25" id="post_password" value="<?php if ( isset( $post->post_password ) ) : echo attribute_escape( $post->post_password ); endif; ?>" /></p> 343 >>>>>>> .merge-right.r8619 238 344 <p><?php _e('Setting a password will require people who visit your blog to enter the above password to view this post and its comments.'); ?></p> 239 345 <?php … … 264 370 endif; 265 371 266 if ( isset($post_ID) &&0 < $post_ID && wp_get_post_revisions( $post_ID ) ) :372 if ( 0 < $post_ID && wp_get_post_revisions( $post_ID ) ) : 267 373 function post_revisions_meta_box($post) { 268 374 wp_list_post_revisions();
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)