<?php
/**
 * Create Category modal template
 *
 * @since      1.2.0
 *
 * @package    PersonalizeWP
 * @subpackage PersonalizeWP/Admin/Partials
 */

namespace PersonalizeWP\Admin\Partials;

use PersonalizeWP\Admin\PageCategories;
use PersonalizeWP\Model\Category;

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

<dialog id="createCategoryModal" class="dialog">
	<form action="<?php echo esc_url( admin_url( PageCategories::$create_url ) ); ?>" method="post" accept-charset="UTF-8" class="pwp-form flow">
		<div class="dialog-header">
			<h5 class="dialog-title"><?php esc_html_e( 'Add New Category', 'personalizewp' ); ?></h5>
			<button type="button" formnovalidate value="close" formmethod="dialog">
				<span aria-hidden="true">&times;</span>
				<span class="screen-reader-text"><?php esc_html_e( 'Close', 'personalizewp' ); ?></span>
			</button>
		</div>
		<?php
			wp_nonce_field( 'category-create' );
			// Set for the form.
			$category   = new Category();
			$modal_mode = true;
			require __DIR__ . '/_form.php';
		?>
	</form>
</dialog>
