aboutsummaryrefslogtreecommitdiffstats
path: root/include/text.php
diff options
context:
space:
mode:
authorzotlabs <mike@macgirvin.com>2017-11-19 17:39:19 -0800
committerzotlabs <mike@macgirvin.com>2017-11-19 17:39:19 -0800
commit4cd0b745cbc24a035a5e9ba488917ec7beeda888 (patch)
treefaad8cf0e7ef2a720ce002e6b280ae31a77971d0 /include/text.php
parentcf4588f16fbe6dc55eabdb590480bc88d560dad3 (diff)
parent88d0bf94d89ac739469528bdab7905d0c00cf8a9 (diff)
downloadvolse-hubzilla-4cd0b745cbc24a035a5e9ba488917ec7beeda888.tar.gz
volse-hubzilla-4cd0b745cbc24a035a5e9ba488917ec7beeda888.tar.bz2
volse-hubzilla-4cd0b745cbc24a035a5e9ba488917ec7beeda888.zip
Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge
Diffstat (limited to 'include/text.php')
-rw-r--r--include/text.php27
1 files changed, 26 insertions, 1 deletions
diff --git a/include/text.php b/include/text.php
index c74e515d2..ee8318d7c 100644
--- a/include/text.php
+++ b/include/text.php
@@ -2710,6 +2710,9 @@ function getIconFromType($type) {
'application/octet-stream' => 'fa-file-o',
//Text
'text/plain' => 'fa-file-text-o',
+ 'text/markdown' => 'fa-file-text-o',
+ 'text/bbcode' => 'fa-file-text-o',
+ 'text/html' => 'fa-file-text-o',
'application/msword' => 'fa-file-word-o',
'application/pdf' => 'fa-file-pdf-o',
'application/vnd.oasis.opendocument.text' => 'fa-file-word-o',
@@ -2739,11 +2742,33 @@ function getIconFromType($type) {
'video/x-matroska' => 'fa-file-video-o'
);
- $iconFromType = 'fa-file-o';
+ $catMap = [
+ 'application' => 'fa-file-code-o',
+ 'multipart' => 'fa-folder',
+ 'audio' => 'fa-file-audio-o',
+ 'video' => 'fa-file-video-o',
+ 'text' => 'fa-file-text-o',
+ 'image' => 'fa=file-picture-o',
+ 'message' => 'fa-file-text-o'
+ ];
+
+
+ $iconFromType = '';
if (array_key_exists($type, $iconMap)) {
$iconFromType = $iconMap[$type];
}
+ else {
+ $parts = explode('/',$type);
+ if($parts[0] && $catMap[$parts[0]]) {
+ $iconFromType = $catMap[$parts[0]];
+ }
+ }
+
+ if(! $iconFromType) {
+ $iconFromType = 'fa-file-o';
+ }
+
return $iconFromType;
}