WordPress.org

Make WordPress Core


Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/edit-page-form.php

    r4397 r3456  
    11
    22<div class="wrap">
    3 <h2 id="write-post"><?php _e('Write Page'); ?></h2>
     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>
    45<?php
    56if (0 == $post_ID) {
    67    $form_action = 'post';
    7     $nonce_action = 'add-page';
    88    $temp_ID = -1 * time();
    9     $form_extra = "<input type='hidden' id='post_ID' name='temp_ID' value='$temp_ID' />";
     9    $form_extra = "<input type='hidden' name='temp_ID' value='$temp_ID' />";
    1010} else {
    1111    $form_action = 'editpost';
    12     $nonce_action = 'update-page_' . $post_ID;
    13     $form_extra = "<input type='hidden' id='post_ID' name='post_ID' value='$post_ID' />";
    14 }
    15 
    16 $sendto = wp_get_referer();
     12    $form_extra = "<input type='hidden' name='post_ID' value='$post_ID' />";
     13}
     14
     15$sendto = $_SERVER['HTTP_REFERER'];
    1716
    1817if ( 0 != $post_ID && $sendto == get_permalink($post_ID) )
     
    2221?>
    2322
    24 <form name="post" action="page.php" method="post" id="post">
    25 
    26 <?php
    27 wp_nonce_field($nonce_action);
    28 
     23<form name="post" action="post.php" method="post" id="post">
     24
     25<?php
    2926if (isset($mode) && 'bookmarklet' == $mode) {
    3027    echo '<input type="hidden" name="mode" value="bookmarklet" />';
     
    3229?>
    3330<input type="hidden" name="user_ID" value="<?php echo $user_ID ?>" />
    34 <input type="hidden" id="hiddenaction" name="action" value='<?php echo $form_action ?>' />
    35 <input type="hidden" id="originalaction" name="originalaction" value="<?php echo $form_action ?>" />
     31<input type="hidden" name="action" value='<?php echo $form_action ?>' />
    3632<?php echo $form_extra ?>
    37 <input type="hidden" id="post_type" name="post_type" value="page" />
     33<input type="hidden" name="post_status" value="static" />
    3834
    3935<script type="text/javascript">
    40 // <![CDATA[
     36<!--
    4137function focusit() { // focus on first input field
    4238    document.post.title.focus();
    4339}
    4440addLoadEvent(focusit);
    45 // ]]>
     41//-->
    4642</script>
    4743<div id="poststuff">
     
    6056</fieldset>
    6157
    62 <fieldset class="dbx-box">
    63 <h3 class="dbx-handle"><?php _e('Page Status') ?></h3>
    64 <div class="dbx-content"><?php if ( current_user_can('publish_pages') ) : ?>
    65 <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>
    66 <?php endif; ?>
    67       <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>
    68       <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>
    69 </fieldset>
    70 
    7158<fieldset id="passworddiv" class="dbx-box">
    72 <h3 class="dbx-handle"><?php _e('Page Password') ?></h3>
     59<h3 class="dbx-handle"><?php _e('Password-Protect Post') ?></h3>
    7360<div class="dbx-content"><input name="post_password" type="text" size="13" id="post_password" value="<?php echo $post->post_password ?>" /></div>
    7461</fieldset>
     
    8471
    8572<?php if ( 0 != count( get_page_templates() ) ) { ?>
    86 <fieldset id="pagetemplate" class="dbx-box">
     73<fieldset id="pageparent" class="dbx-box">
    8774<h3 class="dbx-handle"><?php _e('Page Template:') ?></h3>
    8875<div class="dbx-content"><p><select name="page_template">
     
    9582
    9683<fieldset id="slugdiv" class="dbx-box">
    97 <h3 class="dbx-handle"><?php _e('Page Slug') ?></h3>
     84<h3 class="dbx-handle"><?php _e('Post slug') ?></h3>
    9885<div class="dbx-content"><input name="post_name" type="text" size="13" id="post_name" value="<?php echo $post->post_name ?>" /></div>
    9986</fieldset>
     
    10188<?php if ( $authors = get_editable_authors( $current_user->id ) ) : // TODO: ROLE SYSTEM ?>
    10289<fieldset id="authordiv" class="dbx-box">
    103 <h3 class="dbx-handle"><?php _e('Page Author'); ?>:</h3>
     90<h3 class="dbx-handle"><?php _e('Post author'); ?>:</h3>
    10491<div class="dbx-content">
    10592<select name="post_author_override" id="post_author_override">
     
    135122<fieldset id="<?php echo user_can_richedit() ? 'postdivrich' : 'postdiv'; ?>">
    136123    <legend><?php _e('Page Content') ?></legend>
    137     <?php the_editor($post->post_content); ?>
    138 </fieldset>
     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<!--
     137edCanvas = document.getElementById('content');
     138<?php if ( user_can_richedit() ) : ?>
     139// This code is meant to allow tabbing from Title to Post (TinyMCE).
     140if ( 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        }
     155else
     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>
    139173
    140174<p class="submit">
    141 <span id="autosave"></span>
    142 <input name="save" type="submit" id="save" tabindex="3" value="<?php _e('Save and Continue Editing'); ?>" />
    143 <input type="submit" name="submit" value="<?php _e('Save') ?>" style="font-weight: bold;" tabindex="4" />
    144 <?php
    145 if ('publish' != $post->post_status || 0 == $post_ID):
    146 ?>
    147 <?php if ( current_user_can('publish_pages') ) : ?>
    148     <input name="publish" type="submit" id="publish" tabindex="5" accesskey="p" value="<?php _e('Publish') ?>" />
    149 <?php endif; endif;?>
     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; ?>
    150181<input name="referredby" type="hidden" id="referredby" value="<?php echo $sendto; ?>" />
    151182</p>
     
    156187if (current_user_can('upload_files')) {
    157188    $uploading_iframe_ID = (0 == $post_ID ? $temp_ID : $post_ID);
    158     $uploading_iframe_src = wp_nonce_url("upload.php?style=inline&amp;tab=upload&amp;post_id=$uploading_iframe_ID", 'inlineuploading');
     189    $uploading_iframe_src = "inline-uploading.php?action=view&amp;post=$uploading_iframe_ID";
    159190    $uploading_iframe_src = apply_filters('uploading_iframe_src', $uploading_iframe_src);
    160191    if ( false != $uploading_iframe_src )
    161         echo '<iframe id="uploading" frameborder="0" src="' . $uploading_iframe_src . '">' . __('This feature requires iframe support.') . '</iframe>';
     192        echo '<iframe id="uploading" border="0" src="' . $uploading_iframe_src . '">' . __('This feature requires iframe support.') . '</iframe>';
    162193}
    163194?>
     
    168199<h3 class="dbx-handle"><?php _e('Custom Fields') ?></h3>
    169200<div id="postcustomstuff" class="dbx-content">
    170 <table cellpadding="3">
    171201<?php
    172 $metadata = has_meta($post_ID);
    173 list_meta($metadata);
    174 ?>
    175 
    176 </table>
    177 <?php
     202if($metadata = has_meta($post_ID)) {
     203?>
     204<?php
     205    list_meta($metadata);
     206?>
     207<?php
     208}
    178209    meta_form();
    179210?>
    180211</div>
    181 <div id="ajax-response"></div>
    182212</fieldset>
    183213
     
    186216</div>
    187217
    188 <?php if ('edit' == $action) :
    189     $delete_nonce = wp_create_nonce( 'delete-page_' . $post_ID );
    190     if ( current_user_can('delete_page', $post->ID) ) ?>
    191         <input name="deletepost" class="button delete" type="submit" id="deletepost" tabindex="10" value="<?php _e('Delete this page') ?>" <?php echo "onclick=\"if ( confirm('" . sprintf(__("You are about to delete this page \'%s\'\\n  \'Cancel\' to stop, \'OK\' to delete."), js_escape($post->post_title) ) . "') ) { document.forms.post._wpnonce.value = '$delete_nonce'; return true;}return false;\""; ?> />
    192 <?php endif; ?>
    193 </div>
    194 
     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; ?>
    195221</form>
    196222
    197223</div>
     224
     225</div>
Note: See TracChangeset for help on using the changeset viewer.