summaryrefslogtreecommitdiffstats
path: root/apps/bookmarks
diff options
context:
space:
mode:
authorBart Visscher <bartv@thisnet.nl>2012-03-01 22:58:44 +0100
committerBart Visscher <bartv@thisnet.nl>2012-03-01 22:59:35 +0100
commitd1dcd7893cb878263b8179bab16d101036c57a88 (patch)
treec2759b3d1a862fed99144d79907d9b9628671d90 /apps/bookmarks
parent8c7b13db7011c8be986e9e525ca392bb13375432 (diff)
downloadnextcloud-server-d1dcd7893cb878263b8179bab16d101036c57a88.tar.gz
nextcloud-server-d1dcd7893cb878263b8179bab16d101036c57a88.zip
Search: Change provider registration to class name, for lazy loading of search providers
Diffstat (limited to 'apps/bookmarks')
-rw-r--r--apps/bookmarks/appinfo/app.php3
-rw-r--r--apps/bookmarks/lib/search.php7
2 files changed, 4 insertions, 6 deletions
diff --git a/apps/bookmarks/appinfo/app.php b/apps/bookmarks/appinfo/app.php
index a1f6139d89b..09d7b5df525 100644
--- a/apps/bookmarks/appinfo/app.php
+++ b/apps/bookmarks/appinfo/app.php
@@ -8,6 +8,7 @@
*/
OC::$CLASSPATH['OC_Bookmarks_Bookmarks'] = 'apps/bookmarks/lib/bookmarks.php';
+OC::$CLASSPATH['OC_Search_Provider_Bookmarks'] = 'apps/bookmarks/lib/search.php';
OC_App::register( array( 'order' => 70, 'id' => 'bookmark', 'name' => 'Bookmarks' ));
@@ -15,5 +16,5 @@ $l = new OC_l10n('bookmarks');
OC_App::addNavigationEntry( array( 'id' => 'bookmarks_index', 'order' => 70, 'href' => OC_Helper::linkTo( 'bookmarks', 'index.php' ), 'icon' => OC_Helper::imagePath( 'bookmarks', 'bookmarks.png' ), 'name' => $l->t('Bookmarks')));
OC_App::registerPersonal('bookmarks', 'settings');
-require_once('apps/bookmarks/lib/search.php');
OC_Util::addScript('bookmarks','bookmarksearch');
+OC_Search::registerProvider('OC_Search_Provider_Bookmarks');
diff --git a/apps/bookmarks/lib/search.php b/apps/bookmarks/lib/search.php
index 59495db82ea..235587855d9 100644
--- a/apps/bookmarks/lib/search.php
+++ b/apps/bookmarks/lib/search.php
@@ -20,8 +20,8 @@
*
*/
-class OC_Search_Provider_Bookmarks extends OC_Search_Provider{
- function search($query){
+class OC_Search_Provider_Bookmarks implements OC_Search_Provider{
+ static function search($query){
$results=array();
$offset = 0;
@@ -45,6 +45,3 @@ class OC_Search_Provider_Bookmarks extends OC_Search_Provider{
return $results;
}
}
-new OC_Search_Provider_Bookmarks();
-
-?>