<?php

use WpBookingHotel\Factory;
use WpBookingHotel\Language\Text;

defined('_WPBOOKINGHOTEL_EXEC') or die;
extract($displayData);

$classes = array_filter((array)$classes);
$id = $for . '-lbl';
$title = '';
if (!empty($description)) {
	if ($text && $text !== $description) {
		$classes[] = 'hasPopover';
		$title = ' title="' . htmlspecialchars(trim($text, ':')) . '"'
			. ' data-content="' . htmlspecialchars($description) . '"';

	} else {
		$classes[] = 'hasTooltip';

	}
}
if ($required) {
	$classes[] = 'required';
}
?>
<label id="<?php Text::_echo_no_translate($id); ?>" for="<?php Text::_echo_no_translate($for); ?>"<?php if (!empty($classes)) {
	echo ' class="' . implode(' ', $classes) . '"';
} ?><?php Text::_echo_no_translate($position); ?>>
	<?php Text::_echo_no_translate($text); ?><?php if ($required) : ?><span class="star">&#160;*</span><?php endif; ?>
</label>
