aboutsummaryrefslogtreecommitdiff
path: root/mod/search/index.php
diff options
context:
space:
mode:
authorbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-01-11 22:58:55 +0000
committerbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-01-11 22:58:55 +0000
commit23594f5a78f4557b183d5cc2a045b684cf32cc74 (patch)
treed354462c702524775a48439dc66c7036e9ec2d7d /mod/search/index.php
parenta69015e09a9627c63be577d10c99143190648b7b (diff)
downloadelgg-23594f5a78f4557b183d5cc2a045b684cf32cc74.tar.gz
elgg-23594f5a78f4557b183d5cc2a045b684cf32cc74.tar.bz2
Pulling out entity views in search.
Adding dev documentation. git-svn-id: http://code.elgg.org/elgg/trunk@3795 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod/search/index.php')
-rw-r--r--mod/search/index.php20
1 files changed, 12 insertions, 8 deletions
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));
+ }
}
}
}