public static function buildStatusWidget($name, $current = self::STATUS_CONFIRMED, $any = false)
{
$html = "<select id=\"{$name}\" name=\"{$name}\">";
$statii = array(self::STATUS_FREE, self::STATUS_TENTATIVE, self::STATUS_CONFIRMED, self::STATUS_CANCELLED);
if (!isset($current)) {
$current = self::STATUS_NONE;
}
if ($any) {
$html .= "<option value=\"" . self::STATUS_NONE . "\"";
$html .= $current == self::STATUS_NONE ? ' selected="selected">' : '>';
$html .= _("Any") . "</option>";
}
foreach ($statii as $status) {
$html .= "<option value=\"{$status}\"";
$html .= $status == $current ? ' selected="selected">' : '>';
$html .= self::statusToString($status) . "</option>";
}
$html .= '</select>';
return $html;
}