diff options
author | brettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-03-03 17:53:05 +0000 |
---|---|---|
committer | brettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-03-03 17:53:05 +0000 |
commit | 4766f36a4d74924f21ff329c4318ce4e069ffa04 (patch) | |
tree | 969b84632f2a8b0db79788a8a6db8e41d63e5cb4 /mod/groups/views/default/widgets | |
parent | 57a217fd6b708844407486046a1faa23b46cac08 (diff) | |
download | elgg-4766f36a4d74924f21ff329c4318ce4e069ffa04.tar.gz elgg-4766f36a4d74924f21ff329c4318ce4e069ffa04.tar.bz2 |
Pulled in the interface changes.
git-svn-id: http://code.elgg.org/elgg/trunk@5257 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod/groups/views/default/widgets')
6 files changed, 172 insertions, 0 deletions
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..fa47cdd62 --- /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..3328a8778 --- /dev/null +++ b/mod/groups/views/default/widgets/a_users_groups/view.php @@ -0,0 +1,42 @@ +<?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_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); + + + if($groups){ + + echo "<div class=\"groupmembershipwidget\">"; + + 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>"; + + } + echo "</div>"; + } + + + // echo $groups; + +?>
\ No newline at end of file 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..dbf82b2ec --- /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 Curverider Ltd + * @copyright Curverider Ltd 2008-2010 + * @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..edba53cb5 --- /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 Curverider Ltd + * @copyright Curverider Ltd 2008-2010 + * @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 diff --git a/mod/groups/views/default/widgets/group_members_widget/edit.php b/mod/groups/views/default/widgets/group_members_widget/edit.php new file mode 100644 index 000000000..6d385c204 --- /dev/null +++ b/mod/groups/views/default/widgets/group_members_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 Curverider Ltd + * @copyright Curverider Ltd 2008-2010 + * @link http://elgg.com/ + */ +?> +<p> + <?php echo elgg_echo('groups:widgets:members: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_members_widget/view.php b/mod/groups/views/default/widgets/group_members_widget/view.php new file mode 100644 index 000000000..502affd12 --- /dev/null +++ b/mod/groups/views/default/widgets/group_members_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 Curverider Ltd + * @copyright Curverider Ltd 2008-2010 + * @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 = elgg_view_entity_list($members, $count, $offset, $limit, false, false, false); + } + else + { + $result = elgg_echo('groups:widgets:members:label:pleaseedit'); + } + + echo $result; +?>
\ No newline at end of file |