Back to PhocacartTime class

Method getTimeType

public static
getTimeType
(mixed $type = 1, mixed $format = 0)

Method getTimeType - Source code

public static function getTimeType($type = 1, $format = 0)
{
    $t = '';
    $c = '';
    switch ($type) {
        case 2:
            $t = Text::_('COM_PHOCACART_CLOSING_HOURS');
            $c = "label label-important label-danger badge bg-danger";
            break;
        case 3:
            $t = Text::_('COM_PHOCACART_CLOSING_DAYS');
            $c = "label label-important label-danger badge bg-danger";
            break;
        case 1:
        default:
            $t = Text::_('COM_PHOCACART_OPENING_HOURS');
            $c = "label label-important label-success";
            break;
    }
    if ($t != '' && $format == 1) {
        return '<span class="' . $c . '">' . $t . '</span>';
    }
    return $t;
}