|
54 | 54 | <?php endif; ?> |
55 | 55 |
|
56 | 56 | <?php if ( ! empty( $webhooks ) ) : ?> |
57 | | - <table class="wp-list-table widefat fixed striped table-view-list"> |
58 | | - <thead> |
59 | | - <tr> |
60 | | - <th scope="col" class="manage-column column-name column-primary"> |
61 | | - <?php esc_html_e( 'Name', 'wp-graphql-headless-webhooks' ); ?> |
62 | | - </th> |
63 | | - <th scope="col" class="manage-column column-event"> |
64 | | - <?php esc_html_e( 'Event', 'wp-graphql-headless-webhooks' ); ?> |
65 | | - </th> |
66 | | - <th scope="col" class="manage-column column-method"> |
67 | | - <?php esc_html_e( 'Method', 'wp-graphql-headless-webhooks' ); ?> |
68 | | - </th> |
69 | | - <th scope="col" class="manage-column column-url"> |
70 | | - <?php esc_html_e( 'URL', 'wp-graphql-headless-webhooks' ); ?> |
71 | | - </th> |
72 | | - <th scope="col" class="manage-column column-headers"> |
73 | | - <?php esc_html_e( 'Headers', 'wp-graphql-headless-webhooks' ); ?> |
74 | | - </th> |
75 | | - </tr> |
76 | | - </thead> |
77 | | - <tbody> |
78 | | - <?php foreach ( $webhooks as $webhook ) : ?> |
| 57 | + <form method="post" action="<?php echo esc_url( admin_url( 'admin-post.php' ) ); ?>"> |
| 58 | + <?php wp_nonce_field( 'bulk_delete_webhooks' ); ?> |
| 59 | + <input type="hidden" name="action" value="graphql_webhook_bulk_delete"> |
| 60 | + |
| 61 | + <div class="tablenav top"> |
| 62 | + <div class="alignleft actions bulkactions"> |
| 63 | + <label for="bulk-action-selector-top" class="screen-reader-text"><?php esc_html_e( 'Select bulk action', 'wp-graphql-headless-webhooks' ); ?></label> |
| 64 | + <select name="bulk_action" id="bulk-action-selector-top"> |
| 65 | + <option value=""><?php esc_html_e( 'Bulk actions', 'wp-graphql-headless-webhooks' ); ?></option> |
| 66 | + <option value="delete"><?php esc_html_e( 'Delete', 'wp-graphql-headless-webhooks' ); ?></option> |
| 67 | + </select> |
| 68 | + <input type="submit" class="button action" value="<?php esc_attr_e( 'Apply', 'wp-graphql-headless-webhooks' ); ?>"> |
| 69 | + </div> |
| 70 | + </div> |
| 71 | + |
| 72 | + <table class="wp-list-table widefat fixed striped table-view-list"> |
| 73 | + <thead> |
79 | 74 | <tr> |
80 | | - <td class="column-name column-primary" data-colname="<?php esc_attr_e( 'Name', 'wp-graphql-headless-webhooks' ); ?>"> |
81 | | - <strong> |
82 | | - <a href="<?php echo esc_url( $admin->get_admin_url( array( 'action' => 'edit', 'webhook_id' => $webhook->id ) ) ); ?>" class="row-title"> |
83 | | - <?php echo esc_html( $webhook->name ); ?> |
84 | | - </a> |
85 | | - </strong> |
86 | | - <div class="row-actions"> |
87 | | - <span class="edit"> |
88 | | - <a href="<?php echo esc_url( $admin->get_admin_url( array( 'action' => 'edit', 'webhook_id' => $webhook->id ) ) ); ?>"> |
89 | | - <?php esc_html_e( 'Edit', 'wp-graphql-headless-webhooks' ); ?> |
90 | | - </a> | |
91 | | - </span> |
92 | | - <span class="test"> |
93 | | - <a href="#" class="test-webhook" data-webhook-id="<?php echo esc_attr( $webhook->id ); ?>"> |
94 | | - <?php esc_html_e( 'Test', 'wp-graphql-headless-webhooks' ); ?> |
95 | | - </a> | |
96 | | - </span> |
97 | | - <span class="trash"> |
98 | | - <a href="<?php echo esc_url( wp_nonce_url( $admin->get_admin_url( array( 'action' => 'delete', 'webhook_id' => $webhook->id ) ), 'delete_webhook_' . $webhook->id ) ); ?>" class="delete-webhook submitdelete"> |
99 | | - <?php esc_html_e( 'Delete', 'wp-graphql-headless-webhooks' ); ?> |
100 | | - </a> |
101 | | - </span> |
102 | | - </div> |
103 | | - <button type="button" class="toggle-row"> |
104 | | - <span class="screen-reader-text"><?php esc_html_e( 'Show more details', 'wp-graphql-headless-webhooks' ); ?></span> |
105 | | - </button> |
106 | | - </td> |
107 | | - <td class="column-event" data-colname="<?php esc_attr_e( 'Event', 'wp-graphql-headless-webhooks' ); ?>"> |
108 | | - <code><?php echo esc_html( $webhook->event ); ?></code> |
109 | | - </td> |
110 | | - <td class="column-method" data-colname="<?php esc_attr_e( 'Method', 'wp-graphql-headless-webhooks' ); ?>"> |
111 | | - <strong><?php echo esc_html( strtoupper( $webhook->method ) ); ?></strong> |
112 | | - </td> |
113 | | - <td class="column-url" data-colname="<?php esc_attr_e( 'URL', 'wp-graphql-headless-webhooks' ); ?>"> |
114 | | - <code><?php echo esc_html( $webhook->url ); ?></code> |
| 75 | + <td class="manage-column column-cb check-column"> |
| 76 | + <label class="screen-reader-text" for="cb-select-all-1"><?php esc_html_e( 'Select All', 'wp-graphql-headless-webhooks' ); ?></label> |
| 77 | + <input id="cb-select-all-1" type="checkbox"> |
115 | 78 | </td> |
116 | | - <td class="column-headers" data-colname="<?php esc_attr_e( 'Headers', 'wp-graphql-headless-webhooks' ); ?>"> |
117 | | - <?php if ( ! empty( $webhook->headers ) ) : ?> |
118 | | - <?php foreach ( $webhook->headers as $key => $value ) : ?> |
119 | | - <div><code><?php echo esc_html( $key ); ?></code></div> |
120 | | - <?php endforeach; ?> |
121 | | - <?php else : ?> |
122 | | - <span class="description"><?php esc_html_e( 'None', 'wp-graphql-headless-webhooks' ); ?></span> |
123 | | - <?php endif; ?> |
| 79 | + <th scope="col" class="manage-column column-name column-primary"> |
| 80 | + <?php esc_html_e( 'Name', 'wp-graphql-headless-webhooks' ); ?> |
| 81 | + </th> |
| 82 | + <th scope="col" class="manage-column column-event"> |
| 83 | + <?php esc_html_e( 'Event', 'wp-graphql-headless-webhooks' ); ?> |
| 84 | + </th> |
| 85 | + <th scope="col" class="manage-column column-method"> |
| 86 | + <?php esc_html_e( 'Method', 'wp-graphql-headless-webhooks' ); ?> |
| 87 | + </th> |
| 88 | + <th scope="col" class="manage-column column-url"> |
| 89 | + <?php esc_html_e( 'URL', 'wp-graphql-headless-webhooks' ); ?> |
| 90 | + </th> |
| 91 | + <th scope="col" class="manage-column column-headers"> |
| 92 | + <?php esc_html_e( 'Headers', 'wp-graphql-headless-webhooks' ); ?> |
| 93 | + </th> |
| 94 | + </tr> |
| 95 | + </thead> |
| 96 | + <tbody> |
| 97 | + <?php foreach ( $webhooks as $webhook ) : ?> |
| 98 | + <tr> |
| 99 | + <th scope="row" class="check-column"> |
| 100 | + <label class="screen-reader-text" for="cb-select-<?php echo esc_attr( $webhook->id ); ?>"> |
| 101 | + <?php printf( esc_html__( 'Select %s', 'wp-graphql-headless-webhooks' ), esc_html( $webhook->name ) ); ?> |
| 102 | + </label> |
| 103 | + <input id="cb-select-<?php echo esc_attr( $webhook->id ); ?>" type="checkbox" name="webhook_ids[]" value="<?php echo esc_attr( $webhook->id ); ?>"> |
| 104 | + </th> |
| 105 | + <td class="column-name column-primary" data-colname="<?php esc_attr_e( 'Name', 'wp-graphql-headless-webhooks' ); ?>"> |
| 106 | + <strong> |
| 107 | + <a href="<?php echo esc_url( $admin->get_admin_url( array( 'action' => 'edit', 'webhook_id' => $webhook->id ) ) ); ?>" class="row-title"> |
| 108 | + <?php echo esc_html( $webhook->name ); ?> |
| 109 | + </a> |
| 110 | + </strong> |
| 111 | + <div class="row-actions"> |
| 112 | + <span class="edit"> |
| 113 | + <a href="<?php echo esc_url( $admin->get_admin_url( array( 'action' => 'edit', 'webhook_id' => $webhook->id ) ) ); ?>"> |
| 114 | + <?php esc_html_e( 'Edit', 'wp-graphql-headless-webhooks' ); ?> |
| 115 | + </a> | |
| 116 | + </span> |
| 117 | + <span class="test"> |
| 118 | + <a href="#" class="test-webhook" data-webhook-id="<?php echo esc_attr( $webhook->id ); ?>"> |
| 119 | + <?php esc_html_e( 'Test', 'wp-graphql-headless-webhooks' ); ?> |
| 120 | + </a> | |
| 121 | + </span> |
| 122 | + <span class="trash"> |
| 123 | + <a href="<?php echo esc_url( wp_nonce_url( $admin->get_admin_url( array( 'action' => 'delete', 'webhook_id' => $webhook->id ) ), 'delete_webhook_' . $webhook->id ) ); ?>" class="delete-webhook submitdelete"> |
| 124 | + <?php esc_html_e( 'Delete', 'wp-graphql-headless-webhooks' ); ?> |
| 125 | + </a> |
| 126 | + </span> |
| 127 | + </div> |
| 128 | + <button type="button" class="toggle-row"> |
| 129 | + <span class="screen-reader-text"><?php esc_html_e( 'Show more details', 'wp-graphql-headless-webhooks' ); ?></span> |
| 130 | + </button> |
| 131 | + </td> |
| 132 | + <td class="column-event" data-colname="<?php esc_attr_e( 'Event', 'wp-graphql-headless-webhooks' ); ?>"> |
| 133 | + <code><?php echo esc_html( $webhook->event ); ?></code> |
| 134 | + </td> |
| 135 | + <td class="column-method" data-colname="<?php esc_attr_e( 'Method', 'wp-graphql-headless-webhooks' ); ?>"> |
| 136 | + <strong><?php echo esc_html( strtoupper( $webhook->method ) ); ?></strong> |
| 137 | + </td> |
| 138 | + <td class="column-url" data-colname="<?php esc_attr_e( 'URL', 'wp-graphql-headless-webhooks' ); ?>"> |
| 139 | + <code><?php echo esc_html( $webhook->url ); ?></code> |
| 140 | + </td> |
| 141 | + <td class="column-headers" data-colname="<?php esc_attr_e( 'Headers', 'wp-graphql-headless-webhooks' ); ?>"> |
| 142 | + <?php if ( ! empty( $webhook->headers ) ) : ?> |
| 143 | + <?php foreach ( $webhook->headers as $key => $value ) : ?> |
| 144 | + <div><code><?php echo esc_html( $key ); ?></code></div> |
| 145 | + <?php endforeach; ?> |
| 146 | + <?php else : ?> |
| 147 | + <span class="description"><?php esc_html_e( 'None', 'wp-graphql-headless-webhooks' ); ?></span> |
| 148 | + <?php endif; ?> |
| 149 | + </td> |
| 150 | + </tr> |
| 151 | + <?php endforeach; ?> |
| 152 | + </tbody> |
| 153 | + <tfoot> |
| 154 | + <tr> |
| 155 | + <td class="manage-column column-cb check-column"> |
| 156 | + <label class="screen-reader-text" for="cb-select-all-2"><?php esc_html_e( 'Select All', 'wp-graphql-headless-webhooks' ); ?></label> |
| 157 | + <input id="cb-select-all-2" type="checkbox"> |
124 | 158 | </td> |
| 159 | + <th scope="col" class="manage-column column-name column-primary"> |
| 160 | + <?php esc_html_e( 'Name', 'wp-graphql-headless-webhooks' ); ?> |
| 161 | + </th> |
| 162 | + <th scope="col" class="manage-column column-event"> |
| 163 | + <?php esc_html_e( 'Event', 'wp-graphql-headless-webhooks' ); ?> |
| 164 | + </th> |
| 165 | + <th scope="col" class="manage-column column-method"> |
| 166 | + <?php esc_html_e( 'Method', 'wp-graphql-headless-webhooks' ); ?> |
| 167 | + </th> |
| 168 | + <th scope="col" class="manage-column column-url"> |
| 169 | + <?php esc_html_e( 'URL', 'wp-graphql-headless-webhooks' ); ?> |
| 170 | + </th> |
| 171 | + <th scope="col" class="manage-column column-headers"> |
| 172 | + <?php esc_html_e( 'Headers', 'wp-graphql-headless-webhooks' ); ?> |
| 173 | + </th> |
125 | 174 | </tr> |
126 | | - <?php endforeach; ?> |
127 | | - </tbody> |
128 | | - <tfoot> |
129 | | - <tr> |
130 | | - <th scope="col" class="manage-column column-name column-primary"> |
131 | | - <?php esc_html_e( 'Name', 'wp-graphql-headless-webhooks' ); ?> |
132 | | - </th> |
133 | | - <th scope="col" class="manage-column column-event"> |
134 | | - <?php esc_html_e( 'Event', 'wp-graphql-headless-webhooks' ); ?> |
135 | | - </th> |
136 | | - <th scope="col" class="manage-column column-method"> |
137 | | - <?php esc_html_e( 'Method', 'wp-graphql-headless-webhooks' ); ?> |
138 | | - </th> |
139 | | - <th scope="col" class="manage-column column-url"> |
140 | | - <?php esc_html_e( 'URL', 'wp-graphql-headless-webhooks' ); ?> |
141 | | - </th> |
142 | | - <th scope="col" class="manage-column column-headers"> |
143 | | - <?php esc_html_e( 'Headers', 'wp-graphql-headless-webhooks' ); ?> |
144 | | - </th> |
145 | | - </tr> |
146 | | - </tfoot> |
147 | | - </table> |
148 | | - |
149 | | - <div class="tablenav bottom"> |
150 | | - <div class="alignleft actions"> |
151 | | - <p class="description"> |
152 | | - <?php |
153 | | - printf( |
154 | | - esc_html__( '%d webhooks configured', 'wp-graphql-headless-webhooks' ), |
155 | | - count( $webhooks ) |
156 | | - ); |
157 | | - ?> |
158 | | - </p> |
| 175 | + </tfoot> |
| 176 | + </table> |
| 177 | + |
| 178 | + <div class="tablenav bottom"> |
| 179 | + <div class="alignleft actions bulkactions"> |
| 180 | + <label for="bulk-action-selector-bottom" class="screen-reader-text"><?php esc_html_e( 'Select bulk action', 'wp-graphql-headless-webhooks' ); ?></label> |
| 181 | + <select name="bulk_action2" id="bulk-action-selector-bottom"> |
| 182 | + <option value=""><?php esc_html_e( 'Bulk actions', 'wp-graphql-headless-webhooks' ); ?></option> |
| 183 | + <option value="delete"><?php esc_html_e( 'Delete', 'wp-graphql-headless-webhooks' ); ?></option> |
| 184 | + </select> |
| 185 | + <input type="submit" class="button action" value="<?php esc_attr_e( 'Apply', 'wp-graphql-headless-webhooks' ); ?>"> |
| 186 | + </div> |
| 187 | + <div class="alignleft actions"> |
| 188 | + <p class="description"> |
| 189 | + <?php |
| 190 | + printf( |
| 191 | + esc_html__( '%d webhooks configured', 'wp-graphql-headless-webhooks' ), |
| 192 | + count( $webhooks ) |
| 193 | + ); |
| 194 | + ?> |
| 195 | + </p> |
| 196 | + </div> |
159 | 197 | </div> |
160 | | - </div> |
| 198 | + </form> |
161 | 199 | <?php else : ?> |
162 | 200 | <div class="webhooks-empty-state"> |
163 | 201 | <p><?php esc_html_e( 'No webhooks configured yet.', 'wp-graphql-headless-webhooks' ); ?></p> |
|
0 commit comments