From 23594f5a78f4557b183d5cc2a045b684cf32cc74 Mon Sep 17 00:00:00 2001 From: brettp Date: Mon, 11 Jan 2010 22:58:55 +0000 Subject: Pulling out entity views in search. Adding dev documentation. git-svn-id: http://code.elgg.org/elgg/trunk@3795 36083f99-b078-4883-b0ff-0f9b5a30f544 --- mod/search/index.php | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'mod/search/index.php') diff --git a/mod/search/index.php b/mod/search/index.php index e7081ecb5..adf514caf 100644 --- a/mod/search/index.php +++ b/mod/search/index.php @@ -152,7 +152,9 @@ if ($search_type == 'all' || $search_type == 'entities') { } if (is_array($results['entities']) && $results['count']) { - $results_html .= search_get_listing_html($results['entities'], $results['count'], $params); + if ($view = search_get_search_view($params, 'listing')) { + $results_html .= elgg_view($view, array('results' => $results, 'params' => $params)); + } } } } @@ -169,23 +171,23 @@ if ($search_type == 'all' || $search_type == 'entities') { } if (is_array($results['entities']) && $results['count']) { - $results_html .= search_get_listing_html($results['entities'], $results['count'], $params); + if ($view = search_get_search_view($params, 'listing')) { + $results_html .= elgg_view($view, array('results' => $results, 'params' => $params)); + } } } } // call custom searches if ($search_type != 'entities' || $search_type == 'all') { - // get custom search types - $types = trigger_plugin_hook('search_types', 'get_types', $params, array()); - - if (is_array($types)) { - foreach ($types as $type) { + if (is_array($custom_types)) { + foreach ($custom_types as $type) { if ($search_type != 'all' && $search_type != $type) { continue; } $params['search_type'] = $type; + // custom search types have no subtype. unset($params['subtype']); $results = trigger_plugin_hook('search', $type, $params, array()); @@ -196,7 +198,9 @@ if ($search_type != 'entities' || $search_type == 'all') { } if (is_array($results['entities']) && $results['count']) { - $results_html .= search_get_listing_html($results['entities'], $results['count'], $params); + if ($view = search_get_search_view($params, 'listing')) { + $results_html .= elgg_view($view, array('results' => $results, 'params' => $params)); + } } } } -- cgit v1.2.3