diff options
Diffstat (limited to 'mod/groups/views')
14 files changed, 76 insertions, 103 deletions
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/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/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/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..75c04c810 100644 --- a/mod/groups/views/default/groups/profile/widgets.php +++ b/mod/groups/views/default/groups/profile/widgets.php @@ -6,7 +6,7 @@ */ // 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'])); 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'], +)); |