<?php
/**
 * Add url modal template
 *
 * @since      3.1.0
 *
 * @package    PersonalizeWP
 * @subpackage PersonalizeWP/Admin/Partials
 */

namespace PersonalizeWP\Admin\Partials;

defined( 'ABSPATH' ) || exit; // Exit if accessed directly.
?>

<dialog id="addURLTokenModal" data-url-action class="dialog">
	<ajax-form msg-submitting="<?php esc_attr_e( 'Adding URL...', 'personalizewp' ); ?>">
		<form action="<?php echo esc_url( admin_url( 'admin-ajax.php' ) ); ?>"
			id="addURLTokenForm" method="post" accept-charset="UTF-8" class="pwp-form flow">
			<input type="hidden" name="action" value="pwp_add_url_api_authentication" />
			<?php wp_nonce_field( 'add-url-token', '_ajax_nonce' ); ?>

			<div class="dialog-header">
				<h5 class="dialog-title"><?php esc_html_e( 'Add New URL', 'personalizewp' ); ?></h5>
				<button formnovalidate value="close" type="button" formmethod="dialog">
					<span aria-hidden="true">&times;</span>
					<span class="screen-reader-text"><?php esc_html_e( 'Close', 'personalizewp' ); ?></span>
				</button>
			</div>

			<label for="auth-url"><?php esc_html_e( 'Key URL', 'personalizewp' ); ?></label>
			<input class="regular-text" id="auth_url" type="url" name="auth_url" required placeholder="http://www.example.com">

			<div class="actions">
				<button type="submit" class="primary btn"><?php esc_html_e( 'Add New URL', 'personalizewp' ); ?></button>
				<button type="button" class="secondary btn" formnovalidate value="close" formmethod="dialog"><?php esc_html_e( 'Cancel', 'personalizewp' ); ?></button>
			</div>

			<div hidden role="status" class="notice-message"></div>
		</form>
	</ajax-form>
</dialog>
