Example #1
0
/**
 * Returns the localized representation of the date/time.
 *
 * @param string date_format The format for the date, like the input for the PHP date() function.
 * @param int stamp the timestamp to convert
 * @return string a full date representation
 */
function date_intl($date_format, $stamp)
{
    $ret = str_replace(array('D', 'F', 'l', 'M'), array('$1', '$2', '$3', '$4'), $date_format);
    // to reduce the date calls we retrieve m and w in the same call
    $ret = date('w#m#' . $ret, $stamp);
    // extract day and month in order to replace later by intl day and month
    $aParts = explode('#', $ret);
    $ret = str_replace(array('$1', '$4', '$2', '$3'), array(getDayAbrv($aParts[0]), getMonthAbrv($aParts[1]), getMonthName($aParts[1]), getDayName($aParts[0])), $aParts[2]);
    return $ret;
}
Example #2
0
    switch ($date_format) {
        case 0:
            $clk = date('Y-m-d ' . $hr . ' T', time());
            break;
        case 1:
            $clk = date('m/d/y ' . $hr, time());
            break;
        case 2:
            $clk = date('d/m/y ' . $hr, time());
            break;
        case 4:
        case 5:
            $clk = date($hr, time());
            break;
        default:
            $clk = getDayAbrv(date('w', time())) . date(', ' . $hr, time());
    }
    $clk = str_replace(' ', ' ', $clk);
    echo '<small><span style="white-space: nowrap;">' . str_replace(' ', '&nbsp;', _("Last Refresh")) . ":</span><br /><span style=\"white-space: nowrap;\">{$clk}</span></small><br />";
}
/* Next, display the refresh button. */
echo '<small style="white-space: nowrap;">(<a href="../src/left_main.php" target="left">' . _("Check mail") . '</a>)</small></td></tr></table><br />';
/* Lastly, display the folder list. */
if ($collapse_folders) {
    /* If directed, collapse or uncollapse a folder. */
    if (isset($fold)) {
        setPref($data_dir, $username, 'collapse_folder_' . $fold, SM_BOX_COLLAPSED);
    } else {
        if (isset($unfold)) {
            setPref($data_dir, $username, 'collapse_folder_' . $unfold, SM_BOX_UNCOLLAPSED);
        }