<?php
/**
 * Field Settings
 *
 * @package EASYFUA
 */

if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

	$lang        = easyfua_lang();
	$option_name = 'easyfua_settings' . $lang;
	$settings    = get_option( $option_name );
?>
	<h2><?php esc_html_e( 'Fields Settings', 'easy-file-upload-approval' ); ?></h2>
	<h2><?php esc_html_e( 'Name', 'easy-file-upload-approval' ); ?></h2>
	<table class="form-table extra-fields-settings" role="presentation">
		<tbody>
			<tr>
				<th scope="row"><?php esc_html_e( 'Hide Field?', 'easy-file-upload-approval' ); ?></th>
				<td>
					<input type="hidden" name="<?php echo esc_attr( $option_name ); ?>[hide_name_field]" value="">
					<input type="checkbox" name="<?php echo esc_attr( $option_name ); ?>[hide_name_field]" value="yes" <?php checked( easyfua_settings( 'hide_name_field' ), 'yes' ); ?>> <?php esc_html_e( 'Yes', 'easy-file-upload-approval' ); ?>
				</td>
			</tr>
			<tr>
				<th scope="row"><?php esc_html_e( 'Required?', 'easy-file-upload-approval' ); ?></th>
				<td>
					<input type="hidden" name="<?php echo esc_attr( $option_name ); ?>[name_required]" value="">
					<input type="checkbox" name="<?php echo esc_attr( $option_name ); ?>[name_required]" value="yes" <?php checked( easyfua_settings( 'name_required' ), 'yes' ); ?>> <?php esc_html_e( 'Yes', 'easy-file-upload-approval' ); ?>
				</td>
			</tr>
			<tr>
				<th scope="row"><?php esc_html_e( 'Label', 'easy-file-upload-approval' ); ?></th>
				<td>
					<input class="regular-text" type="text" name="<?php echo esc_attr( $option_name ); ?>[name_label]" placeholder="Name" value="<?php echo esc_attr( easyfua_settings( 'name_label' ) ); ?>">
				</td>
			</tr>
		</tbody>
	</table>
	<hr>
	<h2><?php esc_html_e( 'Email Address', 'easy-file-upload-approval' ); ?></h2>
	<table class="form-table extra-fields-settings" role="presentation">
		<tbody>
			<tr>
				<th scope="row"><?php esc_html_e( 'Hide Field?', 'easy-file-upload-approval' ); ?></th>
				<td>
					<input type="hidden" name="<?php echo esc_attr( $option_name ); ?>[hide_email_field]" value="">
					<input type="checkbox" name="<?php echo esc_attr( $option_name ); ?>[hide_email_field]" value="yes" <?php checked( easyfua_settings( 'hide_email_field' ), 'yes' ); ?>> <?php esc_html_e( 'Yes', 'easy-file-upload-approval' ); ?>
				</td>
			</tr>
			<tr>
				<th scope="row"><?php esc_html_e( 'Required?', 'easy-file-upload-approval' ); ?></th>
				<td>
					<input type="hidden" name="<?php echo esc_attr( $option_name ); ?>[email_required]" value="">
					<input type="checkbox" name="<?php echo esc_attr( $option_name ); ?>[email_required]" value="yes" <?php checked( easyfua_settings( 'email_required' ), 'yes' ); ?>> <?php esc_html_e( 'Yes', 'easy-file-upload-approval' ); ?>
				</td>
			</tr>
			<tr>
				<th scope="row"><?php esc_html_e( 'Label', 'easy-file-upload-approval' ); ?></th>
				<td>
					<input class="regular-text" type="text" name="<?php echo esc_attr( $option_name ); ?>[email_label]" placeholder="Email Address" value="<?php echo esc_attr( easyfua_settings( 'email_label' ) ); ?>">
				</td>
			</tr>
		</tbody>
	</table>
	<hr>
	<h2><?php esc_html_e( 'Google Recaptcha V3', 'easy-file-upload-approval' ); ?></h2>
	<table class="form-table extra-fields-settings" role="presentation">
		<tbody>
			<tr>
				<th scope="row"><?php esc_html_e( 'Site Key', 'easy-file-upload-approval' ); ?></th>
				<td><input type="text" class="regular-text" name="<?php echo esc_attr( $option_name ); ?>[site_key]" value="<?php echo esc_attr( easyfua_settings( 'site_key' ) ); ?>"></td>
			</tr>
			<tr>
				<th scope="row"><?php esc_html_e( 'Secret Key', 'easy-file-upload-approval' ); ?></th>
				<td>
					<input type="text" class="regular-text" name="<?php echo esc_attr( $option_name ); ?>[secret_key]" value="<?php echo esc_attr( easyfua_settings( 'secret_key' ) ); ?>">
					<p class="description">Get your reCAPTCHA v3 keys from Google <a href="https://www.google.com/recaptcha/admin/create" target="_blank">here</a>.</p>
				</td>
			</tr>
		</tbody>
	</table>
	<hr>
	<h2><?php esc_html_e( 'Submit Button', 'easy-file-upload-approval' ); ?></h2>
	<table class="form-table extra-fields-settings" role="presentation">
		<tbody>
			<tr>
				<th scope="row"><?php esc_html_e( 'Text', 'easy-file-upload-approval' ); ?></th>
				<td><input type="text" class="regular-text" placeholder="Submit" name="<?php echo esc_attr( $option_name ); ?>[button_text]" value="<?php echo esc_attr( easyfua_settings( 'button_text' ) ); ?>"></td>
			</tr>
		</tbody>
	</table>