]> scripts.mit.edu Git - autoinstalls/wordpress.git/blob - wp-admin/edit-page-form.php
Wordpress 2.0.2
[autoinstalls/wordpress.git] / wp-admin / edit-page-form.php
1
2 <div class="wrap">
3 <h2 id="write-post"><?php _e('Write Page'); ?><?php if ( 0 != $post_ID ) : ?>
4 <small class="quickjump"><a href="#preview-post"><?php _e('preview &darr;'); ?></a></small><?php endif; ?></h2>
5 <?php
6 if (0 == $post_ID) {
7         $form_action = 'post';
8         $temp_ID = -1 * time();
9         $form_extra = "<input type='hidden' name='temp_ID' value='$temp_ID' />";
10 } else {
11         $form_action = 'editpost';
12         $form_extra = "<input type='hidden' name='post_ID' value='$post_ID' />";
13 }
14
15 $sendto = $_SERVER['HTTP_REFERER'];
16
17 if ( 0 != $post_ID && $sendto == get_permalink($post_ID) )
18         $sendto = 'redo';
19 $sendto = wp_specialchars( $sendto );
20
21 ?>
22
23 <form name="post" action="post.php" method="post" id="post">
24
25 <?php
26 if (isset($mode) && 'bookmarklet' == $mode) {
27     echo '<input type="hidden" name="mode" value="bookmarklet" />';
28 }
29 ?>
30 <input type="hidden" name="user_ID" value="<?php echo $user_ID ?>" />
31 <input type="hidden" name="action" value='<?php echo $form_action ?>' />
32 <?php echo $form_extra ?>
33 <input type="hidden" name="post_status" value="static" />
34
35 <script type="text/javascript">
36 <!--
37 function focusit() { // focus on first input field
38         document.post.title.focus();
39 }
40 addLoadEvent(focusit);
41 //-->
42 </script>
43 <div id="poststuff">
44
45 <div id="moremeta">
46 <div id="grabit" class="dbx-group">
47 <fieldset id="commentstatusdiv" class="dbx-box">
48 <h3 class="dbx-handle"><?php _e('Discussion') ?></h3>
49 <div class="dbx-content">
50 <input name="advanced_view" type="hidden" value="1" />
51 <label for="comment_status" class="selectit">
52 <input name="comment_status" type="checkbox" id="comment_status" value="open" <?php checked($post->comment_status, 'open'); ?> />
53 <?php _e('Allow Comments') ?></label> 
54 <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>
55 </div>
56 </fieldset>
57
58 <fieldset id="passworddiv" class="dbx-box">
59 <h3 class="dbx-handle"><?php _e('Password-Protect Post') ?></h3> 
60 <div class="dbx-content"><input name="post_password" type="text" size="13" id="post_password" value="<?php echo $post->post_password ?>" /></div>
61 </fieldset>
62
63 <fieldset id="pageparent" class="dbx-box">
64 <h3 class="dbx-handle"><?php _e('Page Parent') ?></h3> 
65 <div class="dbx-content"><p><select name="parent_id">
66 <option value='0'><?php _e('Main Page (no parent)'); ?></option>
67 <?php parent_dropdown($post->post_parent); ?>
68 </select></p>
69 </div>
70 </fieldset>
71
72 <?php if ( 0 != count( get_page_templates() ) ) { ?>
73 <fieldset id="pageparent" class="dbx-box">
74 <h3 class="dbx-handle"><?php _e('Page Template:') ?></h3> 
75 <div class="dbx-content"><p><select name="page_template">
76                 <option value='default'><?php _e('Default Template'); ?></option>
77                 <?php page_template_dropdown($post->page_template); ?>
78                 </select></p>
79 </div>
80 </fieldset>
81 <?php } ?>
82
83 <fieldset id="slugdiv" class="dbx-box">
84 <h3 class="dbx-handle"><?php _e('Post slug') ?></h3> 
85 <div class="dbx-content"><input name="post_name" type="text" size="13" id="post_name" value="<?php echo $post->post_name ?>" /></div>
86 </fieldset>
87
88 <?php if ( $authors = get_editable_authors( $current_user->id ) ) : // TODO: ROLE SYSTEM ?>
89 <fieldset id="authordiv" class="dbx-box">
90 <h3 class="dbx-handle"><?php _e('Post author'); ?>:</h3>
91 <div class="dbx-content">
92 <select name="post_author_override" id="post_author_override">
93 <?php 
94 foreach ($authors as $o) :
95 $o = get_userdata( $o->ID );
96 if ( $post->post_author == $o->ID || ( empty($post_ID) && $user_ID == $o->ID ) ) $selected = 'selected="selected"';
97 else $selected = '';
98 echo "<option value='$o->ID' $selected>$o->display_name</option>";
99 endforeach;
100 ?>
101 </select>
102 </div>
103 </fieldset>
104 <?php endif; ?>
105
106 <fieldset id="pageorder" class="dbx-box">
107 <h3 class="dbx-handle"><?php _e('Page Order') ?></h3> 
108 <div class="dbx-content"><p><input name="menu_order" type="text" size="4" id="menu_order" value="<?php echo $post->menu_order ?>" /></p></div>
109 </fieldset>
110
111 <?php do_action('dbx_page_sidebar'); ?>
112
113 </div>
114 </div>
115
116 <fieldset id="titlediv">
117   <legend><?php _e('Page Title') ?></legend> 
118   <div><input type="text" name="post_title" size="30" tabindex="1" value="<?php echo $post->post_title; ?>" id="title" /></div>
119 </fieldset>
120
121
122 <fieldset id="<?php echo user_can_richedit() ? 'postdivrich' : 'postdiv'; ?>">
123     <legend><?php _e('Page Content') ?></legend>
124 <?php
125  $rows = get_settings('default_post_edit_rows');
126  if (($rows < 3) || ($rows > 100)) {
127      $rows = 10;
128  }
129 ?>
130 <?php the_quicktags(); ?>
131
132 <div><textarea title="true" rows="<?php echo $rows; ?>" cols="40" name="content" tabindex="4" id="content"><?php echo user_can_richedit() ? wp_richedit_pre($post->post_content) : $post->post_content; ?></textarea></div>
133 </fieldset>
134
135 <script type="text/javascript">
136 <!--
137 edCanvas = document.getElementById('content');
138 <?php if ( user_can_richedit() ) : ?>
139 // This code is meant to allow tabbing from Title to Post (TinyMCE).
140 if ( tinyMCE.isMSIE )
141         document.getElementById('title').onkeydown = function (e)
142                 {
143                         e = e ? e : window.event;
144                         if (e.keyCode == 9 && !e.shiftKey && !e.controlKey && !e.altKey) {
145                                 var i = tinyMCE.selectedInstance;
146                                 if(typeof i ==  'undefined')
147                                         return true;
148                                 tinyMCE.execCommand("mceStartTyping");
149                                 this.blur();
150                                 i.contentWindow.focus();
151                                 e.returnValue = false;
152                                 return false;
153                         }
154                 }
155 else
156         document.getElementById('title').onkeypress = function (e)
157                 {
158                         e = e ? e : window.event;
159                         if (e.keyCode == 9 && !e.shiftKey && !e.controlKey && !e.altKey) {
160                                 var i = tinyMCE.selectedInstance;
161                                 if(typeof i ==  'undefined')
162                                         return true;
163                                 tinyMCE.execCommand("mceStartTyping");
164                                 this.blur();
165                                 i.contentWindow.focus();
166                                 e.returnValue = false;
167                                 return false;
168                         }
169                 }
170 <?php endif; ?>
171 //-->
172 </script>
173
174 <p class="submit">
175 <?php if ( $post_ID ) : ?>
176 <input name="save" type="submit" id="save" tabindex="5" value=" <?php _e('Save and Continue Editing'); ?> "/> 
177 <input name="savepage" type="submit" id="savepage" tabindex="6" value="<?php $post_ID ? _e('Save') : _e('Create New Page') ?> &raquo;" /> 
178 <?php else : ?>
179 <input name="savepage" type="submit" id="savepage" tabindex="6" value="<?php _e('Create New Page') ?> &raquo;" /> 
180 <?php endif; ?>
181 <input name="referredby" type="hidden" id="referredby" value="<?php echo $sendto; ?>" />
182 </p>
183
184 <?php do_action('edit_page_form'); ?>
185
186 <?php
187 if (current_user_can('upload_files')) {
188         $uploading_iframe_ID = (0 == $post_ID ? $temp_ID : $post_ID);
189         $uploading_iframe_src = "inline-uploading.php?action=view&amp;post=$uploading_iframe_ID";
190         $uploading_iframe_src = apply_filters('uploading_iframe_src', $uploading_iframe_src);
191         if ( false != $uploading_iframe_src )
192                 echo '<iframe id="uploading" border="0" src="' . $uploading_iframe_src . '">' . __('This feature requires iframe support.') . '</iframe>';
193 }
194 ?>
195
196 <div id="advancedstuff" class="dbx-group">
197
198 <fieldset id="postcustom" class="dbx-box">
199 <h3 class="dbx-handle"><?php _e('Custom Fields') ?></h3>
200 <div id="postcustomstuff" class="dbx-content">
201 <?php 
202 if($metadata = has_meta($post_ID)) {
203 ?>
204 <?php
205         list_meta($metadata); 
206 ?>
207 <?php
208 }
209         meta_form();
210 ?>
211 </div>
212 </fieldset>
213
214 <?php do_action('dbx_page_advanced'); ?>
215
216 </div>
217
218 <?php if ('edit' == $action) : ?>
219                 <input name="deletepost" class="delete" type="submit" id="deletepost" tabindex="10" value="<?php _e('Delete this page') ?>" <?php echo "onclick=\"return confirm('" . sprintf(__("You are about to delete this page \'%s\'\\n  \'Cancel\' to stop, \'OK\' to delete."), $wpdb->escape($post->post_title) ) . "')\""; ?> />
220 <?php endif; ?>
221 </form>
222
223 </div>
224
225 </div>