diff options
author | Bart Visscher <bartv@thisnet.nl> | 2012-10-28 19:28:44 +0100 |
---|---|---|
committer | Bart Visscher <bartv@thisnet.nl> | 2012-10-29 15:04:55 +0100 |
commit | ed7accd237bae2bd76df5e6256d8ee2ce2f14308 (patch) | |
tree | f28e327add5e36e8f2c65d0a916ce75928ee90e3 | |
parent | 1bdd0c949bca2f68da0ab3f47efbec10a7e51702 (diff) | |
download | nextcloud-server-ed7accd237bae2bd76df5e6256d8ee2ce2f14308.tar.gz nextcloud-server-ed7accd237bae2bd76df5e6256d8ee2ce2f14308.zip |
Change search to use routing
-rw-r--r-- | core/js/js.js | 2 | ||||
-rw-r--r-- | core/routes.php | 3 | ||||
-rw-r--r-- | search/ajax/search.php | 8 |
3 files changed, 7 insertions, 6 deletions
diff --git a/core/js/js.js b/core/js/js.js index 6ed50b42bd5..2073fc4d4b7 100644 --- a/core/js/js.js +++ b/core/js/js.js @@ -113,7 +113,7 @@ var OC={ } link+=file; }else{ - if ((app == 'settings' || app == 'core') && type == 'ajax') { + if ((app == 'settings' || app == 'core' || app == 'search') && type == 'ajax') { link+='/index.php/'; } else { diff --git a/core/routes.php b/core/routes.php index 186fa8ae562..5c99c542d48 100644 --- a/core/routes.php +++ b/core/routes.php @@ -9,6 +9,9 @@ require_once 'settings/routes.php'; // Core ajax actions +// Search +$this->create('search_ajax_search', '/search/ajax/search.php') + ->actionInclude('search/ajax/search.php'); // AppConfig $this->create('core_ajax_appconfig', '/core/ajax/appconfig.php') ->actionInclude('core/ajax/appconfig.php'); diff --git a/search/ajax/search.php b/search/ajax/search.php index 41ee9ad5aba..f0ca5752b9a 100644 --- a/search/ajax/search.php +++ b/search/ajax/search.php @@ -21,17 +21,15 @@ * */ - -// Init owncloud -require_once '../../lib/base.php'; - // Check if we are a user OC_JSON::checkLoggedIn(); +OC_App::loadApps(); $query=(isset($_GET['query']))?$_GET['query']:''; if($query) { $result=OC_Search::search($query); OC_JSON::encodedPrint($result); -}else{ +} +else { echo 'false'; } |