<?php
/**
 * Custom labels block.
 *
 * @package EventimUSEventListings
 */

defined( 'ABSPATH' ) || exit;
?>
<div class="dashboard-module">
	<div class="module-header">
		<h1><?php esc_html_e( 'Custom Labels', 'eventim-us-event-listings' ); ?></h1>
	</div>
	<div class="module-content">
		<div class="custom-labels-container">
			<?php
			$evusel_customsLabels = evusel_get_custom_labels();
			unset( $evusel_customsLabels[2] );
			?>

			<?php foreach ( $evusel_customsLabels as $evusel_customLabel ) : ?>
				<div class="dispevli-custom-label-group">
					<label><?php echo esc_html( $evusel_customLabel['label'] ); ?></label>
					<input type="text" class="custom-label-input"
						name="<?php echo esc_attr( "evusel_settings[custom_labels][{$evusel_customLabel['key']}][label]" ); ?>"
						value="<?php echo esc_attr( $evuselConfig->get( "custom_labels.{$evusel_customLabel['key']}.label" ) ); ?>"
						placeholder="<?php echo esc_attr( $evusel_customLabel['placeholder'] ); ?>">
					<div class="hide-label-wrapper">
						<input id="<?php echo esc_attr( "custom-labels-{$evusel_customLabel['key']}-is-hidden" ); ?>" type="checkbox"
							name="<?php echo esc_attr( "evusel_settings[custom_labels][{$evusel_customLabel['key']}][is_hidden]" ); ?>"
							<?php echo $evuselConfig->get( "custom_labels.{$evusel_customLabel['key']}.is_hidden" ) === 'on' ? 'checked' : ''; ?>>
						<label for="<?php echo esc_attr( "custom-labels-{$evusel_customLabel['key']}-is-hidden" ); ?>">
							<?php esc_html_e( 'Hide label', 'eventim-us-event-listings' ); ?>
						</label>
					</div>
				</div>
			<?php endforeach; ?>
		</div>
	</div>
</div>