diff options
Diffstat (limited to 'lib/search/provider/file.php')
-rw-r--r-- | lib/search/provider/file.php | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/search/provider/file.php b/lib/search/provider/file.php new file mode 100644 index 00000000000..892c431e05a --- /dev/null +++ b/lib/search/provider/file.php @@ -0,0 +1,16 @@ +<?php + +class OC_Search_Provider_File extends OC_Search_Provider{ + function search($query){ + $files=OC_FILESYSTEM::search($query); + $results=array(); + foreach($files as $file){ + if(OC_FILESYSTEM::is_dir($file)){ + $results[]=new OC_Search_Result(basename($file),$file,OC_HELPER::linkTo( 'files', 'index.php?dir='.$file ),'Files'); + }else{ + $results[]=new OC_Search_Result(basename($file),$file,OC_HELPER::linkTo( 'files', 'download.php?file='.$file ),'Files'); + } + } + return $results; + } +} |