blob: 892c431e05a15533b7180443f6cd8c36730606c0 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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;
}
}
|