<?php

defined('_WPBOOKINGPRO_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) . '"';
		if (!$position && Factory::getLanguage()->isRtl()) {
			$position = ' data-placement="left" ';
		}
	} else {
		WpBookingPro_Html::_('bootstrap.tooltip');
		$classes[] = 'hasTooltip';
		$title = ' title="' . WpBookingPro_Html::_('tooltipText', trim($text, ':'), $description, 0) . '"';
	}
}
if ($required) {
	$classes[] = 'required';
}
?>
<label id="<?php esc_html_e($id); ?>" for="<?php esc_html_e($for); ?>"<?php if (!empty($classes)) {
	echo ' class="' . implode(' ', $classes) . '"';
} ?><?php echo($title); ?><?php esc_html_e($position); ?>>
	<?php esc_html_e($text); ?><?php if ($required) : ?><span class="star">&#160;*</span><?php endif; ?>
</label>
