Commit c38aeea901aa9589791e823f16082f6100d632d9
1 parent
e655ef86
added getMimeTypeIconUrl method
git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@453 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
1 changed file
with
19 additions
and
0 deletions
lib/documentmanagement/Document.inc
| @@ -374,6 +374,25 @@ class Document { | @@ -374,6 +374,25 @@ class Document { | ||
| 374 | return false; | 374 | return false; |
| 375 | } | 375 | } |
| 376 | 376 | ||
| 377 | + /** | ||
| 378 | + * Returns the url to the file type icon associated with this document | ||
| 379 | + * | ||
| 380 | + * @return string the url to the relevant file icon, false if there is none | ||
| 381 | + */ | ||
| 382 | + function getMimeTypeIconUrl() { | ||
| 383 | + global $default; | ||
| 384 | + if ($this->iMimeTypeID) { | ||
| 385 | + // lookup the icon from the table | ||
| 386 | + $sIconPath = lookupField($default->owl_mime_table, "icon_path", "id", $this->iMimeTypeID); | ||
| 387 | + if (strlen($sIconPath) > 0) { | ||
| 388 | + return $default->owl_graphics_url . "/" . $sIconPath; | ||
| 389 | + } else { | ||
| 390 | + return false; | ||
| 391 | + } | ||
| 392 | + } else { | ||
| 393 | + return false; | ||
| 394 | + } | ||
| 395 | + } | ||
| 377 | } | 396 | } |
| 378 | 397 | ||
| 379 | ?> | 398 | ?> |