| 1 |
<?php |
| 2 |
namespace WP_Stream; |
| 3 |
|
| 4 |
class Preview_List_Table extends List_Table { |
| 5 |
|
| 6 |
/** |
| 7 |
* Class constructor. |
| 8 |
* |
| 9 |
* @param Plugin $plugin Plugin object. |
| 10 |
* @return void |
| 11 |
*/ |
| 12 |
public function __construct( $plugin ) { |
| 13 |
$this->plugin = $plugin; |
| 14 |
parent::__construct( $plugin ); |
| 15 |
} |
| 16 |
|
| 17 |
/** |
| 18 |
* Sets up the records for display. |
| 19 |
* |
| 20 |
* @param array $items List of items for display. |
| 21 |
* @return void |
| 22 |
*/ |
| 23 |
function set_records( $items ) { |
| 24 |
$columns = $this->get_columns(); |
| 25 |
$sortable = $this->get_sortable_columns(); |
| 26 |
$hidden = $this->get_hidden_columns(); |
| 27 |
$primary = $columns['summary']; |
| 28 |
|
| 29 |
$this->_column_headers = array( $columns, $hidden, $sortable, $primary ); |
| 30 |
|
| 31 |
$this->items = $items; |
| 32 |
} |
| 33 |
|
| 34 |
/** |
| 35 |
* Display the table |
| 36 |
* |
| 37 |
* @since 3.1.0 |
| 38 |
* @access public |
| 39 |
*/ |
| 40 |
public function display() { |
| 41 |
?> |
| 42 |
<table class="wp-list-table <?php esc_attr( implode( ' ', $this->get_table_classes() ) ); ?>"> |
| 43 |
<thead> |
| 44 |
<tr> |
| 45 |
<?php $this->print_column_headers(); ?> |
| 46 |
</tr> |
| 47 |
</thead> |
| 48 |
|
| 49 |
<tbody id="the-list"> |
| 50 |
<?php $this->display_rows_or_placeholder(); ?> |
| 51 |
</tbody> |
| 52 |
|
| 53 |
<tfoot> |
| 54 |
<tr> |
| 55 |
<?php $this->print_column_headers( false ); ?> |
| 56 |
</tr> |
| 57 |
</tfoot> |
| 58 |
|
| 59 |
</table> |
| 60 |
<?php |
| 61 |
} |
| 62 |
} |
| 63 |
|