html-admin-page-addons.php
6 years ago
html-admin-page-builder-setup.php
6 years ago
html-admin-page-builder.php
6 years ago
html-admin-page-entries-view.php
6 years ago
html-admin-page-export.php
6 years ago
html-admin-page-import.php
6 years ago
html-admin-page-tools-logs.php
6 years ago
html-admin-page-tools.php
6 years ago
html-admin-settings.php
7 years ago
html-notice-custom.php
6 years ago
html-notice-review.php
6 years ago
html-notice-update.php
6 years ago
html-notice-updated.php
6 years ago
html-notice-updating.php
6 years ago
html-admin-page-tools-logs.php
44 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Admin View: Page - Status Logs |
| 4 | * |
| 5 | * @package EverestForms/Admin/Logs |
| 6 | */ |
| 7 | |
| 8 | defined( 'ABSPATH' ) || exit; |
| 9 | |
| 10 | ?> |
| 11 | <?php if ( $logs ) : ?> |
| 12 | <div id="log-viewer-select"> |
| 13 | <div class="alignleft"> |
| 14 | <h2> |
| 15 | <?php echo esc_html( $viewed_log ); ?> |
| 16 | <?php if ( ! empty( $handle ) ) : ?> |
| 17 | <a class="page-title-action" href="<?php echo esc_url( wp_nonce_url( add_query_arg( array( 'handle' => $handle ), admin_url( 'admin.php?page=evf-tools&tab=logs' ) ), 'remove_log' ) ); ?>" class="button"><?php esc_html_e( 'Delete log', 'everest-forms' ); ?></a> |
| 18 | <?php endif; ?> |
| 19 | </h2> |
| 20 | </div> |
| 21 | <div class="alignright"> |
| 22 | <form action="<?php echo esc_url( admin_url( 'admin.php?page=evf-tools&tab=logs' ) ); ?>" method="post"> |
| 23 | <select name="log_file"> |
| 24 | <?php foreach ( $logs as $log_key => $log_file ) : ?> |
| 25 | <?php |
| 26 | $timestamp = filemtime( EVF_LOG_DIR . $log_file ); |
| 27 | /* translators: 1: last access date 2: last access time */ |
| 28 | $date = sprintf( __( '%1$s at %2$s', 'everest-forms' ), date_i18n( evf_date_format(), $timestamp ), date_i18n( evf_time_format(), $timestamp ) ); |
| 29 | ?> |
| 30 | <option value="<?php echo esc_attr( $log_key ); ?>" <?php selected( sanitize_title( $viewed_log ), $log_key ); ?>><?php echo esc_html( $log_file ); ?> (<?php echo esc_html( $date ); ?>)</option> |
| 31 | <?php endforeach; ?> |
| 32 | </select> |
| 33 | <button type="submit" class="button" value="<?php esc_attr_e( 'View', 'everest-forms' ); ?>"><?php esc_html_e( 'View', 'everest-forms' ); ?></button> |
| 34 | </form> |
| 35 | </div> |
| 36 | <div class="clear"></div> |
| 37 | </div> |
| 38 | <div id="log-viewer"> |
| 39 | <pre><?php echo esc_html( file_get_contents( EVF_LOG_DIR . $viewed_log ) ); // phpcs:ignore WordPress.WP.AlternativeFunctions.file_get_contents_file_get_contents ?></pre> |
| 40 | </div> |
| 41 | <?php else : ?> |
| 42 | <div class="updated everest-forms-message inline"><p><?php esc_html_e( 'There are currently no logs to view.', 'everest-forms' ); ?></p></div> |
| 43 | <?php endif; ?> |
| 44 |