PluginProbe
Stream – Activity Log & Audit Trail / 3.9.0
Stream – Activity Log & Audit Trail v3.9.0
4.4.0 4.3.0 4.2.2 4.2.1 trunk 2.0.1 2.0.2 2.0.3 2.0.4 2.0.5 3.0.0 3.0.1 3.0.2 3.0.3 3.0.4 3.0.5 3.0.6 3.0.7 3.1 3.1.1 3.10.0 3.2.0 3.2.1 3.2.2 3.2.3 All 50 releases
stream / classes / class-preview-list-table.php

class-preview-list-table.php in Stream – Activity Log & Audit Trail 3.9.0, at classes/class-preview-list-table.php

79 lines 1.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Displays a list of provided records in a HTML Table
4 *
5 * @package WP_Stream
6 */
7
8 namespace WP_Stream;
9
10 /**
11 * Class - Preview_List_Table
12 */
13 class Preview_List_Table extends List_Table {
14
15 /**
16 * Class constructor.
17 *
18 * @param Plugin $plugin Plugin object.
19 *
20 * @return void
21 */
22 public function __construct( $plugin ) {
23 $this->plugin = $plugin;
24 parent::__construct( $plugin );
25 }
26
27 /**
28 * Sets up the records for display.
29 *
30 * @param array $items List of items for display.
31 *
32 * @return void
33 */
34 public function set_records( $items ) {
35 $columns = $this->get_columns();
36 $sortable = $this->get_sortable_columns();
37 $hidden = $this->get_hidden_columns();
38 $primary = $columns['summary'];
39
40 $this->_column_headers = array(
41 $columns,
42 $hidden,
43 $sortable,
44 $primary,
45 );
46
47 $this->items = $items;
48 }
49
50 /**
51 * Display the table
52 *
53 * @since 3.1.0
54 * @access public
55 */
56 public function display() {
57 ?>
58 <table class="wp-list-table <?php esc_attr( implode( ' ', $this->get_table_classes() ) ); ?>">
59 <thead>
60 <tr>
61 <?php $this->print_column_headers(); ?>
62 </tr>
63 </thead>
64
65 <tbody id="the-list">
66 <?php $this->display_rows_or_placeholder(); ?>
67 </tbody>
68
69 <tfoot>
70 <tr>
71 <?php $this->print_column_headers( false ); ?>
72 </tr>
73 </tfoot>
74
75 </table>
76 <?php
77 }
78 }
79