aboutsummaryrefslogtreecommitdiff
path: root/mod
diff options
context:
space:
mode:
authorbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-05-19 21:40:44 +0000
committerbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-05-19 21:40:44 +0000
commitb5c6d66de499a109444a226a69522c690bf3bb4e (patch)
treeafaa56757f5c4b30b97a777499a4a97617f44f69 /mod
parent251dba674e65f5742c45e777dcba78513bba7082 (diff)
downloadelgg-b5c6d66de499a109444a226a69522c690bf3bb4e.tar.gz
elgg-b5c6d66de499a109444a226a69522c690bf3bb4e.tar.bz2
Removed legacy calls from groups.
git-svn-id: http://code.elgg.org/elgg/trunk@6103 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod')
-rw-r--r--mod/groups/all.php61
-rw-r--r--mod/groups/discussions.php24
-rw-r--r--mod/groups/forum.php12
-rw-r--r--mod/groups/views/default/forum/topics.php2
4 files changed, 51 insertions, 48 deletions
diff --git a/mod/groups/all.php b/mod/groups/all.php
index 8e99ea780..f2edac9c3 100644
--- a/mod/groups/all.php
+++ b/mod/groups/all.php
@@ -1,7 +1,7 @@
<?php
/**
* Elgg groups plugin
- *
+ *
* @package ElggGroups
* @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
* @author Curverider Ltd
@@ -13,62 +13,57 @@
$limit = get_input("limit", 10);
$offset = get_input("offset", 0);
- $tag = get_input("tag");
$filter = get_input("filter");
if (!$filter) {
// active discussions is the default
$filter = "active";
}
-
-
- // Get objects
+
$context = get_context();
-
- set_context('search');
- if ($tag != "") {
- $filter = 'search';
- // groups plugin saves tags as "interests" - see groups_fields_setup() in start.php
- $objects = list_entities_from_metadata('interests',$tag,'group',"","", $limit, false, false, true, false);
- } else {
- switch($filter){
- case "newest":
+
+ switch($filter){
+ case "newest":
$objects = elgg_list_entities(array('types' => 'group', 'owner_guid' => 0, 'limit' => $limit, 'offset' => $offset, 'full_view' => false));
break;
- case "pop":
+
+ case "pop":
$objects = list_entities_by_relationship_count('member', true, "", "", 0, $limit, false);
break;
- case "active":
- case 'default':
- $objects = list_entities_from_annotations("object", "groupforumtopic", "group_topic_post", "", 40, 0, 0, false, true);
+
+ case "active":
+ case 'default':
+ $options = array(
+ 'type' => 'object',
+ 'subtype' => 'groupforumtopic',
+ 'annotation_name' => 'group_topic_post',
+ 'limit' => 40,
+ 'fullview' => TRUE
+ );
+ $objects = elgg_list_entities_from_annotations($options);
break;
- }
}
-
+
//get a group count
$group_count = elgg_get_entities(array('types' => 'group', 'limit' => 10, 'count' => TRUE));
-
+
//menu options
- $area2 = elgg_view("groups/side_menu");
+ $area2 = elgg_view("groups/side_menu");
//find groups
$area2 .= elgg_view("groups/find");
-
+
//featured groups
$featured_groups = elgg_get_entities_from_metadata(array('metadata_name' => 'featured_group', 'metadata_value' => 'yes', 'types' => 'group', 'limit' => 10));
$area2 .= elgg_view("groups/featured", array("featured" => $featured_groups));
-
+
set_context($context);
-
+
$objects = "<div class='group_listings'>".$objects."</div>";
-
- $title = sprintf(elgg_echo("groups:all"),page_owner_entity()->name);
+
+ $title = sprintf(elgg_echo("groups:all"), page_owner_entity()->name);
$area1 .= elgg_view('page_elements/content_header', array('context' => "everyone", 'type' => 'groups', 'new_link' => "{$CONFIG->url}pg/groups/new"));
$area1 .= elgg_view("groups/group_sort_menu", array("count" => $group_count, "filter" => $filter)) . $objects;
$body = elgg_view_layout('one_column_with_sidebar', $area1, $area2);
-
- // Finally draw the page
- page_draw($title, $body);
-
-
-?>
+ // Finally draw the page
+ page_draw($title, $body); \ No newline at end of file
diff --git a/mod/groups/discussions.php b/mod/groups/discussions.php
index c3166dc95..44bc5e610 100644
--- a/mod/groups/discussions.php
+++ b/mod/groups/discussions.php
@@ -2,9 +2,9 @@
/**
* Elgg all group forum discussions page
- * This page will show all topic dicussions ordered by last comment, regardless of which group
+ * This page will show all topic dicussions ordered by last comment, regardless of which group
* they are part of
- *
+ *
* @package ElggGroups
* @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
* @author Curverider Ltd <info@elgg.com>
@@ -17,17 +17,17 @@
// access check for closed groups
group_gatekeeper();
-
+
// Display them
- $area1 = elgg_view_title(elgg_echo("groups:latestdiscussion"));
+ $area1 = elgg_view_title(elgg_echo("groups:latestdiscussion"));
set_context('search');
- $area1 .= list_entities_from_annotations("object", "groupforumtopic", "group_topic_post", "", 40, 0, 0, false, true);
- set_context('groups');
-
- $body = elgg_view_layout("one_column_with_sidebar", $area1);
-
- // Display page
+ $area1 .= list_entities_from_annotations("object", "groupforumtopic", "group_topic_post", "", 40, 0, 0, false, true);
+ set_context('groups');
+
+ $body = elgg_view_layout("one_column_with_sidebar", $area1);
+
+ // Display page
page_draw(elgg_echo('groups:latestdiscussion'),$body);
-
-
+
+
?> \ No newline at end of file
diff --git a/mod/groups/forum.php b/mod/groups/forum.php
index 249ff17b2..32ffea2da 100644
--- a/mod/groups/forum.php
+++ b/mod/groups/forum.php
@@ -20,8 +20,16 @@
group_gatekeeper();
//get any forum topics
- $topics = list_entities_from_annotations("object", "groupforumtopic", "group_topic_post", "", 20, 0, get_input('group_guid'), false, false, false);
- set_context('search');
+ $options = array(
+ 'type' => 'object',
+ 'subtype' => 'groupforumtopic',
+ 'annotation_name' => 'group_topic_post',
+ 'limit' => 20,
+ 'container_guid' => $group_guid,
+ 'fullview' => FALSE
+ );
+
+ $topics = elgg_list_entities_from_annotations($options);
// set up breadcrumbs
$group = get_entity($group_guid);
diff --git a/mod/groups/views/default/forum/topics.php b/mod/groups/views/default/forum/topics.php
index 915c957d3..c0f5ff2d1 100644
--- a/mod/groups/views/default/forum/topics.php
+++ b/mod/groups/views/default/forum/topics.php
@@ -8,8 +8,8 @@
* @copyright Curverider Ltd 2008-2010
* @link http://elgg.com/
*/
-
?>
+
<div id="content_header" class="clearfloat">
<div class="content_header_title">
<h2><?php echo elgg_echo("groups:forum"); ?></h2>