Skip to content
Snippets Groups Projects
Commit 7bcc0efd authored by Robin Appelman's avatar Robin Appelman
Browse files

show galleries in search results

parent 39c4d9b2
No related branches found
No related tags found
No related merge requests found
......@@ -10,4 +10,18 @@ OC_App::addNavigationEntry( array(
'href' => OC_Helper::linkTo('gallery', 'index.php'),
'icon' => OC_Helper::linkTo('', 'core/img/filetypes/image.png'),
'name' => 'Gallery'));
class OC_GallerySearchProvider extends OC_Search_Provider{
function search($query){
$stmt = OC_DB::prepare('SELECT * FROM *PREFIX*gallery_albums WHERE uid_owner = ? AND album_name LIKE ?');
$result = $stmt->execute(array(OC_User::getUser(),'%'.$query.'%'));
$results=array();
while($row=$result->fetchRow()){
$results[]=new OC_Search_Result($row['album_name'],'',OC_Helper::linkTo( 'apps/gallery', 'index.php?view='.$row['album_name']),'Galleries');
}
return $results;
}
}
new OC_GallerySearchProvider();
?>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment