From 12de05107e4c8b006bde6ee8916f34eb476d08da Mon Sep 17 00:00:00 2001 From: donncha Date: Fri, 13 Jun 2008 17:21:00 +0000 Subject: WP Merge with revision 8075 git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@1328 7be80a69-a1ef-0310-a953-fb0f7c49ff36 --- wp-admin/edit-form-advanced.php | 206 +++++++++++++++++++++++----------------- 1 file changed, 119 insertions(+), 87 deletions(-) (limited to 'wp-admin/edit-form-advanced.php') diff --git a/wp-admin/edit-form-advanced.php b/wp-admin/edit-form-advanced.php index 7d1ff7d..e87945e 100644 --- a/wp-admin/edit-form-advanced.php +++ b/wp-admin/edit-form-advanced.php @@ -1,12 +1,35 @@ go back.' ), attribute_escape( stripslashes( $_GET['_wp_original_http_referer'] ) ) ); $messages[2] = __('Custom field updated.'); $messages[3] = __('Custom field deleted.'); $messages[4] = __('Post updated.'); +$messages[5] = sprintf( __('Post restored to revision from %s'), wp_post_revision_title( $_GET['revision'], false ) ); + +$notice = false; +$notices[1] = __( 'There is an autosave of this post that is more recent than the version below. View the autosave.' ); + +if ( !isset($post_ID) || 0 == $post_ID ) { + $form_action = 'post'; + $temp_ID = -1 * time(); // don't change this formula without looking at wp_write_post() + $form_extra = ""; + $autosave = false; +} else { + $post_ID = (int) $post_ID; + $form_action = 'editpost'; + $form_extra = ""; + $autosave = wp_get_post_autosave( $post_id ); + if ( $autosave && mysql2date( 'U', $autosave->post_modified_gmt ) > mysql2date( 'U', $post->post_modified_gmt ) ) + $notice = sprintf( $notices[1], get_edit_post_link( $autosave->ID ) ); +} + ?> + +

+

@@ -20,33 +43,15 @@ $messages[4] = __('Post updated.');

"; +if ( !isset($post_ID) || 0 == $post_ID) wp_nonce_field('add-post'); -} else { - $post_ID = (int) $post_ID; - $form_action = 'editpost'; - $form_extra = ""; +else wp_nonce_field('update-post_' . $post_ID); -} $form_pingback = ''; $form_prevstatus = ''; -$form_trackback = 'to_ping) ) .'" />'; - -if ('' != $post->pinged) { - $pings = '

'. __('Already pinged:') . '

'; -} - $saveasdraft = ''; ?> @@ -83,10 +88,13 @@ else
-

+

- +post_status == 'publish' AND current_user_can('edit_post', $post->ID) ) ) : +?> post_status, 'publish' ); selected( $post->post_status, 'private' );?> value='publish'> post_status ) : ?> post_status, 'future' ); ?> value='future'> @@ -156,6 +164,7 @@ if ( ( 'edit' == $action) && current_user_can('delete_post', $post_ID) )
+

@@ -172,6 +181,9 @@ if ( ( 'edit' == $action) && current_user_can('delete_post', $post_ID) )
  • + +
    +

    @@ -179,7 +191,7 @@ if ( ( 'edit' == $action) && current_user_can('delete_post', $post_ID) )
    -

    +

    @@ -194,7 +206,7 @@ endif; ?>
    -

    +

    post_content); ?> @@ -205,23 +217,22 @@ endif; ?> -
    -

    -
    -

    + +

    -
    -
    - -
    -

    -
    +

    - - 0, 'name' => 'newcat_parent', 'orderby' => 'name', 'hierarchical' => 1, 'show_option_none' => __('Parent category'), 'tab_index' => 3 ) ); ?> + + 0, 'name' => 'newcat_parent', 'orderby' => 'name', 'hierarchical' => 1, 'show_option_none' => __('Parent category'), 'tab_index' => 3 ) ); ?> @@ -244,9 +255,10 @@ endif; ?> ID, false, false, $popular_ids) ?>

    - -
    -
    + @@ -254,32 +266,41 @@ endif; ?>

    -
    -

    -
    + +

    use them in your template'); ?>

    -
    -
    +to_ping) ) .'" />'; + if ('' != $post->pinged) { + $pings = '

    '. __('Already pinged:') . '

      '; + $already_pinged = explode("\n", trim($post->pinged)); + foreach ($already_pinged as $pinged_url) { + $pings .= "\n\t
    • " . wp_specialchars($pinged_url) . "
    • "; + } + $pings .= '
    '; + } -
    -

    -
    -


    ()

    +?> +


    ()

    pingbacks, no other action necessary.'); ?>

    -
    -
    +} +add_meta_box('trackbacksdiv', __('Trackbacks'), 'post_trackback_meta_box', 'post', 'advanced', 'core'); -
    -

    -
    +function post_custom_meta_box($post) { +?>
    ID); list_meta($metadata); ?> @@ -290,55 +311,66 @@ list_meta($metadata);

    use in your theme.'); ?>

    - - + +do_action('dbx_post_advanced'); -
    -

    -
    +function post_comment_status_meta_box($post) { +?>

    trackbacks and pingbacks.'); ?>

    -
    -
    +"> -

    -
    -

    +function post_password_meta_box($post) { +?> +

    -
    - - -
    -

    -
    - -
    -
    + +id ); // TODO: ROLE SYSTEM if ( $post->post_author && !in_array($post->post_author, $authors) ) $authors[] = $post->post_author; if ( $authors && count( $authors ) > 1 ) : +function post_author_meta_box($post) { + global $current_user, $user_ID; + $authors = get_editable_user_ids( $current_user->id ); // TODO: ROLE SYSTEM + if ( $post->post_author && !in_array($post->post_author, $authors) ) + $authors[] = $post->post_author; ?> -
    -

    -
    - $authors, 'name' => 'post_author_override', 'selected' => empty($post_ID) ? $user_ID : $post->post_author) ); ?> -
    -
    - + $authors, 'name' => 'post_author_override', 'selected' => empty($post->ID) ? $user_ID : $post->post_author) ); ?> + +if ( isset($post_ID) && 0 < $post_ID && wp_get_post_revisions( $post_ID ) ) : +function post_revisions_meta_box($post) { + wp_list_post_revisions(); +} +add_meta_box('revisionsdiv', __('Post Revisions'), 'post_revisions_meta_box', 'post', 'advanced', 'core'); +endif; - +do_meta_boxes('post', 'advanced', $post); + +do_action('dbx_post_sidebar'); +?> -- cgit