Make WordPress Core

Ticket #6775: 6775.3.diff

File 6775.3.diff, 5.0 KB (added by mdawaffe, 17 years ago)

Pages

  • wp-includes/js/autosave.js

     
    180180                post_data["comment_status"] = 'open';
    181181        if ( jQuery("#ping_status").attr("checked") )
    182182                post_data["ping_status"] = 'open';
    183         if ( jQuery("#excerpt") )
     183        if ( jQuery("#excerpt").size() )
    184184                post_data["excerpt"] = jQuery("#excerpt").val();
    185         if ( jQuery("#post_author") )
     185        if ( jQuery("#post_author").size() )
    186186                post_data["post_author"] = jQuery("#post_author").val();
    187187
    188188        // Don't run while the TinyMCE spellcheck is on.  Why?  Who knows.
  • wp-includes/script-loader.php

     
    4747                        'broken' => __('An unidentified error has occurred.')
    4848                ) );
    4949
    50                 $this->add( 'autosave', '/wp-includes/js/autosave.js', array('schedule', 'wp-ajax-response'), '20080507' );
     50                $this->add( 'autosave', '/wp-includes/js/autosave.js', array('schedule', 'wp-ajax-response'), '20080508' );
    5151
    5252                $this->add( 'wp-ajax', '/wp-includes/js/wp-ajax.js', array('prototype'), '20070306');
    5353                $this->localize( 'wp-ajax', 'WPAjaxL10n', array(
  • wp-admin/revision.php

     
    88$left        = absint($left);
    99$right       = absint($right);
    1010
    11 
    1211$parent_file = $redirect = 'edit.php';
    13 $submenu_file = 'edit.php';
    14 $title = __( 'Post Revision' );
    1512
    16 
    1713switch ( $action ) :
    1814case 'delete' : // stubs
    1915case 'edit' :
     
    9591        break;
    9692endswitch;
    9793
     94if ( !$redirect && !in_array( $post->post_type, array( 'post', 'page' ) ) )
     95        $redirect = 'edit.php';
     96
    9897if ( $redirect ) {
    9998        wp_redirect( $redirect );
    10099        exit;
    101100}
    102101
     102if ( 'page' == $post->post_type ) {
     103        $submenu_file = 'edit-pages.php';
     104        $title = __( 'Page Revisions' );
     105} else {
     106        $submenu_file = 'edit.php';
     107        $title = __( 'Post Revisions' );
     108}
     109
    103110// Converts post_author ID# into name
    104111add_filter( '_wp_revision_field_post_author', 'get_author_name' );
    105112
     
    163170
    164171<br class="clear" />
    165172
    166 <h2><?php _e( 'Post Revisions' ); ?></h2>
     173<h2><?php echo $title; ?></h2>
    167174
    168175<?php
    169176
  • wp-admin/edit-page-form.php

     
    55$messages[2] = __('Custom field updated.');
    66$messages[3] = __('Custom field deleted.');
    77$messages[4] = __('Page updated.');
    8 ?>
    9 <?php if (isset($_GET['message'])) : ?>
    10 <div id="message" class="updated fade"><p><?php echo $messages[$_GET['message']]; ?></p></div>
    11 <?php endif;
    128
     9$notice = false;
     10$notices[1] = __( 'There is an autosave of this page that is more recent than the version below.  <a href="%s">View the autosave</a>.' );
     11
    1312if (!isset($post_ID) || 0 == $post_ID) {
    1413        $form_action = 'post';
    1514        $nonce_action = 'add-page';
     
    2019        $form_action = 'editpost';
    2120        $nonce_action = 'update-page_' . $post_ID;
    2221        $form_extra = "<input type='hidden' id='post_ID' name='post_ID' value='$post_ID' />";
     22        $autosave = wp_get_autosave( $post_id );
     23        if ( $autosave && mysql2date( 'U', $autosave->post_modified_gmt ) > mysql2date( 'U', $post->post_modified_gmt ) )
     24                $notice = sprintf( $notices[1], get_edit_post_link( $autosave->ID ) );
    2325}
    2426
    2527$temp_ID = (int) $temp_ID;
     
    3133        $sendto = 'redo';
    3234?>
    3335
     36<?php if ( $notice ) : ?>
     37<div id="notice" class="error"><p><?php echo $notice ?></p></div>
     38<?php endif; ?>
     39<?php if (isset($_GET['message'])) : ?>
     40<div id="message" class="updated fade"><p><?php echo $messages[$_GET['message']]; ?></p></div>
     41<?php endif; ?>
     42
    3443<form name="post" action="page.php" method="post" id="post">
    3544<div class="wrap">
    3645<h2><?php _e('Write Page') ?></h2>
     
    4453<input type="hidden" id="user-id" name="user_ID" value="<?php echo $user_ID ?>" />
    4554<input type="hidden" id="hiddenaction" name="action" value='<?php echo $form_action ?>' />
    4655<input type="hidden" id="originalaction" name="originalaction" value="<?php echo $form_action ?>" />
     56<input type="hidden" id="post_author" name="post_author" value="<?php echo attribute_escape( $post->post_author ); ?>" />
    4757<?php echo $form_extra ?>
    4858<input type="hidden" id="post_type" name="post_type" value="<?php echo $post->post_type ?>" />
    4959<input type="hidden" id="original_post_status" name="original_post_status" value="<?php echo $post->post_status ?>" />
     
    282292</div>
    283293<?php endif; ?>
    284294
     295<?php if ( isset($post_ID) && 0 < $post_ID && wp_get_post_revisions( $post_ID ) ) : ?>
     296<div id="revisionsdiv" class="postbox <?php echo postbox_classes('revisionsdiv', 'page'); ?>">
     297<h3><?php _e('Page Revisions'); ?></h3>
     298<div class="inside">
     299<?php wp_list_post_revisions(); ?>
     300</div>
     301</div>
     302<?php endif; ?>
     303
     304
    285305<?php do_meta_boxes('page', 'advanced', $post); ?>
    286306
    287307</div>