Change search to use routing

This commit is contained in:
Bart Visscher 2012-10-28 19:28:44 +01:00
parent 1bdd0c949b
commit ed7accd237
3 changed files with 7 additions and 6 deletions

View File

@ -113,7 +113,7 @@ var OC={
} }
link+=file; link+=file;
}else{ }else{
if ((app == 'settings' || app == 'core') && type == 'ajax') { if ((app == 'settings' || app == 'core' || app == 'search') && type == 'ajax') {
link+='/index.php/'; link+='/index.php/';
} }
else { else {

View File

@ -9,6 +9,9 @@
require_once 'settings/routes.php'; require_once 'settings/routes.php';
// Core ajax actions // Core ajax actions
// Search
$this->create('search_ajax_search', '/search/ajax/search.php')
->actionInclude('search/ajax/search.php');
// AppConfig // AppConfig
$this->create('core_ajax_appconfig', '/core/ajax/appconfig.php') $this->create('core_ajax_appconfig', '/core/ajax/appconfig.php')
->actionInclude('core/ajax/appconfig.php'); ->actionInclude('core/ajax/appconfig.php');

View File

@ -21,17 +21,15 @@
* *
*/ */
// Init owncloud
require_once '../../lib/base.php';
// Check if we are a user // Check if we are a user
OC_JSON::checkLoggedIn(); OC_JSON::checkLoggedIn();
OC_App::loadApps();
$query=(isset($_GET['query']))?$_GET['query']:''; $query=(isset($_GET['query']))?$_GET['query']:'';
if($query) { if($query) {
$result=OC_Search::search($query); $result=OC_Search::search($query);
OC_JSON::encodedPrint($result); OC_JSON::encodedPrint($result);
}else{ }
else {
echo 'false'; echo 'false';
} }