nextcloud/apps/gallery/appinfo/app.php

60 lines
2.1 KiB
PHP
Raw Normal View History

2011-10-02 14:24:02 +04:00
<?php
2012-01-08 14:01:25 +04: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/>.
*
*/
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-03-24 21:35:16 +04:00
OC::$CLASSPATH['OC_Gallery_Sharing'] = 'apps/gallery/lib/sharing.php';
OC::$CLASSPATH['OC_Gallery_Hooks_Handlers'] = 'apps/gallery/lib/hooks_handlers.php';
2011-12-08 23:04:56 +04:00
2012-04-14 18:44:15 +04:00
$l = OC_L10N::get('gallery');
2012-01-15 15:11:04 +04:00
2011-09-26 00:32:08 +04:00
OC_App::register(array(
'order' => 20,
'id' => 'gallery',
'name' => 'Pictures'));
2011-09-26 00:32:08 +04:00
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'),
'name' => $l->t('Pictures')));
2011-10-02 21:33:55 +04:00
class OC_GallerySearchProvider extends OC_Search_Provider{
function search($query){
2011-10-02 21:33:55 +04:00
$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('gallery', 'index.php').'?view='.$row['album_name'],'Galleries');
2011-10-02 21:33:55 +04:00
}
return $results;
}
}
OC_Search::registerProvider('OC_GallerySearchProvider');
require_once('apps/gallery/lib/hooks_handlers.php');
2011-09-26 00:32:08 +04:00
?>