aboutsummaryrefslogtreecommitdiff
path: root/mod/riverdashboard/views/default/widgets/river_widget/view.php
blob: 0a8f23c4145f00f0e70525c49a8d7e872520aa6a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?php
	/**
	 * View the widget
	 * 
	 * @package ElggRiver
	 * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
	 * @author Curverider Ltd
	 * @copyright Curverider Ltd 2008-2009
	 * @link http://elgg.com/
	 */

	$owner = page_owner_entity();
	
	//get the type - mine or friends
	$type = $vars['entity']->content_type;
	if(!$type)
		$type = "mine";
		
	//based on type grab the correct content type
	if($type == "mine")
		$content_type = '';
	else
		$content_type = 'friend';
		
	//get the number of items to display
	$limit = $vars['entity']->num_display;
	if(!$limit)
		$limit = 4;
	
	//grab the river
	$river = elgg_view_river_items($owner->getGuid(), 0, $content_type, $content[0], $content[1], '', $limit,0,0,false);
	
	//display
	echo "<div class=\"contentWrapper\">";
	if($type != 'mine')
		echo "<h3>" . elgg_echo("Friends") . "</h3>";
	echo $river;
	echo "</div>";
	
?>