<?php

/**
 * Tools tab – Download logs.
 *
 * @package northmill-online-shared
 */
declare (strict_types=1);
namespace Northmill_Online_Shared_Checkout;

/**
 * View parameters.
 *
 * @var array $params
 */
\defined('ABSPATH') || exit;
if ($params['is_plugin']) {
    $only_package_checkbox_text = \__('Only download logs from this plugin.', 'northmill-online-shared');
} else {
    $only_package_checkbox_text = \__('Only download logs from this theme', 'northmill-online-shared');
}
$only_package_checkbox_text .= ' ' . \__('If this is unchecked, logs from any other installed Northmill plugins and themes will be included.', 'northmill-online-shared');
?>
<div class="wrap">
	<h1><?php 
\esc_html_e('Download logs', 'northmill-online-shared');
?></h1>
	<form method="post" action="<?php 
echo \esc_url(\admin_url('admin-post.php'));
?>">
		<?php 
\wp_nonce_field($params['admin_post_action'], $params['admin_post_nonce']);
?>
		<input type="hidden" name="action" value="<?php 
echo \esc_attr($params['admin_post_action']);
?>">

		<p>
			<label>
				<input
						type="checkbox"
						name="limit_30_days"
						value="1"
						checked
				>
				<?php 
\esc_html_e('Limit logs to the last 30 days', 'northmill-online-shared');
?>
			</label>
		</p>

		<p>
			<label>
				<input
						type="checkbox"
						name="only_package"
						value="1"
						checked
				>
				<?php 
echo \esc_html($only_package_checkbox_text);
?>
			</label>
		</p>

		<p>
			<button type="submit" class="button button-primary">
				<?php 
\esc_html_e('Download logs', 'northmill-online-shared');
?>
			</button>
		</p>
	</form>
</div>
<?php 
