From bb14d0a2e7fcc586c372858b81676396d279cd0e Mon Sep 17 00:00:00 2001 From: Matt Mullenweg Date: Wed, 28 Apr 2004 02:23:46 +0000 Subject: [PATCH] How the custom fields should look. git-svn-id: https://develop.svn.wordpress.org/trunk@1195 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-admin/admin-functions.php | 86 ++++++++++++++++----------------- wp-admin/edit-form-advanced.php | 33 ++++++------- wp-admin/wp-admin.css | 25 +++++----- 3 files changed, 69 insertions(+), 75 deletions(-) diff --git a/wp-admin/admin-functions.php b/wp-admin/admin-functions.php index e261e85407..6a36c3a8e0 100644 --- a/wp-admin/admin-functions.php +++ b/wp-admin/admin-functions.php @@ -216,28 +216,30 @@ function has_meta($postid) { function list_meta($meta) { global $post_ID; // Exit if no meta - if (!$meta) return; - - - print " - - - - - - \n"; + if (!$meta) return; +?> +
KeyValue 
+ + + + + + - - - - \n"; + $style = ('class="alternate"' == $style) ? '' : 'class="alternate"'; + echo " + + + + + + +"; } - print " -
{$entry['meta_key']}{$entry['meta_value']}Delete
\n"; + echo " + +"; } // Get a list of previously defined keys @@ -256,43 +258,37 @@ function get_meta_keys() { function meta_form() { $keys = get_meta_keys(); ?> -

-
-

- - $key\n"; + echo "\n\t"; } ?> - - - -
-
-

+ or + + + - -
-
-
- -
+ +

escape( stripslashes( trim($_POST['metakeyselect']) ) ); + $metakeyinput = $wpdb->escape( stripslashes( trim($_POST['metakeyinput']) ) ); + $metavalue = $wpdb->escape( stripslashes( trim($_POST['metavalue']) ) ); if (!empty($metavalue) && ((('#NONE#' != $metakeyselect) && !empty($metakeyselect)) || !empty($metakeyinput))) { // We have a key/value pair. If both the select and the @@ -314,7 +310,7 @@ function add_meta($post_ID) { function del_meta($mid) { global $wpdb, $tablepostmeta; - + $result = $wpdb->query("DELETE FROM $tablepostmeta WHERE meta_id = '$mid'"); } diff --git a/wp-admin/edit-form-advanced.php b/wp-admin/edit-form-advanced.php index a5c1e9fdd3..8cf4bf5cb4 100644 --- a/wp-admin/edit-form-advanced.php +++ b/wp-admin/edit-form-advanced.php @@ -139,19 +139,6 @@ if ($action != 'editcomment') { } } ?> -
- - - - -
@@ -179,11 +166,23 @@ if ('' != $pinged) { if ($user_level > 4) { touch_time(($action == 'edit')); } -if ('edit' == $action) echo " -

" . __('Delete this post') . "

"; ?> - +
+ + + + +
- +" . __('Delete this post') . "

"; +?> diff --git a/wp-admin/wp-admin.css b/wp-admin/wp-admin.css index c54428787a..67a6e44179 100644 --- a/wp-admin/wp-admin.css +++ b/wp-admin/wp-admin.css @@ -329,7 +329,7 @@ textarea, input, select { border: 1px solid #aaa; margin: 0.25em; padding: 0.25em; - width: 30em; + width: 98%; } #postcustom p { @@ -337,28 +337,27 @@ textarea, input, select { } #postcustom table { - background-color: #eee; border: 1px solid #ccc; - color: #000; - margin-bottom: 1em; - padding: 0px; + margin: .5em; width: 100%; + +} + +#postcustom table input, #postcustom table textarea { + width: 97%; } #postcustom td, #postcustom th { color: #000; - margin: 1px; - padding: 0.2em; + margin: 0.2em; + padding: .3em; } -#postcustomkeys { - float: left; - width: 49%; +#postcustom #updatemeta, #postcustom #deletemeta { + width: 90%; + margin: auto; } -#postcustomkeys input, #postcustom select, #postcustom textarea { - width: 95%; -} fieldset legend a { border-bottom: none; }