aboutsummaryrefslogtreecommitdiff
path: root/mod/groups/views
diff options
context:
space:
mode:
authorBrett Profitt <brett.profitt@gmail.com>2011-08-25 10:00:38 -0700
committerBrett Profitt <brett.profitt@gmail.com>2011-08-25 10:00:38 -0700
commitdccc333c765bb28da55b4a55d9c916acdb88413a (patch)
treebdd26a0b4cd85241a19b7fcb2c0770f0ac3eb9f0 /mod/groups/views
parentec7b94a64aef23b85866ecdac8e8acc712d29bb6 (diff)
parent003cb81c7888f4d2fd763e5814027c6f8d71186f (diff)
downloadelgg-dccc333c765bb28da55b4a55d9c916acdb88413a.tar.gz
elgg-dccc333c765bb28da55b4a55d9c916acdb88413a.tar.bz2
Merge branch 'master' of github.com:brettp/Elgg
Diffstat (limited to 'mod/groups/views')
-rw-r--r--mod/groups/views/default/annotation/group_topic_post.php17
-rw-r--r--mod/groups/views/default/discussion/group_module.php22
-rw-r--r--mod/groups/views/default/forms/discussion/reply/save.php46
-rw-r--r--mod/groups/views/default/forms/discussion/save.php2
-rw-r--r--mod/groups/views/default/forms/groups/edit.php2
-rw-r--r--mod/groups/views/default/forms/groups/invite.php2
-rw-r--r--mod/groups/views/default/group/default.php1
-rw-r--r--mod/groups/views/default/groups/css.php11
-rw-r--r--mod/groups/views/default/groups/edit.php5
-rw-r--r--mod/groups/views/default/groups/js.php3
-rw-r--r--mod/groups/views/default/groups/profile/activity_module.php11
-rw-r--r--mod/groups/views/default/groups/profile/buttons.php57
-rw-r--r--mod/groups/views/default/groups/profile/module.php25
-rw-r--r--mod/groups/views/default/groups/profile/widgets.php13
-rw-r--r--mod/groups/views/default/groups/sidebar/featured.php2
-rw-r--r--mod/groups/views/default/groups/sidebar/members.php3
-rw-r--r--mod/groups/views/default/object/groupforumtopic.php2
-rw-r--r--mod/groups/views/default/river/annotation/group_topic_post/reply.php25
-rw-r--r--mod/groups/views/default/river/group/create.php20
-rw-r--r--mod/groups/views/default/river/object/groupforumtopic/create.php38
-rw-r--r--mod/groups/views/default/river/relationship/member/create.php14
21 files changed, 144 insertions, 177 deletions
diff --git a/mod/groups/views/default/annotation/group_topic_post.php b/mod/groups/views/default/annotation/group_topic_post.php
index d2303aba8..f38d2a77a 100644
--- a/mod/groups/views/default/annotation/group_topic_post.php
+++ b/mod/groups/views/default/annotation/group_topic_post.php
@@ -1,8 +1,19 @@
<?php
-/**
- * Discussion reply
+/*
+ * Embeds an edit link for the annotation
*/
-$vars['delete_action'] = 'action/discussion/reply/delete';
+$annotation = elgg_extract('annotation', $vars);
echo elgg_view('annotation/default', $vars);
+
+if ($annotation->canEdit()) {
+ $form = elgg_view_form('discussion/reply/save', array(), array_merge(array(
+ 'entity' => get_entity($annotation->entity_guid),
+ 'annotation' => $annotation
+ ), $vars)
+ );
+
+ echo "<div class=\"hidden mbm\" id=\"edit-annotation-$annotation->id\">$form</div>";
+}
+
diff --git a/mod/groups/views/default/discussion/group_module.php b/mod/groups/views/default/discussion/group_module.php
index 165d9b1be..3a46e336e 100644
--- a/mod/groups/views/default/discussion/group_module.php
+++ b/mod/groups/views/default/discussion/group_module.php
@@ -17,10 +17,6 @@ $all_link = elgg_view('output/url', array(
'text' => elgg_echo('link:view:all'),
));
-$header = "<span class=\"groups-widget-viewall\">$all_link</span>";
-$header .= '<h3>' . elgg_echo('discussion:group') . '</h3>';
-
-
elgg_push_context('widgets');
$options = array(
'type' => 'object',
@@ -37,12 +33,14 @@ if (!$content) {
$content = '<p>' . elgg_echo('grouptopic:notcreated') . '</p>';
}
-if ($group->canWriteToContainer()) {
- $new_link = elgg_view('output/url', array(
- 'href' => "discussion/add/" . $group->getGUID(),
- 'text' => elgg_echo('groups:addtopic'),
- ));
- $content .= "<span class='elgg-widget-more'>$new_link</span>";
-}
+$new_link = elgg_view('output/url', array(
+ 'href' => "discussion/add/" . $group->getGUID(),
+ 'text' => elgg_echo('groups:addtopic'),
+));
-echo elgg_view_module('info', '', $content, array('header' => $header));
+echo elgg_view('groups/profile/module', array(
+ 'title' => elgg_echo('discussion:group'),
+ 'content' => $content,
+ 'all_link' => $all_link,
+ 'add_link' => $new_link,
+)); \ No newline at end of file
diff --git a/mod/groups/views/default/forms/discussion/reply/save.php b/mod/groups/views/default/forms/discussion/reply/save.php
index be258b8fe..083fefb78 100644
--- a/mod/groups/views/default/forms/discussion/reply/save.php
+++ b/mod/groups/views/default/forms/discussion/reply/save.php
@@ -1,29 +1,57 @@
<?php
/**
- * Discussion topic reply form bofy
+ * Discussion topic reply form body
*
* @uses $vars['entity'] A discussion topic object
* @uses $vars['inline'] Display a shortened form?
*/
-
if (isset($vars['entity']) && elgg_is_logged_in()) {
+ echo elgg_view('input/hidden', array(
+ 'name' => 'entity_guid',
+ 'value' => $vars['entity']->getGUID(),
+ ));
+
$inline = elgg_extract('inline', $vars, false);
+ $annotation = elgg_extract('annotation', $vars);
+
+ $value = '';
+
+ if ($annotation) {
+ $value = $annotation->value;
+ echo elgg_view('input/hidden', array(
+ 'name' => 'annotation_id',
+ 'value' => $annotation->id
+ ));
+ }
+
if ($inline) {
- echo elgg_view('input/text', array('name' => 'group_topic_post'));
+ echo elgg_view('input/text', array('name' => 'group_topic_post', 'value' => $value));
echo elgg_view('input/submit', array('value' => elgg_echo('reply')));
} else {
?>
<div>
- <label><?php echo elgg_echo("reply"); ?></label>
- <?php echo elgg_view('input/longtext', array('name' => 'group_topic_post')); ?>
+ <label>
+ <?php
+ if ($annotation) {
+ echo elgg_echo('edit');
+ } else {
+ echo elgg_echo("reply");
+ }
+ ?>
+ </label>
+ <?php echo elgg_view('input/longtext', array('name' => 'group_topic_post', 'value' => $value)); ?>
</div>
+ <div class="elgg-foot">
<?php
+ if ($annotation) {
+ echo elgg_view('input/submit', array('value' => elgg_echo('save')));
+ } else {
echo elgg_view('input/submit', array('value' => elgg_echo('reply')));
}
- echo elgg_view('input/hidden', array(
- 'name' => 'entity_guid',
- 'value' => $vars['entity']->getGUID(),
- ));
+?>
+ </div>
+<?php
+ }
}
diff --git a/mod/groups/views/default/forms/discussion/save.php b/mod/groups/views/default/forms/discussion/save.php
index 5d50d5c91..a6582ede7 100644
--- a/mod/groups/views/default/forms/discussion/save.php
+++ b/mod/groups/views/default/forms/discussion/save.php
@@ -42,7 +42,7 @@ $guid = elgg_extract('guid', $vars, null);
<label><?php echo elgg_echo('access'); ?></label><br />
<?php echo elgg_view('input/access', array('name' => 'access_id', 'value' => $access_id)); ?>
</div>
-<div>
+<div class="elgg-foot">
<?php
echo elgg_view('input/hidden', array('name' => 'container_guid', 'value' => $container_guid));
diff --git a/mod/groups/views/default/forms/groups/edit.php b/mod/groups/views/default/forms/groups/edit.php
index b67134c63..26436ef01 100644
--- a/mod/groups/views/default/forms/groups/edit.php
+++ b/mod/groups/views/default/forms/groups/edit.php
@@ -126,7 +126,7 @@ if ($tools) {
}
}
?>
-<div class="elgg-form-footer-alt">
+<div class="elgg-foot">
<?php
if (isset($vars['entity'])) {
diff --git a/mod/groups/views/default/forms/groups/invite.php b/mod/groups/views/default/forms/groups/invite.php
index 83139c2ee..ef3131782 100644
--- a/mod/groups/views/default/forms/groups/invite.php
+++ b/mod/groups/views/default/forms/groups/invite.php
@@ -12,7 +12,7 @@ $friends = elgg_get_logged_in_user_entity()->getFriends('', 0);
if ($friends) {
echo elgg_view('input/friendspicker', array('entities' => $friends, 'name' => 'user_guid', 'highlight' => 'all'));
- echo '<div class="elgg-form-footer">';
+ echo '<div class="elgg-foot">';
echo elgg_view('input/hidden', array('name' => 'forward_url', 'value' => $forward_url));
echo elgg_view('input/hidden', array('name' => 'group_guid', 'value' => $group->guid));
echo elgg_view('input/submit', array('value' => elgg_echo('invite')));
diff --git a/mod/groups/views/default/group/default.php b/mod/groups/views/default/group/default.php
index 2aa377813..fc91f90d0 100644
--- a/mod/groups/views/default/group/default.php
+++ b/mod/groups/views/default/group/default.php
@@ -31,6 +31,7 @@ if ($vars['full_view']) {
'metadata' => $metadata,
'subtitle' => $group->briefdescription,
);
+ $params = $params + $vars;
$list_body = elgg_view('group/elements/summary', $params);
echo elgg_view_image_block($icon, $list_body);
diff --git a/mod/groups/views/default/groups/css.php b/mod/groups/views/default/groups/css.php
index 37fc5dc10..9c65d1602 100644
--- a/mod/groups/views/default/groups/css.php
+++ b/mod/groups/views/default/groups/css.php
@@ -36,15 +36,14 @@
margin: 0;
}
-#groups-tools > .elgg-module {
- float: left;
- margin-bottom: 40px;
+#groups-tools > li {
+ width: 48%;
min-height: 200px;
- width: 350px;
+ margin-bottom: 40px;
}
-#groups-tools > .elgg-module:nth-child(odd) {
- margin-right: 30px;
+#groups-tools > li:nth-child(odd) {
+ margin-right: 4%;
}
.groups-widget-viewall {
diff --git a/mod/groups/views/default/groups/edit.php b/mod/groups/views/default/groups/edit.php
index 5076cc49a..24a1c3f1e 100644
--- a/mod/groups/views/default/groups/edit.php
+++ b/mod/groups/views/default/groups/edit.php
@@ -7,6 +7,9 @@
$entity = elgg_extract('entity', $vars, null);
-$form_vars = array('enctype' => 'multipart/form-data');
+$form_vars = array(
+ 'enctype' => 'multipart/form-data',
+ 'class' => 'elgg-form-alt',
+);
$body_vars = array('entity' => $entity);
echo elgg_view_form('groups/edit', $form_vars, $body_vars);
diff --git a/mod/groups/views/default/groups/js.php b/mod/groups/views/default/groups/js.php
index dec31cf54..ad742445b 100644
--- a/mod/groups/views/default/groups/js.php
+++ b/mod/groups/views/default/groups/js.php
@@ -1,4 +1,5 @@
$(function() {
- $('#groups-tools').find('.elgg-module:odd').addClass('odd');
+ // jQuery uses 0-based indexing
+ $('#groups-tools').children('li:even').addClass('odd');
});
diff --git a/mod/groups/views/default/groups/profile/activity_module.php b/mod/groups/views/default/groups/profile/activity_module.php
index 4ea97cad6..5e557b443 100644
--- a/mod/groups/views/default/groups/profile/activity_module.php
+++ b/mod/groups/views/default/groups/profile/activity_module.php
@@ -21,16 +21,13 @@ $all_link = elgg_view('output/url', array(
'text' => elgg_echo('link:view:all'),
));
-$header = "<span class=\"groups-widget-viewall\">$all_link</span>";
-$header .= '<h3>' . elgg_echo('groups:activity') . '</h3>';
-
elgg_push_context('widgets');
$db_prefix = elgg_get_config('dbprefix');
$content = elgg_list_river(array(
'limit' => 4,
'pagination' => false,
- 'joins' => array("join {$db_prefix}entities e1 on e1.guid = rv.object_guid"),
+ 'joins' => array("JOIN {$db_prefix}entities e1 ON e1.guid = rv.object_guid"),
'wheres' => array("(e1.container_guid = $group->guid)"),
));
elgg_pop_context();
@@ -39,4 +36,8 @@ if (!$content) {
$content = '<p>' . elgg_echo('groups:activity:none') . '</p>';
}
-echo elgg_view_module('info', '', $content, array('header' => $header));
+echo elgg_view('groups/profile/module', array(
+ 'title' => elgg_echo('groups:activity'),
+ 'content' => $content,
+ 'all_link' => $all_link,
+));
diff --git a/mod/groups/views/default/groups/profile/buttons.php b/mod/groups/views/default/groups/profile/buttons.php
deleted file mode 100644
index 55e99f59c..000000000
--- a/mod/groups/views/default/groups/profile/buttons.php
+++ /dev/null
@@ -1,57 +0,0 @@
-<?php
-/**
- * Content header action buttons
- *
- * @uses $vars['entity']
- *
- * @todo This should be done by registering menu items with the page actions menu
- */
-
-if (!elgg_is_logged_in()) {
- return true;
-}
-
-
-$actions = array();
-
-// group owners
-if ($vars['entity']->canEdit()) {
- // edit and invite
- $url = elgg_get_site_url() . "groups/edit/{$vars['entity']->getGUID()}";
- $actions[$url] = elgg_echo('groups:edit');
- $url = elgg_get_site_url() . "groups/invite/{$vars['entity']->getGUID()}";
- $actions[$url] = elgg_echo('groups:invite');
-}
-
-// group members
-if ($vars['entity']->isMember($user)) {
- // leave
- $url = elgg_get_site_url() . "action/groups/leave?group_guid={$vars['entity']->getGUID()}";
- $url = elgg_add_action_tokens_to_url($url);
- $actions[$url] = elgg_echo('groups:leave');
-} else {
- // join - admins can always join.
- $url = elgg_get_site_url() . "action/groups/join?group_guid={$vars['entity']->getGUID()}";
- $url = elgg_add_action_tokens_to_url($url);
- if ($vars['entity']->isPublicMembership() || $vars['entity']->canEdit()) {
- $actions[$url] = elgg_echo('groups:join');
- } else {
- // request membership
- $actions[$url] = elgg_echo('groups:joinrequest');
- }
-}
-
-// display action buttons
-if ($actions) {
- echo '<ul class="elgg-menu elgg-menu-title elgg-menu-hz">';
- foreach ($actions as $url => $action) {
- echo '<li>';
- echo elgg_view('output/url', array(
- 'text' => $action,
- 'href' => $url,
- 'class' => 'elgg-button elgg-button-action',
- ));
- echo '</li>';
- }
- echo '</ul>';
-}
diff --git a/mod/groups/views/default/groups/profile/module.php b/mod/groups/views/default/groups/profile/module.php
new file mode 100644
index 000000000..9d0b18266
--- /dev/null
+++ b/mod/groups/views/default/groups/profile/module.php
@@ -0,0 +1,25 @@
+<?php
+/**
+ * Group module (also called a group widget)
+ *
+ * @uses $vars['title'] The title of the module
+ * @uses $vars['content'] The module content
+ * @uses $vars['all_link'] A link to list content
+ * @uses $vars['add_link'] A link to create content
+ */
+
+$group = elgg_get_page_owner_entity();
+
+$header = "<span class=\"groups-widget-viewall\">{$vars['all_link']}</span>";
+$header .= '<h3>' . $vars['title'] . '</h3>';
+
+if ($group->canWriteToContainer() && isset($vars['add_link'])) {
+ $vars['content'] .= "<span class='elgg-widget-more'>{$vars['add_link']}</span>";
+}
+
+echo '<li>';
+echo elgg_view_module('info', '', $vars['content'], array(
+ 'header' => $header,
+ 'class' => 'elgg-module-group',
+));
+echo '</li>';
diff --git a/mod/groups/views/default/groups/profile/widgets.php b/mod/groups/views/default/groups/profile/widgets.php
index 28e43fdc4..caf019a3a 100644
--- a/mod/groups/views/default/groups/profile/widgets.php
+++ b/mod/groups/views/default/groups/profile/widgets.php
@@ -6,10 +6,19 @@
*/
// tools widget area
-echo '<div id="groups-tools" class="mtl clearfix">';
+echo '<div id="groups-tools" class="elgg-gallery elgg-gallery-fluid mtl clearfix">';
// enable tools to extend this area
-echo elgg_view("groups/tool_latest", array('entity' => $vars['entity']));
+echo elgg_view("groups/tool_latest", $vars);
+
+// backward compatibility
+$right = elgg_view('groups/right_column', $vars);
+$left = elgg_view('groups/left_column', $vars);
+if ($right || $left) {
+ elgg_deprecated_notice('The views groups/right_column and groups/left_column have been replaced by groups/tool_latest', 1.8);
+ echo $left;
+ echo $right;
+}
echo "</div>";
diff --git a/mod/groups/views/default/groups/sidebar/featured.php b/mod/groups/views/default/groups/sidebar/featured.php
index 695782783..8bd51ab5c 100644
--- a/mod/groups/views/default/groups/sidebar/featured.php
+++ b/mod/groups/views/default/groups/sidebar/featured.php
@@ -17,7 +17,7 @@ if ($featured_groups) {
elgg_push_context('widgets');
$body = '';
foreach ($featured_groups as $group) {
- $body .= elgg_view_entity($group, false);
+ $body .= elgg_view_entity($group, array('full_view' => false));
}
elgg_pop_context();
diff --git a/mod/groups/views/default/groups/sidebar/members.php b/mod/groups/views/default/groups/sidebar/members.php
index 28111554f..7249ffbf4 100644
--- a/mod/groups/views/default/groups/sidebar/members.php
+++ b/mod/groups/views/default/groups/sidebar/members.php
@@ -21,7 +21,8 @@ $body = elgg_list_entities_from_relationship(array(
'inverse_relationship' => true,
'types' => 'user',
'limit' => $limit,
- 'gallery' => true,
+ 'list_type' => 'gallery',
+ 'gallery_class' => 'elgg-gallery-users',
));
$body .= "<div class='center mts'>$all_link</div>";
diff --git a/mod/groups/views/default/object/groupforumtopic.php b/mod/groups/views/default/object/groupforumtopic.php
index 3a4decbe4..22589b84d 100644
--- a/mod/groups/views/default/object/groupforumtopic.php
+++ b/mod/groups/views/default/object/groupforumtopic.php
@@ -67,6 +67,7 @@ if ($full) {
'subtitle' => $subtitle,
'tags' => $tags,
);
+ $params = $params + $vars;
$list_body = elgg_view('object/elements/summary', $params);
$info = elgg_view_image_block($poster_icon, $list_body);
@@ -90,6 +91,7 @@ HTML;
'tags' => $tags,
'content' => $excerpt,
);
+ $params = $params + $vars;
$list_body = elgg_view('object/elements/summary', $params);
echo elgg_view_image_block($poster_icon, $list_body);
diff --git a/mod/groups/views/default/river/annotation/group_topic_post/reply.php b/mod/groups/views/default/river/annotation/group_topic_post/reply.php
index 1999c8dd9..cc94fbd43 100644
--- a/mod/groups/views/default/river/annotation/group_topic_post/reply.php
+++ b/mod/groups/views/default/river/annotation/group_topic_post/reply.php
@@ -4,24 +4,9 @@
*/
$object = $vars['item']->getObjectEntity();
$reply = $vars['item']->getAnnotation();
+$excerpt = elgg_get_excerpt($reply->value);
-$url = $object->getURL();
-$title = $object->title;
-$params = array(
- 'href' => $object->getURL(),
- 'text' => $title,
-);
-$object_link = elgg_view('output/url', $params);
-
-$type = $object->getType();
-$subtype = $object->getSubtype();
-
-echo elgg_echo('groups:river:reply') . ' ';
-echo $object_link;
-
-if ($reply) {
- $excerpt = elgg_get_excerpt($reply->value);
- echo '<div class="elgg-river-content">';
- echo $excerpt;
- echo '</div>';
-}
+echo elgg_view('river/item', array(
+ 'item' => $vars['item'],
+ 'message' => $excerpt,
+)); \ No newline at end of file
diff --git a/mod/groups/views/default/river/group/create.php b/mod/groups/views/default/river/group/create.php
index a70f8b51d..cacb5ad3f 100644
--- a/mod/groups/views/default/river/group/create.php
+++ b/mod/groups/views/default/river/group/create.php
@@ -7,19 +7,7 @@ $object = $vars['item']->getObjectEntity();
$excerpt = strip_tags($object->description);
$excerpt = elgg_get_excerpt($excerpt);
-$params = array(
- 'href' => $object->getURL(),
- 'text' => $object->name,
-);
-$link = elgg_view('output/url', $params);
-
-
-echo elgg_echo('groups:river:create');
-
-echo " $link";
-
-if ($excerpt) {
- echo '<div class="elgg-river-content">';
- echo $excerpt;
- echo '</div>';
-}
+echo elgg_view('river/item', array(
+ 'item' => $vars['item'],
+ 'message' => $excerpt,
+)); \ No newline at end of file
diff --git a/mod/groups/views/default/river/object/groupforumtopic/create.php b/mod/groups/views/default/river/object/groupforumtopic/create.php
index 466196921..80e7b09aa 100644
--- a/mod/groups/views/default/river/object/groupforumtopic/create.php
+++ b/mod/groups/views/default/river/object/groupforumtopic/create.php
@@ -7,36 +7,16 @@ $object = $vars['item']->getObjectEntity();
$excerpt = strip_tags($object->description);
$excerpt = elgg_get_excerpt($excerpt);
-$params = array(
- 'href' => $object->getURL(),
- 'text' => $object->title,
-);
-$link = elgg_view('output/url', $params);
-
-$group_string = '';
-$container = $object->getContainerEntity();
-if ($container instanceof ElggGroup) {
- $params = array(
- 'href' => $container->getURL(),
- 'text' => $container->name,
- );
- $group_link = elgg_view('output/url', $params);
- $group_string = elgg_echo('river:ingroup', array($group_link));
-}
-
-echo elgg_echo('forumtopic:river:create');
-
-echo " $link $group_string";
-
-if ($excerpt) {
- echo '<div class="elgg-river-content">';
- echo $excerpt;
- echo '</div>';
-}
-
-if (elgg_is_logged_in() && $container->canWriteToContainer()) {
+$responses = '';
+if (elgg_is_logged_in() && $object->canAnnotate(0, 'group_topic_post')) {
// inline comment form
$form_vars = array('id' => "groups-reply-{$object->getGUID()}", 'class' => 'hidden');
$body_vars = array('entity' => $object, 'inline' => true);
- echo elgg_view_form('discussion/reply/save', $form_vars, $body_vars);
+ $responses = elgg_view_form('discussion/reply/save', $form_vars, $body_vars);
}
+
+echo elgg_view('river/item', array(
+ 'item' => $vars['item'],
+ 'message' => $excerpt,
+ 'responses' => $responses,
+));
diff --git a/mod/groups/views/default/river/relationship/member/create.php b/mod/groups/views/default/river/relationship/member/create.php
index 060826649..d1c4c3ed3 100644
--- a/mod/groups/views/default/river/relationship/member/create.php
+++ b/mod/groups/views/default/river/relationship/member/create.php
@@ -3,14 +3,6 @@
* Group join river view.
*/
-$object = $vars['item']->getObjectEntity();
-
-$params = array(
- 'href' => $object->getURL(),
- 'text' => $object->name,
-);
-$link = elgg_view('output/url', $params);
-
-echo elgg_echo('groups:river:join');
-
-echo " $link";
+echo elgg_view('river/item', array(
+ 'item' => $vars['item'],
+));