From 7df2a8c0ac57785a8ad2140bc883ce4f1cafbc35 Mon Sep 17 00:00:00 2001 From: Matt Pass Date: Mon, 17 Feb 2014 07:47:51 +0000 Subject: [PATCH] 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). --- lib/file-control.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/file-control.php b/lib/file-control.php index 3b5ca5f..0bd6ca1 100644 --- a/lib/file-control.php +++ b/lib/file-control.php @@ -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";';