Back to PhocaDownloadRenderFront class

Method displayNewIcon

public static
displayNewIcon
(mixed $date, mixed $time = 0)

Method displayNewIcon - Source code

public static function displayNewIcon($date, $time = 0)
{
    if ($time == 0) {
        return '';
    }
    $dateAdded = strtotime($date, time());
    $dateToday = time();
    $dateExists = $dateToday - $dateAdded;
    $dateNew = $time * 24 * 60 * 60;
    if ($dateExists < $dateNew) {
        //return ' '. JHtml::_('image', 'media/com_phocadownload/images/icon-new.png', JText::_('COM_PHOCADOWNLOAD_NEW'));
        return ' <span class="label label-warning badge bg-warning">' . Text::_('COM_PHOCADOWNLOAD_LABEL_TXT_NEW') . '</span>';
    } else {
        return '';
    }
}