2011-10-02 14:24:02 +04:00
|
|
|
<?php
|
2011-12-08 23:04:56 +04:00
|
|
|
OC::$CLASSPATH['OC_Gallery_Album'] = 'apps/gallery/lib/album.php';
|
|
|
|
OC::$CLASSPATH['OC_Gallery_Photo'] = 'apps/gallery/lib/photo.php';
|
|
|
|
OC::$CLASSPATH['OC_Gallery_Scanner'] = 'apps/gallery/lib/scanner.php';
|
2012-01-08 03:14:34 +04:00
|
|
|
OC::$CLASSPATH['OC_Gallery_Hooks_Handlers'] = 'apps/gallery/lib/hooks_handlers.php';
|
2011-12-08 23:04:56 +04:00
|
|
|
|
2011-09-26 00:32:08 +04:00
|
|
|
OC_App::register(array(
|
|
|
|
'order' => 20,
|
|
|
|
'id' => 'gallery',
|
|
|
|
'name' => 'Gallery'));
|
|
|
|
|
|
|
|
OC_App::addNavigationEntry( array(
|
|
|
|
'id' => 'gallery_index',
|
|
|
|
'order' => 20,
|
|
|
|
'href' => OC_Helper::linkTo('gallery', 'index.php'),
|
2011-10-07 18:18:47 +04:00
|
|
|
'icon' => OC_Helper::imagePath('core', 'places/picture.svg'),
|
2011-09-26 00:32:08 +04:00
|
|
|
'name' => 'Gallery'));
|
2011-10-02 21:33:55 +04:00
|
|
|
|
|
|
|
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()){
|
2011-10-07 18:18:47 +04:00
|
|
|
$results[]=new OC_Search_Result($row['album_name'],'',OC_Helper::linkTo('apps/gallery', 'index.php?view='.$row['album_name']),'Galleries');
|
2011-10-02 21:33:55 +04:00
|
|
|
}
|
|
|
|
return $results;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
new OC_GallerySearchProvider();
|
2012-01-08 03:14:34 +04:00
|
|
|
|
|
|
|
require_once('apps/gallery/lib/hooks_handlers.php');
|
2011-09-26 00:32:08 +04:00
|
|
|
?>
|