From 93d1eba12ea4d957d8281a5e624dc693f4a1caec Mon Sep 17 00:00:00 2001 From: Matt Mullenweg Date: Sun, 28 Dec 2003 11:44:05 +0000 Subject: [PATCH] New two-stage post process.Some HTML cleanup and general tweaking. Split edit form into several files. git-svn-id: https://develop.svn.wordpress.org/trunk@658 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-admin/edit-form-advanced.php | 172 ++++++++++++++++++++++++++ wp-admin/edit-form-comment.php | 104 ++++++++++++++++ wp-admin/edit-form.php | 208 ++++++-------------------------- wp-admin/link-manager.php | 27 +++-- wp-admin/post.php | 52 ++++---- wp-admin/wp-admin.css | 2 +- 6 files changed, 361 insertions(+), 204 deletions(-) create mode 100644 wp-admin/edit-form-advanced.php create mode 100644 wp-admin/edit-form-comment.php diff --git a/wp-admin/edit-form-advanced.php b/wp-admin/edit-form-advanced.php new file mode 100644 index 0000000000..a148d4aa79 --- /dev/null +++ b/wp-admin/edit-form-advanced.php @@ -0,0 +1,172 @@ + +
+\n'; +$form_prevstatus = ''; +if ($use_trackback) { + $form_trackback = '

+ (Separate multiple URLs with spaces.)
+

'; + if ('' != $pinged) { + $form_trackback .= '

Already pinged:

'; + } +} else { + $form_trackback = ''; +} +$saveasdraft = ''; + + +?> + +
+ + + + + +
+
+ Title +
+
+ +
+ Categories +
+
+ +
+ Post Status +
+ +
+
+
+ Comments +
+
+
+
+ Pings +
+
+
+
+ Post Password +
+
+ +
+
+Excerpt +
+
+ +
+Post +
+Quicktags: '; + include('quicktags.php'); +} +?> +
+ 100)) { + $rows = 10; + } +?> +
+
+ + + + +  +  click for Geo Info +
+ + + + + +

+ + +

+ + += $fileupload_minlevel) + && (in_array($user_login, $allowed_users) || (trim($fileupload_allowedusers)=="")) ) { ?> + + 4) && ($action != "post")) +if ($user_level > 4) { + touch_time(($action == 'edit')); +} +if ('edit' == $action) echo " +

Delete this post

"; +?> + +
+
+ +
diff --git a/wp-admin/edit-form-comment.php b/wp-admin/edit-form-comment.php new file mode 100644 index 0000000000..0d80de96ae --- /dev/null +++ b/wp-admin/edit-form-comment.php @@ -0,0 +1,104 @@ + +
+\n\n' /> + + +
+Name: +
+ +
+
+
+ E-mail: +
+ +
+
+
+ URI: +
+ +
+
+ +
+Comment +
+Quicktags: '; + include('quicktags.php'); +} +?> +
+ 100)) { + $rows = 10; + } +?> +
+
+ + + + + +

+ +

+ + + 4) && ($action != "post")) +if ($user_level > 4) { + touch_time(($action == 'edit')); +} +?> + + + +
diff --git a/wp-admin/edit-form.php b/wp-admin/edit-form.php index 959317a6bf..1463e7faf4 100644 --- a/wp-admin/edit-form.php +++ b/wp-admin/edit-form.php @@ -12,71 +12,34 @@ function checked($checked, $current) { if ($checked == $current) echo ' checked="checked"'; } -switch($action) { - case 'post': - $submitbutton_text = 'Blog this!'; - $toprow_title = 'New Post'; - $form_action = 'post'; - $form_extra = ''; - if ($use_pingback) { - $form_pingback = ''; - if ($use_trackback) { - $form_trackback = '

- (Separate multiple URLs with spaces.)
-

'; - if ('' != $pinged) { - $form_trackback .= '

Already pinged:

'; - } - } else { - $form_trackback = ''; - } - $saveasdraft = ''; - break; - case "editcomment": - $submitbutton_text = 'Edit this!'; - $toprow_title = 'Editing Comment # '.$commentdata['comment_ID']; - $form_action = 'editedcomment'; - $form_extra = "' />\n\n'; - $form_trackback = ''; - break; +$submitbutton_text = 'Blog this!'; +$toprow_title = 'New Post'; +$form_action = 'post'; +$form_extra = ''; +if ($use_pingback) { + $form_pingback = ' @@ -84,9 +47,6 @@ switch($action) { - - +
Title @@ -107,80 +71,14 @@ window.onload = focusit; Categories
- -
- Post Status -
- -
-
-
- Comments -
-
-
-
- Pings -
-
-
Post Password -
+
- - - - - - - - -
-
-
-
- -
-
- -
- - -
-Excerpt -
-
- -
-Post'; -} else { - echo 'Comment'; -} -?> +Post
- -  -  click for Geo Info -
- + -

+

+ + +

= $fileupload_minlevel) - && (in_array($user_login, $allowed_users) || (trim($fileupload_allowedusers)=="")) ) { ?> - - 4) && ($action != "post")) -if ($user_level > 4) { - touch_time(($action == 'edit')); -} -if ('edit' == $action) echo " -

Delete this post

"; ?>
diff --git a/wp-admin/link-manager.php b/wp-admin/link-manager.php index f6cbe2abb7..d802300af6 100644 --- a/wp-admin/link-manager.php +++ b/wp-admin/link-manager.php @@ -340,7 +340,7 @@ th { text-align: right; } for ($r = 0; $r < 10; $r++) { echo(' '); } ?> @@ -468,7 +468,7 @@ function checkAll(form)
  • Import Blogroll
  • -
    + - LINKS; } else { echo "\n"; @@ -634,10 +634,11 @@ LINKS;
    @@ -486,12 +486,12 @@ function checkAll(form) echo " @@ -521,7 +521,7 @@ function checkAll(form)
    - + @@ -591,7 +591,7 @@ LINKS; echo <<Edit
    Delete +    
    -
    + +
    diff --git a/wp-admin/post.php b/wp-admin/post.php index ef3680e1f1..0195f3f2be 100644 --- a/wp-admin/post.php +++ b/wp-admin/post.php @@ -84,8 +84,29 @@ switch($action) { } else { $now = date('Y-m-d H:i:s', (time() + ($time_difference * 3600))); } - - if ('' != $HTTP_POST_VARS['save']) $post_status = 'draft'; + + if (!empty($HTTP_POST_VARS['mode'])) { + switch($HTTP_POST_VARS['mode']) { + case 'bookmarklet': + $location = 'bookmarklet.php?a=b'; + break; + case 'sidebar': + $location = 'sidebar.php?a=b'; + break; + default: + $location = 'post.php'; + break; + } + } else { + $location = 'post.php'; + } + + // What to do based on which button they pressed + if ('' != $HTTP_POST_VARS['saveasdraft']) $post_status = 'draft'; + if ('' != $HTTP_POST_VARS['saveasprivate']) $post_status = 'private'; + if ('' != $HTTP_POST_VARS['publish']) $post_status = 'publish'; + if ('' != $HTTP_POST_VARS['advanced']) $post_status = 'draft'; + if((get_settings('use_geo_positions')) && (strlen($latstr) > 2) && (strlen($lonstr) > 2) ) { $postquery ="INSERT INTO $tableposts @@ -105,6 +126,10 @@ switch($action) { $post_ID = $wpdb->get_var("SELECT ID FROM $tableposts ORDER BY ID DESC LIMIT 1"); + if ('' != $HTTP_POST_VARS['advanced']) + $location = "post.php?action=edit&post=$post_ID"; + + // Insert categories // Check to make sure there is a category, if not just set it to some default if (!$post_categories) $post_categories = $wpdb->get_var("SELECT cat_ID FROM $tablecategories LIMIT 1"); @@ -126,23 +151,6 @@ switch($action) { sleep($sleep_after_edit); } - if (!empty($HTTP_POST_VARS['mode'])) { - switch($HTTP_POST_VARS['mode']) { - case 'bookmarklet': - $location = 'bookmarklet.php?a=b'; - break; - case 'sidebar': - $location = 'sidebar.php?a=b'; - break; - default: - $location = 'post.php'; - break; - } - } else { - $location = 'post.php'; - } - - if ('' != $HTTP_POST_VARS['save']) $location = "post.php?action=edit&post=$post_ID"; header("Location: $location"); @@ -209,7 +217,7 @@ switch($action) { $to_ping = $postdata['to_ping']; $pinged = $postdata['pinged']; - include('edit-form.php'); + include('edit-form-advanced.php'); } else { ?>

    Since you’re a newcomer, you’ll have to wait for an admin to raise your level to 1, @@ -261,6 +269,8 @@ switch($action) { $trackback = $HTTP_POST_VARS['trackback_url']; // Format trackbacks $trackback = preg_replace('|\s+|', '\n', $trackback); + + if ('' != $HTTP_POST_VARS['publish']) $post_status = 'publish'; if (($user_level > 4) && (!empty($HTTP_POST_VARS['edit_date']))) { $aa = $HTTP_POST_VARS['aa']; @@ -407,7 +417,7 @@ switch($action) { $content = $commentdata['comment_content']; $content = format_to_edit($content); - include('edit-form.php'); + include('edit-form-comment.php'); break; diff --git a/wp-admin/wp-admin.css b/wp-admin/wp-admin.css index e092c62b3f..66353e10e6 100644 --- a/wp-admin/wp-admin.css +++ b/wp-admin/wp-admin.css @@ -301,7 +301,7 @@ textarea, input, select { text-align: right; } -#titlediv, #poststatusdiv, #commentstatusdiv, #pingstatusdiv, #postpassworddiv { +#titlediv, #poststatusdiv, #commentstatusdiv, #pingstatusdiv, #postpassworddiv, #namediv, #uridiv, #emaildiv { float: left; height: 6em; margin-right: 5px;