mirror of
https://github.com/icecoder/ICEcoder.git
synced 2026-03-03 07:13:59 +01:00
Default type is text, 2nd array defines 'other'
Changed the default type to 'text' so ICEcoder will want to open any file in the editor to begin with. This is overridden by the images array and the newly purposed 2nd array which defines types to instead pop open in a window (doc, docx, ppt, rtf, pdf ...etc).
This commit is contained in:
@@ -24,7 +24,7 @@ if ($_GET['action']=="load") {
|
||||
echo 'action="load";';
|
||||
|
||||
if (file_exists($file)) {
|
||||
$finfo = "";
|
||||
$finfo = "text";
|
||||
// Determine what to do based on mime type
|
||||
if (function_exists('finfo_open')) {
|
||||
$finfoMIME = finfo_open(FILEINFO_MIME);
|
||||
@@ -33,8 +33,8 @@ if ($_GET['action']=="load") {
|
||||
} else {
|
||||
$fileExt = explode(" ",pathinfo($file, PATHINFO_EXTENSION));
|
||||
$fileExt = $fileExt[0];
|
||||
if (array_search($fileExt,array("coffee","css","htm","html","js","json","less","md","php","py","rb","ruby","sql","txt","xml"))!==false) {$finfo = "text";};
|
||||
if (array_search($fileExt,array("gif","jpg","jpeg","png"))!==false) {$finfo = "image";};
|
||||
if (array_search($fileExt,array("doc","docx","ppt","rtf","pdf","zip","tar","gz","swf","asx","asf","midi","mp3","wav","aiff","mov","qt","wmv","mp4","odt","odg","odp"))!==false) {$finfo = "other";};
|
||||
}
|
||||
if (strpos($finfo,"text")===0 || strpos($finfo,"empty")!==false) {
|
||||
echo 'fileType="text";';
|
||||
|
||||
Reference in New Issue
Block a user