From df7c02eb588a9a5f4b14401ea9bde564132b4e0e Mon Sep 17 00:00:00 2001 From: Tom Schaefer Date: Mon, 26 Jul 2010 11:55:01 -0400 Subject: Add filemgr package new file: config/filemgr/file_manager.tmp new file: config/filemgr/filemgr.inc new file: config/filemgr/filemgr.xml new file: config/filemgr/index.tmp new file: config/filemgr/rbfmimg/bg_footer.png new file: config/filemgr/rbfmimg/bg_header.png new file: config/filemgr/rbfmimg/bg_page.png new file: config/filemgr/rbfmimg/file_editor_bg.png new file: config/filemgr/rbfmimg/folder.png new file: config/filemgr/rbfmimg/folder_go.png new file: config/filemgr/rbfmimg/folder_up.png new file: config/filemgr/rbfmimg/go.png new file: config/filemgr/rbfmimg/ico_delete.png new file: config/filemgr/rbfmimg/ico_download.png new file: config/filemgr/rbfmimg/ico_file.png new file: config/filemgr/rbfmimg/ico_html.png new file: config/filemgr/rbfmimg/ico_open_as_web.png new file: config/filemgr/rbfmimg/ico_php.png new file: config/filemgr/rbfmimg/ico_picture.png new file: config/filemgr/rbfmimg/ico_rename.png new file: config/filemgr/rbfmimg/ico_script_edit.png new file: config/filemgr/rbfmimg/ico_use_file.png new file: config/filemgr/rbfmimg/ico_use_file_inactive.png new file: config/filemgr/rbfmimg/index.html new file: config/filemgr/rbfmimg/new.png new file: config/filemgr/rbfminc/config.tmp new file: config/filemgr/rbfminc/download.tmp new file: config/filemgr/rbfminc/file_editor_style.css new file: config/filemgr/rbfminc/functions.tmp new file: config/filemgr/rbfminc/index.html new file: config/filemgr/rbfminc/rename.tmp new file: config/filemgr/rbfminc/session.tmp modified: pkg_config.7.xml modified: pkg_config.8.xml new file: pkg_config.8.xml.amd64~ --- config/filemgr/rbfminc/functions.tmp | 189 +++++++++++++++++++++++++++++++++++ 1 file changed, 189 insertions(+) create mode 100644 config/filemgr/rbfminc/functions.tmp (limited to 'config/filemgr/rbfminc/functions.tmp') diff --git a/config/filemgr/rbfminc/functions.tmp b/config/filemgr/rbfminc/functions.tmp new file mode 100644 index 00000000..f06ee69c --- /dev/null +++ b/config/filemgr/rbfminc/functions.tmp @@ -0,0 +1,189 @@ + 'image/jpeg', + 'gif' => 'image/gif', + 'png' => 'image/png', + 'bmp' => 'image/bmp', + 'tif|tiff' => 'image/tiff', + 'ico' => 'image/x-icon', + 'asf|asx|wax|wmv|wmx' => 'video/asf', + 'avi' => 'video/avi', + 'mov|qt' => 'video/quicktime', + 'mpeg|mpg|mpe' => 'video/mpeg', + 'txt|c|cc|h' => 'text/plain', + 'rtx' => 'text/richtext', + 'css' => 'text/css', + 'htm|html' => 'text/html', + 'php|php3|' => 'application/php', + 'mp3|mp4' => 'audio/mpeg', + 'ra|ram' => 'audio/x-realaudio', + 'wav' => 'audio/wav', + 'ogg' => 'audio/ogg', + 'mid|midi' => 'audio/midi', + 'wma' => 'audio/wma', + 'rtf' => 'application/rtf', + 'js' => 'application/javascript', + 'pdf' => 'application/pdf', + 'doc' => 'application/msword', + 'pot|pps|ppt' => 'application/vnd.ms-powerpoint', + 'wri' => 'application/vnd.ms-write', + 'xla|xls|xlt|xlw' => 'application/vnd.ms-excel', + 'mdb' => 'application/vnd.ms-access', + 'mpp' => 'application/vnd.ms-project', + 'swf' => 'application/x-shockwave-flash', + 'class' => 'application/java', + 'tar' => 'application/x-tar', + 'zip' => 'application/zip', + 'gz|gzip' => 'application/x-gzip', + 'exe' => 'application/x-msdownload', + // openoffice formats + 'odt' => 'application/vnd.oasis.opendocument.text', + 'odp' => 'application/vnd.oasis.opendocument.presentation', + 'ods' => 'application/vnd.oasis.opendocument.spreadsheet', + 'odg' => 'application/vnd.oasis.opendocument.graphics', + 'odc' => 'application/vnd.oasis.opendocument.chart', + 'odb' => 'application/vnd.oasis.opendocument.database', + 'odf' => 'application/vnd.oasis.opendocument.formula', + + )); + + $type = false; + $ext = false; + + foreach ($mimes as $ext_preg => $mime_match) { + $ext_preg = '!\.(' . $ext_preg . ')$!i'; + if ( preg_match($ext_preg, $filename, $ext_matches) ) { + $type = $mime_match; + $ext = $ext_matches[1]; + break; + } + } + + return compact('ext', 'type'); +} + + + +function roundsize($size){ + $i=0; + $iec = array("B", "Kb", "Mb", "Gb", "Tb"); + while (($size/1024)>1) { + $size=$size/1024; + $i++;} + return(round($size,1)." ".$iec[$i]); +} + +?> \ No newline at end of file -- cgit v1.2.3