Make WordPress Core


Ignore:
Timestamp:
08/24/2008 06:56:22 AM (17 years ago)
Author:
azaozz
Message:

Reply to comments from admin, first run, see #7435

File:
1 edited

Legend:

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

    r8715 r8720  
    800800
    801801    if ( current_user_can('edit_post', $comment->comment_post_ID) ) {
    802         $actions['approve']   = "<a href='$approve_url' class='dim:the-comment-list:comment-$comment->comment_ID:unapproved:e7e7d3:e7e7d3:new=approved' title='" . __( 'Approve this comment' ) . "'>" . __( 'Approve' ) . '</a> | ';
    803         $actions['unapprove'] = "<a href='$unapprove_url' class='dim:the-comment-list:comment-$comment->comment_ID:unapproved:e7e7d3:e7e7d3:new=unapproved' title='" . __( 'Unapprove this comment' ) . "'>" . __( 'Unapprove' ) . '</a> | ';
     802        $actions['approve']   = "<a href='$approve_url' class='dim:the-comment-list:comment-$comment->comment_ID:unapproved:e7e7d3:e7e7d3:new=approved' title='" . __( 'Approve this comment' ) . "'>" . __( 'Approve' ) . "</a> | ";
     803        $actions['unapprove'] = "<a href='$unapprove_url' class='dim:the-comment-list:comment-$comment->comment_ID:unapproved:e7e7d3:e7e7d3:new=unapproved' title='" . __( 'Unapprove this comment' ) . "'>" . __( 'Unapprove' ) . "</a> | ";
    804804        $actions['edit']      = "<a href='comment.php?action=editcomment&amp;c={$comment->comment_ID}' title='" . __('Edit comment') . "'>". __('Edit') . '</a> | ';
    805         $actions['flag']      = "<a href='#' class='no-crazy'>Flag for Follow-up</a> | ";
    806         $actions['spam']      = "<a href='$spam_url' class='delete:the-comment-list:comment-$comment->comment_ID::spam=1' title='" . __( 'Mark this comment as spam' ) . "'>" . __( 'Spam' ) . '</a> | ';
     805        if ( 'spam' != $the_comment_status )
     806            $actions['spam']      = "<a href='$spam_url' class='delete:the-comment-list:comment-$comment->comment_ID::spam=1' title='" . __( 'Mark this comment as spam' ) . "'>" . __( 'Spam' ) . '</a> | ';
    807807        $actions['delete']    = "<a href='$delete_url' class='delete:the-comment-list:comment-$comment->comment_ID delete'>" . __('Delete') . '</a>';
    808808
     
    817817        }
    818818
    819         if ( 'spam' == $the_comment_status )
    820             unset($actions['spam']);
     819        if ( 'spam' != $the_comment_status )
     820            $actions['reply'] = ' | <a onclick="commentReply.open(\''.$comment->comment_ID.'\',\''.$post->ID.'\',this);return false;" title="'.__('Reply to this comment').'" href="#">' . __('Reply') . '</a>';
    821821
    822822        $actions = apply_filters( 'comment_row_actions', $actions, $comment );
    823823
    824824        foreach ( $actions as $action => $link )
    825             echo "<span class='$action'>$link</span>";
     825            echo "<span class='$action'>$link</span>\n";
    826826    }
    827827    ?>
     
    842842<?php if ( 'single' !== $mode ) : ?>
    843843    <td class="response-column">
    844     "<?php echo $post_link ?>" <?php echo sprintf('(%s comments)', $post->comment_count); ?><br/>
     844    "<?php echo $post_link ?>" <?php echo sprintf('(%s comments)', $post->comment_count); ?><br />
    845845    <?php echo get_the_time(__('Y/m/d \a\t g:ia')); ?>
    846846    </td>
     
    848848  </tr>
    849849    <?php
     850}
     851
     852function wp_comment_reply($position = '1', $checkbox = false, $mode = 'single') {
     853    global $current_user;
     854
     855    // allow plugin to replace the popup content
     856    $content = apply_filters( 'wp_comment_reply', '' );
     857   
     858    if ( ! empty($content) ) {
     859        echo $content;
     860        return;
     861    }
     862?>
     863    <div id="replyerror" style="display:none;">
     864    <img src="images/logo.gif" />
     865    <h3 class="info-box-title"><?php _e('Comment Reply Error'); ?></h3>
     866    <p id="replyerrtext"></p>
     867    <p class="submit"><button id="close-button" onclick="commentReply.close();" class="button"><?php _e('Close'); ?></button></p>
     868    </div>
     869   
     870    <div id="replydiv" style="display:none;">
     871    <p id="replyhandle"><?php _e('Reply'); ?></p>
     872    <form action="" method="post" id="replyform">
     873    <input type="hidden" name="user_ID" id="user_ID" value="<?php echo $current_user->ID; ?>" />
     874    <input type="hidden" name="action" value="replyto-comment" />
     875    <input type="hidden" name="comment_ID" id="comment_ID" value="" />
     876    <input type="hidden" name="comment_post_ID" id="comment_post_ID" value="" />
     877    <input type="hidden" name="position" id="position" value="<?php echo $position; ?>" />
     878    <input type="hidden" name="checkbox" id="checkbox" value="<?php echo $checkbox ? 1 : 0; ?>" />
     879    <input type="hidden" name="mode" id="mode" value="<?php echo $mode; ?>" />
     880    <?php wp_nonce_field( 'replyto-comment', '_ajax_nonce', false ); ?>
     881    <?php wp_comment_form_unfiltered_html_nonce(); ?>
     882
     883    <div id="replycontainer"><textarea rows="5" cols="50" name="replycontent" tabindex="10" id="replycontent"></textarea></div>
     884
     885    <p id="replysubmit"><input type="button" onclick="commentReply.close();" class="button" value="<?php _e('Cancel'); ?>" />
     886    <input type="button" onclick="commentReply.send();" class="button" value="<?php _e('Submit Reply'); ?>" /></p>
     887    </form>
     888    </div>
     889<?php
    850890}
    851891
Note: See TracChangeset for help on using the changeset viewer.