Make WordPress Core


Ignore:
Timestamp:
10/08/2008 01:18:16 AM (16 years ago)
Author:
azaozz
Message:

Convert the comment reply popup to a temp table row for consistency, add Quick Edit for comments, see #7435

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/template.php

    r9083 r9098  
    192192 *
    193193 * @since 2.7
    194  * 
     194 *
    195195 * Outputs the HTML for the hidden table rows used in Categories, Link Caregories and Tags quick edit.
    196196 *
    197197 * @param string $type "tag", "category" or "link-category"
    198  * @return 
     198 * @return
    199199 */
    200200function inline_edit_term_row($type) {
     
    260260        <a accesskey="c" href="#inline-edit" title="<?php _e('Cancel'); ?>" class="button-secondary cancel"><?php _e('Cancel'); ?></a>
    261261        <a accesskey="s" href="#inline-edit" title="<?php _e('Save'); ?>" class="button-secondary save"><?php _e('Save'); ?></a>
    262         <span class="hidden error"></span>
     262        <img class="waiting" style="display:none;" src="images/loading.gif" alt="" />
     263        <span class="error" style="display:none;"></span>
    263264        <?php wp_nonce_field( 'taxinlineeditnonce', '_inline_edit', false ); ?>
    264265    </div>
     
    893894 * {@internal Missing Short Description}}
    894895 *
    895  * Outputs the quick edit and bulk edit table rows
    896  * 
     896 * Outputs the quick edit and bulk edit table rows for posts and pages
     897 *
    897898 * @since 2.7
    898899 *
     
    11301131        <a accesskey="c" href="#inline-edit" title="<?php _e('Cancel'); ?>" class="button-secondary cancel"><?php _e('Cancel'); ?></a>
    11311132        <a accesskey="s" href="#inline-edit" title="<?php _e('Save'); ?>" class="button-secondary save"><?php _e('Save'); ?></a>
    1132         <?php if ( ! $bulk ) wp_nonce_field( 'inlineeditnonce', '_inline_edit', false ); ?>
     1133        <?php if ( ! $bulk ) {
     1134            wp_nonce_field( 'inlineeditnonce', '_inline_edit', false ); ?>
     1135            <img class="waiting" style="display:none;" src="images/loading.gif" alt="" />
     1136        <?php } ?>
    11331137        <input type="hidden" name="post_view" value="<?php echo $m; ?>" />
    11341138    </div>
     
    11411145}
    11421146
    1143 // adds hidden fields with the data for use in the inline editor
     1147// adds hidden fields with the data for use in the inline editor for posts and pages
    11441148/**
    11451149 * {@internal Missing Short Description}}
     
    19701974            case 'comment':
    19711975                echo "<td $attributes>";
    1972                 if ( 'detail' == $mode || 'single' == $mode ) comment_text();
    1973 
     1976                if ( 'detail' == $mode || 'single' == $mode ) comment_text(); ?>
     1977                <div id="inline-<?php echo $comment->comment_ID; ?>" class="hidden">
     1978                <textarea class="comment"><?php echo $comment->comment_content; ?></textarea>
     1979                <div class="author-email"><?php echo attribute_escape( $comment->comment_author_email ); ?></div>
     1980                <div class="author"><?php echo attribute_escape( $comment->comment_author ); ?></div>
     1981                <div class="author-url"><?php echo attribute_escape( $comment->comment_author_url ); ?></div>
     1982                <div class="comment_status"><?php echo $comment->comment_approved; ?></div>
     1983                </div>
     1984                <?php
    19741985                $actions = array();
    19751986
     
    19902001                    $actions['delete'] = "<a href='$delete_url' class='delete:the-comment-list:comment-$comment->comment_ID delete vim-d vim-destructive'>" . __('Delete') . '</a>';
    19912002                    $actions['edit'] = "<a href='comment.php?action=editcomment&amp;c={$comment->comment_ID}' title='" . __('Edit comment') . "'>". __('Edit') . '</a>';
     2003                    $actions['quickedit'] = '<a onclick="commentReply.open(\''.$comment->comment_ID.'\',\''.$post->ID.'\',\'edit\');return false;" class="vim-q" title="'.__('Quick Edit').'" href="#">' . __('Quick Edit') . '</a>';
    19922004                    if ( 'spam' != $the_comment_status )
    1993                         $actions['reply'] = '<a onclick="commentReply.open(\''.$comment->comment_ID.'\',\''.$post->ID.'\',this);return false;" class="vim-r" title="'.__('Reply to this comment').'" href="#">' . __('Reply') . '</a>';
     2005                        $actions['reply'] = '<a onclick="commentReply.open(\''.$comment->comment_ID.'\',\''.$post->ID.'\');return false;" class="vim-r" title="'.__('Reply to this comment').'" href="#">' . __('Reply') . '</a>';
    19942006
    19952007                    $actions = apply_filters( 'comment_row_actions', $actions, $comment );
    19962008
    1997                     $action_count = count($actions);
    19982009                    $i = 0;
    19992010                    foreach ( $actions as $action => $link ) {
    20002011                        ++$i;
    2001                         ( $i == $action_count ) ? $sep = '' : $sep = ' | ';
    2002                         // The action before reply shouldn't output a sep
    2003                         if ( 'edit' == $action )
    2004                             $sep = '';
    2005                         // Reply needs a hide-if-no-js span
    2006                         if ( 'reply' == $action )
    2007                             echo "<span class='$action'><span class='hide-if-no-js'> | $link</span>$sep</span>";
    2008                         else
    2009                             echo "<span class='$action'>$link$sep</span>";
     2012                        ( ( ('approve' == $action || 'unapprove' == $action) && 2 === $i ) || 1 === $i ) ? $sep = '' : $sep = ' | ';
     2013
     2014                        // Reply and quickedit need a hide-if-no-js span
     2015                        if ( 'reply' == $action || 'quickedit' == $action )
     2016                            $action .= ' hide-if-no-js';
     2017
     2018                        echo "<span class='$action'>$sep$link</span>";
    20102019                    }
    20112020                }
     
    20542063
    20552064    // allow plugin to replace the popup content
    2056     $content = apply_filters( 'wp_comment_reply', '', array('position'=>$position, 'checkbox'=>$checkbox, 'mode'=>$mode) );
     2065    $content = apply_filters( 'wp_comment_reply', '', array('position' => $position, 'checkbox' => $checkbox, 'mode' => $mode) );
    20572066
    20582067    if ( ! empty($content) ) {
     
    20612070    }
    20622071?>
    2063     <div id="replyerror" style="display:none;">
    2064     <img src="images/logo.gif" />
    2065     <h3 class="info-box-title"><?php _e('Comment Reply Error'); ?></h3>
    2066     <p id="replyerrtext"></p>
    2067     <p class="submit"><button id="close-button" onclick="commentReply.close();" class="button"><?php _e('Close'); ?></button>
    2068     <button id="back-button" onclick="commentReply.back();" class="button"><?php _e('Go back'); ?></button></p>
     2072<form method="get" action=""><table style="display:none;"><tbody id="com-reply">
     2073    <tr id="replyrow"><td colspan="6">
     2074    <div id="replyhead" style="display:none;"><?php _e('Reply to Comment'); ?></div>
     2075
     2076    <div id="edithead" style="display:none;">
     2077        <div id="edittitle"><?php _e('Edit Comment'); ?></div>
     2078
     2079        <div class="inside">
     2080        <label for="author"><?php _e('Name') ?></label>
     2081        <input type="text" name="newcomment_author" size="50" value="" tabindex="101" id="author" />
     2082        </div>
     2083
     2084        <div class="inside">
     2085        <label for="author-email"><?php _e('E-mail') ?></label>
     2086        <input type="text" name="newcomment_author_email" size="50" value="" tabindex="102" id="author-email" />
     2087        </div>
     2088
     2089        <div class="inside">
     2090        <label for="author-url"><?php _e('URL') ?></label>
     2091        <input type="text" id="author-url" name="newcomment_author_url" size="103" value="" tabindex="103" />
     2092        </div>
     2093        <div style="clear:both;"></div>
    20692094    </div>
    20702095
    2071     <div id="replydiv" style="display:none;">
    2072     <p id="replyhandle"><?php _e('Reply'); ?></p>
    2073     <form action="" method="post" id="replyform">
     2096    <div id="replycontainer"><textarea rows="8" cols="40" name="replycontent" tabindex="104" id="replycontent"></textarea></div>
     2097
     2098    <p id="replysubmit">
     2099    <a href="#comments-form" class="cancel button" tabindex="106"><?php _e('Cancel'); ?></a>
     2100    <a href="#comments-form" class="save button" tabindex="105">
     2101    <span id="savebtn" style="display:none;"><?php _e('Save'); ?></span>
     2102    <span id="replybtn" style="display:none;"><?php _e('Submit Reply'); ?></span></a>
     2103    <img class="waiting" style="display:none;" src="images/loading.gif" alt="" />
     2104    <span class="error" style="display:none;"></span>
     2105    </p>
     2106
    20742107    <input type="hidden" name="user_ID" id="user_ID" value="<?php echo $current_user->ID; ?>" />
    2075     <input type="hidden" name="action" value="replyto-comment" />
     2108    <input type="hidden" name="action" id="action" value="" />
    20762109    <input type="hidden" name="comment_ID" id="comment_ID" value="" />
    20772110    <input type="hidden" name="comment_post_ID" id="comment_post_ID" value="" />
     2111    <input type="hidden" name="status" id="status" value="" />
    20782112    <input type="hidden" name="position" id="position" value="<?php echo $position; ?>" />
    20792113    <input type="hidden" name="checkbox" id="checkbox" value="<?php echo $checkbox ? 1 : 0; ?>" />
     
    20812115    <?php wp_nonce_field( 'replyto-comment', '_ajax_nonce', false ); ?>
    20822116    <?php wp_comment_form_unfiltered_html_nonce(); ?>
    2083 
    2084     <?php echo apply_filters( 'wp_comment_reply_content', '
    2085     <div id="replycontainer"><textarea rows="5" cols="40" name="replycontent" tabindex="1000" id="replycontent"></textarea></div>
    2086     '); ?>
    2087 
    2088     <p id="replysubmit"><input type="button" onclick="commentReply.close();" class="button" tabindex="1002" value="<?php _e('Cancel'); ?>" />
    2089     <input type="button" onclick="commentReply.send();" class="button" tabindex="1001" value="<?php _e('Submit Reply'); ?>" /></p>
    2090     </form>
    2091     </div>
     2117    </td></tr>
     2118</tbody></table></form>
    20922119<?php
    20932120}
     
    29873014/**
    29883015 * Display the post password.
    2989  * 
     3016 *
    29903017 * The password is passed through {@link attribute_escape()} to ensure that it
    29913018 * is safe for placing in an html attribute.
     
    30243051/**
    30253052 * Get the post title.
    3026  * 
     3053 *
    30273054 * The post title is fetched and if it is blank then a default string is
    30283055 * returned.
     
    30303057 * @since 2.7.0
    30313058 * @param int $id The post id. If not supplied the global $post is used.
    3032  * 
     3059 *
    30333060 */
    30343061function _draft_or_post_title($post_id = 0)
     
    30423069/**
    30433070 * Display the search query.
    3044  * 
     3071 *
    30453072 * A simple wrapper to display the "s" parameter in a GET URI. This function
    30463073 * should only be used when {@link the_search_query()} cannot.
     
    30483075 * @uses attribute_escape
    30493076 * @since 2.7.0
    3050  * 
     3077 *
    30513078 */
    30523079function _admin_search_query() {
Note: See TracChangeset for help on using the changeset viewer.