From e697c4de72672c43d49bfbcea7b4f8bc17ffc5fd Mon Sep 17 00:00:00 2001 From: cash Date: Tue, 29 Mar 2011 01:06:45 +0000 Subject: Fixes #3243 pulled in anirupdutta's patch with some modifications (moved tag search to its own page handler function) git-svn-id: http://code.elgg.org/elgg/trunk@8874 36083f99-b078-4883-b0ff-0f9b5a30f544 --- mod/groups/lib/groups.php | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) (limited to 'mod/groups/lib/groups.php') diff --git a/mod/groups/lib/groups.php b/mod/groups/lib/groups.php index c0a8a9a94..ec75078eb 100644 --- a/mod/groups/lib/groups.php +++ b/mod/groups/lib/groups.php @@ -56,6 +56,39 @@ function groups_handle_all_page() { echo elgg_view_page(elgg_echo('groups:all'), $body); } +function groups_search_page() { + elgg_push_breadcrumb(elgg_echo('search')); + + $tag = get_input("tag"); + $title = elgg_echo('groups:search:title', array($tag)); + + // groups plugin saves tags as "interests" - see groups_fields_setup() in start.php + $params = array( + 'metadata_name' => 'interests', + 'metadata_value' => $tag, + 'types' => 'group', + 'full_view' => FALSE, + ); + $content = elgg_list_entities_from_metadata($params); + if (!$content) { + $content = elgg_echo('groups:search:none'); + } + + $sidebar = elgg_view('groups/sidebar/find'); + $sidebar .= elgg_view('groups/sidebar/featured'); + + $params = array( + 'content' => $content, + 'sidebar' => $sidebar, + 'filter' => false, + 'buttons' => false, + 'title' => $title, + ); + $body = elgg_view_layout('content', $params); + + echo elgg_view_page($title, $body); +} + /** * List owned groups */ -- cgit v1.2.3