Subversion Repositories website

[/] [trunk/] [wp-admin/] [edit-form-advanced.php] - Blame information for rev 84

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 84 drecordon
<?php
2 drecordon
if ( isset($_GET['message']) )
3 drecordon
    $_GET['message'] = (int) $_GET['message'];
4 drecordon
$messages[1] = __('Post updated');
5 drecordon
$messages[2] = __('Custom field updated');
6 drecordon
$messages[3] = __('Custom field deleted.');
7 drecordon
?>
8 drecordon
<?php if (isset($_GET['message'])) : ?>
9 drecordon
<div id="message" class="updated fade"><p><?php echo wp_specialchars($messages[$_GET['message']]); ?></p></div>
10 drecordon
<?php endif; ?>
11 drecordon
12 drecordon
<form name="post" action="post.php" method="post" id="post">
13 drecordon
<?php if ( (isset($mode) && 'bookmarklet' == $mode) || isset($_GET['popupurl']) ): ?>
14 drecordon
<input type="hidden" name="mode" value="bookmarklet" />
15 drecordon
<?php endif; ?>
16 drecordon
17 drecordon
<div class="wrap">
18 drecordon
<?php
19 drecordon
20 drecordon
if (== $post_ID) {
21 drecordon
    $form_action 'post';
22 drecordon
    $temp_ID = -time(); // don't change this formula without looking at wp_write_post()
23 drecordon
    $form_extra "<input type='hidden' id='post_ID' name='temp_ID' value='$temp_ID' />";
24 drecordon
    wp_nonce_field('add-post');
25 drecordon
} else {
26 drecordon
    $post_ID = (int) $post_ID;
27 drecordon
    $form_action 'editpost';
28 drecordon
    $form_extra "<input type='hidden' id='post_ID' name='post_ID' value='$post_ID' />";
29 drecordon
    wp_nonce_field('update-post_' .  $post_ID);
30 drecordon
}
31 drecordon
32 drecordon
$form_pingback '<input type="hidden" name="post_pingback" value="' . (int) get_option('default_pingback_flag') . '" id="post_pingback" />';
33 drecordon
34 drecordon
$form_prevstatus '<input type="hidden" name="prev_status" value="' attribute_escape$post->post_status ) . '" />';
35 drecordon
36 drecordon
$form_trackback '<input type="text" name="trackback_url" style="width: 415px" id="trackback" tabindex="7" value="'attribute_escapestr_replace("\n"' '$post->to_ping) ) .'" />';
37 drecordon
38 drecordon
if ('' != $post->pinged) {
39 drecordon
    $pings '<p>'__('Already pinged:') . '</p><ul>';
40 drecordon
    $already_pinged explode("\n"trim($post->pinged));
41 drecordon
    foreach ($already_pinged as $pinged_url) {
42 drecordon
        $pings .= "\n\t<li>" wp_specialchars($pinged_url) . "</li>";
43 drecordon
    }
44 drecordon
    $pings .= '</ul>';
45 drecordon
}
46 drecordon
47 drecordon
$saveasdraft '<input name="save" type="submit" id="save" tabindex="3" value="' attribute_escape__('Save and Continue Editing') ) . '" />';
48 drecordon
49 drecordon
if (empty($post->post_status)) $post->post_status 'draft';
50 drecordon
51 drecordon
?>
52 drecordon
53 drecordon
<input type="hidden" name="user_ID" value="<?php echo (int) $user_ID ?>" />
54 drecordon
<input type="hidden" id="hiddenaction" name="action" value="<?php echo $form_action ?>" />
55 drecordon
<input type="hidden" id="originalaction" name="originalaction" value="<?php echo $form_action ?>" />
56 drecordon
<input type="hidden" name="post_author" value="<?php echo attribute_escape$post->post_author ); ?>" />
57 drecordon
<input type="hidden" id="post_type" name="post_type" value="post" />
58 drecordon
 
59 drecordon
<?php echo $form_extra ?>
60 drecordon
<?php if ((isset($post->post_title) && '' == $post->post_title) || (isset($_GET['message']) && $_GET['message'])) : ?>
61 drecordon
<script type="text/javascript">
62 drecordon
function focusit() {
63 drecordon
    // focus on first input field
64 drecordon
    document.post.title.focus();
65 drecordon
}
66 drecordon
addLoadEvent(focusit);
67 drecordon
</script>
68 drecordon
<?php endif; ?>
69 drecordon
<div id="poststuff">
70 drecordon
 
71 drecordon
<div id="moremeta">
72 drecordon
<div id="grabit" class="dbx-group">
73 drecordon
 
74 drecordon
<fieldset id="categorydiv" class="dbx-box">
75 drecordon
<h3 class="dbx-handle"><?php _e('Categories'?></h3>
76 drecordon
<div class="dbx-content">
77 drecordon
<p id="jaxcat"></p>
78 drecordon
<ul id="categorychecklist"><?php dropdown_categories(); ?></ul></div>
79 drecordon
</fieldset>
80 drecordon
 
81 drecordon
<fieldset id="commentstatusdiv" class="dbx-box">
82 drecordon
<h3 class="dbx-handle"><?php _e('Discussion'?></h3>
83 drecordon
<div class="dbx-content">
84 drecordon
<input name="advanced_view" type="hidden" value="1" />
85 drecordon
<label for="comment_status" class="selectit">
86 drecordon
<input name="comment_status" type="checkbox" id="comment_status" value="open" <?php checked($post->comment_status'open'); ?> />
87 drecordon
<?php _e('Allow Comments'?></label>
88 drecordon
<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>
89 drecordon
</div>
90 drecordon
</fieldset>
91 drecordon
 
92 drecordon
<fieldset id="passworddiv" class="dbx-box">
93 drecordon
<h3 class="dbx-handle"><?php _e('Post Password'?></h3>
94 drecordon
<div class="dbx-content"><input name="post_password" type="text" size="13" id="post_password" value="<?php echo attribute_escape$post->post_password ); ?>" /></div>
95 drecordon
</fieldset>
96 drecordon
 
97 drecordon
<fieldset id="slugdiv" class="dbx-box">
98 drecordon
<h3 class="dbx-handle"><?php _e('Post Slug'?></h3>
99 drecordon
<div class="dbx-content"><input name="post_name" type="text" size="13" id="post_name" value="<?php echo attribute_escape$post->post_name ); ?>" /></div>
100 drecordon
</fieldset>
101 drecordon
 
102 drecordon
<fieldset id="poststatusdiv" class="dbx-box">
103 drecordon
<h3 class="dbx-handle"><?php _e('Post Status'?></h3>
104 drecordon
<div class="dbx-content">
105 drecordon
<?php if ( current_user_can('publish_posts') ) : ?>
106 drecordon
    <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>
107 drecordon
<?php endif; ?>
108 drecordon
    <label for="post_status_pending" class="selectit"><input id="post_status_pending" name="post_status" type="radio" value="pending" <?php checked($post->post_status'pending'); ?> /> <?php _e('Pending Review'?></label>
109 drecordon
      <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>
110 drecordon
      <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>
111 drecordon
</fieldset>
112 drecordon
 
113 drecordon
<?php if ( current_user_can('edit_posts') ) : ?>
114 drecordon
<fieldset id="posttimestampdiv" class="dbx-box">
115 drecordon
<h3 class="dbx-handle"><?php _e('Post Timestamp'); ?></h3>
116 drecordon
<div class="dbx-content"><?php touch_time(($action == 'edit')); ?></div>
117 drecordon
</fieldset>
118 drecordon
<?php endif; ?>
119 drecordon
120 drecordon
<?php
121 drecordon
$authors get_editable_user_ids$current_user->id ); // TODO: ROLE SYSTEM
122 drecordon
if ( $post->post_author && !in_array($post->post_author$authors) )
123 drecordon
    $authors[] = $post->post_author;
124 drecordon
if ( $authors && count$authors ) > ) :
125 drecordon
?>
126 drecordon
<fieldset id="authordiv" class="dbx-box">
127 drecordon
<h3 class="dbx-handle"><?php _e('Post Author'); ?></h3>
128 drecordon
<div class="dbx-content">
129 drecordon
<?php wp_dropdown_users( array('include' => $authors'name' => 'post_author_override''selected' => empty($post_ID) ? $user_ID $post->post_author) ); ?>
130 drecordon
</div>
131 drecordon
</fieldset>
132 drecordon
<?php endif; ?>
133 drecordon
134 drecordon
<?php do_action('dbx_post_sidebar'); ?>
135 drecordon
136 drecordon
</div>
137 drecordon
</div>
138 drecordon
 
139 drecordon
<fieldset id="titlediv">
140 drecordon
    <legend><?php _e('Title'?></legend>
141 drecordon
    <div><input type="text" name="post_title" size="30" tabindex="1" value="<?php echo attribute_escape($post->post_title); ?>" id="title" /></div>
142 drecordon
</fieldset>
143 drecordon
 
144 drecordon
<fieldset id="<?php echo user_can_richedit() ? 'postdivrich' 'postdiv'?>">
145 drecordon
<legend><?php _e('Post'?>
146 drecordon
147 drecordon
<?php if ( 'publish' == $post->post_status ) { ?>
148 drecordon
<a href="<?php echo clean_url(get_permalink($post->ID)); ?>" class="view-link" target="_blank"><?php _e('View &raquo;'); ?></a>
149 drecordon
<?php } elseif ( 'edit' == $action ) { ?>
150 drecordon
<a href="<?php echo clean_url(apply_filters('preview_post_link'add_query_arg('preview''true'get_permalink($post->ID)))); ?>" class="view-link" target="_blank"><?php _e('Preview &raquo;'); ?></a>
151 drecordon
<?php ?>
152 drecordon
</legend>
153 drecordon
 
154 drecordon
    <?php the_editor($post->post_content); ?>
155 drecordon
</fieldset>
156 drecordon
 
157 drecordon
<?php echo $form_pingback ?>
158 drecordon
<?php echo $form_prevstatus ?>
159 drecordon
160 drecordon
<fieldset id="tagdiv">
161 drecordon
    <legend><?php _e('Tags (separate multiple tags with commas: cats, pet food, dogs)'); ?></legend>
162 drecordon
    <div><input type="text" name="tags_input" class="tags-input" id="tags-input" size="30" tabindex="3" value="<?php echo get_tags_to_edit$post_ID ); ?>" /></div>
163 drecordon
</fieldset>
164 drecordon
 
165 drecordon
<p class="submit">
166 drecordon
<span id="autosave"></span>
167 drecordon
<?php echo $saveasdraft?>
168 drecordon
<input type="submit" name="submit" value="<?php _e('Save'); ?>" style="font-weight: bold;" tabindex="4" />
169 drecordon
<?php
170 drecordon
if ( !in_array$post->post_status, array('publish''future') ) || == $post_ID ) {
171 drecordon
?>
172 drecordon
<?php if ( current_user_can('publish_posts') ) : ?>
173 drecordon
    <input name="publish" type="submit" id="publish" tabindex="5" accesskey="p" value="<?php _e('Publish'?>" />
174 drecordon
<?php else : ?>
175 drecordon
    <input name="publish" type="submit" id="publish" tabindex="5" accesskey="p" value="<?php _e('Submit for Review'?>" />
176 drecordon
<?php endif; ?>
177 drecordon
<?php
178 drecordon
}
179 drecordon
?>
180 drecordon
<input name="referredby" type="hidden" id="referredby" value="<?php
181 drecordon
if ( !empty($_REQUEST['popupurl']) )
182 drecordon
    echo clean_url(stripslashes($_REQUEST['popupurl']));
183 drecordon
else if ( url_to_postid(wp_get_referer()) == $post_ID )
184 drecordon
    echo 'redo';
185 drecordon
else
186 drecordon
    echo clean_url(stripslashes(wp_get_referer()));
187 drecordon
?>" /></p>
188 drecordon
 
189 drecordon
<?php do_action('edit_form_advanced'); ?>
190 drecordon
191 drecordon
<?php
192 drecordon
if (current_user_can('upload_files')) {
193 drecordon
    $uploading_iframe_ID = (int) (== $post_ID $temp_ID $post_ID);
194 drecordon
    $uploading_iframe_src wp_nonce_url("upload.php?style=inline&amp;tab=upload&amp;post_id=$uploading_iframe_ID"'inlineuploading');
195 drecordon
    $uploading_iframe_src apply_filters('uploading_iframe_src'$uploading_iframe_src);
196 drecordon
    if ( false != $uploading_iframe_src )
197 drecordon
        echo '<iframe id="uploading" name="uploading" frameborder="0" src="' $uploading_iframe_src '">' __('This feature requires iframe support.') . '</iframe>';
198 drecordon
}
199 drecordon
?>
200 drecordon
201 drecordon
<div id="advancedstuff" class="dbx-group" >
202 drecordon
 
203 drecordon
<div class="dbx-b-ox-wrapper">
204 drecordon
<fieldset id="postexcerpt" class="dbx-box">
205 drecordon
<div class="dbx-h-andle-wrapper">
206 drecordon
<h3 class="dbx-handle"><?php _e('Optional Excerpt'?></h3>
207 drecordon
</div>
208 drecordon
<div class="dbx-c-ontent-wrapper">
209 drecordon
<div class="dbx-content"><textarea rows="1" cols="40" name="excerpt" tabindex="6" id="excerpt"><?php echo $post->post_excerpt ?></textarea></div>
210 drecordon
</div>
211 drecordon
</fieldset>
212 drecordon
</div>
213 drecordon
 
214 drecordon
<div class="dbx-b-ox-wrapper">
215 drecordon
<fieldset id="trackbacksdiv" class="dbx-box">
216 drecordon
<div class="dbx-h-andle-wrapper">
217 drecordon
<h3 class="dbx-handle"><?php _e('Trackbacks'?></h3>
218 drecordon
</div>
219 drecordon
<div class="dbx-c-ontent-wrapper">
220 drecordon
<div class="dbx-content"><?php _e('Send trackbacks to:'); ?> <?php echo $form_trackback?> (<?php _e('Separate multiple URLs with spaces'); ?>)
221 drecordon
<?php
222 drecordon
if ( ! empty($pings) )
223 drecordon
    echo $pings;
224 drecordon
?>
225 drecordon
</div>
226 drecordon
</div>
227 drecordon
</fieldset>
228 drecordon
</div>
229 drecordon
 
230 drecordon
<div class="dbx-b-ox-wrapper">
231 drecordon
<fieldset id="postcustom" class="dbx-box">
232 drecordon
<div class="dbx-h-andle-wrapper">
233 drecordon
<h3 class="dbx-handle"><?php _e('Custom Fields'?></h3>
234 drecordon
</div>
235 drecordon
<div class="dbx-c-ontent-wrapper">
236 drecordon
<div id="postcustomstuff" class="dbx-content">
237 drecordon
<table cellpadding="3">
238 drecordon
<?php
239 drecordon
$metadata has_meta($post_ID);
240 drecordon
list_meta($metadata);
241 drecordon
?>
242 drecordon
243 drecordon
</table>
244 drecordon
<?php
245 drecordon
    meta_form();
246 drecordon
?>
247 drecordon
<div id="ajax-response"></div>
248 drecordon
</div>
249 drecordon
</div>
250 drecordon
</fieldset>
251 drecordon
</div>
252 drecordon
 
253 drecordon
<?php do_action('dbx_post_advanced'); ?>
254 drecordon
255 drecordon
</div>
256 drecordon
 
257 drecordon
<?php if ('edit' == $action) : $delete_nonce wp_create_nonce'delete-post_' $post_ID ); ?>
258 drecordon
<input name="deletepost" class="button delete" type="submit" id="deletepost" tabindex="10" value="<?php echo ( 'draft' == $post->post_status ) ? __('Delete this draft') : __('Delete this post'); ?><?php echo "onclick=\"if ( confirm('" js_escape(sprintf( ('draft' == $post->post_status) ? __("You are about to delete this draft '%s'\n  'Cancel' to stop, 'OK' to delete.") : __("You are about to delete this post '%s'\n  'Cancel' to stop, 'OK' to delete."), $post->post_title )) . "') ) { document.forms.post._wpnonce.value = '$delete_nonce'; return true;}return false;\""?> />
259 drecordon
<?php endif; ?>
260 drecordon
261 drecordon
</div>
262 drecordon
 
263 drecordon
</div>
264 drecordon
 
265 drecordon
</form>