diff options
| author | Silvio Rhatto <rhatto@riseup.net> | 2014-03-17 12:00:58 -0300 | 
|---|---|---|
| committer | Silvio Rhatto <rhatto@riseup.net> | 2014-03-17 12:00:58 -0300 | 
| commit | 228d3697bcd0218605be2e28131574cc85293a2e (patch) | |
| tree | 6a59c627f6226bd2b3056b959acc9cc871eb1f8f /views/default/widgets/tasks/content.php | |
| download | elgg-228d3697bcd0218605be2e28131574cc85293a2e.tar.gz elgg-228d3697bcd0218605be2e28131574cc85293a2e.tar.bz2  | |
Squashed 'mod/tasks/' content from commit c9b1097
git-subtree-dir: mod/tasks
git-subtree-split: c9b1097ce081d6893f9c939146208559c089dc15
Diffstat (limited to 'views/default/widgets/tasks/content.php')
| -rw-r--r-- | views/default/widgets/tasks/content.php | 38 | 
1 files changed, 38 insertions, 0 deletions
diff --git a/views/default/widgets/tasks/content.php b/views/default/widgets/tasks/content.php new file mode 100644 index 000000000..bdc694653 --- /dev/null +++ b/views/default/widgets/tasks/content.php @@ -0,0 +1,38 @@ +<?php +/** + * Elgg tasks widget + * + * @package ElggTasks + */ + +elgg_load_library("elgg:tasks"); + +$num = (int) $vars['entity']->tasks_num; + +// We show active first +$options = array( +	'type' => 'object', +	'subtype' => 'task', +	'relationship_guid' => $vars['entity']->owner_guid, +	'relationship' => 'subscribes', +	'metadata_name' => 'status', +	'metadata_value' => array('assigned', 'active'), +	'limit' => $num, +	'full_view' => FALSE, +	'pagination' => FALSE, +); +$content = elgg_get_entities_from_relationship($options); + +echo elgg_view_entity_list($content, $options); + +if ($content) { +	$url = "tasks/owner/" . elgg_get_page_owner_entity()->username; +	$more_link = elgg_view('output/url', array( +		'href' => $url, +		'text' => elgg_echo('tasks:more'), +		'is_trusted' => true, +	)); +	echo "<span class=\"elgg-widget-more\">$more_link</span>"; +} else { +	echo elgg_echo('tasks:none'); +}  | 
