<?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 wpbookingpro_render_content($id); ?>" for="<?php wpbookingpro_render_content($for); ?>"<?php if (!empty($classes)) echo ' class="' . implode(' ', $classes) . '"'; ?><?php wpbookingpro_render_content($title); ?><?php wpbookingpro_render_content($position); ?>>
	<?php wpbookingpro_render_content($text); ?><?php if ($required) : ?><span class="star">&#160;*</span><?php endif; ?>
</label>
