aboutsummaryrefslogtreecommitdiff
path: root/mod/groups/views
diff options
context:
space:
mode:
Diffstat (limited to 'mod/groups/views')
-rw-r--r--mod/groups/views/default/widgets/a_users_groups/view.php77
1 files changed, 39 insertions, 38 deletions
diff --git a/mod/groups/views/default/widgets/a_users_groups/view.php b/mod/groups/views/default/widgets/a_users_groups/view.php
index f020e07c4..687ba7251 100644
--- a/mod/groups/views/default/widgets/a_users_groups/view.php
+++ b/mod/groups/views/default/widgets/a_users_groups/view.php
@@ -1,50 +1,51 @@
<?php
- /**
- * Group profile widget - this displays a users groups on their profile
- **/
+/**
+ * Group profile widget - this displays a users groups on their profile
+ **/
- //the number of groups to display
- $number = (int) $vars['entity']->num_display;
- if (!$number)
- $number = 4;
+//the number of groups to display
+$number = (int) $vars['entity']->num_display;
+if (!$number) {
+ $number = 4;
+}
- //the page owner
- $owner = $vars['entity']->owner_guid;
+//the page owner
+$owner = $vars['entity']->owner_guid;
- //$groups = get_users_membership($owner);
- //$groups = list_entities_from_relationship('member',$owner,false,'group','',0,$number,false,false,false);
+//$groups = get_users_membership($owner);
+//$groups = list_entities_from_relationship('member',$owner,false,'group','',0,$number,false,false,false);
+$groups = get_entities_from_relationship('member', $owner, false, "group", "", 0, "", $number, 0, false, 0);
- $options = array(
- 'relationship' => 'member',
- 'relationship_guid' => $owner,
- 'type' => 'group',
- 'limit' => $number,
- );
- $groups = elgg_get_entities_from_relationship($options);
+if ($groups) {
+ echo "<div class=\"groupmembershipwidget\">";
- if($groups){
-
- echo "<div class=\"groupmembershipwidget\">";
-
- foreach($groups as $group){
- $icon = elgg_view(
+ foreach ($groups as $group) {
+ $icon = elgg_view(
"groups/icon", array(
- 'entity' => $group,
- 'size' => 'small',
- )
- );
-
- echo "<div class=\"contentWrapper\">" . $icon . " <div class='search_listing_info'><p><span>" . $group->name . "</span><br />";
- echo $group->briefdescription . "</p></div><div class=\"clearfloat\"></div></div>";
+ 'entity' => $group,
+ 'size' => 'small',
+ )
+ );
+
+ $group_link = $group->getURL();
+
+ echo <<<___END
+
+<div class="contentWrapper">
+ $icon
+ <div class="search_listing_info">
+ <p>
+ <span><a href="$group_link">$group->name</a></span><br />
+ $group->briefdescription
+ </p>
+ </div>
+ <div class="clearfloat"></div>
+</div>
+___END;
- }
- echo "</div>";
}
-
-
-// echo $groups;
-
-?> \ No newline at end of file
+ echo "</div>";
+}