PluginProbe
HTML Forms – Simple WordPress Forms Plugin / 1.1
HTML Forms – Simple WordPress Forms Plugin v1.1
1.7.0 trunk 1.0 1.0.1 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6 1.1 1.1.1 1.1.2 1.1.3 1.1.4 1.1.5 1.2.0 1.3.0 1.3.1 1.3.10 1.3.11 1.3.12 1.3.13 1.3.14 1.3.15 1.3.16 All 67 releases
html-forms / views / tab-submissions-list.php

tab-submissions-list.php in HTML Forms – Simple WordPress Forms Plugin 1.1, at views/tab-submissions-list.php

78 lines 3.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 defined( 'ABSPATH' ) or exit;
4 $datetime_format = sprintf('%s %s', get_option( 'date_format' ), get_option( 'time_format' ) );
5
6 add_action( 'hf_admin_form_submissions_output_column_header', function( $column ) {
7 echo esc_html( ucfirst( strtolower( $column ) ) );
8 });
9
10 ?>
11
12 <h2><?php _e( 'Form Submissions', 'html-forms' ); ?></h2>
13
14 </form><?php // close main form. This means this always has to be the last tab or it will break stuff. ?>
15 <form method="post">
16 <div class="tablenav top">
17 <div class="alignleft actions bulkactions">
18 <label for="bulk-action-selector-top" class="screen-reader-text"><?php _e( 'Select bulk action' ); ?></label>
19 <select name="_hf_admin_action" id="bulk-action-selector-top">
20 <option value=""><?php _e( 'Bulk Actions' ); ?></option>
21 <option value="bulk_delete_submissions"><?php _e( 'Move to Trash' ); ?></option>
22 </select>
23 <input type="submit" class="button action" value="<?php _e( 'Apply' ); ?>">
24 </div>
25
26 <div class="tablenav-pages one-page">
27 <span class="displaying-num"><?php echo sprintf( __( '%d items' ), count( $submissions ) ); ?></span>
28 </div>
29
30 <br class="clear">
31 </div>
32
33 <table class="wp-list-table widefat fixed striped">
34 <thead>
35 <tr>
36 <td id="cb" class="manage-column column-cb check-column"><input type="checkbox" /></td>
37 <th scope="col" class="hf-column manage-column" style="width: 160px;"><?php _e( 'Timestamp', 'html-forms' ); ?></th>
38 <?php foreach( $columns as $column ) {
39 echo sprintf( '<th scope="col" class="hf-column manage-column hf-column-%s">', esc_attr( $column ) );
40 do_action( 'hf_admin_form_submissions_output_column_header', $column );
41 echo '</th>';
42 } ?>
43 </tr>
44 </thead>
45 <tbody>
46
47 <?php foreach( $submissions as $s ) { ?>
48 <tr>
49 <th scope="row" class="check-column">
50 <input type="checkbox" name="id[]" value="<?php echo esc_attr( $s->id ); ?>"/>
51 </th>
52 <td>
53 <abbr title="<?php echo date( $datetime_format, strtotime( $s->submitted_at ) ); ?>">
54 <?php echo sprintf( '<a href="%s">%s</a>', esc_attr( add_query_arg( array( 'submission_id' => $s->id ) ) ), esc_html( $s->submitted_at ) ); ?>
55 </abbr>
56 </td>
57
58 <?php foreach( $columns as $column ) {
59 $value = isset( $s->data[ $column ] ) ? $s->data[ $column ] : '';
60 if( is_array( $value ) ) {
61 $value = join( ', ', $value );
62 }
63 $value = esc_html( $value );
64
65 echo sprintf( '<td>%s%s</td>', substr( $value, 0, 100 ), strlen( $value ) > 100 ? '...' : '' );
66 } ?>
67 </tr>
68 <?php } ?>
69 <?php if ( empty( $submissions ) ) {
70 printf( '<tr><td colspan="2">%s</td></tr>', __( 'Nothing to see here, yet!', 'html-forms' ) );
71 } ?>
72 </tbody>
73 </table>
74 </form>
75
76
77 <form><?php // open new main form. This means this always has to be the last tab or it will break stuff. ?>
78