getExt($file); if(!Director::fileExists("themes/".SSViewer::current_theme()."/images/icons/file_extension_{$ext}.png")) { $ext = $this->appCategory($file); } if(!Director::fileExists("themes/".SSViewer::current_theme()."/images/icons/file_extension_{$ext}.png")) { $ext = "generic"; } return "themes/".SSViewer::current_theme()."/images/icons/file_extension_{$ext}.png"; } function getExt($file){ $ext = pathinfo($file, PATHINFO_EXTENSION); return $ext; } public function appCategory($file) { $ext = $this->getExt($file); switch($ext) { case "aif": case "au": case "mid": case "midi": case "mp3": case "ra": case "ram": case "rm": case "mp3": case "wav": case "m4a": case "snd": case "aifc": case "aiff": case "wma": case "apl": case "avr": case "cda": case "mp4": case "ogg": return "audio"; case "mpeg": case "mpg": case "m1v": case "mp2": case "mpa": case "mpe": case "ifo": case "vob": case "avi": case "wmv": case "asf": case "m2v": case "qt": return "video"; case "arc": case "rar": case "tar": case "gz": case "tgz": case "bz2": case "dmg": case "jar": case "ace": case "arj": case "bz": case "cab": return "zip"; case "bmp": case "gif": case "jpg": case "jpeg": case "pcx": case "tif": case "png": case "alpha": case "als": case "cel": case "icon": case "ico": case "ps": return "img"; case "key": case "pptx": case "ppt": return "ppt"; case "doc": case "docx": return "doc"; case "xls": case "xlsx": return "xls"; } } }