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