diff options
| author | Cash Costello <cash.costello@gmail.com> | 2011-09-11 08:30:04 -0400 | 
|---|---|---|
| committer | Cash Costello <cash.costello@gmail.com> | 2011-09-11 08:30:04 -0400 | 
| commit | d2e9a0c7fae9d0c57dd8646aa6ef277f2e14b7fe (patch) | |
| tree | 2292decee3ec49ec76e8b62066c4d2562339ec9e /mod/dashboard/views/default/widgets/group_activity/content.php | |
| parent | d3b4548a57668ffef7c02b9bc3b84e69a0a5eb8b (diff) | |
| download | elgg-d2e9a0c7fae9d0c57dd8646aa6ef277f2e14b7fe.tar.gz elgg-d2e9a0c7fae9d0c57dd8646aa6ef277f2e14b7fe.tar.bz2 | |
Fixes #3340 adds group activity widget for the user dashboard
Diffstat (limited to 'mod/dashboard/views/default/widgets/group_activity/content.php')
| -rw-r--r-- | mod/dashboard/views/default/widgets/group_activity/content.php | 36 | 
1 files changed, 36 insertions, 0 deletions
| diff --git a/mod/dashboard/views/default/widgets/group_activity/content.php b/mod/dashboard/views/default/widgets/group_activity/content.php new file mode 100644 index 000000000..60a9b352c --- /dev/null +++ b/mod/dashboard/views/default/widgets/group_activity/content.php @@ -0,0 +1,36 @@ +<?php +/** + * Group activity widget + */ + +$num = (int) $vars['entity']->num_display; +$guid = $vars['entity']->group_guid; + +$content = ''; + +if ($guid) { +	$title = get_entity($guid)->name; +	$content = "<h3>$title</h3>"; + +	elgg_push_context('widgets'); +	$db_prefix = elgg_get_config('dbprefix'); +	$activity = elgg_list_river(array( +		'limit' => $num, +		'pagination' => false, +		'joins' => array("JOIN {$db_prefix}entities e1 ON e1.guid = rv.object_guid"), +		'wheres' => array("(e1.container_guid = $guid)"), +	)); +	if (!$activity) { +		$activity = '<p>' . elgg_echo('dashboard:widget:group:noactivity') . '</p>'; +	} +	elgg_pop_context(); + +	$content .= $activity; +} else { +	// no group selected yet +	if ($vars['entity']->canEdit()) { +		$content = '<p>' . elgg_echo('dashboard:widget:group:noselect') . '</p>'; +	} +} + +echo $content; | 
