diff options
Diffstat (limited to 'app/Helper/File.php')
-rw-r--r-- | app/Helper/File.php | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/app/Helper/File.php b/app/Helper/File.php index 6948fe6a..b493e64f 100644 --- a/app/Helper/File.php +++ b/app/Helper/File.php @@ -82,4 +82,26 @@ class File extends \Kanboard\Core\Base return 'image/jpeg'; } } + + /** + * Get the preview type + * + * @access public + * @param string $filename + * @return string + */ + public function getPreviewType($filename) + { + $extension = strtolower(pathinfo($filename, PATHINFO_EXTENSION)); + + switch ($extension) { + case 'md': + case 'markdown': + return 'markdown'; + case 'txt': + return 'text'; + } + + return null; + } } |