diff options
author | dave <dave@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2008-08-09 15:12:23 +0000 |
---|---|---|
committer | dave <dave@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2008-08-09 15:12:23 +0000 |
commit | 441bf62e1e767991ac3d25c14ed8d1291b142639 (patch) | |
tree | 1abe6f1bc8069caca40741c77c201c7aecc66646 /mod | |
parent | a74d4216eb5a89743e0938d831db0ec57fc8df05 (diff) | |
download | elgg-441bf62e1e767991ac3d25c14ed8d1291b142639.tar.gz elgg-441bf62e1e767991ac3d25c14ed8d1291b142639.tar.bz2 |
a simple widget that displays a users groups on their profile
git-svn-id: https://code.elgg.org/elgg/trunk@1811 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod')
-rw-r--r-- | mod/groups/languages/en.php | 4 | ||||
-rw-r--r-- | mod/groups/start.php | 6 | ||||
-rw-r--r-- | mod/groups/views/default/widgets/a_users_groups/edit.php | 14 | ||||
-rw-r--r-- | mod/groups/views/default/widgets/a_users_groups/view.php | 20 |
4 files changed, 41 insertions, 3 deletions
diff --git a/mod/groups/languages/en.php b/mod/groups/languages/en.php index 171ee78af..e5197195c 100644 --- a/mod/groups/languages/en.php +++ b/mod/groups/languages/en.php @@ -34,7 +34,9 @@ 'groups:membership' => "Membership",
'groups:access' => "Access permissions",
'groups:owner' => "Owner",
-
+ 'groups:widget:num_display' => 'Number of groups to display',
+ 'groups:widget:membership' => 'Group membership',
+ 'groups:widgets:description' => 'Display the groups you are a member of on your profile',
'groups:noaccess' => 'No access to group',
'groups:cantedit' => 'You can not edit this group',
'groups:saved' => 'Group saved',
diff --git a/mod/groups/start.php b/mod/groups/start.php index 38c799bf6..3500f829a 100644 --- a/mod/groups/start.php +++ b/mod/groups/start.php @@ -55,8 +55,10 @@ add_page_owner_handler('groups_page_owner_handler');
// Add some widgets
- add_widget_type('group_members_widget',elgg_echo('groups:widgets:members:title'), elgg_echo('groups:widgets:members:description'), 'groups');
- add_widget_type('group_entities_widget',elgg_echo('groups:widgets:entities:title'), elgg_echo('groups:widgets:entities:description'), 'groups');
+ //add_widget_type('group_members_widget',elgg_echo('groups:widgets:members:title'), elgg_echo('groups:widgets:members:description'), 'groups');
+ //add_widget_type('group_entities_widget',elgg_echo('groups:widgets:entities:title'), elgg_echo('groups:widgets:entities:description'), 'groups');
+ add_widget_type('a_users_groups',elgg_echo('groups:widget:membership'), elgg_echo('groups:widgets:description'), 'profile');
+
//extend some views
extend_view('profile/icon','groups/icon');
diff --git a/mod/groups/views/default/widgets/a_users_groups/edit.php b/mod/groups/views/default/widgets/a_users_groups/edit.php new file mode 100644 index 000000000..1dbb5900d --- /dev/null +++ b/mod/groups/views/default/widgets/a_users_groups/edit.php @@ -0,0 +1,14 @@ +<p>
+ <?php echo elgg_echo("groups:widget:num_display"); ?>:
+ <select name="params[num_display]">
+ <option value="1" <?php if($vars['entity']->num_display == 1) echo "SELECTED"; ?>>1</option>
+ <option value="2" <?php if($vars['entity']->num_display == 2) echo "SELECTED"; ?>>2</option>
+ <option value="3" <?php if($vars['entity']->num_display == 3) echo "SELECTED"; ?>>3</option>
+ <option value="4" <?php if($vars['entity']->num_display == 4) echo "SELECTED"; ?>>4</option>
+ <option value="5" <?php if($vars['entity']->num_display == 5) echo "SELECTED"; ?>>5</option>
+ <option value="6" <?php if($vars['entity']->num_display == 6) echo "SELECTED"; ?>>6</option>
+ <option value="7" <?php if($vars['entity']->num_display == 7) echo "SELECTED"; ?>>7</option>
+ <option value="8" <?php if($vars['entity']->num_display == 8) echo "SELECTED"; ?>>8</option>
+ <option value="9" <?php if($vars['entity']->num_display == 9) echo "SELECTED"; ?>>9</option>
+ </select>
+</p>
\ No newline at end of file diff --git a/mod/groups/views/default/widgets/a_users_groups/view.php b/mod/groups/views/default/widgets/a_users_groups/view.php new file mode 100644 index 000000000..030cbc3c9 --- /dev/null +++ b/mod/groups/views/default/widgets/a_users_groups/view.php @@ -0,0 +1,20 @@ +<?php
+
+ /**
+ * 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 page owner
+ $owner = $vars['entity']->owner_guid;
+
+ //$groups = get_users_membership($owner);
+ $groups = list_entities("group", "", $owner, $number, true, false);
+
+ echo $groups;
+
+?>
\ No newline at end of file |