diff options
author | marcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2008-07-09 12:18:36 +0000 |
---|---|---|
committer | marcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2008-07-09 12:18:36 +0000 |
commit | a4b0f36ff9d347cc22b8063cadf0505c8fa87494 (patch) | |
tree | 7ff3eb8ccdf831170fe4d26067916e8a1a51eddb | |
parent | 6fc948daa0469142af595eaffc4fe59282690bf4 (diff) | |
download | elgg-a4b0f36ff9d347cc22b8063cadf0505c8fa87494.tar.gz elgg-a4b0f36ff9d347cc22b8063cadf0505c8fa87494.tar.bz2 |
Refs #129, #109 & #106
git-svn-id: https://code.elgg.org/elgg/trunk@1353 36083f99-b078-4883-b0ff-0f9b5a30f544
-rw-r--r-- | mod/groups/languages/en.php | 5 | ||||
-rw-r--r-- | mod/groups/start.php | 1 | ||||
-rw-r--r-- | mod/groups/views/default/widgets/group_entities_widget/edit.php | 23 | ||||
-rw-r--r-- | mod/groups/views/default/widgets/group_entities_widget/view.php | 35 |
4 files changed, 64 insertions, 0 deletions
diff --git a/mod/groups/languages/en.php b/mod/groups/languages/en.php index 13ab1b041..753dd2c5d 100644 --- a/mod/groups/languages/en.php +++ b/mod/groups/languages/en.php @@ -91,6 +91,11 @@ or click below to confirm request: 'groups:widgets:members:description' => 'List the members of a group.', 'groups:widgets:members:label:displaynum' => 'List the members of a group.', 'groups:widgets:members:label:pleaseedit' => 'Please configure this widget.', + + 'groups:widgets:entities:title' => "Objects in group", + 'groups:widgets:entities:description' => "List the objects saved in this group", + 'groups:widgets:entities:label:displaynum' => 'List the objects of a group.', + 'groups:widgets:entities:label:pleaseedit' => 'Please configure this widget.', ); diff --git a/mod/groups/start.php b/mod/groups/start.php index 509533999..58aa50d15 100644 --- a/mod/groups/start.php +++ b/mod/groups/start.php @@ -58,6 +58,7 @@ // Add some widgets add_widget_type('group_members_widget',elgg_echo('groups:widgets:members:title'), elgg_echo('groups:widgets:members:description')); + add_widget_type('group_entities_widget',elgg_echo('groups:widgets:entities:title'), elgg_echo('groups:widgets:entities:description')); // For now, we'll hard code the groups profile items as follows: // TODO make this user configurable diff --git a/mod/groups/views/default/widgets/group_entities_widget/edit.php b/mod/groups/views/default/widgets/group_entities_widget/edit.php new file mode 100644 index 000000000..01b273c08 --- /dev/null +++ b/mod/groups/views/default/widgets/group_entities_widget/edit.php @@ -0,0 +1,23 @@ +<?php + /** + * Edit the widget + * + * @package ElggGroups + * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2 + * @author Marcus Povey + * @copyright Curverider Ltd 2008 + * @link http://elgg.com/ + */ +?> +<p> + <?php echo elgg_echo('groups:widgets:entities:label:displaynum'); ?> + + <select name="params[limit]"> + <option value="5" <?php if ($vars['entity']->limit == 5) echo " selected=\"yes\" "; ?>>5</option> + <option value="8" <?php if ((!$vars['entity']->limit) || ($vars['entity']->limit == 8)) echo " selected=\"yes\" "; ?>>8</option> + <option value="12" <?php if ($vars['entity']->limit == 12) echo " selected=\"yes\" "; ?>>12</option> + <option value="15" <?php if ($vars['entity']->limit == 15) echo " selected=\"yes\" "; ?>>15</option> + </select> + + <input type="hidden" name="params[group_guid]" value="<?php echo get_input('group_guid'); ?>" /> +</p>
\ No newline at end of file diff --git a/mod/groups/views/default/widgets/group_entities_widget/view.php b/mod/groups/views/default/widgets/group_entities_widget/view.php new file mode 100644 index 000000000..dfb26e5d9 --- /dev/null +++ b/mod/groups/views/default/widgets/group_entities_widget/view.php @@ -0,0 +1,35 @@ +<?php + /** + * View the widget + * + * @package ElggGroups + * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2 + * @author Marcus Povey + * @copyright Curverider Ltd 2008 + * @link http://elgg.com/ + */ + + $group_guid = get_input('group_guid'); + $limit = get_input('limit', 8); + $offset = 0; + + if ($vars['entity']->limit) + $limit = $vars['entity']->limit; + + $group_guid = $vars['entity']->group_guid; + + if ($group_guid) + { + $group = get_entity($group_guid); + $members = $group->getMembers($limit, $offset); + $count = $group->getMembers($limit, $offset, true); + + $result = list_entities_groups("", 0, $group_guid, $limit); + } + else + { + $result = elgg_echo('groups:widgets:entities:label:pleaseedit'); + } + + echo $result; +?>
\ No newline at end of file |