root/tags/1_0-rc1/wp-admin/edit-form-advanced.php

Revision 595, 8.9 kB (checked in by donncha, 3 years ago)

WP Merge

  • Property svn:eol-style set to native
Line 
1 <?php
2 $messages[1] = __('Post updated');
3 $messages[2] = __('Custom field updated');
4 $messages[3] = __('Custom field deleted.');
5 ?>
6 <?php if (isset($_GET['message'])) : ?>
7 <div id="message" class="updated fade"><p><?php echo $messages[$_GET['message']]; ?></p></div>
8 <?php endif; ?>
9
10 <form name="post" action="post.php" method="post" id="post">
11 <?php if ( (isset($mode) && 'bookmarklet' == $mode) ||
12             isset($_GET['popupurl']) ): ?>
13 <input type="hidden" name="mode" value="bookmarklet" />
14 <?php endif; ?>
15
16 <div class="wrap">
17 <h2 id="write-post"><?php _e('Write Post'); ?><?php if ( 0 != $post_ID ) : ?>
18  <small class="quickjump"><a href="#preview-post"><?php _e('preview &darr;'); ?></a></small><?php endif; ?></h2>
19 <?php
20
21 if (0 == $post_ID) {
22     $form_action = 'post';
23     $temp_ID = -1 * time();
24     $form_extra = "<input type='hidden' id='post_ID' name='temp_ID' value='$temp_ID' />";
25     wp_nonce_field('add-post');
26 } else {
27     $form_action = 'editpost';
28     $form_extra = "<input type='hidden' id='post_ID' name='post_ID' value='$post_ID' />";
29     wp_nonce_field('update-post_' $post_ID);
30 }
31
32 $form_pingback = '<input type="hidden" name="post_pingback" value="' . get_option('default_pingback_flag') . '" id="post_pingback" />';
33
34 $form_prevstatus = '<input type="hidden" name="prev_status" value="' . $post->post_status . '" />';
35
36 $form_trackback = '<input type="text" name="trackback_url" style="width: 415px" id="trackback" tabindex="7" value="'. str_replace("\n", ' ', $post->to_ping) .'" />';
37
38 if ('' != $post->pinged) {
39     $pings = '<p>'. __('Already pinged:') . '</p><ul>';
40     $already_pinged = explode("\n", trim($post->pinged));
41     foreach ($already_pinged as $pinged_url) {
42         $pings .= "\n\t<li>$pinged_url</li>";
43     }
44     $pings .= '</ul>';
45 }
46
47 $saveasdraft = '<input name="save" type="submit" id="save" tabindex="3" value="' . __('Save and Continue Editing') . '" />';
48
49 if (empty($post->post_status)) $post->post_status = 'draft';
50
51 ?>
52
53 <input type="hidden" name="user_ID" value="<?php echo $user_ID ?>" />
54 <input type="hidden" id="hiddenaction" name="action" value="<?php echo $form_action ?>" />
55 <input type="hidden" name="post_author" value="<?php echo $post->post_author ?>" />
56 <input type="hidden" name="post_type" value="post" />
57
58 <?php echo $form_extra ?>
59 <?php if (isset($_GET['message']) && 2 > $_GET['message']) : ?>
60 <script type="text/javascript">
61 function focusit() {
62     // focus on first input field
63     document.post.title.focus();
64 }
65 addLoadEvent(focusit);
66 </script>
67 <?php endif; ?>
68 <?php autocomplete_css(); ?>
69 <div id="poststuff">
70
71 <div id="moremeta">
72 <div id="grabit" class="dbx-group">
73
74 <fieldset id="categorydiv" class="dbx-box">
75 <h3 class="dbx-handle"><?php _e('Categories') ?></h3>
76 <div class="dbx-content">
77 <p id="jaxcat"></p>
78 <?php if ( current_user_can('manage_categories') ) : ?>
79 <div id="searchresults" class="autocomplete"></div>
80 <?php autocomplete_textbox( "wpmu-edit.php?action=searchcategories&search=", "newcat", "searchresults" ); ?>
81 <?php endif; ?>
82 <ul id="categorychecklist"><?php dropdown_categories(get_settings('default_category')); ?></ul></div>
83 </fieldset>
84
85 <fieldset id="commentstatusdiv" class="dbx-box">
86 <h3 class="dbx-handle"><?php _e('Discussion') ?></h3>
87 <div class="dbx-content">
88 <input name="advanced_view" type="hidden" value="1" />
89 <label for="comment_status" class="selectit">
90 <input name="comment_status" type="checkbox" id="comment_status" value="open" <?php checked($post->comment_status, 'open'); ?> />
91 <?php _e('Allow Comments') ?></label>
92 <label for="ping_status" class="selectit"><input name="ping_status" type="checkbox" id="ping_status" value="open" <?php checked($post->ping_status, 'open'); ?> /> <?php _e('Allow Pings') ?></label>
93 </div>
94 </fieldset>
95
96 <fieldset id="passworddiv" class="dbx-box">
97 <h3 class="dbx-handle"><?php _e('Password-Protect Post') ?></h3>
98 <div class="dbx-content"><input name="post_password" type="text" size="13" id="post_password" value="<?php echo $post->post_password ?>" /></div>
99 </fieldset>
100
101 <fieldset id="slugdiv" class="dbx-box">
102 <h3 class="dbx-handle"><?php _e('Post slug') ?></h3>
103 <div class="dbx-content"><input name="post_name" type="text" size="13" id="post_name" value="<?php echo $post->post_name ?>" /></div>
104 </fieldset>
105
106 <fieldset class="dbx-box">
107 <h3 class="dbx-handle"><?php _e('Post Status') ?></h3>
108 <div class="dbx-content"><?php if ( current_user_can('publish_posts') ) : ?>
109 <label for="post_status_publish" class="selectit"><input id="post_status_publish" name="post_status" type="radio" value="publish" <?php checked($post->post_status, 'publish'); checked($post->post_status, 'future'); ?> /> <?php _e('Published') ?></label>
110 <?php endif; ?>
111       <label for="post_status_draft" class="selectit"><input id="post_status_draft" name="post_status" type="radio" value="draft" <?php checked($post->post_status, 'draft'); ?> /> <?php _e('Draft') ?></label>
112       <label for="post_status_private" class="selectit"><input id="post_status_private" name="post_status" type="radio" value="private" <?php checked($post->post_status, 'private'); ?> /> <?php _e('Private') ?></label></div>
113 </fieldset>
114
115 <?php if ( current_user_can('edit_posts') ) : ?>
116 <fieldset class="dbx-box">
117 <h3 class="dbx-handle"><?php _e('Post Timestamp'); ?>:</h3>
118 <div class="dbx-content"><?php touch_time(($action == 'edit')); ?></div>
119 </fieldset>
120 <?php endif; ?>
121
122 <?php if ( $authors = get_editable_authors( $current_user->id ) ) : // TODO: ROLE SYSTEM ?>
123 <fieldset id="authordiv" class="dbx-box">
124 <h3 class="dbx-handle"><?php _e('Post author'); ?>:</h3>
125 <div class="dbx-content">
126 <select name="post_author_override" id="post_author_override">
127 <?php
128 foreach ($authors as $o) :
129 $o = get_userdata( $o->ID );
130 if ( $post->post_author == $o->ID || ( empty($post_ID) && $user_ID == $o->ID ) ) $selected = 'selected="selected"';
131 else $selected = '';
132 echo "<option value='$o->ID' $selected>$o->display_name</option>";
133 endforeach;
134 ?>
135 </select>
136 </div>
137 </fieldset>
138 <?php endif; ?>
139
140 <?php do_action('dbx_post_sidebar'); ?>
141
142 </div>
143 </div>
144
145 <fieldset id="titlediv">
146   <legend><?php _e('Title') ?></legend>
147   <div><input type="text" name="post_title" size="30" tabindex="1" value="<?php echo $post->post_title; ?>" id="title" /></div>
148 </fieldset>
149
150 <fieldset id="<?php echo user_can_richedit() ? 'postdivrich' : 'postdiv'; ?>">
151 <legend><?php _e('Post') ?></legend>
152
153     <?php the_editor($post->post_content); ?>
154
155 <?php echo $form_pingback ?>
156 <?php echo $form_prevstatus ?>
157
158
159 <p class="submit"><?php echo $saveasdraft; ?> <input type="submit" name="submit" value="<?php _e('Save') ?>" style="font-weight: bold;" tabindex="4" />
160 <?php
161 if ('publish' != $post->post_status || 0 == $post_ID) {
162 ?>
163 <?php if ( current_user_can('publish_posts') ) : ?>
164     <input name="publish" type="submit" id="publish" tabindex="5" accesskey="p" value="<?php _e('Publish') ?>" />
165 <?php endif; ?>
166 <?php
167 }
168 ?>
169 <input name="referredby" type="hidden" id="referredby" value="<?php
170 if ( !empty($_REQUEST['popupurl']) )
171     echo wp_specialchars($_REQUEST['popupurl']);
172 else if ( url_to_postid(wp_get_referer()) == $post_ID )
173     echo 'redo';
174 else
175     echo wp_specialchars(wp_get_referer());
176 ?>" /></p>
177
178 <?php do_action('edit_form_advanced'); ?>
179
180 <?php
181 if (current_user_can('upload_files')) {
182     $uploading_iframe_ID = (0 == $post_ID ? $temp_ID : $post_ID);
183     $uploading_iframe_src = wp_nonce_url("inline-uploading.php?action=view&amp;post=$uploading_iframe_ID", 'inlineuploading');
184     $uploading_iframe_src = apply_filters('uploading_iframe_src', $uploading_iframe_src);
185     if ( false != $uploading_iframe_src )
186         echo '<iframe id="uploading" border="0" src="' . $uploading_iframe_src . '">' . __('This feature requires iframe support.') . '</iframe>';
187 }
188 ?>
189
190 <div id="advancedstuff" class="dbx-group" >
191
192 <fieldset id="postexcerpt" class="dbx-box">
193 <h3 class="dbx-handle"><?php _e('Optional Excerpt') ?></h3>
194 <div class="dbx-content"><textarea rows="1" cols="40" name="excerpt" tabindex="6" id="excerpt"><?php echo $post->post_excerpt ?></textarea></div>
195 </fieldset>
196
197 <fieldset class="dbx-box">
198 <h3 class="dbx-handle"><?php _e('Trackbacks') ?></h3>
199 <div class="dbx-content"><?php _e('Send trackbacks to'); ?>: <?php echo $form_trackback; ?> (<?php _e('Separate multiple URIs with spaces'); ?>)
200 <?php
201 if ( ! empty($pings) )
202     echo $pings;
203 ?>
204 </div>
205 </fieldset>
206
207 <fieldset id="postcustom" class="dbx-box">
208 <h3 class="dbx-handle"><?php _e('Custom Fields') ?></h3>
209 <div id="postcustomstuff" class="dbx-content">
210 <table cellpadding="3">
211 <?php
212 $metadata = has_meta($post_ID);
213 list_meta($metadata);
214 ?>
215
216 </table>
217 <?php
218     meta_form();
219 ?>
220 <div id="ajax-response"></div>
221 </div>
222 </fieldset>
223
224 <?php do_action('dbx_post_advanced'); ?>
225
226 </div>
227
228 <?php if ('edit' == $action) : $delete_nonce = wp_create_nonce( 'delete-post_' . $post_ID ); ?>
229 <input name="deletepost" class="button" type="submit" id="deletepost" tabindex="10" value="<?php _e('Delete this post') ?>" <?php echo "onclick=\"if ( confirm('" . sprintf(__("You are about to delete this post \'%s\'\\n  \'Cancel\' to stop, \'OK\' to delete."), js_escape($post->post_title) ) . "') ) { document.forms.post._wpnonce.value = '$delete_nonce'; return true;}return false;\""; ?> />
230 <?php endif; ?>
231
232 </div>
233
234 </div>
235
236 </form>
237
Note: See TracBrowser for help on using the browser.