aboutsummaryrefslogtreecommitdiff
path: root/engine/lib/search.php
diff options
context:
space:
mode:
authorbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2009-10-09 20:43:39 +0000
committerbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2009-10-09 20:43:39 +0000
commit34e28b1ccb73cb488f36cec692c854f9502cdd18 (patch)
treee8117952cca46ef10c6543d388e92bd6e232fb34 /engine/lib/search.php
parentf9aa70c258578d907cdeb1e9d5b26fffca5bede6 (diff)
downloadelgg-34e28b1ccb73cb488f36cec692c854f9502cdd18.tar.gz
elgg-34e28b1ccb73cb488f36cec692c854f9502cdd18.tar.bz2
Reverted back to previous copy removing Justin's search because of views problems in plugins.
git-svn-id: http://code.elgg.org/elgg/trunk@3521 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine/lib/search.php')
-rw-r--r--engine/lib/search.php50
1 files changed, 50 insertions, 0 deletions
diff --git a/engine/lib/search.php b/engine/lib/search.php
new file mode 100644
index 000000000..222c0b6e9
--- /dev/null
+++ b/engine/lib/search.php
@@ -0,0 +1,50 @@
+<?php
+ /**
+ * Elgg search helper functions.
+ *
+ * @package Elgg
+ * @subpackage Core
+ * @author Curverider Ltd <info@elgg.com>
+ * @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(!get_input('tag')) {
+ set_input('tag', $page[0]);
+ }
+
+ 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');
+?>