aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-01-02 01:08:42 +0000
committercash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-01-02 01:08:42 +0000
commitac28ee3f7abac584c0b787604112611fe8f6b207 (patch)
tree27eb875b43f17fc695dbb4465040562cb880f741
parentb2661f317eebc4ebeef19540a87cc39f149a0eb8 (diff)
downloadelgg-ac28ee3f7abac584c0b787604112611fe8f6b207.tar.gz
elgg-ac28ee3f7abac584c0b787604112611fe8f6b207.tar.bz2
updated group widget
git-svn-id: http://code.elgg.org/elgg/trunk@7811 36083f99-b078-4883-b0ff-0f9b5a30f544
-rw-r--r--actions/widgets/save.php2
-rw-r--r--mod/groups/languages/en.php3
-rw-r--r--mod/groups/views/default/groups/featured.php11
-rw-r--r--mod/groups/views/default/widgets/a_users_groups/content.php74
-rw-r--r--mod/groups/views/default/widgets/a_users_groups/edit.php37
5 files changed, 59 insertions, 68 deletions
diff --git a/actions/widgets/save.php b/actions/widgets/save.php
index a78f4ca75..b1649cc17 100644
--- a/actions/widgets/save.php
+++ b/actions/widgets/save.php
@@ -6,6 +6,8 @@
* @subpackage Widgets.Management
*/
+elgg_set_context('widgets');
+
$guid = get_input('guid');
$params = get_input('params');
diff --git a/mod/groups/languages/en.php b/mod/groups/languages/en.php
index 47c570c7f..01dd8a231 100644
--- a/mod/groups/languages/en.php
+++ b/mod/groups/languages/en.php
@@ -73,6 +73,9 @@ $english = array(
'groups:member' => "members",
'groups:searchtag' => "Search for groups by tag",
+ 'groups:more' => 'More groups',
+ 'groups:none' => 'No groups',
+
/*
* Access
diff --git a/mod/groups/views/default/groups/featured.php b/mod/groups/views/default/groups/featured.php
index 50e473d1c..ef2be5885 100644
--- a/mod/groups/views/default/groups/featured.php
+++ b/mod/groups/views/default/groups/featured.php
@@ -8,16 +8,13 @@
*/
if ($vars['featured']) {
-
+
+ elgg_push_context('widgets');
$body = '';
foreach ($vars['featured'] as $group) {
- $icon = elgg_view("groups/icon", array(
- 'entity' => $group,
- 'size' => 'tiny',
- ));
- $body .= "<div class='featured_group'>".$icon."<p class='entity-title clearfix'><a href=\"" . $group->getUrl() . "\">" . $group->name . "</a></p>";
- $body .= "<p class='entity-subtext'>" . $group->briefdescription . "</p></div>";
+ $body .= elgg_view_entity($group, false);
}
+ elgg_pop_context();
echo elgg_view('layout/objects/module', array(
'title' => elgg_echo("groups:featured"),
diff --git a/mod/groups/views/default/widgets/a_users_groups/content.php b/mod/groups/views/default/widgets/a_users_groups/content.php
index 462ac419c..b9060dbb0 100644
--- a/mod/groups/views/default/widgets/a_users_groups/content.php
+++ b/mod/groups/views/default/widgets/a_users_groups/content.php
@@ -1,54 +1,32 @@
<?php
+/**
+ * Elgg file widget view
+ *
+ * @package ElggFile
+ */
-/**
- * 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;
+$num = $vars['entity']->num_display;
-$groups = elgg_get_entities_from_relationship(array(
+$options = array(
+ 'type' => 'group',
'relationship' => 'member',
- 'relationship_guid' => $owner,
- 'types' => 'group',
- 'limit' => $number,
-));
-
-
-if ($groups) {
-
- echo "<div class=\"groupmembershipwidget\">";
-
- foreach ($groups as $group) {
- $icon = elgg_view(
- "groups/icon", array(
- '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="clearfix"></div>
-</div>
-___END;
-
- }
- echo "</div>";
+ 'relationship_guid' => $vars['entity']->owner_guid,
+ 'limit' => $num,
+ 'full_view' => FALSE,
+ 'pagination' => FALSE,
+);
+$content = elgg_list_entities_from_relationship($options);
+
+echo $content;
+
+if ($content) {
+ $url = "pg/group/member/" . elgg_get_page_owner()->username;
+ $more_link = elgg_view('output/url', array(
+ 'href' => $url,
+ 'text' => elgg_echo('groups:more'),
+ ));
+ echo "<span class=\"elgg-widget-more\">$more_link</span>";
+} else {
+ echo elgg_echo('groups:none');
}
diff --git a/mod/groups/views/default/widgets/a_users_groups/edit.php b/mod/groups/views/default/widgets/a_users_groups/edit.php
index fa47cdd62..7465f4b70 100644
--- a/mod/groups/views/default/widgets/a_users_groups/edit.php
+++ b/mod/groups/views/default/widgets/a_users_groups/edit.php
@@ -1,14 +1,25 @@
+<?php
+/**
+ * Elgg group widget edit view
+ *
+ * @package ElggGroups
+ */
+
+
+// set default value
+if (!isset($vars['entity']->num_display)) {
+ $vars['entity']->num_display = 4;
+}
+
+$params = array(
+ 'internalname' => 'params[num_display]',
+ 'value' => $vars['entity']->num_display,
+ 'options' => array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 15, 20),
+);
+$dropdown = elgg_view('input/pulldown', $params);
+
+?>
<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
+ <?php echo elgg_echo('groups:widget:num_display'); ?>:
+ <?php echo $dropdown; ?>
+</p>