aboutsummaryrefslogtreecommitdiff
path: root/mod/groups/lib/groups.php
diff options
context:
space:
mode:
authorcash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-03-29 01:06:45 +0000
committercash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-03-29 01:06:45 +0000
commite697c4de72672c43d49bfbcea7b4f8bc17ffc5fd (patch)
tree07e8dc35d554c27ce42cab273b43aba8f49f15c9 /mod/groups/lib/groups.php
parent7d290fd28e4bdceb4b22007d16c07550bff078f7 (diff)
downloadelgg-e697c4de72672c43d49bfbcea7b4f8bc17ffc5fd.tar.gz
elgg-e697c4de72672c43d49bfbcea7b4f8bc17ffc5fd.tar.bz2
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
Diffstat (limited to 'mod/groups/lib/groups.php')
-rw-r--r--mod/groups/lib/groups.php33
1 files changed, 33 insertions, 0 deletions
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
*/