Make WordPress Core


Ignore:
Timestamp:
10/09/2007 10:49:42 PM (17 years ago)
Author:
ryan
Message:

jquery for list manipulation. Round one, fight. Props mdawaffe. fixes #4805

File:
1 edited

Legend:

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

    r6026 r6213  
    103103        $start = " start='$offset'";
    104104
    105         echo "<ol id='the-comment-list' class='commentlist' $start>\n";
     105        echo "<ol id='the-comment-list' class='list:comment commentlist' $start>\n";
    106106        $i = 0;
    107107        foreach ( $comments as $comment ) {
     
    113113if ( $extra_comments ) : ?>
    114114<div id="extra-comments" style="display:none">
    115 <ul id="the-extra-comment-list" class="commentlist">
     115<ol id="the-extra-comment-list" class="list:comment commentlist" style="color:red">
    116116<?php
    117117    foreach ( $extra_comments as $comment ) {
    118118        get_comment( $comment ); // Cache it
    119         _wp_comment_list_item( $comment->comment_ID, ++$i );
    120     }
    121 ?>
    122 </ul>
     119        _wp_comment_list_item( $comment->comment_ID, 0 );
     120    }
     121?>
     122</ol>
     123<form action="" method="get" id="get-extra-comments" class="add:the-extra-comment-list:">
     124<input type="hidden" name="page" value="<?php echo $page; ?>" />
     125<input type="hidden" name="s" value="<?php echo attribute_escape(@$_GET['s']); ?>" />
     126<?php wp_nonce_field( 'add-comment', '_ajax_nonce', false ); ?>
    123127</div>
    124128<?php endif; // $extra_comments ?>
     
    150154    <th scope="col" colspan="3" style="text-align: center">' .  __('Actions') . '</th>
    151155  </tr>
    152 </thead>';
     156</thead>
     157<tbody id="the-comment-list" class="list:comment">';
    153158        foreach ($comments as $comment) {
    154159        $post = get_post($comment->comment_post_ID);
     
    160165  <tr id="comment-<?php echo $comment->comment_ID; ?>" class='<?php echo $class; ?>'>
    161166    <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>
    162     <td><?php comment_author_link() ?></td>
     167    <td class="comment-author"><?php comment_author_link() ?></td>
    163168    <td><?php comment_author_email_link() ?></td>
    164169    <td><a href="edit-comments.php?s=<?php comment_author_IP() ?>&amp;mode=edit"><?php comment_author_IP() ?></a></td>
     
    174179    echo "<a href='comment.php?action=editcomment&amp;c=$comment->comment_ID' class='edit'>" .  __('Edit') . "</a>"; } ?></td>
    175180    <td><?php if ( current_user_can('edit_post', $comment->comment_post_ID) ) {
    176         echo "<a href=\"comment.php?action=deletecomment&amp;p=".$comment->comment_post_ID."&amp;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> ";
     181        $url = clean_url( wp_nonce_url( "comment.php?action=deletecomment&p=$comment->comment_post_ID&c=$comment->comment_ID", "delete-comment_$comment->comment_ID" ) );
     182        echo "<a href='$url' class='delete:the-comment-list:comment-$comment->comment_ID delete'>" . __('Delete') . "</a> ";
    177183        } ?></td>
    178184  </tr>
    179185        <?php
    180186        } // end foreach
    181     ?></table>
     187    ?></tbody>
     188</table>
    182189<p class="submit"><input type="submit" name="delete_button" class="delete" value="<?php _e('Delete Checked Comments &raquo;') ?>" 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 + '"); ?>')" />
    183190            <input type="submit" name="spam_button" value="<?php _e('Mark Checked Comments as Spam &raquo;') ?>" 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>
Note: See TracChangeset for help on using the changeset viewer.