3 <h2 id="write-post"><?php _e('Write Page'); ?></h2>
8 $nonce_action = 'add-page';
9 $temp_ID = -1 * time(); // don't change this formula without looking at wp_write_post()
10 $form_extra = "<input type='hidden' id='post_ID' name='temp_ID' value='$temp_ID' />";
12 $post_ID = (int) $post_ID;
13 $form_action = 'editpost';
14 $nonce_action = 'update-page_' . $post_ID;
15 $form_extra = "<input type='hidden' id='post_ID' name='post_ID' value='$post_ID' />";
18 $temp_ID = (int) $temp_ID;
19 $user_ID = (int) $user_ID;
21 $sendto = clean_url(stripslashes(wp_get_referer()));
23 if ( 0 != $post_ID && $sendto == get_permalink($post_ID) )
27 <form name="post" action="page.php" method="post" id="post">
30 wp_nonce_field($nonce_action);
32 if (isset($mode) && 'bookmarklet' == $mode) {
33 echo '<input type="hidden" name="mode" value="bookmarklet" />';
36 <input type="hidden" name="user_ID" value="<?php echo $user_ID ?>" />
37 <input type="hidden" id="hiddenaction" name="action" value='<?php echo $form_action ?>' />
38 <input type="hidden" id="originalaction" name="originalaction" value="<?php echo $form_action ?>" />
39 <?php echo $form_extra ?>
40 <input type="hidden" id="post_type" name="post_type" value="page" />
42 <script type="text/javascript">
44 function focusit() { // focus on first input field
45 document.post.title.focus();
47 addLoadEvent(focusit);
53 <div id="grabit" class="dbx-group">
54 <fieldset id="commentstatusdiv" class="dbx-box">
55 <h3 class="dbx-handle"><?php _e('Discussion') ?></h3>
56 <div class="dbx-content">
57 <input name="advanced_view" type="hidden" value="1" />
58 <label for="comment_status" class="selectit">
59 <input name="comment_status" type="checkbox" id="comment_status" value="open" <?php checked($post->comment_status, 'open'); ?> />
60 <?php _e('Allow Comments') ?></label>
61 <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>
65 <fieldset class="dbx-box">
66 <h3 class="dbx-handle"><?php _e('Page Status') ?></h3>
67 <div class="dbx-content"><?php if ( current_user_can('publish_pages') ) : ?>
68 <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>
70 <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>
71 <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>
74 <fieldset id="passworddiv" class="dbx-box">
75 <h3 class="dbx-handle"><?php _e('Page Password') ?></h3>
76 <div class="dbx-content"><input name="post_password" type="text" size="13" id="post_password" value="<?php echo attribute_escape( $post->post_password ); ?>" /></div>
79 <fieldset id="pageparent" class="dbx-box">
80 <h3 class="dbx-handle"><?php _e('Page Parent') ?></h3>
81 <div class="dbx-content"><p><select name="parent_id">
82 <option value='0'><?php _e('Main Page (no parent)'); ?></option>
83 <?php parent_dropdown($post->post_parent); ?>
88 <?php if ( 0 != count( get_page_templates() ) ) { ?>
89 <fieldset id="pagetemplate" class="dbx-box">
90 <h3 class="dbx-handle"><?php _e('Page Template') ?></h3>
91 <div class="dbx-content"><p><select name="page_template">
92 <option value='default'><?php _e('Default Template'); ?></option>
93 <?php page_template_dropdown($post->page_template); ?>
99 <fieldset id="slugdiv" class="dbx-box">
100 <h3 class="dbx-handle"><?php _e('Page Slug') ?></h3>
101 <div class="dbx-content"><input name="post_name" type="text" size="13" id="post_name" value="<?php echo attribute_escape( $post->post_name ); ?>" /></div>
104 <?php if ( $authors = get_editable_authors( $current_user->id ) ) : // TODO: ROLE SYSTEM ?>
105 <fieldset id="authordiv" class="dbx-box">
106 <h3 class="dbx-handle"><?php _e('Page Author'); ?></h3>
107 <div class="dbx-content">
108 <select name="post_author_override" id="post_author_override">
110 foreach ($authors as $o) :
111 $o = get_userdata( $o->ID );
112 if ( $post->post_author == $o->ID || ( empty($post_ID) && $user_ID == $o->ID ) ) $selected = 'selected="selected"';
114 $o->ID = (int) $o->ID;
115 $o->display_name = wp_specialchars( $o->display_name );
116 echo "<option value='$o->ID' $selected>$o->display_name</option>";
124 <fieldset id="pageorder" class="dbx-box">
125 <h3 class="dbx-handle"><?php _e('Page Order') ?></h3>
126 <div class="dbx-content"><p><input name="menu_order" type="text" size="4" id="menu_order" value="<?php echo $post->menu_order ?>" /></p></div>
129 <?php do_action('dbx_page_sidebar'); ?>
134 <fieldset id="titlediv">
135 <legend><?php _e('Page Title') ?></legend>
136 <div><input type="text" name="post_title" size="30" tabindex="1" value="<?php echo attribute_escape( $post->post_title ); ?>" id="title" /></div>
140 <fieldset id="<?php echo user_can_richedit() ? 'postdivrich' : 'postdiv'; ?>">
141 <legend><?php _e('Page Content') ?>
143 <?php if ( 'publish' == $post->post_status ) { ?>
144 <a href="<?php echo clean_url(get_permalink($post->ID)); ?>" style="position: absolute; right: 2em; margin-right: 19em; text-decoration: underline;" target="_blank"><?php _e('View »'); ?></a>
145 <?php } elseif ( 'edit' == $action ) { ?>
146 <a href="<?php echo clean_url(apply_filters('preview_post_link', add_query_arg('preview', 'true', get_permalink($post->ID)))); ?>" style="position: absolute; right: 2em; margin-right: 19em; text-decoration: underline;" target="_blank"><?php _e('Preview »'); ?></a>
149 <?php the_editor($post->post_content); ?>
153 <span id="autosave"></span>
154 <input name="save" type="submit" id="save" tabindex="3" value="<?php _e('Save and Continue Editing'); ?>" />
155 <input type="submit" name="submit" value="<?php _e('Save') ?>" style="font-weight: bold;" tabindex="4" />
157 if ('publish' != $post->post_status || 0 == $post_ID):
159 <?php if ( current_user_can('publish_pages') ) : ?>
160 <input name="publish" type="submit" id="publish" tabindex="5" accesskey="p" value="<?php _e('Publish') ?>" />
161 <?php endif; endif;?>
162 <input name="referredby" type="hidden" id="referredby" value="<?php echo $sendto; ?>" />
165 <?php do_action('edit_page_form'); ?>
168 if (current_user_can('upload_files')) {
169 $uploading_iframe_ID = (0 == $post_ID ? $temp_ID : $post_ID);
170 $uploading_iframe_src = wp_nonce_url("upload.php?style=inline&tab=upload&post_id=$uploading_iframe_ID", 'inlineuploading');
171 $uploading_iframe_src = apply_filters('uploading_iframe_src', $uploading_iframe_src);
172 if ( false != $uploading_iframe_src )
173 echo '<iframe id="uploading" name="uploading" frameborder="0" src="' . $uploading_iframe_src . '">' . __('This feature requires iframe support.') . '</iframe>';
177 <div id="advancedstuff" class="dbx-group">
179 <fieldset id="postcustom" class="dbx-box">
180 <h3 class="dbx-handle"><?php _e('Custom Fields') ?></h3>
181 <div id="postcustomstuff" class="dbx-content">
182 <table cellpadding="3">
184 $metadata = has_meta($post_ID);
185 list_meta($metadata);
193 <div id="ajax-response"></div>
196 <?php do_action('dbx_page_advanced'); ?>
200 <?php if ('edit' == $action) :
201 $delete_nonce = wp_create_nonce( 'delete-page_' . $post_ID );
202 if ( current_user_can('delete_page', $post->ID) ) ?>
203 <input name="deletepost" class="button delete" type="submit" id="deletepost" tabindex="10" value="<?php _e('Delete this page') ?>" <?php echo "onclick=\"if ( confirm('" . js_escape(sprintf(__("You are about to delete this page '%s'\n 'Cancel' to stop, 'OK' to delete."), $post->post_title )) . "') ) { document.forms.post._wpnonce.value = '$delete_nonce'; return true;}return false;\""; ?> />