mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 22:30:04 +00:00
jquery for list manipulation. Round one, fight. Props mdawaffe. fixes #4805
git-svn-id: https://develop.svn.wordpress.org/trunk@6213 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -102,7 +102,7 @@ if ('view' == $mode) {
|
||||
$offset = $offset + 1;
|
||||
$start = " start='$offset'";
|
||||
|
||||
echo "<ol id='the-comment-list' class='commentlist' $start>\n";
|
||||
echo "<ol id='the-comment-list' class='list:comment commentlist' $start>\n";
|
||||
$i = 0;
|
||||
foreach ( $comments as $comment ) {
|
||||
get_comment( $comment ); // Cache it
|
||||
@@ -112,14 +112,18 @@ if ('view' == $mode) {
|
||||
|
||||
if ( $extra_comments ) : ?>
|
||||
<div id="extra-comments" style="display:none">
|
||||
<ul id="the-extra-comment-list" class="commentlist">
|
||||
<ol id="the-extra-comment-list" class="list:comment commentlist" style="color:red">
|
||||
<?php
|
||||
foreach ( $extra_comments as $comment ) {
|
||||
get_comment( $comment ); // Cache it
|
||||
_wp_comment_list_item( $comment->comment_ID, ++$i );
|
||||
_wp_comment_list_item( $comment->comment_ID, 0 );
|
||||
}
|
||||
?>
|
||||
</ul>
|
||||
</ol>
|
||||
<form action="" method="get" id="get-extra-comments" class="add:the-extra-comment-list:">
|
||||
<input type="hidden" name="page" value="<?php echo $page; ?>" />
|
||||
<input type="hidden" name="s" value="<?php echo attribute_escape(@$_GET['s']); ?>" />
|
||||
<?php wp_nonce_field( 'add-comment', '_ajax_nonce', false ); ?>
|
||||
</div>
|
||||
<?php endif; // $extra_comments ?>
|
||||
|
||||
@@ -149,7 +153,8 @@ if ( $extra_comments ) : ?>
|
||||
<th scope="col">' . __('Comment Excerpt') . '</th>
|
||||
<th scope="col" colspan="3" style="text-align: center">' . __('Actions') . '</th>
|
||||
</tr>
|
||||
</thead>';
|
||||
</thead>
|
||||
<tbody id="the-comment-list" class="list:comment">';
|
||||
foreach ($comments as $comment) {
|
||||
$post = get_post($comment->comment_post_ID);
|
||||
$authordata = get_userdata($post->post_author);
|
||||
@@ -159,7 +164,7 @@ if ( $extra_comments ) : ?>
|
||||
?>
|
||||
<tr id="comment-<?php echo $comment->comment_ID; ?>" class='<?php echo $class; ?>'>
|
||||
<td style="text-align: center"><?php if ( current_user_can('edit_post', $comment->comment_post_ID) ) { ?><input type="checkbox" name="delete_comments[]" value="<?php echo $comment->comment_ID; ?>" /><?php } ?></td>
|
||||
<td><?php comment_author_link() ?></td>
|
||||
<td class="comment-author"><?php comment_author_link() ?></td>
|
||||
<td><?php comment_author_email_link() ?></td>
|
||||
<td><a href="edit-comments.php?s=<?php comment_author_IP() ?>&mode=edit"><?php comment_author_IP() ?></a></td>
|
||||
<td><?php comment_excerpt(); ?></td>
|
||||
@@ -173,12 +178,14 @@ if ( $extra_comments ) : ?>
|
||||
<td><?php if ( current_user_can('edit_post', $comment->comment_post_ID) ) {
|
||||
echo "<a href='comment.php?action=editcomment&c=$comment->comment_ID' class='edit'>" . __('Edit') . "</a>"; } ?></td>
|
||||
<td><?php if ( current_user_can('edit_post', $comment->comment_post_ID) ) {
|
||||
echo "<a href=\"comment.php?action=deletecomment&p=".$comment->comment_post_ID."&c=".$comment->comment_ID."\" onclick=\"return deleteSomething( 'comment', $comment->comment_ID, '" . js_escape(sprintf(__("You are about to delete this comment by '%s'. \n 'Cancel' to stop, 'OK' to delete."), $comment->comment_author )) . "', theCommentList );\" class='delete'>" . __('Delete') . "</a> ";
|
||||
$url = clean_url( wp_nonce_url( "comment.php?action=deletecomment&p=$comment->comment_post_ID&c=$comment->comment_ID", "delete-comment_$comment->comment_ID" ) );
|
||||
echo "<a href='$url' class='delete:the-comment-list:comment-$comment->comment_ID delete'>" . __('Delete') . "</a> ";
|
||||
} ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
} // end foreach
|
||||
?></table>
|
||||
?></tbody>
|
||||
</table>
|
||||
<p class="submit"><input type="submit" name="delete_button" class="delete" value="<?php _e('Delete Checked Comments »') ?>" onclick="var numchecked = getNumChecked(document.getElementById('deletecomments')); if(numchecked < 1) { alert('<?php echo js_escape(__("Please select some comments to delete")); ?>'); return false } return confirm('<?php echo sprintf(js_escape(__("You are about to delete %s comments permanently \n 'Cancel' to stop, 'OK' to delete.")), "' + numchecked + '"); ?>')" />
|
||||
<input type="submit" name="spam_button" value="<?php _e('Mark Checked Comments as Spam »') ?>" onclick="var numchecked = getNumChecked(document.getElementById('deletecomments')); if(numchecked < 1) { alert('<?php echo js_escape(__("Please select some comments to mark as spam")); ?>'); return false } return confirm('<?php echo sprintf(js_escape(__("You are about to mark %s comments as spam \n 'Cancel' to stop, 'OK' to mark as spam.")), "' + numchecked + '"); ?>')" /></p>
|
||||
</form>
|
||||
|
||||
Reference in New Issue
Block a user