2014-07-28 14:50:11 +00:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* Admin View: Page - Status Logs
|
|
|
|
*/
|
|
|
|
|
2014-07-28 15:16:35 +00:00
|
|
|
if ( ! defined( 'ABSPATH' ) ) {
|
2015-03-07 03:16:08 +00:00
|
|
|
exit;
|
2014-07-28 15:16:35 +00:00
|
|
|
}
|
2014-07-28 14:50:11 +00:00
|
|
|
|
|
|
|
?>
|
2014-05-28 10:12:35 +00:00
|
|
|
<?php if ( $logs ) : ?>
|
|
|
|
<div id="log-viewer-select">
|
|
|
|
<div class="alignleft">
|
2016-02-17 18:23:50 +00:00
|
|
|
<h2><?php printf( __( 'Log file: %s (%s)', 'woocommerce' ), esc_html( $viewed_log ), date_i18n( get_option( 'date_format') . ' ' . get_option( 'time_format'), filemtime( WC_LOG_DIR . $viewed_log ) ) ); ?></h2>
|
2014-05-28 10:12:35 +00:00
|
|
|
</div>
|
|
|
|
<div class="alignright">
|
|
|
|
<form action="<?php echo admin_url( 'admin.php?page=wc-status&tab=logs' ); ?>" method="post">
|
|
|
|
<select name="log_file">
|
|
|
|
<?php foreach ( $logs as $log_key => $log_file ) : ?>
|
|
|
|
<option value="<?php echo esc_attr( $log_key ); ?>" <?php selected( sanitize_title( $viewed_log ), $log_key ); ?>><?php echo esc_html( $log_file ); ?> (<?php echo date_i18n( get_option( 'date_format') . ' ' . get_option( 'time_format'), filemtime( WC_LOG_DIR . $log_file ) ); ?>)</option>
|
|
|
|
<?php endforeach; ?>
|
|
|
|
</select>
|
2015-03-07 03:16:08 +00:00
|
|
|
<input type="submit" class="button" value="<?php esc_attr_e( 'View', 'woocommerce' ); ?>" />
|
2014-05-28 10:12:35 +00:00
|
|
|
</form>
|
|
|
|
</div>
|
|
|
|
<div class="clear"></div>
|
|
|
|
</div>
|
|
|
|
<div id="log-viewer">
|
|
|
|
<textarea cols="70" rows="25"><?php echo esc_textarea( file_get_contents( WC_LOG_DIR . $viewed_log ) ); ?></textarea>
|
|
|
|
</div>
|
|
|
|
<?php else : ?>
|
2016-02-23 08:33:11 +00:00
|
|
|
<div class="updated woocommerce-message inline"><p><?php _e( 'There are currently no logs to view.', 'woocommerce' ); ?></p></div>
|
2015-03-07 03:16:08 +00:00
|
|
|
<?php endif; ?>
|