From 2ca1534938e124c415102955f0ca587c843ca112 Mon Sep 17 00:00:00 2001 From: Megan Watson Date: Mon, 11 May 2009 11:18:15 +0200 Subject: [PATCH] KTS-4282 Added function to get the file extension for use in the pdf converter. Fixed. --- lib/mime.inc.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+), 0 deletions(-) diff --git a/lib/mime.inc.php b/lib/mime.inc.php index 93c588e..4e3da56 100644 --- a/lib/mime.inc.php +++ b/lib/mime.inc.php @@ -287,6 +287,20 @@ class KTMime { $res = DBUtil::getResultArray($aQuery); return $res; } + + /** + * Gets the file type / extension based on the mimetype id + * + * @param int $iMimeTypeID + */ + function getFileType($iMimeTypeID) + { + $sTable = KTUtil::getTableName('mimetypes'); + $sQuery = "SELECT filetypes FROM " . $sTable . " WHERE id = ?"; + $aQuery = array($sQuery, array($iMimeTypeID)); + $ext = DBUtil::getOneResultKey($aQuery, 'filetypes'); + return $ext; + } } $_KT_icon_path_cache = array(); -- libgit2 0.21.4