aboutsummaryrefslogtreecommitdiff
path: root/mod
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
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')
-rw-r--r--mod/groups/all.php33
-rw-r--r--mod/groups/languages/en.php9
-rw-r--r--mod/groups/start.php4
-rw-r--r--mod/groups/views/default/groups/featured.php9
-rw-r--r--mod/groups/views/default/groups/find.php21
-rw-r--r--mod/groups/views/default/groups/group_sort_menu.php28
-rw-r--r--mod/groups/views/default/groups/grouplisting.php12
7 files changed, 108 insertions, 8 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);
diff --git a/mod/groups/languages/en.php b/mod/groups/languages/en.php
index 880dfcc66..d73611dfc 100644
--- a/mod/groups/languages/en.php
+++ b/mod/groups/languages/en.php
@@ -58,13 +58,18 @@
'groupforumtopic:new' => "New forum post",
+ 'groups:count' => "groups created",
+ 'groups:open' => "open group",
+ 'groups:closed' => "closed group",
+ 'groups:member' => "members",
+ 'groups:searchtag' => "Search groups by tag",
+
/*
* Access
*/
'groups:access:private' => 'Closed - Users must be invited',
'groups:access:public' => 'Open - Any user may join',
- 'groups:closedgroup' => 'This group has a closed membership, please request to join.',
/*
Group tools
*/
@@ -76,6 +81,8 @@
'group:created' => 'Created %s with %d posts',
'groups:lastupdated' => 'Last updated %s by %s',
+ 'groups:pages' => 'Group pages',
+ 'groups:files' => 'Group files',
/*
Group forum strings
diff --git a/mod/groups/start.php b/mod/groups/start.php
index f8c698e25..8b723eb97 100644
--- a/mod/groups/start.php
+++ b/mod/groups/start.php
@@ -21,8 +21,8 @@
// Set up the menu for logged in users
if (isloggedin())
{
- add_menu(elgg_echo('groups'), $CONFIG->wwwroot . "pg/groups/member/" . $_SESSION['user']->username,'groups');
- add_menu(elgg_echo('groups:alldiscussion'),$CONFIG->wwwroot."mod/groups/discussions.php");
+ add_menu(elgg_echo('groups'), $CONFIG->wwwroot . "pg/groups/world/");
+ //add_menu(elgg_echo('groups:alldiscussion'),$CONFIG->wwwroot."mod/groups/discussions.php");
}
else
{
diff --git a/mod/groups/views/default/groups/featured.php b/mod/groups/views/default/groups/featured.php
new file mode 100644
index 000000000..ab7691a0b
--- /dev/null
+++ b/mod/groups/views/default/groups/featured.php
@@ -0,0 +1,9 @@
+<?php
+
+ /**
+ * This view will display featured groups - these are set by admin
+ **/
+
+?>
+
+<h3>Featured groups</h3> \ No newline at end of file
diff --git a/mod/groups/views/default/groups/find.php b/mod/groups/views/default/groups/find.php
new file mode 100644
index 000000000..3dc37dac0
--- /dev/null
+++ b/mod/groups/views/default/groups/find.php
@@ -0,0 +1,21 @@
+<?php
+
+ /**
+ * A simlpe group search by tag view
+ **/
+
+?>
+<div class="group_search">
+<h3><?php echo elgg_echo('groups:searchtag'); ?></h3>
+<form id="searchform" action="" method="get">
+ <input type="text" name="group_find" value="Search" onclick="if (this.value=='Search') { this.value='' }" class="search_input" />
+ <input type="submit" value="<?php echo elgg_echo('go'); ?>" class="search_submit_button" />
+</form>
+</div>
+<div class="user_groups_link">
+<?php
+ if(isloggedin())
+ echo "<p><a href=\"{$vars['url']}pg/groups/member/{$_SESSION['user']->username}\">". elgg_echo('groups:yours') ."</a></p>";
+
+?>
+</div> \ No newline at end of file
diff --git a/mod/groups/views/default/groups/group_sort_menu.php b/mod/groups/views/default/groups/group_sort_menu.php
new file mode 100644
index 000000000..957094ee6
--- /dev/null
+++ b/mod/groups/views/default/groups/group_sort_menu.php
@@ -0,0 +1,28 @@
+<?php
+
+ /**
+ * A simple view to provide the user with group filters and the number of group on the site
+ **/
+
+ $num_groups = $vars['count'];
+ if(!$num_groups)
+ $num_groups = 0;
+
+ $filter = $vars['filter'];
+
+ //url
+ $url = $vars['url'] . "pg/groups/world/";
+
+?>
+<div id="elgg_horizontal_tabbed_nav">
+<ul>
+ <li <?php if($filter == "newest") echo "class='selected'"; ?>><a href="<?php echo $url; ?>?filter=newest"><?php echo elgg_echo('newest'); ?></a></li>
+ <li <?php if($filter == "pop") echo "class='selected'"; ?>><a href="<?php echo $url; ?>?filter=pop"><?php echo elgg_echo('popular'); ?></a></li>
+ <li <?php if($filter == "active") echo "class='selected'"; ?>><a href="<?php echo $url; ?>?filter=active"><?php echo elgg_echo('groups:latestdiscussion'); ?></a></li>
+</ul>
+</div>
+<div class="group_count">
+ <?php
+ echo $num_groups . " " . elgg_echo("groups:count");
+ ?>
+</div> \ No newline at end of file
diff --git a/mod/groups/views/default/groups/grouplisting.php b/mod/groups/views/default/groups/grouplisting.php
index 3d0e1ce34..8d7e3c6d8 100644
--- a/mod/groups/views/default/groups/grouplisting.php
+++ b/mod/groups/views/default/groups/grouplisting.php
@@ -17,9 +17,17 @@
'size' => 'small',
)
);
-
+
+ //get the membership type
+ $membership = $vars['entity']->membership;
+ if($membership == 2)
+ $mem = elgg_echo("groups:open");
+ else
+ $mem = elgg_echo("groups:closed");
+
+ $info .= "<div style=\"float:right;\">" . $mem . " / " . elgg_echo("groups:member") . " (" . get_group_members($vars['entity']->guid, 10, 0, 0, true) . ")</div>";
$info .= "<p><b><a href=\"" . $vars['entity']->getUrl() . "\">" . $vars['entity']->name . "</a></b></p>";
- $info .= "<p class=\"owner_timestamp\">" . $vars['entity']->briefdescription . "</p>";
+ $info .= "<p class=\"owner_timestamp\">" . $vars['entity']->description . "</p>";
// num users, last activity, owner etc