html-admin-page-addons.php
2 years ago
html-admin-page-builder.php
4 years ago
html-admin-page-entries-view.php
3 years ago
html-admin-page-export.php
3 years ago
html-admin-page-form-templates.php
3 years ago
html-admin-page-import.php
3 years ago
html-admin-page-tools-logs.php
4 years ago
html-admin-page-tools.php
5 years ago
html-admin-settings.php
7 years ago
html-deactivation-popup.php
3 years ago
html-notice-allow-usage.php
2 years ago
html-notice-custom.php
6 years ago
html-notice-php-deprecation.php
3 years ago
html-notice-review.php
2 years ago
html-notice-survey.php
4 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
47 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 ( 1 < count( $logs ) ) : ?> |
| 17 | <a class="page-title-action page-title-action-all" href="<?php echo esc_url( wp_nonce_url( add_query_arg( array( 'handle_all' => sanitize_title( 'delete-all-logs' ) ), admin_url( 'admin.php?page=evf-tools&tab=logs' ) ), 'remove_all_logs' ) ); ?>" class="button"><?php esc_html_e( 'Delete all logs', 'everest-forms' ); ?></a> |
| 18 | <?php endif; ?> |
| 19 | <?php if ( ! empty( $viewed_log ) ) : ?> |
| 20 | <a class="page-title-action" href="<?php echo esc_url( wp_nonce_url( add_query_arg( array( 'handle' => sanitize_title( $viewed_log ) ), admin_url( 'admin.php?page=evf-tools&tab=logs' ) ), 'remove_log' ) ); ?>" class="button"><?php esc_html_e( 'Delete log', 'everest-forms' ); ?></a> |
| 21 | <?php endif; ?> |
| 22 | </h2> |
| 23 | </div> |
| 24 | <div class="alignright"> |
| 25 | <form action="<?php echo esc_url( admin_url( 'admin.php?page=evf-tools&tab=logs' ) ); ?>" method="post"> |
| 26 | <select name="log_file"> |
| 27 | <?php foreach ( $logs as $log_key => $log_file ) : ?> |
| 28 | <?php |
| 29 | $timestamp = filemtime( EVF_LOG_DIR . $log_file ); |
| 30 | /* translators: 1: last access date 2: last access time */ |
| 31 | $date = sprintf( __( '%1$s at %2$s', 'everest-forms' ), date_i18n( evf_date_format(), $timestamp ), date_i18n( evf_time_format(), $timestamp ) ); |
| 32 | ?> |
| 33 | <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> |
| 34 | <?php endforeach; ?> |
| 35 | </select> |
| 36 | <button type="submit" class="button" value="<?php esc_attr_e( 'View', 'everest-forms' ); ?>"><?php esc_html_e( 'View', 'everest-forms' ); ?></button> |
| 37 | </form> |
| 38 | </div> |
| 39 | <div class="clear"></div> |
| 40 | </div> |
| 41 | <div id="log-viewer"> |
| 42 | <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> |
| 43 | </div> |
| 44 | <?php else : ?> |
| 45 | <div class="updated everest-forms-message inline"><p><?php esc_html_e( 'There are currently no logs to view.', 'everest-forms' ); ?></p></div> |
| 46 | <?php endif; ?> |
| 47 |