<?php
if ( ! defined( 'ABSPATH' ) ) {
	exit;
}
$settings = $settings ?? [];
$ids      = $ids ?? [];
$default_pattern = $settings['default_pattern'] ?? '{title}';
?>
<div id="wpps-bulk-rename-modal" class="wpps-bulk-rename-modal" style="display:none;" role="dialog" aria-labelledby="wpps-bulk-rename-title">
	<div class="wpps-bulk-rename-modal-content">
		<h2 id="wpps-bulk-rename-title"><?php esc_html_e( 'Bulk Rename Files', 'wp-powersuite' ); ?></h2>
		<p class="description"><?php esc_html_e( 'Rename selected files using a pattern. Variables: {title}, {post-title}, {id}, {date}, {counter}', 'wp-powersuite' ); ?></p>

		<table class="form-table">
			<tr>
				<th scope="row"><label for="wpps-bulk-prefix"><?php esc_html_e( 'Prefix', 'wp-powersuite' ); ?></label></th>
				<td><input type="text" id="wpps-bulk-prefix" class="regular-text" placeholder="product-" /></td>
			</tr>
			<tr>
				<th scope="row"><label for="wpps-bulk-pattern"><?php esc_html_e( 'Pattern', 'wp-powersuite' ); ?></label></th>
				<td><input type="text" id="wpps-bulk-pattern" class="regular-text" value="<?php echo esc_attr( $default_pattern ); ?>" placeholder="{title}" /></td>
			</tr>
			<tr>
				<th scope="row"><label for="wpps-bulk-suffix"><?php esc_html_e( 'Suffix', 'wp-powersuite' ); ?></label></th>
				<td><input type="text" id="wpps-bulk-suffix" class="regular-text" placeholder="-thumb" /></td>
			</tr>
			<tr>
				<th scope="row"><?php esc_html_e( 'Options', 'wp-powersuite' ); ?></th>
				<td>
					<label><input type="checkbox" id="wpps-bulk-update-title" value="1" /> <?php esc_html_e( 'Update media titles', 'wp-powersuite' ); ?></label>
				</td>
			</tr>
		</table>

		<div class="wpps-bulk-progress" style="display:none;">
			<progress id="wpps-bulk-progress-bar" value="0" max="100"></progress>
			<p><span id="wpps-bulk-counter">0</span> / <span id="wpps-bulk-total">0</span></p>
			<p id="wpps-bulk-current-file"></p>
		</div>

		<div class="wpps-bulk-summary" style="display:none;"></div>

		<p class="wpps-bulk-actions">
			<button type="button" class="button button-primary" id="wpps-bulk-rename-start"><?php esc_html_e( 'Start Rename', 'wp-powersuite' ); ?></button>
			<button type="button" class="button" id="wpps-bulk-rename-close"><?php esc_html_e( 'Close', 'wp-powersuite' ); ?></button>
		</p>
	</div>
</div>
<input type="hidden" id="wpps-bulk-rename-ids" value="<?php echo esc_attr( implode( ',', $ids ) ); ?>" />
