Commit 2ca1534938e124c415102955f0ca587c843ca112

Authored by Megan Watson
1 parent 57a3536a

KTS-4282 Added function to get the file extension for use in the pdf converter.

Fixed.

Committed by: Megan Watson
Showing 1 changed file with 14 additions and 0 deletions
lib/mime.inc.php
... ... @@ -287,6 +287,20 @@ class KTMime {
287 287 $res = DBUtil::getResultArray($aQuery);
288 288 return $res;
289 289 }
  290 +
  291 + /**
  292 + * Gets the file type / extension based on the mimetype id
  293 + *
  294 + * @param int $iMimeTypeID
  295 + */
  296 + function getFileType($iMimeTypeID)
  297 + {
  298 + $sTable = KTUtil::getTableName('mimetypes');
  299 + $sQuery = "SELECT filetypes FROM " . $sTable . " WHERE id = ?";
  300 + $aQuery = array($sQuery, array($iMimeTypeID));
  301 + $ext = DBUtil::getOneResultKey($aQuery, 'filetypes');
  302 + return $ext;
  303 + }
290 304 }
291 305  
292 306 $_KT_icon_path_cache = array();
... ...