aboutsummaryrefslogtreecommitdiff
path: root/mod/groups/all.php
diff options
context:
space:
mode:
authordave <dave@36083f99-b078-4883-b0ff-0f9b5a30f544>2009-02-17 16:39:20 +0000
committerdave <dave@36083f99-b078-4883-b0ff-0f9b5a30f544>2009-02-17 16:39:20 +0000
commit5a6ecf982492cee7b01729295d1598caa921b95b (patch)
tree32e5b78c1937058ec0d16976c48468cf4f08a0f0 /mod/groups/all.php
parent32e4c110c77e42e028a76ee50e89b79bc78d97c8 (diff)
downloadelgg-5a6ecf982492cee7b01729295d1598caa921b95b.tar.gz
elgg-5a6ecf982492cee7b01729295d1598caa921b95b.tar.bz2
new all groups view
git-svn-id: https://code.elgg.org/elgg/trunk@2788 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod/groups/all.php')
-rw-r--r--mod/groups/all.php33
1 files changed, 30 insertions, 3 deletions
diff --git a/mod/groups/all.php b/mod/groups/all.php
index 0941929fd..87c079750 100644
--- a/mod/groups/all.php
+++ b/mod/groups/all.php
@@ -14,6 +14,9 @@
$limit = get_input("limit", 10);
$offset = get_input("offset", 0);
$tag = get_input("tag");
+ $filter = get_input("filter");
+ if(!$filter)
+ $filter = "newest";
// Get objects
@@ -22,15 +25,39 @@
set_context('search');
if ($tag != "")
$objects = list_entities_from_metadata('tags',$tag,'group',"","", $limit, false);
- else
- $objects = list_entities('group',"", 0, $limit, false);
+ else{
+ switch($filter){
+ case "newest":
+ $objects = list_entities('group',"", 0, $limit, false);
+ break;
+ case "pop":
+ $objects = list_entities('group',"", 0, $limit, false);
+ break;
+ case "active":
+ $objects = list_entities_from_annotations("object", "groupforumtopic", "group_topic_post", "", 40, 0, 0, false, true);
+ break;
+ case 'default':
+ $objects = list_entities('group',"", 0, $limit, false);
+ break;
+ }
+ }
+
+ //get a group count
+ $group_count = get_entities("group", "", 0, "", 10, 0, true, 0, null);
+
+ //find groups
+ $area1 = elgg_view("groups/find");
+
+ //featured groups
+ $area1 .= elgg_view("groups/featured");
set_context($context);
$title = sprintf(elgg_echo("groups:all"),page_owner_entity()->name);
$area2 = elgg_view_title($title);
+ $area2 .= elgg_view("groups/group_sort_menu", array("count" => $group_count, "filter" => $filter));
$area2 .= $objects;
- $body = elgg_view_layout('two_column_left_sidebar',$area1, $area2);
+ $body = elgg_view_layout('sidebar_boxes',$area1, $area2);
// Finally draw the page
page_draw($title, $body);