aboutsummaryrefslogtreecommitdiff
path: root/views/default/widgets/event_calendar/view.php
blob: 12fff6d602fef2c39871ca88d732cb63099b74df (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
<?php

/**
 * Elgg event calendar widget
 *
 * @package event_calendar
 * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
 * @author Kevin Jardine <kevin@radagast.biz>
 * @copyright Radagast Solutions 2008
 * @link http://radagast.biz/
 *
 */

	// Load event calendar model
	require_once(dirname(dirname(dirname(dirname(dirname(__FILE__)))))."/models/model.php");

    //the number of events to display
	$num = (int) $vars['entity']->num_display;
	if (!$num)
		$num = 5;
		
    // Get the events

	$events = event_calendar_get_personal_events_for_user(page_owner(),$num);
		
	// If there are any events to view, view them
	if (is_array($events) && sizeof($events) > 0) {

		echo "<div id=\"widget_calendar\">";

		foreach($events as $event) {
			echo elgg_view("object/event_calendar",array('entity' => $event));
		}

		echo "</div>";
			
    }
	
?>