예제 #1
0
function format_file_glyphicon(FileModel $file)
{
    if ($file->type() == 'dir') {
        return 'glyphicon glyphicon-folder-close';
    }
    switch ($file->mime()) {
        case 'image/gif':
        case 'image/jpeg':
        case 'image/png':
        case 'image/svg+xml':
        case 'image/tiff':
        case 'image/vnd.microsoft.icon':
        case 'image/x-ms-bmp':
            return 'glyphicon glyphicon-picture';
        case 'video/3gpp':
        case 'video/annodex':
        case 'video/dl':
        case 'video/dv':
        case 'video/fli':
        case 'video/gl':
        case 'video/mpeg':
        case 'video/MP2T':
        case 'video/mp4':
        case 'video/quicktime':
        case 'video/mp4v-es':
        case 'video/ogg':
        case 'video/parityfec':
        case 'video/pointer':
        case 'video/webm':
        case 'video/vnd.fvt':
        case 'video/vnd.motorola.video':
        case 'video/vnd.motorola.videop':
        case 'video/vnd.mpegurl':
        case 'video/vnd.mts':
        case 'video/vnd.nokia.interleaved-multimedia':
        case 'video/vnd.vivo':
        case 'video/x-flv':
        case 'video/x-la-asf':
        case 'video/x-mng':
        case 'video/x-ms-asf':
        case 'video/x-ms-wm':
        case 'video/x-ms-wmv':
        case 'video/x-ms-wmx':
        case 'video/x-ms-wvx':
        case 'video/x-msvideo':
        case 'video/x-sgi-movie':
        case 'video/x-matroska':
            return 'glyphicon glyphicon-film';
        case 'audio/32kadpcm':
        case 'audio/3gpp':
        case 'audio/amr':
        case 'audio/amr-wb':
        case 'audio/annodex':
        case 'audio/basic':
        case 'audio/csound':
        case 'audio/flac':
        case 'audio/g.722.1':
        case 'audio/l16':
        case 'audio/midi':
        case 'audio/mp4a-latm':
        case 'audio/mpa-robust':
        case 'audio/mpeg':
        case 'audio/mpegurl':
        case 'audio/ogg':
        case 'audio/parityfec':
        case 'audio/prs.sid':
        case 'audio/telephone-event':
        case 'audio/tone':
        case 'audio/vnd.cisco.nse':
        case 'audio/vnd.cns.anp1':
        case 'audio/vnd.cns.inf1':
        case 'audio/vnd.digital-winds':
        case 'audio/vnd.everad.plj':
        case 'audio/vnd.lucent.voice':
        case 'audio/vnd.nortel.vbk':
        case 'audio/vnd.nuera.ecelp4800':
        case 'audio/vnd.nuera.ecelp7470':
        case 'audio/vnd.nuera.ecelp9600':
        case 'audio/vnd.octel.sbc':
        case 'audio/vnd.qcelp':
        case 'audio/vnd.rhetorex.32kadpcm':
        case 'audio/vnd.vmx.cvsd':
        case 'audio/x-aiff':
        case 'audio/x-gsm':
        case 'audio/x-mpegurl':
        case 'audio/x-ms-wma':
        case 'audio/x-ms-wax':
        case 'audio/x-pn-realaudio-plugin':
        case 'audio/x-pn-realaudio':
        case 'audio/x-realaudio':
        case 'audio/x-scpls':
        case 'audio/x-sd2':
        case 'audio/x-wav':
            return 'glyphicon glyphicon-music';
        default:
            return 'glyphicon glyphicon-file';
    }
}