summaryrefslogtreecommitdiffstats
path: root/lib/search
diff options
context:
space:
mode:
authorRobin Appelman <icewind1991@gmail.com>2011-08-03 00:30:21 +0200
committerRobin Appelman <icewind1991@gmail.com>2011-08-03 00:30:21 +0200
commita2062036d325c45a7bc0e50ddb39fe5b238cde41 (patch)
treecfac15d4d91a8c0343f4f576bc69210122c239b8 /lib/search
parentad513284081da89c1d25936b3b2aeca16a8732ab (diff)
downloadnextcloud-server-a2062036d325c45a7bc0e50ddb39fe5b238cde41.tar.gz
nextcloud-server-a2062036d325c45a7bc0e50ddb39fe5b238cde41.zip
selecting a text file from the search results now activates the text viewer
Diffstat (limited to 'lib/search')
-rw-r--r--lib/search/provider/file.php9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/search/provider/file.php b/lib/search/provider/file.php
index f3d235abdce..5fd35fa3e52 100644
--- a/lib/search/provider/file.php
+++ b/lib/search/provider/file.php
@@ -13,11 +13,18 @@ class OC_Search_Provider_File extends OC_Search_Provider{
switch($mimeBase){
case 'audio':
break;
+ case 'text':
+ $results[]=new OC_Search_Result(basename($file),'',OC_Helper::linkTo( 'files', 'download.php?file='.$file ),'Text');
+ break;
case 'image':
$results[]=new OC_Search_Result(basename($file),'',OC_Helper::linkTo( 'files', 'download.php?file='.$file ),'Images');
break;
default:
- $results[]=new OC_Search_Result(basename($file),'',OC_Helper::linkTo( 'files', 'download.php?file='.$file ),'Files');
+ if($mime=='application/xml'){
+ $results[]=new OC_Search_Result(basename($file),'',OC_Helper::linkTo( 'files', 'download.php?file='.$file ),'Text');
+ }else{
+ $results[]=new OC_Search_Result(basename($file),'',OC_Helper::linkTo( 'files', 'download.php?file='.$file ),'Files');
+ }
}
}
}