aboutsummaryrefslogtreecommitdiff
path: root/mod/groups
diff options
context:
space:
mode:
Diffstat (limited to 'mod/groups')
-rw-r--r--mod/groups/all.php5
-rw-r--r--mod/groups/languages/en.php4
-rw-r--r--mod/groups/views/default/group/default.php2
-rw-r--r--mod/groups/views/default/groups/css.php5
-rw-r--r--mod/groups/views/default/groups/grouplisting.php43
-rw-r--r--mod/groups/views/default/groups/sidebar/featured.php (renamed from mod/groups/views/default/groups/featured.php)15
-rw-r--r--mod/groups/views/default/groups/sidebar/find.php (renamed from mod/groups/views/default/groups/find.php)0
-rw-r--r--mod/groups/views/default/icon/group/default/large.php6
-rw-r--r--mod/groups/views/default/icon/group/default/medium.php6
-rw-r--r--mod/groups/views/default/icon/group/default/small.php6
-rw-r--r--mod/groups/views/default/icon/group/default/tiny.php6
-rw-r--r--mod/groups/views/default/object/groupforumtopic.php120
-rw-r--r--mod/groups/views/default/settings/groups/edit.php38
13 files changed, 112 insertions, 144 deletions
diff --git a/mod/groups/all.php b/mod/groups/all.php
index 909e02894..51030adc9 100644
--- a/mod/groups/all.php
+++ b/mod/groups/all.php
@@ -47,11 +47,10 @@ switch ($filter) {
$group_count = elgg_get_entities(array('types' => 'group', 'limit' => 10, 'count' => TRUE));
//find groups
-$area2 .= elgg_view("groups/find");
+$area2 .= elgg_view("groups/sidebar/find");
//featured groups
-$featured_groups = elgg_get_entities_from_metadata(array('metadata_name' => 'featured_group', 'metadata_value' => 'yes', 'types' => 'group', 'limit' => 10));
-$area2 .= elgg_view("groups/featured", array("featured" => $featured_groups));
+$area2 .= elgg_view("groups/sidebar/featured");
elgg_set_context($context);
diff --git a/mod/groups/languages/en.php b/mod/groups/languages/en.php
index 01dd8a231..f28bc0846 100644
--- a/mod/groups/languages/en.php
+++ b/mod/groups/languages/en.php
@@ -149,9 +149,9 @@ $english = array(
'groups:userinvited' => 'User has been invited.',
'groups:usernotinvited' => 'User could not be invited.',
'groups:useralreadyinvited' => 'User has already been invited',
- 'groups:updated' => "Last comment",
'groups:invite:subject' => "%s you have been invited to join %s!",
- 'groups:started' => "Started by",
+ 'groups:updated' => "Last comment by %s %s",
+ 'groups:started' => "Started by %s",
'groups:joinrequest:remove:check' => 'Are you sure you want to remove this join request?',
'groups:invite:remove:check' => 'Are you sure you want to remove this invite?',
'groups:invite:body' => "Hi %s,
diff --git a/mod/groups/views/default/group/default.php b/mod/groups/views/default/group/default.php
index bc3710888..568867da9 100644
--- a/mod/groups/views/default/group/default.php
+++ b/mod/groups/views/default/group/default.php
@@ -54,7 +54,7 @@ if (elgg_in_context('owner_block') || elgg_in_context('widgets')) {
if ($vars['full']) {
- echo elgg_view("groups/groupprofile",$vars);
+ echo elgg_view("groups/profile/profile_block", $vars);
} else {
// brief view
diff --git a/mod/groups/views/default/groups/css.php b/mod/groups/views/default/groups/css.php
index be4d152f8..5a7366fe3 100644
--- a/mod/groups/views/default/groups/css.php
+++ b/mod/groups/views/default/groups/css.php
@@ -34,6 +34,11 @@
font-size: 85%;
}
+.groups-latest-comment {
+ float: right;
+}
+
+
/* group listings */
.group_count {
float:right;
diff --git a/mod/groups/views/default/groups/grouplisting.php b/mod/groups/views/default/groups/grouplisting.php
deleted file mode 100644
index e7caa5f31..000000000
--- a/mod/groups/views/default/groups/grouplisting.php
+++ /dev/null
@@ -1,43 +0,0 @@
-<?php
-/**
- * Elgg user display (small)
- *
- * @package ElggGroups
- *
- * @uses $vars['entity'] The user entity
- */
-
-$icon = elgg_view(
- "groups/icon", array(
- 'entity' => $vars['entity'],
- 'size' => 'tiny',
-));
-
-//get the membership type
-$membership = $vars['entity']->membership;
-if($membership == ACCESS_PUBLIC) {
- $mem = elgg_echo("groups:open");
-} else {
- $mem = elgg_echo("groups:closed");
-}
-
-$info .= "<p class='entity-subtext groups'>" . $mem . " / <b>" . get_group_members($vars['entity']->guid, 10, 0, 0, true) ."</b> " . elgg_echo("groups:member");
-
-//for admins only - display the feature or unfeature option
-if(isadminloggedin()) {
- if($vars['entity']->featured_group == "yes"){
- $url = elgg_add_action_tokens_to_url(elgg_get_site_url() . "action/groups/featured?group_guid=" . $vars['entity']->guid . "&action_type=unfeature");
- $wording = elgg_echo("groups:makeunfeatured");
- }else{
- $url = elgg_add_action_tokens_to_url(elgg_get_site_url() . "action/groups/featured?group_guid=" . $vars['entity']->guid . "&action_type=feature");
- $wording = elgg_echo("groups:makefeatured");
- }
- // display 'make featured' option
- $info .= "<br /><a href=\"{$url}\">{$wording}</a>";
-}
-
-$info .= "</p>";
-$info .= "<p class='entity-title'><a href=\"" . $vars['entity']->getUrl() . "\">" . $vars['entity']->name . "</a></p>";
-$info .= "<p class='entity-subtext'>" . $vars['entity']->briefdescription . "</p>";
-
-echo elgg_view_image_block($icon, $info);
diff --git a/mod/groups/views/default/groups/featured.php b/mod/groups/views/default/groups/sidebar/featured.php
index ef2be5885..47cb7f2ab 100644
--- a/mod/groups/views/default/groups/featured.php
+++ b/mod/groups/views/default/groups/sidebar/featured.php
@@ -2,16 +2,21 @@
/**
* Featured groups
*
- * @uses $vars['featured']
- *
* @package ElggGroups
*/
-
-if ($vars['featured']) {
+
+$featured_groups = elgg_get_entities_from_metadata(array(
+ 'metadata_name' => 'featured_group',
+ 'metadata_value' => 'yes',
+ 'types' => 'group',
+ 'limit' => 10,
+));
+
+if ($featured_groups) {
elgg_push_context('widgets');
$body = '';
- foreach ($vars['featured'] as $group) {
+ foreach ($featured_groups as $group) {
$body .= elgg_view_entity($group, false);
}
elgg_pop_context();
diff --git a/mod/groups/views/default/groups/find.php b/mod/groups/views/default/groups/sidebar/find.php
index c0c135be2..c0c135be2 100644
--- a/mod/groups/views/default/groups/find.php
+++ b/mod/groups/views/default/groups/sidebar/find.php
diff --git a/mod/groups/views/default/icon/group/default/large.php b/mod/groups/views/default/icon/group/default/large.php
index e5e30ac3e..4bad6255a 100644
--- a/mod/groups/views/default/icon/group/default/large.php
+++ b/mod/groups/views/default/icon/group/default/large.php
@@ -1,3 +1,5 @@
<?php
- echo elgg_get_site_url() . "mod/groups/graphics/defaultlarge.gif";
-?> \ No newline at end of file
+/**
+ * Large default group icon
+ */
+echo elgg_get_site_url() . "mod/groups/graphics/defaultlarge.gif";
diff --git a/mod/groups/views/default/icon/group/default/medium.php b/mod/groups/views/default/icon/group/default/medium.php
index f7bd9376d..769357286 100644
--- a/mod/groups/views/default/icon/group/default/medium.php
+++ b/mod/groups/views/default/icon/group/default/medium.php
@@ -1,3 +1,5 @@
<?php
- echo elgg_get_site_url() . "mod/groups/graphics/defaultmedium.gif";
-?> \ No newline at end of file
+/**
+ * Medium default group icon
+ */
+echo elgg_get_site_url() . "mod/groups/graphics/defaultmedium.gif";
diff --git a/mod/groups/views/default/icon/group/default/small.php b/mod/groups/views/default/icon/group/default/small.php
index 2a0ef7d93..0ff91f4c8 100644
--- a/mod/groups/views/default/icon/group/default/small.php
+++ b/mod/groups/views/default/icon/group/default/small.php
@@ -1,3 +1,5 @@
<?php
- echo elgg_get_site_url() . "mod/groups/graphics/defaultsmall.gif";
-?> \ No newline at end of file
+/**
+ * Small default group icon
+ */
+echo elgg_get_site_url() . "mod/groups/graphics/defaultsmall.gif";
diff --git a/mod/groups/views/default/icon/group/default/tiny.php b/mod/groups/views/default/icon/group/default/tiny.php
index 2920da6b6..c16fe4a24 100644
--- a/mod/groups/views/default/icon/group/default/tiny.php
+++ b/mod/groups/views/default/icon/group/default/tiny.php
@@ -1,3 +1,5 @@
<?php
- echo elgg_get_site_url() . "mod/groups/graphics/defaulttiny.gif";
-?> \ No newline at end of file
+/**
+ * Tiny default group icon
+ */
+echo elgg_get_site_url() . "mod/groups/graphics/defaulttiny.gif";
diff --git a/mod/groups/views/default/object/groupforumtopic.php b/mod/groups/views/default/object/groupforumtopic.php
index 551e256db..e569bff77 100644
--- a/mod/groups/views/default/object/groupforumtopic.php
+++ b/mod/groups/views/default/object/groupforumtopic.php
@@ -1,81 +1,71 @@
<?php
/**
- * Elgg Groups latest discussion listing
+ * Forum topic entity view
*
* @package ElggGroups
*/
-//get the required variables
-$title = htmlentities($vars['entity']->title, ENT_QUOTES, 'UTF-8');
-//$description = get_entity($vars['entity']->description);
-$topic_owner = get_user($vars['entity']->owner_guid);
-$group = get_entity($vars['entity']->container_guid);
-$forum_created = elgg_view_friendly_time($vars['entity']->time_created);
-$counter = $vars['entity']->countAnnotations("generic_comment");
-$last_post = $vars['entity']->getAnnotations("generic_comment", 1, 0, "desc");
-//get the time and user
-if ($last_post) {
- foreach($last_post as $last) {
- $last_time = $last->time_created;
- $last_user = $last->owner_guid;
- }
+//$full = elgg_get_array_value('full', $vars, FALSE);
+$topic = elgg_get_array_value('entity', $vars, FALSE);
+
+if (!$topic) {
+ return true;
}
-$u = get_user($last_user);
+$poster = $topic->getOwnerEntity();
+$group = $topic->getContainerEntity();
+$excerpt = elgg_get_excerpt($topic->description);
-//select the correct output depending on where you are
-if (elgg_get_context() == "search") {
- var_export($counter);
- if($counter == 1){
- $info = "<p class='entity-subtext groups'>" . elgg_echo('groups:forum:created:single', array($forum_created, $counter)) . "<br />";
- }else{
- $info = "<p class='entity-subtext groups'>" . elgg_echo('groups:forum:created', array($forum_created, $counter)) . "<br />";
- }
- if (($last_time) && ($u)) $info.= elgg_echo('groups:lastupdated', array(elgg_view_friendly_time($last_time), " <a href=\"" . $u->getURL() . "\">" . $u->name . "</a>"));
- $info .= '</p>';
- //get the group avatar
- $icon = elgg_view("profile/icon",array('entity' => $u, 'size' => 'tiny'));
- //get the group and topic title
- $info .= "<p class='entity-subtext'><b>" . elgg_echo('groups:topic') . ":</b> <a href=\"".elgg_get_site_url()."mod/groups/topicposts.php?topic={$vars['entity']->guid}&group_guid={$group->guid}\">{$title}</a></p>";
- if ($group instanceof ElggGroup) {
- $info .= "<p class='entity-title'><b>" . elgg_echo('group') . ":</b> <a href=\"{$group->getURL()}\">".htmlentities($group->name, ENT_QUOTES, 'UTF-8') ."</a></p>";
- }
+$poster_icon = elgg_view('profile/icon', array('entity' => $poster, 'size' => 'tiny'));
+$poster_link = elgg_view('output/url', array(
+ 'href' => $poster->getURL(),
+ 'text' => $poster->name,
+));
+$poster_text = elgg_echo('groups:started', array($poster->name));
-} else {
- if($counter == 1){
- $info = "<p class='entity-subtext groups'>" . elgg_echo('groups:forum:created:single', array($forum_created, $counter)) . "</p>";
- }else{
- $info = "<p class='entity-subtext groups'>" . elgg_echo('groups:forum:created', array($forum_created, $counter)) . "</p>";
- }
- $info .= "<p class='entity-title'>" . elgg_echo('groups:started') . " " . $topic_owner->name . ": <a href=\"".elgg_get_site_url()."mod/groups/topicposts.php?topic={$vars['entity']->guid}&group_guid={$group->guid}\">{$title}</a></p>";
+$tags = elgg_view('output/tags', array('tags' => $topic->tags));
+$date = elgg_view_friendly_time($topic->time_created);
- if (groups_can_edit_discussion($vars['entity'], elgg_get_page_owner()->owner_guid)) {
- // display the delete link to those allowed to delete
- $info .= "<div class='entity-metadata'>";
- $info .= '<span class="entity-edit">' . elgg_view("output/url", array(
- 'href' => "mod/groups/edittopic.php?group={$vars['entity']->container_guid}&topic={$vars['entity']->guid}",
- 'text' => elgg_echo('edit'),
- ));
- $info .= '</span>';
+$comments_link = '';
+$comments_text = '';
+$num_comments = elgg_count_comments($topic);
+if ($num_comments != 0) {
+ $last_comment = $topic->getAnnotations("generic_comment", 1, 0, "desc");
+ $commenter = $last_comment[0]->getOwnerEntity();
+ $comment_time = elgg_view_friendly_time($last_comment[0]->time_created);
+ $comments_text = elgg_echo('groups:updated', array($commenter->name, $comment_time));
+
+ $comments_link = elgg_view('output/url', array(
+ 'href' => $topic->getURL() . '#topic-comments',
+ 'text' => elgg_echo("comments") . " ($num_comments)",
+ ));
+}
- // display the delete link to those allowed to delete
- $info .= '<span class="delete-button">' . elgg_view("output/confirmlink", array(
- 'href' => "action/groups/deletetopic?topic=" . $vars['entity']->guid . "&group=" . $vars['entity']->container_guid,
- 'text' => elgg_echo('delete'),
- 'confirm' => elgg_echo('deleteconfirm'),
- ));
- $info .= "</span></div>";
+$metadata = elgg_view('layout/objects/list/metadata', array(
+ 'entity' => $topic,
+ 'handler' => 'forum',
+));
-}
+$subtitle = "$poster_text $date $comments_link <span class=\"groups-latest-comment\">$comments_text</span>";
- if (($last_time) && ($u)) {
- $commenter_link = "<a href\"{$u->getURL()}\">$u->name</a>";
- $text = elgg_echo('groups:lastcomment', array(elgg_view_friendly_time($last_time), $commenter_link));
- $info .= "<p class='entity-subtext'>$text</p>";
- }
- //get the user avatar
- $icon = elgg_view("profile/icon",array('entity' => $topic_owner, 'size' => 'tiny'));
+// do not show the metadata and controls in widget view
+if (elgg_in_context('widgets')) {
+ $metadata = '';
}
-//display
-echo elgg_view_listing($icon, $info); \ No newline at end of file
+if ($full) {
+
+} else {
+ // brief view
+
+ $params = array(
+ 'entity' => $topic,
+ 'metadata' => $metadata,
+ 'subtitle' => $subtitle,
+ 'tags' => $tags,
+ 'content' => $excerpt,
+ );
+ $list_body = elgg_view('layout/objects/list/body', $params);
+
+ echo elgg_view_image_block($poster_icon, $list_body);
+}
diff --git a/mod/groups/views/default/settings/groups/edit.php b/mod/groups/views/default/settings/groups/edit.php
index 311e58dee..25feed3aa 100644
--- a/mod/groups/views/default/settings/groups/edit.php
+++ b/mod/groups/views/default/settings/groups/edit.php
@@ -1,18 +1,22 @@
<?php
- $hidden_groups = $vars['entity']->hidden_groups;
- if (!$hidden_groups) $hidden_groups = 'no';
-?>
-<p>
- <?php echo elgg_echo('groups:allowhiddengroups'); ?>
-
- <?php
- echo elgg_view('input/pulldown', array(
- 'internalname' => 'params[hidden_groups]',
- 'options_values' => array(
- 'no' => elgg_echo('option:no'),
- 'yes' => elgg_echo('option:yes')
- ),
- 'value' => $hidden_groups
- ));
- ?>
-</p> \ No newline at end of file
+/**
+ * Groups plugin settings
+ */
+
+// set default value
+if (!isset($vars['entity']->hidden_groups)) {
+ $vars['entity']->hidden_groups = 'no';
+}
+
+echo '<p>';
+echo elgg_echo('groups:allowhiddengroups');
+echo ' ';
+echo elgg_view('input/pulldown', array(
+ 'internalname' => 'params[hidden_groups]',
+ 'options_values' => array(
+ 'no' => elgg_echo('option:no'),
+ 'yes' => elgg_echo('option:yes')
+ ),
+ 'value' => $vars['entity']->hidden_groups,
+));
+echo '</p>';