0byt3m1n1
Path:
/
data
/
applications
/
aps
/
gallery
/
2.2-08
/
htdocs
/
modules
/
mime
/
classes
/
[
Home
]
File: MimeHelper.class
<?php /* * Gallery - a web based photo album viewer and editor * Copyright (C) 2000-2007 Bharat Mediratta * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or (at * your option) any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ /** * Utility functions useful in managing MIME types * @package Mime * @subpackage Classes * @author Felix Rabinovich <Felix@Rabinovich.org> * @version $Revision: 15513 $ * @static */ class MimeHelper { /** * Return mime types and applicable file extensions * * @return array object GalleryStatus a status code * array('ext' => array(string mime type => array of string extensions) * 'viewable' => array(string mime type => boolean is viewable)) */ function getMimeTypeMap() { list ($ret, $searchResults) = GalleryCoreApi::getMapEntry('GalleryMimeTypeMap', array('mimeType', 'extension', 'viewable'), array(), array('orderBy' => array('mimeType' => ORDER_ASCENDING))); if ($ret) { return array($ret, null); } while ($result = $searchResults->nextResult()) { $MimeTypeMap['ext'][$result[0]][] = $result[1]; $MimeTypeMap['viewable'][$result[0]] = $result[2]; } return array(null, $MimeTypeMap); } } ?>