aboutsummaryrefslogtreecommitdiff
path: root/mod/search/index.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 /mod/search/index.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 'mod/search/index.php')
-rw-r--r--mod/search/index.php132
1 files changed, 0 insertions, 132 deletions
diff --git a/mod/search/index.php b/mod/search/index.php
deleted file mode 100644
index c6283d2f3..000000000
--- a/mod/search/index.php
+++ /dev/null
@@ -1,132 +0,0 @@
-<?php
-
- /** Main search page */
-
-global $CONFIG;
-
-$tag = get_input('tag');
-$offset = get_input('offset', 0);
-$limit = get_input('limit', 10);
-$viewtype = get_input('search_viewtype','list');
-$searchtype = get_input('searchtype', 'all');
-$object_type = get_input('object_type', '');
-$subtype = get_input('subtype', '');
-$owner_guid = get_input('owner_guid', '');
-$tagtype = get_input('tagtype', '');
-$friends = (int)get_input('friends', 0);
-
-
-$title = sprintf(elgg_echo('searchtitle'), $tag);
-
-
-if (substr_count($owner_guid,',')) {
- $owner_guid_array = explode(",",$owner_guid);
-} else {
- $owner_guid_array = $owner_guid;
-}
-if ($friends > 0) {
- if ($friends = get_user_friends($friends,'',9999)) {
- $owner_guid_array = array();
- foreach($friends as $friend) {
- $owner_guid_array[] = $friend->guid;
- }
- } else {
- $owner_guid = -1;
- }
-}
-
-// Set up submenus
-if ($object_types = get_registered_entity_types()) {
-
- foreach($object_types as $ot => $subtype_array) {
- if (is_array($subtype_array) && sizeof($subtype_array))
- foreach($subtype_array as $object_subtype) {
- $label = 'item:' . $ot;
- if (!empty($object_subtype)) $label .= ':' . $object_subtype;
- add_submenu_item(elgg_echo($label), $CONFIG->wwwroot . "pg/search/?tag=". urlencode($tag) ."&subtype=" . $object_subtype . "&object_type=". urlencode($ot) ."&tagtype=" . urlencode($md_type) . "&owner_guid=" . urlencode($owner_guid));
- }
- }
- add_submenu_item(elgg_echo('all'), $CONFIG->wwwroot . "pg/search/?tag=". urlencode($tag) ."&owner_guid=" . urlencode($owner_guid));
-
-}
-
-$body = '';
-if (!empty($tag)) {
-
- // blank the results to start off
- $results = new stdClass();
- $results->entities = array();
- $results->total = 0;
-
- $results = trigger_plugin_hook('search:entities', '', array('tag' => $tag,
- 'offset' => $offset,
- 'limit' => $limit,
- 'searchtype' => $searchtype,
- 'object_type' => $object_type,
- 'subtype' => $subtype,
- 'tagtype' => $tagtype,
- 'owner_guid' => $owner_guid_array
- ),
- $results);
-
- /*
- $searchtypes = trigger_plugin_hook('search:types', '', NULL, array());
- add_submenu_item(elgg_echo('search:type:all'),
- $CONFIG->wwwroot . "pg/search/?tag=". urlencode($tag) ."&searchtype=all");
-
- foreach ($searchtypes as $st) {
- add_submenu_item(elgg_echo('search:type:' . $st),
- $CONFIG->wwwroot . "pg/search/?tag=". urlencode($tag) ."&searchtype=" . $st);
- }
- */
-
-
- if (empty($objecttype) && empty($subtype)) {
- $title = sprintf(elgg_echo('searchtitle'),$tag);
- } else {
- if (empty($objecttype)) $objecttype = 'object';
- $itemtitle = 'item:' . $objecttype;
- if (!empty($subtype)) $itemtitle .= ':' . $subtype;
- $itemtitle = elgg_echo($itemtitle);
- $title = sprintf(elgg_echo('advancedsearchtitle'),$itemtitle,$tag);
- }
-
-
-
-
- //print_r($results);
-
- $body .= elgg_view_title($title); // elgg_view_title(sprintf(elgg_echo('searchtitle'),$tag));
- $body .= elgg_view('search/startblurb',array('tag' => $tag));
-
-
- $body .= elgg_view('search/entity_list',array('entities' => $results->entities,
- 'count' => $results->total,
- 'offset' => $offset,
- 'limit' => $limit,
- 'baseurl' => $_SERVER['REQUEST_URI'],
- 'fullview' => false,
- 'context' => 'search',
- 'viewtypetoggle' => true,
- 'viewtype' => $viewtype,
- 'pagination' => true
- ));
-
-
-
-
-elgg_view_entity_list($results->entities, count($results->entities), 0, count($results->entities), false);
-} else {
-
- $body .= elgg_view_title(elgg_echo('search:enterterm'));
- $body .= elgg_view('page_elements/contentwrapper', array('body' => '<div>' . elgg_view('page_elements/searchbox') . '</div>'));
-
-
-}
-$layout = elgg_view_layout('two_column_left_sidebar','',$body);
-
-
-page_draw($title, $layout);
-
-
-?> \ No newline at end of file