PageRenderTime 44ms CodeModel.GetById 13ms RepoModel.GetById 0ms app.codeStats 0ms

/wordpress3.4.2/wp-admin/includes/class-wp-comments-list-table.php

https://bitbucket.org/ch3tag/mothers
PHP | 558 lines | 416 code | 107 blank | 35 comment | 105 complexity | 18ea4a6b7d796b443c6f15b6ef9e351f MD5 | raw file
  1. <?php
  2. /**
  3. * Comments and Post Comments List Table classes.
  4. *
  5. * @package WordPress
  6. * @subpackage List_Table
  7. * @since 3.1.0
  8. */
  9. /**
  10. * Comments List Table class.
  11. *
  12. * @package WordPress
  13. * @subpackage List_Table
  14. * @since 3.1.0
  15. * @access private
  16. */
  17. class WP_Comments_List_Table extends WP_List_Table {
  18. var $checkbox = true;
  19. var $pending_count = array();
  20. function __construct() {
  21. global $post_id;
  22. $post_id = isset( $_REQUEST['p'] ) ? absint( $_REQUEST['p'] ) : 0;
  23. if ( get_option('show_avatars') )
  24. add_filter( 'comment_author', 'floated_admin_avatar' );
  25. parent::__construct( array(
  26. 'plural' => 'comments',
  27. 'singular' => 'comment',
  28. 'ajax' => true,
  29. ) );
  30. }
  31. function ajax_user_can() {
  32. return current_user_can('edit_posts');
  33. }
  34. function prepare_items() {
  35. global $post_id, $comment_status, $search, $comment_type;
  36. $comment_status = isset( $_REQUEST['comment_status'] ) ? $_REQUEST['comment_status'] : 'all';
  37. if ( !in_array( $comment_status, array( 'all', 'moderated', 'approved', 'spam', 'trash' ) ) )
  38. $comment_status = 'all';
  39. $comment_type = !empty( $_REQUEST['comment_type'] ) ? $_REQUEST['comment_type'] : '';
  40. $search = ( isset( $_REQUEST['s'] ) ) ? $_REQUEST['s'] : '';
  41. $user_id = ( isset( $_REQUEST['user_id'] ) ) ? $_REQUEST['user_id'] : '';
  42. $orderby = ( isset( $_REQUEST['orderby'] ) ) ? $_REQUEST['orderby'] : '';
  43. $order = ( isset( $_REQUEST['order'] ) ) ? $_REQUEST['order'] : '';
  44. $comments_per_page = $this->get_per_page( $comment_status );
  45. $doing_ajax = defined( 'DOING_AJAX' ) && DOING_AJAX;
  46. if ( isset( $_REQUEST['number'] ) ) {
  47. $number = (int) $_REQUEST['number'];
  48. }
  49. else {
  50. $number = $comments_per_page + min( 8, $comments_per_page ); // Grab a few extra
  51. }
  52. $page = $this->get_pagenum();
  53. if ( isset( $_REQUEST['start'] ) ) {
  54. $start = $_REQUEST['start'];
  55. } else {
  56. $start = ( $page - 1 ) * $comments_per_page;
  57. }
  58. if ( $doing_ajax && isset( $_REQUEST['offset'] ) ) {
  59. $start += $_REQUEST['offset'];
  60. }
  61. $status_map = array(
  62. 'moderated' => 'hold',
  63. 'approved' => 'approve'
  64. );
  65. $args = array(
  66. 'status' => isset( $status_map[$comment_status] ) ? $status_map[$comment_status] : $comment_status,
  67. 'search' => $search,
  68. 'user_id' => $user_id,
  69. 'offset' => $start,
  70. 'number' => $number,
  71. 'post_id' => $post_id,
  72. 'type' => $comment_type,
  73. 'orderby' => $orderby,
  74. 'order' => $order,
  75. );
  76. $_comments = get_comments( $args );
  77. update_comment_cache( $_comments );
  78. $this->items = array_slice( $_comments, 0, $comments_per_page );
  79. $this->extra_items = array_slice( $_comments, $comments_per_page );
  80. $total_comments = get_comments( array_merge( $args, array('count' => true, 'offset' => 0, 'number' => 0) ) );
  81. $_comment_post_ids = array();
  82. foreach ( $_comments as $_c ) {
  83. $_comment_post_ids[] = $_c->comment_post_ID;
  84. }
  85. $_comment_post_ids = array_unique( $_comment_post_ids );
  86. $this->pending_count = get_pending_comments_num( $_comment_post_ids );
  87. $this->set_pagination_args( array(
  88. 'total_items' => $total_comments,
  89. 'per_page' => $comments_per_page,
  90. ) );
  91. }
  92. function get_per_page( $comment_status = 'all' ) {
  93. $comments_per_page = $this->get_items_per_page( 'edit_comments_per_page' );
  94. $comments_per_page = apply_filters( 'comments_per_page', $comments_per_page, $comment_status );
  95. return $comments_per_page;
  96. }
  97. function no_items() {
  98. global $comment_status;
  99. if ( 'moderated' == $comment_status )
  100. _e( 'No comments awaiting moderation.' );
  101. else
  102. _e( 'No comments found.' );
  103. }
  104. function get_views() {
  105. global $post_id, $comment_status, $comment_type;
  106. $status_links = array();
  107. $num_comments = ( $post_id ) ? wp_count_comments( $post_id ) : wp_count_comments();
  108. //, number_format_i18n($num_comments->moderated) ), "<span class='comment-count'>" . number_format_i18n($num_comments->moderated) . "</span>"),
  109. //, number_format_i18n($num_comments->spam) ), "<span class='spam-comment-count'>" . number_format_i18n($num_comments->spam) . "</span>")
  110. $stati = array(
  111. 'all' => _nx_noop('All', 'All', 'comments'), // singular not used
  112. 'moderated' => _n_noop('Pending <span class="count">(<span class="pending-count">%s</span>)</span>', 'Pending <span class="count">(<span class="pending-count">%s</span>)</span>'),
  113. 'approved' => _n_noop('Approved', 'Approved'), // singular not used
  114. 'spam' => _n_noop('Spam <span class="count">(<span class="spam-count">%s</span>)</span>', 'Spam <span class="count">(<span class="spam-count">%s</span>)</span>'),
  115. 'trash' => _n_noop('Trash <span class="count">(<span class="trash-count">%s</span>)</span>', 'Trash <span class="count">(<span class="trash-count">%s</span>)</span>')
  116. );
  117. if ( !EMPTY_TRASH_DAYS )
  118. unset($stati['trash']);
  119. $link = 'edit-comments.php';
  120. if ( !empty($comment_type) && 'all' != $comment_type )
  121. $link = add_query_arg( 'comment_type', $comment_type, $link );
  122. foreach ( $stati as $status => $label ) {
  123. $class = ( $status == $comment_status ) ? ' class="current"' : '';
  124. if ( !isset( $num_comments->$status ) )
  125. $num_comments->$status = 10;
  126. $link = add_query_arg( 'comment_status', $status, $link );
  127. if ( $post_id )
  128. $link = add_query_arg( 'p', absint( $post_id ), $link );
  129. /*
  130. // I toyed with this, but decided against it. Leaving it in here in case anyone thinks it is a good idea. ~ Mark
  131. if ( !empty( $_REQUEST['s'] ) )
  132. $link = add_query_arg( 's', esc_attr( stripslashes( $_REQUEST['s'] ) ), $link );
  133. */
  134. $status_links[$status] = "<a href='$link'$class>" . sprintf(
  135. translate_nooped_plural( $label, $num_comments->$status ),
  136. number_format_i18n( $num_comments->$status )
  137. ) . '</a>';
  138. }
  139. $status_links = apply_filters( 'comment_status_links', $status_links );
  140. return $status_links;
  141. }
  142. function get_bulk_actions() {
  143. global $comment_status;
  144. $actions = array();
  145. if ( in_array( $comment_status, array( 'all', 'approved' ) ) )
  146. $actions['unapprove'] = __( 'Unapprove' );
  147. if ( in_array( $comment_status, array( 'all', 'moderated' ) ) )
  148. $actions['approve'] = __( 'Approve' );
  149. if ( in_array( $comment_status, array( 'all', 'moderated', 'approved' ) ) )
  150. $actions['spam'] = _x( 'Mark as Spam', 'comment' );
  151. if ( 'trash' == $comment_status )
  152. $actions['untrash'] = __( 'Restore' );
  153. elseif ( 'spam' == $comment_status )
  154. $actions['unspam'] = _x( 'Not Spam', 'comment' );
  155. if ( in_array( $comment_status, array( 'trash', 'spam' ) ) || !EMPTY_TRASH_DAYS )
  156. $actions['delete'] = __( 'Delete Permanently' );
  157. else
  158. $actions['trash'] = __( 'Move to Trash' );
  159. return $actions;
  160. }
  161. function extra_tablenav( $which ) {
  162. global $comment_status, $comment_type;
  163. ?>
  164. <div class="alignleft actions">
  165. <?php
  166. if ( 'top' == $which ) {
  167. ?>
  168. <select name="comment_type">
  169. <option value=""><?php _e( 'Show all comment types' ); ?></option>
  170. <?php
  171. $comment_types = apply_filters( 'admin_comment_types_dropdown', array(
  172. 'comment' => __( 'Comments' ),
  173. 'pings' => __( 'Pings' ),
  174. ) );
  175. foreach ( $comment_types as $type => $label )
  176. echo "\t<option value='" . esc_attr( $type ) . "'" . selected( $comment_type, $type, false ) . ">$label</option>\n";
  177. ?>
  178. </select>
  179. <?php
  180. submit_button( __( 'Filter' ), 'secondary', false, false, array( 'id' => 'post-query-submit' ) );
  181. }
  182. if ( ( 'spam' == $comment_status || 'trash' == $comment_status ) && current_user_can( 'moderate_comments' ) ) {
  183. wp_nonce_field( 'bulk-destroy', '_destroy_nonce' );
  184. $title = ( 'spam' == $comment_status ) ? esc_attr__( 'Empty Spam' ) : esc_attr__( 'Empty Trash' );
  185. submit_button( $title, 'button-secondary apply', 'delete_all', false );
  186. }
  187. do_action( 'manage_comments_nav', $comment_status );
  188. echo '</div>';
  189. }
  190. function current_action() {
  191. if ( isset( $_REQUEST['delete_all'] ) || isset( $_REQUEST['delete_all2'] ) )
  192. return 'delete_all';
  193. return parent::current_action();
  194. }
  195. function get_columns() {
  196. global $post_id;
  197. $columns = array();
  198. if ( $this->checkbox )
  199. $columns['cb'] = '<input type="checkbox" />';
  200. $columns['author'] = __( 'Author' );
  201. $columns['comment'] = _x( 'Comment', 'column name' );
  202. if ( !$post_id )
  203. $columns['response'] = _x( 'In Response To', 'column name' );
  204. return $columns;
  205. }
  206. function get_sortable_columns() {
  207. return array(
  208. 'author' => 'comment_author',
  209. 'response' => 'comment_post_ID'
  210. );
  211. }
  212. function display() {
  213. extract( $this->_args );
  214. wp_nonce_field( "fetch-list-" . get_class( $this ), '_ajax_fetch_list_nonce' );
  215. $this->display_tablenav( 'top' );
  216. ?>
  217. <table class="<?php echo implode( ' ', $this->get_table_classes() ); ?>" cellspacing="0">
  218. <thead>
  219. <tr>
  220. <?php $this->print_column_headers(); ?>
  221. </tr>
  222. </thead>
  223. <tfoot>
  224. <tr>
  225. <?php $this->print_column_headers( false ); ?>
  226. </tr>
  227. </tfoot>
  228. <tbody id="the-comment-list" class="list:comment">
  229. <?php $this->display_rows_or_placeholder(); ?>
  230. </tbody>
  231. <tbody id="the-extra-comment-list" class="list:comment" style="display: none;">
  232. <?php $this->items = $this->extra_items; $this->display_rows(); ?>
  233. </tbody>
  234. </table>
  235. <?php
  236. $this->display_tablenav( 'bottom' );
  237. }
  238. function single_row( $a_comment ) {
  239. global $post, $comment;
  240. $comment = $a_comment;
  241. $the_comment_class = join( ' ', get_comment_class( wp_get_comment_status( $comment->comment_ID ) ) );
  242. $post = get_post( $comment->comment_post_ID );
  243. $this->user_can = current_user_can( 'edit_comment', $comment->comment_ID );
  244. echo "<tr id='comment-$comment->comment_ID' class='$the_comment_class'>";
  245. echo $this->single_row_columns( $comment );
  246. echo "</tr>\n";
  247. }
  248. function column_cb( $comment ) {
  249. if ( $this->user_can )
  250. echo "<input type='checkbox' name='delete_comments[]' value='$comment->comment_ID' />";
  251. }
  252. function column_comment( $comment ) {
  253. global $post, $comment_status;
  254. $user_can = $this->user_can;
  255. $comment_url = esc_url( get_comment_link( $comment->comment_ID ) );
  256. $the_comment_status = wp_get_comment_status( $comment->comment_ID );
  257. $ptime = date( 'G', strtotime( $comment->comment_date ) );
  258. if ( ( abs( time() - $ptime ) ) < 86400 )
  259. $ptime = sprintf( __( '%s ago' ), human_time_diff( $ptime ) );
  260. else
  261. $ptime = mysql2date( __( 'Y/m/d \a\t g:i A' ), $comment->comment_date );
  262. if ( $user_can ) {
  263. $del_nonce = esc_html( '_wpnonce=' . wp_create_nonce( "delete-comment_$comment->comment_ID" ) );
  264. $approve_nonce = esc_html( '_wpnonce=' . wp_create_nonce( "approve-comment_$comment->comment_ID" ) );
  265. $url = "comment.php?c=$comment->comment_ID";
  266. $approve_url = esc_url( $url . "&action=approvecomment&$approve_nonce" );
  267. $unapprove_url = esc_url( $url . "&action=unapprovecomment&$approve_nonce" );
  268. $spam_url = esc_url( $url . "&action=spamcomment&$del_nonce" );
  269. $unspam_url = esc_url( $url . "&action=unspamcomment&$del_nonce" );
  270. $trash_url = esc_url( $url . "&action=trashcomment&$del_nonce" );
  271. $untrash_url = esc_url( $url . "&action=untrashcomment&$del_nonce" );
  272. $delete_url = esc_url( $url . "&action=deletecomment&$del_nonce" );
  273. }
  274. echo '<div class="submitted-on">';
  275. /* translators: 2: comment date, 3: comment time */
  276. printf( __( 'Submitted on <a href="%1$s">%2$s at %3$s</a>' ), $comment_url,
  277. /* translators: comment date format. See http://php.net/date */ get_comment_date( __( 'Y/m/d' ) ),
  278. /* translators: comment time format. See http://php.net/date */ get_comment_date( get_option( 'time_format' ) ) );
  279. if ( $comment->comment_parent ) {
  280. $parent = get_comment( $comment->comment_parent );
  281. $parent_link = esc_url( get_comment_link( $comment->comment_parent ) );
  282. $name = get_comment_author( $parent->comment_ID );
  283. printf( ' | '.__( 'In reply to <a href="%1$s">%2$s</a>.' ), $parent_link, $name );
  284. }
  285. echo '</div>';
  286. comment_text();
  287. if ( $user_can ) { ?>
  288. <div id="inline-<?php echo $comment->comment_ID; ?>" class="hidden">
  289. <textarea class="comment" rows="1" cols="1"><?php echo esc_textarea( apply_filters( 'comment_edit_pre', $comment->comment_content ) ); ?></textarea>
  290. <div class="author-email"><?php echo esc_attr( $comment->comment_author_email ); ?></div>
  291. <div class="author"><?php echo esc_attr( $comment->comment_author ); ?></div>
  292. <div class="author-url"><?php echo esc_attr( $comment->comment_author_url ); ?></div>
  293. <div class="comment_status"><?php echo $comment->comment_approved; ?></div>
  294. </div>
  295. <?php
  296. }
  297. if ( $user_can ) {
  298. // preorder it: Approve | Reply | Quick Edit | Edit | Spam | Trash
  299. $actions = array(
  300. 'approve' => '', 'unapprove' => '',
  301. 'reply' => '',
  302. 'quickedit' => '',
  303. 'edit' => '',
  304. 'spam' => '', 'unspam' => '',
  305. 'trash' => '', 'untrash' => '', 'delete' => ''
  306. );
  307. if ( $comment_status && 'all' != $comment_status ) { // not looking at all comments
  308. if ( 'approved' == $the_comment_status )
  309. $actions['unapprove'] = "<a href='$unapprove_url' class='delete:the-comment-list:comment-$comment->comment_ID:e7e7d3:action=dim-comment&amp;new=unapproved vim-u vim-destructive' title='" . esc_attr__( 'Unapprove this comment' ) . "'>" . __( 'Unapprove' ) . '</a>';
  310. else if ( 'unapproved' == $the_comment_status )
  311. $actions['approve'] = "<a href='$approve_url' class='delete:the-comment-list:comment-$comment->comment_ID:e7e7d3:action=dim-comment&amp;new=approved vim-a vim-destructive' title='" . esc_attr__( 'Approve this comment' ) . "'>" . __( 'Approve' ) . '</a>';
  312. } else {
  313. $actions['approve'] = "<a href='$approve_url' class='dim:the-comment-list:comment-$comment->comment_ID:unapproved:e7e7d3:e7e7d3:new=approved vim-a' title='" . esc_attr__( 'Approve this comment' ) . "'>" . __( 'Approve' ) . '</a>';
  314. $actions['unapprove'] = "<a href='$unapprove_url' class='dim:the-comment-list:comment-$comment->comment_ID:unapproved:e7e7d3:e7e7d3:new=unapproved vim-u' title='" . esc_attr__( 'Unapprove this comment' ) . "'>" . __( 'Unapprove' ) . '</a>';
  315. }
  316. if ( 'spam' != $the_comment_status && 'trash' != $the_comment_status ) {
  317. $actions['spam'] = "<a href='$spam_url' class='delete:the-comment-list:comment-$comment->comment_ID::spam=1 vim-s vim-destructive' title='" . esc_attr__( 'Mark this comment as spam' ) . "'>" . /* translators: mark as spam link */ _x( 'Spam', 'verb' ) . '</a>';
  318. } elseif ( 'spam' == $the_comment_status ) {
  319. $actions['unspam'] = "<a href='$unspam_url' class='delete:the-comment-list:comment-$comment->comment_ID:66cc66:unspam=1 vim-z vim-destructive'>" . _x( 'Not Spam', 'comment' ) . '</a>';
  320. } elseif ( 'trash' == $the_comment_status ) {
  321. $actions['untrash'] = "<a href='$untrash_url' class='delete:the-comment-list:comment-$comment->comment_ID:66cc66:untrash=1 vim-z vim-destructive'>" . __( 'Restore' ) . '</a>';
  322. }
  323. if ( 'spam' == $the_comment_status || 'trash' == $the_comment_status || !EMPTY_TRASH_DAYS ) {
  324. $actions['delete'] = "<a href='$delete_url' class='delete:the-comment-list:comment-$comment->comment_ID::delete=1 delete vim-d vim-destructive'>" . __( 'Delete Permanently' ) . '</a>';
  325. } else {
  326. $actions['trash'] = "<a href='$trash_url' class='delete:the-comment-list:comment-$comment->comment_ID::trash=1 delete vim-d vim-destructive' title='" . esc_attr__( 'Move this comment to the trash' ) . "'>" . _x( 'Trash', 'verb' ) . '</a>';
  327. }
  328. if ( 'spam' != $the_comment_status && 'trash' != $the_comment_status ) {
  329. $actions['edit'] = "<a href='comment.php?action=editcomment&amp;c={$comment->comment_ID}' title='" . esc_attr__( 'Edit comment' ) . "'>". __( 'Edit' ) . '</a>';
  330. $actions['quickedit'] = '<a onclick="commentReply.open( \''.$comment->comment_ID.'\',\''.$post->ID.'\',\'edit\' );return false;" class="vim-q" title="'.esc_attr__( 'Quick Edit' ).'" href="#">' . __( 'Quick&nbsp;Edit' ) . '</a>';
  331. $actions['reply'] = '<a onclick="commentReply.open( \''.$comment->comment_ID.'\',\''.$post->ID.'\' );return false;" class="vim-r" title="'.esc_attr__( 'Reply to this comment' ).'" href="#">' . __( 'Reply' ) . '</a>';
  332. }
  333. $actions = apply_filters( 'comment_row_actions', array_filter( $actions ), $comment );
  334. $i = 0;
  335. echo '<div class="row-actions">';
  336. foreach ( $actions as $action => $link ) {
  337. ++$i;
  338. ( ( ( 'approve' == $action || 'unapprove' == $action ) && 2 === $i ) || 1 === $i ) ? $sep = '' : $sep = ' | ';
  339. // Reply and quickedit need a hide-if-no-js span when not added with ajax
  340. if ( ( 'reply' == $action || 'quickedit' == $action ) && ! defined('DOING_AJAX') )
  341. $action .= ' hide-if-no-js';
  342. elseif ( ( $action == 'untrash' && $the_comment_status == 'trash' ) || ( $action == 'unspam' && $the_comment_status == 'spam' ) ) {
  343. if ( '1' == get_comment_meta( $comment->comment_ID, '_wp_trash_meta_status', true ) )
  344. $action .= ' approve';
  345. else
  346. $action .= ' unapprove';
  347. }
  348. echo "<span class='$action'>$sep$link</span>";
  349. }
  350. echo '</div>';
  351. }
  352. }
  353. function column_author( $comment ) {
  354. global $comment_status;
  355. $author_url = get_comment_author_url();
  356. if ( 'http://' == $author_url )
  357. $author_url = '';
  358. $author_url_display = preg_replace( '|http://(www\.)?|i', '', $author_url );
  359. if ( strlen( $author_url_display ) > 50 )
  360. $author_url_display = substr( $author_url_display, 0, 49 ) . '...';
  361. echo "<strong>"; comment_author(); echo '</strong><br />';
  362. if ( !empty( $author_url ) )
  363. echo "<a title='$author_url' href='$author_url'>$author_url_display</a><br />";
  364. if ( $this->user_can ) {
  365. if ( !empty( $comment->comment_author_email ) ) {
  366. comment_author_email_link();
  367. echo '<br />';
  368. }
  369. echo '<a href="edit-comments.php?s=';
  370. comment_author_IP();
  371. echo '&amp;mode=detail';
  372. if ( 'spam' == $comment_status )
  373. echo '&amp;comment_status=spam';
  374. echo '">';
  375. comment_author_IP();
  376. echo '</a>';
  377. }
  378. }
  379. function column_date( $comment ) {
  380. return get_comment_date( __( 'Y/m/d \a\t g:ia' ) );
  381. }
  382. function column_response( $comment ) {
  383. global $post;
  384. if ( isset( $this->pending_count[$post->ID] ) ) {
  385. $pending_comments = $this->pending_count[$post->ID];
  386. } else {
  387. $_pending_count_temp = get_pending_comments_num( array( $post->ID ) );
  388. $pending_comments = $this->pending_count[$post->ID] = $_pending_count_temp[$post->ID];
  389. }
  390. if ( current_user_can( 'edit_post', $post->ID ) ) {
  391. $post_link = "<a href='" . get_edit_post_link( $post->ID ) . "'>";
  392. $post_link .= get_the_title( $post->ID ) . '</a>';
  393. } else {
  394. $post_link = get_the_title( $post->ID );
  395. }
  396. echo '<div class="response-links"><span class="post-com-count-wrapper">';
  397. echo $post_link . '<br />';
  398. $this->comments_bubble( $post->ID, $pending_comments );
  399. echo '</span> ';
  400. $post_type_object = get_post_type_object( $post->post_type );
  401. echo "<a href='" . get_permalink( $post->ID ) . "'>" . $post_type_object->labels->view_item . '</a>';
  402. echo '</div>';
  403. if ( 'attachment' == $post->post_type && ( $thumb = wp_get_attachment_image( $post->ID, array( 80, 60 ), true ) ) )
  404. echo $thumb;
  405. }
  406. function column_default( $comment, $column_name ) {
  407. do_action( 'manage_comments_custom_column', $column_name, $comment->comment_ID );
  408. }
  409. }
  410. /**
  411. * Post Comments List Table class.
  412. *
  413. * @package WordPress
  414. * @subpackage List_Table
  415. * @since 3.1.0
  416. * @access private
  417. *
  418. * @see WP_Comments_Table
  419. */
  420. class WP_Post_Comments_List_Table extends WP_Comments_List_Table {
  421. function get_column_info() {
  422. $this->_column_headers = array(
  423. array(
  424. 'author' => __( 'Author' ),
  425. 'comment' => _x( 'Comment', 'column name' ),
  426. ),
  427. array(),
  428. array(),
  429. );
  430. return $this->_column_headers;
  431. }
  432. function get_table_classes() {
  433. $classes = parent::get_table_classes();
  434. $classes[] = 'comments-box';
  435. return $classes;
  436. }
  437. function display( $output_empty = false ) {
  438. extract( $this->_args );
  439. wp_nonce_field( "fetch-list-" . get_class( $this ), '_ajax_fetch_list_nonce' );
  440. ?>
  441. <table class="<?php echo implode( ' ', $this->get_table_classes() ); ?>" cellspacing="0" style="display:none;">
  442. <tbody id="the-comment-list"<?php if ( $singular ) echo " class='list:$singular'"; ?>>
  443. <?php if ( ! $output_empty ) $this->display_rows_or_placeholder(); ?>
  444. </tbody>
  445. </table>
  446. <?php
  447. }
  448. function get_per_page( $comment_status = false ) {
  449. return 10;
  450. }
  451. }