2011-10-02 10:24:02 +00:00
|
|
|
<?php
|
2012-01-08 10:01:25 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* ownCloud - gallery application
|
|
|
|
*
|
|
|
|
* @author Bartek Przybylski
|
|
|
|
* @copyright 2012 Bartek Przybylski bart.p.pl@gmail.com
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 3 of the License, or any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2012-06-22 22:05:39 +00:00
|
|
|
OC::$CLASSPATH['OC_Gallery_Album'] = 'gallery/lib/album.php';
|
|
|
|
OC::$CLASSPATH['OC_Gallery_Photo'] = 'gallery/lib/photo.php';
|
|
|
|
OC::$CLASSPATH['OC_Gallery_Scanner'] = 'gallery/lib/scanner.php';
|
|
|
|
OC::$CLASSPATH['OC_Gallery_Sharing'] = 'gallery/lib/sharing.php';
|
|
|
|
OC::$CLASSPATH['OC_Gallery_Hooks_Handlers'] = 'gallery/lib/hooks_handlers.php';
|
|
|
|
OC::$CLASSPATH['Pictures_Managers'] = 'gallery/lib/managers.php';
|
|
|
|
OC::$CLASSPATH['Pictures_Tiles'] = 'gallery/lib/tiles.php';
|
2011-12-08 19:04:56 +00:00
|
|
|
|
2012-04-14 14:44:15 +00:00
|
|
|
$l = OC_L10N::get('gallery');
|
2012-01-15 11:11:04 +00:00
|
|
|
|
2012-05-01 22:50:26 +00:00
|
|
|
OCP\App::addNavigationEntry( array(
|
2011-09-25 20:32:08 +00:00
|
|
|
'id' => 'gallery_index',
|
|
|
|
'order' => 20,
|
2012-05-01 21:19:39 +00:00
|
|
|
'href' => OCP\Util::linkTo('gallery', 'index.php'),
|
2012-05-01 22:20:45 +00:00
|
|
|
'icon' => OCP\Util::imagePath('core', 'places/picture.svg'),
|
2012-03-30 16:15:03 +00:00
|
|
|
'name' => $l->t('Pictures')));
|
2011-10-02 17:33:55 +00:00
|
|
|
|
2012-04-14 09:29:44 +00:00
|
|
|
class OC_GallerySearchProvider extends OC_Search_Provider{
|
|
|
|
function search($query){
|
2012-05-03 11:06:08 +00:00
|
|
|
$stmt = OCP\DB::prepare('SELECT * FROM *PREFIX*gallery_albums WHERE uid_owner = ? AND album_name LIKE ?');
|
2012-05-01 16:50:31 +00:00
|
|
|
$result = $stmt->execute(array(OCP\USER::getUser(),'%'.$query.'%'));
|
2011-10-02 17:33:55 +00:00
|
|
|
$results=array();
|
|
|
|
while($row=$result->fetchRow()){
|
2012-05-01 21:19:39 +00:00
|
|
|
$results[]=new OC_Search_Result($row['album_name'],'',OCP\Util::linkTo('gallery', 'index.php').'?view='.$row['album_name'],'Galleries');
|
2011-10-02 17:33:55 +00:00
|
|
|
}
|
|
|
|
return $results;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-06-10 07:52:01 +00:00
|
|
|
//OC_Search::registerProvider('OC_GallerySearchProvider');
|
2012-01-07 23:14:34 +00:00
|
|
|
|
2012-06-22 22:05:39 +00:00
|
|
|
require_once('gallery/lib/hooks_handlers.php');
|