Make WordPress Core


Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3.0/wp-admin/includes/meta-boxes.php

    r17322 r15452  
    2323<?php // Hidden submit button early on so that the browser chooses the right button when form is submitted with Return key ?>
    2424<div style="display:none;">
    25 <?php submit_button( __( 'Save' ), 'button', 'save' ); ?>
     25<input type="submit" name="save" value="<?php esc_attr_e('Save'); ?>" />
    2626</div>
    2727
     
    3333<input type="submit" name="save" id="save-post" value="<?php esc_attr_e('Save as Pending'); ?>" tabindex="4" class="button button-highlighted" />
    3434<?php } ?>
    35 <img src="<?php echo esc_url( admin_url( 'images/wpspin_light.gif' ) ); ?>" class="ajax-loading" id="draft-ajax-loading" alt="" />
    3635</div>
    3736
     
    3938<?php
    4039if ( 'publish' == $post->post_status ) {
    41     $preview_link = esc_url( get_permalink( $post->ID ) );
    42     $preview_button = __( 'Preview Changes' );
     40    $preview_link = esc_url(get_permalink($post->ID));
     41    $preview_button = __('Preview Changes');
    4342} else {
    44     $preview_link = get_permalink( $post->ID );
    45     if ( is_ssl() )
    46         $preview_link = str_replace( 'http://', 'https://', $preview_link );
    47     $preview_link = esc_url( apply_filters( 'preview_post_link', add_query_arg( 'preview', 'true', $preview_link ) ) );
    48     $preview_button = __( 'Preview' );
     43    $preview_link = esc_url(apply_filters('preview_post_link', add_query_arg('preview', 'true', get_permalink($post->ID))));
     44    $preview_button = __('Preview');
    4945}
    5046?>
     
    7773    case 'auto-draft':
    7874        _e('Draft');
     75        break;
     76    case 'auto-draft':
     77        _e('Unsaved');
    7978        break;
    8079}
     
    155154</div><?php // /misc-pub-section ?>
    156155
     156
    157157<?php
    158158// translators: Publish box date formt, see http://php.net/date
     
    205205
    206206<div id="publishing-action">
    207 <img src="<?php echo esc_url( admin_url( 'images/wpspin_light.gif' ) ); ?>" class="ajax-loading" id="ajax-loading" alt="" />
     207<img src="<?php echo esc_url( admin_url( 'images/wpspin_light.gif' ) ); ?>" id="ajax-loading" style="visibility:hidden;" alt="" />
    208208<?php
    209209if ( !in_array( $post->post_status, array('publish', 'future', 'private') ) || 0 == $post->ID ) {
     
    211211        if ( !empty($post->post_date_gmt) && time() < strtotime( $post->post_date_gmt . ' +0000' ) ) : ?>
    212212        <input name="original_publish" type="hidden" id="original_publish" value="<?php esc_attr_e('Schedule') ?>" />
    213         <?php submit_button( __( 'Schedule' ), 'primary', 'publish', false, array( 'tabindex' => '5', 'accesskey' => 'p' ) ); ?>
     213        <input name="publish" type="submit" class="button-primary" id="publish" tabindex="5" accesskey="p" value="<?php esc_attr_e('Schedule') ?>" />
    214214<?php   else : ?>
    215215        <input name="original_publish" type="hidden" id="original_publish" value="<?php esc_attr_e('Publish') ?>" />
    216         <?php submit_button( __( 'Publish' ), 'primary', 'publish', false, array( 'tabindex' => '5', 'accesskey' => 'p' ) ); ?>
     216        <input name="publish" type="submit" class="button-primary" id="publish" tabindex="5" accesskey="p" value="<?php esc_attr_e('Publish') ?>" />
    217217<?php   endif;
    218218    else : ?>
    219219        <input name="original_publish" type="hidden" id="original_publish" value="<?php esc_attr_e('Submit for Review') ?>" />
    220         <?php submit_button( __( 'Submit for Review' ), 'primary', 'publish', false, array( 'tabindex' => '5', 'accesskey' => 'p' ) ); ?>
     220        <input name="publish" type="submit" class="button-primary" id="publish" tabindex="5" accesskey="p" value="<?php esc_attr_e('Submit for Review') ?>" />
    221221<?php
    222222    endif;
     
    232232
    233233<?php
    234 }
    235 
    236 /**
    237  * Display post format form elements.
    238  *
    239  * @since 3.1.0
    240  *
    241  * @param object $post
    242  */
    243 function post_format_meta_box( $post, $box ) {
    244     if ( current_theme_supports( 'post-formats' ) && post_type_supports( $post->post_type, 'post-formats' ) ) :
    245     $post_formats = get_theme_support( 'post-formats' );
    246 
    247     if ( is_array( $post_formats[0] ) ) :
    248         $post_format = get_post_format( $post->ID );
    249         if ( !$post_format )
    250             $post_format = '0';
    251         $post_format_display = get_post_format_string( $post_format );
    252         // Add in the current one if it isn't there yet, in case the current theme doesn't support it
    253         if ( $post_format && !in_array( $post_format, $post_formats[0] ) )
    254             $post_formats[0][] = $post_format;
    255     ?>
    256     <div id="post-formats-select">
    257         <input type="radio" name="post_format" class="post-format" id="post-format-0" value="0" <?php checked( $post_format, '0' ); ?> /> <label for="post-format-0"><?php _e('Standard'); ?></label>
    258         <?php foreach ( $post_formats[0] as $format ) : ?>
    259         <br /><input type="radio" name="post_format" class="post-format" id="post-format-<?php echo esc_attr( $format ); ?>" value="<?php echo esc_attr( $format ); ?>" <?php checked( $post_format, $format ); ?> /> <label for="post-format-<?php echo esc_attr( $format ); ?>"><?php echo esc_html( get_post_format_string( $format ) ); ?></label>
    260         <?php endforeach; ?><br />
    261     </div>
    262     <?php endif; endif;
    263234}
    264235
     
    286257    <div class="nojs-tags hide-if-js">
    287258    <p><?php echo $taxonomy->labels->add_or_remove_items; ?></p>
    288     <textarea name="<?php echo "tax_input[$tax_name]"; ?>" rows="3" cols="20" class="the-tags" id="tax-input-<?php echo $tax_name; ?>" <?php echo $disabled; ?>><?php echo get_terms_to_edit( $post->ID, $tax_name ); // textarea_escaped by esc_attr() ?></textarea></div>
     259    <textarea name="<?php echo "tax_input[$tax_name]"; ?>" rows="3" cols="20" class="the-tags" id="tax-input-<?php echo $tax_name; ?>" <?php echo $disabled; ?>><?php echo esc_attr(get_terms_to_edit( $post->ID, $tax_name )); ?></textarea></div>
    289260    <?php if ( current_user_can($taxonomy->cap->assign_terms) ) : ?>
    290261    <div class="ajaxtag hide-if-no-js">
     
    301272<?php if ( current_user_can($taxonomy->cap->assign_terms) ) : ?>
    302273<p class="hide-if-no-js"><a href="#titlediv" class="tagcloud-link" id="link-<?php echo $tax_name; ?>"><?php echo $taxonomy->labels->choose_from_most_used; ?></a></p>
     274<?php else : ?>
     275<p><em><?php _e('You cannot modify this taxonomy.'); ?></em></p>
    303276<?php endif; ?>
    304277<?php
     
    344317            </ul>
    345318        </div>
     319    <?php if ( !current_user_can($tax->cap->assign_terms) ) : ?>
     320    <p><em><?php _e('You cannot modify this taxonomy.'); ?></em></p>
     321    <?php endif; ?>
    346322    <?php if ( current_user_can($tax->cap->edit_terms) ) : ?>
    347323            <div id="<?php echo $taxonomy; ?>-adder" class="wp-hidden-children">
     
    381357function post_excerpt_meta_box($post) {
    382358?>
    383 <label class="screen-reader-text" for="excerpt"><?php _e('Excerpt') ?></label><textarea rows="1" cols="40" name="excerpt" tabindex="6" id="excerpt"><?php echo $post->post_excerpt; // textarea_escaped ?></textarea>
     359<label class="screen-reader-text" for="excerpt"><?php _e('Excerpt') ?></label><textarea rows="1" cols="40" name="excerpt" tabindex="6" id="excerpt"><?php echo $post->post_excerpt ?></textarea>
    384360<p><?php _e('Excerpts are optional hand-crafted summaries of your content that can be used in your theme. <a href="http://codex.wordpress.org/Excerpt" target="_blank">Learn more about manual excerpts.</a>'); ?></p>
    385361<?php
     
    448424    <label for="comment_status" class="selectit"><input name="comment_status" type="checkbox" id="comment_status" value="open" <?php checked($post->comment_status, 'open'); ?> /> <?php _e( 'Allow comments.' ) ?></label><br />
    449425    <label for="ping_status" class="selectit"><input name="ping_status" type="checkbox" id="ping_status" value="open" <?php checked($post->ping_status, 'open'); ?> /> <?php printf( __( 'Allow <a href="%s" target="_blank">trackbacks and pingbacks</a> on this page.' ), __( 'http://codex.wordpress.org/Introduction_to_Blogging#Managing_Comments' ) ); ?></label>
    450     <?php do_action('post_comment_status_meta_box-options', $post); ?>
    451426</p>
    452427<?php
     
    458433 * @since 3.0.0
    459434 *
    460  * @param array $result table header rows
    461  * @return array
     435 * @param $result table header rows
     436 * @return
    462437 */
    463438function post_comment_meta_box_thead($result) {
     
    484459
    485460    wp_nonce_field( 'get-comments', 'add_comment_nonce', false );
    486 
    487     $wp_list_table = _get_list_table('WP_Post_Comments_List_Table');
    488     $wp_list_table->display( true );
    489 ?>
     461    add_filter('manage_edit-comments_columns', 'post_comment_meta_box_thead', 8, 1);
     462?>
     463
     464<table class="widefat comments-box fixed" cellspacing="0" style="display:none;">
     465<thead><tr>
     466    <?php print_column_headers('edit-comments'); ?>
     467</tr></thead>
     468<tbody id="the-comment-list" class="list:comment"></tbody>
     469</table>
    490470<p class="hide-if-no-js"><a href="#commentstatusdiv" id="show-comments" onclick="commentsBox.get(<?php echo $total; ?>);return false;"><?php _e('Show comments'); ?></a> <img class="waiting" style="display:none;" src="<?php echo esc_url( admin_url( 'images/wpspin_light.gif' ) ); ?>" alt="" /></p>
    491471<?php
     
    495475<?php
    496476    }
     477    remove_filter('manage_edit-comments_columns', 'post_comment_meta_box_thead');
    497478    wp_comment_trashnotice();
    498479}
     
    522503function post_author_meta_box($post) {
    523504    global $user_ID;
    524 ?>
    525 <label class="screen-reader-text" for="post_author_override"><?php _e('Author'); ?></label>
    526 <?php
    527     wp_dropdown_users( array(
    528         'who' => 'authors',
    529         'name' => 'post_author_override',
    530         'selected' => empty($post->ID) ? $user_ID : $post->post_author,
    531         'include_selected' => true
    532     ) );
     505    $authors = get_editable_user_ids( get_current_user_id(), true, $post->post_type ); // TODO: ROLE SYSTEM
     506    if ( $post->post_author && !in_array($post->post_author, $authors) )
     507        $authors[] = $post->post_author;
     508?>
     509<label class="screen-reader-text" for="post_author_override"><?php _e('Author'); ?></label><?php wp_dropdown_users( array('include' => $authors, 'name' => 'post_author_override', 'selected' => empty($post->ID) ? $user_ID : $post->post_author) ); ?>
     510<?php
    533511}
    534512
     
    601579<?php // Hidden submit button early on so that the browser chooses the right button when form is submitted with Return key ?>
    602580<div style="display:none;">
    603 <?php submit_button( __( 'Save' ), 'button', 'save', false ); ?>
     581<input type="submit" name="save" value="<?php esc_attr_e('Save'); ?>" />
    604582</div>
    605583
     
    885863    <tr class="form-field">
    886864        <th valign="top"  scope="row"><label for="link_notes"><?php _e('Notes') ?></label></th>
    887         <td><textarea name="link_notes" id="link_notes" cols="50" rows="10" style="width: 95%"><?php echo ( isset( $link->link_notes ) ? $link->link_notes : ''); // textarea_escaped ?></textarea></td>
     865        <td><textarea name="link_notes" id="link_notes" cols="50" rows="10" style="width: 95%"><?php echo  ( isset( $link->link_notes ) ? $link->link_notes : ''); ?></textarea></td>
    888866    </tr>
    889867    <tr class="form-field">
Note: See TracChangeset for help on using the changeset viewer.