From b7ae2062b48055b23176000691fe454f6f67f5e9 Mon Sep 17 00:00:00 2001 From: marcus Date: Thu, 28 May 2009 15:23:58 +0000 Subject: Refs #965: Search now correctly using page handler to make it easier to replace. git-svn-id: https://code.elgg.org/elgg/trunk@3308 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/lib/search.php | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 engine/lib/search.php (limited to 'engine/lib/search.php') diff --git a/engine/lib/search.php b/engine/lib/search.php new file mode 100644 index 000000000..01ba7b907 --- /dev/null +++ b/engine/lib/search.php @@ -0,0 +1,48 @@ + + * @copyright Curverider Ltd 2008-2009 + * @link http://elgg.org/ + */ + + /** + * Initialise search helper functions. + * + */ + function search_init() + { + register_page_handler('search','search_page_handler'); + } + + /** + * Page handler for search + * + * @param array $page Page elements from pain page handler + */ + function search_page_handler($page) + { + global $CONFIG; + + if (isset($page[0])) { + switch ($page[0]) { + case 'user' : + case 'users' : include_once($CONFIG->path . "search/users.php"); break; + + case 'group' : + case 'groups' : include_once($CONFIG->path . "search/groups.php"); break; + + default: include_once($CONFIG->path . "search/index.php"); + } + } + else + include_once($CONFIG->path . "search/index.php"); + } + + /** Register init system event **/ + register_elgg_event_handler('init','system','search_init'); +?> \ No newline at end of file -- cgit v1.2.3