aboutsummaryrefslogtreecommitdiffstats
path: root/include/text.php
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2018-01-09 09:00:20 +0100
committerMario <mario@mariovavti.com>2018-01-09 09:00:20 +0100
commit4f4d0e416eac87121898b8a27b1afa6065ff17a2 (patch)
treeaae7f2582b2b9c6596dcbf87c06a836434140830 /include/text.php
parent22c89b6c660e185d5c5c6362acf23b145d932d15 (diff)
parent8fde0f01b8472082158b38386046ed606bcfbc49 (diff)
downloadvolse-hubzilla-4f4d0e416eac87121898b8a27b1afa6065ff17a2.tar.gz
volse-hubzilla-4f4d0e416eac87121898b8a27b1afa6065ff17a2.tar.bz2
volse-hubzilla-4f4d0e416eac87121898b8a27b1afa6065ff17a2.zip
Merge branch '3.0RC'3.0
Diffstat (limited to 'include/text.php')
-rw-r--r--include/text.php42
1 files changed, 36 insertions, 6 deletions
diff --git a/include/text.php b/include/text.php
index c74e515d2..107efe0cb 100644
--- a/include/text.php
+++ b/include/text.php
@@ -1679,9 +1679,9 @@ function prepare_text($text, $content_type = 'text/bbcode', $cache = false) {
require_once('include/bbcode.php');
if(stristr($text,'[nosmile]'))
- $s = bbcode($text,false,true,$cache);
+ $s = bbcode($text, [ 'cache' => $cache ]);
else
- $s = smilies(bbcode($text,false,true,$cache));
+ $s = smilies(bbcode($text, [ 'cache' => $cache ]));
$s = zidify_links($s);
@@ -1754,9 +1754,14 @@ function get_plink($item,$conversation_mode = true) {
else
$key = 'llink';
+ $zidify = true;
+
+ if(array_key_exists('author',$item) && $item['author']['xchan_network'] !== 'zot')
+ $zidify = false;
+
if(x($item,$key)) {
return array(
- 'href' => zid($item[$key]),
+ 'href' => (($zidify) ? zid($item[$key]) : $item[$key]),
'title' => t('Link to Source'),
);
}
@@ -2704,12 +2709,15 @@ function linkify_tags($a, &$body, $uid, $diaspora = false) {
function getIconFromType($type) {
$iconMap = array(
//Folder
- t('Collection') => 'fa-folder',
- 'multipart/mixed' => 'fa-folder', //dirs in attach use this mime type
+ t('Collection') => 'fa-folder-o',
+ 'multipart/mixed' => 'fa-folder-o', //dirs in attach use this mime type
//Common file
'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 +2747,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;
}