Make WordPress Core


Ignore:
Timestamp:
08/11/2008 10:52:43 PM (18 years ago)
Author:
ryan
Message:

crazyhorse: merge with log:trunk@8334:8619 , merge arrows unresolved

File:
1 edited

Legend:

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

    r8483 r8620  
    11<?php
     2
     3if ( ! isset( $post_ID ) )
     4        $post_ID = 0;
    25
    36$action = isset($action) ? $action : '';
    47if ( isset($_GET['message']) )
    58        $_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'] : '') ) ) );
    710$messages[2] = __('Custom field updated.');
    811$messages[3] = __('Custom field deleted.');
    912$messages[4] = __('Post updated.');
    10 $messages[5] = sprintf( __('Post restored to revision from %s'), wp_post_revision_title( $_GET['revision'], false ) );
    1113$messages[6] = __('Post published.');
    1214$messages[7] = __('Post saved.');
    1315
     16if ( isset($_GET['revision']) )
     17        $messages[5] = sprintf( __('Post restored to revision from %s'), wp_post_revision_title( (int) $_GET['revision'], false ) );
     18
    1419$notice = false;
    1520$notices[1] = __( 'There is an autosave of this post that is more recent than the version below.  <a href="%s">View the autosave</a>.' );
    1621
    17 if ( !isset($post_ID) || 0 == $post_ID ) {
     22if ( 0 == $post_ID ) {
    1823        $form_action = 'post';
    1924        $temp_ID = -1 * time(); // don't change this formula without looking at wp_write_post()
     
    4651<?php
    4752
     53<<<<<<< .working
    4854// All meta boxes should be defined and added before the first do_meta_boxes() call (or potentially during the do_meta_boxes action).
     55=======
     56if ( 0 == $post_ID)
     57        wp_nonce_field('add-post');
     58else
     59        wp_nonce_field('update-post_' .  $post_ID);
     60>>>>>>> .merge-right.r8619
    4961
    5062function post_tags_meta_box($post) {
     
    5769add_meta_box('tagsdiv', __('Tags'), 'post_tags_meta_box', 'post', 'side', 'core');
    5870
     71<<<<<<< .working
    5972//crazyhorse
    6073function post_media_meta_box($post) {
    6174        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
     83if ( !empty($_REQUEST['popupurl']) )
     84        echo clean_url(stripslashes($_REQUEST['popupurl']));
     85else if ( strpos( wp_get_referer(), '/wp-admin/' ) === false && $post_ID && url_to_postid(wp_get_referer()) == $post_ID  )
     86        echo 'redo';
     87else
     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
    6292
    6393        if ( empty( $post->ID ) )
     
    85115                echo "<h4>$att->post_title</h4>";
    86116
     117<<<<<<< .working
    87118                echo "<a href='#' class='no-crazy'>Remove</a> | ";
    88119                echo "<a href='media.php?action=edit&amp;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)
     126if ( 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
    90140                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
     149if ( 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
    91159        }
    92160
     
    96164add_meta_box( 'mediadiv', __('Media added to this Post' ), 'post_media_meta_box', 'post', 'side', 'core' );
    97165
    98 
    99 
     166<<<<<<< .working
     167=======
     168if ( ( 'edit' == $action) && current_user_can('delete_post', $post_ID) )
     169        echo "<a class='submitdelete' href='" . wp_nonce_url("post.php?action=delete&amp;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&nbsp;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
    100202
    101203function post_categories_meta_box($post) {
     
    231333function post_password_meta_box($post) {
    232334?>
     335<<<<<<< .working
    233336<p>
    234337        <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>
     
    236339<h4><?php _e( 'Post Password' ); ?></h4>
    237340<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
    238344<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>
    239345<?php
     
    264370endif;
    265371
    266 if ( isset($post_ID) && 0 < $post_ID && wp_get_post_revisions( $post_ID ) ) :
     372if ( 0 < $post_ID && wp_get_post_revisions( $post_ID ) ) :
    267373function post_revisions_meta_box($post) {
    268374        wp_list_post_revisions();
Note: See TracChangeset for help on using the changeset viewer.