Beispiel #1
0
/**
 * Formated Date Output, special handling for params on windows
 *
 * @since  3.4
 * @author  cnb
 * 
 * @param  string $format    A strftime or date format
 * @param  time $timestamp   A timestamp
 * @param  bool $uselocale   if true, set and unset locale
 * @return string            returns a formated date string
 */
function formatDate($format, $timestamp = null, $uselocale = true)
{
    if (!$timestamp) {
        $timestamp = time();
    }
    // debugLog(__FUNCTION__.' '.$format.' '.$timestamp.' '.$uselocale);
    // if no strfttime tokens found just use date
    // @todo add a date token -> strftime token converter here
    if (strpos($format, '%') === false) {
        $date = date($format, $timestamp);
    } else {
        // set locale temporarily for strfttime
        if ($uselocale) {
            setNewLocale(LC_TIME);
        }
        if (hostIsWindows()) {
            # fixes for Windows
            $format = preg_replace('#(?<!%)((?:%%)*)%e#', '\\1%#d', $format);
            // strftime %e parameter not supported
            $date = utf8_encode(strftime($format, $timestamp));
            // strftime returns ISO-8859-1 encoded string
        } else {
            $date = strftime($format, $timestamp);
        }
        if ($uselocale) {
            restoreOldLocale(LC_TIME);
        }
    }
    return $date;
}
Beispiel #2
0
        if (create_dir($path . $cleanname, $chmod_value)) {
            //create folder for thumbnails
            $thumbFolder = GSTHUMBNAILPATH . $subFolder . $cleanname;
            if (!file_exists($thumbFolder)) {
                create_dir($thumbFolder, $chmod_value);
            }
            $success = sprintf(i18n_r('FOLDER_CREATED'), $cleanname);
        } else {
            $error = i18n_r('ERROR_CREATING_FOLDER');
        }
    }
}
$pagetitle = i18n_r('FILE_MANAGEMENT');
get_template('header');
// check if host uses Linux (used for displaying permissions
$isUnixHost = !hostIsWindows();
function getUploadIcon($type)
{
    if ($type == '.') {
        $class = 'folder';
    } else {
        $class = getFileIconClass($type) . '-o';
    }
    return '<span class="fa fa-fw fa-' . $class . ' icon-left"></span>';
}
?>
	
<?php 
include 'template/include-nav.php';
?>