diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2014-03-15 14:42:50 -0300 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2014-03-15 14:42:50 -0300 |
commit | 36102a094de700ee339f6eaeffb8ab16ba4f2f3b (patch) | |
tree | 57676a64905ae0e112cc5d698a5f61b36a88c5b3 /views/default/groups/profile | |
download | elgg-36102a094de700ee339f6eaeffb8ab16ba4f2f3b.tar.gz elgg-36102a094de700ee339f6eaeffb8ab16ba4f2f3b.tar.bz2 |
Squashed 'mod/graphstats/' content from commit b5d0461
git-subtree-dir: mod/graphstats
git-subtree-split: b5d046138c5841d55b4497618d5678cb8027c245
Diffstat (limited to 'views/default/groups/profile')
-rw-r--r-- | views/default/groups/profile/activity_module.php | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/views/default/groups/profile/activity_module.php b/views/default/groups/profile/activity_module.php new file mode 100644 index 000000000..7829f8c70 --- /dev/null +++ b/views/default/groups/profile/activity_module.php @@ -0,0 +1,49 @@ +<?php +/** + * Groups latest activity + * + * @todo add people joining group to activity + * + * @package Groups + */ + +if ($vars['entity']->activity_enable == 'no') { + return true; +} + +$group = $vars['entity']; +if (!$group) { + return true; +} + +$all_link = elgg_view('output/url', array( + 'href' => "groups/activity/$group->guid", + 'text' => elgg_echo('link:view:all'), +)); + +$add_link = ' '.elgg_view('output/url', array( + 'href' => "graphs/group/$group->guid", + 'text' => elgg_echo('timeline'), +)); + + +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"), + 'wheres' => array("(e1.container_guid = $group->guid)"), +)); +elgg_pop_context(); + +if (!$content) { + $content = '<p>' . elgg_echo('groups:activity:none') . '</p>'; +} + +echo elgg_view('groups/profile/module', array( + 'title' => elgg_echo('groups:activity'), + 'content' => $content, + 'all_link' => $all_link, + 'add_link' => $add_link, +)); |